Fixed formatting in genetic_operators.clj

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -88,7 +88,7 @@

 (defn add-parentheses-mutate
   "Returns a version of the given individual with one pair of parentheses added
-somewhere. Not compatible with (currently 'experimental') tagged code macros."
+   somewhere. Not compatible with (currently 'experimental') tagged code macros."
   [ind max-points]
   (let [expression (:program ind)
         new-program (let [expstr (str expression)
@@ -114,8 +114,8 @@

 (defn tagging-mutate
   "Returns a version of the given individual with a piece of code replaced by a tag
-reference, and with an expression that tags the replaced code with the same tag added
-to the beginning of the individual's program."
+   reference, and with an expression that tags the replaced code with the same tag added
+   to the beginning of the individual's program."
   [ind max-points tag-limit]
   (let [old-program (:program ind)
         index-to-tag (select-node-index old-program)
@@ -136,12 +136,12 @@

 (defn tag-branch-insertion-mutate
   "Returns a version of the given individual with a tag-branch inserted at a random
-location. A tag-branch is a sequence of instructions that 1) produces a boolean
-value by performing a randomly chosen comparison of copies (not popped) of the top
-two items of a randomly selected type, and 2) branches to one of two tags depending
-on the result. The type-instruction-pairs argument should be a sequence of pairs,
-in which the first element of each is a type and the second element is a Push instruction
-that performs a comparison of the type, as in [:integer 'integer_eq]."
+   location. A tag-branch is a sequence of instructions that 1) produces a boolean
+   value by performing a randomly chosen comparison of copies (not popped) of the top
+   two items of a randomly selected type, and 2) branches to one of two tags depending
+   on the result. The type-instruction-pairs argument should be a sequence of pairs,
+   in which the first element of each is a type and the second element is a Push instruction
+   that performs a comparison of the type, as in [:integer 'integer_eq]."
   [ind max-points type-instruction-pairs tag-limit]
   (let [old-program (:program ind)
         tag-ref-instruction-1 (symbol (str "tagged_" (str (lrand-int tag-limit))))
@@ -238,9 +238,9 @@
 (defn delete-somewhere
   [thing lst]
   (let [locations (->> lst
-                    (map vector (iterate inc 0))
-                    (filter #(= (second %) thing))
-                    (map first))
+                       (map vector (iterate inc 0))
+                       (filter #(= (second %) thing))
+                       (map first))
         location (lrand-nth locations)]
     (concat (take location lst)
             (drop (inc location) lst))))
@@ -287,10 +287,10 @@
   [open-close-sequence]
   ;(println "balancing:" open-close-sequence)
   (-> open-close-sequence
-    (left-balance :open :close)
-    (reverse)
-    (left-balance :close :open)
-    (reverse)))
+      (left-balance :open :close)
+      (reverse)
+      (left-balance :close :open)
+      (reverse)))

 ;(let [s '(:open 1 2 :open a b :open c :close :open :open d :close :close e :close :close)]
 ;  (println s)
@@ -367,7 +367,7 @@

 (defn ultra
   "Returns the result of applying the ULTRA (Uniform Linear Transformation
-with Repair and Alternation) operation to parent1 and parent2."
+   with Repair and Alternation) operation to parent1 and parent2."
   [parent1 parent2 max-points alternation-rate alignment-deviation mutation-rate atom-generators]
   (let [new-program (ultra-operate-on-programs (:program parent1)
                                                (:program parent2)
@@ -381,6 +381,3 @@
                        :ancestors (if maintain-ancestors
                                     (cons (:program parent1) (:ancestors parent1))
                                     (:ancestors parent1))))))
-
-
-


Improve tailing

Improve tailing

--- test/com/nomistech/clojure_the_language/c_920_io/tailing.clj
+++ test/com/nomistech/clojure_the_language/c_920_io/tailing.clj
@@ -54,33 +54,33 @@
             :append true)
       (Thread/sleep sleep-ms))))

-(fact (let [delay-ms        100
-            sleep-ms        (+ delay-ms 10)
-            lines-s         [["I met her in a pool room"
-                              "Her name I didn't catch"
-                              "She looked like something special"
-                              "The kind who'd understand"
-                              "The room was almost spinning"]
-                             ["She pulled another smile"
-                              "She had the grace like pleasure"
-                              "She had a certain style"
-                              "Sunlight on the lino"
-                              "Woke me with a shake"]
-                             ["I looked around to find her"
-                              "But she'd gone"
-                              "Goodbye girl"
-                              "Goodbye girl"
-                              "Goodbye girl"]]
-            f               (let [f (File. "test/_work-dir/plop.log")]
-                              ;; Setting up some initial content makes things
-                              ;; work as I expect; without this my first line
-                              ;; is lost.
-                              ;; jsk-2016-10-29
-                              (spit f "this will be ignored this will be ignored this will be ignored this will be ignored\n")
-                              f)
-            t-and-c         (tailer-and-channel f delay-ms)
-            result-ch       (a/thread (doall (tailer-and-channel->seq t-and-c)))]
-        (spit-lines-s f lines-s sleep-ms)
+(fact (let [delay-ms  100
+            sleep-ms  (+ delay-ms 10)
+            lines-s   [["I met her in a pool room"
+                        "Her name I didn't catch"
+                        "She looked like something special"
+                        "The kind who'd understand"
+                        "The room was almost spinning"]
+                       ["She pulled another smile"
+                        "She had the grace like pleasure"
+                        "She had a certain style"
+                        "Sunlight on the lino"
+                        "Woke me with a shake"]
+                       ["I looked around to find her"
+                        "But she'd gone"
+                        "Goodbye girl"
+                        "Goodbye girl"
+                        "Goodbye girl"]]
+            file      (let [f (File. "test/_work-dir/plop.log")]
+                        ;; Setting up some initial content makes things
+                        ;; work as I expect; without this my first line
+                        ;; is lost.
+                        ;; jsk-2016-10-29
+                        (spit f "this will be ignored this will be ignored this will be ignored this will be ignored\n")
+                        f)
+            t-and-c   (tailer-and-channel file delay-ms)
+            result-ch (a/thread (doall (tailer-and-channel->seq t-and-c)))]
+        (spit-lines-s file lines-s sleep-ms)
         (stop-tailer-and-channel t-and-c)
         (a/<!! result-ch)
         => ["I met her in a pool room"


Vorbereitung 26.11.

Vorbereitung 26.11.

--- src/fpc/ul05.clj
+++ src/fpc/ul05.clj
@@ -162,3 +162,104 @@
 (prime? 99993)
 ;=> false

+; Aufgabe 6 Pascal'sche Zahlen
+; Rekursive Funktion (pascal row index) zur Berechnung
+; der Pascalschen Zahl
+
+(defn pascal
+  "Value in Pascal's triangle in row r at index i (counting beginning with 1)."
+  [r i]
+  {:pre [(integer? r) (integer? i) (<= 1 i r)]}
+  (if (or (= i 1) (= i r))
+    1
+    (+ (pascal (dec r) (dec i)) (pascal (dec r) i))))
+
+
+(pascal 1 1)
+;=> 1
+
+(pascal 0 1)
+;=> AssertionError Assert failed: (<= 1 i r)
+
+(pascal 2 1)
+;=>  1
+
+(pascal 2 2)
+;=> 1
+
+(pascal 2 3)
+;=> AssertionError Assert failed: (<= 1 i r)
+
+(pascal 3 1)
+;=> 1
+
+(pascal 3 2)
+;=> 2
+
+(pascal 3 3)
+;=> 1
+
+(pascal 4 2)
+;=> 3
+
+(pascal 5 3)
+;=> 6
+
+;; Endrekursive Variante
+(comment
+  Für die Binomialkoeffizienten gibt es eine Formel:
+
+    n
+  (   ) = Produkt i = 1 bis k  (n - k + i) / i
+    k
+
+  Beispiel:
+
+                   4
+  pascal (5 3) = (   )  und das ist nach obiger Formel
+                   2
+
+  (4-2+1)/1 * (4-2+2)/2 = 3/1 * 4/2 = 3 * 2 = 6
+
+  oder von hinten her aufziehen:
+
+  ((1 * 4)/2 * 3)/1    n und k entsprechend runterzählen
+
+  Das können wir verwenden:
+)
+
+(defn pascal
+  [z s]
+  "Endrekursive Variante für die Berechnung der Pascal'schen Zahl
+   an Zeile z und Spalte s."
+   (let [n (dec z) k (dec s)]
+     (loop [current-n n current-k k acc 1]
+       (cond
+         (or (< z 1) (< z s) (< s 1)) 0
+         (or (= current-n 0) (= current-k 0) (= current-k current-n)) acc
+         :else (recur (dec current-n) (dec current-k) (/ (* acc current-n) current-k))))))
+
+(pascal 1 1)
+;=> 1
+
+(pascal 5 1)
+;=> 1
+
+(pascal 5 2)
+;=> 4
+
+(pascal 5 3)
+;=> 6
+
+(pascal 5 4)
+;=> 4
+
+(pascal 5 5)
+;=> 1
+
+(pascal 5 0)
+;=> 0
+
+(pascal 5 6)
+;=> 0
+


CMR-5920: Fixed collection-keywords-validation-test.

--- common-app-lib/src/cmr/common_app/services/kms_lookup.clj
+++ common-app-lib/src/cmr/common_app/services/kms_lookup.clj
@@ -183,7 +183,7 @@
                           (kms-scheme->fields-for-umm-c-lookup keyword-scheme))]
     (as-> kms-index index
           (get index keyword-scheme)
-          (map #(set/rename-keys % {:granule-data-format :format}) index)
+          (map #(set/rename-keys % {:granuledataformat :format}) index)
           (filter #(= (str/lower-case (:format %))
                       (str/lower-case (:format comparison-map)))
                   index)


update unit tests for query-processor to reflect the fact that :extra_info is now part of our responses.

--- test/metabase/driver/generic_sql/query_processor_test.clj
+++ test/metabase/driver/generic_sql/query_processor_test.clj
@@ -119,12 +119,12 @@
                  [9 71 1 -118.301 34.1018 "Krua Siri"]
                  [10 20 2 -118.292 34.1046 "Fred 62"]],
           :columns ["ID" "CATEGORY_ID" "PRICE" "LONGITUDE" "LATITUDE" "NAME"],
-          :cols [{:special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :venues), :id (field->id :venues :id)}
-                 {:special_type "fk", :base_type "IntegerField", :description nil, :name "CATEGORY_ID", :table_id (table->id :venues), :id (field->id :venues :category_id)}
-                 {:special_type nil, :base_type "IntegerField", :description nil, :name "PRICE", :table_id (table->id :venues), :id (field->id :venues :price)}
-                 {:special_type "longitude", :base_type "FloatField", :description nil, :name "LONGITUDE", :table_id (table->id :venues), :id (field->id :venues :longitude)}
-                 {:special_type "latitude", :base_type "FloatField", :description nil, :name "LATITUDE", :table_id (table->id :venues), :id (field->id :venues :latitude)}
-                 {:special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :venues), :id (field->id :venues :name)}]}}
+          :cols [{:extra_info {} :special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :venues), :id (field->id :venues :id)}
+                 {:extra_info {:target_table_id (table->id :categories)} :special_type "fk", :base_type "IntegerField", :description nil, :name "CATEGORY_ID", :table_id (table->id :venues), :id (field->id :venues :category_id)}
+                 {:extra_info {} :special_type nil, :base_type "IntegerField", :description nil, :name "PRICE", :table_id (table->id :venues), :id (field->id :venues :price)}
+                 {:extra_info {} :special_type "longitude", :base_type "FloatField", :description nil, :name "LONGITUDE", :table_id (table->id :venues), :id (field->id :venues :longitude)}
+                 {:extra_info {} :special_type "latitude", :base_type "FloatField", :description nil, :name "LATITUDE", :table_id (table->id :venues), :id (field->id :venues :latitude)}
+                 {:extra_info {} :special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :venues), :id (field->id :venues :name)}]}}
         (process-and-run {:type :query
                           :database @db-id
                           :query {:source_table (table->id :venues)
@@ -146,8 +146,8 @@
                        [4 "Asian"]
                        [5 "BBQ"]]
                 :columns ["ID", "NAME"]
-                :cols [{:special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :categories), :id (field->id :categories :id)}
-                       {:special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :categories), :id (field->id :categories :name)}]}}
+                :cols [{:extra_info {} :special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :categories), :id (field->id :categories :id)}
+                       {:extra_info {} :special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :categories), :id (field->id :categories :name)}]}}
   (process-and-run {:type :query
                     :database @db-id
                     :query {:source_table (table->id :categories)
@@ -165,8 +165,8 @@
                        [9 "Breakfast / Brunch"]
                        [10 "Brewery"]]
                 :columns ["ID", "NAME"]
-                :cols [{:special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :categories), :id (field->id :categories :id)}
-                       {:special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :categories), :id (field->id :categories :name)}]}}
+                :cols [{:extra_info {} :special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :categories), :id (field->id :categories :id)}
+                       {:extra_info {} :special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :categories), :id (field->id :categories :name)}]}}
   (process-and-run {:type :query
                     :database @db-id
                     :query {:source_table (table->id :categories)
@@ -190,8 +190,8 @@
                        ["Krua Siri" 9]
                        ["Fred 62" 10]],
                 :columns ["NAME" "ID"],
-                :cols [{:special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :venues), :id (field->id :venues :name)}
-                       {:special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :venues), :id (field->id :venues :id)}]}}
+                :cols [{:extra_info {} :special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :venues), :id (field->id :venues :name)}
+                       {:extra_info {} :special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :venues), :id (field->id :venues :id)}]}}
         (process-and-run {:type :query
                           :database @db-id
                           :query {:source_table (table->id :venues)
@@ -209,9 +209,9 @@
          :row_count 10,
          :data {:rows [[1 12 375] [1 9 139] [1 1 72] [2 15 129] [2 12 471] [2 11 325] [2 9 590] [2 9 833] [2 8 380] [2 5 719]],
                 :columns ["VENUE_ID" "USER_ID" "ID"],
-                :cols [{:special_type "fk", :base_type "IntegerField", :description nil, :name "VENUE_ID", :table_id (table->id :checkins), :id (field->id :checkins :venue_id)}
-                       {:special_type "fk", :base_type "IntegerField", :description nil, :name "USER_ID", :table_id (table->id :checkins), :id (field->id :checkins :user_id)}
-                       {:special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :checkins), :id (field->id :checkins :id)}]}}
+                :cols [{:extra_info {:target_table_id (table->id :venues)} :special_type "fk", :base_type "IntegerField", :description nil, :name "VENUE_ID", :table_id (table->id :checkins), :id (field->id :checkins :venue_id)}
+                       {:extra_info {:target_table_id (table->id :users)} :special_type "fk", :base_type "IntegerField", :description nil, :name "USER_ID", :table_id (table->id :checkins), :id (field->id :checkins :user_id)}
+                       {:extra_info {} :special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :checkins), :id (field->id :checkins :id)}]}}
         (process-and-run {:type :query
                           :database @db-id
                           :query {:source_table (table->id :checkins)
@@ -230,12 +230,12 @@
   (delay ["ID" "CATEGORY_ID" "PRICE" "LONGITUDE" "LATITUDE" "NAME"]))

 (def venues-cols
-  (delay [{:special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :venues), :id (field->id :venues :id)}
-          {:special_type "fk", :base_type "IntegerField", :description nil, :name "CATEGORY_ID", :table_id (table->id :venues), :id (field->id :venues :category_id)}
-          {:special_type nil, :base_type "IntegerField", :description nil, :name "PRICE", :table_id (table->id :venues), :id (field->id :venues :price)}
-          {:special_type "longitude", :base_type "FloatField", :description nil, :name "LONGITUDE", :table_id (table->id :venues), :id (field->id :venues :longitude)}
-          {:special_type "latitude", :base_type "FloatField", :description nil, :name "LATITUDE", :table_id (table->id :venues), :id (field->id :venues :latitude)}
-          {:special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :venues), :id (field->id :venues :name)}]))
+  (delay [{:extra_info {} :special_type "id", :base_type "BigIntegerField", :description nil, :name "ID", :table_id (table->id :venues), :id (field->id :venues :id)}
+          {:extra_info {:target_table_id (table->id :categories)} :special_type "fk", :base_type "IntegerField", :description nil, :name "CATEGORY_ID", :table_id (table->id :venues), :id (field->id :venues :category_id)}
+          {:extra_info {} :special_type nil, :base_type "IntegerField", :description nil, :name "PRICE", :table_id (table->id :venues), :id (field->id :venues :price)}
+          {:extra_info {} :special_type "longitude", :base_type "FloatField", :description nil, :name "LONGITUDE", :table_id (table->id :venues), :id (field->id :venues :longitude)}
+          {:extra_info {} :special_type "latitude", :base_type "FloatField", :description nil, :name "LATITUDE", :table_id (table->id :venues), :id (field->id :venues :latitude)}
+          {:extra_info {} :special_type nil, :base_type "TextField", :description nil, :name "NAME", :table_id (table->id :venues), :id (field->id :venues :name)}]))

 ;; ### FILTER -- "AND", ">", ">="
 (expect {:status :completed,
@@ -324,7 +324,7 @@
          :row_count 15,
          :data {:rows [[1 31] [2 70] [3 75] [4 77] [5 69] [6 70] [7 76] [8 81] [9 68] [10 78] [11 74] [12 59] [13 76] [14 62] [15 34]],
                 :columns ["USER_ID" "count"],
-                :cols [{:special_type "fk", :base_type "IntegerField", :description nil, :name "USER_ID", :table_id (table->id :checkins) :id (field->id :checkins :user_id)}
+                :cols [{:extra_info {:target_table_id (table->id :users)} :special_type "fk", :base_type "IntegerField", :description nil, :name "USER_ID", :table_id (table->id :checkins) :id (field->id :checkins :user_id)}
                        {:base_type "IntegerField", :special_type "number", :name "count", :id nil, :table_id nil, :description nil}]}}
         (process-and-run {:type :query
                           :database @db-id
@@ -341,8 +341,8 @@
          :row_count 10,
          :data {:rows [[1 1 1] [5 1 1] [7 1 1] [10 1 1] [13 1 1] [16 1 1] [26 1 1] [31 1 1] [35 1 1] [36 1 1]],
                 :columns ["VENUE_ID" "USER_ID" "count"],
-                :cols [{:special_type "fk", :base_type "IntegerField", :description nil, :name "VENUE_ID", :table_id (table->id :checkins), :id (field->id :checkins :venue_id)}
-                       {:special_type "fk", :base_type "IntegerField", :description nil, :name "USER_ID", :table_id (table->id :checkins), :id (field->id :checkins :user_id)}
+                :cols [{:extra_info {:target_table_id (table->id :venues)} :special_type "fk", :base_type "IntegerField", :description nil, :name "VENUE_ID", :table_id (table->id :checkins), :id (field->id :checkins :venue_id)}
+                       {:extra_info {:target_table_id (table->id :users)} :special_type "fk", :base_type "IntegerField", :description nil, :name "USER_ID", :table_id (table->id :checkins), :id (field->id :checkins :user_id)}
                        {:base_type "IntegerField", :special_type "number", :name "count", :id nil, :table_id nil, :description nil}]}}
         (process-and-run {:type :query
                           :database @db-id
@@ -358,8 +358,8 @@
          :row_count 10,
          :data {:rows [[2 15 1] [3 15 1] [7 15 1] [14 15 1] [16 15 1] [18 15 1] [22 15 1] [23 15 2] [24 15 1] [27 15 1]],
                 :columns ["VENUE_ID" "USER_ID" "count"],
-                :cols [{:special_type "fk", :base_type "IntegerField", :description nil, :name "VENUE_ID", :table_id (table->id :checkins), :id (field->id :checkins :venue_id)}
-                       {:special_type "fk", :base_type "IntegerField", :description nil, :name "USER_ID", :table_id (table->id :checkins), :id (field->id :checkins :user_id)}
+                :cols [{:extra_info {:target_table_id (table->id :venues)} :special_type "fk", :base_type "IntegerField", :description nil, :name "VENUE_ID", :table_id (table->id :checkins), :id (field->id :checkins :venue_id)}
+                       {:extra_info {:target_table_id (table->id :users)} :special_type "fk", :base_type "IntegerField", :description nil, :name "USER_ID", :table_id (table->id :checkins), :id (field->id :checkins :user_id)}
                        {:base_type "IntegerField", :special_type "number", :name "count", :id nil, :table_id nil, :description nil}]}}
         (process-and-run {:type :query
                           :database @db-id
@@ -393,7 +393,7 @@
          :row_count 15
          :data {:rows [[1] [3] [6] [10] [15] [21] [28] [36] [45] [55] [66] [78] [91] [105] [120]]
                 :columns ["ID"]
-                :cols [{:special_type "id", :base_type "IntegerField", :description nil, :name "ID", :table_id (table->id :users), :id (field->id :users :id)}]}}
+                :cols [{:extra_info {} :special_type "id", :base_type "IntegerField", :description nil, :name "ID", :table_id (table->id :users), :id (field->id :users :id)}]}}
   (process-and-run {:type :query
                     :database @db-id
                     :query {:limit nil
@@ -407,8 +407,8 @@
          :row_count 15
          :data {:rows [4 12 13 22 34 44 57 72 78 85 90 104 115 118 120]
                 :columns ["ID" "CAST(LAST_LOGIN AS DATE)"]
-                :cols [{:special_type "id", :base_type "IntegerField", :description nil, :name "ID", :table_id (table->id :users), :id (field->id :users :id)}
-                       {:special_type nil, :base_type "DateTimeField", :description nil, :name "LAST_LOGIN", :table_id (table->id :users), :id (field->id :users :last_login)}]}}
+                :cols [{:extra_info {} :special_type "id", :base_type "IntegerField", :description nil, :name "ID", :table_id (table->id :users), :id (field->id :users :id)}
+                       {:extra_info {} :special_type nil, :base_type "DateTimeField", :description nil, :name "LAST_LOGIN", :table_id (table->id :users), :id (field->id :users :last_login)}]}}
   (-> (process-and-run {:type :query
                         :database @db-id
                         :query {:limit nil


more ibm wierdness

more ibm wierdness

--- dada-core/src/test/clojure/org/dada/core/test_clojure.clj
+++ dada-core/src/test/clojure/org/dada/core/test_clojure.clj
@@ -128,14 +128,15 @@
 ;; 		(dotimes [i n] (swap! a conj [i i]))
 ;; 		))))

-;; atom 4 times faster on J6/C1.3a4
-(deftest atom-vs-ref
-  (let [a (atom 0)
-	r (ref 0)]
-    (dosync
-     (is (faster 10000000
-		 (swap! a inc)
-		 (alter r inc))))))
+;; atom 4 times faster on J6/C1.3a4
+(if (not (ibm?))
+  (deftest atom-vs-ref
+    (let [a (atom 0)
+	  r (ref 0)]
+      (dosync
+       (is (faster 10000000
+		   (swap! a inc)
+		   (alter r inc)))))))

 ;; [with two cores] pmap is about 50x slower than map - i.e. the
 ;; overhead of dispatching and collating each thread means that you


New function name from old repl state.

New function name from old repl state.

--- src/onyx/flow_conditions/fc_routing.cljc
+++ src/onyx/flow_conditions/fc_routing.cljc
@@ -50,7 +50,7 @@
       (if (seq compiled-ex-fcs)
         (choose-output-paths event compiled-ex-fcs result (:exception (ex-data message)) egress-ids)
         (let [{:keys [exception segment]} (ex-data message)]
-          (throw (maybe-attach-exception exception segment))))
+          (throw (maybe-attach-segment exception segment))))
       (if (seq compiled-norm-fcs)
         (choose-output-paths event compiled-norm-fcs result message egress-ids)
         (->Route egress-ids nil nil nil)))))


(PDB-4962) PuppetDBServer/query rely on narrow-globals too

Rely on the existing function so there's only one place to make
changes.

--- src/puppetlabs/puppetdb/cli/services.clj
+++ src/puppetlabs/puppetdb/cli/services.clj
@@ -58,6 +58,7 @@
             [puppetlabs.puppetdb.command.constants :refer [command-names]]
             [puppetlabs.puppetdb.command.dlo :as dlo]
             [puppetlabs.puppetdb.config :as conf]
+            [puppetlabs.puppetdb.http.query :as http-q]
             [puppetlabs.puppetdb.http.server :as server]
             [puppetlabs.puppetdb.jdbc :as jdbc]
             [puppetlabs.puppetdb.meta.version :as version]
@@ -1129,9 +1130,7 @@
    (let [sc (service-context this)
          _ (throw-unless-started sc)
          query-options (-> (get sc :shared-globals)
-                           (select-keys [:scf-read-db :warn-experimental
-                                         :node-purge-ttl :add-agent-report-filter
-                                         :log-queries])
+                           http-q/narrow-globals
                            (assoc :url-prefix @(get sc :url-prefix)))]
      (qeng/stream-query-result version
                                query-expr


Use `:permalink` in `static` if set, and set `:path` on `entry`

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -586,12 +586,12 @@
    p page     PAGE     str "static result page path"
    m meta     META     edn "metadata to set on the static entry"]
   (let [options (merge +static-defaults+ *opts*)
-        path (make-path (:out-dir options) nil (:page options))
+        path (make-path (:out-dir options) (:permalink (:meta options)) (:page options))
         static-path (fn [fileset options]
                       (perun/report-info "static" "rendered %s" path)
                       {path {:render-data {:meta (perun/get-global-meta fileset)
                                            :entry (:meta options)}
-                             :entry (:meta options)}})]
+                             :entry (assoc (:meta options) :path path)}})]
     (render-pre-wrap static-path options :io.perun/static)))

 (defn- grouped-paths


bring paginate up-to-date with fileset-invictus

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -689,7 +689,8 @@
   {:out-dir "public"
    :prefix "page-"
    :page-size 10
-   :filterer :has-content
+   :filterer identity
+   :extensions [".html"]
    :sortby (fn [file] (:date-published file))
    :comparator (fn [i1 i2] (compare i2 i1))})

@@ -705,14 +706,15 @@
    to the `filterer` option.

    The `sortby` function can be used for ordering entries before rendering."
-  [o out-dir    OUTDIR     str  "the output directory"
-   f prefix     PREFIX     str  "the prefix for each html file, eg prefix-1.html, prefix-2.html (default: `\"page-\"`)"
-   p page-size  PAGESIZE   int  "the number of entries to include in each page (default: `10`)"
-   r renderer   RENDERER   sym  "page renderer (fully qualified symbol resolving to a function)"
-   _ filterer   FILTER     code "predicate to use for selecting entries (default: `:has-content`)"
-   s sortby     SORTBY     code "sort entries by function"
-   c comparator COMPARATOR code "sort by comparator function"
-   m meta       META       edn  "metadata to set on each collection entry"]
+  [o out-dir    OUTDIR     str   "the output directory"
+   f prefix     PREFIX     str   "the prefix for each html file, eg prefix-1.html, prefix-2.html (default: `\"page-\"`)"
+   p page-size  PAGESIZE   int   "the number of entries to include in each page (default: `10`)"
+   r renderer   RENDERER   sym   "page renderer (fully qualified symbol resolving to a function)"
+   _ filterer   FILTER     code  "predicate to use for selecting entries (default: `identity`)"
+   e extensions EXTENSIONS [str] "extensions of files to include"
+   s sortby     SORTBY     code  "sort entries by function"
+   c comparator COMPARATOR code  "sort by comparator function"
+   m meta       META       edn   "metadata to set on each collection entry"]
   (let [options (merge +paginate-defaults+ *opts*)
         grouper (fn [entries]
                   (->> entries


Fix removing files from metadata when they are removed

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -124,7 +124,7 @@
                           (boot/fileset-removed @prev-fs)
                           boot/user-files
                           (boot/by-ext ["md" "markdown"])
-                          (map #(:path (boot/tmp-file %)))
+                          (map #(boot/tmp-path %))
                           set)
             updated-files (pod/with-call-in @pod
                              (io.perun.markdown/parse-markdown ~md-files ~options))


Update Problem0004.SpeedTest.clj

Update Problem0004.SpeedTest.clj

--- pe/nonvisualstudio/clojure/SpeedTests/Problem0004.SpeedTest.clj
+++ pe/nonvisualstudio/clojure/SpeedTests/Problem0004.SpeedTest.clj
@@ -10,5 +10,5 @@
 ;(time (maxPalendromProduceSync 100 999)) 235 - 248msec
 ;(time (maxPalendromProduceParallel 100 999)) 86 - 95msec

+;(time (maxPalendromProduceSync 1000 9999)) 26220 -26224
 ;(time (maxPalendromProduceParallel 1000 9999)) 6889 - 6928 msec
-;(time (maxPalendromProduceSync 1000 9999)) 26220 -26224


missed a test

missed a test

--- elephantdb-cascalog/test/elephantdb/cascalog/keyval_test.clj
+++ elephantdb-cascalog/test/elephantdb/cascalog/keyval_test.clj
@@ -165,9 +165,4 @@
       "One more iteration should work just fine."
       (reshard! tmp-a tmp-b 5)
       [fs tmp-b] => (spec-has {:num-shards 5})
-      (deserialize-str (keyval-tap tmp-b)) => (produces pairs)
-
-      "Resharding into the same path should work."
-      (reshard! tmp-b tmp-b 6)
-      [fs tmp-b] => (spec-has {:num-shards 6})
       (deserialize-str (keyval-tap tmp-b)) => (produces pairs))))


DM | Removed references to user-store atom from email confirmations controller tests

--- test/stonecutter/test/controller/email_confirmations.clj
+++ test/stonecutter/test/controller/email_confirmations.clj
@@ -4,6 +4,7 @@
             [clauth.token :as cl-token]
             [clauth.user :as cl-user]
             [net.cgrand.enlive-html :as html]
+            [stonecutter.test.test-helpers :as th]
             [stonecutter.email :as email]
             [stonecutter.routes :as routes]
             [stonecutter.controller.email-confirmations :as ec]
@@ -11,6 +12,7 @@
             [stonecutter.db.user :as user]
             [stonecutter.db.storage :as storage]
             [stonecutter.db.confirmation :as conf]
+            [stonecutter.db.mongo :as m]
             [stonecutter.view.profile :as profile]))

 (defn check-redirects-to [path]
@@ -33,11 +35,6 @@
                         session-not-changed)
                    (is-signed-in? response))))))

-(defn create-request [method url params]
-  (-> (mock/request method url)
-      (assoc :params params)
-      (assoc-in [:context :translator] {})))
-
 (def most-recent-email (atom nil))
 (def email "dummy@email.com")
 (def confirmation-id "RANDOM-ID-12345")
@@ -57,10 +54,9 @@
                :confirmation-id confirmation-id))

 (def confirm-email-request
-  (create-request :get confirm-email-path {:confirmation-id confirmation-id}))
+  (th/create-request :get confirm-email-path {:confirmation-id confirmation-id}))

 (background (before :facts (do (storage/setup-in-memory-stores!)
-                               (cl-user/reset-user-store! @storage/user-store)
                                (email/initialise! test-email-sender!
                                                   {:confirmation test-email-renderer}))
                     :after (do (storage/reset-in-memory-stores!)
@@ -69,62 +65,66 @@

 (facts "about confirm-email-with-id"
        (fact "if the confirmation UUID in the query string matches that of the signed in user's user record confirm the account and redirect to profile view"
-             (let [user (user/store-user! @storage/user-store email "password")
+             (let [user-store (m/create-memory-store)
+                   user (user/store-user! user-store email "password")
                    confirmation (conf/store! @storage/confirmation-store email confirmation-id)
                    request (-> confirm-email-request
                                (with-signed-in-user user))]
-               (ec/confirm-email-with-id @storage/user-store request) => (check-redirects-to (routes/path :show-profile))
-               (user/retrieve-user @storage/user-store (:login user)) =not=> (contains {:confirmation-id anything})
-               (user/retrieve-user @storage/user-store (:login user)) => (contains {:confirmed? true})))
+               (ec/confirm-email-with-id user-store request) => (check-redirects-to (routes/path :show-profile))
+               (user/retrieve-user user-store (:login user)) =not=> (contains {:confirmation-id anything})
+               (user/retrieve-user user-store (:login user)) => (contains {:confirmed? true})))

        (fact "when confirmation UUID in the query string does not match that of the signed in user's user record, signs the user out and redirects to confirmation endpoint with the original confirmation UUID from the query string"
-             (let [signed-in-user (user/store-user! @storage/user-store "signed-in@email.com" "password")
-                   confirming-user (user/store-user! @storage/user-store "confirming@email.com" "password")
+             (let [user-store (m/create-memory-store)
+                   signed-in-user (user/store-user! user-store "signed-in@email.com" "password")
+                   confirming-user (user/store-user! user-store "confirming@email.com" "password")
                    confirmation (conf/store! @storage/confirmation-store "confirming@email.com" confirmation-id)
                    request (-> confirm-email-request
                                (with-signed-in-user signed-in-user))
-                   response (ec/confirm-email-with-id @storage/user-store request)]
+                   response (ec/confirm-email-with-id user-store request)]
                response =not=> (check-signed-in request signed-in-user)
                response => (check-redirects-to confirm-email-path)))

        (fact "when user is not signed in, redirects to sign-in form with the confirmation endpoint (including confirmation UUID query string) as the successful sign-in redirect target"
-             (let [confirming-user (user/store-user! @storage/user-store email "password")
+             (let [user-store (m/create-memory-store)
+                   confirming-user (user/store-user! user-store email "password")
                    confirmation (conf/store! @storage/confirmation-store email confirmation-id)
-                   response (ec/confirm-email-with-id @storage/user-store confirm-email-request)]
+                   response (ec/confirm-email-with-id user-store confirm-email-request)]
                response => (check-redirects-to (routes/path :confirmation-sign-in-form
                                                             :confirmation-id confirmation-id))))

        (fact "when email confirmation is complete confirmation-id is revoked"
-             (let [user (user/store-user! @storage/user-store email "password")
+             (let [user-store (m/create-memory-store)
+                   user (user/store-user! user-store email "password")
                    confirmation (conf/store! @storage/confirmation-store email confirmation-id)
                    request (-> confirm-email-request
                                (with-signed-in-user user))]
-               (ec/confirm-email-with-id @storage/user-store request)
+               (ec/confirm-email-with-id user-store request)
                (conf/fetch @storage/confirmation-store confirmation-id) => nil)))

 (facts "about confirmation sign in"
        (fact "when password matches login of confirmation id, user is logged in")
-       (->> (create-request :post (routes/path :confirmation-sign-in) {:confirmation-id confirmation-id :password password})
-            (ec/confirmation-sign-in @storage/user-store)) => (contains {:status  302
+       (->> (th/create-request :post (routes/path :confirmation-sign-in) {:confirmation-id confirmation-id :password password})
+            (ec/confirmation-sign-in ...user-store...)) => (contains {:status  302
                                                                          :headers {"Location" confirm-email-path}
                                                                          :session {:user-login   ...user-login...
                                                                                :access_token ...token...}})
        (provided
-         (user/authenticate-and-retrieve-user @storage/user-store email password) => {:login ...user-login...}
-         (conf/fetch @storage/confirmation-store confirmation-id) => {:login email :confirmation-id confirmation-id}
-         (cl-token/create-token @storage/token-store nil {:login ...user-login...}) => {:token ...token...})
+        (user/authenticate-and-retrieve-user ...user-store... email password) => {:login ...user-login...}
+        (conf/fetch @storage/confirmation-store confirmation-id) => {:login email :confirmation-id confirmation-id}
+        (cl-token/create-token @storage/token-store nil {:login ...user-login...}) => {:token ...token...})

        (fact "when credentials are invalid, redirect back to form with invalid error"
              (against-background
-               (user/authenticate-and-retrieve-user @storage/user-store email "Invalid password") => nil
-               (conf/fetch @storage/confirmation-store confirmation-id) => {:login email :confirmation-id confirmation-id})
-             (let [response (->> (create-request :post (routes/path :confirmation-sign-in)
-                                                 {:confirmation-id confirmation-id :password "Invalid password"})
-                                 (ec/confirmation-sign-in @storage/user-store))]
+              (user/authenticate-and-retrieve-user ...user-store... email "Invalid password") => nil
+              (conf/fetch @storage/confirmation-store confirmation-id) => {:login email :confirmation-id confirmation-id})
+             (let [response (->> (th/create-request :post (routes/path :confirmation-sign-in)
+                                                    {:confirmation-id confirmation-id :password "Invalid password"})
+                                 (ec/confirmation-sign-in ...user-store...))]
                response => (contains {:status 200})
                response =not=> (contains {:session {:user-login   anything
                                                     :access_token anything}})
                (-> (html/select (html/html-snippet (:body response)) [:.clj--validation-summary__item]) first :attrs :data-l8n)
                => "content:confirmation-sign-in-form/invalid-credentials-validation-message")))
-

+


finish api transaction update test

finish api transaction update test

--- test/clj_money/api/transactions_test.clj
+++ test/clj_money/api/transactions_test.clj
@@ -93,9 +93,9 @@
   {:resource-name "transaction"
    :find-updated-resource-fn #(transactions/find-by-id storage-spec (:id %) (:transaction-date %))
    :update-fn api/update
-   :comparison-fn #(= (:name %) "Bag o' Money")
-   :update-params {:name "Bag o' Money"
-                   :type "asset"}})
+   :comparison-fn #(= (:memo %) "updated memo")
+   :update-params {:transaction-date (t/local-date 2016 2 1)
+                   :memo "updated memo"}})

 (deftest-delete delete-a-transaction
   {:resource-name "transaction"


squash! Minor testing cleanup

squash! Minor testing cleanup

--- test/doctopus/doctopus/tentacle_test.clj
+++ test/doctopus/doctopus/tentacle_test.clj
@@ -7,19 +7,21 @@
             [doctopus.doctopus.head :as h]
             [doctopus.doctopus.tentacle :refer :all]
             [doctopus.test-database :refer [schema-only-fixture]]
-            [doctopus.test-utilities :as utils]
+            [doctopus.test-utilities :as utils :refer [truthy?]]
             [me.raynes.fs :as fs]))

 (use-fixtures :once schema-only-fixture)
+
+(deftest test-image-regex
+  (testing "Our regex should match image types and nothing else!"
+    (is (truthy? (re-find image-re "image/png")) "We should match image/png")
+    (is (nil? (re-find image-re "text/html")) "We should not match text/html")))

 (def test-map-props
   (h/parse-tentacle-config-map
    (edn/read-string (slurp (io/resource "test/heads/test/doctopus-test.edn")))))

 (def one-tentacle (map->Tentacle test-map-props))
-
-(defn truthy? [v]
-  (or (true? v) (and (not (nil? v)) (false? v))))

 (deftest tentacle-test
   (db/save-tentacle! one-tentacle)


Removing expectations from more tests

Removing expectations from more tests

--- test/time_tracker/timers/pubsub_test.clj
+++ test/time_tracker/timers/pubsub_test.clj
@@ -159,8 +159,6 @@
                  (:project-id create-response)))
           (is (= "create" (:type create-response)))
           (is (nil? (:started-time create-response)))
-          (is (= current-time
-                 (:started-time start-response)))
           (is (= "astro zombies"
                  (:notes create-response)
                  (:notes start-response)))
@@ -182,8 +180,6 @@
             (is (nil? (:started-time create-response)))
             (is (= created-time
                    (:time-created create-response)))
-            (is (= current-time
-                   (:started-time start-response)))
             (is (= "against the power that exists"
                    (:notes start-response)
                    (:notes create-response)))
@@ -274,7 +270,6 @@
       (let [result1 (test-helpers/try-take!! response1)
             result2 (test-helpers/try-take!! response2)]
         (is (= timer-id (:id result1)))
-        (is (= current-time (:started-time result2)))

         (testing "All clients with the same gid receive the broadcast"
           (is (= result1 result2))))


(SERVER-1142) Remove anonymous function in master-core-test ring-handler

--- test/unit/puppetlabs/services/master/master_core_test.clj
+++ test/unit/puppetlabs/services/master/master_core_test.clj
@@ -19,7 +19,7 @@

 (defn build-ring-handler
   [request-handler puppet-version jruby-service]
-  (-> (root-routes request-handler #(ring/wrap-params %) jruby-service (constantly nil))
+  (-> (root-routes request-handler ring/wrap-params jruby-service (constantly nil))
       (comidi/routes->handler)
       (wrap-middleware puppet-version)))


CMR-1863 Removes need for format-to-format-adjustment.

--- umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
+++ umm-spec-lib/src/cmr/umm_spec/test/expected_conversion.clj
@@ -2,7 +2,8 @@
   "This contains functions for manipulating the expected UMM record when taking a UMM record
   writing it to an XML format and parsing it back. Conversion from a UMM record into metadata
   can be lossy if some fields are not supported by that format"
-  (:require [cmr.umm-spec.models.common :as cmn]))
+  (:require [cmr.umm-spec.models.common :as cmn]
+            [cmr.umm-spec.umm-to-xml-mappings.dif10 :as dif10]))

 (defmulti ^:private convert-internal
   "Returns UMM collection that would be expected when converting the source UMM-C record into the
@@ -101,7 +102,19 @@
   [umm-coll _]
   (-> umm-coll
       (update-in [:TemporalExtents] dif-temporal)
+      ;; DIF 9 does not support Platform Type.
       (update-in-each [:Platforms] assoc :Type nil)))
+
+;; DIF 10
+
+(defn fix-dif10-platform
+  [platform]
+  ;; Only a limited subset of platform types are supported by DIF 10.
+  (assoc platform :Type (get dif10/platform-types (:Type platform))))
+
+(defmethod convert-internal :dif10
+  [umm-coll _]
+  (update-in-each umm-coll [:Platforms] fix-dif10-platform))

 ;; ISO 19115-2

@@ -150,19 +163,6 @@
           record
           not-implemented-fields))

-(defmulti format-to-format-adjustment
-  "Performs additional transformations after converting to dest format, based on src format."
-  (fn [umm-coll src dest]
-    [src dest]))
-
-(defmethod format-to-format-adjustment :default
-  [umm-coll _ _]
-  umm-coll)
-
-(defmethod format-to-format-adjustment [:iso-smap :dif10]
-  [umm-coll _ _]
-  (update-in-each umm-coll [:Platforms] assoc :Type nil))
-
 ;;; Public API

 (defn convert
@@ -176,5 +176,4 @@
   ([umm-coll src dest]
    (-> umm-coll
        (convert src)
-       (convert dest)
-       (format-to-format-adjustment src dest))))
+       (convert dest))))


Copy into a file instead of into a stream when repairing

--- src/mdr2/repair.clj
+++ src/mdr2/repair.clj
@@ -114,9 +114,8 @@
              (prod/create-dirs production)
              ;; copy tar to tmpdir
              (nio/create-directory! tmp-dir)
-             (with-open [input (:body response)
-                         output (io/output-stream tar-file)]
-               (nio/copy! input output))
+             (with-open [input (:body response)]
+               (nio/copy! input tar-file))
              ;; extract the tar
              (compress/untar tar-file tar-dir)
              ;; extract the relevant parts to the structured-path


A more clean interface and main organization

--- src/mosaic/core.clj
+++ src/mosaic/core.clj
@@ -3,21 +3,36 @@
   (:require [mosaic.tile :as tile])
   (:gen-class))

+(defn help [banner]
+  (println "\nExample: lein run target.jpg tiles/*.jpg\n")
+  (println banner)
+  (System/exit 0))
+
 (defn -main [& args]
-  (let [[params source-files help]
+  (let [[options files banner]
 	(cli args
-	     ["-t" "--target" "Target image" :parse-fn tile/load-image]
-	     ["-i" "--tile-size" "Tile size in pixels" :parse-fn #(Integer. %)]
-	     ["-s" "--step-size" "Step size in pixels" :parse-fn #(Integer. %)]
-	     ["-a" "--samples" "Number of sample regions" :parse-fn #(Integer. %)]
-	     ["-o" "--output" "Filename of output" :default "output.jpg"]
-	     ["-w" "--width" "Output width in tiles" :parse-fn #(Integer. %)])
-	sources (map tile/load-image source-files)]
-    (tile/save-image
-     (tile/mosaic sources
-		  (:target params)
-		  (:tile-size params)
-		  (:step-size params)
-		  (:width params)
-		  (:samples params))
-     (:output params))))
+	     ["-i" "--tile-size" "Tile size in pixels"
+	      :parse-fn #(Integer. %) :default "50"]
+	     ["-s" "--step-size" "Step size in pixels"
+	      :parse-fn #(Integer. %) :default "50"]
+	     ["-a" "--samples" "Number of sample regions (width)"
+	      :parse-fn #(Integer. %) :default "6"]
+	     ["-o" "--output" "Filename of output"
+	      :default "output.jpg"]
+	     ["-w" "--width" "Output width in tiles"
+	      :parse-fn #(Integer. %) :default "30"]
+	     ["-h" "--help" "Show help"
+	      :default false :flag true])]
+    (when (:help options) (help banner))
+    (if (< (count files) 2)
+      (help banner)
+      (let [target (tile/load-image (first files))
+	    tiles (map tile/load-image (rest files))]
+	(tile/save-image
+	 (tile/mosaic tiles
+		      target
+		      (:tile-size options)
+		      (:step-size options)
+		      (:width options)
+		      (:samples options))
+	 (:output options))))))


Remove newline

Remove newline

--- resources/platformer/utils.clj
+++ resources/platformer/utils.clj
@@ -51,8 +51,7 @@
   (cond
     (> (:x-velocity entity) 0) :right
     (< (:x-velocity entity) 0) :left
-    :else
-    (:direction entity)))
+    :else (:direction entity)))

 (defn get-touching-tile
   [screen entity & layer-names]


make native method private

make native method private

--- src/neuseg/fann.clj
+++ src/neuseg/fann.clj
@@ -6,31 +6,31 @@

 (System/setProperty "jna.library.path" "/usr/local/lib")

-(def *create-standard*
+(def ^:private create-standard
   (jna/to-fn Pointer fann/fann_create_standard))

-(def *set-activiation-hidden*
+(def ^:private set-activiation-hidden
   (jna/to-fn Integer fann/fann_set_activation_function_hidden))

-(def *set-activiation-output*
+(def ^:private set-activiation-output
   (jna/to-fn Integer fann/fann_set_activation_function_output))

-(def *train-on-data*
+(def ^:private train-on-data
   (jna/to-fn Integer fann/fann_train_on_data))

-(def *test-data*
-  (jna/to-fn Flaot fann/fann_test_data))
+(def ^:private test-data
+  (jna/to-fn Float fann/fann_test_data))

-(def *save*
+(def ^:private save
   (jna/to-fn Integer fann/fann_save))

-(def *destroy*
+(def ^:private destroy
   (jna/to-fn Integer fann/fann_destroy))

-(def *read-train-from-file*
+(def ^:private read-train-from-file
   (jna/to-fn Pointer fann/fann_read_train_from_file))

-(def *destroy-train*
+(def ^:private destroy-train
   (jna/to-fn Integer fann/fann_destroy_train))

 ;; constants
@@ -59,21 +59,21 @@

 (defn create [layers & opts]
   (let [params (cons (count layers) layers)
-        fann   (apply *create-standard* params)]
+        fann   (apply create-standard params)]
     (if-let [hidden (:hidden opt)]
-      (*set-activiation-hidden* fann (get activiation-function-map hidden)))
+      (set-activiation-hidden fann (get activiation-function-map hidden)))
     (if-let [output (:output opt)]
-      (*set-activiation-output* fann (get activiation-function-map output)))
+      (set-activiation-output fann (get activiation-function-map output)))
     fann))

 (defn load-train-data [train-file-name]
-    (*read-train-from-file* train-file-name))
+    (read-train-from-file train-file-name))

 (defn train [fann train-data max-epochs epochs-between-reports desired-error]
-  (*train-on-data* fann train-data max-epochs epochs-between-reports desired-error))
+  (train-on-data fann train-data max-epochs epochs-between-reports desired-error))

 (defn test [fann train-data]
-  (*test-data* fann train-data))
+  (test-data fann train-data))


fixed layout of paginator; was screwy and then broke when I changed the combo box height

--- src/cljs/org/broadinstitute/firecloud_ui/common/table_utils.cljs
+++ src/cljs/org/broadinstitute/firecloud_ui/common/table_utils.cljs
@@ -44,21 +44,19 @@
            allow-next (< current-page num-pages)
            right-num (min num-rows-visible (* current-page rows-per-page))
            left-num (if (zero? right-num) 0 (inc (* (dec current-page) rows-per-page)))]
-       [:div {:style {:border "1px solid #ebebeb"}}
+       [:div {:style {:border "1px solid #ebebeb" :padding "1em"}}
         (let [layout-style (if (= :narrow (:width props))
                              {:textAlign "center" :padding "1ex"}
-                             {:float "left" :width "33.33%"})
+                             {:display "inline-block" :width "33.33%"})
               view-component
-              [:div {:style (merge {:padding "2.15em 0em" :verticalAlign "middle"}
-                              layout-style)}
+              [:div {:style layout-style}
                [:b {} (str left-num " - " right-num)]
                (str " of " (pluralize num-rows-visible " result")
                  (when-not (= num-rows-visible (:num-total-rows props))
                    (str " (filtered from " (:num-total-rows props) " total)")))]
               page-component
               (style/create-unselectable
-                :div {:style (merge {:padding "1.6em 0em" :verticalAlign "middle" :textAlign "center"}
-                               layout-style)}
+                :div {:style (merge {:textAlign "center"} layout-style)}
                 [:div {:style {:display "inline-block" :padding "0.55em 0.9em"
                                :color (if allow-prev
                                         (:button-blue style/colors)
@@ -87,8 +85,7 @@
                  [:span {:style {:paddingRight "1em"}} "Next"]
                  (icons/font-icon {:style {:fontSize "70%"}} :angle-right)])
               rows-component
-              [:div {:style (merge {:padding "2.15em 0em" :textAlign "right"}
-                              layout-style)}
+              [:div {:style (merge {:textAlign "right"} layout-style)}
                "Display"
                (style/create-select
                  {:style {:width 60 :margin "0em 1em"}
@@ -97,7 +94,7 @@
                               :current-page 1)}
                  rows-per-page-options)
                "rows per page"]]
-          [:div {:style {:fontSize 13 :lineHeight 1.5 :padding "0px 48px" :verticalAlign "middle"}}
+          [:div {:style {:fontSize 13 :lineHeight 1.5 :padding "0px 48px"}}
            view-component page-component rows-component
            (common/clear-both)])]))
    :component-did-update


Throw better exception.

Throw better exception.

--- src/onyx/system.clj
+++ src/onyx/system.clj
@@ -10,19 +10,38 @@

 (def peer-components [:logging-config :sync :queue :peer])

+(defn rethrow-component [f]
+  (try
+    (f)
+    (catch Exception e
+      (throw (.getCause e)))))
+
 (defrecord OnyxCoordinator [logging-config sync queue]
   component/Lifecycle
   (start [this]
-    (component/start-system this coordinator-components))
+    (rethrow-component
+     #(component/start-system this coordinator-components)))
   (stop [this]
-    (component/stop-system this coordinator-components)))
+    (rethrow-component
+     #(component/stop-system this coordinator-components))))
+
+(defrecord OnyxCoordinatorConnection [logging-config sync]
+  component/Lifecycle
+  (start [this]
+    (rethrow-component
+     #(component/start-system this connection-components)))
+  (stop [this]
+    (rethrow-component
+     #(component/stop-system this connection-components))))

 (defrecord OnyxPeer [logging-config sync queue]
   component/Lifecycle
   (start [this]
-    (component/start-system this peer-components))
+    (rethrow-component
+     #(component/start-system this peer-components)))
   (stop [this]
-    (component/stop-system this peer-components)))
+    (rethrow-component
+     #(component/stop-system this peer-components))))

 (defn onyx-coordinator
   [opts]


Docstring style

Docstring style

--- src/oxcart/core.clj
+++ src/oxcart/core.clj
@@ -54,12 +54,15 @@

 (defn gensym
-  "(gensym) → Symbol
-   (gensym prefix ← String) → Symbol
+  "(λ) → Symbol
+   (λ → Prefix) → Symbol

   Wrapper around clojure.core/gensym which adds metadata annotating
   generated symbols and permitting distinction between generated and
-  user specified symbols."
+  user specified symbols.
+
+  If Prefix is provided, it must be a string. Otherwise a prefix of
+  \"OG__\" is used by default."
   ([]
      (gensym "OG__"))

@@ -70,8 +73,8 @@

 (defn eval
-  "λ form → value
-   λ form → config-map → value
+  "(λ form) → value
+   (λ form → config-map) → value

   Form is any Clojure sexpr, config map is a load configuration and
   value is an arbitrary Clojure value or class.
@@ -137,8 +140,8 @@

 (defn load
-  "λ String → nil
-   λ String → config-map → nil
+  "(λ String) → nil
+   (λ String → config-map) → nil

   Loads a resource on the classpath identified by a string path as
   clojure code via eval for side-effects against the invoking Clojure
@@ -182,8 +185,8 @@

 (defn compile
-  "λ String → nil
-   λ String → config-map → nil
+  "(λ String) → nil
+   (λ String → config-map) → nil

   Loads a resource via load, applies any compilation transformations
   specified in the config-map, emitting and loading the resulting


Add update/adapt-code unit test

Add update/adapt-code unit test

--- backend/test/akvo/lumen/transformation/derive_test.clj
+++ backend/test/akvo/lumen/transformation/derive_test.clj
@@ -1,5 +1,6 @@
 (ns akvo.lumen.transformation.derive-test
   (:require [akvo.lumen.transformation.derive :as derive]
+            [akvo.lumen.update :as update]
             [clojure.test :refer :all]))

 (deftest parse-row-object-references
@@ -45,7 +46,6 @@
   (is (= '(["row['e`']" "e`"])
          (derive/parse-row-object-references "row['e`']"))))

-
 (deftest computed
   (let [t1 {"op" "core/derive"
             "args" {"newColumnTitle" "C"
@@ -73,3 +73,45 @@
                        (get computed "references"))
                first
                (get "column-name"))))))
+
+(deftest adapt-code-test
+  (let [code_v1 "row.a_1+row.b_1"
+        code_v2 "row['a_2']+row['b_2']"
+        t1 {"op" "core/derive"
+            "args" {"newColumnTitle" "C"
+                    "newColumnType" "text"
+                    "code" code_v1}
+            "onError" "leave-empty"}
+
+        older-columns [{"sort" nil
+                        "type" "text"
+                        "title" "a_1"
+                        "hidden" false
+                        "direction" nil
+                        "columnName" "c1"}
+                       {"sort" nil
+                        "type" "text"
+                        "title" "b_1"
+                        "hidden" false
+                        "direction" nil
+                        "columnName" "c2"}]
+
+        new-columns [{"sort" nil
+                      "type" "text"
+                      "title" "a_2"
+                      "hidden" false
+                      "direction" nil
+                      "columnName" "c1"}
+                     {"sort" nil
+                      "type" "text"
+                      "title" "b_2"
+                      "hidden" false
+                      "direction" nil
+                      "columnName" "c2"}]
+        computed (derive/compute-transformation-code (get-in t1 ["args" "code"]) older-columns)]
+    (is (= code_v2 (derive/columnName>columnTitle computed new-columns)))
+    (is (= (update-in t1 ["args" "code"] (constantly code_v2))
+           (update/adapt-transformation t1 older-columns new-columns)))
+    ))
+
+


fixed setting custom resource path

fixed setting custom resource path

--- src/selmer/util.clj
+++ src/selmer/util.clj
@@ -109,12 +109,13 @@
   (.contains file-path "jar!/"))

 (defn resource-path [template]
-  (or @custom-resource-path
-      (-> (Thread/currentThread)
-        (.getContextClassLoader)
-        (.getResource template))))
+  (if-let [path @custom-resource-path]
+    (java.net.URL. (str "file:///" path template))
+    (-> (Thread/currentThread)
+      (.getContextClassLoader)
+      (.getResource template))))

 (defn check-template-exists [^String file-path]
   (when-not (or (in-jar? file-path)
                 (.exists (java.io.File. file-path)))
-    (throw (Exception. (str "temaplate: \"" file-path "\" not found")))))+    (throw (Exception. (str "template: \"" file-path "\" not found")))))


Remove fn nml-uniq (was only used by nml-tree)

--- src/nml/core.clj
+++ src/nml/core.clj
@@ -4,7 +4,7 @@
   (:require [clojure.tools.cli :as cli   ])
   (:gen-class))

-(declare nml-get nml-name nml-parse nml-set nml-str nml-uniq strmap)
+(declare nml-get nml-name nml-parse nml-set nml-str strmap)

 ;; formatting

@@ -166,14 +166,6 @@
                      :wsopt                 ""
                      val))))

-(defn- nml-uniq [values]
-  (loop [head (first values) tail (rest values) tree []]
-    (if (nil? head)
-      tree
-      (let [name #(nml-name (second %))
-            copy  (some #(= (name head) (name %)) tail)]
-        (recur (first tail) (rest tail) (into tree (if copy [] [head])))))))
-
 ;; nml public defns

 (defn nml-get [m nml key]


Use remove rather than filter/complemnt.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -52,7 +52,7 @@
 (defn validate-workflow-names [{:keys [workflow catalog]}]
   (when-let [missing-names (->> workflow
                                 flatten-workflow
-                                (filter (complement (set (map :onyx/name catalog))))
+                                (remove (set (map :onyx/name catalog)))
                                 seq)]
     (throw (Exception. (str "Catalog is missing :onyx/name values "
                             "for the following workflow keywords: "


some more tests

some more tests

--- src/signet/core.clj
+++ src/signet/core.clj
@@ -1,6 +1,7 @@
 (ns signet.core
   (:require [taoensso.timbre :as timbre]
             [konserve.store :refer [new-mem-store]]
+            [konserve.protocols :refer [-get-in -assoc-in]]
             [geschichte.repo :as r]
             [geschichte.sync :refer [server-peer client-peer]]
             [geschichte.stage :as s]
@@ -14,7 +15,29 @@

 (comment

-  (def repo (r/new-repository "kordano@topiq.es" "Bookmark collector"))
+  (def store (<!? (new-mem-store)))
+
+  (def peer (client-peer "CLIENT" store identity))
+
+  (def stage (<!! (s/create-stage! "kordano@topiq.es" peer eval)))
+
+  (def r-id (<!? (s/create-repo! stage "Bookmark collection")))
+
+  (aprint r-id)
+
+  (<!? (s/transact stage ["kordano@topiq.es" r-id "master"]
+                   '(fn [old params] (merge old params))
+                   {:bookmark "q.es"}))

+  (<!? (s/commit! stage {"kordano@topiq.es" {r-id #{"master"}}}))
+
+
+  (<!? (-get-in store ["kordano@topiq.es"]))
+
+
+  (aprint (get-in @stage ["kordano@topiq.es" r-id]))
+
+  (aprint peer)
+
   )


Marks test-incoming-router-metrics-handler-valid-handshake as :explicit (#50)

--- waiter/test/waiter/metrics_sync_test.clj
+++ waiter/test/waiter/metrics_sync_test.clj
@@ -263,7 +263,10 @@
       (is (= (encrypt {:message "Missing source router!", :data {}}) (async/<!! (:out ws-request))))
       (is (nil? (async/<!! (:out ws-request)))))))

-(deftest test-incoming-router-metrics-handler-valid-handshake
+; Marked explicit due to:
+; - https://github.com/twosigma/waiter/issues/45
+; - https://travis-ci.org/twosigma/waiter/jobs/250454964#L8663-L8698
+(deftest ^:explicit test-incoming-router-metrics-handler-valid-handshake
   (testing "incoming-router-metrics-handler:valid-handshake"
     (let [decrypt-call-counter (atom 0)
           encrypt (fn [data] {:data data})


Added tests for validating spatial polygon and bounding box queries.

--- test/cmr/system_int_test/search/granule_spatial_search_test.clj
+++ test/cmr/system_int_test/search/granule_spatial_search_test.clj
@@ -12,6 +12,7 @@
             [cmr.spatial.ring :as r]
             [cmr.spatial.derived :as derived]
             [cmr.spatial.codec :as codec]
+            [cmr.spatial.messages :as smsg]
             [clojure.string :as str]
             [cmr.spatial.dev.viz-helper :as viz-helper]
             [cmr.spatial.serialize :as srl]
@@ -59,6 +60,26 @@
     (viz-helper/add-geometries [geometry
                                 (srl/shape->mbr geometry)
                                 (srl/shape->lr geometry)])))
+
+
+;; Tests that invalid spatial areas are detected and error messages are returned.
+(deftest spatial-search-validation-test
+  (testing "invalid encoding"
+    (is (= {:errors [(smsg/shape-decode-msg :polygon "0,ad,d,0")] :status 422}
+           (search/find-refs :granule {:polygon "0,ad,d,0"})))
+    (is (= {:errors [(smsg/shape-decode-msg :bounding-box "0,ad,d,0")] :status 422}
+           (search/find-refs :granule {:bounding-box "0,ad,d,0"}))))
+
+  (testing "invalid polygons"
+    (is (= {:errors [(smsg/ring-not-closed)] :status 422}
+           (search/find-refs :granule
+                             {:polygon (codec/url-encode
+                                         (p/polygon [(r/ords->ring 0 0, 1 0, 1 1, 0 1)]))}))))
+  (testing "invalid bounding box"
+    (is (= {:errors [(smsg/br-north-less-than-south 45 46)] :status 422}
+           (search/find-refs
+             :granule
+             {:bounding-box (codec/url-encode (m/mbr -180 45 180 46))})))))

 (deftest spatial-search-test


use an atom to simplify the accumulator.

--- clojure/point-mutations/dna.clj
+++ clojure/point-mutations/dna.clj
@@ -2,11 +2,10 @@

 (defn hamming-distance
   [s1 s2]
-  (loop [[fst-s1 & rst-s1] s1
-         [fst-s2 & rst-s2] s2
-         distance-acc 0]
-    (let [distance (if (= fst-s1 fst-s2) 0 1)
-          distance-acc (+ distance-acc distance)]
-      (if (some empty? [rst-s1 rst-s2])
-        distance-acc
-        (recur rst-s1 rst-s2 distance-acc)))))
+  (loop [[hd1 & tl1] s1
+         [hd2 & tl2] s2
+         acc-dist (atom 0)]
+    (if-not (= hd1 hd2) (swap! acc-dist inc))
+    (if (some empty? [tl1 tl2])
+      @acc-dist
+      (recur tl1 tl2 acc-dist))))


start thinking about showing a portion of the world...

--- clojure/src/dnd/showScreen.cljs
+++ clojure/src/dnd/showScreen.cljs
@@ -3,6 +3,9 @@
             [dnd.level :refer [width height]]
             [dnd.color :refer [COLOR color-to-vec]]
             ))
+
+(def window-width width)
+(def window-height height)

 (defonce terminal (nodejs/require "terminal-kit"))

@@ -10,29 +13,29 @@

 (defn end-points [character]
   (let [{:keys [x y]} character
-        _width  (inc width)
-        _height (inc height)
+        _width  (inc window-width)
+        _height (inc window-height)
         zw (range 0 _width)
         zh (range 0 _height)
         ziy (range 0 y)
         zix (range 0 x)
-        ++yh (range (inc y) height)
-        ++xw (range (inc x) width)
+        ++yh (range (inc y) window-height)
+        ++xw (range (inc x) window-width)
         opposite-wall (vec (case (:direction character)
            "n" (map #(vec [% 0])      zw)
-           "s" (map #(vec [% height]) zw)
+           "s" (map #(vec [% window-height]) zw)
            "w" (map #(vec [0 %])      zh)
-           "e" (map #(vec [width %])  zh)))
+           "e" (map #(vec [window-width %])  zh)))
         adjenct-wall (vec (case (:direction character)
            "n" (map #(vec [0 %])      ziy)
            "s" (map #(vec [0 %])      ++yh)
            "w" (map #(vec [% 0])      zix)
            "e" (map #(vec [% 0])      ++xw)))
         adjenct-wall2 (vec (case (:direction character)
-           "n" (map #(vec [width %])  ziy)
-           "s" (map #(vec [width %])  ++yh)
-           "w" (map #(vec [% height]) zix)
-           "e" (map #(vec [% height]) ++xw)))]
+           "n" (map #(vec [window-width %])  ziy)
+           "s" (map #(vec [window-width %])  ++yh)
+           "w" (map #(vec [% window-height]) zix)
+           "e" (map #(vec [% window-height]) ++xw)))]
     (concat opposite-wall adjenct-wall adjenct-wall2)
     ))

@@ -48,8 +51,8 @@

 (defn shorten-line [level line]
   (def shortened-line (take-while #(let [[x y] %
-                     x (min (dec width)  (max 0 x))
-                     y (min (dec height) (max 0 y))
+                     x (min (dec window-width)  (max 0 x))
+                     y (min (dec window-height) (max 0 y))
                      current-block (get-in level [x y])]
                                      (not (current-block :solid))
                                      ) line))
@@ -119,8 +122,8 @@
   (let [
         buffer ((.. terminal -ScreenBufferHD -create)
                 #js {:dst    term
-                     :width  width
-                     :height height
+                     :width  window-width
+                     :height window-height
                      })
         get-in-level (partial get-in level)]

@@ -141,11 +144,11 @@
   (doto term
     (.color256    7)
     (.bgColor256  0)
-    (.moveTo (+ 2 width) 1 (str "HP: " (:hp character)))
-    (.moveTo (+ 2 width) 2 (str "INV: " (count (:inventory character))))
-    (.moveTo (+ 2 width) 3 (str "trueColor: " (.. term -support -trueColor)))
+    (.moveTo (+ 2 window-width) 1 (str "HP: " (:hp character)))
+    (.moveTo (+ 2 window-width) 2 (str "INV: " (count (:inventory character))))
+    (.moveTo (+ 2 window-width) 3 (str "trueColor: " (.. term -support -trueColor)))
     ;(.moveTo 0 (inc height) "got some text down below\n\n")
-    (.moveTo 0 (+ 10 height))))
+    (.moveTo 0 (+ 10 window-height))))

 ;(.moveTo term 0 0
 ;(.drawImage term "" #js {:shrink #js {:width 100 :height 150}}))
@@ -153,7 +156,7 @@

 (defn inventory-selected [term character error response]
   (assoc character :can-move true)
-  (.moveTo term 0 (inc height)
+  (.moveTo term 0 (inc window-height)
            (if error
              "oh crap!"
              (str "you stare at " (.-selectedText response)))


add notes about transaction processing

add notes about transaction processing

--- src/clj/clj_money/models/transactions.clj
+++ src/clj/clj_money/models/transactions.clj
@@ -790,6 +790,21 @@
        (update-transaction storage))
   (assoc context :transaction (reload storage transaction)))

+; Processing a transaction
+; 1. Save the transaction and item records
+; 2. Identify starting items for account rebalancing
+;   a. Find the item immediately before (chronologically) this transaction in
+;      each account with a item in this transaction. If this is an update,
+;      this must be based on the earlier of the original transaction date
+;      and the current transaction date.
+;   b. Find the item immediately before (chronologically) this transaction in
+;      each account that has been dereferenced from this transaction. This is
+;      based only on the original transaction date (which will be stored in
+;      the dereferenced transaction item.) For new transactions this is always
+;      empty.
+;   c. Recalculate statistics for each of the items identified in identified in
+;      steps a and b.
+
 (defn update
   "Updates the specified transaction"
   [storage-spec transaction]


Cleanup/refactor

Cleanup/refactor

--- src/cljs/gtfve/components/side_panel.cljs
+++ src/cljs/gtfve/components/side_panel.cljs
@@ -109,22 +109,17 @@
                                             (chan 1 (comp
                                                      opacity-filter
                                                      fade-filter
-                                                     tab-pane-filter)))
-            active-in-ch (chan 1)]
+                                                     tab-pane-filter)))]
         (go-loop []
-          (let [[v c] (alts! [active-in-ch toggle-ch kill-ch])]
+          (let [[v c] (alts! [toggle-ch kill-ch])]
             (if (= c kill-ch)
               ::done
-              (do
-                (condp = c
-                  toggle-ch (let [{:keys [active in]} (om/get-state owner)]
-                              (om/set-state! owner :in nil)
-                              (<! transition-ch)
-                              (om/set-state! owner :active v)
-                              (>! active-in-ch v))
-                  active-in-ch (do
-                                 (<! mutations-ch)
-                                 (om/set-state! owner :in v)))
+              (let [{:keys [active in]} (om/get-state owner)]
+                (om/set-state! owner :in nil)
+                (<! transition-ch)
+                (om/set-state! owner :active v)
+                (<! mutations-ch)
+                (om/set-state! owner :in v)
                 (recur)))))))
     om/IWillUnmount
     (will-unmount [_]


change password btn label

change password btn label

--- src/cljs/swarmpit/component/password.cljs
+++ src/cljs/swarmpit/component/password.cljs
@@ -72,7 +72,7 @@
       [:div.form-panel-right
        (comp/mui
          (comp/raised-button
-           {:label      "Submit"
+           {:label      "Change"
             :disabled   (not canSubmit)
             :primary    true
             :onTouchTap change-password-handler}))]]


fix name of DB in create-db script

fix name of DB in create-db script

--- src/clojurelive_web/scripts/create_db.clj
+++ src/clojurelive_web/scripts/create_db.clj
@@ -3,8 +3,9 @@
             [clojurelive-web.db :as db]))

 ;;
-;; $ createuser clojurelive -P # clojurelive_dev
-;; $ createdb clojurelive_web_dev -O clojurelive
+;; $ createuser clojurelive -P
+;; > clojurelive_dev
+;; $ createdb clojurelive_dev -O clojurelive
 ;;
 (defn install-ci-text-module []
   (jdbc/db-do-commands
@@ -58,7 +59,7 @@
                           [:users_id :integer "REFERENCES users"]
                           [:content :text "NOT NULL"])))

-(comment
+(defn -main [& args]
   (install-ci-text-module)
   (create-table-users)
   (create-table-topics)


typo on session-not-found page

typo on session-not-found page

--- src/cljs/work_sessions/components/session_no_found_page.cljs
+++ src/cljs/work_sessions/components/session_no_found_page.cljs
@@ -13,4 +13,4 @@
     "It's too early! Please follow this "
     [:a {:href "/session-two-room"}
      "link"]
-    " at 13:30 Helsinki time"]])
+    " on 2 June 13:30 Helsinki time"]])


First working version of vok-algorithm

First working version of vok-algorithm

i.e. algorithm by Vychodil, Outrata and Krajca.

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

--- src/conexp/contrib/algorithms/bitwise.clj
+++ src/conexp/contrib/algorithms/bitwise.clj
@@ -20,11 +20,22 @@
   `(loop [~var (int (.nextSetBit ~bitset 0))]
      (cond
        (== -1 ~var)
-       true
+       true,
        (not ~@body)
-       false
+       false,
        :else
        (recur (.nextSetBit ~bitset (inc ~var))))))
+
+(defmacro dobits
+  ""
+  [[var bitset] & body]
+  `(let [#^BitSet bitset# ~bitset]
+     (loop [~var (int (.nextSetBit bitset# 0))]
+       (if (== -1 ~var)
+	 nil
+	 (do
+	   ~@body
+	   (recur (int (.nextSetBit bitset# (inc ~var)))))))))

 (defn- to-bitset
   ""
@@ -92,9 +103,9 @@
        (loop [j (int (dec i))]
 	 (cond
 	   (< j 0)
-	   true
-	   (not (= (.get A j) (.get B j)))
-	   false
+	   true,
+	   (not= (.get A j) (.get B j))
+	   false,
 	   :else
 	   (recur (dec j))))))

@@ -110,12 +121,12 @@
 (defn- next-closed-set
   ""
   [base-count clop #^BitSet A]
-  (loop [i (dec base-count)]
+  (loop [i (dec (int base-count))]
     (cond
       (== -1 i)
-      nil
+      nil,
       (.get A i)
-      (recur (dec i))
+      (recur (dec i)),
       :else
       (let [A_i (oplus base-count clop A i)]
 	(if (lectic-<_i base-count i A A_i)
@@ -150,8 +161,103 @@
 	    (to-hashset attribute-vector bitset)])
 	 intents)))

+
 ;; Krajca-Outrata-Vychodil (:vok)

+(defn- create-structures-for-vok
+  ""
+  [context]
+  (let [object-vector (vec (objects context))
+	attribute-vector (vec (attributes context))
+
+	object-count (count object-vector)
+	attribute-count (count attribute-vector)
+
+	incidence-matrix (to-binary-matrix object-vector attribute-vector (incidence context))
+
+	rows (into-array (map (fn [y]
+				(let [#^BitSet bs (BitSet.)]
+				  (.set bs y)
+				  (bitwise-attribute-derivation incidence-matrix
+								object-count
+								attribute-count
+								bs)))
+			      (range attribute-count)))]
+    [object-vector attribute-vector
+     object-count  attribute-count
+     incidence-matrix  rows]))
+
+(set! *warn-on-reflection* true)
+
+(defn- compute-closure
+  ""
+  [object-count attribute-count incidence-matrix rows #^BitSet A #^BitSet B y]
+  (let [#^BitSet C (BitSet.)
+	#^BitSet D (BitSet.)
+	#^BitSet E (BitSet.)
+	y (int y)]
+    (.set D 0 (int attribute-count))
+    (.or E A)
+    (.and E (aget #^objects rows y))
+    (dobits [i E]
+      (.set C i)
+      (dotimes [j attribute-count]
+	(if (== 0 (deep-aget ints incidence-matrix i j))
+	  (.set D j false))))
+    [C, D]))
+
+(defn- generate-from
+  ""
+  [object-count attribute-count incidence-matrix rows #^BitSet A #^BitSet B y]
+  (lazy-seq
+    (cons [A, B]
+	  (if (or (== attribute-count (.cardinality B))
+		  (>= y attribute-count))
+	    nil
+	    (apply concat
+		   (for [j (range y attribute-count)]
+		     (when (not (.get B j))
+		       (let [new-concept (compute-closure object-count
+							  attribute-count
+							  incidence-matrix
+							  rows
+							  A B j)
+			     #^BitSet C (first new-concept)
+			     #^BitSet D (second new-concept)
+			     skip (loop [k 0]
+				    (cond
+				      (== k j)
+				      false,
+				      (not= (.get D k) (.get B k))
+				      true,
+				      :else
+				      (recur (int (inc k)))))]
+			 (when (not skip)
+			   (generate-from object-count
+					  attribute-count
+					  incidence-matrix
+					  rows
+					  C D (inc j)))))))))))
+
+(defmethod concepts :vok [_ context]
+  (let [[object-vector attribute-vector
+	 object-count attribute-count
+	 incidence-matrix rows]
+	(create-structures-for-vok context)
+
+	empty-down (bitwise-attribute-derivation incidence-matrix
+						 object-count
+						 attribute-count
+						 (BitSet.))
+	empty-down-up (bitwise-object-derivation incidence-matrix
+						 object-count
+						 attribute-count
+						 empty-down)]
+    (map (fn [pair]
+	   [(to-hashset object-vector (first pair))
+	    (to-hashset attribute-vector (second pair))])
+	 (generate-from object-count attribute-count incidence-matrix rows empty-down empty-down-up 0))))
+
 ;; In-Close (:in-close)

 ;;;


Simplified and speeded up (concepts :vychodil ctx)

by using a SynchronousQueue.

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

--- src/conexp/contrib/algorithms/bitwise.clj
+++ src/conexp/contrib/algorithms/bitwise.clj
@@ -1,6 +1,7 @@
 (ns #^{:doc "Algorithms which work with bits to improve performance."}
   conexp.contrib.algorithms.bitwise
   (:import [java.util BitSet])
+  (:import [java.util.concurrent SynchronousQueue])
   (:use [clojure.contrib.seq-utils :only (indexed)])
   (:use [conexp.fca.contexts :only (objects attributes incidence)]))

@@ -204,30 +205,29 @@

 (defn generate-from
   ""
-  [object-count, attribute-count, incidence-matrix, rows, #^BitSet A, #^BitSet B, y]
-  (lazy-seq
-    (cons [A, B]
-	  (if (or (== attribute-count (.cardinality B))
-		  (>= (int y) (int attribute-count)))
-	    nil
-	    (for [j (range (int y) (int attribute-count))
-		  :when (not (.get B j))
-		  :let [[#^BitSet C, #^BitSet D] (compute-closure object-count attribute-count,
-								  incidence-matrix rows,
-								  A B j)
-			skip (loop [k (int 0)]
-			       (cond
-				 (== k j)
-				 false,
-				 (not= (.get D k) (.get B k))
-				 true,
-				 :else
-				 (recur (inc k))))]
-		  :when (not skip)
-		  next-concept (generate-from object-count attribute-count,
-					      incidence-matrix rows,
-					      C D (inc j))]
-	      next-concept)))))
+  [object-count, attribute-count, incidence-matrix, rows, #^BitSet A, #^BitSet B, y, #^SynchronousQueue queue]
+  (.put queue [A, B])
+  (if (or (== attribute-count (.cardinality B))
+	  (>= (int y) (int attribute-count)))
+    nil
+    (doseq [j (range (int y) (int attribute-count))
+	    :when (not (.get B j))
+	    :let [[#^BitSet C, #^BitSet D] (compute-closure object-count attribute-count,
+							    incidence-matrix rows,
+							    A B j)
+		  skip (loop [k (int 0)]
+			 (cond
+			   (== k j)
+			   false,
+			   (not= (.get D k) (.get B k))
+			   true,
+			   :else
+			   (recur (inc k))))]
+	    :when (not skip)]
+      (generate-from object-count attribute-count,
+		     incidence-matrix rows,
+		     C D (inc j)
+		     queue))))

 (defmethod concepts :vychodil [_ context]
   (let [[object-vector attribute-vector
@@ -251,13 +251,20 @@
 	empty-down-up (bitwise-object-derivation incidence-matrix
 						 object-count
 						 attribute-count
-						 empty-down)]
+						 empty-down)
+	queue (SynchronousQueue.)
+	worker (Thread. (fn []
+			  (generate-from object-count attribute-count,
+					 incidence-matrix rows,
+					 empty-down empty-down-up 0
+					 queue)
+			  (.put queue 1)))]
+    (.start worker)
     (map (fn [pair]
 	   [(to-hashset object-vector (first pair))
 	    (to-hashset attribute-vector (second pair))])
-	 (generate-from object-count attribute-count,
-			incidence-matrix rows,
-			empty-down empty-down-up 0))))
+	 (take-while #(not= 1 %)
+		     (repeatedly #(.take queue))))))

 ;; In-Close (:in-close)


Re-wrote refresh-prices using agents

Re-wrote refresh-prices using agents

--- src/hackerati_interval_web_app/schema.clj
+++ src/hackerati_interval_web_app/schema.clj
@@ -118,43 +118,15 @@
        first
        :password))

-;; TODO refactor
-;; Using ids and ps to respectively only represent productids and prices makes this function fragile. If a get-price fails it will corrupt the results for successive entries.
 (defn refresh-prices []
   (let [products (select products)
-        ids (map :productid products)
-        urls (map :url products)
-        ps (apply scrape/get-price-from-urls urls)
-        m (reduce #(conj %1 (assoc {} :productid (first %2) :price (second %2)))  [] (partition 2 (interleave ids ps)))]
-;; TODO optimize by including all values within one insert statement, instead of mapping across the bunch
-;; Although, one advantage of doing it this way is that one error doesn't ruin the whole insertion.
-   #_(println m)
-    (doseq [entry m]
-      #_(println entry)
-      (add-price! entry))))
-
-;; test ;;
-
-;; working proof of concept--retrieves one item's price
-(time (let [agents (list (agent 1))
-       products (select products)
-       urls (map :url products)
-       url (first urls)]
-   (doseq [a agents]
-     (send-off a (fn [_] (scrape/get-price-from-url url))))
-   (doseq [a agents]
-     (await-for 4000 a))
-   (doseq [a agents]
-     (print @a))))
-
-;; demo code from JoC p. 252
-(time (let [agents (map #(agent %) (range 10))]
-   (doseq [a agents]
-     (send-off a (fn [_] (Thread/sleep 1000))))
-   (doseq [a agents]
-     (await-for 1000 a))))
-
-;; test ;;
+        agents (map #(agent %) (range (count products)))]
+    (doseq [a agents]
+      (send-off a (fn [_] (hash-map :productid (:productid (nth products @a)) :price (scrape/get-price-from-url (:url (nth products @a)))))))
+    (doseq [a agents]
+      (await-for 4000 a))
+    (doseq [a agents]
+      (add-price! @a))))

 (defn user-exists? [username]
   (seq (select users (where {:username username}))))


Improve some documentation related to response validation

--- src/io/aviso/rook/response_validation.clj
+++ src/io/aviso/rook/response_validation.clj
@@ -1,6 +1,7 @@
 (ns io.aviso.rook.response-validation
   "Allows for validation of the content of responses
-  from resource handler functions. This is usually only enabled during development."
+  from resource handler functions. Response status must match expected values, and response bodies
+  can be validated against a Schema. This is usually only enabled during development."
   {:since "0.1.11"}
   (:import (javax.servlet.http HttpServletResponse))
   (:require
@@ -67,6 +68,17 @@

 (defn wrap-with-response-validation
   "Middleware to ensure that the response provided matches the :responses metadata on the resource handler function.
+  The keys of the responses metadata are the status codes to match, the values are schemas to match against the body
+  of the response (there is no validation of headers).
+
+  A response schema may be nil, in which case there is no validation of the body (but the status code must be a key
+  of the :responses metadata).
+
+  A response in the 5xx range is not validated in anyway, as there represent failures within a resource handler function,
+  or a downstream failure passed through the resource handler function.
+
+  Response validation should generally be the final middleware in a resource handler function's pipeline, to ensure
+  this isn't interference from other middleware in the pipeline (such as [[io.aviso.rook.schema-validation]]).

   handler
   : delegate handler


reached a wall with ?monad? approach - needs some hard thought...

--- src/main/clojure/org/dada/demo/whales.clj
+++ src/main/clojure/org/dada/demo/whales.clj
@@ -435,7 +435,8 @@
 	 (fn [] [src-metadata tgt-key])
 	 ;; apply
 	 (fn [hook]
-	     (let [tgt-model (model (.toString tgt-key) src-metadata)]
+	     (let [tgt-name (name (gensym "union"))
+		   tgt-model (model tgt-name src-metadata)]
 	       (insert *metamodel* tgt-model)
 	       (hook tgt-model tgt-key)
 	       (applicator
@@ -546,8 +547,6 @@
     ))
   "union(count(split(whales, :time)))")
  )
-
-

 ;;--------------------------------------------------------------------------------


Add docstring to test ns

Add docstring to test ns

--- cljs-test/paredit/core-test.cljs
+++ cljs-test/paredit/core-test.cljs
@@ -1,4 +1,5 @@
-(ns paredit.core-test)
+(ns paredit.core-test
+  "Test the core functionality of paredity with a mock editor")

 (defn mock-next-word [text]
   (fn [_ p]
@@ -9,9 +10,9 @@
       (inc (count text)))))

 (comment
+  "This is here so we can test the actual paredit inside the editor"

-(some (bitches (get fd stiches) lolz) foo)
-lol
+  (foo (bar (bam baz) lol wtf) rofl)

 )


CMR-1246: Remove reference to deleted test-environment namespace

--- system-int-test/src/cmr/system_int_test/utils/bootstrap_util.clj
+++ system-int-test/src/cmr/system_int_test/utils/bootstrap_util.clj
@@ -5,7 +5,6 @@
             [clj-http.client :as client]
             [cmr.system-int-test.utils.url-helper :as url]
             [cmr.system-int-test.utils.ingest-util :as ingest]
-            [cmr.system-int-test.utils.test-environment :as test-env]
             [cmr.metadata-db.config :as mdb-config]
             [cmr.bootstrap.test.catalog-rest :as cat-rest]
             [cmr.common.lifecycle :as lifecycle]


Wire up Ring handler dump for debugging.

--- src/webdev/core.clj
+++ src/webdev/core.clj
@@ -3,6 +3,7 @@
   (:require [ring.adapter.jetty :as jetty]
             [ring.middleware.reload :refer [wrap-reload]]
             [ring.middleware.params :refer [wrap-params]]
+            [ring.handler.dump :refer [handle-dump]]
             [compojure.core :refer [defroutes ANY GET POST PUT DELETE]]
             [compojure.route :refer [not-found]]))

@@ -17,6 +18,7 @@
 (defroutes routes
   (GET "/" [] greet)
   (GET "/goodbye" [] goodbye)
+  (ANY "/request" [] handle-dump)
   (not-found "Page not found."))

 (defn wrap-db [hdlr]


persistence: remove provided scope from some deps

--- contrib/persistence/project.clj
+++ contrib/persistence/project.clj
@@ -1,5 +1,5 @@
 (defproject
-  carry-persistence "0.2.0"
+  carry-persistence "0.3.0"
   :description "Carry middleware for automatic model saving/loading using browser storage."
   :url "https://github.com/metametadata/carry/tree/master/contrib/persistence"
   :license {:name "MIT" :url "http://opensource.org/licenses/MIT"}
@@ -7,7 +7,7 @@
   :dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
                  [org.clojure/clojurescript "1.8.51" :scope "provided"]

-                 [org.clojure/core.match "0.3.0-alpha4" :scope "provided"]]
+                 [org.clojure/core.match "0.3.0-alpha4"]]

   :pedantic? :abort


fix broken use of circle logo svg component

--- frontend/components/common.cljs
+++ frontend/components/common.cljs
@@ -170,7 +170,7 @@
   (html
    [:nav.outer-nav
     [:a.logo-circleci {:on-click #(raise! owner [:home-scroll-logo-clicked])}
-     [:figure circle-logo]]
+     [:figure (circle-logo)]]
     [:a {:href "/about"} "About"]
     [:a {:href "/pricing"} "Pricing"]
     [:a {:href "/docs"} "Docs"]


Several paragraphs in info-box

Several paragraphs in info-box

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -46,8 +46,9 @@
   [:div
    [:div#info-box
     [:div#info-close]
-    [:p#info-text "Wishlist is created by Stina Qvarnström and Erik Kronberg. Bla bla. osv."]]
-   [:div#info-container]])
+    [:div#info-text [:p "Wishlisted.org gives you a single place for all your wishlists, no signup required. Simply create a wishlist and add some wishes and optionally URLs. You will be automatically assigned your own unique URL that you can use to return to your wishlist at any time. Anyone else with the link will also be able to view and update it."]
+                    [:p "The site was built using a combination of open source technologies by Erik Kronberg and Stina Qvarnström."]]
+   [:div#info-container]]])

 ; GETTING AND SETTING


Remove empty line.

Remove empty line.

--- frontend/uxbox/util/syntax.cljc
+++ frontend/uxbox/util/syntax.cljc
@@ -7,4 +7,3 @@
     `(cljs.core/defonce ~sym
        (do ~@body
            nil))))
-


updated to ignore printlns in prod build

--- src/leiningen/new/reagent/env/prod/cljs/reagent/prod.cljs
+++ src/leiningen/new/reagent/env/prod/cljs/reagent/prod.cljs
@@ -1,4 +1,7 @@
 (ns {{project-ns}}.prod
   (:require [{{project-ns}}.core :as core]))

+;;ignore println statements in prod
+(set! *print-fn* (fn [& -]))
+
 (core/init!)


make pepa.bus/Bus double-`stop'-safe.

make pepa.bus/Bus double-`stop'-safe.

--- src/pepa/bus.clj
+++ src/pepa/bus.clj
@@ -50,7 +50,8 @@

   (stop [component]
     (println ";; Stopping bus")
-    (async/close! (:input component))
+    (when-let [input (:input component)]
+      (async/close! input))
     (assoc component
            :input nil
            :mult nil


CMR-1825: Addressed more review comments

--- bootstrap-app/src/cmr/bootstrap/data/db_synchronization.clj
+++ bootstrap-app/src/cmr/bootstrap/data/db_synchronization.clj
@@ -83,16 +83,16 @@
   [provider-id]
   (let [virt-collections-by-prov (group-by first (keys vp-config/virtual-product-to-source-config))
         provider-virt-collections (get virt-collections-by-prov provider-id)]
-    (map #(second %) provider-virt-collections)))
+    (map second provider-virt-collections)))

 (defn- granule-is-not-virtual-clause
   "Returns a sql clause to filter out virtual granules.
-  cnt is the number of virtual collections for the given provider"
-  [provider-id cnt]
+  n is the number of virtual collections for the given provider"
+  [provider-id n]
   (format "parent_collection_id not in (select distinct concept_id from %s
           where entry_title in (%s))"
           (mu/metadata-db-concept-table provider-id :collection)
-          (str/join "," (repeat cnt "?"))))
+          (str/join "," (repeat n "?"))))

 (defmulti add-updates-to-work-table-stmt
   (fn [system provider-id concept-type params]
@@ -452,20 +452,20 @@
   [system provider-id concept-type params]
   (let [virtual-entry-titles (provider-virtual-entry-titles provider-id)
         add-virt-gran-clause?  (and (= :granule concept-type) (seq virtual-entry-titles))
-        add-virt-entry-titles (fn [prepared-stmt]
-                                (if add-virt-gran-clause?
-                                  (vec (concat prepared-stmt virtual-entry-titles))
-                                  prepared-stmt))]
-    (add-virt-entry-titles
-      [(format "insert into sync_delete_work (concept_id, revision_id, deleted)
-               select concept_id, revision_id, deleted from %s
-               where concept_id not in (select %s from %s) and %s"
-               (mu/metadata-db-concept-table provider-id concept-type)
-               (mu/concept-type->catalog-rest-id-field concept-type)
-               (mu/catalog-rest-table system provider-id concept-type)
-               (if add-virt-gran-clause?
-                 (granule-is-not-virtual-clause provider-id (count virtual-entry-titles))
-                 "1=1"))])))
+
+        prepared-stmt
+        [(format "insert into sync_delete_work (concept_id, revision_id, deleted)
+                 select concept_id, revision_id, deleted from %s
+                 where concept_id not in (select %s from %s) and %s"
+                 (mu/metadata-db-concept-table provider-id concept-type)
+                 (mu/concept-type->catalog-rest-id-field concept-type)
+                 (mu/catalog-rest-table system provider-id concept-type)
+                 (if add-virt-gran-clause?
+                   (granule-is-not-virtual-clause provider-id (count virtual-entry-titles))
+                   "1=1"))]]
+    (if add-virt-gran-clause?
+      (into prepared-stmt virtual-entry-titles)
+      prepared-stmt)))

 (defmethod add-deleted-items-to-delete-work-table-stmt #{:entry-title}
   [system provider-id concept-type {:keys [entry-title]}]
@@ -473,25 +473,24 @@
         match-entry-title-clause (concept-matches-entry-title-clause system provider-id concept-type)
         virtual-entry-titles (provider-virtual-entry-titles provider-id)
         add-virt-gran-clause?  (and (= :granule concept-type) (seq virtual-entry-titles))
-        ;; Function to concatenate virtual entry titles to the prepared statement.
-        add-virt-entry-titles (fn [prepared-stmt]
-                                (if add-virt-gran-clause?
-                                  (vec (concat prepared-stmt virtual-entry-titles))
-                                  prepared-stmt))]
-    (add-virt-entry-titles
-      [(format "insert into sync_delete_work (concept_id, revision_id, deleted)
-               select concept_id, revision_id, deleted from %s
-               where %s and concept_id not in (select %s from %s where %s) and %s"
-               (mu/metadata-db-concept-table provider-id concept-type)
-               match-entry-title-clause
-               (mu/concept-type->catalog-rest-id-field concept-type)
-               (mu/catalog-rest-table system provider-id concept-type)
-               match-dataset-id-clause
-               (if add-virt-gran-clause?
-                 (granule-is-not-virtual-clause provider-id (count virtual-entry-titles))
-                 "1=1"))
-       entry-title
-       entry-title])))
+
+        prepared-stmt
+        [(format "insert into sync_delete_work (concept_id, revision_id, deleted)
+                 select concept_id, revision_id, deleted from %s
+                 where %s and concept_id not in (select %s from %s where %s) and %s"
+                 (mu/metadata-db-concept-table provider-id concept-type)
+                 match-entry-title-clause
+                 (mu/concept-type->catalog-rest-id-field concept-type)
+                 (mu/catalog-rest-table system provider-id concept-type)
+                 match-dataset-id-clause
+                 (if add-virt-gran-clause?
+                   (granule-is-not-virtual-clause provider-id (count virtual-entry-titles))
+                   "1=1"))
+         entry-title
+         entry-title]]
+    (if add-virt-gran-clause?
+      (into prepared-stmt virtual-entry-titles)
+      prepared-stmt)))

 (defn- add-deleted-items-to-delete-work-table
   "Find items that exist in Metadata DB but do not exist in Catalog REST. This includes all


Insert and update triggers working on postgres

They generate the log entry in the log table at least, anyway

--- src/webapp/framework/server/systemfns.clj
+++ src/webapp/framework/server/systemfns.clj
@@ -450,6 +450,7 @@

         coils-trigger-exists   (pos? (count coils-trigger))

+        sql-to-drop-trigger    (str "DROP TRIGGER IF EXISTS trigger_afterinsert ON " table-name ";")
       sql-to-insert-trigger-row "
 INSERT INTO coils_triggers
 (
@@ -457,9 +458,8 @@
 ) values (?,?);
 "

-        sql-to-create-trigger "
-CREATE TRIGGER trigger_afterInsert AFTER INSERT ON todo_items FOR EACH ROW EXECUTE PROCEDURE trigger_function_afterInsert();
-"
+        sql-to-create-insert-trigger (str "CREATE TRIGGER trigger_afterInsert AFTER INSERT ON " table-name " FOR EACH ROW EXECUTE PROCEDURE trigger_function_afterInsert();")
+        sql-to-create-update-trigger (str "CREATE TRIGGER trigger_afterUpdate AFTER UPDATE ON " table-name " FOR EACH ROW EXECUTE PROCEDURE trigger_function_afterUpdate();")
         ]
         (println "Coils trigger table exists: " coils-trigger-exists)

@@ -467,7 +467,9 @@
         (if (not coils-trigger-exists )
         (do
             (korma.core/exec-raw   [sql-to-insert-trigger-row [table-name  coils-tables-trigger-version]]   [])
-            (korma.core/exec-raw   [sql-to-create-trigger []]   [])
+            (korma.core/exec-raw   [sql-to-drop-trigger []]   [])
+            (korma.core/exec-raw   [sql-to-create-insert-trigger []]   [])
+            (korma.core/exec-raw   [sql-to-create-update-trigger []]   [])

                       )
                       nil
@@ -554,7 +556,7 @@

-(defn make-log-table-trigger-function []
+(defn make-log-table-insert-trigger-function []
     (let [coils-trigger-fn-exists-result      (korma.core/exec-raw
                                                   ["select exists(select * from pg_proc where proname = 'trigger_function_afterinsert');" []]
                                                   :results)
@@ -562,7 +564,7 @@
           coils-trigger-fn-exists   (= "t"  coils-trigger-fn-exists-result)

           sql-to-create-trigger-fn "
-CREATE OR REPLACE FUNCTION trigger_function_afterInsert()\n
+CREATE OR REPLACE FUNCTION trigger_function_afterInsert()
       RETURNS trigger AS
 $BODY$
       BEGIN
@@ -588,13 +590,48 @@

+(defn make-log-table-update-trigger-function []
+    (let [coils-trigger-fn-exists-result      (korma.core/exec-raw
+                                                  ["select exists(select * from pg_proc where proname = 'trigger_function_afterUpdate');" []]
+                                                  :results)
+
+          coils-trigger-fn-exists   (= "t"  coils-trigger-fn-exists-result)
+
+          sql-to-create-trigger-fn "
+CREATE OR REPLACE FUNCTION trigger_function_afterUpdate()
+      RETURNS trigger AS
+$BODY$
+      BEGIN
+           INSERT INTO coils_realtime_log
+                 (record_timestamp,  record_table_name,  record_id,  record_operation,  record_status)
+           VALUES
+                 ( now(),   TG_TABLE_NAME ,  NEW.id,  'UPDATE',  'WAITING');
+           RETURN NULL;
+      END;
+$BODY$
+LANGUAGE plpgsql;
+"
+          ]
+
+        (println "Coils trigger function exists: " coils-trigger-fn-exists)
+        (if (not coils-trigger-fn-exists )
+            (korma.core/exec-raw   [sql-to-create-trigger-fn []]   [])
+            nil
+            )
+        )
+    )
+
+
+
+

 (defn do-real [& {:keys [:table-name]}]
   (println "table name: " table-name)
   (make-admin-table )
   (make-log-table   )
-  ( make-log-table-trigger-function)
+  ( make-log-table-insert-trigger-function)
+  ( make-log-table-update-trigger-function)
   (create-realtime-trigger  :table-name  table-name)
 )