made all tracking owner/current-state agnostic

--- src-cljs/frontend/analytics/core.cljs
+++ src-cljs/frontend/analytics/core.cljs
@@ -102,12 +102,6 @@
       (add-properties-to-track-from-owner)
       (merge props)))

-(defn- get-user-properties-from-state [current-state]
-  (let [analytics-id (get-in current-state state/user-analytics-id-path)
-        user-data (get-in current-state state/user-path)]
-    {:id analytics-id
-     :user-properties (select-keys user-data (keys common-analytics/UserProperties))}))
-
 (defn- supplement-tracking-properties-from-state [props current-state]
   "Fill in any unsuppplied property values with those supplied
   in the current app state."
@@ -144,43 +138,58 @@
   (when (frontend.config/analytics-enabled?)
     (merror-unsupported-event (:event-type data))))

+(defn- supplement-tracking-properties [{:keys [properties owner current-state]}]
+  (if owner
+    (supplement-tracking-properties-from-owner properties owner)
+    (supplement-tracking-properties-from-state properties current-state)))
+
 (s/defmethod track :event [event-data :- AnalyticsEvent]
   (let [{:keys [event-type properties owner current-state]} event-data]
-    (if owner
-      (segment/track-event event-type (supplement-tracking-properties-from-owner properties owner))
-      (segment/track-event event-type (supplement-tracking-properties-from-state properties current-state)))))
-
-(s/defmethod track :track-controller-events [event-data :- AnalyticsEventForControllers]
-  (let [{:keys [event-type properties current-state]} event-data]
-    (segment/track-event event-type (supplement-tracking-properties-from-state properties current-state)))
+    (segment/track-event event-type (supplement-tracking-properties {:properties properties
+                                                                     :owner owner
+                                                                     :current-state current-state}))))

 (s/defmethod track :external-click [event-data :- ExternalClickEvent]
-  (let [{:keys [event properties owner]} event-data]
+  (let [{:keys [event properties owner current-state]} event-data]
     (if (supported-click-and-impression-events (:event event-data))
-      (segment/track-external-click event (supplement-tracking-properties-from-owner properties owner))
+      (segment/track-external-click event (supplement-tracking-properties {:properties properties
+                                                                           :owner owner
+                                                                           :current-state current-state}))
       (merror-unsupported-event (:event event-data)))))

 (s/defmethod track :pageview [event-data :- PageviewEvent]
-  (let [{:keys [navigation-point properties current-state]} event-data]
-    (segment/track-pageview navigation-point (supplement-tracking-properties-from-state properties current-state))))
+  (let [{:keys [navigation-point properties owner current-state]} event-data]
+    (segment/track-pageview navigation-point (supplement-tracking-properties {:properties properties
+                                                                              :owner owner
+                                                                              :current-state current-state}))))

 (s/defmethod track :build-triggered [event-data :- BuildEvent]
-  (let [{:keys [build properties owner]} event-data
+  (let [{:keys [build properties owner current-state]} event-data
         props (merge {:project (vcs-url/project-name (:vcs_url build))
                       :build-num (:build_num build)
                       :retry? true}
                      properties)]
-    (segment/track-event :build-triggered (supplement-tracking-properties-from-owner props owner))))
+    (segment/track-event :build-triggered (supplement-tracking-properties {:properties properties
+                                                                           :owner owner
+                                                                           :current-state current-state}))))

 (s/defmethod track :view-build [event-data :- BuildEvent]
-  (let [{:keys [build properties current-state]} event-data
+  (let [{:keys [build properties owner current-state]} event-data
         props (merge (build-properties build) properties)
         user (get-in current-state state/user-path)]
-    (segment/track-event :view-build (supplement-tracking-properties-from-state props current-state))
+    (segment/track-event :view-build (supplement-tracking-properties {:properties properties
+                                                                      :owner owner
+                                                                      :current-state current-state}))
     (when (and (:oss build) (build-model/owner? build user))
       (intercom/track :viewed-self-triggered-oss-build
                       {:vcs-url (vcs-url/project-name (:vcs_url build))
                        :outcome (:outcome build)}))))

+(defn- get-user-properties-from-state [current-state]
+  (let [analytics-id (get-in current-state state/user-analytics-id-path)
+        user-data (get-in current-state state/user-path)]
+    {:id analytics-id
+     :user-properties (select-keys user-data (keys common-analytics/UserProperties))}))
+
 (s/defmethod track :init-user [event-data :- AnalyticsEvent]
   (segment/identify (get-user-properties-from-state (:current-state event-data))))


Remove dead code

Remove dead code

--- src/zaffre/glterminal.clj
+++ src/zaffre/glterminal.clj
@@ -106,7 +106,6 @@
         height         (.getHeight buffered-image)
         texture-id     (GL11/glGenTextures)
         texture-buffer ^ByteBuffer (zimgutil/buffered-image-byte-buffer buffered-image)]
-     ;;(.order texture-buffer (ByteOrder/nativeOrder))
      (GL11/glBindTexture GL11/GL_TEXTURE_2D texture-id)
      (GL11/glPixelStorei GL11/GL_UNPACK_ALIGNMENT 1)
      (GL11/glTexParameteri GL11/GL_TEXTURE_2D GL11/GL_TEXTURE_MIN_FILTER GL11/GL_NEAREST)
@@ -125,7 +124,6 @@
    (texture-id width height layers (BufferUtils/createByteBuffer (* width height 4 layers))))
   ([^long width ^long height ^long layers ^ByteBuffer texture-buffer]
    (let [texture-id (GL11/glGenTextures)]
-     ;;(.order texture-buffer (ByteOrder/nativeOrder))
      (GL11/glBindTexture GL30/GL_TEXTURE_2D_ARRAY texture-id)
      (GL11/glPixelStorei GL11/GL_UNPACK_ALIGNMENT 1)
      (GL11/glTexParameteri GL30/GL_TEXTURE_2D_ARRAY GL11/GL_TEXTURE_MIN_FILTER GL11/GL_NEAREST)
@@ -137,7 +135,6 @@

 (defn- xy-texture-id [^long width ^long height ^long layers ^ByteBuffer texture-buffer]
   (let [texture-id (GL11/glGenTextures)]
-    ;;(.order texture-buffer (ByteOrder/nativeOrder))
     (GL11/glBindTexture GL30/GL_TEXTURE_2D_ARRAY texture-id)
     (GL11/glTexParameteri GL30/GL_TEXTURE_2D_ARRAY GL11/GL_TEXTURE_MIN_FILTER GL11/GL_NEAREST)
     (GL11/glTexParameteri GL30/GL_TEXTURE_2D_ARRAY GL11/GL_TEXTURE_MAG_FILTER GL11/GL_NEAREST)
@@ -342,7 +339,6 @@
       (set! (.m33 ortho-matrix) m33)
       (.clear matrix-buffer)
       (.get ortho-matrix matrix-buffer)
-      ;(.flip matrix-buffer)
       matrix-buffer)))

 (defn position-matrix-buffer
@@ -355,7 +351,6 @@
       (.scale matrix (Vector3f. (get s 0) (get s 1) (get s 2)))
       (.clear matrix-buffer)
       (.get matrix matrix-buffer)
-      ;(.flip matrix-buffer)
       matrix-buffer)))

 (defn- init-buffers []
@@ -615,9 +610,6 @@
           (.position glyph-image-data (* glyph-texture-width glyph-texture-height 4 (inc layer)))
           (.position fg-image-data    (* glyph-texture-width glyph-texture-height 4 (inc layer)))
           (.position bg-image-data    (* glyph-texture-width glyph-texture-height 4 (inc layer))))
-        #_(.position glyph-image-data (.limit glyph-image-data))
-        #_(.position fg-image-data (.limit fg-image-data))
-        #_(.position bg-image-data (.limit bg-image-data))
         (.flip glyph-image-data)
         (.flip fg-image-data)
         (.flip bg-image-data)
@@ -648,16 +640,12 @@
           (GL30/glBindVertexArray vao-id)
           (except-gl-errors (str "vao bind - glBindVertexArray " vao-id))
           ; Setup vertex buffer
-          ;(GL15/glBindBuffer GL15/GL_ARRAY_BUFFER, vertices-vbo-id)
           (except-gl-errors (str "vbo bind - glBindBuffer " vertices-vbo-id))
           (GL20/glEnableVertexAttribArray 0);pos-vertex-attribute)
           (except-gl-errors "vbo bind - glEnableVertexAttribArray")
-          ;;(GL20/glVertexAttribPointer 0 3 GL11/GL_FLOAT false 0 0)
           (except-gl-errors "vbo bind - glVertexAttribPointer")
           ; Setup uv buffer
-          ;(GL15/glBindBuffer GL15/GL_ARRAY_BUFFER, texture-coords-vbo-id)
           (GL20/glEnableVertexAttribArray 1);texture-coords-vertex-attribute)
-          ;;(GL20/glVertexAttribPointer 1 2 GL11/GL_FLOAT false 0 0)
           (except-gl-errors "texture coords bind")
           ; Setup font texture
           (GL13/glActiveTexture GL13/GL_TEXTURE0)
@@ -1105,7 +1093,6 @@
                            window
                            capabilities)]
       ;; Access to terminal will be multi threaded. Release context so that other threads can access it)))
-      ;(Display/releaseContext)
       (when @fullscreen
         (zat/fullscreen! terminal (first (zat/fullscreen-sizes terminal))))
       ;; Start font file change listener thread
@@ -1138,7 +1125,6 @@
               (except-gl-errors "Start of loop")
               ; Process messages in the main thread rather than the input go-loop due to Windows only allowing
               ; input on the thread that created the window
-              ;(Display/processMessages)
               (GLFW/glfwPollEvents)
               ;; Close the display if the close window button has been clicked
               ;; or the gl-lock has been released programmatically (e.g. by destroy!)


Fix order of shapes rendering in canvas.

--- src/uxbox/ui/workspace/canvas.cljs
+++ src/uxbox/ui/workspace/canvas.cljs
@@ -58,7 +58,7 @@
       [:svg.page-layout {}
        (shapes-selection)
        [:g.main {}
-        (for [item (:shapes page)]
+        (for [item (reverse (:shapes page))]
           (-> (uus/shape item)
               (rum/with-key (str item))))
         (draw-area)]]])))


Fix yetibot adapters schema for ssl option

--- src/yetibot/core/adapters/init.clj
+++ src/yetibot/core/adapters/init.clj
@@ -19,7 +19,7 @@
     ;; IRC
     (s/optional-key :host) s/Str
     (s/optional-key :port) s/Str
-    (s/optional-key :ssl?) s/Str
+    (s/optional-key :ssl) s/Str
     (s/optional-key :username) s/Str
     (s/optional-key :password) s/Str}])


fixing find-reachable-attrs

fixing find-reachable-attrs

--- src/synthesis_crawlers/core.clj
+++ src/synthesis_crawlers/core.clj
@@ -203,16 +203,22 @@
   (println "given: " attr-nodes)
   (let [result (for [[url attr-nodes] attr-nodes
                      [attr nodes] attr-nodes
-                     node (set (flatten (map reachable-elements nodes)))]
-                 [url [node attr]])]
-    (println "result: " result)
-    (println "--")
-    (reduce (fn [acc [url [node attr]]]
-              (let [node-attr (get acc url {})
-                    attrs (get node-attr node #{})]
-                (assoc acc url (assoc node-attr node (conj attrs attr)))))
-            {}
-            result)))
+                     node (set (map #(.cssSelector %)
+                                    (flatten (map reachable-elements nodes))))]
+                 [url [node attr]])
+        url-root (zipmap (keys attr-nodes) (map #(.ownerDocument (first (second (first %))))
+                                                (vals attr-nodes)))
+        reachable-attrs (reduce (fn [acc [url [node attr]]]
+                                  (let [node-attr (get acc url {})
+                                        attrs (get node-attr node #{})]
+                                    (assoc acc url (assoc node-attr node (conj attrs attr)))))
+                                {}
+                                result)
+        ]
+    (println "url-root: " url-root)
+    (println "reachable-attrs: " reachable-attrs)
+    #_(println "vals:" (map #(.cssSelector %) (keys (reachable-attrs "http://example.com/1"))))
+    reachable-attrs))

 (s/fdef find-support-nodes
         :args (s/cat :attr-nodes ::attributed-nodes-in-pages))


get-array working solution

get-array working solution

--- src/tic_tac_toe/tic_tac_toe.clj
+++ src/tic_tac_toe/tic_tac_toe.clj
@@ -29,12 +29,19 @@
 ;; 0 - put at random first empty
 ;; 1 - algorithm - think where is best to place char

+
 ;; in-progres:

+;; improve?
+;; change [0 0] -> {:row 0 :col 0}

+;; http://stackoverflow.com/questions/3937729/putting-doc-strings-on-data-vars-is-it-considered-idiomatic
+;; todo: make it random at startup
+(def
+  ^{:doc "current player char" }
+  current-player \o)

-
-(def array [[nil nil nil]
+(def *array* [[nil nil nil]
             [nil nil nil]
             [nil nil nil]])

@@ -51,7 +58,7 @@
   (println))

 ;; print array state
-(print-array array)
+(print-array *array*)

 ;; 3 get player input
 ;; (with-in-str "0 0"
@@ -68,3 +75,10 @@
 ;; (map-to-ints (split "00" #""))

 ;; ((memfn Integer/parseInt) "1") ; dont work
+
+(defn get-array [input]
+  (let [row (nth *array* (first input))]
+    (assoc *array* (first input)
+      (assoc row (second input) \o))))
+
+;; (get-array [0 0])


[test fix] for now, preserve combined file and ordered weight loading path

--- keras/src/think/cortex/keras/core.clj
+++ keras/src/think/cortex/keras/core.clj
@@ -387,9 +387,9 @@
   throws an exception if unable to parse."
   [out-name]
   (let [parts (string/split out-name #"_")]
-    (if (= (count parts) 2)
+    (if (= (count parts) 4)
       {:index (Long/parseLong (parts 1))
-       :layer-type (keyword (parts 0))}
+       :layer-type (keyword (parts 3))}
       (throw (ex-info "Expected format 'layertype_index' where index is an unsigned integer."
                 {:cause      :bad-layer-name
                  :layer-name out-name
@@ -469,6 +469,27 @@
                       {:cause :missing-output
                        :layer lyr-map})))))
         desc-seq))
+
+
+(defn- ordered-layer-outputs
+  "Output a layer output per desc associated with that desc.
+  Output may be nil for a given desc."
+  [desc-seq output-seq]
+  (loop [desc (first desc-seq)
+         desc-seq (rest desc-seq)
+         output-seq output-seq
+         retval []]
+    (if desc
+      (let [[retval output-seq] (if (:embedded-activation desc)
+                                  [(conj retval [desc nil]) output-seq]
+                                  [(conj retval [desc (if (contains? desc :embedded)
+                                                        (assoc (first output-seq) :layer-type :Activation)
+                                                        (first output-seq))])
+                                   (rest output-seq)])]
+        (recur (first desc-seq) (rest desc-seq) output-seq retval))
+      retval)))
+
+

 (defn- check-output-dims
   "Given a mapping of vector tuples of built layer descriptions and output weights,
@@ -536,7 +557,7 @@
                       (double-array (vec (repeat (reduce * input-shape) 1.0))))
           input (to-core-matrix file-data input-shape)
           layer-outputs (->> (layer-output->ordered-data (:layer_outputs file-child-map))
-                             (associate-layer-outputs (drop 1 built-description))
+                             (ordered-layer-outputs (drop 1 built-description))
                              (mapv reshape-layer-outputs))

           type-map (vec (map vector


[#2486] Fix geo-shape-features

[#2486] Fix geo-shape-features

--- backend/src/akvo/lumen/lib/transformation/multiple_column/geo_shape_features.clj
+++ backend/src/akvo/lumen/lib/transformation/multiple_column/geo_shape_features.clj
@@ -12,7 +12,7 @@

 (defn columns-to-extract [columns selected-column extractImage]
   (let [columns   (filter :extract columns)
-        base-column (dissoc selected-column :multipleId :type :multipleType :columnName :title)]
+        base-column (dissoc selected-column :multipleId :type :multipleType :columnName :title :groupName :groupId)]
     (map #(assoc base-column :title (:name %) :type (:type %) :internal-id (:id %)) columns)))

 (defn- extract-values


[Close #2] using reftype

[Close #2] using reftype

--- src/clj_elm/core.clj
+++ src/clj_elm/core.clj
@@ -191,13 +191,13 @@

 (defn -main []
   (printfl "Start exp\n")
-  (def dataset-cover (read-dataset "data/australian.csv" 14 :header true))
+  (def dataset (atom (read-dataset "data/australian.csv" 14 :header true)))
   (printfl "Fin read-data outguess_all_0.0.csv\n")
-  (def dataset-stego (read-dataset "data/australian.csv" 14 :header true))
+  (def datasets (atom (read-dataset "data/australian.csv" 14 :header true)))
   (printfl "Fin read-data outguess_all_1.0.csv\n")
-  (def dataset-row (data/concat-dataset dataset-cover dataset-stego))
+  (reset! dataset (data/concat-dataset @dataset @datasets))
   (printfl "Fin data concat\n")
-  (def dataset (data/shuffle-dataset dataset-row))
+  (reset! dataset (data/shuffle-dataset @dataset))
   (printfl "Fin data shuffle\n")
-  (printfl (str (cross-validate dataset 100 10) "\n"))
+  (printfl (str (cross-validate @dataset 100 10) "\n"))
   (System/exit 0))


extra note

extra note

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

--- plugins/SlideExplorer2/src/slide_explorer/flatfield.clj
+++ plugins/SlideExplorer2/src/slide_explorer/flatfield.clj
@@ -40,6 +40,7 @@
 ;; I do with channel overlays? Memoization key here.
 ;; Correction image can perhaps be generated using the remedian algorithm.
 ;; See http://web.ipac.caltech.edu/staff/fmasci/home/statistics_refs/Remedian.pdf
+;; flattening seems to take around 5 ms on my computer.

 (defn re-flatten [in-dir out-dir flat-field-by-channel]
   (let [out-cache (tile-cache/create-tile-cache 200 out-dir false)]


:fire: Remove debug info from worker.

:fire: Remove debug info from worker.

--- frontend/src/uxbox/worker/selection.cljs
+++ frontend/src/uxbox/worker/selection.cljs
@@ -31,7 +31,6 @@

 (defmethod impl/handler :selection/create-index
   [{:keys [file-id pages] :as message}]
-  (js/console.log :selection/create-index file-id)
   (letfn [(index-page [state page]
             (let [id (:id page)
                   objects (get-in page [:data :objects])
@@ -42,33 +41,29 @@
           (update-state [state]
             (reduce index-page state pages))]

-    (time
-     (swap! state update-state))
+    (swap! state update-state)
     nil))

 (defmethod impl/handler :selection/update-index
   [{:keys [page-id objects] :as message}]
-  (js/console.log :selection/update-index page-id)
   (letfn [(update-page [_]
             (let [objects (reduce resolve-object {} (vals objects))
                   index   (create-index objects)]
               {:index index :objects objects}))]
-    (time
-     (swap! state update page-id update-page))
+    (swap! state update page-id update-page)
     nil))

 (defmethod impl/handler :selection/query
   [{:keys [page-id rect] :as message}]
-  (time
-   (when-let [{:keys [index objects]} (get @state page-id)]
-     (let [lookup #(get objects %)
-           result (-> (qdt/search index (clj->js rect))
-                      (es6-iterator-seq))
-           matches? #(geom/overlaps? % rect)]
-       (into #{} (comp (map #(unchecked-get % "data"))
+  (when-let [{:keys [index objects]} (get @state page-id)]
+    (let [lookup #(get objects %)
+          result (-> (qdt/search index (clj->js rect))
+                     (es6-iterator-seq))
+          matches? #(geom/overlaps? % rect)]
+      (into #{} (comp (map #(unchecked-get % "data"))
                        (filter matches?)
                        (map :id))
-             result)))))
+            result))))

 (defn- calculate-bounds
   [objects]


:bug: Fixes broken test

:bug: Fixes broken test


create service config param only if name is known.

--- db-serializers/src/com/sixsq/slipstream/db/serializers/utils.clj
+++ db-serializers/src/com/sixsq/slipstream/db/serializers/utils.clj
@@ -147,26 +147,27 @@

 (defn build-sc-param
   [value desc & [category]]
-  (let [name (qualified-pname desc category)
-        scp  (ServiceConfigurationParameter. name
-                                             (str value)
-                                             (:description desc))]
-    (when desc
-      (when (or category (:category desc))
-        (.setCategory scp (or category (:category desc))))
-      (when-not (nil? (:mandatory desc))
-        (.setMandatory scp (as-boolean (:mandatory desc))))
-      (when (:type desc)
-        (.setType scp (ParameterType/valueOf (s/capitalize (:type desc)))))
-      (when-not (nil? (:readOnly desc))
-        (.setReadonly scp (as-boolean (get desc :readOnly (:readOnly desc)))))
-      (when (:order desc)
-        (.setOrder scp (read-str (:order desc))))
-      (when (:instructions desc)
-        (.setInstructions scp (:instructions desc)))
-      (when-not (empty? (:enum desc))
-        (.setEnumValues scp (:enum desc))))
-    scp))
+  (when-let [name (qualified-pname desc category)]
+    (let
+      [scp (ServiceConfigurationParameter. name
+                                           (str value)
+                                           (or (:description desc) ""))]
+      (when desc
+        (when (or category (:category desc))
+          (.setCategory scp (or category (:category desc))))
+        (when-not (nil? (:mandatory desc))
+          (.setMandatory scp (as-boolean (:mandatory desc))))
+        (when (:type desc)
+          (.setType scp (ParameterType/valueOf (s/capitalize (:type desc)))))
+        (when-not (nil? (:readOnly desc))
+          (.setReadonly scp (as-boolean (get desc :readOnly (:readOnly desc)))))
+        (when (:order desc)
+          (.setOrder scp (read-str (:order desc))))
+        (when (:instructions desc)
+          (.setInstructions scp (:instructions desc)))
+        (when-not (empty? (:enum desc))
+          (.setEnumValues scp (:enum desc))))
+      scp)))

 (defn desc-from-param
   [p]


Get image and description from section template when putting a section. Get headline from the section update, the last revision or the template.

--- src/open_company/resources/section.clj
+++ src/open_company/resources/section.clj
@@ -202,8 +202,9 @@
   (put-section company-slug (keyword section-name) section user timestamp))

   ([company-slug section-name section user timestamp]
-  (let [original-company (company/get-company company-slug)
-        original-section (get-section company-slug section-name)
+  (let [original-company (company/get-company company-slug) ; company before the update
+        original-section (get-section company-slug section-name) ; section before the update
+        template-section (common/section-by-name section-name) ; canonical version of this section
         author (common/author-for-user user)
         updated-section (-> section
           (clean)
@@ -212,6 +213,9 @@
           (assoc :section-name section-name)
           (assoc :author author)
           (assoc :updated-at timestamp)
+          (assoc :image (:image template-section)); read-only property
+          (assoc :description (:description template-section)); read-only property
+          (assoc :headline (or (:headline section) (:headline original-section) (:headline template-section)))
           (update-notes-for (original-company section-name) author timestamp))
         updated-sections (sections-with (:sections original-company) section-name)
         sectioned-company (assoc original-company :sections updated-sections)


GTXDataset histogram uses pre-instantiated kernels.

--- src/clojure/uncomplicate/bayadera/internal/nvidia_gtx.clj
+++ src/clojure/uncomplicate/bayadera/internal/nvidia_gtx.clj
@@ -106,12 +106,19 @@
 ;; ============================ Dataset engine =================================

 (deftype GTXDatasetEngine [ctx modl hstream ^long WGS
-                           sum-reduction-kernel mean-kernel variance-kernel]
+                           sum-reduction-kernel mean-kernel variance-kernel
+                           min-max-reduction-kernel min-max-kernel histogram-kernel
+                           uint-to-real-kernel local-sort-kernel]
   Releaseable
   (release [_]
     (release sum-reduction-kernel)
     (release mean-kernel)
     (release variance-kernel)
+    (release min-max-reduction-kernel)
+    (release min-max-kernel)
+    (release histogram-kernel)
+    (release uint-to-real-kernel)
+    (release local-sort-kernel)
     (release modl))
   DatasetEngine
   (data-mean [this data-matrix]
@@ -161,12 +168,7 @@
                       uint-res (mem-alloc (* Integer/BYTES WGS m))
                       limits (ge data-matrix 2 m)
                       result (ge data-matrix WGS m)
-                      bin-ranks (ge data-matrix WGS m)
-                      min-max-reduction-kernel (function modl "min_max_reduction")
-                      min-max-kernel (function modl "min_max_reduce")
-                      histogram-kernel (function modl "histogram")
-                      uint-to-real-kernel (function modl "uint_to_real")
-                      local-sort-kernel (function modl "bitonic_local")]
+                      bin-ranks (ge data-matrix WGS m)]
          (launch-reduce! hstream min-max-kernel min-max-reduction-kernel
                          [cu-min-max (buffer data-matrix)] [cu-min-max]
                          m n wgsm wgsn)
@@ -625,8 +627,16 @@
         (let-release [modl (module prog)
                       sum-reduction-kernel (function modl "sum_reduction_horizontal")
                       mean-kernel (function modl "mean_reduce")
-                      variance-kernel (function modl "variance_reduce")]
-          (->GTXDatasetEngine ctx modl hstream WGS sum-reduction-kernel mean-kernel variance-kernel)))))
+                      variance-kernel (function modl "variance_reduce")
+                      min-max-reduction-kernel (function modl "min_max_reduction")
+                      min-max-kernel (function modl "min_max_reduce")
+                      histogram-kernel (function modl "histogram")
+                      uint-to-real-kernel (function modl "uint_to_real")
+                      local-sort-kernel (function modl "bitonic_local")]
+          (->GTXDatasetEngine ctx modl hstream WGS
+                              sum-reduction-kernel mean-kernel variance-kernel
+                              min-max-reduction-kernel min-max-kernel histogram-kernel
+                              uint-to-real-kernel local-sort-kernel)))))
     ([ctx hstream]
      (gtx-dataset-engine ctx hstream 1024)))


0.8.5.1 doesn't exist yet

0.8.5.1 doesn't exist yet

--- onyx-peers/project.clj
+++ onyx-peers/project.clj
@@ -5,7 +5,7 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.7.0"]
                  [org.onyxplatform/onyx "0.8.5-SNAPSHOT" :exclusions [org.slf4j/slf4j-nop]]
-                 [org.onyxplatform/onyx-bookkeeper "0.8.5.1-SNAPSHOT"]]
+                 [org.onyxplatform/onyx-bookkeeper "0.8.4.1-SNAPSHOT"]]
   :jvm-opts ^:replace ["-server"]
   :profiles {:uberjar {:aot [onyx-peers.launcher.aeron-media-driver
                              onyx-peers.launcher.launch-prod-peers]}


Adding more logging during database migration of granules.

--- src/cmr/bootstrap/data/bulk_migration.clj
+++ src/cmr/bootstrap/data/bulk_migration.clj
@@ -199,7 +199,9 @@
   [system provider-id]
   (info "Copying granule data for provider" provider-id)
   (doseq [{:keys [id echo_collection_id]} (get-provider-collection-list system provider-id)]
-    (copy-granule-data-for-collection system provider-id echo_collection_id id)))
+    (info (str "Copying granule data for collection " echo_collection_id))
+    (let [result (copy-granule-data-for-collection system provider-id echo_collection_id id)]
+      (info result))))

 (defn copy-single-collection
   "Delete a collection form the provider's collection table and all associated granules and


export: centralize the the api-version setting

--- src/puppetlabs/puppetdb/cli/export.clj
+++ src/puppetlabs/puppetdb/cli/export.clj
@@ -21,6 +21,8 @@
             [clj-time.core :refer [now]]
             [clj-http.util :refer [url-encode]]))

+(def ^:private api-version :v4)
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Internal Schemas

@@ -42,7 +44,7 @@

 (defn-validated catalog-for-node :- (s/maybe s/Str)
   "Given a node name, retrieve the catalog for the node."
-  ([host port node] (catalog-for-node host port :v4 node))
+  ([host port node] (catalog-for-node host port api-version node))
   ([host :- s/Str
     port :- s/Int
     version
@@ -75,7 +77,7 @@
   :- {s/Keyword s/Any}
   "Supplying host, port, and optionally version,
    retrieve the factset for a given certname `node`"
-  ([host port node] (facts-for-node host port :v4 node))
+  ([host port node] (facts-for-node host port api-version node))
   ([host :- String
     port :- s/Int
     version :- s/Keyword
@@ -106,7 +108,7 @@

 (defn-validated events-for-report-hash :- (s/pred seq? 'seq?)
   "Given a report hash, returns all events as a vector of maps."
-  ([host port report-hash] (events-for-report-hash host port :v4 report-hash))
+  ([host port report-hash] (events-for-report-hash host port api-version report-hash))
   ([host :- s/Str
     port :- s/Int
     version
@@ -126,7 +128,7 @@

 (defn-validated reports-for-node :- (s/maybe (s/pred seq? 'seq?))
   "Given a node name, retrieves the reports for the node."
-  ([host port node] (reports-for-node host port :v4 node))
+  ([host port node] (reports-for-node host port api-version node))
   ([host :- s/Str
     port :- s/Int
     version
@@ -184,7 +186,7 @@
    port :- s/Int]
   (parse-response
    (client/get
-    (format "http://%s:%s/v4/nodes" host port)
+    (format "http://%s:%s/%s/nodes" host port (name api-version))
     {:accept :json})))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


additional destruction on transitive-verb-rule

--- src/babel/lexiconfn.cljc
+++ src/babel/lexiconfn.cljc
@@ -336,6 +336,9 @@

              ;; do not apply rule if (:subcat :2) is explicitly empty.
              (not (= '() (get-in lexical-entry [:synsem :subcat :2])))
+
+             ;; do not apply rule if (:subcat :2) is not noun.
+             (= :noun (get-in lexical-entry [:synsem :subcat :2 :cat] :noun))

              ;; do not apply rule if there is :3.
              (= :none (get-in lexical-entry [:synsem :subcat :3] :none)))


[core] Add 'do-self-updating fn for input.

This fn repeatedly reads a specified input file for out-of-band locate 'state
:data updates that can then be seen transferring throughout the gossip cluster.

--- src/birdie_tell/core.clj
+++ src/birdie_tell/core.clj
@@ -268,6 +268,15 @@
           (send-gossip (partial handle-peer-liveness state) @state peer)))
       (Thread/sleep (+ min-rest-time (rand-int wait-range))))))

+(defn- do-self-updating!
+  "Parse 'data-file as EDN every 'reread-delay-ms, and update :data in
+  'state (with version bumps) when 'data-file changes."
+  [data-file state reread-delay-ms]
+  (while true
+      (let [data (edn/read-string (slurp data-file))]
+        (swap! state merge-my-data data))
+      (Thread/sleep reread-delay-ms)))
+
 (defn main
   "'max-hotness: how many times do I tell another peer about this peer?
   'live-percentage: what percentage of the time do I bias toward talking to peers I think are :alive, instead of :dead?"


Updated check task to reload project before and after; this should fix problem which was causing unreliable results based on whether a class was already aot compiled or not. In particular, this was causing the check task to fail on clojure-protobuf and unreliable results when run on projects where certain classes were already aot-compiled.

--- src/cake/tasks/check.clj
+++ src/cake/tasks/check.clj
@@ -3,11 +3,13 @@
   (:use cake
         cake.core
         [cake.file :only [file rmdir]]
+        [cake.project :only [reload!]]
         [cake.tasks.compile :only [source-dir]]))

 (deftask check #{compile-java}
   "Check syntax and warn on reflection."
   (let [source-path (source-dir)]
+    (reload!)
     (bake (:use [bake.core :only [log print-stacktrace]]
                 [bake.find-namespaces :only [find-clojure-sources-in-dir
                                              read-file-ns-decl]]
@@ -29,4 +31,5 @@
                           (print-stacktrace e))))
                   (do
                     (log "Skipping namespace " (second src-file-ns-decl))
-                    (log "  Reason: Dependency on cake.core")))))))))+                    (log "  Reason: Dependency on cake.core")))))))
+    (reload!)))


Housekeeping

Housekeeping

--- src/taoensso/carmine/message_queue.clj
+++ src/taoensso/carmine/message_queue.clj
@@ -134,9 +134,9 @@
                        (car/with-conn pool spec
                          (car/sadd (qkey qname "recently-done")
                                        message-id))
-                       (catch Throwable e
+                       (catch Throwable t
                          (timbre/error
-                          e (str "Exception while handling message from queue: "
+                          t (str "Error while handling message from queue: "
                                  qname "\n") poll-reply))))))
             (when throttle-msecs (Thread/sleep throttle-msecs))))))
     nil))


Improve performance of reading vcf file.

--- src/cljam/vcf/reader.clj
+++ src/cljam/vcf/reader.clj
@@ -3,7 +3,8 @@
   https://samtools.github.io/hts-specs/ for the detail VCF specifications."
   (:require [clojure.string :as cstr]
             [camel-snake-kebab.core :refer [->kebab-case-keyword]]
-            [cljam.util :refer [str->long]]))
+            [cljam.util :refer [str->long]])
+  (:import [clojure.lang LazilyPersistentVector]))

 ;; VCFReader
 ;; ---------
@@ -17,8 +18,9 @@
 ;; ---------

 (defn- dot->nil
-  [s]
-  (if (= s ".") nil s))
+  [^String s]
+  ;; Avoid calling equiv on strings.
+  (if (and (= 1 (.length s)) (= \. (.charAt s 0))) nil s))

 ;; Loading meta-information
 ;; ------------------------
@@ -93,28 +95,35 @@
 ;; ------------------

 (defn- parse-data-line
-  [line header]
-  (let [[fields gt-fields] (->> (cstr/split line #"\t")
+  [line header kws]
+  ;; When splitting a string with single-character delimiter,
+  ;; `java.lang.String#split` is slightly faster than `clojure.string/split`.
+  ;; For more details, please refer to https://github.com/chrovis/cljam/pull/29.
+  (let [[fields gt-fields] (->> (.split ^String line "\t")
+                                LazilyPersistentVector/createOwning
                                 (map dot->nil)
                                 (split-at 8))]
-    (merge {:chrom (first fields)
-            :pos (str->long (nth fields 1))
-            :id (nth fields 2)
-            :ref (nth fields 3)
-            :alt (some-> (nth fields 4) (cstr/split #","))
-            :qual (some-> (nth fields 5) Double/parseDouble)
-            :filter (nth fields 6)
-            :info (nth fields 7)}
-           (zipmap (map keyword (drop 8 header)) gt-fields))))
+    (->> gt-fields
+         (interleave kws)
+         (concat [:chrom (first fields)
+                  :pos (str->long (nth fields 1))
+                  :id (nth fields 2)
+                  :ref (nth fields 3)
+                  :alt (some-> (nth fields 4) (cstr/split #","))
+                  :qual (some-> (nth fields 5) Double/parseDouble)
+                  :filter (nth fields 6)
+                  :info (nth fields 7)])
+         (apply hash-map))))

 (defn- read-data-lines
-  [^java.io.BufferedReader rdr header]
+  [^java.io.BufferedReader rdr header kws]
   (when-let [line (.readLine rdr)]
     (if-not (or (meta-line? line) (header-line? line))
-      (cons (parse-data-line line header)
-            (lazy-seq (read-data-lines rdr header)))
-      (read-data-lines rdr header))))
+      (cons (parse-data-line line header kws)
+            (lazy-seq (read-data-lines rdr header kws)))
+      (read-data-lines rdr header kws))))

 (defn read-variants
   [^VCFReader rdr]
-  (read-data-lines (.reader rdr) (.header rdr)))
+  (let [kws (mapv keyword (drop 8 (.header rdr)))]
+    (read-data-lines (.reader rdr) (.header rdr) kws)))


Removed debugging code.

Removed debugging code.

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -199,17 +199,3 @@
             me (calculate-meta-errors new-ind argmap)]
         (assoc new-ind :meta-errors me)))))

-(let [hist '(1 2 3 3 3 3)]
-  (if (empty? (rest hist))
-    1000000
-    (loop [remaining hist
-           new-best-count 0]
-      (print :remaining remaining :new-best-count new-best-count)
-      (if (empty? (rest remaining))
-        (- 1 (/ new-best-count (dec (count hist))))
-        (recur (rest remaining)
-               (+ new-best-count
-                  (if (every? #(> % (first remaining))
-                              (rest remaining))
-                    1
-                    0)))))))


Fix activation color of motion seeds.

Fix activation color of motion seeds.

--- src/videotest/falling/motion_trace.clj
+++ src/videotest/falling/motion_trace.clj
@@ -7,7 +7,7 @@
 (def MAX-TRACE-LIFE 60)

 (defn init-trace []
-  {:life (inc (rand-int MAX-TRACE-LIFE))})
+  {:life MAX-TRACE-LIFE})

 (defn color-with-alpha [c alpha]
   (conj (vec (take 3 c)) alpha))
@@ -39,7 +39,7 @@
 (defn decay-motion-trace
   [{:keys [motion-trace triangle-points color-record previous-color-record] :as state}]
   (let [dec-life (fn [trace]
-                   (update-in trace [:life] #(max 0 (dec %))))]
+                   (update-in trace [:life] #(max 0 (- % (+ 1 (rand 10))))))]
     (assoc-in state [:motion-trace]
               (reduce (fn [memo [coords trace]]
                         (if (>= 1 (:life trace))


Doctopus Testsssssss

Doctopus Testsssssss

--- test/doctopus/doctopus_test.clj
+++ test/doctopus/doctopus_test.clj
@@ -1,3 +1,33 @@
 (ns doctopus.doctopus-test
-  (:require [doctopus.doctopus :refer :all]
-            [clojure.test :refer :all]))
+  (:require [clojure.java.io :as io]
+            [clojure.test :refer :all]
+            [doctopus.doctopus.head :as h]
+            [doctopus.doctopus :refer :all])
+  (:import [doctopus.doctopus Doctopus]
+           [doctopus.doctopus.head Head]))
+
+(def doctopus-test-configs
+  {:heads-dir (io/resource "test/heads")})
+
+;; Note: we *should* probably test bootstrapping heads here. HOWEVER, that's a
+;; mechanism we're about to change in a major (and good) way, so I'm not super
+;; inclined to mess with it until we get a Database and we can stop returning
+;; new Doctopi/Heads every time there's a state change :/ - RMD
+(def stunt-doctopus (bootstrap-heads (Doctopus. doctopus-test-configs)))
+
+(deftest doctopus-test
+  (testing "Can we list heads?"
+    (let [test-head (h/bootstrap-tentacles (Head. "test") (io/resource "test/heads"))]
+      (is (= #{test-head} (set (list-heads stunt-doctopus))))
+      (is (= "test" (:name (first (list-heads stunt-doctopus)))))))
+  (testing "Can we list tentacles?"
+    (let [tent-list (list-tentacles stunt-doctopus)]
+      (is (= 1 (count tent-list))
+          "We should only have one of these")
+      (is (= "doctopus-test" (:name (first tent-list)))
+          "Would sure be weird if we got a different tentacle here")))
+  (testing "Can we get a tentacle by its head?"
+    (is (= 1 (count (list-tentacles-by-head stunt-doctopus "test")))
+        "This should get one tentacle")
+    (is (empty? (list-tentacles-by-head stunt-doctopus "HOOBASTANK"))
+        "There should never, ever be a tentacle with this name. Ever.")))


Added syntax for defining custom regex matchers in routes

--- src/compojure/routes.clj
+++ src/compojure/routes.clj
@@ -29,12 +29,15 @@
   "Compiles a function to match a HTTP request against the supplied method
   and route."
   [method route]
-  (let [matcher (if (string? route)
-                  (route-compile route)
-                  route)]
+  (let [matcher (cond
+                  (string? route) (route-compile route)
+                  (seq? route)    (route-compile
+                                    (first route)
+                                    (apply hash-map (rest route)))
+                  :otherwise      route)]
    `(fn [request#]
       (and (method-matches ~method request#)
-           (route-matches ~route request#)))))
+           (route-matches ~matcher request#)))))

 (defmacro with-request-bindings
   "Add shortcut bindings for the keys in a request map."


CMR-4169 - Added new UMM-S ingest routes.

--- ingest-app/src/cmr/ingest/api/routes.clj
+++ ingest-app/src/cmr/ingest/api/routes.clj
@@ -14,6 +14,7 @@
    [cmr.ingest.api.granules :as granules]
    [cmr.ingest.api.multipart :as mp]
    [cmr.ingest.api.provider :as provider-api]
+   [cmr.ingest.api.services :as services]
    [cmr.ingest.api.translation :as translation-api]
    [cmr.ingest.api.variables :as variables]
    [cmr.ingest.services.ingest-service :as ingest]
@@ -110,16 +111,24 @@
           (GET "/status/:task-id"
                [task-id :as request]
                (bulk/get-provider-task-status provider-id task-id request)))))
-    ;; Variable ingest routes
+    ;; Variables ingest routes
     (context "/variables" []
       (POST "/"
             {:keys [request-context headers body]}
             (variables/create-variable request-context headers body))
-      (context "/:variable-key" [variable-key]
-        (PUT "/"
-             {:keys [request-context headers body]}
-             (variables/update-variable
-              request-context headers body variable-key))))))
+      (PUT "/:variable-key"
+           [variable-key :as {:keys [request-context headers body]}]
+           (variables/update-variable
+            request-context headers body variable-key)))
+    ;; Services ingest routes
+    (context "/services" []
+      (POST "/"
+            {:keys [request-context headers body]}
+            (services/create-service request-context headers body))
+      (PUT "/:service-key"
+           [service-key :as {:keys [request-context headers body]}]
+           (services/update-service
+            request-context headers body service-key)))))

 (defn build-routes [system]
   (routes
@@ -129,7 +138,7 @@
       ;; Add routes for translating metadata formats
       translation-api/translation-routes

-      ;; Add routes to create, update, delete, validate concepts
+      ;; Add routes to create, update, delete, & validate concepts
       ingest-routes

       ;; db migration route


updated fxn description

updated fxn description

--- src-cljs/frontend/utils/state.cljs
+++ src-cljs/frontend/utils/state.cljs
@@ -155,7 +155,7 @@
                                  (get-in state state/last-visited-org-path))))

 (defn show-nux-expeprience?
-  "Returns `true` if user should be in `new user experience` state, `false` otherwise."
+  "Returns `true` if user should be in `new user experience` mode, `false` otherwise."
   [state]
   (let [builds (get-in state state/recent-builds-path)
         projects (get-in state state/projects-path)]


Clarified test scenario to make more obvious what we expect

--- test/lambdacd_git/core_test.clj
+++ test/lambdacd_git/core_test.clj
@@ -232,6 +232,7 @@
                     (git-init)
                     (git-commit "initial commit")
                     (git-checkout-b "some-branch")
+                    (git-commit "some commit on branch")
                     (git-checkout "master")

                     (start-wait-for-git-step :ref (fn [_] true))
@@ -241,12 +242,12 @@

                     (git-checkout "some-branch")
                     (start-wait-for-git-step :ref (fn [_] true))
-                    (git-commit "some commit on branch")
-
-                    (get-step-result))]
-      (is (= :success (:status (step-result state))))
-      (is (= (commit-hash-by-msg state "initial commit") (:old-revision (step-result state)))) ; FIXME: is this correct?
-      (is (= (commit-hash-by-msg state "some commit on branch") (:revision (step-result state))))
+                    (git-commit "some other commit on branch")
+
+                    (get-step-result))]
+      (is (= :success (:status (step-result state))))
+      (is (= (commit-hash-by-msg state "some commit on branch") (:old-revision (step-result state))))
+      (is (= (commit-hash-by-msg state "some other commit on branch") (:revision (step-result state))))
       (is (str-containing (commit-hash-by-msg state "some commit on branch") (:out (step-result state))))))
   (testing "that it prints out information on old and new commit hashes"
     (let [state (-> (init-state)


adding ip and vmid gen test

adding ip and vmid gen test

--- test/celestial/integration/proxmox.clj
+++ test/celestial/integration/proxmox.clj
@@ -27,3 +27,14 @@
      (.status ct) => "running"
      (.stop ct)
      (.delete ct))))
+
+(fact "ip and vmid generation" :integration :proxmox
+   (with-conf
+    (let [ct (vconstruct (-> redis-prox-spec (dissoc-in* [:machine :ip]) (dissoc-in* [:machine :vmid])))]
+     (.stop ct)
+     (.delete ct)
+     (.create ct)
+     (.start ct)
+     (.status ct) => "running"
+     (.stop ct)
+     (.delete ct))))


test for GET /api/emailreport/:id

test for GET /api/emailreport/:id

--- test/metabase/api/emailreport_test.clj
+++ test/metabase/api/emailreport_test.clj
@@ -111,3 +111,53 @@
        :public_perms common/perms-readwrite
        :created_at $})
   (create-email-report))
+
+;; ## GET /api/emailreport/:id
+(expect-eval-actual-first
+    (match-$ (sel :one EmailReport (order :id :DESC))
+      {:description nil
+       :email_addresses ""
+       :can_read true
+       :schedule {:days_of_week {:mon true
+                                 :tue true
+                                 :wed true
+                                 :thu true
+                                 :fri true
+                                 :sat true
+                                 :sun true}
+                  :timezone ""
+                  :time_of_day "morning"}
+       :creator (match-$ (fetch-user :rasta)
+                  {:common_name "Rasta Toucan"
+                   :date_joined $
+                   :last_name "Toucan"
+                   :id $
+                   :is_superuser false
+                   :last_login $
+                   :first_name "Rasta"
+                   :email "rasta@metabase.com"})
+       :can_write true
+       :organization_id (:id @test-org)
+       :name "My Cool Email Report"
+       :mode (emailreport/mode->id :active)
+       :organization {:id (:id @test-org)
+                      :slug "test"
+                      :name "Test Organization"
+                      :description nil
+                      :logo_url nil
+                      :inherits true}
+       :creator_id (user->id :rasta)
+       :updated_at $
+       :dataset_query {:database (:id @test-db)
+                       :query {:limit nil
+                               :breakout [nil]
+                               :aggregation ["rows"]
+                               :filter [nil nil]
+                               :source_table (table->id :venues)}
+                       :type "query"}
+       :id $
+       :version 1
+       :public_perms common/perms-readwrite
+       :created_at $})
+  (let [{id :id} (create-email-report)]
+    ((user->client :rasta) :get 200 (format "emailreport/%d" id))))


(SERVER-2532) Fold update-env.-info-entry into callers

Previously we used a single function for updating the environment info
cache, sometimes passing nil into that fn to invalidate its contents.

This is problematic because invalidating the cache needs to update all
info service tags, but normal updating a tag should only update the tag
for a single info service.

To resolve the mismatch between needing to update one or more tags, this
folds the tag updates into the calling methods.

--- src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
+++ src/clj/puppetlabs/services/jruby/jruby_puppet_core.clj
@@ -314,27 +314,16 @@
     (update original-environment-info-entry :cache-generation-id inc)
     (environment-info-entry)))

-(schema/defn ^:always-validate update-environment-info-entry
-  :- EnvironmentInfoCacheEntry
-  "Return the supplied 'original-environment-info-entry', only updated
-  with the supplied tag and a cache-generation-id value that has been
-  incremented."
-  [original-environment-info-entry :-
-   (schema/maybe EnvironmentInfoCacheEntry)
-   tag :- (schema/maybe schema/Str)]
-  (-> original-environment-info-entry
-      inc-cache-generation-id-for-info-entry
-      (assoc-in [:info :classes] tag)))
-
 (schema/defn ^:always-valid invalidate-environment-info-entry
   :- EnvironmentInfoCacheEntry
   "Return the supplied 'original-environment-info-entry', only updated
   with nil tags and a cache-generation-id value that has been incremented."
   [original-environment-info-entry :-
    (schema/maybe EnvironmentInfoCacheEntry)]
-  (update-environment-info-entry
-   original-environment-info-entry
-   nil))
+  (-> original-environment-info-entry
+    inc-cache-generation-id-for-info-entry
+    (assoc-in [:info :classes] nil)
+    (assoc-in [:info :transports] nil)))

 (schema/defn ^:always-validate
   environment-info-cache-with-invalidated-entry
@@ -370,9 +359,9 @@
   (let [cache-entry (get environment-info-cache env-name)]
     (if (= (:cache-generation-id cache-entry)
            cache-generation-id-before-tag-computed)
-      (assoc environment-info-cache
-        env-name
-        (update-environment-info-entry cache-entry tag))
+      (-> environment-info-cache
+        (assoc-in [env-name :info :classes] tag)
+        (update-in [env-name :cache-generation-id] inc))
       environment-info-cache)))

 (schema/defn ^:always-validate


Use std API.

Use std API.

--- test/onyx/peer/multi_peer_mem_test.clj
+++ test/onyx/peer/multi_peer_mem_test.clj
@@ -1,6 +1,5 @@
 (ns onyx.peer.multi-peer-mem-test
   (:require [com.stuartsierra.component :as component]
-            [onyx.system :refer [onyx-development-env]]
             [midje.sweet :refer :all]
             [onyx.queue.hornetq-utils :as hq-util]
             [onyx.api]))
@@ -38,9 +37,7 @@
    :onyx.peer/outbox-capacity (:outbox-capacity (:peer config))
    :onyx.peer/job-scheduler :onyx.job-scheduler/round-robin})

-(def dev (onyx-development-env env-config))
-
-(def env (component/start dev))
+(def env (onyx.api/start-env env-config))

 (def n-messages 100000)

@@ -104,9 +101,9 @@
 (def results (hq-util/consume-queue! hq-config out-queue echo))

 (doseq [v-peer v-peers]
-  ((:shutdown-fn v-peer)))
+  (onyx.api/shutdown-peer v-peer))

-(component/stop env)
+(onyx.api/shutdown-env env)

 (let [expected (set (map (fn [x] {:n (inc x)}) (range n-messages)))]
   (fact (set (butlast results)) => expected)


Make all new application schemas editable

This will mean that we can start making appshare apps with editable
database schemas

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -2487,6 +2487,9 @@
       (sql-1 "insert into appshare_application_schemas  (fk_appshare_application_id,fk_appshare_schema_id, application_environment) values (?, ?,?)"
              [new-app-id  new-schema-id  "DEV"])

+      (sql-1 "insert into appshare_application_can_call_interface  (fk_application_id, interface_name) values (?, ?)"
+             [new-app-id  "edit.my.database"])
+

       (sql-1 (str "create schema " new-schema-name)
              [])


fix problem with generation with boot-stem1 words`

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -714,6 +714,19 @@
            person (get-in word '(:agr :person))
            number (get-in word '(:agr :number))]
        (cond
+
+        (and (= person :1st) (= number :sing)
+             (get-in word [:boot-stem1]))
+        (str (get-in word [:boot-stem1]) "o")
+
+        (and (= person :2nd) (= number :sing)
+             (get-in word [:boot-stem1]))
+        (str (get-in word [:boot-stem1]) "i")
+
+        (and (= person :3rd) (= number :sing)
+             (get-in word [:boot-stem1]))
+        (str (get-in word [:boot-stem1]) "e")
+
         (and (= person :1st) (= number :sing))
         (str stem "o")

@@ -754,6 +767,10 @@

         (and (= person :2nd) (= number :plur) ire-type)
         (str stem "ite")
+
+        (and (= person :3rd) (= number :plur)
+             (get-in word [:boot-stem1]))
+        (str (get-in word [:boot-stem1]) "ono")

         (and (= person :3rd) (= number :plur)
              ire-type)


Upgrading to latest release of marginalia 1.5.1.

--- clojuroids/project.clj
+++ clojuroids/project.clj
@@ -5,6 +5,6 @@
         [org.clojure/clojure "1.2.0"]
         [org.clojure/clojure-contrib "1.2.0"]]
     :dev-dependencies [
-        [marginalia "0.5.0-alpha"]]
+        [marginalia "0.5.1"]]
     :main clojuroids.core)


further refactoring forums

further refactoring forums

--- src/bonews_rest/scraper/forums.clj
+++ src/bonews_rest/scraper/forums.clj
@@ -68,20 +68,35 @@
       (:attrs)
       (:href)))

+(defn get-rows
+  [table]
+  (-> table
+      (html/select [:tr])
+      rest))
+
 (defn get-cols
   [row]
-  (let [cols (rest (html/select row [:td]))]
-    {:thread-url            (get-thread-url cols)
-     :thread-title          (get-thread-title cols)
-     :thread-num-replies    (get-thread-num-replies cols)
-     :thread-last-update    (get-thread-last-update cols)
-     :author                (get-thread-author cols)
-     :author-url            (get-author-url cols)}))
+  (-> row
+      (html/select [:td])
+      rest))

-(defn get-rows
+(defn get-thread-data
+  [cols]
+  {
+    :thread-url            (get-thread-url cols)
+    :thread-title          (get-thread-title cols)
+    :thread-num-replies    (get-thread-num-replies cols)
+    :thread-last-update    (get-thread-last-update cols)
+    :author                (get-thread-author cols)
+    :author-url            (get-author-url cols)
+  })
+
+(defn get-page-data
   [table]
   (map-indexed vector
-    (for [row (rest (html/select table [:tr]))
-      :let [cols (get-cols row)]
-      :when (seq cols)]
-    cols)))+    (for [row (get-rows table)
+      :let [page-data (-> row
+                          (get-cols)
+                          (get-thread-data))]
+      :when (seq page-data)]
+    page-data)))


remove reference to nonexistant function in mobile

--- src/braid/client/mobile/state.cljs
+++ src/braid/client/mobile/state.cljs
@@ -23,8 +23,6 @@

 (rf/register-sub :active-group state/get-active-group)

-(rf/register-handler :set-active-group-id! state/set-active-group-id!)
-
 (rf/register-sub :active-group-inbox-threads
   (fn [state _]
     (let [group-id (reaction (:open-group-id @state))


Fix predicate/pixel-generator so that it returns a Cascalog generator.

--- src/clj/forma/hadoop/predicate.clj
+++ src/clj/forma/hadoop/predicate.clj
@@ -158,11 +158,14 @@
 ;; ### Generators

 (defn pixel-generator
-  "Returns a cascalog generator that produces every pixel combination
-  for the supplied sequence of tiles, given the supplied
-  resolution. `pixel-generator` stages each tuple into a sequence file
-  located at `tmp-dir`. See `cascalog.ops/lazy-generator`
-  for usage advice."
+  "Returns a Cascalog generator that emits MODIS pixel tuples
+  [?mod-h ?mod-v ?sample ?line] for a set of MODIS tiles at a given spatial
+  resolution.
+
+  Arguments:
+    tmp-path - A staging directory for writing tuples to a sequence file.
+    res - The spatial resolution.
+    tileseq - Map of country ISO keywords to MODIS tiles (see: forma.source.tilesets.clj)"
   [tmp-path res tileseq]
   (let [tap (:sink (hfs-seqfile tmp-path))]
     (with-open [^TupleEntryCollector collector
@@ -173,7 +176,8 @@
                          sample (range (pixels-at-res res))
                          line   (range (pixels-at-res res))]
                      [h v sample line])]
-        (.add collector (Util/coerceToTuple item))))))
+        (.add collector (Util/coerceToTuple item))))
+    (name-vars tap ["?mod-h" "?mod-v" "?sample" "?line"])))

 ;; ### Special Functions


Fix and comment out the ns generation code

--- src/clj_chrome_devtools/define.clj
+++ src/clj_chrome_devtools/define.clj
@@ -71,13 +71,14 @@

 (define-command-functions "Page")

-;; To regenerate the command namespaces, run this
-(doseq [{:keys [domain description]} (proto/all-domains)]
-  (let [clj-name (camel->clojure domain)
-        file-name (str "src/clj_cdp_test/commands/" (str/lower-case (str/replace clj-name "-" "_")) ".clj")]
-    (spit file-name
-          (str "(ns clj-chrome-devtools.commands." (str/lower-case clj-name) "\n"
-               (when description
-                 (str "  " (pr-str description) "\n"))
-               "  (:require [clj-chrome-devtools.define :refer [define-command-functions]]))\n"
-               "(define-command-functions \"" domain "\")"))))
+(comment
+  ;; To regenerate the command namespaces, run this
+  (doseq [{:keys [domain description]} (proto/all-domains)]
+    (let [clj-name (camel->clojure domain)
+          file-name (str "src/clj_chrome_devtools/commands/" (str/lower-case (str/replace clj-name "-" "_")) ".clj")]
+      (spit file-name
+            (str "(ns clj-chrome-devtools.commands." (str/lower-case clj-name) "\n"
+                 (when description
+                   (str "  " (pr-str description) "\n"))
+                 "  (:require [clj-chrome-devtools.define :refer [define-command-functions]]))\n"
+                 "(define-command-functions \"" domain "\")")))))


Fix npe in schema*-args

Fix npe in schema*-args

--- src/cljc/mikron/compiler/spec.cljc
+++ src/cljc/mikron/compiler/spec.cljc
@@ -92,10 +92,10 @@
 (s/def ::schema*-args
   (s/and (s/cat :schema ::schema
                 :ext    (s/keys* :opt-un [::diff-paths ::interp-paths ::processor-types]))
-         (s/conformer
+         (s/conformer
            (fn [{:keys [ext] :as schema-args}]
              (reduce (fn [schema-args ext-key]
-                       (if-some [ext-value (ext ext-key)]
+                       (if-some [ext-value (get ext ext-key)]
                          (assoc schema-args ext-key ext-value)
                          schema-args))
                      (dissoc schema-args :ext)


Include controller to app

Include controller to app

--- src/cljs/gtfve/components/app.cljs
+++ src/cljs/gtfve/components/app.cljs
@@ -6,7 +6,8 @@
             [cljs.core.async :as async :refer [put! chan <! close!]]
             [gtfve.components.header :as header]
             [gtfve.components.side-panel :as side-panel]
-            [gtfve.components.maps-panel :as maps-panel])
+            [gtfve.components.maps-panel :as maps-panel]
+            [gtfve.components.controller :as controller])
   (:import goog.History))

 (defn app* [data owner]
@@ -17,6 +18,7 @@
       (let [panel (:panel data)]
         (html
          [:div
+          (om/build controller/controller data)
           (om/build header/header nil)
           [:div.container-fluid
            [:div.row


implement adjustment using newton raphson root finding

--- src/cljs/palimpsest/smoothing.cljs
+++ src/cljs/palimpsest/smoothing.cljs
@@ -112,6 +112,29 @@
             (v2-scale (B1 t) (:v1 bezier)))
     (v2-add (v2-scale (B2 t) (:v2 bezier))
             (v2-scale (B3 t) (:v3 bezier)))))
+
+(defn bezier3-deriv [bezier3]
+  [(v2-scale 3 (v2-sub (:v1 bezier3) (:v0 bezier3)))
+   (v2-scale 3 (v2-sub (:v2 bezier3) (:v1 bezier3)))
+   (v2-scale 3 (v2-sub (:v3 bezier3) (:v2 bezier3)))])
+
+(defn bezier2-calc [[v0 v1 v2] t]
+  (let [tmp (- 1.0 t)
+        b0 (* tmp tmp)
+        b1 (* 2 tmp t)
+        b2 (* t t)]
+    (v2-add (v2-scale b0 v0)
+            (v2-add
+              (v2-scale b1 v1)
+              (v2-scale b2 v2)))))
+
+(defn bezier2-deriv [[v0 v1 v2]]
+  [(v2-scale 2 (v2-sub v1 v0))
+   (v2-scale 2 (v2-sub v2 v1))])
+
+(defn bezier1-calc [[v0 v1] t]
+  (v2-add (v2-scale (- 1.0 t) v0)
+          (v2-scale t v1)))

 (defn wu-barsky-heuristic [bez0 bez3 tan1 tan2]
   (let [dist (/ (v2-dist bez0 bez3) 3.0)]
@@ -143,7 +166,9 @@
                (v2-add bez3 (v2-scale alpha2 tan2))
                bez3))))

-(def fit-error 4.0)
+(def fit-error 16.0)
+(def adjust-error 4.0)
+(def max-adjust-iter 10)

 (defn compute-max-error [coords bezier params]
   (->>
@@ -155,6 +180,30 @@
     (reduce (fn [[max-dist split-point :as res-pair] [i dist]]
               (if (>= dist max-dist) [dist i] res-pair))
             [0.0 (/ (count coords) 2)])))
+
+(defn newton-raphson-iter [bezier3 P u]
+  (let [bezier2 (bezier3-deriv bezier3)
+        bezier1 (bezier2-deriv bezier2)
+        Qu (bezier3-calc bezier3 u)
+        Q1u (bezier2-calc bezier2 u)
+        Q2u (bezier1-calc bezier1 u)
+        numer (v2-dot (v2-sub Qu P) Q1u)
+        denom (+ (v2-dot (v2-sub Qu P) Q2u) (v2-dot Q1u Q1u))]
+    (- u (/ numer denom))))
+
+(defn reparameterize [bezier coords params]
+  (vec (map #(newton-raphson-iter bezier %1 %2) coords params)))
+
+(defn adjust-bezier [bezier coords params tan1 tan2 iter-error max-iter]
+  (loop [bezier bezier
+         params params
+         i 0]
+    (let [error (compute-max-error coords bezier params)]
+      (if (or (<= error iter-error) (>= i max-iter))
+        bezier
+        (let [newparams (reparameterize bezier coords params)
+              newbezier (gen-bezier coords newparams tan1 tan2)]
+          (recur newbezier newparams (inc i)))))))

 (defn fit-cubic
   ([coords]
@@ -169,12 +218,12 @@
     (if (= (count coords) 2)
       ; use the heuristic if there are no intermediate points
       [(wu-barsky-heuristic (first coords) (last coords) tan1 tan2)]
-      (let [iter-error (* fit-error fit-error)
-            params (chord-parameterize coords)
+      (let [params (chord-parameterize coords)
             bezier (gen-bezier coords params tan1 tan2)
             [max-error split-point] (compute-max-error coords bezier params)]
-        (if (< max-error iter-error)
-          [bezier]
+        (if (< max-error fit-error)
+          [(adjust-bezier bezier coords params tan1 tan2
+                          adjust-error max-adjust-iter)]
           (let [center-tan (v2-center-tangent
                              (nth coords (dec split-point))
                              (nth coords split-point)


fr 12h is always midi

fr 12h is always midi

--- resources/duckling/rules/fr.time.clj
+++ resources/duckling/rules/fr.time.clj
@@ -201,10 +201,17 @@
   (intersect %1 (day-of-month (:value %2)))

-  ;; hours and minutes (absolute time)
+  ; Hours and minutes (absolute time)
+  ;
+  ; Assumptions:
+  ; - 0 is midnight
+  ; - 1..11 is ambiguous am or pm
+  ; - 12 is noon (whereas in English it is ambiguous)
+  ; - 13..23 is pm
+
   "time-of-day (latent)"
   (integer 0 23)
-  (assoc (hour (:value %1) true) :latent true)
+  (assoc (hour (:value %1) (< (:value %1) 12)) :latent true)

   "midi"
   #"(?i)midi"
@@ -224,9 +231,10 @@

   "hh(:|h)mm (time-of-day)"
   #"(?i)((?:[01]?\d)|(?:2[0-3]))[:h]([0-5]\d)"
-  (hour-minute (Integer/parseInt (first (:groups %1)))
-               (Integer/parseInt (second (:groups %1)))
-               true)
+  (let [h (Integer/parseInt (first (:groups %1)))]
+    (hour-minute h
+                 (Integer/parseInt (second (:groups %1)))
+                 (< h 12)))

   "hhmm (military time-of-day)"
   #"(?i)((?:[01]?\d)|(?:2[0-3]))([0-5]\d)"


nicer browser-repl setup

nicer browser-repl setup

--- frontend/core.cljs
+++ frontend/core.cljs
@@ -176,17 +176,22 @@
   (put! ws-ch [:subscribe {:channel-name (pusher/user-channel user)
                            :messages [:refresh]}]))

+(defn setup-browser-repl []
+  (when-let [repl-url (aget js/window "browser_connected_repl_url")]
+    (try
+      (repl/connect repl-url)
+      ;; the repl tries to take over *out*
+      (enable-console-print!)
+      (catch js/Error e
+        (merror e)))))
+
 (defn setup! []
   (main app-state (sel1 :body))
-  ;; XXX direct dispatching is probably the wrong approach
   (when-let [user (inspect (:current-user @app-state))]
     (subscribe-to-user-channel user (inspect (get-in @app-state [:comms :ws]))))
   (when (env/development?)
-    (when-let [repl-url (aget js/window "browser_connected_repl_url")]
-      (try
-        (repl/connect repl-url)
-        (catch js/Error e
-          (merror e)))))
+    (setup-browser-repl))
+  ;; XXX direct dispatching is probably the wrong approach
   (sec/dispatch! (.getPath (goog.Uri. js/document.location.href))))

 ;; Wait for the page to finish loading before we kick off the setup


standard-body-template can be useful as a library function

--- src/devtools/format.cljs
+++ src/devtools/format.cljs
@@ -155,10 +155,13 @@
 (defn build-header [value]
   (template span "background-color:#efe" (header-template value)))

+(defn standard-body-template [lines]
+  (template ol standard-ol-style (map #(template li standard-li-style %) lines)))
+
 (defn body-line-template [index value]
-  (template li standard-li-style (index-template index) spacer (inlined-value-template value)))
-
-(defn body-line-templates [value]
+  [(index-template index) spacer (inlined-value-template value)])
+
+(defn body-lines-templates [value]
   (loop [data (seq value)                                   ; TODO: limit max number of lines here?
          index 0
          lines []]
@@ -167,7 +170,7 @@
       (recur (rest data) (inc index) (conj lines (body-line-template index (first data)))))))

 (defn build-body [value]
-  (template ol standard-ol-style (body-line-templates value)))
+  (standard-body-template (body-lines-templates value)))

 (defn something-abbreviated? [value]
   (if (coll? value)


removed previous version of cnstrrecs

removed previous version of cnstrrecs

--- src/fogus/me/trammel.clj
+++ src/fogus/me/trammel.clj
@@ -213,28 +213,6 @@
           (list `alter-var-root (list `var n#)
                 (list `fn '[f c] (list `with-constraints 'f 'c)) c#))
       nil)))
-
-(defmacro defconstrainedrecord
-  [name slots invariants & etc]
-  (let [fields       (->> slots (partition 2) (map first) vec)
-        defaults     (->> slots (partition 2) (map second))
-        ctor-name    (symbol (str name \.))
-        factory-name (symbol (str "new-" name))]
-    `(do
-       (defrecord ~name
-         ~fields
-         ~@etc)
-       (defconstrainedfn ~factory-name
-         ([] [] (with-meta
-                  (~ctor-name ~@defaults)
-                  {:factory ~factory-name}))
-         ([& {:keys ~fields :as kwargs# :or ~(apply hash-map slots)}]
-            ~invariants
-            (with-meta
-              (-> (~ctor-name ~@defaults)
-                  (merge kwargs#))
-              {:factory ~factory-name})))
-       ~name)))

 (defmacro defconstrainedrecord
   [name slots invariants & etc]


Implement extract quantifiers

Implement extract quantifiers

--- src/formlogic/parser.clj
+++ src/formlogic/parser.clj
@@ -202,6 +202,7 @@
                                                    zip/down
                                                    zip/right
                                                    zip/right
+                                                   ;; Now we are at formula contents.
                                                    zip/node)))]
               ;; We replace all references to the bound-literal with replacement.
               (recur (replace-literal bound-literal replacement modified-loc)))
@@ -222,19 +223,55 @@
       (recur used-literals (map str/join (comb/cartesian-product alphabet literals)))
       next-candidate))))

-(defn transform-unique-quantifiers
+(defn transform-universal-quantifiers
   ([tree] (transform-unique-quantifiers (zip/vector-zip tree) #{}))
   ([loc atoms]
    (if-let [formula (next-quantified-formula loc :FOREACH)]
-     (let [literal (-extract-bound-literal formula)]
+     (let [literal (-extract-bound-literal formula)
+           atoms-with-literal (conj atoms literal)]
        (if (contains? atoms literal)
          ;; This literal was used before. Replace it with unused literal.
          (let [modified-loc (replace-literal literal
                                              [:LITERAL (next-unused-literal atoms)]
                                              formula)]
-           (recur (-> modified-loc zip/down zip/right zip/right) (conj atoms literal)))
-         (recur (-> formula zip/down zip/right zip/right) (conj atoms literal))))
+           (recur (-> modified-loc zip/down zip/right zip/right) atoms-with-literal))
+         (recur (-> formula zip/down zip/right zip/right) atoms-with-literal)))
      (zip/root loc))))
+
+(defn extract-quantifiers
+  ([tree] (extract-quantifiers (zip/vector-zip tree) []))
+  ([loc root]
+   (if-let [formula (next-quantified-formula loc :FOREACH)]
+     (let [modified-formula (-> formula
+                                zip/down
+                                zip/right
+                                zip/right
+                                ;; Now we're at formula contents.
+                                zip/remove
+                                ;; Removing puts us at previous depth-first node.
+                                zip/up
+                                zip/up
+                                zip/up
+                                ;; Now we're at formula root. Leave a marker.
+                                (zip/append-child [:append-here])
+                                zip/node)
+           new-root (if (empty? root)
+                      (conj root modified-formula)
+                      (insta/transform {:append-here (constantly modified-formula)} root))
+           ;; Remove the existential formula and replace it with its
+           ;; contents.
+           modified-loc (zip/edit formula
+                                  (constantly (-> formula
+                                                  zip/down
+                                                  zip/right
+                                                  zip/right
+                                                  ;; Now we are at formula contents.
+                                                  zip/node)))]
+
+       (extract-quantifiers modified-loc new-root))
+     ;; Finally, replace the marker at the end of quantifier chain with modified
+     ;; tree node.
+     (insta/transform {:append-here (constantly (zip/root loc))} root))))

 (defn wff->cnf
   "Converts a well-formed formula in string form to conjuctive-normal-form in
@@ -245,4 +282,5 @@
       transform-implications
       transform-negations
       transform-existential-quantifiers
-      transform-unique-quantifiers))
+      transform-universal-quantifiers
+      extract-quantifiers))


Maintain Future as the return value of new producer `send`.

--- src/clj_kafka/new/producer.clj
+++ src/clj_kafka/new/producer.clj
@@ -3,7 +3,8 @@
   http://kafka.apache.org/082/javadoc/org/apache/kafka/clients/producer/package-summary.html"}
   clj-kafka.new.producer
   (:refer-clojure :exclude [send])
-  (:import [org.apache.kafka.clients.producer Callback KafkaProducer ProducerRecord RecordMetadata]
+  (:import [java.util.concurrent Future TimeUnit TimeoutException]
+           [org.apache.kafka.clients.producer Callback KafkaProducer ProducerRecord RecordMetadata]
            [org.apache.kafka.common.serialization Serializer ByteArraySerializer StringSerializer]))

 (defn string-serializer [] (StringSerializer.))
@@ -38,10 +39,19 @@
    :partition (.partition m)
    :offfset (.offset m)})

+(defn- map-future-val
+  [^Future fut f]
+  (reify
+    java.util.concurrent.Future
+    (cancel [_ interrupt?] (.cancel fut interrupt?))
+    (get [_] (f (.get fut)))
+    (get [_ timeout unit] (f (.get fut timeout unit)))
+    (isCancelled [_] (.isCancelled fut))
+    (isDone [_] (.isDone fut))))
+
 (defn send
-  "Asynchronously send a record to Kafka. Returns a map with `:topic`,
-  `:partition` and `:offset` keys, wrapped in a delay. Derefing delay
-  will block until the underlying future completes. Optionally provide
+  "Asynchronously send a record to Kafka. Returns a `Future` of a map
+  with `:topic`, `:partition` and `:offset` keys. Optionally provide
   a callback fn that will be called when the operation completes.
   Callback should be a fn of two arguments, a map as above, and an
   exception. Exception will be nil if operation succeeded.
@@ -49,9 +59,9 @@
   For details on behaviour, see http://kafka.apache.org/082/javadoc/org/apache/kafka/clients/producer/KafkaProducer.html#send(org.apache.kafka.clients.producer.ProducerRecord,org.apache.kafka.clients.producer.Callback)"
   ([^KafkaProducer producer record]
    (let [fut (.send producer record)]
-     (delay (record-metadata->map @fut))))
+     (map-future-val fut record-metadata->map)))
   ([^KafkaProducer producer record callback]
    (let [fut (.send producer record (reify Callback
                                       (onCompletion [_ metadata exception]
                                         (callback (and metadata (record-metadata->map metadata)) exception))))]
-     (delay (record-metadata->map @fut)))))
+     (map-future-val fut record-metadata->map))))


Hide transaction management

Hide transaction management

Signed-off-by: Andrea Maria Piana <39e16ece3c2d27e1889178b15ddb376e524032f8@gmail.com>

--- src/status_im/ui/screens/wallet/transactions/views.cljs
+++ src/status_im/ui/screens/wallet/transactions/views.cljs
@@ -39,7 +39,7 @@
   [{:keys [label contact address contact-accessibility-label
            currency-text amount-text
            time-formatted on-touch-fn type hash]}
-   _ _ {:keys [keycard-account? transactions-management-enabled?]}]
+   _ _ {:keys [keycard-account?]}]
   [:<>
    [quo/list-item
     (merge
@@ -60,7 +60,9 @@
                      time-formatted)
       :chevron             true}
      (when type (transaction-type->icon (keyword type))))]
-   (when (and transactions-management-enabled?
+   ;; Disabling for now as we have added nonce which is more reliable, until we
+   ;; address the ux issues
+   (when (and false
               (not keycard-account?)
               (= type :pending))
      [react/view {:flex-direction :row :padding 16 :justify-content :space-between}
@@ -120,7 +122,6 @@
   (let [fetching-recent-history? @(re-frame/subscribe [:wallet/fetching-recent-tx-history? address])
         fetching-more-history? @(re-frame/subscribe [:wallet/fetching-tx-history? address])
         keycard-account? @(re-frame/subscribe [:multiaccounts/keycard-account?])
-        transactions-management-enabled? @(re-frame/subscribe [:wallet/transactions-management-enabled?])
         custom-rpc-node? @(re-frame/subscribe [:custom-rpc-node])
         non-archival-rpc-node? @(re-frame/subscribe [:wallet/non-archival-node])
         all-fetched? @(re-frame/subscribe [:wallet/tx-history-fetched? address])
@@ -141,8 +142,7 @@
      [list/section-list
       {:sections    transaction-history-sections
        :key-fn      :hash
-       :render-data {:keycard-account?                 keycard-account?
-                     :transactions-management-enabled? transactions-management-enabled?}
+       :render-data {:keycard-account? keycard-account?}
        :render-fn   render-transaction
        :empty-component
        [react/i18n-text {:style styles/empty-text


Fix hex-spacers

Fix hex-spacers


Bugfixes

Bugfixes


cleanup

cleanup


CMR-470: Added test for inserting granule with missing parent collection.

--- test/cmr/system_int_test/ingest/granule_ingest_test.clj
+++ test/cmr/system_int_test/ingest/granule_ingest_test.clj
@@ -9,11 +9,11 @@
             [clojure.string :as string]
             [cmr.system-int-test.utils.ingest-util :as util]))

-;;; tests
+;;;; tests
 ;;; ensure metadata, indexer and ingest apps are accessable on ports 3001, 3004 and 3002 resp;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-;; Verify a new granule is ingested successfully.
+;;; Verify a new granule is ingested successfully.
 (deftest granule-ingest-test
   (testing "ingest of a new granule"
     (let [collection (util/collection-concept "PROV1" 5)
@@ -21,7 +21,7 @@
           granule (util/granule-concept "PROV1" "C1000000000-PROV1" 5)
           {:keys [concept-id revision-id]} (util/ingest-granule granule)]
       (is (util/concept-exists-in-mdb? concept-id revision-id))
-      (is (= revision-id 0)))))
+      (is (= 0 revision-id)))))

 ; Verify a new granule with concept-id is ingested successfully.
 (deftest granule-w-concept-id-ingest-test
@@ -33,10 +33,10 @@
           {:keys [concept-id revision-id]} (util/ingest-granule granule)]
       (is (util/concept-exists-in-mdb? concept-id revision-id))
       (is (= supplied-concept-id concept-id))
-      (is (= revision-id 0)))))
+      (is (= 0 revision-id)))))

-;; Ingest same granule N times and verify same concept-id is returned and
-;; revision id is 1 greater on each subsequent ingest
+;;; Ingest same granule N times and verify same concept-id is returned and
+;;; revision id is 1 greater on each subsequent ingest
 (deftest repeat-same-granule-ingest-test
   (testing "ingest same granule n times ..."
     (let [collection (util/collection-concept "PROV1" 5)
@@ -47,25 +47,25 @@
       (is (apply = (map :concept-id created-granules)))
       (is (= (range 0 n) (map :revision-id created-granules))))))

-;; Verify ingest behaves properly if empty body is presented in the request.
+;;; Verify ingest behaves properly if empty body is presented in the request.
 (deftest empty-granule-ingest-test
   (let [collection (util/collection-concept "PROV1" 5)
         _ (util/ingest-collection collection)
         granule-with-empty-body  (assoc (util/granule-concept "PROV1" "C1000000000-PROV1" 5 "G1-PROV1") :metadata "")
         {:keys [status errors-str]} (util/ingest-granule granule-with-empty-body)]
-    (is (= status 400))
+    (is (= 400 status))
     (is (re-find #"Invalid XML file." errors-str))))

-;; Verify non-existent granule deletion results in not found / 404 error.
+;;; Verify non-existent granule deletion results in not found / 404 error.
 (deftest delete-non-existent-granule-test
   (let [granule (util/granule-concept "PROV1" "C1000000000-PROV1" 5 "G1-PROV1")
         fake-provider-id (str (:provider-id granule) (:native-id granule))
         non-existent-granule (assoc granule :provider-id fake-provider-id)
         {:keys [status]} (util/delete-concept non-existent-granule)]
-    (is (= status 404))))
+    (is (= 404 status))))

-;; Verify existing granule can be deleted and operation results in revision id 1 greater than
-;; max revision id of the granule prior to the delete
+;;; Verify existing granule can be deleted and operation results in revision id 1 greater than
+;;; max revision id of the granule prior to the delete
 (deftest delete-granule-test
   (let [collection (util/collection-concept "PROV1" 5)
         _ (util/ingest-collection collection)
@@ -76,35 +76,42 @@
         delete-revision-id (:revision-id delete-result)]
     (is (= 1 (- delete-revision-id ingest-revision-id)))))

-;; Verify ingest behaves properly if request is missing content type.
+;;; Verify ingest behaves properly if request is missing content type.
 (deftest missing-content-type-ingest-test
   (let [collection (util/collection-concept "PROV1" 5)
         _ (util/ingest-collection collection)
         granule-with-no-content-type  (assoc (util/granule-concept "PROV1" "C1000000000-PROV1" 5 "G1-PROV1") :content-type "")
         {:keys [status errors-str]} (util/ingest-granule granule-with-no-content-type)]
-    (is (= status 400))
+    (is (= 400 status))
     (is (re-find #"Invalid content-type" errors-str))))

-;; Verify ingest behaves properly if request contains invalid  content type.
+;;; Verify ingest behaves properly if request contains invalid  content type.
 (deftest invalid-content-type-ingest-test
   (let [collection (util/collection-concept "PROV1" 5)
         _ (util/ingest-collection collection)
         granule-with-no-content-type (assoc (util/granule-concept "PROV1" "C1000000000-PROV1" 5 "G1-PROV1") :content-type "blah")
         {:keys [status errors-str]} (util/ingest-granule granule-with-no-content-type)]
-    (is (= status 400))
+    (is (= 400 status))
     (is (re-find #"Invalid content-type" errors-str))))

-;; Verify deleting same granule twice is not an error if ignore conflict is true.
+;;; Verify deleting same granule twice is not an error if ignore conflict is true.
 (deftest delete-same-granule-twice-test
   (let [collection (util/collection-concept "PROV1" 5)
         _ (util/ingest-collection collection)
-        granule (util/granule-concept "PROV1" "C1000000000-PROV1" 5 "G1-PROV1")
+        granule (util/granule-concept "PROV1" nil 5 "G1-PROV1")
         ingest-result (util/ingest-granule granule)
         delete1-result (util/delete-concept granule)
         delete2-result (util/delete-concept granule)]
     (is (= 200 (:status ingest-result)))
     (is (= 200 (:status delete1-result)))
     (is (= 200 (:status delete2-result)))))
+
+;;; Verify that attempts to ingest a granule whose parent does not exist result in a 404
+(deftest ingest-orphan-granule-test
+  (let [granule (util/granule-concept "PROV1" "C1000000000-PROV1" 5 "G1-PROV1")
+        {:keys [status]} (util/ingest-granule granule)]
+    (is (= 404 status))
+    (is (not (util/concept-exists-in-mdb? "G1-PROV1" 0)))))

 ;;; Fixtures


don't use io/file because that breaks when we are reading out of a zipped jar file.

--- src/metabase/util/infer_spaces.clj
+++ src/metabase/util/infer_spaces.clj
@@ -9,7 +9,7 @@
     "checkins"])

 ; # Build a cost dictionary, assuming Zipf's law and cost = -math.log(probability).
-(def ^:private words (concat special-words (s/split-lines (slurp (io/file (io/resource "words-by-frequency.txt"))))))
+(def ^:private words (concat special-words (s/split-lines (slurp (io/resource "words-by-frequency.txt")))))

 ; wordcost = dict((k, log((i+1)*log(len(words)))) for i,k in enumerate(words))
 (def ^:private word-cost


Structure for handling fake defaults.

Structure for handling fake defaults.

--- src/midje/internal_ideas/fakes.clj
+++ src/midje/internal_ideas/fakes.clj
@@ -115,24 +115,31 @@
  ;;; Binding

-(defmulti matches-call? (fn [fake function-var actual-args]
-                          (:type fake)))
-
-(defmethod matches-call? :not-called
-  [fake function-var actual-args]
+
+(defn var-handled-by-fake? [function-var fake]
   (= function-var (fake :lhs)))

-(defmethod matches-call? :default
-  [fake function-var actual-args]
-  (and (= function-var (fake :lhs))
+(defn- fakes-for-var [fakes function-var]
+  (filter (partial var-handled-by-fake? function-var) fakes))
+
+(defmulti call-handled-by-fake? (fn [function-var actual-args fake] (:type fake)))
+
+(defmethod call-handled-by-fake? :not-called
+  [function-var actual-args fake]
+  (var-handled-by-fake? function-var fake))
+
+(defmethod call-handled-by-fake? :default
+  [function-var actual-args fake]
+  (and (var-handled-by-fake? function-var fake)
        (= (count actual-args) (count (fake :arg-matchers)))
        (extended-list-= actual-args (fake :arg-matchers))))

-(defn find-matching-call [function-var actual-args fakes]
-  (first (filter #(matches-call? % function-var actual-args) fakes)))
+(defn fakes-for-call [fakes function-var actual-args]
+  (filter (partial call-handled-by-fake? function-var actual-args) fakes))

 (defn best-call-action [function-var actual-args fakes]
-  (let [found (find-matching-call function-var actual-args fakes)]
+  (let [possible-fakes (fakes-for-var fakes function-var)
+        found (first (fakes-for-call possible-fakes function-var actual-args))]
     (cond found
           {:use-fake true :matching-fake found}

@@ -142,7 +149,7 @@

 (defn call-faker [function-var actual-args fakes]
   "This is the function that handles all mocked calls."
-  (let [found (find-matching-call function-var actual-args fakes)]
+  (let [found (first (fakes-for-call fakes function-var actual-args))]
     (if-not found
       (do
         (clojure.test/report {:type :mock-argument-match-failure


Fix author [author] error with entries created through the REST API.

--- src/oc/storage/resources/entry.clj
+++ src/oc/storage/resources/entry.clj
@@ -69,7 +69,7 @@
           add-topic? (not ((set topics) (name topic-slug))) ; need to add the topic for this entry to the board?
           ts (db-common/current-timestamp)
           author (assoc (first (:author entry)) :updated-at ts) ; update initial author timestamp
-          entry-result (db-common/create-resource conn table-name (assoc entry :author author) ts)] ; create the entry
+          entry-result (db-common/create-resource conn table-name (assoc entry :author [author]) ts)] ; create the entry
       (when (and entry-result add-topic?)
         ;; Add the topic to the board
         (board-res/update-board! conn board-uuid {:topics (conj topics topic-slug)}))


Implement tabu search

Implement tabu search

Now I need to adapt the other functions to the new shape of data.


Implement a sub-command 'faidx'

Implement a sub-command 'faidx'

--- src/cljam/core.clj
+++ src/cljam/core.clj
@@ -94,7 +94,11 @@
   (with-command-line args
     "Usage: cljam faidx <ref.fasta>"
     [files]
-    nil))
+    (when-not (= (count files) 1)
+      (println "Invalid arguments")
+      (System/exit 1))
+    (io/spit-fai (str (first files) ".fai")
+                 (io/slurp-fasta (first files)))))

 (defn -main [& args]
   (do-sub-command args
@@ -106,4 +110,4 @@
     [:idxstats cljam.core/idxstats "Retrieve  and print stats in the index file."]
     [:merge    cljam.core/merge    "Merge multiple SAM/BAM."]
     [:pileup   cljam.core/pileup   "todo"]
-    [:faidx    cljam.core/faidx    "todo"]))
+    [:faidx    cljam.core/faidx    "Index reference sequence in the FASTA format."]))


fix mongo collection naming scheme (math env keyword -> name/string sans :)

--- src/polismath/components/mongo.clj
+++ src/polismath/components/mongo.clj
@@ -12,7 +12,7 @@
   prod, preprod, dev (and subdevs like chrisdev or mikedev) have their own noninterfering collections."
   ([mongo rootname]
    (let [{:keys [math-schema-date math-env]} (:config mongo)]
-     (str rootname "_" math-env "_" math-schema-date)))
+     (str rootname "_" (name math-env) "_" math-schema-date)))
   ([mongo rootname basename] (str (collection-name mongo rootname) basename)))

 (defn math-collection-name


Fix indentation

Fix indentation

--- src/re_frame/std_interceptors.cljc
+++ src/re_frame/std_interceptors.cljc
@@ -120,21 +120,21 @@
      2. call handler-fn giving coeffects
      3. stores the result back into the `:effects`"
   [handler-fn]
-(->interceptor
-  :id     :fx-handler
-  :before (fn fx-handler-before
-            [context]
-            (let [new-context
-                  (trace/with-trace
-                    {:op-type   :event/handler
-                     :operation (get-coeffect context :original-event)}
-                    (let [{:keys [event] :as coeffects} (get-coeffect context)]
-                      (->> (handler-fn coeffects event)
-                           (assoc context :effects))))]
-              (trace/merge-trace!
-                {:tags {:effects   (get-effect new-context)
-                        :coeffects (get-coeffect context)}})
-              new-context))))
+  (->interceptor
+    :id     :fx-handler
+    :before (fn fx-handler-before
+              [context]
+              (let [new-context
+                    (trace/with-trace
+                      {:op-type   :event/handler
+                       :operation (get-coeffect context :original-event)}
+                      (let [{:keys [event] :as coeffects} (get-coeffect context)]
+                        (->> (handler-fn coeffects event)
+                             (assoc context :effects))))]
+                (trace/merge-trace!
+                  {:tags {:effects   (get-effect new-context)
+                          :coeffects (get-coeffect context)}})
+                new-context))))

 (defn ctx-handler->interceptor


Trim the matches from find-symbol

Trim the matches from find-symbol

--- src/refactor_nrepl/find_symbol.clj
+++ src/refactor_nrepl/find_symbol.clj
@@ -75,7 +75,8 @@
          str/split-lines
          (drop line-index)
          (take (- eline line-index))
-         (str/join "\n"))))
+         (str/join "\n")
+         str/trim)))

 (defn- find-symbol-in-file [fully-qualified-name file]
   (let [file-content (slurp file)


CMR-2088: Fixed tests.

CMR-2088: Fixed tests.

--- metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/search_test.clj
+++ metadata-db-app/int_test/cmr/metadata_db/int_test/concepts/search_test.clj
@@ -341,11 +341,11 @@
   (let [tag1 (util/create-and-save-tag 1 3)
         tag2 (util/create-and-save-tag 2 2)]
     (testing "find latest revsions"
-      (are2 [granules params]
-            (= (set (map util/expected-granule-concept granules))
-               (set (-> (util/find-latest-concepts :tags params)
-                        :concepts
-                        concepts-for-comparison)))
+      (are2 [tags params]
+            (= (set tags)
+               (set (->> (util/find-latest-concepts :tags params)
+                         :concepts
+                         (map #(dissoc % :provider-id :revision-date)))))
             "with metadata"
             [tag1 tag2] {}


(TK-476) Catch all rbac errors in a single clause

--- src/puppetlabs/trapperkeeper/authorization/ring_middleware.clj
+++ src/puppetlabs/trapperkeeper/authorization/ring_middleware.clj
@@ -234,6 +234,14 @@
       request
       (ring-params/assoc-query-params request encoding))))

+(defn- rbac-error?
+  "Return true if an exception comes from puppetlabs-rbac* libraries (rbac or rbac-client)"
+  [err]
+  (some-> err
+          :kind
+          namespace
+          (str/starts-with? "puppetlabs.rbac")))
+
 (schema/defn add-rbac-subject
   [request :- ring/Request
    token->subject :- (schema/maybe IFn)]
@@ -241,13 +249,7 @@
     (if-let [token (get-in request [:headers "x-authentication"])]
       (sling/try+
         (assoc request :rbac-subject (token->subject token))
-        (catch [:kind :puppetlabs.rbac/token-revoked] {:keys [msg]}
-          (log/error "Failure validating RBAC token:" msg)
-          (assoc request :rbac-error msg))
-        (catch [:kind :puppetlabs.rbac/token-expired] {:keys [msg]}
-          (log/error "Failure validating RBAC token:" msg)
-          (assoc request :rbac-error msg))
-        (catch [:kind :puppetlabs.rbac-client/connection-failure] {:keys [msg]}
+        (catch rbac-error? {:keys [msg]}
           (log/error "Failure validating RBAC token:" msg)
           (assoc request :rbac-error msg)))
       request)


Removes cruft code

Removes cruft code

--- src/lt/objs/console.cljs
+++ src/lt/objs/console.cljs
@@ -33,7 +33,6 @@
 (defui console-ui [this]
   [:ul.console]
   :contextmenu (fn [e]
-                 (object/assoc-in! this [:current-event] e)
                  (object/raise this :menu! e)))

 (behavior ::on-close


Avoid opening a nonexistent file and logging error

With dffe186953b6be27b7ba1ee402d8bc0a94f6626f, we log failed file
openings. When saving clojure.cljs in the Clojure plugin, I was
seeing these unnecessary errors as the plugin's clojurescript was
rebuilt

--- src/lt/objs/plugins.cljs
+++ src/lt/objs/plugins.cljs
@@ -96,21 +96,22 @@
       plugin)))

 (defn plugin-edn [dir]
-  (when-let [content (files/open-sync (files/join dir "plugin.edn"))]
-    (try
-      (-> (EOF-read (:content content))
+  (let [file (files/join dir "plugin.edn")]
+    (when-let [content (and (files/exists? file) (files/open-sync file))]
+      (try
+        (-> (EOF-read (:content content))
+            (assoc :dir dir)
+            (validate "plugin.edn"))
+        (catch :default e
+          (console/error (str "FAILED to load plugin.edn: " dir)))))))
+
+(defn plugin-json [dir]
+  (let [file (files/join dir "plugin.json")]
+    (when-let [content (and (files/exists? file) (files/open-sync file))]
+      (-> (js/JSON.parse (:content content))
+          (js->clj :keywordize-keys true)
           (assoc :dir dir)
-          (validate "plugin.edn"))
-      (catch :default e
-        (console/error (str "FAILED to load plugin.edn: " dir))))
-    ))
-
-(defn plugin-json [dir]
-  (when-let [content (files/open-sync (files/join dir "plugin.json"))]
-    (-> (js/JSON.parse (:content content))
-        (js->clj :keywordize-keys true)
-        (assoc :dir dir)
-        (validate "plugin.json"))))
+          (validate "plugin.json")))))

 (defn plugin-info [dir]
   (or (plugin-json dir) (plugin-edn dir)))


:bug: Redirect to 404 page when file not found on workspace.

--- frontend/src/uxbox/main/data/workspace.cljs
+++ frontend/src/uxbox/main/data/workspace.cljs
@@ -9,21 +9,22 @@

 (ns uxbox.main.data.workspace
   (:require
+   [beicon.core :as rx]
+   [cljs.spec.alpha :as s]
    [clojure.set :as set]
-   [beicon.core :as rx]
+   [goog.events :as events]
    [goog.object :as gobj]
-   [goog.events :as events]
-   [cljs.spec.alpha :as s]
    [potok.core :as ptk]
    [uxbox.common.data :as d]
+   [uxbox.common.exceptions :as ex]
    [uxbox.common.pages :as cp]
    [uxbox.common.spec :as us]
-   [uxbox.common.exceptions :as ex]
+   [uxbox.common.uuid :as uuid]
    [uxbox.config :as cfg]
    [uxbox.main.constants :as c]
-   [uxbox.main.data.icons :as udi]
    [uxbox.main.data.dashboard :as dd]
    [uxbox.main.data.helpers :as helpers]
+   [uxbox.main.data.icons :as udi]
    [uxbox.main.geom :as geom]
    [uxbox.main.refs :as refs]
    [uxbox.main.repo :as rp]
@@ -38,7 +39,6 @@
    [uxbox.util.router :as rt]
    [uxbox.util.time :as dt]
    [uxbox.util.transit :as t]
-   [uxbox.common.uuid :as uuid]
    [uxbox.util.webapi :as wapi]
    #_[vendor.randomcolor])
   (:import goog.events.EventType
@@ -530,7 +530,10 @@
       (->> (rp/query :file-with-users {:id id})
            (rx/merge-map (fn [result]
                            (rx/of (file-fetched (dissoc result :users))
-                                  (users-fetched (:users result)))))))))
+                                  (users-fetched (:users result)))))
+           (rx/catch (fn [{:keys [type] :as error}]
+                       (when (= :not-found type)
+                         (rx/of (rt/nav :not-found)))))))))
 (defn fetch-file
   [id]
   (us/verify ::us/uuid id)


Log parallel query trace

Log parallel query trace

--- workspaces/src/com/wsscode/pathom/workspaces/parallel_parser_cards.cljs
+++ workspaces/src/com/wsscode/pathom/workspaces/parallel_parser_cards.cljs
@@ -111,18 +111,19 @@
                                    ::p/placeholder-prefixes #{">"}}
                       ::p/mutate  pc/mutate-async
                       ::p/plugins [p/error-handler-plugin
-                                   p/trace-plugin
-                                   p/request-cache-plugin]}))
+                                   p/request-cache-plugin
+                                   p/trace-plugin]}))

 (defn run-query []
   (go-catch
     (let [res (<! (demo-parser {} [{::all [::id ::color]} :com.wsscode.pathom/trace]))]
-      (-> res :com.wsscode.pathom/trace pt/compute-durations))))
+      (-> res :com.wsscode.pathom/trace))))

 (fp/defsc TraceViz [this {::keys [trace]}]
   {:componentDidMount
    (fn []
      )}
+  (js/console.log "TRACE" trace)
   (dom/div))

 (def trace-viz (fp/factory TraceViz))


[keycard] Fix assets message signature

[keycard] Fix assets message signature

--- src/status_im/hardwallet/sign.cljs
+++ src/status_im/hardwallet/sign.cljs
@@ -43,11 +43,18 @@
                 (when-not keycard-match?
                   (common/show-wrong-keycard-alert card-connected?))))))

+(defn normalize-signature [signature]
+  (-> signature
+      (clojure.string/replace-first #"00$", "1b")
+      (clojure.string/replace-first #"01$", "1c")
+      ethereum/normalized-hex))
+
 (fx/defn sign-message
   {:events [:hardwallet/sign-message]}
   [{:keys [db] :as cofx} params result]
   (let [{:keys [result error]} (types/json->clj result)
-        on-success #(re-frame/dispatch [:hardwallet/on-sign-message-success params %])
+        on-success #(re-frame/dispatch [:hardwallet/on-sign-message-success params
+                                        (normalize-signature %)])
         hash (ethereum/naked-address result)
         card-connected?                   (get-in db [:hardwallet :card-connected?])
         pairing                           (common/get-pairing db)
@@ -159,11 +166,7 @@
   {:events [:hardwallet.callback/on-sign-success]}
   [{:keys [db] :as cofx} signature]
   (log/debug "[hardwallet] sign success: " signature)
-  (let [signature-json (types/clj->json
-                        {:result (-> signature
-                                     (clojure.string/replace-first #"00$", "1b")
-                                     (clojure.string/replace-first #"01$", "1c")
-                                     ethereum/normalized-hex)})
+  (let [signature-json (types/clj->json {:result (normalize-signature signature)})
         transaction    (get-in db [:hardwallet :transaction])
         tx-obj         (select-keys transaction [:from :to :value :gas :gasPrice :command? :chat-id :message-id])
         command?       (:command? transaction)]


add debugging logs

add debugging logs

--- src/chat/server/extensions/asana.clj
+++ src/chat/server/extensions/asana.clj
@@ -103,9 +103,16 @@
           (if (hmac-verify {:secret (get-in extension [:config :webhook-secret])
                             :data (str (:body event-req))
                             :mac signature})
-            (let [data (json/read-str (:body event-req))]
+            (do
               (timbre/debugf "webhook signature okay")
-              {:status 200})
+              (let [data (json/read-str (:body event-req))
+                    new-issues (->> (data "events")
+                                    (filter (fn [e] (and (= "task" (e "type"))
+                                                         (= "added" (e "action"))))))]
+                ; TODO: start a new thread for the issue & watch the thread
+                (timbre/debugf "event data: %s" data)
+                (timbre/debugf "new issues %s" new-issues)
+                {:status 200}))
             {:status 400 :body "bad hmac"}))
       (do (timbre/warnf "missing signature on webhook %s" event-req)
           {:status 400 :body "missing signature"}))))
@@ -114,7 +121,9 @@

 (defmethod handle-thread-change :asana
   [extension thread-id]
-  (println "ext" extension "Thread changed" thread-id))
+  (timbre/debugf "Thread changed %s for extension %s" thread-id extension)
+  ; TODO: add comment to thread
+  )

 ;; Fetching information
 (defn fetch-asana-info