Exception monad type -> record

Exception monad type -> record

--- src/cats/monad/exception.cljc
+++ src/cats/monad/exception.cljc
@@ -79,7 +79,7 @@

 (declare context)

-(deftype Success [v]
+(defrecord Success [v]
   p/Contextual
   (-get-context [_] context)

@@ -93,22 +93,9 @@
   #?@(:cljs [cljs.core/IDeref
              (-deref [_] v)]
       :clj  [clojure.lang.IDeref
-             (deref [_] v)])
-
-  #?@(:clj
-      [Object
-       (equals [self other]
-         (if (instance? Success other)
-           (= v (.-v ^Success other))
-           false))]
-      :cljs
-      [cljs.core/IEquiv
-       (-equiv [_ other]
-         (if (instance? Success other)
-           (= v (.-v ^Success other))
-           false))]))
-
-(deftype Failure [e]
+             (deref [_] v)]))
+
+(defrecord Failure [e]
   p/Contextual
   (-get-context [_] context)

@@ -122,21 +109,7 @@
   #?@(:cljs [cljs.core/IDeref
              (-deref [_] (throw e))]
       :clj  [clojure.lang.IDeref
-             (deref [_] (throw e))])
-
-  #?@(:clj
-      [Object
-       (equals [self other]
-         (if (instance? Failure other)
-           (= e (.-e ^Failure other))
-           false))]
-
-      :cljs
-      [cljs.core/IEquiv
-       (-equiv [_ other]
-         (if (instance? Failure other)
-           (= e (.-e ^Failure other))
-           false))]))
+             (deref [_] (throw e))]))

 (alter-meta! #'->Success assoc :private true)
 (alter-meta! #'->Failure assoc :private true)


Fixing validation call

Fixing validation call

--- src/celestial/persistency.clj
+++ src/celestial/persistency.clj
@@ -158,8 +158,7 @@
   [task]
    (validate! ::non-valid-task
      (cond-> task
-       (task :capistrano) (-> cap-v second))))
-
+       (task :capistrano) cap-v)))

 (defn reset-admin
   "Resets admin password if non is defined"


changing some labels

changing some labels

--- citizen_cljs/rrm/citizen.cljs
+++ citizen_cljs/rrm/citizen.cljs
@@ -191,7 +191,7 @@
         onres (fn [json] (let [data (getdata json)]
                            (if (empty? (.-data data))
                              (do
-                               (set-key-value :message "The File is not available")
+                               (set-key-value :message "No Records to Display")
                                (set-key-value :mutations nil)
                                (set-key-value :total-pages (get-total-rec-no (.-pagesCount data)))
                                (r/render [render-mutations (get-value! :mutations)]  (.getElementById js/document "app1")))
@@ -218,11 +218,9 @@
        [:div.col-sm-2 "Mutation Number"
         [:input.form-control {:id "mutationnumber"
                               :type "text"
-                              :placeholder "Enter search by mutationnumber"}]]
+                              :placeholder "Enter search by mutationnumber"}]]]]

-       [:div.col-sm-6
-        [:b
-        [:h2 {:style  {:color "red"}} (str (:message @citizen-storage))]]]]]
+
      [:div.form-group
       [:div.row
        [:div.col-sm-2 "District Name"
@@ -255,10 +253,10 @@
         [:input.form-control {:id "snameofthesecondparty"
                               :type "text"
                               :placeholder "Name of the Second Party"}]]
-       [:div.col-sm-2 "Name Of P.O"
+       [:div.col-sm-2 "Name of P.O"
         [:input.form-control {:id "svillagename"
                               :list "combo"
-                              :placeholder "Name Of P.O"}[datalist]]]
+                              :placeholder "Name of P.O"}[datalist]]]
        [:div.col-sm-2 "Title"
         [:input.form-control {:id "stitle"
                               :type "text"
@@ -285,7 +283,7 @@
        [:tr
         [:th "Mutation Number"]
         [:th "Name of the First Party"]
-        [:th "Name of The Second Party"]
+        [:th "Name of the Second Party"]
         [:th "Date of Institution"]
         [:th "Name of P.O"]
         [:th "Name of District"]
@@ -314,7 +312,8 @@
                                    [:td (.-senddate mt)]
                                    [:td (.-receiveddate mt)]
                                    ]))]]
-     [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]]]])
+     [:div{:class "col-xs-6 col-centered col-max"} [shared-state 0]]
+     [:div [:b [:h2 {:style  {:color "red"}} (str (:message @citizen-storage))]]]]]])


Wrap the archive db operations in transactions

so they are rolled back in case there are exceptions

--- src/clj/mdr2/archive/core.clj
+++ src/clj/mdr2/archive/core.clj
@@ -32,6 +32,7 @@

   (:require [clojure.java.io :refer [file]]
             [clojure.tools.logging :as log]
+            [conman.core :as conman]
             [mdr2.config :refer [env]]
             [mdr2.db.core :as db]
             [java-time :as time]
@@ -123,7 +124,9 @@
   [production sektion]
   (let [archive-root-path (container-root-path production sektion)]
     (if (fs/exists? archive-root-path)
-      (log/errorf "Archive root path %s already exists" archive-root-path)
+      (let [message (format "Archive root path %s already exists" archive-root-path)]
+        (log/error message)
+        (throw (ex-info message {:error-id ::directory-already-exists})))
       (let [archive-path (container-path production sektion)]
         (fs/create-dirs archive-path)
         (log/debugf "Copying files for %s (%s)" (:id production) sektion)
@@ -166,62 +169,62 @@

 (defmethod archive "book"
   [production]
-;;  (transaction)
-  (archive-sektion production :master)
-  (archive-sektion production :dist-master)
-  (prod/set-state-archived! production))
+  (conman/with-transaction [db/*archive-db*]
+    (archive-sektion production :master)
+    (archive-sektion production :dist-master)
+    (prod/set-state-archived! production)))

 (defmethod archive "periodical"
   [production]
-;;  (transaction)
-  (archive-sektion production :master)
-  ;; archive the periodical iso(s)
-  (let [dam-number (prod/dam-number production)
-        archive-path (.getPath (file (env :archive-periodical-spool-dir) dam-number))
-        multi-volume? (prod/multi-volume? production)]
-    (when (fs/exists? archive-path)
-      ;; when repairing the production is already in the spool dir
-      (log/warnf "Archive path %s for periodical already exists, removing" archive-path)
-      (fs/delete-tree archive-path))
-    (fs/create-dirs archive-path)
-    ;; create the rdf
-    (let [rdf-path (file archive-path (str dam-number ".rdf"))
-          rdf (rdf/rdf production)]
-      (spit rdf-path rdf))
-    ;; copy all volumes
-    (doseq [volume (range 1 (inc (:volumes production)))]
-      (let [iso-archive-name (str dam-number (when multi-volume? (str "_" volume)) ".iso")
-            iso-archive-path (file archive-path "produkt" iso-archive-name)]
-        (fs/create-dirs (fs/parent iso-archive-path))
-        (fs/copy (path/iso-name production volume) iso-archive-path)))
-    (set-file-permissions (file archive-path))
-    (prod/set-state-archived! production)))
+  (conman/with-transaction [db/*archive-db*]
+    (archive-sektion production :master)
+    ;; archive the periodical iso(s)
+    (let [dam-number (prod/dam-number production)
+          archive-path (.getPath (file (env :archive-periodical-spool-dir) dam-number))
+          multi-volume? (prod/multi-volume? production)]
+      (when (fs/exists? archive-path)
+        ;; when repairing the production is already in the spool dir
+        (log/warnf "Archive path %s for periodical already exists, removing" archive-path)
+        (fs/delete-tree archive-path))
+      (fs/create-dirs archive-path)
+      ;; create the rdf
+      (let [rdf-path (file archive-path (str dam-number ".rdf"))
+            rdf (rdf/rdf production)]
+        (spit rdf-path rdf))
+      ;; copy all volumes
+      (doseq [volume (range 1 (inc (:volumes production)))]
+        (let [iso-archive-name (str dam-number (when multi-volume? (str "_" volume)) ".iso")
+              iso-archive-path (file archive-path "produkt" iso-archive-name)]
+          (fs/create-dirs (fs/parent iso-archive-path))
+          (fs/copy (path/iso-name production volume) iso-archive-path)))
+      (set-file-permissions (file archive-path))
+      (prod/set-state-archived! production))))

 (defmethod archive "other"
   [production]
-;;  (transaction)
-  (archive-sektion production :master)
-  ;; place the iso(s) in a spool directory
-  (let [dam-number (prod/dam-number production)
-        archive-path (.getPath (file (env :archive-other-spool-dir) dam-number))
-        multi-volume? (prod/multi-volume? production)]
-    (when (fs/exists? archive-path)
-      ;; when repairing the production is already in the spool dir
-      (log/warnf "Archive path %s for other production already exists, removing" archive-path)
-      (fs/delete-tree archive-path))
-    (fs/create-dirs archive-path)
-    ;; create the rdf
-    (let [rdf-path (file archive-path (str dam-number ".rdf"))
-          rdf (rdf/rdf production)]
-      (spit rdf-path rdf))
-    ;; copy all volumes
-    (doseq [volume (range 1 (inc (:volumes production)))]
-      (let [iso-archive-name (str dam-number (when multi-volume? (str "_" volume)) ".iso")
-            iso-archive-path (file archive-path "produkt" iso-archive-name)]
-        (fs/create-dirs (fs/parent iso-archive-path))
-        (fs/copy (path/iso-name production volume) iso-archive-path)
-        (set-file-permissions (file iso-archive-path))))
-    (prod/set-state-archived! production)))
+  (conman/with-transaction [db/*archive-db*]
+    (archive-sektion production :master)
+    ;; place the iso(s) in a spool directory
+    (let [dam-number (prod/dam-number production)
+          archive-path (.getPath (file (env :archive-other-spool-dir) dam-number))
+          multi-volume? (prod/multi-volume? production)]
+      (when (fs/exists? archive-path)
+        ;; when repairing the production is already in the spool dir
+        (log/warnf "Archive path %s for other production already exists, removing" archive-path)
+        (fs/delete-tree archive-path))
+      (fs/create-dirs archive-path)
+      ;; create the rdf
+      (let [rdf-path (file archive-path (str dam-number ".rdf"))
+            rdf (rdf/rdf production)]
+        (spit rdf-path rdf))
+      ;; copy all volumes
+      (doseq [volume (range 1 (inc (:volumes production)))]
+        (let [iso-archive-name (str dam-number (when multi-volume? (str "_" volume)) ".iso")
+              iso-archive-path (file archive-path "produkt" iso-archive-name)]
+          (fs/create-dirs (fs/parent iso-archive-path))
+          (fs/copy (path/iso-name production volume) iso-archive-path)
+          (set-file-permissions (file iso-archive-path))))
+      (prod/set-state-archived! production))))

 (prometheus/instrument! metrics/registry #'archive)


use physicalPackageCount for cpus-physical

There are 3 different cpu values in oshi output.  the above is for
physical sockets on the motherboard, physicalProcessorCount appears to
be number of cores, while logicalProcessorCount appears to be cores *
hyperthreads.

--- src/clj/runbld/facts/oshi.clj
+++ src/clj/runbld/facts/oshi.clj
@@ -37,7 +37,7 @@
     (get-in x [:hardware :processor :logicalProcessorCount]))

   (cpus-physical [{x :facts}]
-    (get-in x [:hardware :processor :physicalProcessorCount]))
+    (get-in x [:hardware :processor :physicalPackageCount]))

   (facter-provider [{x :facts}]
     "oshi")


Add counts for conditions and fields to show

--- src/cljs/iframe_app/core.cljs
+++ src/cljs/iframe_app/core.cljs
@@ -73,7 +73,7 @@
     (html
       [:div.all_rules
        [:h4.rules_summary_title
-        (str "Conditions in this form (" (count (:conditions app-state)) ")")]
+        (str "Conditions in this form (" (count conditions) ")")]
        [:ul.unstyled.global
         (for [condition conditions]
           (condition-detail condition))]])))
@@ -166,7 +166,7 @@
           [:ul.table-header.clearfix
            [:li "Fields"]
            [:li "Values"]
-           [:li "Fields to show"]]
+           [:li (str "Fields to show (" (count (:slave-fields (:selections app-state))) ")")]]

           [:div.table-wrapper
            [:table.table


sort of working

sort of working

--- src/cljs/my_project/core.cljs
+++ src/cljs/my_project/core.cljs
@@ -6,7 +6,7 @@
                        mk-tile-map
                        reducer]]
     [gaz.math :refer [cos-01]]
-    [gaz.vec2 :refer [v2]]
+    [gaz.vec2 :as v2 ]
     [gaz.color :refer [rgb-str]]
     [gaz.appstate :refer [app-state]]
     [gaz.animcomp :refer [animation-view]]
@@ -30,24 +30,43 @@
       (cons (f x y v) memo))
     ()))

+
+(def scaler (v2/v2 20 10))
+
 (defn render-tile [x y v]
-  {:x x :y y :tile v})
+  (let [pos (v2/v2 x y) ]
+    (assoc (v2/mul pos scaler)
+           :w (:x scaler)
+           :h (:y scaler)
+           :col (mapv cos-01 [x y (+ x y)]))
+    ))
+
+; (defn render-tile [x y v]
+;   {}
+;   )

 (defn render-map [level]
   (traverse-map render-tile level))

 (defn test-it []
-  (let [level (mk-tile-map 10 10 :blank)]
+  (let [level (mk-tile-map 30 30 :blank)]
     (render-map level)))

+(def rendered-map (test-it))

 (defn update-game [game dt]
   (let [t (+ dt  (-> game :count :count))]
     (-> game
         (assoc-in [:render-data :boxes]
-                  [{:x (* 100  (cos-01 (* 5 t))) :y 10 :w 100 :h 100 :col [0 (cos-01 (* 0.5 t)) 0]}])
+                  (flatten
+                    [
+                  rendered-map
+                  [{:x (* 100  (cos-01 (* 5 t))) :y 10 :w 100 :h 100 :col [0 (cos-01 (* 0.5 t)) 0]}]
+                     ]
+                    )
+                  )
         (assoc-in [:render-data :sprs]
-                  [ { :id :floor :pos (v2 100 100) } ]
+                  [ { :id :floor :pos (v2/v2 100 100) } ]
                   )
         (assoc-in [:render-data :bg-col ] [(cos-01 (* t 1)) 0 t])
         (assoc-in [:count :count] t))))


display graph in mxGraph

display graph in mxGraph

--- src/clojure/defgraph/core.clj
+++ src/clojure/defgraph/core.clj
@@ -1,5 +1,8 @@
 (ns defgraph.core
-  (:gen-class))
+  (:gen-class)
+  (:import com.mxgraph.swing.mxGraphComponent
+           com.mxgraph.view.mxGraph
+           javax.swing.JFrame))

 (def defs     (filter #(.isFile %) (.listFiles (java.io.File. "defs/runs"))))
 (def vertices (map #(.getName %) defs))
@@ -9,12 +12,26 @@
 (def rootpath (memoize #(let [x (edges %)] (if x (conj {% x} (rootpath x)) {}))))

 (defn graph [re]
-  (let [filtered-edges (filter #(re-matches re (first %)) edges)]
-    {:V (set vertices)
-     :E (reduce conj {} (map #(rootpath %) (keys filtered-edges)))}))
+  (let [filtered-edges (filter #(re-matches re (first %)) edges)
+        complete-edges (reduce conj {} (map #(rootpath %) (keys filtered-edges)))]
+    {:V (into #{} (concat (keys complete-edges) (vals complete-edges)))
+     :E complete-edges}))

 (defn -main [& args]
   (if (> (count args) 1)
     (println "Supply at most a single filtering prefix.")
-    (let [g (graph (re-pattern (str (first args) ".*")))]
-      (println g))))
+    (let [G (graph (re-pattern (str (first args) ".*")))
+          mxgraph (mxGraph.)
+          parent (.getDefaultParent mxgraph)
+          model (.getModel mxgraph)]
+      (.beginUpdate model)
+      (let [vs (:V G)
+            mkv #(.insertVertex mxgraph parent nil % 20 20 80 30)
+            vmap (apply hash-map (interleave vs (map mkv vs)))]
+        (doseq [e (:E G)] (.insertEdge mxgraph parent nil "" (vmap (key e)) (vmap (val e)))))
+      (.endUpdate model)
+      (doto (JFrame. "defgraph")
+        (.setSize 800 600)
+        (.setDefaultCloseOperation JFrame/EXIT_ON_CLOSE)
+        (.add (mxGraphComponent. mxgraph))
+        (.setVisible true)))))


Fix argument validation

Fix argument validation

--- src/com/palletops/cli/api.clj
+++ src/com/palletops/cli/api.clj
@@ -84,6 +84,8 @@
   "Validate a parsed argument."
   [arg {:keys [optional vararg valid-fn] :as arg-descriptor}]
   (cond
+   (map? arg) arg              ; propagate any error from the parse-fn
+
    (and (= arg ::missing) (not (or optional vararg)))
    {:invalid-args (assoc arg-descriptor :value arg :reason :missing)}

@@ -109,7 +111,12 @@
   [(merge-with conj res
                (validate-arg
                 (if (seq args)
-                  (parse-arg (first args) arg-descriptor-map)
+                  (try (parse-arg (first args) arg-descriptor-map)
+                       (catch Exception e
+                         {:invalid-args (assoc arg-descriptor-map
+                                          :value (first args)
+                                          :reason :not-parseable
+                                          :error (.getMessage e))}))
                   ::missing)
                 arg-descriptor-map))
    (rest args)])
@@ -142,12 +149,16 @@
 (defn invalid-args-message
   [invalid-args]
   (reduce
-   (fn [s {:keys [argument-name value reason]}]
-     (str s "Invalid argument for " argument-name " : "
+   (fn [s {:keys [arg-name value reason error value]}]
+     (str s "Invalid argument for '" arg-name "'"
+          (when value (str " with value '" value "'"))
+          ". "
           (condp = reason
-            :missing "argument missing"
-            :invalid "argument invalid")
-          "."))
+            :missing "Argument missing"
+            :invalid "Argument invalid"
+            :not-parseable "Argument wrong format")
+          "."
+          (when error (str " " error))))
    ""
    invalid-args))


Fix typo.

Fix typo.

--- src/vacation2/main.clj
+++ src/vacation2/main.clj
@@ -76,7 +76,7 @@
             (+ (* (rand 5) 10) 50))
           (generate-relation []
             (for [i (range n-relations)]
-              (ref {:id i :seats (rand-seats :price (rand-price))})))]
+              (ref {:id i :seats (rand-seats) :price (rand-price)})))]
     {:reservations
       (for [i (range n-reservations)]
         (ref {:id i :fulfilled? false :total 0}))


Add sampler

Add sampler

--- src/webcv/sampler.cljs
+++ src/webcv/sampler.cljs
@@ -1,6 +1,50 @@
 (ns webcv.sampler
   (:require [clojure.spec.alpha :as s]
+            [cljs.core.async :as async]
+            [oops.core :refer [oget oget+ oset!]]
+            [webcv.audio :as audio]
+            [webcv.chan :as chan]
+            [webcv.ramp :as ramp]
             [webcv.synthdef :as synthdef]))
+
+(defmethod synthdef/node-spec ::sampler-node [_]
+  (s/keys :req [::filename]))
+
+(defmethod synthdef/make-node ::sampler-node
+  [{::audio/keys [actx] ::keys [buffer-cache]} {::keys [filename]}]
+  {::detune-controller (doto (.createConstantSource actx) (.start))
+   ::filename filename
+   ::output (.createGain actx)})
+
+(defn trigger-sample! [sampler-node actx buffer]
+  (let [node (.createBufferSource actx)]
+    (oset! node "buffer" buffer)
+    (.connect (::detune-controller sampler-node) (oget node "detune"))
+    (.connect node (::output sampler-node))
+    (.start node)))
+
+(defmethod synthdef/make-edge [::chan/chan-node ::sampler-node]
+  [ctx src dest {::synthdef/keys [param-name]}]
+  (async/go-loop []
+    (let [msg (async/<! (::chan/mult-out src))]
+      (case param-name
+        ::trigger
+        (let [buffer (get-in ctx [::buffer-cache (::filename dest)])]
+          (trigger-sample! dest (::audio/actx ctx) buffer))
+        ::detune
+        (ramp/schedule! (oget (::detune-node dest) "detune") msg))
+      (recur))))
+
+(defmethod synthdef/make-edge [::audio/audio-node ::sampler-node]
+  [_ src dest _]
+  (.connect src (::detune-controller dest)))
+
+(defmethod synthdef/make-edge [::sampler-node ::audio/audio-node]
+  [_ src dest {::synthdef/keys [param-name]}]
+  (.connect (::output src)
+            (if (not= ::audio/input param-name)
+              (oget+ dest param-name)
+              dest)))

 (defn load-sample
   "Fetches and decodes the sample at url. Calls cb with an AudioBuffer"
@@ -12,3 +56,13 @@
     (set! (.-responseType request) "arraybuffer")
     (set! (.-onload request) onload)
     (.send request)))
+
+(defn note->detune [note]
+  (* 100 (- note 60)))
+
+(defn sampler [filename trigger detune]
+  (synthdef/synthdef
+    {::synthdef/node-type ::sampler-node
+     ::filename filename}
+    {::trigger [trigger]
+     "detune" [detune]}))


CMR-3286 pr comment

CMR-3286 pr comment

--- access-control-app/src/cmr/access_control/services/acl_authorization.clj
+++ access-control-app/src/cmr/access_control/services/acl_authorization.clj
@@ -57,10 +57,8 @@
     ;; read is special, if the user has any permission for the acl
     ;; then the user has permission to read
     (if (= action :read)
-      (some #{true}
-        (set
-          (for [act ["create" "read" "update" "delete"]]
-            (acl/acl-matches-sids-and-permission? (:sids returned-acl) act echo-acl))))
+      (some #(acl/acl-matches-sids-and-permission? (:sids returned-acl) % echo-acl)
+            ["create" "read" "update" "delete"])
       (acl/acl-matches-sids-and-permission? (:sids returned-acl) (name action) echo-acl))))

 (defn- permission-denied-message


Use ListView to improve performance Closes #3

--- src/todo_mvc/list_todo.cljs
+++ src/todo_mvc/list_todo.cljs
@@ -7,15 +7,17 @@
 (def FontAwesome (js/require "react-native-vector-icons/FontAwesome"))
 (def MaterialIcons (js/require "react-native-vector-icons/MaterialIcons"))
 (def LayoutAnimation (.-LayoutAnimation ReactNative))
+(def ListView (.-ListView ReactNative))

 (def view (r/adapt-react-class (.-View ReactNative)))
+(def list-view (r/adapt-react-class (.-ListView ReactNative)))
 (def fontawesome-icon (r/adapt-react-class (.-default FontAwesome)))
 (def material-icon (r/adapt-react-class (.-default MaterialIcons)))

 (when (= "android" (.. ReactNative -Platform -OS))
   (.. ReactNative -UIManager (setLayoutAnimationEnabledExperimental true)))

-(defn item-todo [[id {:keys [desc done?]}]]
+(defn item-todo [id {:keys [desc done?]}]
   [view
    {:style {:flex-direction "row"
             :flex           1
@@ -35,11 +37,20 @@
                       :style    {:margin-left 5}}]])

 (defn list-todo []
-  (r/create-class
-    {:reagent-render
-     (fn []
-       [view {:style {:flex 1 :align-self "stretch"}}
-        (map (fn [todo] ^{:key (first todo)} [item-todo todo])
-             @(rf/subscribe [:get-showing-todos]))])
-     :componentWillUpdate
-     #(.easeInEaseOut LayoutAnimation)}))
+  (let [ds (new (.-DataSource ListView) #js {:rowHasChanged not=})]
+    (r/create-class
+      {:reagent-render
+       (fn []
+         (let [dataSource (.cloneWithRows ds (clj->js @(rf/subscribe [:get-showing-todos])))]
+           [list-view
+            {:style               {:flex       1
+                                   :align-self "stretch"}
+             :dataSource          dataSource
+             :renderRow           (fn [rowData _ rowID]
+                                    (r/as-element
+                                      [item-todo rowID (js->clj rowData
+                                                                :keywordize-keys true)]))
+             ; this flag will be deprecated in future releases of react-native
+             :enableEmptySections true}]))
+       :componentWillUpdate
+       #(.easeInEaseOut LayoutAnimation)})))


Implement AutoCloseable for socket and context of zmq.

--- src/uxbox/msgbus/zmq.clj
+++ src/uxbox/msgbus/zmq.clj
@@ -1,3 +1,6 @@
+;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
+;; All rights reserved.
+
 (ns uxbox.msgbus.zmq
   "A lightweigt interop intetface to java zmq library."
   (:refer-clojure :exclude [send])
@@ -60,10 +63,16 @@
   (-unregister [_ socket] "Unregister the socket from the poller.")
   (-poll [_ ms] "Poll."))

-(deftype ZContext [^ZMQ$Context ctx])
-(deftype ZSoket [^ZContext context ^ZMQ$Socket socket connections bindings])
+(deftype ZContext [^ZMQ$Context ctx]
+  java.lang.AutoCloseable
+  (close [_] (.destroy ctx)))
+
+(deftype ZSoket [^ZContext context ^ZMQ$Socket socket connections bindings]
+  java.lang.AutoCloseable
+  (close [_] (.destroy socket)))
+
 (deftype ZPoller [^ZContext context ^ZMQ$Poller poller sockets])
-(defrecord ZPollItem [^ZSoket socket readable writable error])
+(defrecord ZPollItem [^ZSoket socket readable? writable? errored?])

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Implementation


Fixed transaction graph

Fixed transaction graph

--- scripts/transaction_graph/main.clj
+++ scripts/transaction_graph/main.clj
@@ -12,9 +12,9 @@

 (def ^:private wallet-counter (atom 0))

-(defn new-wallet! [wallet-store blockchain uuid-generator wallet-data-generator]
+(defn new-wallet! [wallet-store blockchain wallet-data-generator]
   (let [{:keys [sso-id name email]} (wallet-data-generator)]
-    (wallet/new-empty-wallet! wallet-store blockchain uuid-generator sso-id name email)))
+    (wallet/new-empty-wallet! wallet-store blockchain sso-id name email)))

 (defn new-transaction! [blockchain transaction-data-generator wallets-and-secrets]
   (let [{:keys [from-account-id amount
@@ -57,7 +57,7 @@
         wallet-data-generator (create-wallet-generator (create-index-generator))
         transaction-data-generator (create-transaction-generator random-selection random-selection random-amount)
         wallets-and-secrets (->> #(new-wallet! wallet-store blockchain
-                                               uuid/uuid wallet-data-generator)
+                                               wallet-data-generator)
                                  repeatedly
                                  (take n-wallets)
                                  doall)]


Add tests

Add tests

--- test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
+++ test/clojure/clojurewerkz/cassaforte/new_query_api_test.clj
@@ -336,4 +336,16 @@
                  (columns :a :b :c)
                  (where {:k 0})
                  )))
+
+  (is (= "DELETE a[3],b['foo'],c FROM foo WHERE k=1;"
+         (delete :foo
+                 (columns (list-elt :a 3)
+                          (map-elt :b "foo")
+                          :c)
+                 (where {:k 1}))))
+
+  (is (= "DELETE FROM foo USING TIMESTAMP 1240003134 WHERE k='value';"
+         (delete :foo
+                 (using {:timestamp 1240003134})
+                 (where {:k "value"}))))
   )


CMR-4908 Fixes parse-data-sizes unit test.

--- umm-spec-lib/test/cmr/umm_spec/test/umm_spec_test_util.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/umm_spec_test_util.clj
@@ -6,16 +6,16 @@
    [cmr.umm-spec.util :as util]))

-(deftest test-parse-data-size
+(deftest test-parse-data-sizes
   (are [s expected] (= expected
                        (util/parse-data-sizes s))
-    "2 k" [{:Size 2.0 :Unit "KB"}]
+    "2 k" [{:Size 2 :Unit "KB"}]
     "4,555.5mb" [{:Size 4555.5 :Unit "MB"}]
     "9.446 Tbytes" [{:Size 9.446 :Unit "TB"}]
     "pixel size: 1km, 500m, 250m" nil
     "4.3 GB (total volume)" [{:Size 4.3 :Unit "GB"}]
-    "79 MB compressed; 214 MB uncompressed" [{:Size 79.0 :Unit "MB"} {:Size 214.0 :Unit "MB"}]
-    "Total Volume: 40 Mbytes for XBT data; 10 Mbytes for TSG data" [{:Size 40.0 :Unit "MB"} {:Size 10.0 :Unit "MB"}]
+    "79 MB compressed; 214 MB uncompressed" [{:Size 79 :Unit "MB"} {:Size 214 :Unit "MB"}]
+    "Total Volume: 40 Mbytes for XBT data; 10 Mbytes for TSG data" [{:Size 40 :Unit "MB"} {:Size 10 :Unit "MB"}]
     "1010 files; Total size: 2351.98 MB" [{:Size 2351.98 :Unit "MB"}]

     "Single layer, raster format, 13.2 megabytes; vector format, 1.2 megabytes"
@@ -23,7 +23,8 @@

     "173.596 Gbytes" [{:Size 173.596 :Unit "GB"}]

-    ".5 GB" [{:Size 0.5 :Unit "GB"}])
+    ".5 GB" [{:Size '.5 :Unit "GB"}])
+
   (are3 [s expected]
     (is (= expected (util/parse-data-sizes s)))

@@ -34,7 +35,7 @@
     "2,894,890 bytes" [{:Size 2894.89 :Unit "KB"}]

     "KB with sanitize"
-    "2 k" [{:Size 2.0 :Unit "KB"}]))
+    "2 k" [{:Size 2 :Unit "KB"}]))

 (deftest data-size-str-test
   (is (= (util/data-size-str [{:Size 92.4 :Unit "MB"} {:Size 0.4 :Unit "GB"}])


Render ArraySeqs. Fixes #67.

Render ArraySeqs. Fixes #67.

--- src/gorilla_repl/renderer.clj
+++ src/gorilla_repl/renderer.clj
@@ -135,6 +135,18 @@
      :items (map r/render self)
      :value (pr-str self)}))

+;; TODO: is this really necessary? Is there some interface I'm missing for lists? Or would just ISeq work?
+(extend-type clojure.lang.ArraySeq
+  r/Renderable
+  (render [self]
+    {:type :list-like
+     :open "("
+     :close ")"
+     :separator " "
+     :items (map r/render self)
+     :value (pr-str self)}))
+
+
 ;; When we render a map we will map over its entries, which will yield key-value pairs represented as vectors. To render
 ;; the map we render each of these key-value pairs with this helper function. They are rendered as list-likes with no
 ;; bracketing. These will then be assembled in to a list-like for the whole map by the IPersistentMap render function.


Replace both with conditional

Replace both with conditional

--- src/icecap/handlers/http.clj
+++ src/icecap/handlers/http.clj
@@ -20,8 +20,7 @@
   (#{"http" "https"} (scheme url)))

 (defstep :http
-  {:url (s/both sc/URI
-                (s/pred valid-scheme? 'valid-scheme?))
+  {:url (s/conditional valid-scheme? sc/URI)
    :method (s/enum :GET :POST :DELETE :PUT :PATCH :HEAD)}
   [step]
   (let [req (spy (request step))]


commented out timer creation as well in nimbus

--- storm-multicore/src/clj/backtype/storm/daemon/nimbus.clj
+++ storm-multicore/src/clj/backtype/storm/daemon/nimbus.clj
@@ -260,10 +260,10 @@
    ; by default this is DefaultTopologyValidator
    :validator (new-instance (conf NIMBUS-TOPOLOGY-VALIDATOR))
    ; not sure if we need a timer.
-   :timer (mk-timer :kill-fn (fn [t]
-                               (log-error t "Error when processing event")
-                               (halt-process! 20 "Error when processing an event")
-                               ))
+;   :timer (mk-timer :kill-fn (fn [t]
+;                               (log-error t "Error when processing event")
+;                               (halt-process! 20 "Error when processing an event")
+;                               ))
    :scheduler (mk-scheduler conf inimbus)})

@@ -328,7 +328,7 @@

       DaemonCommon
       (waiting? [this]
-        (timer-waiting? (:timer nimbus))))))
+        ))))

 (defn standalone-nimbus []


use pagination on record delete

use pagination on record delete

--- src_cljs/rrms/corecljs.cljs
+++ src_cljs/rrms/corecljs.cljs
@@ -12,9 +12,20 @@
   (:import goog.History
            goog.json.Serializer))

+(def storage (r/atom {:documents {}
+                      :current-page 1
+                      :total-pages 1
+                      :document {}}))
+
 (def documents (r/atom nil))

 (def document (r/atom {}))
+
+(defn set-key-value [k v]
+  (reset! storage (assoc @storage k v)))
+
+(defn get-value! [k]
+  (k @storage))

 (defn get-total-rec-no [nos]
   (let [totrec (quot nos 10)]
@@ -22,6 +33,20 @@
       totrec
       (+ 1 totrec))))

+(defn get-new-page-data [data current-page]
+  (let [total-pages (get-total-rec-no (count data))
+        pag-start (* 10 (dec current-page))
+        pag-end (+ pag-start 9)]
+    (cond (<= total-pages 1) ((set-key-value :current-page 1)
+                              (set-key-value :total-pages 1)
+                              (clj->js (keep-indexed #(if (< %1 10) %2) data)))
+          :else ((set-key-value :total-pages total-pages)
+                 (when (< total-pages (get-value! :current-page))
+                   (set-key-value :current-page total-pages))
+                 (clj->js (keep-indexed
+                           #(if (and (>= %1 pag-start) (<= %1 pag-end)) %2) data))))))
+
+
 (defn url-format [url title]
   [:a {:href url :class "btn btn-primary  glyphicon glyphicon-plus"} title])

@@ -32,25 +57,25 @@
 (defn getd [indexNo]
   (let [onres (fn [json]
                 (let [d (.-data (getdata json))]
-                  (reset! documents d)
-                  (r/render [render-documents @documents]
+                  (set-key-value :documents d)
+                  (r/render [render-documents (get-value! :documents)]
                             (.getElementById js/document "app1"))))]
     (http-get (str (str "http://localhost:8193/documents/paging/" indexNo) "/10") onres)))

-(defn pager [value totalItems]
+(defn pager [value total-rec]
   [pager-elem {:bsSize "large"
                :prev true
                :next true
                :first true
                :last true
                :ellipsis true
-               :items @totalItems
-               :activePage @value
+               :items (:total-pages @storage)
+               :activePage (:current-page @storage)
                :maxButtons 5
                :onSelect (fn [s1 s2]
                            (let [i (.-eventKey s2)]
                              (getd i)
-                             (reset! value i)))}])
+                             (set-key-value :current-page i)))}])

 (defn shared-state [totalRec]
@@ -154,8 +179,9 @@

 (defn delete[id]
   (let [onres (fn [json]
-                ((reset! documents (getdata json))
-                 (r/render [render-documents @documents]
+                ((set-key-value :documents (getdata json))
+                 (r/render [render-documents (get-new-page-data (get-value! :documents)
+                                                                (get-value! :current-page))]
                            (.getElementById js/document "app1"))))]
     (http-delete (str "http://localhost:8193/documents/delete/" id)  onres)))

@@ -225,13 +251,14 @@
 (defroute home-path "/" []
   (let [onres (fn [json]
                 (let [dt (getdata json)]
-                  (reset! documents (.-data dt))
-                  (r/render [render-documents @documents]
+                  (set-key-value :documents (.-data dt))
+                  (r/render [render-documents (get-value! :documents)]
                             (.getElementById js/document "app1"))
-                  (r/render [shared-state (get-total-rec-no
-                                           (.-totaldocuments(first
-                                                             (.-totaldocuments dt))))]
-                            (.getElementById js/document "pindex"))))]
+                  (r/render [shared-state 0]
+                            (.getElementById js/document "pindex"))
+                  (set-key-value :total-pages (get-total-rec-no
+                                               (.-totaldocuments(first
+                                                                 (.-totaldocuments dt)))))))]
     (http-get "http://localhost:8193/documents/paging/1/10" onres)))

 (defroute documents-path "/documents/add" []


Resolve all wrongs in corecljs without JSON

--- src_cljs/rrms/corecljs.cljs
+++ src_cljs/rrms/corecljs.cljs
@@ -27,17 +27,13 @@
   (xhr/send url callback))

-(defn to-string
-  [obj]
-  (if-let [dt (to-date-time obj)]
-    (time-fmt/unparse (:date-time time-fmt/formatters) dt)))
-
-
 (defn http-post [url callback data]
   (xhr/send url callback "POST" data  (structs/Map. (clj->js {:Content-Type "application/json"}))))

 (defn http-delete [url callback data]
   (xhr/send url callback "DELETE" data  (structs/Map. (clj->js {:Content-Type "application/json"}))))
+
+(declare render-documents)

 (defn search [event]
   (let [stext (.-value (.getElementById js/document "sText"))
@@ -54,12 +50,32 @@
    [:label
     [:input {:field :radio :name name :value value}]
     label]])
-(defn input [label type id value]
-  (row label [:input.form-control {:type type :id id :defaultValue value}]))
+(defn input
+  ([label type id value]
+   (row label [:input.form-control {:type type :id id :defaultValue value}]))
+  ([label type id]
+   (input label type id "")))
+
+(defn getinputvalue[id]
+  (.-value (.getElementById js/document id)))
+
+(defn get-documents-formdata []
+  {:documentname (getinputvalue "documentname")
+   :title (getinputvalue "title")
+   :employeename (getinputvalue "employeename")
+   :date (getinputvalue "date")
+   :location (getinputvalue "location")
+   })
+
+
+(defn save [event]
+  (let [onres (fn[data] (set! (.-location js/window) "http://localhost:8193"))]
+    (http-post "http://localhost:8193/documents/add"
+               onres  (JSON/stringify (clj->js (get-documents-formdata))))))

 (defn document-template []
   [:div {:id "add" :class "form-group"}
-   [:div#dn (input "Documentname" :text :documentname)]
+   [:div#dn (input "Documentname" :text :documentname )]
    [:div#tl (input "Title" :text :title)]
    [:div#empn (input "EmployeeName" :text :employeename)]
    [:div#dt (input "Date":Date :date)]
@@ -67,6 +83,29 @@
    [:input {:type "button" :value "Save"
             :class "btn btn-primary" :on-click save}]
    ])
+
+(defn get-update-documents-formdata []
+  {
+   :id (getinputvalue "id")
+   :documentname (getinputvalue "upd_documentname")
+   :title (getinputvalue "upd_title")
+   :employeename (getinputvalue "upd_employeename")
+   :date (getinputvalue "upd_date")
+   :location (getinputvalue "upd_location")
+   })
+
+
+
+(defn click-update[id]
+  (.assign js/location (str "#/documents/update/" id)))
+
+
+(defn docupdate [event]
+  (let [onres (fn[data]
+                (.assign js/location "/"))]
+    (http-post "http://localhost:8193/documents/update"
+               onres (JSON/stringify (clj->js (get-update-documents-formdata))))))
+

 (defn document-update-template [id dmt]
   [:div.form-group {:id "update" :class "form-group"}
@@ -80,50 +119,12 @@
             :class "btn btn-primary" :on-click docupdate}]])

-
-(defn getinputvalue[id]
-  (.-value (.getElementById js/document id)))
-
-(defn get-documents-formdata []
-  {:documentname (getinputvalue "documentname")
-   :title (getinputvalue "title")
-   :employeename (getinputvalue "employeename")
-   :date (getinputvalue "date")
-   :location (getinputvalue "location")
-   })
-
-(defn get-update-documents-formdata []
-  {
-   :id (getinputvalue "id")
-   :documentname (getinputvalue "upd_documentname")
-   :title (getinputvalue "upd_title")
-   :employeename (getinputvalue "upd_employeename")
-   :date (getinputvalue "upd_date")
-   :location (getinputvalue "upd_location")
-   })
-
-(defn save [event]
-  (let [onres (fn[data] (set! (.-location js/window) "http://localhost:8193"))]
-    (http-post "http://localhost:8193/documents/add"
-               onres  (JSON/stringify (clj->js (get-documents-formdata))))))
-
-(defn click-update[id]
-  (.assign js/location (str "#/documents/update/" id)))
-
-
-(defn docupdate [event]
-  (let [onres (fn[data]
-                (.assign js/location "/"))]
-    (http-post "http://localhost:8193/documents/update"
-               onres (JSON/stringify (clj->js (get-update-documents-formdata))))))
-
-
 (defn delete[id]
   (let [onres (fn [json]
                 ((reset! documents (getdata json))
                  (r/render [render-documents @documents]
                            (.-body js/document))))]
-    (http-delete (str "http://localhost:8193/documents/delete/" id) onres)))
+    (http-delete (str "http://localhost:8193/documents/delete/" id) nil onres)))

 (defn render-documents [documents]
@@ -159,8 +160,8 @@
                            [:td (.-documentname dn)]
                            [:td (.-title dn)]
                            [:td (.-employeename dn)]
-                           [:td  (f/unparse (f/formatter "MM/dd/yyyy")(f/parse (.-date dn)))]
-                           [:td (.-date dn)]
+                           [:td  (f/unparse (f/formatter "dd-MMM-yyyy")(f/parse (.-date dn)))]
+                           ;; [:td (.-date dn)]
                            [:td (.-location dn)]
                            [:td [:input {:type "button" :on-click #(click-update(.-id dn))
                                          :value "Update"}]]
@@ -203,6 +204,6 @@
     (.setEnabled history true)))

 (defn nav! [token]
-  (.setToken history token))
+  (.setToken (History.) token))

 (main)


Write nrepl port to ".nrepl-port", use doto

--- src/leiningen/ring/server.clj
+++ src/leiningen/ring/server.clj
@@ -46,10 +46,11 @@
 (defn start-nrepl-expr [project]
   (let [port (-> project :ring :nrepl (:port 0))]
     `(let [{port# :port} (clojure.tools.nrepl.server/start-server :port ~port)]
-       (-> "target/repl-port"
-           java.io.File.
-           (#(do (.deleteOnExit %) %))
-           (spit port#))
+       (doseq [port-file# ["target/repl-port" ".nrepl-port"]]
+         (-> port-file#
+             java.io.File.
+             (doto .deleteOnExit)
+             (spit port#)))
        (println "Started nREPL server on port" port#))))

 (defn server-task


_include'd templates correctly replace ids inside of a _within

--- src/lib/clj/one/templates.clj
+++ src/lib/clj/one/templates.clj
@@ -11,7 +11,10 @@
 (declare construct-html)

 (defn- html-body [name]
-  (:content (first (select (html-resource name) [:body]))))
+  (let [nodes (html-resource name)]
+    (or
+     (:content (first (select nodes [:body])))
+     nodes)))

 (defn- include-html [h]
   (let [includes (select h [:_include])]


fixing test by adding user to job args

fixing test by adding user to job args

--- test/celestial/test/api.clj
+++ test/celestial/test/api.clj
@@ -11,11 +11,6 @@
     [celestial.jobs :as jobs]
     [celestial.persistency.systems :as s]
     [celestial.persistency :as p]))
-
-; TODO is seems that ring-mock isn't working correctly with '&' distructuing
-#_(def host-req
-    (merge {:params redis-prox-spec}
-           (header (request :post "/registry/host") "Content-type" "application/edn")))

 (def non-sec-app (app false))

@@ -31,17 +26,6 @@
         (s/get-system "1") => {:type "redis"}
         (p/get-type "redis") => {:classes {:redis {:append true}}}))

-#_(def type-req
-    (merge {:params (slurp-edn "fixtures/redis-type.edn")}
-           (header (request :post "/type") "Content-type" "application/edn")))
-
-; TODO is seems that ring-mock isn't working correctly with '&' distructuing
-#_(fact "type requests"
-        (non-sec-app type-req) => {:status 200}
-        (provided
-          (p/add-type (slurp-edn "fixtures/redis-type.edn") :type) => nil
-          ))
-
 (let [machine {:type "redis" :machine {:host "foo"}} type {:classes {:redis {}}}]
     (fact "provisioning job"
           (non-sec-app (request :post "/jobs/provision/1")) => (contains {:status 200})
@@ -50,7 +34,7 @@
             (s/get-system "1")  => machine
             (s/get-system "1" :env)  => :dev
             (p/get-type "redis") => type
-            (jobs/enqueue "provision" {:identity "1" :args [type (assoc machine :system-id 1)] :tid nil :env :dev}) => nil)))
+            (jobs/enqueue "provision" {:identity "1" :args [type (assoc machine :system-id 1)] :tid nil :env :dev :user nil}) => nil)))

 (fact "staging job"
       (non-sec-app (request :post "/jobs/stage/1")) => (contains {:status 200})
@@ -59,7 +43,7 @@
         (p/get-type "redis") => {:puppet-module "bar"}
         (s/get-system "1") => {:type "redis"}
         (s/get-system "1" :env)  => :dev
-        (jobs/enqueue "stage" {:identity "1" :args [{:puppet-module "bar"} {:system-id 1 :type "redis"}] :tid nil :env :dev}) => nil))
+        (jobs/enqueue "stage" {:identity "1" :args [{:puppet-module "bar"} {:system-id 1 :type "redis"}] :tid nil :env :dev :user nil}) => nil))

 (fact "creation job"
       (non-sec-app (request :post "/jobs/create/1"))  => (contains {:status 200})
@@ -67,4 +51,4 @@
         (s/system-exists? "1") => true
         (s/get-system "1")  => {}
         (s/get-system "1" :env)  => :dev
-        (jobs/enqueue "reload" {:identity "1" :args [{:system-id 1}] :tid nil :env :dev}) => nil))
+        (jobs/enqueue "reload" {:identity "1" :args [{:system-id 1}] :tid nil :env :dev :user nil}) => nil))


Fix unit tests for epoch millisecond conversion

Timezones are hard.

--- test/env_logger/db_test.clj
+++ test/env_logger/db_test.clj
@@ -420,9 +420,10 @@

 (deftest convert-to-epoch-ms-test
   (testing "Unix epoch time calculation"
-    (is (= 1620723600000
-           (convert-to-epoch-ms (t/to-sql-timestamp
-                                 (t/local-date-time 2021 5 11 12 0)))))
-    (is (= 1609582380000
-           (convert-to-epoch-ms (t/to-sql-timestamp
-                                 (t/local-date-time 2021 1 2 13 13)))))))
+    (with-redefs [get-conf-value (fn [_] "UTC")]
+      (is (= 1620734400000
+             (convert-to-epoch-ms (t/to-sql-timestamp
+                                   (t/local-date-time 2021 5 11 12 0)))))
+      (is (= 1609593180000
+             (convert-to-epoch-ms (t/to-sql-timestamp
+                                   (t/local-date-time 2021 1 2 13 13))))))))


prevent NullPointerException

prevent NullPointerException

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

--- acqEngine/src/org/micromanager/config_editor.clj
+++ acqEngine/src/org/micromanager/config_editor.clj
@@ -67,9 +67,10 @@
 (def widgets (atom nil))

 (defn get-selected-group []
-  (let [row (.getSelectedRow (@widgets :groups-table))]
-    (when (<= 0 row)
-      (nth @groups row))))
+  (let [row (.getSelectedRow (@widgets :groups-table))
+        groups @groups]
+    (when (< -1 row (count groups))
+      (nth groups row))))

 (defn update-group-data []
@@ -110,6 +111,7 @@
     (isCellEditable [_ _] true)
     (getValueAt [row column] (nth (keys @group-data) row))
     (setValueAt [val row column]
+                (println old-val val row column)
       (let [old-val (.getValueAt this row column)]
         (core renameConfig (get-selected-group) old-val val)
         (update-group-data)))))
@@ -123,7 +125,7 @@
     (getValueAt [row column] (get (nth (vals @group-data) row)
                                   (nth (properties @group-data) column)))
     (setValueAt [val row column]
-      ;(let [old-val (.getValueAt this row column)]
+                ;(let [old-val (.getValueAt this row column)]
         ;TODO: finish
         )))


Create jarfile before tests

Create jarfile before tests

--- test/carambar/cache_test.clj
+++ test/carambar/cache_test.clj
@@ -5,29 +5,18 @@
   (:import [java.util.zip ZipEntry ZipOutputStream]))

-(fact (add-entry {:name "/path/test.jar" :values []}) => (contains {:name "/path/test.jar" :values []}))
+(fact "Add entry"
+  (add-entry {:name "/path/test.jar" :values []}) => (contains {:name "/path/test.jar" :values []}))
+
+(fact "Convert filename to javaclas."
+  (filename->javaclass "a/b/c/MyClass.class") => "a.b.c.MyClass")

 ;; need to run mvn clean install before...
 (def jarfile-with-two-classes "/home/nchapon/opt/m2_repo/org/carambar/simple/1.0-SNAPSHOT/simple-1.0-SNAPSHOT.jar")

-(def slf4j "/home/nchapon/opt/m2_repo/org/slf4j/slf4j-api/1.7.8/slf4j-api-1.7.8.jar")
-
 (fact (:values (parse jarfile-with-two-classes)) => (contains ["org.carambar.App" "org.carambar.MyClass"] :in-any-order))

-(fact (filename->javaclass "a/b/c/MyClass.class") => "a.b.c.MyClass")
-
-
 (def tmpdir (System/getProperty "java.io.tmpdir"))
-
-
-
-
-;;(.mkdir (java.io.File. (str tmpdir "/carambar")))
-
-;;(map #(.mkdir (java.io.File. (str  tmpdir "/carambar/" %))) ["a" "a/b" "a/b/c"])
-
-;;(map  #(spit (str tmpdir "/carambar/a/b/c/" %) "CONTENT") ["A.class"])
-

 (defmacro ^:private with-entry
   [zip entry-name & body]
@@ -37,25 +26,16 @@
      (flush)
      (.closeEntry zip#)))

-(defn jarfile [filename]
-  (with-open [file (io/output-stream (str tmpdir "/" filename))
+(defn jarfile [filename classes]
+  (with-open [file (io/output-stream filename)
               zip  (ZipOutputStream. file)
               wrt  (io/writer zip)]
     (binding [*out* wrt]
-      (doto zip
-        (with-entry "Foo.class"
-          (println "foo"))
-        (with-entry "bar/Baz.class"
-          (println "baz"))))))
+      (dotimes [i (count classes)]
+        (with-entry zip (nth classes i)
+              (println "foo"))))))

-
-;; (with-open [output (ZipOutputStream. (io/output-stream "foo.zip"))
-;;             input  (io/input-stream "foo")]
-;;   (with-entry output "foo"
-;;     (io/copy input output)))
-
-
-(jarfile "test.jar")
-
-
-(parse (str tmpdir "/" "test.jar"))
+(fact "Parse one jar with two classes"
+  (let [filename (str tmpdir "/" "test.jar")
+        jar (jarfile filename ["Foo.class" "bar/Baz.class"])]
+    (parse filename) => {:name "/tmp/test.jar" :values ["Foo" "bar.Baz"]}))


Add fake onyx.core/params

Add fake onyx.core/params

--- test/expound/alpha_test.cljc
+++ test/expound/alpha_test.cljc
@@ -1489,6 +1489,8 @@
 (s/def :trigger/pre-evictor any?)
 (s/def :trigger/post-evictor any?)
 (s/def :flow/short-circuit any?)
+(s/def :onyx.core/params?
+  (s/coll-of any? :kind vector?))

 #?(:clj
    (deftest real-spec-tests-mutated-valid-value


whitespace

whitespace

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -106,204 +106,198 @@
 (declare get-string)

 ;; TODO: this is an overly huge method that needs to be rewritten to be easier to understand and maintain.
-;; TODO: use replace patterns instead (as with French)
-;; TODO: split into morphology/verb function, morphology/noun function, etc.
 (defn get-string-1 [word]
   (let [person (get-in word '(:agr :person))
         number (get-in word '(:agr :number))]
     (cond
-
-     (and (string? (get-in word '(:a)))
-          (string? (get-in word '(:b))))
-     (get-string (get-in word '(:a))
-                 (get-in word '(:b)))
-
-     (and (string? (get-in word '(:a)))
-          (map? (get-in word '(:b))))
-     (get-string (get-in word '(:a))
-                 (get-in word '(:b)))
-
-     (and (map? (get-in word '(:a)))
-          (map? (get-in word '(:b))))
-     (get-string
-      (get-in word '(:a))
-      (get-in word '(:b)))
-
-     (= :verb (get-in word [:cat]))
-     (verbs/conjugate word)
-
-     ;; TODO: this rule is pre-empting all of the following rules
-     ;; that look in :a and :b. Either remove those following rules
-     ;; if they are redundant and not needed, or move this general rule
-     ;; below the following rules.
-     (and (not (= :none (get-in word '(:a) :none)))
-          (not (= :none (get-in word '(:b) :none))))
-     (get-string (get-in word '(:a))
-                 (get-in word '(:b)))
-
-     (and
-      (string? (get-in word '(:a :italiano)))
-      (string? (get-in word '(:b :italiano)))
-      (or (= :none (get-in word '(:b :agr :number) :none))
-          (= :top (get-in word '(:b :agr :number) :none)))
-      )
-     (str (string/trim (get-in word '(:a :italiano)))
-          " "
-          (string/trim (get-in word '(:b :italiano))))
-
-     (and
-      (string? (get-in word '(:a)))
-      (string? (get-in word '(:b :italiano)))
-      (or (= :none (get-in word '(:b :agr :number) :none))
-          (= :top (get-in word '(:b :agr :number) :none)))
-      )
-     (str (string/trim (get-in word '(:a)))
-          " "
-          (string/trim (get-in word '(:b :italiano))))
-
-     (and
-      (string? (get-in word '(:a :italiano)))
-      (get-in word '(:a :italiano))
-      (or (= :none (get-in word '(:b :agr :number) :none))
-          (= :top (get-in word '(:b :agr :number) :none)))
-      (= (get-in word '(:a :infl)) :top))
-     (string/trim (str (get-in word '(:a :italiano))
-                 " " (get-string-1 (get-in word '(:b)))))
-
-     ;; TODO: all of the rules that handle exceptions should be removed:
-     ;; exceptions are dealt with at compile-time now, via babel.italiano.morphology/exception-generator
-
-     ;; handle lexical exceptions (plural feminine adjectives):
-     (and
-      (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:agr :gender)) :fem)
-      (= (get-in word '(:cat)) :adjective)
-      (string? (get-in word '(:fem :plur))))
-     (get-in word '(:fem :plur))
-
-     ;; handle lexical exceptions (plural feminine adjectives):
-     (and
-      (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:agr :gender)) :fem)
-      (= (get-in word '(:cat)) :adjective)
-      (string? (get-in word '(:fem :plur))))
-     (get-in word '(:fem :plur))
-
-     ;; handle lexical exceptions (plural masculine adjectives):
-     (and
-      (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:agr :gender)) :masc)
-      (= (get-in word '(:cat)) :adjective)
-      (string? (get-in word '(:masc :plur))))
-     (get-in word '(:masc :plur))
-
-     (and
-      (string? (get-in word [:italiano]))
-      (or (= (get-in word [:agr :gender]) :masc)
-          (= (get-in word [:agr :gender]) :top))
-      (= (get-in word [:agr :number]) :plur)
-      (= (get-in word [:cat]) :adjective))
-     (string/replace (get-in word '[:italiano])
-                     #"[eo]$" "i") ;; nero => neri
-
-     (and
-      (= (get-in word '(:agr :gender)) :fem)
-      (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:cat)) :adjective)
-      (re-find #"o$" (get-in word [:italiano])))
-     (string/replace (get-in word '(:italiano))
-                     #"[o]$" "e") ;; nero => nere
-     (and
-      (= (get-in word '(:agr :gender)) :fem)
-      (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:cat)) :adjective)
-      (re-find #"e$" (get-in word [:italiano])))
-     (string/replace (get-in word '(:italiano))
-                     #"[e]$" "i") ;; difficile => difficili
+      (and (string? (get-in word '(:a)))
+           (string? (get-in word '(:b))))
+      (get-string (get-in word '(:a))
+                  (get-in word '(:b)))
+      (and (string? (get-in word '(:a)))
+           (map? (get-in word '(:b))))
+      (get-string (get-in word '(:a))
+                  (get-in word '(:b)))
+      (and (map? (get-in word '(:a)))
+           (map? (get-in word '(:b))))
+      (get-string
+       (get-in word '(:a))
+       (get-in word '(:b)))
+      (= :verb (get-in word [:cat]))
+      (let [conjugated (verbs/conjugate word)]
+        (if (or (nil? conjugated) (empty? conjugated))
+          (throw (Exception. (str "failed to conjugate: "
+                                  (dag_unify.core/strip-refs word))))
+          conjugated))
+      ;; TODO: this rule is pre-empting all of the following rules
+      ;; that look in :a and :b. Either remove those following rules
+      ;; if they are redundant and not needed, or move this general rule
+      ;; below the following rules.
+      (and (not (= :none (get-in word '(:a) :none)))
+           (not (= :none (get-in word '(:b) :none))))
+      (get-string (get-in word '(:a))
+                  (get-in word '(:b)))
+      (and
+       (string? (get-in word '(:a :italiano)))
+       (string? (get-in word '(:b :italiano)))
+       (or (= :none (get-in word '(:b :agr :number) :none))
+           (= :top (get-in word '(:b :agr :number) :none)))
+       )
+      (str (string/trim (get-in word '(:a :italiano)))
+           " "
+           (string/trim (get-in word '(:b :italiano))))
+      (and
+       (string? (get-in word '(:a)))
+       (string? (get-in word '(:b :italiano)))
+       (or (= :none (get-in word '(:b :agr :number) :none))
+           (= :top (get-in word '(:b :agr :number) :none)))
+       )
+      (str (string/trim (get-in word '(:a)))
+           " "
+           (string/trim (get-in word '(:b :italiano))))
+      (and
+       (string? (get-in word '(:a :italiano)))
+       (get-in word '(:a :italiano))
+       (or (= :none (get-in word '(:b :agr :number) :none))
+           (= :top (get-in word '(:b :agr :number) :none)))
+       (= (get-in word '(:a :infl)) :top))
+      (string/trim (str (get-in word '(:a :italiano))
+                        " " (get-string-1 (get-in word '(:b)))))
+
+      ;; TODO: all of the rules that handle exceptions should be removed:
+      ;; exceptions are dealt with at compile-time now, via babel.italiano.morphology/exception-generator
+
+      ;; handle lexical exceptions (plural feminine adjectives):
+      (and
+       (= (get-in word '(:agr :number)) :plur)
+       (= (get-in word '(:agr :gender)) :fem)
+       (= (get-in word '(:cat)) :adjective)
+       (string? (get-in word '(:fem :plur))))
+      (get-in word '(:fem :plur))
+
+      ;; handle lexical exceptions (plural feminine adjectives):
+      (and
+       (= (get-in word '(:agr :number)) :plur)
+       (= (get-in word '(:agr :gender)) :fem)
+       (= (get-in word '(:cat)) :adjective)
+       (string? (get-in word '(:fem :plur))))
+      (get-in word '(:fem :plur))
+
+      ;; handle lexical exceptions (plural masculine adjectives):
+      (and
+       (= (get-in word '(:agr :number)) :plur)
+       (= (get-in word '(:agr :gender)) :masc)
+       (= (get-in word '(:cat)) :adjective)
+       (string? (get-in word '(:masc :plur))))
+      (get-in word '(:masc :plur))
+
+      (and
+       (string? (get-in word [:italiano]))
+       (or (= (get-in word [:agr :gender]) :masc)
+           (= (get-in word [:agr :gender]) :top))
+       (= (get-in word [:agr :number]) :plur)
+       (= (get-in word [:cat]) :adjective))
+      (string/replace (get-in word '[:italiano])
+                      #"[eo]$" "i") ;; nero => neri
+
+      (and
+       (= (get-in word '(:agr :gender)) :fem)
+       (= (get-in word '(:agr :number)) :plur)
+       (= (get-in word '(:cat)) :adjective)
+       (re-find #"o$" (get-in word [:italiano])))
+      (string/replace (get-in word '(:italiano))
+                      #"[o]$" "e") ;; nero => nere
+      (and
+       (= (get-in word '(:agr :gender)) :fem)
+       (= (get-in word '(:agr :number)) :plur)
+       (= (get-in word '(:cat)) :adjective)
+       (re-find #"e$" (get-in word [:italiano])))
+      (string/replace (get-in word '(:italiano))
+                      #"[e]$" "i") ;; difficile => difficili

-     ;; handle lexical exceptions (plural nouns):
-     (and
-      (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:cat)) :noun)
-      (string? (get-in word '(:plur))))
-     (get-in word '(:plur))
-
-     ;; regular masculine nouns
-     (and
-      (string? (get-in word [:italiano]))
-      (= (get-in word '(:agr :gender)) :masc)
-      (= (get-in word '(:agr :number)) :plur)
-      (= :noun (get-in word '(:cat)))
-      (not (= true (get-in word '(:pronoun))))
-      (get-in word '(:italiano)))
-     (string/replace (get-in word '(:italiano))
-                     #"[eo]$" "i") ;; dottore => dottori; medico => medici
-
-     ;; regular feminine nouns ending in 'e':
-     (and
-      (string? (get-in word [:italiano]))
-      (= (get-in word '(:agr :gender)) :fem)
-      (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:cat)) :noun)
+      ;; handle lexical exceptions (plural nouns):
+      (and
+       (= (get-in word '(:agr :number)) :plur)
+       (= (get-in word '(:cat)) :noun)
+       (string? (get-in word '(:plur))))
+      (get-in word '(:plur))
+
+      ;; regular masculine nouns
+      (and
+       (string? (get-in word [:italiano]))
+       (= (get-in word '(:agr :gender)) :masc)
+       (= (get-in word '(:agr :number)) :plur)
+       (= :noun (get-in word '(:cat)))
+       (not (= true (get-in word '(:pronoun))))
+       (get-in word '(:italiano)))
+      (string/replace (get-in word '(:italiano))
+                      #"[eo]$" "i") ;; dottore => dottori; medico => medici
+
+      ;; regular feminine nouns ending in 'e':
+      (and
+       (string? (get-in word [:italiano]))
+       (= (get-in word '(:agr :gender)) :fem)
+       (= (get-in word '(:agr :number)) :plur)
+       (= (get-in word '(:cat)) :noun)
+       (get-in word '(:italiano))
+       (re-find #"e$" (get-in word [:italiano])))
+      (string/replace (get-in word '(:italiano))
+                      #"[e]$" "i") ;; madre => madri
+
+      ;; regular feminine nouns not ending in 'e'
+      (and
+       (string? (get-in word [:italiano]))
+       (= (get-in word '(:agr :gender)) :fem)
+       (= (get-in word '(:agr :number)) :plur)
+       (= (get-in word '(:cat)) :noun)
+       (get-in word '(:italiano)))
+      (string/replace (get-in word '(:italiano))
+                      #"[aà]$" "e") ;; donna => donne
+
+      ;; TODO: move this down to other adjectives.
+      ;; this was moved up here to avoid
+      ;; another rule from matching it.
+      (and
+       (string? (get-in word [:italiano]))
+       (= (get-in word '(:agr :gender)) :fem)
+       (= (get-in word '(:agr :number)) :plur)
+       (= (get-in word '(:cat)) :adjective))
+      (string/replace (get-in word '(:italiano))
+                      #"[eo]$" "e") ;; nero => nere
+
+      ;; TODO: move this down to other adjectives.
+      ;; this was moved up here to avoid
+      ;; another rule from matching it.
+      ;; exceptional feminine singular adjectives
+      (and
+       (= (get-in word '(:agr :gender)) :fem)
+       (= (get-in word '(:agr :number)) :sing)
+       (= (get-in word '(:cat)) :adjective)
+       (string? (get-in word '(:fem :sing))))
+      (get-in word '(:fem :sing))
+
+      ;; TODO: move this down to other adjectives.
+      ;; this was moved up here to avoid
+      ;; another rule from matching it.
+      ;; regular feminine singular adjectives
+      (and
+       (string? (get-in word [:italiano]))
+       (= (get-in word '(:agr :gender)) :fem)
+       (= (get-in word '(:agr :number)) :sing)
+       (= (get-in word '(:cat)) :adjective))
+      (string/replace (get-in word '(:italiano))
+                      #"[eo]$" "a") ;; nero => nera
+
+      (and (= :infinitive (get-in word '(:infl)))
+           (string? (get-in word '(:italiano))))
       (get-in word '(:italiano))
-      (re-find #"e$" (get-in word [:italiano])))
-     (string/replace (get-in word '(:italiano))
-                     #"[e]$" "i") ;; madre => madri
-
-     ;; regular feminine nouns not ending in 'e'
-     (and
-      (string? (get-in word [:italiano]))
-      (= (get-in word '(:agr :gender)) :fem)
-      (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:cat)) :noun)
-      (get-in word '(:italiano)))
-     (string/replace (get-in word '(:italiano))
-                     #"[aà]$" "e") ;; donna => donne
-
-     ;; TODO: move this down to other adjectives.
-     ;; this was moved up here to avoid
-     ;; another rule from matching it.
-     (and
-      (string? (get-in word [:italiano]))
-      (= (get-in word '(:agr :gender)) :fem)
-      (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:cat)) :adjective))
-     (string/replace (get-in word '(:italiano))
-                     #"[eo]$" "e") ;; nero => nere
-
-     ;; TODO: move this down to other adjectives.
-     ;; this was moved up here to avoid
-     ;; another rule from matching it.
-     ;; exceptional feminine singular adjectives
-     (and
-      (= (get-in word '(:agr :gender)) :fem)
-      (= (get-in word '(:agr :number)) :sing)
-      (= (get-in word '(:cat)) :adjective)
-      (string? (get-in word '(:fem :sing))))
-     (get-in word '(:fem :sing))
-
-     ;; TODO: move this down to other adjectives.
-     ;; this was moved up here to avoid
-     ;; another rule from matching it.
-     ;; regular feminine singular adjectives
-     (and
-      (string? (get-in word [:italiano]))
-      (= (get-in word '(:agr :gender)) :fem)
-      (= (get-in word '(:agr :number)) :sing)
-      (= (get-in word '(:cat)) :adjective))
-     (string/replace (get-in word '(:italiano))
-                     #"[eo]$" "a") ;; nero => nera
-
-     (and (= :infinitive (get-in word '(:infl)))
-          (string? (get-in word '(:italiano))))
-     (get-in word '(:italiano))
-
-     (and
-      (get-in word '(:a))
-      (get-in word '(:b)))
-     (str
-      (trim (get-string-1 (get-in word '(:a)))) " "
-      (trim (get-string-1 (get-in word '(:b)))))
+
+      (and
+       (get-in word '(:a))
+       (get-in word '(:b)))
+      (str
+       (trim (get-string-1 (get-in word '(:a)))) " "
+       (trim (get-string-1 (get-in word '(:b)))))

      (and
       (string? (get-in word '(:italiano)))


fix closure warnings

fix closure warnings

--- src/main/shadow/cljs/log.cljc
+++ src/main/shadow/cljs/log.cljc
@@ -130,7 +130,7 @@
          "\n\tProvided: " source-path "/" name
          )))

-(defmethod event->str :closure-warnings
+(defmethod event->str :shadow.cljs.closure/warnings
   [{:keys [warnings]}]
   (->> warnings
        (map :msg)


rearranged function arguments in hello.physics

--- src/maqueta/hello/physics.clj
+++ src/maqueta/hello/physics.clj
@@ -60,7 +60,7 @@
         (.add floor-phy))))

 (defn make-brick
-  [loc app]
+  [app loc]
   (let [brick-geo (Geometry. "brick" box)
         brick-phy (RigidBodyControl. (float 2))]
     (doto brick-geo
@@ -73,18 +73,17 @@
         (.add brick-phy))))

 (defn make-brick-rows
-  [j startpt height app]
+  [app j startpt height]
   (when (> j 0)
     (doseq [i (range 6)]
-      (make-brick (Vector3f. (+ startpt (* i brick-length 2))
-                             (+ brick-height height)
-                             0)
-                  app))
-    (make-brick-rows (- j 1) (- startpt) (+ height (* brick-height 2)) app)))
+      (make-brick app (Vector3f. (+ startpt (* i brick-length 2))
+                                 (+ brick-height height)
+                                 0)))
+    (make-brick-rows app (- j 1) (- startpt) (+ height (* brick-height 2)))))

 (defn init-wall
   [app]
-  (make-brick-rows 15 (/ brick-length 4) 0 app))
+  (make-brick-rows app 15 (/ brick-length 4) 0))

 (defn make-cannon-ball
   [app]
@@ -104,8 +103,9 @@
                                      (.mult (float 25))))))

 (defn init-cross-hairs
-  [gui-node]
-  (let [font (load-font "Interface/Fonts/Default.fnt")
+  [app]
+  (let [gui-node (.getGuiNode app)
+        font (load-font "Interface/Fonts/Default.fnt")
         ch (BitmapText. font false)]
     (.detachAllChildren gui-node)
     (doto ch
@@ -130,7 +130,7 @@
       (.lookAt (Vector3f. 2 2 0) Vector3f/UNIT_Y))
     (init-wall app)
     (init-floor app)
-    (init-cross-hairs (.getGuiNode app))))
+    (init-cross-hairs app)))

 (defn -main
   [& args]


Adjust color of search bar [x] to match active group color

--- src/braid/ui/views/search_bar.cljs
+++ src/braid/ui/views/search_bar.cljs
@@ -7,7 +7,8 @@
             [chat.client.store :as store]
             [chat.client.views.helpers :refer [debounce]]
             [chat.client.reagent-adapter :refer [subscribe]]
-            [chat.client.routes :as routes]))
+            [chat.client.routes :as routes]
+            [chat.client.views.helpers :refer [->color]]))

 (defn search-bar-view
   []
@@ -51,5 +52,6 @@
                        (put! search-chan {:query query})))}]
           (if (seq @search-query)
             [:div.action.clear {:on-click (fn []
-                                            (exit-search!))}]
+                                            (exit-search!))
+                                :style {:color (->color @open-group-id)}}]
             [:div.action.search])])})))


Fix basic system declaration namespacing

Bug left over from a recent refactoring that I didn't have much chance
to discover until I got back to the point where I could try starting the
System again.

This showed me that the way I'm declaring the Client system is broken.

--- src/clj/com/frereth/web/system.clj
+++ src/clj/com/frereth/web/system.clj
@@ -98,16 +98,16 @@
                        ;; Poor name. This is really the frereth-client.
                        ;; Or maybe the frereth-server-connection.
                        ;; TODO: Either way, pick a better one.
-                       :frereth-server com.frereth.client.system/init
+                       :frereth-client com.frereth.client.system/init
                        :http-router com.frereth.web.routes.core/ctor
                        :web-sock-handler com.frereth.web.routes.websock/ctor
                        :web-server com.frereth.web.handler/ctor}
-        dependencies  {:http-router [:frereth-server :web-sock-handler]
+        dependencies  {:http-router [:frereth-client :web-sock-handler]
                        :web-server [:http-router]
                        :web-sock-handler [:frereth-server]
                        :frereth-server [:complete]}]
-    (cpt-dsl/build {:structure constructors
-                    :dependencies dependencies}
+    (cpt-dsl/build #:component-dsl.system{:structure constructors
+                                          :dependencies dependencies}
                    {})))

 ;; TODO: This needs to be a unit test


Minor cosmetic fix on sse impl.

Minor cosmetic fix on sse impl.

--- src/clojure/catacumba/impl/sse.clj
+++ src/clojure/catacumba/impl/sse.clj
@@ -74,8 +74,7 @@
         pub (->> (schannel/publisher out {:close true})
                  (stream/bind-exec))
         tfm (hp/fn->action transform-event)]
-    (exec/execute
-     #(handler context out))
+    (exec/execute #(handler context out))
     (->> (ServerSentEvents/serverSentEvents pub tfm)
          (.render ctx))))


added ability to delete tasks

added ability to delete tasks

--- src/clojure/com/gt/metime/main.clj
+++ src/clojure/com/gt/metime/main.clj
@@ -41,153 +41,163 @@
               (millis-to-format-time millis-complete)))))
       (onFinish [] (finish-fn)))))

-  (defn create-count-up-timer-class
-    ([text-time-view millis-in-future countdown-timer-interval finish-fn] (priv-count-up-timer text-time-view millis-in-future countdown-timer-interval finish-fn 0))
-    ([text-time-view millis-in-future countdown-timer-interval finish-fn start-time] (priv-count-up-timer text-time-view millis-in-future countdown-timer-interval finish-fn start-time)))
-
-  (defn show-picker [activity picker picker-type]
-    (. picker show
-       (. activity getFragmentManager)
-       picker-type))
-
-  (def listing (atom (sorted-map)))
-
-  (defrecord Task [date name duration date-index])
-
-  (defn add-to-listing [event-name date-key time-key]
-    (swap! listing update-in [date-key] (fnil conj []) [event-name time-key]))
-
-  (defn sorted-map-array-to-array-task [lst]
-    (mapcat
-      identity
-      (map
-        (fn [sorted-map-data]
-          (into [] (map-indexed (fn [i ele] (apply ->Task (concat [(first sorted-map-data)] ele [i]))) (second sorted-map-data))))
-        lst)))
-
-  (declare start-timer)
-  (declare stop-timer)
-
-  (def simple-date-format (doto (SimpleDateFormat. "HH:mm:ss")
-                            (.setTimeZone (TimeZone/getTimeZone "GMT"))))
-
-  (defn format-time-to-millis [event-timer-view] (.getTime (.parse simple-date-format (.getText ^TextView event-timer-view))))
-
-  (defn stop-timer [timer duration event-timer-view event-button-view]
-    (config event-button-view :text "Stop")
-    (config event-button-view :on-click (fn [_]
-                                          (.cancel ^CountDownTimer timer)
-                                          (start-timer duration event-timer-view event-button-view (format-time-to-millis event-timer-view)))))
-
-  (defn start-timer [duration event-timer-view event-button-view start-time]
-    (let [timer (create-count-up-timer-class
-                  event-timer-view
-                  (* duration 60000)
-                  1000
-                  (fn []
-                    (on-ui (config event-timer-view :text "Completed."))
-                    (start-timer duration event-timer-view event-button-view 0)
-                    (on-ui (config event-button-view :text "Reset")))
-                  start-time)]
-      (config event-button-view :text "Start")
-      (config event-button-view :on-click (fn [_] (.start ^CountDownTimer timer)
-                                            (stop-timer timer duration event-timer-view event-button-view)))))
-
-  (defn make-date-adapter []
-    (adapters/ref-adapter
-      (fn [_]
-        [:linear-layout {:id-holder   true
-                         :orientation :vertical}
-         [:text-view {:id ::date-tv}]
-         [:linear-layout {:id          ::event-ll
-                          :id-holder   true
-                          :orientation :horizontal}
-          [:text-view {:id ::event-tv}]
-          [:text-view {:id ::goal-tv}]
-          [:text-view {:id ::time-tv}]
-          [:button {:id ::event-btn}]]])
-      (fn [_ view _ task]
-        (let [date-text-view (find-view view ::date-tv)
-              event-linear-layout-view (find-view view ::event-ll)
-              event-text-view (find-view event-linear-layout-view ::event-tv)
-              event-timer-view (find-view event-linear-layout-view ::time-tv)
-              event-button-view (find-view event-linear-layout-view ::event-btn)]
-
-          ;mutates the viz
-          (config date-text-view :visibility (if (= (:date-index task) 0) View/VISIBLE View/GONE))
-          (config date-text-view :text (str (:date task)))
-
-          (start-timer (:duration task) event-timer-view event-button-view 0)
-
-          (config event-text-view :text (str (:name task) " (Goal: " ( millis-to-format-time (* 1000 60 (:duration task))) ") "))))
-      listing
-      sorted-map-array-to-array-task))
-
-  (defn main-layout [activity]
-    [:linear-layout {:orientation :vertical}
-     [:edit-text {
-                  :hint "Event name",
-                  :id   ::name}]
-     [:linear-layout {:orientation :horizontal}
-      [:text-view {:hint "Goal (Time)",
-                   :id   ::time}]
-      [:button {:text     "...",
-                :on-click (fn [_] (show-picker activity
-                                               (time-picker activity), "timePicker"))}]]
-     [:linear-layout {:orientation :horizontal}
-      [:text-view {:hint "Event date",
-                   :id   ::date}]
-      [:button {:text     "...",
-                :on-click (fn [_] (show-picker activity
-                                               (date-picker activity) "datePicker"))}]]
-     [:button {:text     "+ Event",
-               :on-click (fn [_] (add-event activity))}]
-     [:list-view {:id                   ::days
-                  :draw-selector-on-top true
-                  :adapter              (make-date-adapter)}]])
-
-  (defn get-elmt [activity elmt]
-    (str (.getText ^TextView (find-view activity elmt))))
-
-  (defn set-elmt-text [activity elmt s]
-    (on-ui (config (find-view activity elmt) :text s)))
-
-  (defn update-ui [activity]
-    (set-elmt-text activity ::name ""))
-
-  (defn add-event [activity]
-    (let [date-key (try
-                     (read-string (get-elmt activity ::date))
-                     (catch RuntimeException e "Date string is empty!"))
-          time-key (try
-                     (read-string (get-elmt activity ::time))
-                     (catch RuntimeException e "Time string is empty!"))]
-      (when (number? date-key)
-        (add-to-listing (get-elmt activity ::name) date-key time-key)
-        (update-ui activity))))
-
-  (defn date-picker [activity]
-    (proxy [DialogFragment DatePickerDialog$OnDateSetListener] []
-      (onCreateDialog [_]
-        (let [c (Calendar/getInstance)
-              year (.get c Calendar/YEAR)
-              month (.get c Calendar/MONTH)
-              day (.get c Calendar/DAY_OF_MONTH)]
-          (DatePickerDialog. activity this year month day)))
-      (onDateSet [_ year month day]
-        (set-elmt-text activity ::date
-                       (format "%d%02d%02d" year (inc month) day)))))
-
-  (defn time-picker [activity]
-    (proxy [DialogFragment TimePickerDialog$OnTimeSetListener] []
-      (onCreateDialog [_]
-        (TimePickerDialog. activity this 0 0 true))
-      (onTimeSet [_ hourOfDay minute]
-        (set-elmt-text activity ::time
-                       (format "%d" (+ (* hourOfDay 60) minute))))))
-
-  (defactivity com.gt.metime.MainActivity
-               :key :main
-               (onCreate [this bundle]
-                         (.superOnCreate this bundle)
-                         (on-ui (set-content-view! (*a) (main-layout (*a))))))+(defn create-count-up-timer-class
+  ([text-time-view millis-in-future countdown-timer-interval finish-fn] (priv-count-up-timer text-time-view millis-in-future countdown-timer-interval finish-fn 0))
+  ([text-time-view millis-in-future countdown-timer-interval finish-fn start-time] (priv-count-up-timer text-time-view millis-in-future countdown-timer-interval finish-fn start-time)))
+
+(defn show-picker [activity picker picker-type]
+  (. picker show (. activity getFragmentManager) picker-type))
+
+(def listing (atom (sorted-map)))
+
+(defrecord Task [date name duration date-index])
+
+(defn add-to-listing [event-name date-key time-key]
+  (swap! listing update-in [date-key] (fnil conj []) [event-name time-key]))
+
+(defn sorted-map-array-to-array-task [lst]
+  (mapcat
+    identity
+    (map
+      (fn [sorted-map-data]
+        (into [] (map-indexed (fn [i ele] (apply ->Task (concat [(first sorted-map-data)] ele [i]))) (second sorted-map-data))))
+      lst)))
+
+(declare start-timer)
+(declare stop-timer)
+
+(def simple-date-format (doto (SimpleDateFormat. "HH:mm:ss")
+                          (.setTimeZone (TimeZone/getTimeZone "GMT"))))
+
+(defn format-time-to-millis [event-timer-view] (.getTime (.parse simple-date-format (.getText ^TextView event-timer-view))))
+
+(defn stop-timer [timer duration event-timer-view event-button-view]
+  (config event-button-view :text "Stop")
+  (config event-button-view :on-click (fn [_]
+                                        (.cancel ^CountDownTimer timer)
+                                        (start-timer duration event-timer-view event-button-view (format-time-to-millis event-timer-view)))))
+
+(defn start-timer [duration event-timer-view event-button-view start-time]
+  (let [timer (create-count-up-timer-class
+                event-timer-view
+                (* duration 60000)
+                1000
+                (fn []
+                  (on-ui (config event-timer-view :text "Completed."))
+                  (start-timer duration event-timer-view event-button-view 0)
+                  (on-ui (config event-button-view :text "Reset")))
+                start-time)]
+    (config event-button-view :text "Start")
+    (config event-button-view :on-click (fn [_] (.start ^CountDownTimer timer)
+                                          (stop-timer timer duration event-timer-view event-button-view)))))
+
+(defn remove-element-from-vec [date-list index]
+  (vec (concat (subvec date-list 0 index) (subvec date-list (+ index 1)))))
+
+(defn remove-from-listing [date-key date-index]
+  (swap! listing update-in [date-key] (fn [date-list] (remove-element-from-vec date-list date-index))))
+
+(defn make-date-adapter []
+  (adapters/ref-adapter
+    (fn [_]
+      [:linear-layout {:id-holder   true
+                       :orientation :vertical}
+       [:text-view {:id ::date-tv}]
+       [:linear-layout {:id          ::event-ll
+                        :id-holder   true
+                        :orientation :horizontal}
+        [:text-view {:id ::event-tv}]
+        [:text-view {:id ::goal-tv}]
+        [:text-view {:id ::time-tv}]
+        [:button {:id ::event-btn}]
+        [:button {:id   ::delete-btn
+                  :text "del"}]]])
+    (fn [_ view _ task]
+      (let [date-text-view (find-view view ::date-tv)
+            event-linear-layout-view (find-view view ::event-ll)
+            event-text-view (find-view event-linear-layout-view ::event-tv)
+            event-timer-view (find-view event-linear-layout-view ::time-tv)
+            event-button-view (find-view event-linear-layout-view ::event-btn)
+            event-delete-button-view (find-view event-linear-layout-view ::delete-btn)]
+
+        ;mutates the viz
+        (config date-text-view :visibility (if (= (:date-index task) 0) View/VISIBLE View/GONE))
+        (config date-text-view :text (str (:date task)))
+
+        (start-timer (:duration task) event-timer-view event-button-view 0)
+
+        (config event-text-view :text (str (:name task) " (Goal: " (millis-to-format-time (* 1000 60 (:duration task))) ") "))
+
+        (config event-delete-button-view :on-click (fn [_] (remove-from-listing (:date task) (:date-index task))))))
+
+    listing
+    sorted-map-array-to-array-task))
+
+(defn main-layout [activity]
+  [:linear-layout {:orientation :vertical}
+   [:edit-text {
+                :hint "Event name",
+                :id   ::name}]
+   [:linear-layout {:orientation :horizontal}
+    [:text-view {:hint "Goal (Time)",
+                 :id   ::time}]
+    [:button {:text     "...",
+              :on-click (fn [_] (show-picker activity
+                                             (time-picker activity), "timePicker"))}]]
+   [:linear-layout {:orientation :horizontal}
+    [:text-view {:hint "Event date",
+                 :id   ::date}]
+    [:button {:text     "...",
+              :on-click (fn [_] (show-picker activity
+                                             (date-picker activity) "datePicker"))}]]
+   [:button {:text     "+ Event",
+             :on-click (fn [_] (add-event activity))}]
+   [:list-view {:id                   ::days
+                :draw-selector-on-top true
+                :adapter              (make-date-adapter)}]])
+
+(defn get-elmt [activity elmt]
+  (str (.getText ^TextView (find-view activity elmt))))
+
+(defn set-elmt-text [activity elmt s]
+  (on-ui (config (find-view activity elmt) :text s)))
+
+(defn update-ui [activity]
+  (set-elmt-text activity ::name ""))
+
+(defn add-event [activity]
+  (let [date-key (try
+                   (read-string (get-elmt activity ::date))
+                   (catch RuntimeException e "Date string is empty!"))
+        time-key (try
+                   (read-string (get-elmt activity ::time))
+                   (catch RuntimeException e "Time string is empty!"))]
+    (when (number? date-key)
+      (add-to-listing (get-elmt activity ::name) date-key time-key)
+      (update-ui activity))))
+
+(defn date-picker [activity]
+  (proxy [DialogFragment DatePickerDialog$OnDateSetListener] []
+    (onCreateDialog [_]
+      (let [c (Calendar/getInstance)
+            year (.get c Calendar/YEAR)
+            month (.get c Calendar/MONTH)
+            day (.get c Calendar/DAY_OF_MONTH)]
+        (DatePickerDialog. activity this year month day)))
+    (onDateSet [_ year month day]
+      (set-elmt-text activity ::date
+                     (format "%d%02d%02d" year (inc month) day)))))
+
+(defn time-picker [activity]
+  (proxy [DialogFragment TimePickerDialog$OnTimeSetListener] []
+    (onCreateDialog [_]
+      (TimePickerDialog. activity this 0 0 true))
+    (onTimeSet [_ hourOfDay minute]
+      (set-elmt-text activity ::time
+                     (format "%d" (+ (* hourOfDay 60) minute))))))
+
+(defactivity com.gt.metime.MainActivity
+             :key :main
+             (onCreate [this bundle]
+                       (.superOnCreate this bundle)
+                       (on-ui (set-content-view! (*a) (main-layout (*a))))))


Added first implementations of the apply-filter and apply-function functions.

--- kanbanik-statistics/src/main/clojure/org/kanbanik/statistics.clj
+++ kanbanik-statistics/src/main/clojure/org/kanbanik/statistics.clj
@@ -47,7 +47,28 @@
   )
 )

+"Defines the map of functions which can be used"
+(def functions
+  {:cnt (fn [tasks] (count tasks))}
+)

+(defn apply-filter [filter-conditions tasks]
+"
+Takes an example of the task which should be matched and
+returns the list of tasks which are matched by it.
+
+Currently supports only the workflowitem-id.
+"
+(filter (fn [task]
+  (= (:workflowitem-id filter-conditions) (:workflowitem-id task)))
+  tasks)
+)
+
+(defn apply-function [function tasks]
+  ((function functions) tasks)
+)
+
+"maybe delete because the above two should do the trick"
 (defn calculate-one [function filter tasks]
 1
 )


NPE checks for the replaceAll utility function

--- test/clouseau/test_utils.clj
+++ test/clouseau/test_utils.clj
@@ -368,6 +368,19 @@
             "xbbx"  (replaceAll "xaaaax" "aa" "b")
             "xbxbx" (replaceAll "xaaxaax" "aa" "b"))))

+(deftest test-replaceAll-not-NPE
+    "Check the function emender-jenkins.utils/replaceAll."
+    (testing "the function emender-jenkins.utils/replaceAll."
+        (is (= "a" (replaceAll "a" "b" nil)))))
+
+(deftest test-replaceAll-NPE
+    "Check the function emender-jenkins.utils/replaceAll."
+    (testing "the function emender-jenkins.utils/replaceAll."
+        (is (thrown? NullPointerException (replaceAll nil "a" "b")))
+        (is (thrown? NullPointerException (replaceAll "a" nil "b")))
+        (is (thrown? NullPointerException (replaceAll "a" "a" nil)))
+        (is (thrown? NullPointerException (replaceAll nil nil "b")))))
+
 (deftest test-parse-boolean
     "Check the behaviour of function emender-jenkins.config/parse-boolean."
     (are [x y] (= x y)


Fixed test case for binop + expression.

Fixed test case for binop + expression.

--- test/minijava/test_munch.clj
+++ test/minijava/test_munch.clj
@@ -12,7 +12,7 @@
 				(let [tree (BinaryOp :+ (Temp (minijava.ir.temp.Temp.)) (Const 1))]
 				 (is (= (select tree)
            (list (movl (CONST 1) (Temp (minijava.ir.temp.Temp.)))
-           			 (addl (Temp (minijava.ir.temp.Temp.) (Temp (minijava.ir.temp.Temp.)))))
+           			 (addl (Temp (minijava.ir.temp.Temp.)) (Temp (minijava.ir.temp.Temp.))))
 				))))


Fixing, again...

Fixing, again...

--- src/civs/io.clj
+++ src/civs/io.clj
@@ -81,7 +81,7 @@
            complete-world-filename (resolver world-filename)]
       (when
         (nil? complete-world-filename)
-        (throw RuntimeException. (str "Cannot find " world-filename)))
+        (throw (java.lang.RuntimeException. (str "Cannot find " world-filename))))
       (load-world complete-world-filename))))

 (defn PersistentArrayMapReader [value]


Don't replay over an in-progress peer.

Don't replay over an in-progress peer.

--- src/onyx/coordinator/impl.clj
+++ src/onyx/coordinator/impl.clj
@@ -119,16 +119,19 @@
         task-node (:task-node node-data)
         n (n-peers sync state-bucket task-node #{:acking :active :waiting :sealing})
         n-waiting (n-peers sync state-bucket task-node #{:waiting})
-        n-sealing (n-peers sync state-bucket task-node #{:sealing})]
-    (let [state-path (extensions/resolve-node sync :peer-state (:id node-data))
-          peer-state (:content (extensions/dereference sync state-path))
-          state (if (and (= n-waiting (dec n)) (zero? n-sealing))
-                  (assoc peer-state :state :sealing)
-                  (assoc peer-state :state :waiting))]
-      (extensions/create-at sync :peer-state (:id node-data) state)
-      {:seal? (= (:state state) :sealing)
-       :seal-node (:node/seal (:nodes node-data))
-       :exhaust-node (:node/exhaust (:nodes node-data))})))
+        n-sealing (n-peers sync state-bucket task-node #{:sealing})
+        state-path (extensions/resolve-node sync :peer-state (:id node-data))
+        peer-state (:content (extensions/dereference sync state-path))
+        same-task? (= (:task-node peer-state) (:task-node node-data))
+        matching-state? (some #{(:state peer-state)} #{:active :waiting :sealing})
+        state (if (and (= n-waiting (dec n)) (zero? n-sealing))
+                (assoc peer-state :state :sealing)
+                (assoc peer-state :state :waiting))]
+    (when (and (not= (:state peer-state) :sealing) same-task? matching-state?)
+      (extensions/create-at sync :peer-state (:id node-data) state))
+    {:seal? (boolean (and (= (:state state) :sealing) same-task? matching-state?))
+     :seal-node (:node/seal (:nodes node-data))
+     :exhaust-node (:node/exhaust (:nodes node-data))}))

 (defmethod extensions/complete ZooKeeper
   [sync complete-node cooldown-node cb]
@@ -138,9 +141,10 @@
         complete? (task-complete? sync (:task-node peer-state))
         n (n-peers sync (extensions/bucket sync :peer-state)
                    (:task-node peer-state) #{:acking :active})]
-    (if (or (= (:state peer-state) :active)
-            (= (:state peer-state) :sealing)
-            (= (:state peer-state) :dead))
+    (if (and (or (= (:state peer-state) :active)
+                 (= (:state peer-state) :sealing)
+                 (= (:state peer-state) :dead))
+             (= (:task-node peer-state) (:task-node node-data)))
       (let [state (assoc peer-state :state :idle)]
         (when-not (= (:state peer-state) :dead)
           (extensions/create-at sync :peer-state (:id node-data) state))


noc 6_4 small update

noc 6_4 small update

--- examples/NOC/ch06/flowfield_6_4.clj
+++ examples/NOC/ch06/flowfield_6_4.clj
@@ -14,6 +14,7 @@
 (def ^:const ^int w 640)
 (def ^:const ^int h 360)
 (def ^:const ^int resolution 15)
+(def ^:const ^int vehicles-no 120)

 (def ^:const cols (int (/ w resolution)))
 (def ^:const rows (int (/ h resolution)))
@@ -21,10 +22,13 @@
 (defn make-field
   "Create sampled vector field using provided noise function and scales."
   ([noise-fn ^double sx ^double sy]
-   (vec (for [^int i (range cols)]
-          (vec (for [^int j (range rows)]
-                 (let [theta (* m/TWO_PI ^double (noise-fn (* i sx) (* j sy)))]
-                   (Vec2. (m/cos theta) (m/sin theta))))))))
+   (let [^double field-shift-x (r/drand -2 2)
+         ^double field-shift-y (r/drand -2 2)]
+     (vec (for [^int i (range cols)]
+            (vec (for [^int j (range rows)]
+                   (let [theta (* m/TWO_PI ^double (noise-fn (+ field-shift-x (* i sx))
+                                                             (+ field-shift-y (* j sy))))]
+                     (Vec2. (m/cos theta) (m/sin theta)))))))))
   ([] (make-field (j/make-random-fractal-noise) (r/drand 0.005 0.1) (r/drand 0.005 0.1))))

 (defn lookup-field
@@ -46,9 +50,9 @@
                                                     (translate x y)
                                                     (rotate (v/heading v))
                                                     (line 0 0 (/ resolution 1.5) 0)
+                                                    (ellipse 0 0 3 3)
                                                     (pop-matrix)))) vv))) field))
   canvas)
-

 (deftype Vehicle [position
                   velocity
@@ -95,7 +99,7 @@
 (defn draw
   "Draw on canvas"
   [canvas _ _ state]
-  (let [vehicles (or state (repeatedly 120 make-vehicle))]
+  (let [vehicles (or state (repeatedly vehicles-no make-vehicle))]
     (-> canvas
         (set-background :linen)
         (set-color :black 100)


Clarify definition of 'transitive', remove extra fns

--- src/main/clojure/clojure/tools/namespace/dependency.clj
+++ src/main/clojure/clojure/tools/namespace/dependency.clj
@@ -51,15 +51,15 @@

 (defn- transitive
   "Recursively expands the set of dependency relationships starting
-  at (get m x), for each x in node-set"
-  [m node-set]
-  (loop [unexpanded (mapcat #(get m %) node-set)
+  at (get neighbors x), for each x in node-set"
+  [neighbors node-set]
+  (loop [unexpanded (mapcat neighbors node-set)
          expanded #{}]
-    (if-let [unexpanded (seq unexpanded)]
-      (let [[n & ns] unexpanded]
-        (if (contains? expanded n)
-          (recur ns expanded)
-          (recur (concat ns (get m n)) (conj expanded n))))
+    (if-let [[node & more] (seq unexpanded)]
+      (if (contains? expanded node)
+        (recur more expanded)
+        (recur (concat more (neighbors node))
+               (conj expanded node)))
       expanded)))

 (declare depends?)


Move sequence realization to with-open

Move sequence realization to with-open

--- src/hu/ssh/github_changelog/dependencies/bundler.clj
+++ src/hu/ssh/github_changelog/dependencies/bundler.clj
@@ -7,8 +7,7 @@
   (->> (line-seq reader)
        (drop-while #(not= % "  specs:"))
        (drop 1)
-       (take-while seq)
-       doall))
+       (take-while seq)))

 (defn- parse-spec [spec]
   {:name (second spec) :version (nth spec 2)})
@@ -20,4 +19,4 @@

 (defn parse [file]
   (with-open [reader (io/reader file)]
-    (parse-specs (get-specs reader))))
+    (doall (parse-specs (get-specs reader)))))


Remove cljs boiler plate code

Remove cljs boiler plate code

Makes the cljs much nicer to look at! :)

--- src/webapp/framework/client/webhosting/hostmain.cljs
+++ src/webapp/framework/client/webhosting/hostmain.cljs
@@ -24,6 +24,14 @@

+(def start "(ns webapp.framework.client.fns
+  (:require-macros
+    [webapp.framework.client.macros :refer [ ns-coils   div button input span defn-ui-component]]))
+(ns-coils 'webapp.framework.client.fns)")
+(def end "(webapp.framework.client.system-globals.touch [:ui])")
+
+
+

@@ -31,7 +39,7 @@
   (go
     (let [code (js/getCodeMirrorValue)]
       (remote !savecode {:id app-id :code code})
-      (js/sendcode (str code))
+      (js/sendcode (str start code end ))
       )))


Add test for dangling ref inside or

Add test for dangling ref inside or

This edge case seems particularly thorny and worth including.

--- test/aero/core_test.cljc
+++ test/aero/core_test.cljc
@@ -225,3 +225,9 @@
         config (#?(:cljs source-logging-push-back-reader
                    :clj java.io.StringReader.) config-str)]
     (is (= "foo" (:x (read-config config))))))
+
+(deftest or-dangling-ref
+  (let [config-str "{:y #or [#ref [:x] \"bar\"]}"
+        config (#?(:cljs source-logging-push-back-reader
+                   :clj java.io.StringReader.) config-str)]
+    (is (= "bar" (:y (read-config config))))))


Add check for :ttl-mins config value in C* ring session

--- systems/ring-session-cassandra/src/containium/systems/ring_session_cassandra.clj
+++ systems/ring-session-cassandra/src/containium/systems/ring_session_cassandra.clj
@@ -93,6 +93,7 @@
                        config "...")
             _ (ensure-schema cassandra)
             ttl-mins (:ttl-mins config)
+            _ (assert ttl-mins "Missing :ttl-mins config")
             read-q (prepare cassandra "SELECT data FROM ring.sessions WHERE key = ?;")
             ;; TTL in the database queure is twice as what is configured, as unchanged session
             ;; data is only written once in TTL minutes to the database.


[#3073] Remove TODOs

[#3073] Remove TODOs

* The backward compatibility will be tackled later
* Optimizing the definition of the `instance_id` will be another issue

--- backend/src/akvo/lumen/lib/transformation/merge_datasets.clj
+++ backend/src/akvo/lumen/lib/transformation/merge_datasets.clj
@@ -150,11 +150,6 @@

 (defn get-data-groups-to-be-created [conn source target-dataset-columns]
   (let [dataset-id (get source "datasetId")
-        ;; TODO what would happen if dataset source doesn't have data-groups (old dataset => dataset-version-1)
-        ;; expected shape to return [{:columns :table-name :group-id :group-name :repeatable :group-order }]
-        ;; take care of group-order
-        ;; perhaps group-id and group-name should be unique
-        ;; form-instance-id as internal joined column, what do do now???
         dataset-version (db.dataset-version/latest-dataset-version-2-by-dataset-id conn {:dataset-id dataset-id})
         data-groups     (db.data-group/list-data-groups-by-dataset-version-id
                          conn
@@ -169,7 +164,7 @@
                                                                         (+ (engine/next-column-index target-dataset-columns) i)))
                                                    reset-column-values))))
                               (group-by #(get % "groupId")))
-        instance-id-column (->> (db.data-group/get-data-group-by-column-name ;; TODO: define column as a var? (def instance-id-col {})
+        instance-id-column (->> (db.data-group/get-data-group-by-column-name
                                  conn
                                  {:column-name "instance_id"
                                   :dataset-version-id (:id dataset-version) })
@@ -242,14 +237,12 @@
                                                                              (:columnName %)))
                                                             (walk/keywordize-keys columns)))
         (jdbc/insert-multi! conn table-name data)))
-    #_(map #(dissoc % :original-table-name) data-groups-to-be-created)
     {:success? true
      :data-groups-to-be-created data-groups-to-be-created
      :execution-log [(format "Merged columns from %s into %s"
                              "(:table-name source-dataset)"
                              table-name)]
-     :columns (vec columns)}
-    ))
+     :columns (vec columns)}))

 (defn apply-merge-operation
   [conn table-name columns op-spec]


Fixing large virtual product queue in ops.

--- virtual-product-app/src/cmr/virtual_product/services/virtual_product_service.clj
+++ virtual-product-app/src/cmr/virtual_product/services/virtual_product_service.clj
@@ -31,11 +31,10 @@
 (defn subscribe-to-ingest-events
   "Subscribe to messages on the indexing queue."
   [context]
-  (when (config/virtual-products-enabled)
-    (let [queue-broker (get-in context [:system :queue-broker])
-          queue-name (config/virtual-product-queue-name)]
-      (dotimes [n (config/queue-listener-count)]
-        (queue/subscribe queue-broker queue-name #(handle-ingest-event context %))))))
+  (let [queue-broker (get-in context [:system :queue-broker])
+        queue-name (config/virtual-product-queue-name)]
+    (dotimes [n (config/queue-listener-count)]
+      (queue/subscribe queue-broker queue-name #(handle-ingest-event context %)))))

 (def source-provider-id-entry-titles
   "A set of the provider id entry titles for the source collections."


slam incoming perf-asmts

slam incoming perf-asmts

--- src/oarlock.clj
+++ src/oarlock.clj
@@ -18,7 +18,7 @@
   (tx-entity! db-conn :task task))

 (defn perf-asmt-in [db-conn perf-asmt]
-  (tx-entity! db-conn :perf-asmt perf-asmt))
+  (tx-entity! db-conn :perf-asmt (hatch/slam-all perf-asmt :user)))

 (defn student2perf-asmt-in [db-conn user2perf-asmt]
   (tx-entity! db-conn :student2perf-asmt user2perf-asmt))


Story ID: develop fixed version...my bad

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject untangled-spec "0.2.2"
+(defproject untangled-spec "0.2.3-SNAPSHOT"
   :description "A Behavioral specification system for clj and cljs stacked on clojure.test"
   :url ""
   :license {:name "MIT Public License"


v0.5.2

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject employeerepublic/er-cassandra "0.5.1"
+(defproject employeerepublic/er-cassandra "0.5.2"
   :description "a simple cassandra conector"
   :url "https://github.com/employeerepublic/er-cassandra"
   :license {:name "Eclipse Public License"


Update cheshire dependenency.

Update cheshire dependenency.

--- project.clj
+++ project.clj
@@ -14,6 +14,6 @@
                    :dependencies [[org.clojure/clojure "1.7.0-beta2"]
                                   [postgresql "9.3-1102.jdbc41"]
                                   [com.h2database/h2 "1.4.187"]
-                                  [cheshire "5.4.0"]]}}
+                                  [cheshire "5.5.0"]]}}
   :java-source-paths ["src/java"])