Reindent

Reindent

--- src/cljs/puertorico/client.cljs
+++ src/cljs/puertorico/client.cljs
@@ -5,168 +5,168 @@

 (def initial-buildings
   {:small-indigo-maker {:cost 1
-    :vp 1
-    :workers 1
-    :resource :indigo
-    :count 4
-    :column 1
-
-}
-:large-indigo-maker {:cost 3
-    :vp 2
-    :workers 3
-    :resource :indigo
-    :count 3
-    :column 2
-}
-:small-sugar-maker {:cost 1
-    :vp 1
-    :workers 1
-    :resource :sugar
-    :count 4
-    :column 1
-}
-:large-sugar-maker {:cost 4
-    :vp 2
-    :workers 3
-    :resource :sugar
-    :count 3
-    :column 2
-}
-:tobacco-maker {:cost 5
-    :vp 3
-    :workers 3
-    :resource :tobacco
-    :count 3
-    :column 3
-}
-:coffee-maker {:cost 6
-    :vp 3
-    :workers 2
-    :resource :coffee
-    :count 3
-    :column 3
-}
-:small-market {:cost 1
-    :vp 1
-    :workers 1
-    :count 2
-    :column 1
-    :description "When the owner of an occupied small market sells a barrel in the trader phase, he gets an extra doubloon from the bank for it."
-}
-:large-market {:cost 5
-    :vp 2
-    :workers 1
-    :count 2
-    :column 2
-    :description "When the owner of an occupied large market sells a good in the trader phase, he gets an extra 2 doubloons from the bank for it."
-}
-:hospice {:cost 4
-    :vp 2
-    :workers 1
-    :count 2
-    :column 2
-    :description "During the settler phase, when the owner of an occupied hospice places a plantation or quarry tile on his island, he may take a colonist from the colonist supply and place it on this tile. "
-}
-:office {:cost 5
-    :vp 2
-    :workers 1
-    :count 2
-    :column 2
-    :description "When the owner of an occupied office sells a good to the trading house in the trader phase, it need not be different than the goods already there. If the trading house is full, the player cannot sell a good there!"
-}
-:factory {:cost 8
-    :vp 3
-    :workers 1
-    :count 2
-    :column 3
-    :description "If the owner of an occupied factory produces goods of more than one kind in the craftsman phase, he earns money from the bank: for two kinds of goods, he earns 1 doubloon, for three kinds of goods, he earns 2 doubloons, for four kinds of goods, he earns 3 doubloons, and for all five kinds of goods, he earns 5 doubloons. The number of barrels produced plays no role."
-}
-:university {:cost 7
-    :vp 3
-    :workers 1
-    :count 2
-    :column 3
-    :description "During the builder phase, when the owner of an occupied university builds a building in his city, he may take a colonist from the colonist supply and place it on this tile."
-}
-:hacienda {:cost 2
-    :vp 1
-    :workers 1
-    :count 2
-    :column 1
-    :description "On his turn in the settler phase, the owner of an occupied hacienda may, before he takes a face-up plantation tile, take an additional tile chosen at random from the rest of the supply. He does this by clicking on the top right corner of the hacienda."
-}
-:construction-hut {:cost 2
-    :vp 1
-    :workers 1
-    :count 2
-    :column 1
-    :description "In the settler phase, the owner of an occupied construction hut, can place a quarry on his island of one of the face-up plantation tiles."
-}
-:harbor {:cost 8
-    :vp 3
-    :workers 1
-    :count 2
-    :column 3
-    :description "Each time, during the captain phase, the owner of an occupied harbour loads goods on a cargo ship, he earns one extra victory point."
-}
-:wharf {:cost 9
-    :vp 3
-    :workers 1
-    :count 2
-    :column 3
-    :description "During the captain phase, when a player with an occupied wharf must load goods, instead of loading them on a cargo ship, he may place all goods of one kind in the goods supply and score the appropriate victory points as though he has loaded them on a cargo ship. It is as though the player has an imaginary ship with unlimited capacity at his disposal."
-}
-:small-warehouse {:cost 3
-    :vp 1
-    :workers 1
-    :count 2
-    :column 1
-    :description "The owner of an occupied small warehouse may store, at the end of the captain phase, in addition to the single goods barrel he is allowed to store on his windrose, all the barrels of one kind of goods that he chooses."
-}
-:large-warehouse {:cost 6
-    :vp 2
-    :workers 1
-    :count 2
-    :column 2
-    :description "The owner of an occupied large warehouse may store, at the end of the captain phase, in addition to the single goods barrel he is allowed to store on his wind rose, all the barrels of two kinds of goods that he chooses."
-}
-:guild-hall {:cost 10
-    :vp 4
-    :workers 1
-    :count 1
-    :column 4
-    :description "The owner of the occupied guild hall earns, at game end, an additional 1 VP for each small production building (occupied or unoccupied) in his city (= small indigo plant and small sugar mill), and an additional 2 VP for each large production building (occupied or unoccupied) in his city (= indigo plant, sugar mill, tobacco storage, and coffee roaster)."
-}
-:residence {:cost 10
-    :vp 4
-    :workers 1
-    :count 1
-    :column 4
-    :description "The owner of the occupied residence earns, at game end, additional victory points for the plantations and quarries he has placed on his island. For up to nine filled island spaces, he earns 4 VP, for ten filled island spaces, he earns 5 VP, for eleven filled island spaces, he earns 6 VP, and for all twelve spaces filled, he earns 7 VP."
-}
-:customs-house {:cost 10
-    :vp 4
-    :workers 1
-    :count 1
-    :column 4
-    :description "The owner of the occupied customs house earns, at game end, one additional victory point for every four victory points he acquired during the game. The player should only count his victory point chips (and any extra victory points recorded on paper after the chip supply was exhausted, but before game end). He does not use victory points earned for his buildings at game end."
-}
-:city-hall {:cost 10
-    :vp 4
-    :workers 1
-    :count 1
-    :column 4
-    :description "The owner of the occupied city hall earns, at game end, one additional victory point for each violet building and each green building(occupied or unoccupied) in his city."
-}
-:fortress {:cost 10
-    :vp 4
-    :workers 1
-    :count 1
-    :column 4
-    :description "The owner of the occupied fortress earns, at game end, one additional victory point for every three colonists on his player board."
-}
-})
+                        :vp 1
+                        :workers 1
+                        :resource :indigo
+                        :count 4
+                        :column 1
+
+                        }
+   :large-indigo-maker {:cost 3
+                        :vp 2
+                        :workers 3
+                        :resource :indigo
+                        :count 3
+                        :column 2
+                        }
+   :small-sugar-maker {:cost 1
+                       :vp 1
+                       :workers 1
+                       :resource :sugar
+                       :count 4
+                       :column 1
+                       }
+   :large-sugar-maker {:cost 4
+                       :vp 2
+                       :workers 3
+                       :resource :sugar
+                       :count 3
+                       :column 2
+                       }
+   :tobacco-maker {:cost 5
+                   :vp 3
+                   :workers 3
+                   :resource :tobacco
+                   :count 3
+                   :column 3
+                   }
+   :coffee-maker {:cost 6
+                  :vp 3
+                  :workers 2
+                  :resource :coffee
+                  :count 3
+                  :column 3
+                  }
+   :small-market {:cost 1
+                  :vp 1
+                  :workers 1
+                  :count 2
+                  :column 1
+                  :description "When the owner of an occupied small market sells a barrel in the trader phase, he gets an extra doubloon from the bank for it."
+                  }
+   :large-market {:cost 5
+                  :vp 2
+                  :workers 1
+                  :count 2
+                  :column 2
+                  :description "When the owner of an occupied large market sells a good in the trader phase, he gets an extra 2 doubloons from the bank for it."
+                  }
+   :hospice {:cost 4
+             :vp 2
+             :workers 1
+             :count 2
+             :column 2
+             :description "During the settler phase, when the owner of an occupied hospice places a plantation or quarry tile on his island, he may take a colonist from the colonist supply and place it on this tile. "
+             }
+   :office {:cost 5
+            :vp 2
+            :workers 1
+            :count 2
+            :column 2
+            :description "When the owner of an occupied office sells a good to the trading house in the trader phase, it need not be different than the goods already there. If the trading house is full, the player cannot sell a good there!"
+            }
+   :factory {:cost 8
+             :vp 3
+             :workers 1
+             :count 2
+             :column 3
+             :description "If the owner of an occupied factory produces goods of more than one kind in the craftsman phase, he earns money from the bank: for two kinds of goods, he earns 1 doubloon, for three kinds of goods, he earns 2 doubloons, for four kinds of goods, he earns 3 doubloons, and for all five kinds of goods, he earns 5 doubloons. The number of barrels produced plays no role."
+             }
+   :university {:cost 7
+                :vp 3
+                :workers 1
+                :count 2
+                :column 3
+                :description "During the builder phase, when the owner of an occupied university builds a building in his city, he may take a colonist from the colonist supply and place it on this tile."
+                }
+   :hacienda {:cost 2
+              :vp 1
+              :workers 1
+              :count 2
+              :column 1
+              :description "On his turn in the settler phase, the owner of an occupied hacienda may, before he takes a face-up plantation tile, take an additional tile chosen at random from the rest of the supply. He does this by clicking on the top right corner of the hacienda."
+              }
+   :construction-hut {:cost 2
+                      :vp 1
+                      :workers 1
+                      :count 2
+                      :column 1
+                      :description "In the settler phase, the owner of an occupied construction hut, can place a quarry on his island of one of the face-up plantation tiles."
+                      }
+   :harbor {:cost 8
+            :vp 3
+            :workers 1
+            :count 2
+            :column 3
+            :description "Each time, during the captain phase, the owner of an occupied harbour loads goods on a cargo ship, he earns one extra victory point."
+            }
+   :wharf {:cost 9
+           :vp 3
+           :workers 1
+           :count 2
+           :column 3
+           :description "During the captain phase, when a player with an occupied wharf must load goods, instead of loading them on a cargo ship, he may place all goods of one kind in the goods supply and score the appropriate victory points as though he has loaded them on a cargo ship. It is as though the player has an imaginary ship with unlimited capacity at his disposal."
+           }
+   :small-warehouse {:cost 3
+                     :vp 1
+                     :workers 1
+                     :count 2
+                     :column 1
+                     :description "The owner of an occupied small warehouse may store, at the end of the captain phase, in addition to the single goods barrel he is allowed to store on his windrose, all the barrels of one kind of goods that he chooses."
+                     }
+   :large-warehouse {:cost 6
+                     :vp 2
+                     :workers 1
+                     :count 2
+                     :column 2
+                     :description "The owner of an occupied large warehouse may store, at the end of the captain phase, in addition to the single goods barrel he is allowed to store on his wind rose, all the barrels of two kinds of goods that he chooses."
+                     }
+   :guild-hall {:cost 10
+                :vp 4
+                :workers 1
+                :count 1
+                :column 4
+                :description "The owner of the occupied guild hall earns, at game end, an additional 1 VP for each small production building (occupied or unoccupied) in his city (= small indigo plant and small sugar mill), and an additional 2 VP for each large production building (occupied or unoccupied) in his city (= indigo plant, sugar mill, tobacco storage, and coffee roaster)."
+                }
+   :residence {:cost 10
+               :vp 4
+               :workers 1
+               :count 1
+               :column 4
+               :description "The owner of the occupied residence earns, at game end, additional victory points for the plantations and quarries he has placed on his island. For up to nine filled island spaces, he earns 4 VP, for ten filled island spaces, he earns 5 VP, for eleven filled island spaces, he earns 6 VP, and for all twelve spaces filled, he earns 7 VP."
+               }
+   :customs-house {:cost 10
+                   :vp 4
+                   :workers 1
+                   :count 1
+                   :column 4
+                   :description "The owner of the occupied customs house earns, at game end, one additional victory point for every four victory points he acquired during the game. The player should only count his victory point chips (and any extra victory points recorded on paper after the chip supply was exhausted, but before game end). He does not use victory points earned for his buildings at game end."
+                   }
+   :city-hall {:cost 10
+               :vp 4
+               :workers 1
+               :count 1
+               :column 4
+               :description "The owner of the occupied city hall earns, at game end, one additional victory point for each violet building and each green building(occupied or unoccupied) in his city."
+               }
+   :fortress {:cost 10
+              :vp 4
+              :workers 1
+              :count 1
+              :column 4
+              :description "The owner of the occupied fortress earns, at game end, one additional victory point for every three colonists on his player board."
+              }
+   })

 (defn create-player [name gold starting-field]
   {:name name
@@ -177,9 +177,9 @@
    })

 (defn circles [n]
-  (repeat n
-  [:svg {:height 20 :width 20}
-   [:circle {:cx 10 :cy 10 :r 7 :stroke "black" :stroke-width 1 :fill "white"}]]))
+  (repeat n
+          [:svg {:height 20 :width 20}
+           [:circle {:cx 10 :cy 10 :r 7 :stroke "black" :stroke-width 1 :fill "white"}]]))

 (defn gold [text]
   [:span.gold text])
@@ -193,7 +193,7 @@
                         :settler "Get quarry/field(s)"
                         :mayor "Get colonists"
                         :craftsman "Produce goods"})
-
+

 (def common
   {:roles (set (keys role-descriptions))
@@ -205,9 +205,9 @@
    :quarry 8
    :fields {:coffee 8 :tobacco 9 :corn 10 :sugar 11 :indigo 12}})

-(defn create-game
+(defn create-game
   ([p1 p2 p3]
-   (merge common
+   (merge common
           {:n-player 3
            :vp 75 :colonists 55 :ships [4 5 6]
            :colonist-ship 3
@@ -219,11 +219,11 @@

 (defn randomize-fields []
   (->> (for [[field-type field-num] (:fields @game)]
-        (repeat field-num field-type))
-      flatten
-      shuffle
-      (take (inc (:n-player @game)))
-      vec))
+         (repeat field-num field-type))
+       flatten
+       shuffle
+       (take (inc (:n-player @game)))
+       vec))

 (defn vec-remove
   "remove elem in coll"
@@ -236,19 +236,19 @@
   (println "Trying to buy " b-name))

 (defn building-tile [b-name]
-    (let [building (b-name (:buildings @game))]
-      [:div.building {:class [(:resource building)]
-                      :on-click #(buy-building b-name)}
-       [:h5.pull-left (name b-name)]
-
-       [:span.pull-right (gold (:cost building))]
-       [:span.pull-right (vp (:vp building))]
-
-       [:div.clearfix]
-       [:div.pull-left (circles (:workers building))]
-       [:div.building-count.pull-right (:count building) "x"]
-       [:div.clearfix]
-       ]))
+  (let [building (b-name (:buildings @game))]
+    [:div.building {:class [(:resource building)]
+                    :on-click #(buy-building b-name)}
+     [:h5.pull-left (name b-name)]
+
+     [:span.pull-right (gold (:cost building))]
+     [:span.pull-right (vp (:vp building))]
+
+     [:div.clearfix]
+     [:div.pull-left (circles (:workers building))]
+     [:div.building-count.pull-right (:count building) "x"]
+     [:div.clearfix]
+     ]))

 (defn building-board []
   [:table
@@ -284,55 +284,55 @@

 (defn render-ship [size type]
   [:div.ship
-    (repeat size [:div.box {:class type}])
-    [:div.clearfix]])
+   (repeat size [:div.box {:class type}])
+   [:div.clearfix]])

 (defn render-trader [trader]
   [:div.ship
-    [:div.box {:class type}]
-    [:div.box {:class type}]
-    [:div.box {:class type}]
-    [:div.box {:class type}]
-    [:div.clearfix]])
+   [:div.box {:class type}]
+   [:div.box {:class type}]
+   [:div.box {:class type}]
+   [:div.box {:class type}]
+   [:div.clearfix]])

 (defn player-board [player]
   [:div
    (if (:role player)
      [:div.rolecard (name (:role player))])
-      [:div.well
-        [:div.pull-left (:name player)]
-        [:span.pull-right (gold (:gold player))]
-        [:span.pull-right (vp (:vp player))]
-        [:div.clearfix]
-        [:h5 "Buildings"]
-        (for [building (:buildings player)]
-            [:div (:name building)])
-        [:h5 "Fields"]
-        (for [field (:fields player)]
-            [:div.field {:class (name field)} (name field)])
-        ]])
+   [:div.well
+    [:div.pull-left (:name player)]
+    [:span.pull-right (gold (:gold player))]
+    [:span.pull-right (vp (:vp player))]
+    [:div.clearfix]
+    [:h5 "Buildings"]
+    (for [building (:buildings player)]
+      [:div (:name building)])
+    [:h5 "Fields"]
+    (for [field (:fields player)]
+      [:div.field {:class (name field)} (name field)])
+    ]])

 (defn current-role []
   (let [last-role-event
-      (first
-          (filter
-            (fn [event]
-              (contains? #{:rolestart :roleend} (first event)))
-            (rseq (:log @game))))]
-      (println last-role-event)
-      (if (= :rolestart (first last-role-event))
-          (second last-role-event))))
+        (first
+         (filter
+          (fn [event]
+            (contains? #{:rolestart :roleend} (first event)))
+          (rseq (:log @game))))]
+    (println last-role-event)
+    (if (= :rolestart (first last-role-event))
+      (second last-role-event))))

 (defn player-boards []
   [:div.row
    (for [player (:players @game)]
      [:div.col-md-3
-        (player-board player)])])
+      (player-board player)])])

 (defn game-log []
-    [:div
-  (for [event (:log @game)]
-    [:div (pr-str event)])])
+  [:div
+   (for [event (:log @game)]
+     [:div (pr-str event)])])

 (defn get-field [field-type i]
   (when (= :settler (current-role))
@@ -344,36 +344,36 @@
 (defn player-pick-role [role]
   (let [cstate @game
         governor (:governor cstate)]
-      (swap! game update-in [:log] conj [:rolestart role (:governor @game)])
-      (swap! game update-in [:players governor] assoc :role role)
-      (swap! game update-in [:roles] disj role)))
+    (swap! game update-in [:log] conj [:rolestart role (:governor @game)])
+    (swap! game update-in [:players governor] assoc :role role)
+    (swap! game update-in [:roles] disj role)))

 (defn roles-board []
   [:div
-  (for [role (:roles @game)]
-            [:div.rolecard {:on-click #(player-pick-role role)}
-             (name role)
-             [:span " - " (role role-descriptions)]])])
+   (for [role (:roles @game)]
+     [:div.rolecard {:on-click #(player-pick-role role)}
+      (name role)
+      [:span " - " (role role-descriptions)]])])

 (defn supply-board []
-    (let [current @game]
-      [:div
-          [:i.fa.fa-trophy (:vp current)]
-          [:div "Colonist Supply: " (:colonists current)]
-          [:div "Colonist Ship: " (:colonist-ship current)]
-          [:h3 "Ships"]
-          (for [ship (:ships current)]
-            (render-ship ship))
-          [:h3 "Trader"] (render-trader (:trader current))
-          [:h3 "Fields"]
-          [:div.quarry.field {:on-click #(get-field :quarry nil)} (:quarry current) " Q"]
-          (map-indexed (fn [i field]
-                         [:div.field {:class (name field)
-                                :on-click #(get-field field i)} (name field)]
-                         )
-                       (:available-fields current))
-          #_[:h3 "It is " (active-player) "'s turn"]
-          #_[:h3 "Current role: " (current-role)]]))
+  (let [current @game]
+    [:div
+     [:i.fa.fa-trophy (:vp current)]
+     [:div "Colonist Supply: " (:colonists current)]
+     [:div "Colonist Ship: " (:colonist-ship current)]
+     [:h3 "Ships"]
+     (for [ship (:ships current)]
+       (render-ship ship))
+     [:h3 "Trader"] (render-trader (:trader current))
+     [:h3 "Fields"]
+     [:div.quarry.field {:on-click #(get-field :quarry nil)} (:quarry current) " Q"]
+     (map-indexed (fn [i field]
+                    [:div.field {:class (name field)
+                                 :on-click #(get-field field i)} (name field)]
+                    )
+                  (:available-fields current))
+     #_[:h3 "It is " (active-player) "'s turn"]
+     #_[:h3 "Current role: " (current-role)]]))

 (defn game-state []
   [:blockquote (pr-str @game)])


upsert*-test

upsert*-test

--- test/er_cassandra/model/alia/upsert_test.clj
+++ test/er_cassandra/model/alia/upsert_test.clj
@@ -84,6 +84,58 @@
                          :collections {:phone :list}}]
     :secondary-tables [{:name :upsert_lookup_and_secondaries_test_by_thing
                         :key [:org_id :thing]}]}))
+
+(defn create-unique-lookup-secondaries-entity
+  []
+  (tu/create-table
+   :upsert_unique_lookup_secondaries_test
+   "(org_id timeuuid, id timeuuid, nick text, email set<text>, phone list<text>, thing text, title text, tag set<text>, dept list<text>, stuff text, primary key (org_id, id))")
+
+  (tu/create-table
+   :upsert_unique_lookup_secondaries_test_by_nick
+   "(nick text, org_id timeuuid, id timeuuid, primary key (org_id, nick))")
+  (tu/create-table
+   :upsert_unique_lookup_secondaries_test_by_email
+   "(email text primary key, org_id timeuuid, id timeuuid)")
+  (tu/create-table
+   :upsert_unique_lookup_secondaries_test_by_phone
+   "(phone text primary key, org_id timeuuid, id timeuuid)")
+
+  (tu/create-table
+   :upsert_unique_lookup_secondaries_test_by_thing
+   "(org_id timeuuid, id timeuuid, nick text, email set<text>, phone list<text>, thing text, title text, tag set<text>, dept list<text>, stuff text, primary key (org_id, thing))")
+
+  (tu/create-table
+   :upsert_unique_lookup_secondaries_test_by_title
+   "(title text, org_id timeuuid, id timeuuid, primary key (org_id, title))")
+  (tu/create-table
+   :upsert_unique_lookup_secondaries_test_by_tag
+   "(tag text primary key, org_id timeuuid, id timeuuid)")
+  (tu/create-table
+   :upsert_unique_lookup_secondaries_test_by_dept
+   "(dept text primary key, org_id timeuuid, id timeuuid)")
+
+  (t/create-entity
+   {:primary-table {:name :upsert_unique_lookup_secondaries_test :key [:org_id :id]}
+    :unique-key-tables [{:name :upsert_unique_lookup_secondaries_test_by_nick
+                         :key [:org_id :nick]}
+                        {:name :upsert_unique_lookup_secondaries_test_by_email
+                         :key [:email]
+                         :collections {:email :set}}
+                        {:name :upsert_unique_lookup_secondaries_test_by_phone
+                         :key [:phone]
+                         :collections {:phone :list}}]
+    :secondary-tables [{:name :upsert_unique_lookup_secondaries_test_by_thing
+                        :key [:org_id :thing]}]
+    :lookup-key-tables [{:name :upsert_unique_lookup_secondaries_test_by_title
+                         :key [:org_id :title]}
+                        {:name :upsert_unique_lookup_secondaries_test_by_tag
+                         :key [:tag]
+                         :collections {:tag :set}}
+                        {:name :upsert_unique_lookup_secondaries_test_by_dept
+                         :key [:dept]
+                         :collections {:dept :list}}]}))
+

 (deftest delete-record-test
   (let [m (create-simple-entity)
@@ -420,4 +472,26 @@
                (fetch-record :upsert_lookup_and_secondaries_test_by_phone
                              [:phone] "456")))))))

-(deftest upsert*-test)
+(deftest upsert*-test
+  (let [m (create-unique-lookup-secondaries-entity)
+        [org-id id] [(uuid/v1) (uuid/v1)]
+
+        record {:org_id org-id
+                :id id
+
+                :stuff "whateva"
+
+                :nick "foo"
+                :email #{"foo@bar.com" "foo@baz.com"}
+                :phone ["123" "456"]
+
+                :thing "blah"
+
+                :title "mr"
+                :tag #{"quick" "slow"}
+                :dept ["hr" "dev"]}
+
+        _ @(u/upsert* tu/*model-session* m record {})]
+
+    (is (= record (fetch-record :upsert_unique_lookup_secondaries_test
+                                [:org_id :id] [org-id id])))))


Added missing dedication

Added missing dedication

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

--- src/conexp/contrib/gui/util.clj
+++ src/conexp/contrib/gui/util.clj
@@ -5,6 +5,8 @@
 ;; By using this software in any fashion, you are agreeing to be bound by
 ;; the terms of this license.
 ;; You must not remove this notice, or any other, from this software.
+
+;; this file contains contributions by Immanuel Albrecht

 (ns conexp.contrib.gui.util
   (:import [javax.swing JFrame JMenuBar JMenu JMenuItem Box JToolBar JPanel


[#2486] Adapt split-column tx

[#2486] Adapt split-column tx

--- backend/src/akvo/lumen/lib/transformation/split_column.clj
+++ backend/src/akvo/lumen/lib/transformation/split_column.clj
@@ -54,7 +54,7 @@

 (defn columns-to-extract [prefix number-new-rows selected-column columns]
   (let [selected-column (find-column (walk/keywordize-keys columns) (:columnName selected-column))
-        base-column (dissoc selected-column :type :columnName)
+        base-column (dissoc selected-column :type :columnName :groupId :groupName)
         new-columns (map #(assoc base-column :title (str prefix "-" %) :type "text")
                          (range 1 (inc number-new-rows)))]
     (add-name-to-new-columns columns new-columns)))


Add default case for monitor tab table icons (#799)

--- src/cljs/main/broadfcui/page/workspace/monitor/tab.cljs
+++ src/cljs/main/broadfcui/page/workspace/monitor/tab.cljs
@@ -38,7 +38,8 @@
                  [:div {:style {:height table-style/table-icon-size}}
                   (case (:status submission)
                     "Done" (moncommon/icon-for-sub-status (:workflowStatuses submission))
-                    "Aborted" moncommon/failure-icon)
+                    "Aborted" moncommon/failure-icon
+                    nil)
                   (:status submission)])}
       {:header "Method Configuration" :initial-width 300
        :column-data (juxt :methodConfigurationNamespace :methodConfigurationName)


Update Math.clj

Update Math.clj

Added a little instruction comment.

--- utilities/nonvisualstudio/clojure/Implementation/Math.clj
+++ utilities/nonvisualstudio/clojure/Implementation/Math.clj
@@ -1,3 +1,7 @@
+;To Use
+;(load-file "C:/Users/Thomas/Documents/GitHub/practice/utilities/nonvisualstudio/clojure/Implementation/Math.clj")
+;(use 'utilities.math)
+
 (ns utilities.math)

 (defn gcd [largerNumber smallerNumber]


Update project.clj

Update project.clj

--- src/jarkeeper/views/project.clj
+++ src/jarkeeper/views/project.clj
@@ -121,6 +121,5 @@
                 (:repo-owner project)
                 "/"
                 (:repo-name project)
-                "/status.svg\">"))]
-        ]]
+                "/status.svg\">"))]]]
      (common-views/common-footer)]))


WIP.  Proper HTTP status codes in place in get-changes.  request handler parameter destructuring moved to resource/handler level and out of actual handler functions to create a layer of indirection, decoupling the HTTP resource interface from the implementation function.

--- src/lcmap/clownfish/changes.clj
+++ src/lcmap/clownfish/changes.clj
@@ -71,7 +71,7 @@
   [{:keys [x y algorithm]}]
   true)

-(defn query-data
+(defn retrieve-changes
   [{:keys [x y algorithm]}]
   {:algorithm algorithm
    :start  12343
@@ -85,7 +85,7 @@
    :swir2s [1 2 3]
    :whatever ["the" "results" "are"]})

-(defn run-tile
+(defn schedule-change-detection
   [{:keys [x y algorithm] :as data}]
   (let [existing-ticket (snap-x-y-and-check-iwds data)]
     (if (some? existing-ticket)
@@ -94,46 +94,48 @@

 ;;; request handlers
 (defn get-changes
-  [{{x :x
-     y :y
-     a :algorithm
-     r :refresh
-     :or {r false}} :params}]
+  [x y algorithm refresh]
   (let [data   {:x x :y y :algorithm a :refresh (boolean r)}
-        valid? {:algorithm-available (algorithm-available? data)}])
-  (if (not-every? true? (vals valid?))
-    {:status 202 :body (merge data valid?)}
-    (let [src?      (future (source-data-available? data))
-          results?  {:change-results-exist (change-results-exist? data)}
-          source?   {:source-data-available @src?}
-          doquery?  (and (not (:refresh data))
-                         (:change-results-exist results?))
-          runtile?  (and (not doquery?)
-                         (:source-data-available source?))
-          body      (merge data valid? results? source? {:doquery doquery?
-                                                         :runtile runtile?})]
-      (cond
-        doquery? {:status 202
-                  :body (merge body {:changes (query-data data)})}
-        runtile? {:status 202
-                  :body (merge body {:ticket (run-tile data)})}
-        :else    {:status 202
-                  :body body}))))
-
+        valid? {:algorithm-available (algorithm-available? data)}]
+    (if (not-every? true? (vals valid?)
+            {:status 400 :body (merge data valid?)}
+            (let [src?      (future (source-data-available? data))
+                  results?  {:change-results-exist (change-results-exist? data)}
+                  source?   {:source-data-available @src?}
+                  doquery?  (and (not (:refresh data))
+                                 (:change-results-exist results?))
+                  runtile?  (and (not doquery?)
+                                 (:source-data-available source?))
+                  body      (merge data valid? results? source?
+                                   {:doquery doquery? :runtile runtile?})]
+              (cond
+                doquery? {:status 200
+                          :body (merge body
+                                       {:changes (retrieve-changes data)})}
+                runtile? {:status 202
+                          :body (merge body
+                                       {:ticket (schedule-change-detection data)})}
+                :else    {:status 422
+                          :body body}))))))
 ;;; Routes
 (defn resource
-  "Handlers for landsat resource."
+  "Handlers for changes resource."
   []
   (wrap-handler
-   (context "/changes" request
-     (GET    "/" []
-       (with-meta
-         {:status 200}
-         {:template html/default}))
-     (ANY    "/" []
-       (with-meta
-         (allow ["GET"])
-         {:template html/default}))
-     (GET "/problem/" []
-       {:status 200 :body "problem resource"}))
+   (context "/changes/v0-beta" request
+     (GET "/"
+          []
+          (with-meta {:status 200}{:template html/default}))
+
+     (GET "/:algorithm{.+}/:x{\d.+}/:y{\d.+}"
+          {{x :x y :y a :algorithm r :refresh :or {r false}} :params}
+          (with-meta (get-changes a x y r) {:template html/default}))
+
+     (ANY "/"
+          []
+          (with-meta (allow ["GET"]) {:template html/default}))
+
+     (GET "/problem/"
+          []
+          {:status 200 :body "problem resource"}))
    prepare-with respond-with))


Save data_readers.clj file to assets

Save data_readers.clj file to assets

Saving them to resources doesn't work well because it requires
eval'ing inside the project before the resources are generated; and if
there are Java classes that rely on the R file, it blows up.

--- src/leiningen/droid/compile.clj
+++ src/leiningen/droid/compile.clj
@@ -19,11 +19,11 @@
   "Save project's *data-readers* value to application's resources so
   it can be later retrieved in runtime. This is necessary to be able
   to use data readers when developing in REPL on the device."
-  [{{:keys [res-path]} :android :as project}]
-  (.mkdirs (io/file res-path "raw"))
+  [{{:keys [assets-path]} :android :as project}]
+  (.mkdirs (io/file assets-path))
   (eval/eval-in-project
    project
-   `(spit (io/file ~res-path "raw" "data_readers.clj")
+   `(spit (io/file ~assets-path "data_readers.clj")
           (into {} (map (fn [[k# v#]]
                           [k# (symbol (subs (str v#) 2))])
                         *data-readers*)))))
@@ -37,8 +37,6 @@
             out-res-path external-res-paths library]} :android
     java-only :java-only :as project}]
   (info "Generating R.java...")
-  (when-not java-only
-    (save-data-readers-to-resource project))
   (let [aapt-bin (sdk-binary sdk-path :aapt)
         android-jar (get-sdk-android-jar sdk-path target-version)
         manifest-file (io/file manifest-path)
@@ -140,6 +138,8 @@
   "Compiles both Java and Clojure source files."
   [{{:keys [sdk-path]} :android, java-only :java-only :as project} & args]
   (ensure-paths sdk-path)
+  (when-not java-only
+    (save-data-readers-to-resource project))
   (apply leiningen.javac/javac project args)
   (when-not java-only
    (compile-clojure project)))


Update git-branch-spec.

Update git-branch-spec.

--- spec/incise/deploy/workflows/git_branch_spec.clj
+++ spec/incise/deploy/workflows/git_branch_spec.clj
@@ -49,20 +49,20 @@
                  (it)))
   (context "remove-out-dir"
     (it "removes the prefixed out-dir returning a relative path"
-      (should= @file-name (#'incise.deploy.workflows.git-branch/remove-out-dir
+      (should= @file-name (remove-out-dir
                             (.getCanonicalPath (file @out-dir @file-name))))))
   (context "move-to-work-dir"
     (it "moves a file from out-dir to work-dir"
       (should= (file @work-dir @file-name)
                (move-to-work-dir @ex-file)))))

-(describe "add-files"
+(describe "add-file"
   (with repo-dir (create-dummy-repo))
   (around [it] (with-repo @repo-dir (it)))
   (with files (map (partial file @repo-dir)
                    ["a" "b" "c"]))
   (it "adds files"
-    (should-not-throw (add-files @files))))
+    (should-not-throw (map add-file @files))))

 (defn- file-exists? [file-like]
   (.exists (file *work-dir* file-like)))


incremental tile work

incremental tile work

--- src/main/cljc/clojure_club/tile_laying/mbastian.cljc
+++ src/main/cljc/clojure_club/tile_laying/mbastian.cljc
@@ -15,4 +15,62 @@
   (conj tiles (random-neigbhor tiles)))

 (defn rotate-ccw [shape]
-  (apply mapv vector (map rseq shape)))+  (apply mapv vector (map rseq shape)))
+
+(def tiles
+  [
+   ;Central monastery
+   [:L :L :L :L]
+   [:L :L :L :L]
+   [:L :L :L :L]
+   [:L :L :L :L]
+   ;Central monastery
+   [:L :L :L :R]
+   [:L :L :L :R]
+   ;Mega-city with shield
+   [:C :C :C :C]
+   ;City open at bottom
+   [:C :C :C :L]
+   [:C :C :C :L]
+   [:C :C :C :L]
+   ;City open at bottom with shield
+   [:C :C :C :L]
+   ;City with single road
+   [:C :C :C :R]
+   ;City with single road + shield
+   [:C :C :C :R]
+   [:C :C :C :R]
+   ;Corner city
+   [:L :C :C :L]
+   [:L :C :C :L]
+   [:L :C :C :L]
+   ;Corner city + shield
+   [:L :C :C :L]
+   [:L :C :C :L]
+   ;Corner city with non-connected corner road
+   [:R :C :C :R]
+   [:R :C :C :R]
+   [:R :C :C :R]
+   ])
+
+[[:U :U :U :U]
+ [:U :R :R :U]
+ [:U :C :C :C]
+ [:U :U :C :L]]
+
+(def initial-state {[0 0] [:R :C :R :L]})
+
+(def state-1 {[0 0] [:R :C :R :L]
+              [1 0] [:R :C :R :L]
+              [0 1] [:R :L :R :C]})
+
+(for [n (available-neighbors (keys state-1))]
+  [n (mapv (fn [i v] (get v i)) [2 3 0 1] (map state-1 (neighbors n)))])
+
+(defn compatible [piece slot]
+  (->> piece
+       cycle
+       (partition 4 1)
+       (take 4)
+       ;not quite - maybe reverse seqs?
+       (filter (fn [s] (every? true? (map (comp #(apply = %) #(filter identity %) vector) s slot))))))


add support for "output-dir" in package.json

defaults to "node_modules/shadow-cljs"

Some JS tools (eg. create-react-app) do not watch files in
"node_modules"  so HMR won't reload them. Setting an output-dir
means that you must use a relative path to require the file

require("shadow-cljs/demo.foo") becomes
require("../the-output-dir/demo.foo")

webpack supports setting a resolve.alias so the former can still
work but requires configuration.

--- src/main/shadow/cljs/devtools/targets/npm_module.clj
+++ src/main/shadow/cljs/devtools/targets/npm_module.clj
@@ -114,20 +114,9 @@

 (defn flush
-  [{::comp/keys [build-info] :as state} mode
-   {:keys [module-root module-name]
-    :or {module-name "shadow-cljs"
-         module-root "./"}
-    :as config}]
-
-  (let [root
-        (-> (io/file module-root)
-            (.getCanonicalFile))
-
-        output-dir
-        (io/file root "node_modules" module-name)
-
-        env-file
+  [{::comp/keys [build-info] :keys [output-dir] :as state} mode config]
+
+  (let [env-file
         (io/file output-dir "cljs_env.js")]

     (util/with-logged-time [state {:type :npm-flush :output-path (.getAbsolutePath output-dir)}]


wire up internal tests for CLJS

wire up internal tests for CLJS

--- test-doo/calfpath/runner.cljs
+++ test-doo/calfpath/runner.cljs
@@ -11,6 +11,7 @@
   (:require
     [doo.runner :refer-macros [doo-tests]]
     [calfpath.core-test]
+    [calfpath.internal-test]
     [calfpath.route-handler-test]
     [calfpath.route-prepare-test]
     [calfpath.route-reverse-test]))
@@ -21,6 +22,7 @@
 (try
   (doo-tests
     'calfpath.core-test
+    'calfpath.internal-test
     'calfpath.route-handler-test
     'calfpath.route-prepare-test
     'calfpath.route-reverse-test)


converting last few tests

converting last few tests

--- test/cljs/cljs/core_test.cljs
+++ test/cljs/cljs/core_test.cljs
@@ -2286,24 +2286,62 @@
     (is (= 1.5 1.5M))
     (is (= 4.9E-324 5E-324M))))

-(defn test-stuff []
+(deftest test-transient-edge-case-1
   (let [v1 (vec (range 15 48))
         v2 (vec (range 40 57))
         v1 (persistent! (assoc! (conj! (pop! (transient v1)) :foo) 0 :quux))
         v2 (persistent! (assoc! (conj! (transient v2) :bar) 0 :quux))
         v  (into v1 v2)]
-    (assert (= v (vec (concat [:quux] (range 16 47) [:foo]
-                              [:quux] (range 41 57) [:bar])))))
-  (loop [v  (transient [])
-         xs (range 100)]
-    (if-let [x (first xs)]
-      (recur
-       (condp #(%1 (mod %2 3)) x
-         #{0 2} (conj! v x)
-         #{1}   (assoc! v (count v) x))
-       (next xs))
-      (assert (= (vec (range 100)) (persistent! v)))))
-
+    (is (= v (vec (concat [:quux] (range 16 47) [:foo]
+                    [:quux] (range 41 57) [:bar]))))))
+
+(deftest test-transient-edge-case-2
+  (is (loop [v  (transient [])
+             xs (range 100)]
+        (if-let [x (first xs)]
+          (recur
+            (condp #(%1 (mod %2 3)) x
+              #{0 2} (conj! v x)
+              #{1}   (assoc! v (count v) x))
+            (next xs))
+          (= (vec (range 100)) (persistent! v))))))
+
+(deftest test-phm
+  (let [m (-> (->> (interleave (range 10) (range 10))
+                (apply assoc cljs.core.PersistentHashMap.EMPTY))
+            (dissoc 3 5 7))]
+    (testing "Testing PHM dissoc"
+      (is (= (count m) 7))
+      (is (= m {0 0 1 1 2 2 4 4 6 6 8 8 9 9}))))
+  (let [m (-> (->> (interleave (range 10) (range 10))
+                (apply assoc cljs.core.PersistentHashMap.EMPTY))
+            (conj [:foo 1]))]
+    (testing "Testing PHM conj"
+      (is (= (count m) 11))
+      (is (= m {0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 :foo 1}))))
+  (let [m (-> (->> (interleave (range 10) (range 10))
+                (apply assoc cljs.core.PersistentHashMap.EMPTY)
+                transient)
+            (conj! [:foo 1])
+            persistent!)]
+    (testing "Testing PHM conj!"
+      (is (= (count m) 11))
+      (is (= m {0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 :foo 1}))))
+  (let [tm (->> (interleave (range 10) (range 10))
+                (apply assoc cljs.core.PersistentHashMap.EMPTY)
+                transient)]
+    (testing "Testing transient PHM"
+      (is (loop [tm tm ks [3 5 7]]
+            (if-let [k (first ks)]
+              (recur (dissoc! tm k) (next ks))
+              (let [m (persistent! tm)]
+                (and (= (count m) 7)
+                     (= m {0 0 1 1 2 2 4 4 6 6 8 8 9 9}))))))))
+)
+
+(deftest test-phm-fixed-hash)
+
+(defn test-stuff []
   ;; PersistentHashMap & TransientHashMap
   (loop [m1 cljs.core.PersistentHashMap.EMPTY
          m2 (transient cljs.core.PersistentHashMap.EMPTY)
@@ -2326,32 +2364,6 @@
         (assert (= (map vector (range 100) (range 100)) (sort-by first (seq m1))))
         (assert (= (map vector (range 100) (range 100)) (sort-by first (seq m2))))
         (assert (not (contains? (dissoc m1 3) 3))))))
-  (let [m (-> (->> (interleave (range 10) (range 10))
-                   (apply assoc cljs.core.PersistentHashMap.EMPTY))
-              (dissoc 3 5 7))]
-    (assert (= (count m) 7))
-    (assert (= m {0 0 1 1 2 2 4 4 6 6 8 8 9 9})))
-  (let [m (-> (->> (interleave (range 10) (range 10))
-                   (apply assoc cljs.core.PersistentHashMap.EMPTY))
-              (conj [:foo 1]))]
-    (assert (= (count m) 11))
-    (assert (= m {0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 :foo 1})))
-  (let [m (-> (->> (interleave (range 10) (range 10))
-                   (apply assoc cljs.core.PersistentHashMap.EMPTY)
-                   transient)
-              (conj! [:foo 1])
-              persistent!)]
-    (assert (= (count m) 11))
-    (assert (= m {0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 :foo 1})))
-  (let [tm (->> (interleave (range 10) (range 10))
-                (apply assoc cljs.core.PersistentHashMap.EMPTY)
-                transient)]
-    (loop [tm tm ks [3 5 7]]
-      (if-let [k (first ks)]
-        (recur (dissoc! tm k) (next ks))
-        (let [m (persistent! tm)]
-          (assert (= (count m) 7))
-          (assert (= m {0 0 1 1 2 2 4 4 6 6 8 8 9 9}))))))
   (let [tm (-> (->> (interleave (range 10) (range 10))
                     (apply assoc cljs.core.PersistentHashMap.EMPTY))
                (dissoc 3 5 7)
@@ -2364,14 +2376,17 @@
       (assert (= 2 (try (persistent! tm) 1 (catch js/Error e 2))))
       (assert (= 2 (try (count tm) 1 (catch js/Error e 2))))
       (assert (= m {0 0 1 1 2 2 4 4 6 6 8 8 9 9}))))
+
   (deftype FixedHash [h v]
     IHash
     (-hash [this] h)
     IEquiv
     (-equiv [this other]
       (and (instance? FixedHash other) (= v (.-v other)))))
+
   (def fixed-hash-foo (FixedHash. 0 :foo))
   (def fixed-hash-bar (FixedHash. 0 :bar))
+
   (let [m (assoc cljs.core.PersistentHashMap.EMPTY
             fixed-hash-foo 1
             fixed-hash-bar 2)]
@@ -2382,6 +2397,7 @@
       (assert (= (get m fixed-hash-bar) 2))
       (assert (not (contains? m fixed-hash-foo)))
       (assert (= (count m) 1))))
+
   (let [m (into cljs.core.PersistentHashMap.EMPTY ; make sure we're testing
                 (zipmap (range 100) (range 100))) ; the correct map type
         m (assoc m fixed-hash-foo 1 fixed-hash-bar 2)]
@@ -2392,6 +2408,7 @@
       (assert (= (get m fixed-hash-bar) 2))
       (assert (not (contains? m fixed-hash-foo)))
       (assert (= (count m) 98))))
+
   (let [m (into cljs.core.PersistentHashMap.EMPTY ; make sure we're testing
                 (zipmap (range 100) (range 100))) ; the correct map type
         m (transient m)


Fix typo in github repo stats widget

Fix typo in github repo stats widget

--- src/cljs/dashboard_clj/widgets/github_repo_stats.cljs
+++ src/cljs/dashboard_clj/widgets/github_repo_stats.cljs
@@ -8,24 +8,20 @@
   [:div {:class "github-repo-stats"}
    [:div.header {:style {:background  (:color options)}}
     [:img {:class "github-logo" :src "/images/github_mark.png"}]
-    [:h2 {:class "title" }(str "Hello: " (:repo-name w))]]
+    [:h2 {:class "title" } (:repo-name w)]]
    [:div#total-commits
     [:p {:class "subheading"} "Total commits"]
     [:h4 {:class "total-commits" :style {:background (:color options)}} (get-in @data [:data :total-commits])]]
-    [:table {:class "contributors"}
-     [:tbody
-      [:tr
-       [:th {:class "subheading" }"contributors"]]
-      (doall (for [contributor (get-in @data [:data :contributors])]
-               [:tr {:key contributor}
-                [:td (str contributor)]]))]]
-   [:div {:class "commit-chart" :style { :width "95%" :height "40%"}}
+   [:table {:class "contributors"}
+    [:tbody
+     [:tr
+      [:th {:class "subheading" }"contributors"]]
+     (doall (for [contributor (get-in @data [:data :contributors])]
+              [:tr {:key contributor}
+               [:td (str contributor)]]))]]
+   [:div {:class "commit-chart" :style { :width "95%" :height "40%"}}
     [charts/line-chart {:chart-options
                         {:title {:text text}
                          :xAxis {:categories (mapv first (get-in @data [:data :weekly-commit-breakdown]))}
                          :series [{:name "commits"
                                    :data (mapv second (get-in @data [:data :weekly-commit-breakdown]))}]}}]]])
-
-
-
-


GAWB-1930: fixed for realz this time

GAWB-1930: fixed for realz this time

--- src/cljs/main/broadfcui/page/billing/billing_management.cljs
+++ src/cljs/main/broadfcui/page/billing/billing_management.cljs
@@ -62,9 +62,8 @@

 (react/defc BillingProjectTable
   {:reload
-   (fn [{:keys [this refs after-update]}]
-     (react/call :load-data this)
-     (after-update #((@refs "table") :refresh-rows)))
+   (fn [{:keys [this]}]
+     (react/call :load-data this))
    :render
    (fn [{:keys [props state this]}]
      (cond
@@ -133,13 +132,14 @@
    (fn [{:keys [this]}]
      (react/call :load-data this))
    :load-data
-   (fn [{:keys [state]}]
+   (fn [{:keys [state refs after-update]}]
      (endpoints/get-billing-projects
       true
       (fn [err-text projects]
         (if err-text
           (swap! state assoc :error-message err-text)
-          (swap! state assoc :projects projects)))))
+          (swap! state assoc :projects projects)
+          (after-update #((@refs "table") :refresh-rows))))))
    :-handle-status-change
    (fn [{:keys [state refs after-update]} project-name new-status message]
      (let [project-index (utils/first-matching-index


Refactored creation of metadata results for performance improvement.

--- src/cmr/search/results_handlers/metadata_results_handler.clj
+++ src/cmr/search/results_handlers/metadata_results_handler.clj
@@ -52,17 +52,9 @@
   [context query elastic-results]
   (elastic-results->query-metadata-results context query elastic-results))

+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Search results handling
-
-(defn- remove-xml-processing-instructions
-  "Removes xml processing instructions from XML so it can be embedded in another XML document"
-  [xml]
-  (let [processing-regex #"<\?.*?\?>"
-        doctype-regex #"<!DOCTYPE.*?>"]
-    (-> xml
-        (str/replace processing-regex "")
-        (str/replace doctype-regex ""))))

 (defmulti metadata-item->result-string
   "Converts a search result + metadata into a string containing a single result for the metadata format."
@@ -72,28 +64,40 @@
 (defmethod metadata-item->result-string :granule
   [concept-type metadata-item]
   (let [{:keys [concept-id collection-concept-id revision-id metadata]} metadata-item]
-    (format "<result concept-id=\"%s\" collection-concept-id=\"%s\" revision-id=\"%s\">%s</result>"
-            concept-id
-            collection-concept-id
-            revision-id
-            (remove-xml-processing-instructions metadata))))
+    ["<result concept-id=\""
+     concept-id
+     "\" collection-concept-id=\""
+     collection-concept-id
+     "\" revision-id=\""
+     revision-id
+     "\">"
+     (cx/remove-xml-processing-instructions metadata)
+     "</result>"]))

 (defmethod metadata-item->result-string :collection
   [concept-type metadata-item]
   (let [{:keys [concept-id revision-id metadata]} metadata-item]
-    (format "<result concept-id=\"%s\" revision-id=\"%s\">%s</result>"
-            concept-id
-            revision-id
-            (remove-xml-processing-instructions metadata))))
+    ["<result concept-id=\""
+     concept-id
+     "\" revision-id=\""
+     revision-id
+     "\">"
+     (cx/remove-xml-processing-instructions metadata)
+     "</result>"]))

 (defn search-results->metadata-response
   [context query results]
   (let [{:keys [hits took items]} results
         {:keys [result-format pretty? concept-type]} query
-        result-strings (map (partial metadata-item->result-string concept-type) items)
-        response (format (str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
-                              "<results><hits>%d</hits><took>%d</took>%s</results>")
-                         hits took (str/join "" result-strings))]
+        result-strings (apply concat (map (partial metadata-item->result-string concept-type) items))
+        headers ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                 "<results><hits>"
+                 hits
+                 "</hits><took>"
+                 took
+                 "</took>"]
+        footers ["</results>"]
+        response (apply str (concat headers result-strings footers))]
     (if pretty?
       (let [parsed (x/parse-str response)
             ;; Fix for DIF emitting XML


remove commented out implementation of shuffle as it's already available in Clojure.core

--- src/overtone/helpers/chance.clj
+++ src/overtone/helpers/chance.clj
@@ -63,13 +63,6 @@
         n (if (> n 1) 1 n)]
     (< (rand) n)))

-
-;(defn shuffle
-;  "Shuffle a collection, returns a seq."
-;  [coll]
-;  (let [l (ArrayList. coll)]
-;    (Collections/shuffle l)
-                                        ;    (seq l)))
 (defn ranged-rand
   "Returns a random value within the specified range"
   [min max]


Add more macro examples

Add more macro examples

--- src/clojure/clojure_walkthrough/cjia/ch07_xx.clj
+++ src/clojure/clojure_walkthrough/cjia/ch07_xx.clj
@@ -74,3 +74,64 @@
           (do
             (println "Odd!")
             (println "Very odd!"))))
+
+(exhibits-oddity? 4) ; nil
+(exhibits-oddity? 3) ; REPL: "Odd!" and "Very odd!"
+
+(defmacro unless [test & exprs]
+  `(if (not ~test)
+     (do ~exprs)))
+
+(defmacro unless [test & exprs]
+  `(if (not ~test)
+     (do ~@exprs)))
+;
+(:import 'java.lang.System)
+(System/currentTimeMillis)
+
+(defmacro def-logged-fn [fn-name args & body]
+  `(defn ~fn-name ~args
+     (let [now# (System/currentTimeMillis)]
+       (println "[" now# "]Call to" (str (var ~fn-name)))
+     ~@body)))
+
+(macroexpand-1 '(def-logged-fn printname [name]
+                  (println "Hi" name))) ;; (clojure.core/defn printname [name] (clojure.core/let [clojure-walkthrough.cjia.ch07-xx/now (java.lang.System/currentTimeMillis)] (clojure.core/println "[" clojure-walkthrough.cjia.ch07-xx/now "]Call to" (clojure.core/str (var printname))) (println "Hi" name)))
+
+(def-logged-fn printname [name]
+  (println "Hi" name))
+
+(printname "Arun")
+
+;; 7.1.2: comment
+; (defmacro comment [& body])
+
+(defmacro declare [& names]
+  `(do
+     ~@(map #(list 'def %) names)))
+
+(macroexpand '(declare add multiply subtract divide)) ; (do (def add) (def multiply) (def subtract) (def divide))
+
+;; defonce
+(defmacro defonce [name expr]
+  `(let [v# (def ~name)]
+     (when-not (.hasRoot v#)
+       (def ~name ~expr))))
+
+;; and
+(defmacro and
+  ([] true)
+  ([x] x)
+  ([x & next]
+   `(let [and# ~x]
+      (if and# (and ~@next) and#))))
+
+(and 2)
+(and [true 3]) ; [true 3]
+(and [(+ 4 5) nil 9])
+(and) ; true
+
+(macroexpand '(and (even? x) (> x 50) (< x 500))) ; (let* [and__20455__auto__ (even? x)] (if and__20455__auto__ (clojure-walkthrough.cjia.ch07-xx/and (> x 50) (< x 500)) and__20455__auto__))
+
+;; time:
+


fix alpha11 issues (#114)

fix alpha11 issues (#114)

--- occi/java/jar/src/main/clojure/slipstream/credcache/voms_utils.clj
+++ occi/java/jar/src/main/clojure/slipstream/credcache/voms_utils.clj
@@ -109,8 +109,8 @@
   "Gets an attribute certificate from a VOMS server for the given VO,
    FQANs (roles), and targets."
   [cred vo {:keys [fqans targets]
-            :or   {:fqans   []
-                   :targets []}}]
+            :or   {fqans   []
+                   targets []}}]
   (let [lifetime (get-lifetime cred)
         service (voms-service)
         request (voms-request (name vo) fqans targets lifetime)]


CMR-5087 Adds paging to acl-fetcher's search-for-acls call. (#544)

--- acl-lib/src/cmr/acl/acl_fetcher.clj
+++ acl-lib/src/cmr/acl/acl_fetcher.clj
@@ -73,18 +73,39 @@
   [context]
   (:object-identity-types (cache/context->cache context acl-cache-key)))

+(defn- get-all-acls
+  "Calls acl search endpoint using object-identity-types. Pages through results as needed."
+  [context object-identity-types]
+  (let [page-size 2000
+        response (access-control/search-for-acls (assoc context :token (config/echo-system-token))
+                                                 {:identity-type (object-identity-types->identity-strings
+                                                                  object-identity-types)
+                                                  :include-full-acl true
+                                                  :page-size page-size})
+        total-pages (int (Math/ceil (/ (:hits response) page-size)))]
+    (if (> total-pages 1)
+      ;; Take the items from first page of the response from above,
+      ;; and concat each page after that in sequence.
+      (reduce (fn [all-items new-items]
+                (conj all-items new-items))
+              [response]
+              (for [page-num (range 2 (+ 1 total-pages))
+                    :let [response (access-control/search-for-acls (assoc context :token (config/echo-system-token))
+                                                                   {:identity-type (object-identity-types->identity-strings
+                                                                                object-identity-types)
+                                                                    :include-full-acl true
+                                                                    :page-size page-size
+                                                                    :page-num page-num})]]
+                response))
+      [response])))
+
 (defn- process-search-for-acls
-  "Calls acl search endpoint using converting object-identity-types
-   and processes response and formats it for get-acls"
+  "Processes response and formats it for get-all-acls"
   [context object-identity-types]
-  (map (comp :acl util/map-keys->kebab-case)
-       (get
-        (access-control/search-for-acls (assoc context :token (config/echo-system-token))
-                                        {:identity-type (object-identity-types->identity-strings
-                                                         object-identity-types)
-                                         :include-full-acl true
-                                         :page-size 2000})
-        :items)))
+  (->> (get-all-acls context object-identity-types)
+       (mapcat :items)
+       (map :acl)
+       (map util/map-keys->kebab-case)))

 (defn expire-consistent-cache-hashes
   "Forces the cached hash codes of an ACL consistent cache to expire so that subsequent requests for


screenbuffer

screenbuffer

--- clojure/src/dnd/showScreen.cljs
+++ clojure/src/dnd/showScreen.cljs
@@ -57,6 +57,24 @@
     (concat shortened-line (list (nth line (count shortened-line))))
     line))

+(defn put-block [buffer block]
+  (let [{:keys [x y solid inhabitants color visible]} block
+        has-inhabitant (boolean (seq inhabitants))
+        fgcolor (or (:color (first inhabitants)) [0 0 0])
+        [r g b] fgcolor
+        bgcolor (color-to-vec (.rgb COLOR color))
+        [bgR bgG bgB] bgcolor
+        char    (if-not visible
+                  " "
+                  (if has-inhabitant
+                    (:char (first inhabitants))
+                    (if solid "▒" " ")))]
+    (.put buffer
+          #js {:x x :y y
+               :attr #js {:r r :g g :b b :bgR bgR :bgG bgG :bgB bgB}}
+          char)))
+
+
 (defn draw-block [term block]
   (let [{:keys [x y solid inhabitants color visible]} block
         has-inhabitant (boolean (seq inhabitants))
@@ -103,33 +121,30 @@
     (map #(if (block-not-in-coords %) (dim-block %) (lit-block %)) flattened-level)
     ))

+
 (defn show-screen [term level character]
-  ;(defn callback [error] (when error (println error)))
-  ;(.drawImage term
-  ;"http://www.ontariotrails.on.ca/assets/images/mastheads-all/cheltenham2.jpg"
-  ;#js {:shrink #js {:width 100 :height 100}}
-  ;callback
-  ;)
-
-  ;; (def buffer ((.. terminal -ScreenBuffer -create) #js {:dst term :width 20 :height 10}))
-  ;; (.put buffer
-  ;;       #js {:x 0 :y 2 :attr #js {:color "green" :bgColor "black"}}
-  ;;       "Pizza is Forever")
-  ;; (.draw buffer)
-
+  (defonce buffer ((.. terminal -ScreenBufferHD -create)
+                   #js {
+                        :dst term
+                        :x 0
+                        :y 0
+                        :width width
+                        :height height
+                        }))

   (->> level
        (viewable-coords character)
        (dimmed-blocks level)
-       (run! #(draw-block term %)))
+       (run! #(put-block buffer %)))
+
+  (.draw buffer #js {:delta true})

   (.color256    term 7)
   (.bgColor256  term 0)
   (.moveTo term (+ 2 width) 1 (str "HP: " (:hp character)))
   (.moveTo term (+ 2 width) 2 (str "INV: " (count (:inventory character))))
   (.moveTo term 0 (inc height) "got some text down below\n\n")
-  (.moveTo term 0 (+ 2 height))
-  (.moveTo term 0 (+ 15 height))
+  (.moveTo term 0 (+ 10 height))

   )


shorten descs to keep searches + listings reasonable, does cause premature endings

--- src/semtag_web/client/view.cljs
+++ src/semtag_web/client/view.cljs
@@ -19,7 +19,10 @@

 ;;; td formatters
 (defn- td-url [url]
-  [:td [:a {:href url} (shorten-to url 40)]])
+  [:td [:a {:href url} (shorten-to url 30)]])
+
+(defn- td-desc [desc]
+  [:td {:title desc} (shorten-to desc 30)])

 (defn- td-tags [tags]
   [:td
@@ -58,7 +61,7 @@
   [:tr
    (td-model (:namespace row))
    (td-url (:url row))
-   [:td (:desc row)]
+   (td-desc (:desc row))
    (td-tags (:tags row))])

 (defpartial models-row [row & fields]
@@ -73,7 +76,7 @@
   [:tr
    [:td (if (seq (:name row)) (link-tag (:name row)) (:name row))]
    (td-url (:url row))
-   [:td (:desc row)]
+   (td-desc (:desc row))
    (td-tags (:tags row))])

 (defpartial tag-row [row & fields]


Remove chat from activity center after opening from public chat (#12815)

--- src/status_im/contact/chat.cljs
+++ src/status_im/contact/chat.cljs
@@ -3,7 +3,8 @@
             [status-im.navigation :as navigation]
             [status-im.utils.fx :as fx]
             [status-im.chat.models :as chat]
-            [status-im.contact.core :as contact]))
+            [status-im.contact.core :as contact]
+            [status-im.notifications-center.core :as notification-center]))

 (fx/defn send-message-pressed
   {:events       [:contact.ui/send-message-pressed]
@@ -11,6 +12,7 @@
   [cofx {:keys [public-key]}]
   (fx/merge cofx
             {:dispatch-later [{:ms 1000 :dispatch [:chat.ui/start-chat public-key]}]}
+            (notification-center/accept-all-activity-center-notifications-from-chat public-key)
             (navigation/pop-to-root-tab :chat-stack)))

 (fx/defn contact-code-submitted


fix issue with no deref-ing boot atom

fix issue with no deref-ing boot atom

--- src/tailrecursion/boot/core.clj
+++ src/tailrecursion/boot/core.clj
@@ -76,12 +76,12 @@

 ;; BOOT API ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

-(defn tmpfile?  [this f]            (dotmp this (tmp/tmpfile? f)) this)
-(defn mk!       [this key & [name]] (dotmp this (tmp/mk! key name)))
-(defn mkdir!    [this key & [name]] (dotmp this (tmp/mkdir! key name)))
-(defn unmk!     [this key]          (dotmp this (tmp/unmk! key)) this)
-(defn add-sync! [this dst & [srcs]] (dotmp this (tmp/add-sync! dst srcs)) this)
-(defn sync!     [this]              (dotmp this (tmp/sync!)) this)
+(defn tmpfile?  [this f]            (dotmp @this (tmp/tmpfile? f)))
+(defn mk!       [this key & [name]] (dotmp @this (tmp/mk! key name)))
+(defn mkdir!    [this key & [name]] (dotmp @this (tmp/mkdir! key name)))
+(defn unmk!     [this key]          (dotmp @this (tmp/unmk! key)) this)
+(defn add-sync! [this dst & [srcs]] (dotmp @this (tmp/add-sync! dst srcs)) this)
+(defn sync!     [this]              (dotmp @this (tmp/sync!)) this)

 (defmacro deftask [name & args]
   `(defn ~(with-meta name {::task true}) ~@args))


Added field for selecting an output file.

--- src/fm/simrunner/gui/view.clj
+++ src/fm/simrunner/gui/view.clj
@@ -22,6 +22,9 @@
 (def ^{:private true} input-specs [{:id         :input-file
                                     :type       :select
                                     :label-text "Input File"}
+                                   {:id         :output-file
+                                    :type       :select
+                                    :label-text "Output File"}
                                    {:id         :eps
                                     :type       :text
                                     :label-text "EPS"}


no need to start a background thread if you publish only

--- clients/clojure/src/samsara/client.clj
+++ clients/clojure/src/samsara/client.clj
@@ -19,7 +19,10 @@
    ;; :url  - REQUIRED

    ;; the identifier of the source of these events
-   ;; :sourceId  - REQUIRED
+   ;; :sourceId  - REQUIRED only for record-event
+
+   ;; whether to start the publishing thread.
+   :start-publishing-thread true

    ;; how often should the events being sent to samsara
    :publish-interval 60               ;seconds
@@ -100,19 +103,22 @@
           :sourceId (:sourceId *config*)}
          event))

+
 (defn- prepare-event [event]
   "Enriches and validates the event and throws an Exception if validation fails."
   (let [e (enrich-event event)]
     (validate-event e)
     e))

+
 (defn- send-events [events]
   "Send events to samsara api"
-  (let [{:keys [status error] :as resp} @(http/post (str (:url *config*) "/events")
-                                                    {:timeout (:send-timeout-ms *config*)
-                                                     :headers {"Content-Type" "application/json"
-                                                               "X-Samsara-publishedTimestamp" (str (System/currentTimeMillis))}
-                                                     :body (to-json events)})]
+  (let [{:keys [status error] :as resp}
+        @(http/post (str (:url *config*) "/events")
+                    {:timeout (:send-timeout-ms *config*)
+                     :headers {"Content-Type" "application/json"
+                               "X-Samsara-publishedTimestamp" (str (System/currentTimeMillis))}
+                     :body (to-json events)})]
     ;;Throw the exception from HttpKit to the caller.
     (when error
       (log/error "Failed to connect to samsara with error: " error)
@@ -141,16 +147,17 @@
       (log/info "Nothing to send."))))

-(defn- init-timer! [{:keys [publish-interval] :as config}]
-  (let [times (periodic-seq (t/now) (-> publish-interval t/seconds))]
-    (log/info "Starting job to flush events.")
-    (let [chimes (chime-ch times {:ch (a/chan (a/sliding-buffer 1))})]
-      (thread
-        (loop [] ;; TODO: add a way to stop the timer.
-          (when-let [time (<!! chimes)]
-            (log/info "Flushing buffer now.")
-            (flush-buffer)
-            (recur)))))))
+(defn- init-timer! [{:keys [publish-interval start-publishing-thread] :as config}]
+  (when start-publishing-thread
+    (let [times (periodic-seq (t/now) (-> publish-interval t/seconds))]
+      (log/info "Starting job to flush events.")
+      (let [chimes (chime-ch times {:ch (a/chan (a/sliding-buffer 1))})]
+        (thread
+          (loop [] ;; TODO: add a way to stop the timer.
+            (when-let [time (<!! chimes)]
+              (log/info "Flushing buffer now.")
+              (flush-buffer)
+              (recur))))))))

 (defn init! [config]


delaney.clj: assert connectness of symbol for (invariant) and (canonical)

--- clojure/org/gavrog/clojure/delaney.clj
+++ clojure/org/gavrog/clojure/delaney.clj
@@ -81,6 +81,18 @@
            ())))
       (seq seeds) (doall (concat stacks queues)) #{})))

+(defn orbit-reps
+  ([ds indices seeds]
+    (for [[D i] (pretty-traversal ds indices seeds) :when (= :root i)] D))
+  ([ds indices]
+    (orbit-reps ds indices (elements ds))))
+
+(defn orbit [ds indices seed]
+  (distinct (for [[D i] (pretty-traversal ds indices [seed])] D)))
+
+(defn connected? [ds]
+  (> 2 (count (orbit-reps ds (indices ds)))))
+
 (defn- protocol [ds indices traversal]
   (let [imap (zipmap indices (range (count indices)))
         ipairs (map vector indices (rest indices))
@@ -100,20 +112,13 @@
     (step traversal {} 1)))

 (defn invariant [ds]
-  (when (pos? (size ds))
-    (let [idcs (indices ds)]
-      (reduce lexicographically-smallest
-              (for [D (elements ds)]
-                (protocol ds idcs (pretty-traversal ds idcs [D])))))))
-
-(defn orbit-reps
-  ([ds indices seeds]
-    (for [[D i] (pretty-traversal ds indices seeds) :when (= :root i)] D))
-  ([ds indices]
-    (orbit-reps ds indices (elements ds))))
-
-(defn orbit [ds indices seed]
-  (distinct (for [[D i] (pretty-traversal ds indices [seed])] D)))
+  (do
+    (assert (connected? ds) "Symbol must be connected")
+    (when (pos? (size ds))
+      (let [idcs (indices ds)]
+        (reduce lexicographically-smallest
+                (for [D (elements ds)]
+                  (protocol ds idcs (pretty-traversal ds idcs [D]))))))))

 (defn walk [ds D & idxs]
   "Returns the result of applying the D-symbol operators on ds with the
@@ -490,7 +495,10 @@
                 (str "12:1 3 4 6 8 10 12,2 3 5 7 8 9 11 12,4 9 10 5 6 12 11:"
                      "3 5 4,5 4 3")
                 (str "6 3:1 2 3 4 6,1 2 3 5 6,2 4 5 6,1 3 4 5 6:"
-                     "4 3 3 3,4 3 3,4 4 4")))
+                     "4 3 3 3,4 3 3,4 4 4"))
+           (is (thrown-with-msg?
+                 AssertionError #"Symbol must be connected"
+                 (invariant (dsymbol "2")))))

   (testing "canonical-forms"
            (are [x] (let [ds (dsymbol x)]
@@ -504,4 +512,7 @@
                 (str "12:1 3 4 6 8 10 12,2 3 5 7 8 9 11 12,4 9 10 5 6 12 11:"
                      "3 5 4,5 4 3")
                 (str "6 3:1 2 3 4 6,1 2 3 5 6,2 4 5 6,1 3 4 5 6:"
-                     "4 3 3 3,4 3 3,4 4 4"))))
+                     "4 3 3 3,4 3 3,4 4 4"))
+           (is (thrown-with-msg?
+                 AssertionError #"Symbol must be connected"
+                 (canonical (dsymbol "2"))))))


delaney.clj: more changes in (traversal) and (protocol)

--- clojure/org/gavrog/clojure/delaney.clj
+++ clojure/org/gavrog/clojure/delaney.clj
@@ -77,15 +77,17 @@
            (seq todo-for-i)
            (let [D (first todo-for-i)
                  Di (s ds i D)
+                 head [D i Di]
                  todo (if Di (vec (push-neighbors todo Di)) todo)
                  seen (conj seen (as-root Di) [D i] [Di i])]
-             (lazy-seq (cons [D i Di] (collect seeds-left todo seen))))
+             (lazy-seq (cons head (collect seeds-left todo seen))))
            (seq seeds-left)
            (let [D (first seeds-left)
+                 head (as-root D)
+                 seeds-left (rest seeds-left)
                  todo (vec (push-neighbors todo D))
                  seen (conj seen (as-root D))]
-             (lazy-seq
-               (cons (as-root D) (collect (rest seeds-left) todo seen))))
+             (lazy-seq (cons head (collect seeds-left todo seen))))
            :else
            ())))
       (seq seeds) (vec (concat stacks queues)) #{})))
@@ -133,13 +135,14 @@
                  (if (nil? D)
                    (recur (rest xs) emap n)
                    (let [[Ei E] (sort [(emap Di) (or (emap D) n)])
-                         new? (= E n)
-                         emap (if new? (assoc emap D n) emap)
-                         n (if new? (inc n) n)
-                         head (if (= i :root) [-1] [(imap i) Ei])
-                         tail (if new? (spins D) [])
-                         prefix (vec (concat head [E] tail))]
-                     (lazy-seq (concat prefix (step (rest xs) emap n)))))))]
+                         head (if (= i :root) [-1 E] [(imap i) Ei E])
+                         xs (rest xs)]
+                     (if (not= E n)
+                       (lazy-seq (concat head (step xs emap n)))
+                       (let [head (vec (concat head (spins D)))
+                             emap (assoc emap D n)
+                             n (inc n)]
+                         (lazy-seq (concat head (step xs emap n)))))))))]
     (step trav {} 1)))

 (defn invariant


Added a test case.

Added a test case.

--- test/cmr/system_int_test/search/granule_search_index_name_test.clj
+++ test/cmr/system_int_test/search/granule_search_index_name_test.clj
@@ -55,6 +55,10 @@
             [gran1]
             (search/find-refs :granule {:short-name "ShortOne"
                                         "granule-ur[]" ["Granule1" "Granule4"]}))))
+    (testing "search for granules in multiple collection index with collection identifier."
+      (is (d/refs-match?
+            [gran1 gran2 gran3 gran4]
+            (search/find-refs :granule {"short-name[]" ["ShortOne" "ShortTwo"]}))))
     (testing "search for granules in small_collections index."
       (is (d/refs-match?
             [gran5]


revert changes from 4a65349dabb16b0362a90479fe49c2fd14325f1c where we attempted to put dimensions at the front of the column ordering but we failed and it created other bugs.

--- src/metabase/driver/generic_sql/query_processor/annotate.clj
+++ src/metabase/driver/generic_sql/query_processor/annotate.clj
@@ -28,30 +28,20 @@
   "Get an ordered seqences of column names for the results.
    If a `fields` clause was specified in the Query Dict, we want to return results in the same order."
   [query results]
-  (let [ids->names (fn [field-ids]
-                     (when-not (or (empty? field-ids)
-                                 (= field-ids [nil]))
-                       (let [field-id->name (->> (sel :many [Field :id :name :base_type]
-                                                   :id [in field-ids])     ; Fetch names of fields from `fields` clause
-                                              (map (fn [{:keys [id name base_type]}]  ; build map of field-id -> field-name
-                                                     ;; this feels hacky, but we can't reuse `(castify)` because we don't want a korma form here :(
-                                                     (if (contains? #{:DateField :DateTimeField} base_type)
-                                                       {id (keyword (format "CAST(%s AS DATE)" name))}
-                                                       {id (keyword name)})))
-                                              (into {}))]
-                         (map field-id->name field-ids))))                  ; now get names in same order as the IDs
-        field-ids (-> query :query :fields)
-        fields-clause-fields (ids->names field-ids)
-        ;; note that we are protecting against the possibility that a dimension already exists in :fields
-        dimension-ids (filter #(not (contains? (set field-ids) %)) (-> query :query :breakout))
-        dimensions-clause-fields (ids->names dimension-ids)
+  (let [field-ids (-> query :query :fields)
+        fields-clause-fields (when-not (or (empty? field-ids)
+                                         (= field-ids [nil]))
+                               (let [field-id->name (->> (sel :many [Field :id :name]
+                                                           :id [in field-ids])     ; Fetch names of fields from `fields` clause
+                                                      (map (fn [{:keys [id name]}]  ; build map of field-id -> field-name
+                                                             {id (keyword name)}))
+                                                      (into {}))]
+                                 (map field-id->name field-ids)))                     ; now get names in same order as the IDs
         other-fields (->> (first results)
-                          keys                                                        ; Get the names of any other fields that were returned (i.e., `sum`)
-                          (filter #(not (contains? (clojure.set/union
-                                                     (set fields-clause-fields)
-                                                     (set dimensions-clause-fields)) %))))]
-    (->> (concat fields-clause-fields dimensions-clause-fields other-fields)                                   ; Return a combined vector. Convert them to strs, otherwise korma
-         (map name))))                                                                ; will qualify them like `"METABASE_FIELD"."FOLLOWERS_COUNT"
+                       keys                                                        ; Get the names of any other fields that were returned (i.e., `sum`)
+                       (filter #(not (contains? (set fields-clause-fields) %))))]
+    (->> (concat fields-clause-fields other-fields)                                   ; Return a combined vector. Convert them to strs, otherwise korma
+      (map name))))                                                                ; will qualify them like `"METABASE_FIELD"."FOLLOWERS_COUNT"

 (defn- uncastify
   "Remove CAST statements from a column name if needed.


Diet: Removed UI event loop

Diet: Removed UI event loop

Now when we have event loops we just call an event handler directly

--- src/webapp/framework/client/components/system_container.cljs
+++ src/webapp/framework/client/components/system_container.cljs
@@ -70,57 +70,6 @@

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-( go (loop []
-      (let [ui-event (<! ui-chan)]
-        (do
-          ;(. js/console log (pr-str "****CALLED UI EVENT: "  (:type (:watch ui-event)) ":" (:path (:watch ui-event))  ))
-          ;(. js/console log (pr-str "****FN: "  (:fn (:watch ui-event)) ))
-          ;(. js/console log (pr-str "****extra: "  (:extra ui-event)) )
-          ;(. js/console log (pr-str "****app: "  app) )
-          ;(. js/console log (pr-str "****Om : "  @global-om-state) )
-          ;(. js/console log (pr-str "****App : "  @app-state) )
-          (if @global-om-state
-            (apply (:fn (:watch ui-event)) (conj [@global-om-state] (:extra ui-event)) )
-            ;(. js/console log (pr-str "No globAL OM STATE" ) )
-            )
-          ;(swap! app-state assoc :touch-id (rand-int 99999))
-          (recur)))))
-
-
-
-
-
-
-
-
-
-
-
-
 (defn main-view [app owner]
   (reify
     ;---------------------------------------------------------
@@ -148,19 +97,7 @@
                   (dorun (for [init-state-fn  @init-state-fns]
                            (do
                              (init-state-fn)
-                             )))
-
-
-
-
-                    ))
-
-
-
-
-
-
-
+                             )))))


super robust code

super robust code

--- test/epicea/poly/core_test.clj
+++ test/epicea/poly/core_test.clj
@@ -114,3 +114,8 @@
   (is (nil? (f10 [3 4 5]))))

 (def f11 (compile-arg-parser (compile-arglist-exprs expr11)))
+
+(deftest compile-args-test2
+  (is (= [3 4 [5]] (f11 [3 4 5])))
+  (is (= [3 4 [5 6]] (f11 [3 4 5 6])))
+  (is (nil? (f11 [3 4 :a]))))


Add test for special unknown type exception.

--- test/isla/test/interpreter.clj
+++ test/isla/test/interpreter.clj
@@ -36,11 +36,24 @@
    {:type (defrecord Person [age name])
     :defaults [0 ""]}})

+;; type assignment
+
 (deftest test-type-assignment
   (let [result (interpret (parse "isla is a person")
                           (library/get-initial-env extra-types))]
     (is (= (get (:ctx result) "isla")
            (new isla.test.interpreter.Person 0 "")))))
+
+
+(deftest test-unknown-type-causes-exception
+  (try
+    (interpret (parse "isla is a giraffe")
+               (library/get-initial-env extra-types))
+    (is false) ;; should not get called
+    (catch Exception e
+      (is (= (.getMessage e) "I do not know what a giraffe is.")))))
+
+;; slot assignment

 (deftest test-slot-assignment
   (let [result (interpret (parse "isla is a person\nisla age is 1")


coerce original transaction date

coerce original transaction date

--- src/clj_money/models/transactions.clj
+++ src/clj_money/models/transactions.clj
@@ -154,7 +154,8 @@
 (def ^:private coercion-rules
   [(coercion/rule :uuid [:id])
    (coercion/rule :integer [:entity-id])
-   (coercion/rule :local-date [:transaction-date])])
+   (coercion/rule :local-date [:transaction-date])
+   (coercion/rule :local-date [:original-transaction-date])])

 (defn- before-validation
   "Performs operations required before validation"


Don't re-paint preview pixels if they were already painting in current stroke

--- src/cljs/goya/components/drawing.cljs
+++ src/cljs/goya/components/drawing.cljs
@@ -304,16 +304,19 @@
         flat-coords (vec (map #(geometry/flatten-point-to-index % doc-width) coords))]
     (reset! visited-pixels (vec (concat @visited-pixels flat-coords)))))

-(defn paint-pixel [coord pixel-size]
+(defn paint-pixel [coord pixel-size doc-canvas-width]
   (let [[x y] coord
+        flat-coord (geometry/flatten-point-to-index coord doc-canvas-width)
+        already-drew-point (some #(= flat-coord %) @visited-pixels)
         preview-context (.getContext preview-canvas-elem "2d")]
-    (.fillRect preview-context
-               (* x pixel-size)
-               (* y pixel-size)
-               pixel-size pixel-size)))
-
-(defn paint-pixels-for-pencil-tool [coords pixel-size]
-  (dorun (map #(paint-pixel % pixel-size) coords)))
+    (when-not already-drew-point
+      (.fillRect preview-context
+                 (* x pixel-size)
+                 (* y pixel-size)
+                 pixel-size pixel-size))))
+
+(defn paint-pixels-for-pencil-tool [coords pixel-size doc-canvas-width]
+  (dorun (map #(paint-pixel % pixel-size doc-canvas-width) coords)))

 ;; =============================================================================
@@ -340,7 +343,7 @@
   (when (= paint-tool :brush)
     (let [active-pixels-since-last-event (bresenham/bresenham doc-x doc-y last-x last-y)]
       (set! (.-fillStyle preview-context) preview-color)
-      (paint-pixels-for-pencil-tool active-pixels-since-last-event pixel-size)
+      (paint-pixels-for-pencil-tool active-pixels-since-last-event pixel-size doc-canvas-width)
       (visit-pixels-for-line-segment doc-x doc-y last-x last-y doc-canvas-width)
       (reset! guistate/transient-state
               (assoc @guistate/transient-state :last-mouse-pos [doc-x doc-y]))))
@@ -349,7 +352,7 @@
     (clear-preview-canvas)
     (set! (.-fillStyle preview-context) preview-color)
     (let [line-coords (bresenham/bresenham mouse-down-x mouse-down-y doc-x doc-y)]
-      (paint-pixels-for-pencil-tool line-coords pixel-size)))
+      (paint-pixels-for-pencil-tool line-coords pixel-size doc-canvas-width)))

   (when (= paint-tool :box)
     (set! (.-width preview-canvas-elem) (.-width preview-canvas-elem))


Extract function draw-selection to ensure clipboard contents are drawn on paste

--- src/cljs/goya/components/drawing.cljs
+++ src/cljs/goya/components/drawing.cljs
@@ -200,9 +200,9 @@
 (defn blit-sub-image [app sub-image xoff yoff]
   (let [canvas preview-canvas-elem
         context (.getContext canvas "2d")
-        width (get-in @app [:main-app :canvas-width])
-        height (get-in @app [:main-app :canvas-height])
-        zoom-factor (get-in @app [:zoom-factor])
+        width (get-in app [:main-app :canvas-width])
+        height (get-in app [:main-app :canvas-height])
+        zoom-factor (get-in app [:zoom-factor])
         pixel-size zoom-factor
         sub-image-pixel-count (count (:image-data sub-image))]
     (dotimes [x sub-image-pixel-count]
@@ -258,6 +258,13 @@
          (* (- x2 x1) zoom-factor)
          (* (- y2 y1) zoom-factor))
      (.stroke preview-context)))
+
+
+(defn draw-selection [app owner]
+   (let [preview-context (.getContext preview-canvas-elem "2d")
+         [x1 y1 x2 y2] (om/get-state owner :selection)
+         selection-image (om/get-state owner :selection-image)]
+      (blit-sub-image app selection-image x1 y1)))

 ;; =============================================================================
@@ -351,7 +358,7 @@
              (* y1 zoom-factor)
              (* (- x2 x1) zoom-factor)
              (* (- y2 y1) zoom-factor))
-          (blit-sub-image app (om/get-state owner :selection-image) blit-x blit-y)))))))
+          (blit-sub-image @app (om/get-state owner :selection-image) blit-x blit-y)))))))

 ;; =============================================================================
@@ -456,9 +463,9 @@

     om/IDidUpdate
       (did-update [_ _ _]
-          (clear-preview-canvas)
-          (when (= (get-in app [:tools :paint-tool]) :selection)
-            (draw-selection-outline app owner)))
+        (when (= (get-in app [:tools :paint-tool]) :selection)
+          (draw-selection app owner)
+          (draw-selection-outline app owner)))

     om/IWillMount
     (will-mount [_]


Replace anonymous functions with partial where possible.

--- project/analyze-data/src/analyze_data/corpus_to_tf_idf.clj
+++ project/analyze-data/src/analyze_data/corpus_to_tf_idf.clj
@@ -11,7 +11,7 @@
   (let [csv-file (csv/read-csv reader)
         header-row (first csv-file)
         data (rest csv-file)]
-    (map #(zipmap header-row %) data)))
+    (map (partial zipmap header-row) data)))

 (defn write-sequence!
   "Write each item in sequence s as a line of edn to file-path. Uses doseq
@@ -47,7 +47,7 @@
         document-texts (map #(% "item-text") corpus)
         tf-idf-corpus (tf-idf (map to-terms document-texts))
         header-row (cons "item-name" (first tf-idf-corpus))
-        data (map #(cons %1 %2) document-names (rest tf-idf-corpus))]
+        data (map (partial cons) document-names (rest tf-idf-corpus))]
         (cons header-row data)))

 (defn csv-corpus-to-tf-idf-data!


STORM-1995: close input stream and other tweaks to downloadChunk

--- storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
+++ storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
@@ -1793,16 +1793,16 @@
         (.mark nimbus:num-downloadChunk-calls)
         (check-authorization! nimbus nil nil "fileDownload")
         (let [downloaders (:downloaders nimbus)
-              ^BufferFileInputStream is (.get downloaders id)]
+              ^BufferInputStream is (.get downloaders id)]
           (when-not is
             (throw (RuntimeException.
-                    "Could not find input stream for that id")))
+                    "Could not find input stream for id " id)))
           (let [ret (.read is)]
             (.put downloaders id is)
             (when (empty? ret)
+              (.close is)
               (.remove downloaders id))
-            (ByteBuffer/wrap ret)
-            )))
+            (ByteBuffer/wrap ret))))

       (^String getNimbusConf [this]
         (.mark nimbus:num-getNimbusConf-calls)


fix bug in snap-image

fix bug in snap-image

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -287,9 +287,7 @@
       (doall (map (partial await-for 10000) (vals device-agents))))
     (do
       (doseq [[dev action] action-map]
-        ;(action) (wait-for-device dev)
-        (device-best-effort dev action)
-        ))))
+        (device-best-effort dev action)))))

 (defn run-autofocus []
   (.. gui getAutofocusManager getDevice fullFocus)
@@ -298,11 +296,11 @@

 (defn snap-image [open-before close-after]
   (with-core-setting [getAutoShutter setAutoShutter false]
-    (if open-before
+    (when open-before
       (core setShutterOpen true)
       (wait-for-device (core getShutterDevice)))
     (core snapImage)
-    (if close-after
+    (when close-after
       (core setShutterOpen false))
       (wait-for-device (core getShutterDevice))))


take out day of week

take out day of week

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -74,7 +74,7 @@

 ;; mm utils

-(def iso8601modified (SimpleDateFormat. "yyyy-MM-dd E HH:mm:ss Z"))
+(def iso8601modified (SimpleDateFormat. "yyyy-MM-dd HH:mm:ss Z"))

 (defn get-current-time-str []
   (. iso8601modified format (Date.)))


add camera bit depth to image metadata

add camera bit depth to image metadata

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

--- acqEngine/src/org/micromanager/acq_engine.clj
+++ acqEngine/src/org/micromanager/acq_engine.clj
@@ -35,6 +35,7 @@
            [org.json JSONObject JSONArray]
            [java.util Date UUID]
            [java.text SimpleDateFormat]
+           [javax.swing SwingUtilities]
            [ij ImagePlus])
    (:gen-class
      :name org.micromanager.AcqEngine
@@ -154,6 +155,7 @@
       {
        "AxisPositions" (when-let [axes (get-in event [:position :axes])] (JSONObject. axes))
        "Binning" (core getProperty (core getCameraDevice) "Binning")
+       "CameraBitDepth" (core getImageBitDepth)
        "Channel" (get-in event [:channel :name])
        "ChannelIndex" (:channel-index event)
        "ElapsedTime-ms" (if (state :start-time) (- (clock-ms) (state :start-time)) 0)
@@ -529,6 +531,7 @@

 (def live-mode-running (ref false))

+
 (defn enable-live-mode [^Boolean on]
       (if on
         (let [event (create-basic-event)
@@ -536,12 +539,11 @@
           (dosync (ref-set live-mode-running true))
           (core startContinuousSequenceAcquisition 0)
           (.start (Thread.
-                    #(do
-                       (while @live-mode-running
-                         (let [img (annotate-image (core getLastImage) event state)]
-                           (reset-snap-window img)
-                             (show-image @snap-window img)))
-                       (core stopSequenceAcquisition)))))
+                    #(do (while @live-mode-running
+                           (let [img (annotate-image (core getLastImage) event state)]
+                              (reset-snap-window img)
+                              (show-image @snap-window img)))
+                         (core stopSequenceAcquisition)))))
         (dosync (ref-set live-mode-running false))))

 ;; java interop


Force travis build

Force travis build

--- backend/src/akvo/lumen/lib/import/flow_v3.clj
+++ backend/src/akvo/lumen/lib/import/flow_v3.clj
@@ -8,6 +8,7 @@
             [akvo.lumen.lib.import.flow-common :as flow-common]
             [akvo.lumen.lib.import.flow-v2 :as v2])
   (:import [java.time Instant]))
+

 (defn question-type->lumen-type
   [question]


[#2384] Only load-auth-data if match-by-template-and-method

--- backend/src/akvo/lumen/lib/auth.clj
+++ backend/src/akvo/lumen/lib/auth.clj
@@ -180,22 +180,23 @@
   [tenant-manager flow-api collector]
   (fn [handler]
     (fn [{:keys [jwt-claims tenant] :as request}]
-      (let [tenant-conn    (p/connection tenant-manager tenant)
-            dss            (db.dataset/all-datasets tenant-conn)
-            rasters        (mapv :id (db.raster/all-rasters tenant-conn))
-            auth-uuid-tree (if (and (match-by-jwt-family-name? request)
-                                    (match-by-template-and-method? auth-calls request))
-                             (load-auth-data dss rasters tenant-conn flow-api request collector tenant)
-                             (do
-                               (future
-                                 (load-auth-data dss rasters tenant-conn flow-api request collector tenant))
-                               {:rasters             rasters
-                                :auth-datasets       (mapv :id dss)
-                                :auth-visualisations (mapv :id (db.visualisation/all-visualisations-ids tenant-conn))
-                                :auth-dashboards     (mapv :id (db.dashboard/all-dashboards-ids tenant-conn))
-                                :auth-collections    (mapv :id (db.collection/all-collections-ids tenant-conn))}))]
-        (handler (assoc request
-                        :auth-service (new-auth-service auth-uuid-tree)))))))
+      (if-not (match-by-template-and-method? auth-calls request)
+        (handler request)
+        (let [tenant-conn    (p/connection tenant-manager tenant)
+              dss            (db.dataset/all-datasets tenant-conn)
+              rasters        (mapv :id (db.raster/all-rasters tenant-conn))
+              auth-uuid-tree (if (match-by-jwt-family-name? request)
+                               (load-auth-data dss rasters tenant-conn flow-api request collector tenant)
+                               (do
+                                 (future
+                                   (load-auth-data dss rasters tenant-conn flow-api request collector tenant))
+                                 {:rasters             rasters
+                                  :auth-datasets       (mapv :id dss)
+                                  :auth-visualisations (mapv :id (db.visualisation/all-visualisations-ids tenant-conn))
+                                  :auth-dashboards     (mapv :id (db.dashboard/all-dashboards-ids tenant-conn))
+                                  :auth-collections    (mapv :id (db.collection/all-collections-ids tenant-conn))}))]
+          (handler (assoc request
+                          :auth-service (new-auth-service auth-uuid-tree))))))))

 (defmethod ig/init-key :akvo.lumen.lib.auth/wrap-auth-datasets  [_ {:keys [tenant-manager flow-api monitoring] :as opts}]
   (wrap-auth-datasets tenant-manager flow-api (:collector monitoring)))


new funcs

new funcs


Fixed missing import

Fixed missing import

--- src/main/clojure/vimclojure/nails.clj
+++ src/main/clojure/vimclojure/nails.clj
@@ -26,6 +26,7 @@
                  [util :as util]
                  [backend :as backend]))
   (:import
+     java.io.BufferedReader
      com.martiansoftware.nailgun.NGContext))

 (defmacro defnail


Convert test fixture to use component.

Convert test fixture to use component.

--- test/clj/re_recipes/db_test.clj
+++ test/clj/re_recipes/db_test.clj
@@ -21,14 +21,13 @@
    })

 (defn connect-apply-schema-create-dbs [f]
-  (d/create-database test-uri)
-  (let [conn (d/connect test-uri)]
-    @(d/transact conn db/schema)
+  (let [db (component/start (db/new-db test-uri))
+        conn (:db db)]
     (def empty-db (d/db conn))
     (def test-db (speculate empty-db db/test-data))
-    (def two-recipes-db (speculate test-db (db/add-recipe-tx test-recipe))))
-  (f)
-  (d/delete-database test-uri))
+    (def two-recipes-db (speculate test-db (db/add-recipe-tx test-recipe)))
+    (f)
+    (component/stop db)))

 (use-fixtures :once connect-apply-schema-create-dbs)


Add newline

Add newline

--- test/simple_check/core_test.clj
+++ test/simple_check/core_test.clj
@@ -236,4 +236,4 @@
                        [v (gen/vector gen/int 3 10)]
                        (let [c (count v)]
                          (and (<= c 10)
-                              (>= c 3)))))))))+                              (>= c 3)))))))))


♻ Increase timeout for refreshing projections in tests

Why:
- It timed out once, probably due to the computer experiencing a hiccup

--- test/territory_bro/api_test.clj
+++ test/territory_bro/api_test.clj
@@ -67,6 +67,10 @@
           (str "Unexpected response " response))
   response)

+(defn refresh-projections! []
+  (projections/refresh-async!)
+  (projections/await-refreshed (Duration/ofSeconds 10)))
+

 ;;;; API Helpers

@@ -125,8 +129,7 @@
                             :command/system "test"
                             :congregation/id cong-id
                             :congregation/name name}))
-    (projections/refresh-async!)
-    (projections/await-refreshed (Duration/ofSeconds 1))
+    (refresh-projections!)
     cong-id))

 (defn revoke-access-from-all! [cong-id]
@@ -141,8 +144,7 @@
                               :congregation/id cong-id
                               :user/id user-id
                               :permission/ids []})))
-    (projections/refresh-async!)
-    (projections/await-refreshed (Duration/ofSeconds 1))))
+    (refresh-projections!)))

 ;;;; Tests
@@ -473,8 +475,7 @@
                               ;; TODO: create a command for removing a single permission? or produce the event directly from tests?
                               ;; removed :gis-access
                               :permission/ids [:view-congregation :configure-congregation]}))
-      (projections/refresh-async!)
-      (projections/await-refreshed (Duration/ofSeconds 1))
+      (refresh-projections!)

       (let [response (-> (request :get (str "/api/congregation/" cong-id "/qgis-project"))
                          (merge session)


Conventional formatting of loop/recur

Conventional formatting of loop/recur

--- ClojureScript/src/persistent_perf/view_controller.cljs
+++ ClojureScript/src/persistent_perf/view_controller.cljs
@@ -4,11 +4,9 @@
 (defui obj-c-time-label cljs-time-label run-tests-button)

 (defn- run-cljs-test []
-  (loop [i 0
-         m (transient {})]
+  (loop [i 0 m (transient {})]
     (if (< i 1000000)
-      (recur (inc i)
-             (conj! m [i i]))
+      (recur (inc i) (conj! m [i i]))
       (persistent! m))))

 (defn- run-tests! []


Fix url matcher for hackerparadise

Fix url matcher for hackerparadise

--- frontend/src/faceboard/whitelabel.cljs
+++ frontend/src/faceboard/whitelabel.cljs
@@ -5,7 +5,7 @@

 (def domain-mappings
   [[#"fb\.local.*" "test-localhost-whitelabel"]             ; just a test local host
-   [#"hackerparadise\.org" "hp"]])                          ; http://faceboard.hackerparadise.org
+   [#".*hackerparadise\.org" "hp"]])                          ; http://faceboard.hackerparadise.org

 (defn domain->boad-id [domain]
   (if-let [match (utils/find-first #(re-matches (first %) domain) domain-mappings)]


Make the Clojure/Android game project target Java 7

--- src/clojure/leiningen/new/game_clojure/android-project.clj
+++ src/clojure/leiningen/new/game_clojure/android-project.clj
@@ -33,4 +33,4 @@

   :source-paths ["src/clojure" "../desktop/src-common/clojure" "src"]
   :java-source-paths ["src/java" "gen"]
-  :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"])
+  :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"])


Minor fix

Minor fix

--- src/misc_scripts/generate_qrcodes.clj
+++ src/misc_scripts/generate_qrcodes.clj
@@ -2,7 +2,7 @@
   (:require [clj-http.client :as http]))

 (defn shorten [url]
-  (let [response (http/get "https://api-ssl.bitly.com/v3/shorten/"
+  (let [response (http/get "https://api-ssl.bitly.com/v3/shorten"
                            {:query-params {
                                            :login ""
                                            :apiKey ""


Apply scroll-view rendering optimization for list of chats

Signed-off-by: Max Risuhin <0ee5369ece4f0e4c0a73403ed3c1a7a1557865df@gmail.com>

--- src/status_im/ui/screens/desktop/main/tabs/home/views.cljs
+++ src/status_im/ui/screens/desktop/main/tabs/home/views.cljs
@@ -74,7 +74,7 @@
        [react/view {:style styles/add-new}
         [icons/icon :icons/add {:style {:tint-color :white}}]]]]
      [react/view {:style styles/chat-list-separator}]
-     [react/scroll-view
+     [react/scroll-view {:enableArrayScrollingOptimization true}
       [react/view
        (for [[index chat] (map-indexed vector home-items)]
          ^{:key (first chat)}


Fix opt-out script to make sure it overrides the previous user visibility map.

--- src/oc/storage/util/inbox_opt_out.clj
+++ src/oc/storage/util/inbox_opt_out.clj
@@ -59,7 +59,7 @@
                                        :else
                                        nil))
                                 (:user-visibility e))))
-                    cleaned-entry (if (seq user-vis) (assoc e :user-visibility user-vis) (dissoc e :user-visibility))]
+                    cleaned-entry (if (seq user-vis) (assoc e :user-visibility user-vis) (assoc e :user-visibility nil))]
                 (println "Updating entry" (:uuid e))
                 (entry/update-entry-no-user! conn (:uuid e) cleaned-entry))))))
       (catch Exception e


More ham extraction

More ham extraction

--- integration-tests/src/test/clojure/immutant/integs/msg/selector.clj
+++ integration-tests/src/test/clojure/immutant/integs/msg/selector.clj
@@ -63,6 +63,6 @@
   (is (nil? (receive "/queue/filtered" :timeout 1000)))
   (publish "/queue/filtered" "success" :properties {:color "blue"})
   (is (= "success" (receive "/queue/filtered")))
-  (is (nil? (receive "/queue/ham" :timeout 1000)))
+  (is (nil? (receive queue :timeout 1000)))
   (publish "/queue/filtered" "success" :properties {:color "blue" :animal "penguin"})
-  (is (= "success" (receive "/queue/ham"))))
+  (is (= "success" (receive queue))))


Relax schema slightly on author.

Relax schema slightly on author.

--- src/open_company/resources/common.clj
+++ src/open_company/resources/common.clj
@@ -65,7 +65,7 @@
 (def Author {
   :name schema/Str
   :user-id schema/Str
-  :image (schema/maybe schema/Str)
+  (schema/optional-key :image) (schema/maybe schema/Str)
   (schema/optional-key :updated-at) (schema/maybe schema/Str)})

 (def Section