Add catch-game slide

Add catch-game slide

go-blocks are rendered as Om components

--- src-cljs/qcon/main.cljs
+++ src-cljs/qcon/main.cljs
@@ -46,8 +46,9 @@
                              ;; Forces a re-render
                              (om/set-state! owner :modified (new js/Date))))}

-            [:rect {:x 0 :y 0 :width 140 :height 100 :fill "black"}]
-            [:text {:x 30 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} ">!"]]
+            [:g {:transform "translate(90,0)"}
+             [:rect {:x 0 :y 0 :width 140 :height 100 :fill "black"}]
+             [:text {:x 0 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} ">!"]]]

            (for [x (range bufsize)]
              [:g {:transform (str "translate(320,320)")}
@@ -61,9 +62,12 @@
                            (go
                              (<! ch)
                              (om/set-state! owner :modified (new js/Date))))}
-            [:rect {
-                    :x 0 :y 0 :width 140 :height 100 :fill "black"}]
-            [:text {:x 30 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} "<!"]]]])))))
+
+            [:g {:transform "translate(90,0)"}
+             [:rect {:x 0 :y 0 :width 140 :height 100 :fill "black"}]
+             [:text {:x 0 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}} "<!"]]
+
+            ]]])))))

 (defn timeout-slide [data owner opts]
   (reify
@@ -111,116 +115,217 @@
             [:text {:x 30 :y 80 :style {:font-size default-font :stroke "white" :fill "white"}}
              "(alts! ch (time-out 2000))"]]]])))))

-(defn create-circle [offset angle]
-  (fn [app owner]
-    (reify
-      om/IInitState
-      (init-state [_]
-        {:label (rand-int 10)}
+(defn go-block [data owner {:keys [radius algo font-size]}]
+  (reify
+    om/IInitState
+    (init-state [_]
+      {:label ""})
+    om/IWillMount
+    (will-mount [_]
+      (algo owner))
+    om/IRender
+    (render [_]
+      (html
+       [:g
+        [:rect {:x (- (/ radius 2)) :y (- (/ radius 2)) :width radius :height radius :stroke "white" :stroke-width "2" :fill "#5F8"}]
+        [:text {:x (- 10) :y 20 :style {:font-size font-size}} (str (om/get-state owner :label))]]))))
+
+(defn go-block-slide [data owner opts]
+  (reify
+    om/IInitState
+    (init-state [_]
+      {:circles
+       (for [n (range (:circles opts))]
+         (let [angle (* n (/ (* 2 Math/PI) (:circles opts)))
+               offset (* .8 (/ (- (min (:width opts) (:height opts)) (:radius opts)) 2))]
+           [(* offset (Math/cos angle))
+            (- (* offset (Math/sin angle)))]))})
+    om/IRender
+    (render [_]
+      (html
+       [:div
+        [:svg {:version "1.1" :width (:width opts) :height (:height opts)}
+         [:g
+          [:rect {:x 0 :y 0 :width (:width opts) :height (:height opts) :fill "#222"}]
+          ;; Center the diagram
+          [:g {:transform (str "translate(" (/ (:width opts) 2) "," (/ (:height opts) 2) ")")}
+           (for [[x y] (om/get-state owner :circles)]
+             [:g {:transform (str "translate(" x "," y ")")}
+              (om/build
+               go-block data
+               {:opts {:radius (:radius opts)
+                       :font-size (:font-size opts)
+                       :algo (fn [owner]
+                               (go-loop []
+                                 (<! (timeout (+ 1000 (rand-int 200))))
+                                 (om/set-state! owner :label (str (rand-int 10)))
+                                 (recur)
+                                 ))}})])]]]]))))
+
+(defn catch-game-slide [data owner opts]
+  (reify
+    om/IInitState
+    (init-state [_]
+      {:instances
+       (vec
+        (for [n (range (:circles opts))]
+          (let [angle (* n (/ (* 2 Math/PI) (:circles opts)))
+                offset (* .8 (/ (- (min (:width opts) (:height opts)) (:radius opts)) 2))]
+            {:id n
+             :position [(* offset (Math/cos angle))
+                        (- (* offset (Math/sin angle)))]
+             :channel (chan)
+             }
+            )))})
+
+    om/IWillMount
+    (will-mount [_]
+      (println "Mounting game")
+      (go
+        (>! (:channel (first (om/get-state owner :instances)))
+            "MESSAGE"))
+      (let [instances (om/get-state owner :instances)]
+        (println "There are instances:" (count instances))
         )
-      om/IWillMount
-      (will-mount [_]
-        (go-loop []
-          (<! (timeout (+ 1000 (rand-int 200))))
-          (om/set-state! owner :label (str (rand-int 10)))
-          (recur)
-          )
-        )
-      om/IRender
-      (render [_]
-        (html
-         (let [x (+ 300 (* offset (Math/cos angle)))
-               y (- 300 (* offset (Math/sin angle)))
-               x2 (+ 300 (* (inc offset) (Math/cos angle)))
-               y2 (- 300 (* (inc offset) (Math/sin angle)))
-               ]
-           [:g {:transform (str "translate(" x "," y ")")}
-            [:circle {:cx 0 :cy 0 :r 30 :fill "#5F8"}]
-            [:text {:x -10 :y 10 :style {:font-size "32pt"}} (str (om/get-state owner :label))]]
-))))))
-
-(defn go-block-slide [data owner opts]
-  (reify
-    om/IInitState
-    (init-state [_]
-      (let [circles (:circles opts)]
-        {:default-font (:font-size opts)
-         :circles (for [n (range circles)]
-                    (let [angle (* n (/ (* 2 Math/PI) circles))
-                          offset 250]
-                      (create-circle offset angle)))}))
-    om/IRender
-    (render [_]
-      (let [default-font (om/get-state owner :default-font)]
-        (html
-         [:div
-          [:svg {:version "1.1" :width 600 :height 600}
-           [:g
-            [:rect {:x 0 :y 0 :width 600 :height 600 :fill "#292"}]
-            (for [c (om/get-state owner :circles)]
-              (om/build c data))
-            #_[:text {:x 20 :y 120 :fill "#f00"
-                      :style {:font-size "80pt"}}
-               "Hello Ruben, buon compleano!!!"]]]])))))
-
+
+      )
+
+    om/IRender
+    (render [_]
+      (html
+       [:div
+        [:svg {:version "1.1" :width (:width opts) :height (:height opts)}
+         [:g
+          [:rect {:x 0 :y 0 :width (:width opts) :height (:height opts) :fill "#222"}]
+          ;; Center the diagram
+          [:g {:transform (str "translate(" (/ (:width opts) 2) "," (/ (:height opts) 2) ")")}
+
+           ;; Draw the paths
+           (for [[x1 y1] (map :position (om/get-state owner :instances))
+                 [x2 y2] (map :position (om/get-state owner :instances))]
+             [:line {:x1 x1 :y1 y1 :x2 x2 :y2 y2 :stroke "#222" :stroke-width 3}])
+
+           ;; Draw the go-blocks
+           (let [instances (om/get-state owner :instances)]
+             (for [{:keys [id position channel]} instances]
+               (let [[x y] position]
+                 [:g {:transform (str "translate(" x "," y ")")}
+                  (om/build
+                   go-block data
+                   {:opts {:radius (:radius opts)
+                           :font-size (:font-size opts)
+                           ;; Promote this function somewhere
+                           :algo (fn [gb-owner]
+                                   (go-loop [n 0]
+                                     (om/set-state! gb-owner :label n)
+                                     (<! channel)
+
+                                     (let [to (mod (+ id (+ 2 (rand-int (- (count instances) 4))))
+                                                   (count instances)
+                                                   )]
+                                       ;;(println "Instance " id " is playing and sending to" to)
+                                       ;;(println "From position" position)
+                                       ;;(println "To position" (:position (get instances to)))
+                                       (let [from-pos position
+                                             to-pos (:position (get instances to))
+                                             xdelta (/ (- (first to-pos) (first from-pos)) 18)
+                                             ydelta (/ (- (second to-pos) (second from-pos)) 18)
+                                             ]
+
+                                         (go-loop [i 0]
+                                           (<! (timeout 1))
+                                           ;;(println "show message" x "," y)
+                                           (om/set-state!
+                                            owner :message
+                                            [(+ (first from-pos) (* i xdelta))
+                                             (+ (second from-pos) (* i ydelta))])
+                                           (if (= i 18)
+                                             (do
+                                               (om/set-state! owner :message nil)
+                                               (>! (get-in instances [to :channel]) "MESSAGE"))
+                                             (recur (inc i)))
+                                           ))
+                                       )
+
+
+                                     (recur (inc n))
+                                     )
+                                   )}})])))
+
+           (when-let [[x y] (om/get-state owner :message)]
+             [:circle {:cx x :cy y :r 10 :fill "yellow" }])
+
+           ]]]]))))
 (def app-model
-  (atom {:current-slide 1
+  (atom {:current-slide 9
          :slides
          ;; TODO Add cardinal such that each slide has its own number to avoid react warning
-         [{:title "core.async"
-           :event "QCon 2014"
-           :author "Malcolm Sparks"
-           :company "JUXT"
-           :email "malcolm@juxt.pro"
-           :twitter "@malcolmsparks"
-           }
-
-          {:subtitle "What is core.async?"
-           ;;:text "Here is the first slide"
-           ;;:background "/static/cspdiag.jpg"
-           :bullets ["Clojure library released May 2013"
-                     "Based on Communicating Sequential Processes"
-                     "Available in Clojure and ClojureScript"]
-           }
-
-          {:title "Quick tutorial"}
-
-          {:subtitle "channels (TODO)"}
-
-          ;; TODO Add source code on right hand side of slide
-          {:subtitle "put and take"
-           :custom put-and-take-slide
-           :opts {:buffer-size 7 :font-size "72pt" :radius 50}}
-
-          {:subtitle "timeouts"
-           :custom timeout-slide
-           :opts {:font-size "72pt"}}
-
-          {:subtitle "buffers (TODO)"
-           :code "(<! (chan))"}
-
-          {:subtitle "alts!"
-           :custom alts-slide
-           :opts {:font-size "30pt"}}
-
-          {:subtitle "go blocks"
-           :custom go-block-slide
-           :opts {:font-size "80pt" :circles 5}
-           }
-
-          ;; TODO Play catch between go blocks
-
-          ;; TODO Show source code from cljs sources on disk - via cljs - use different namespaces
-
-          ;; TODO result of race in alts! between a channel and a timeout
-
-          ;; Go blocks
-
-          {:title "When?"}
-
-          ;; TODO Don't forget to mention Hecuba and Stentor (that they're free software)
-
-          {:title "END?"}]}))
+         (vec
+          (map-indexed
+           (fn [i m] (assoc m :slideno (str "slide-" (inc i))))
+           [{:title "core.async"
+             :event "QCon 2014"
+             :author "Malcolm Sparks"
+             :company "JUXT"
+             :email "malcolm@juxt.pro"
+             :twitter "@malcolmsparks"
+             }
+
+            {:subtitle "What is core.async?"
+             ;;:text "Here is the first slide"
+             ;;:background "/static/cspdiag.jpg"
+             :bullets ["Clojure library released May 2013"
+                       "Based on Communicating Sequential Processes"
+                       "Available in Clojure and ClojureScript"]
+             }
+
+            {:title "Quick tutorial"}
+
+            {:subtitle "channels (TODO)"}
+
+            ;; TODO Add source code on right hand side of slide
+            {:subtitle "put and take"
+             :custom put-and-take-slide
+             :opts {:buffer-size 7 :font-size "72pt" :radius 50}}
+
+            {:subtitle "timeouts"
+             :custom timeout-slide
+             :opts {:font-size "72pt"}}
+
+            {:subtitle "buffers (TODO)"
+             :code "(<! (chan))"}
+
+            {:subtitle "alts!"
+             :custom alts-slide
+             :opts {:font-size "30pt"}}
+
+            {:subtitle "go blocks"
+             :custom go-block-slide
+             :opts {:width 600 :height 600
+                    :circles 7
+                    :radius 60 :font-size "40pt"}
+             }
+
+            {:subtitle "catch game"
+             :custom catch-game-slide
+             :opts {:width 600 :height 600
+                    :circles 13
+                    :radius 30 :font-size "20pt"}
+             }
+
+            ;; TODO Play catch between go blocks
+
+            ;; TODO Show source code from cljs sources on disk - via cljs - use different namespaces
+
+            ;; TODO result of race in alts! between a channel and a timeout
+
+            ;; Go blocks
+
+            {:title "When?"}
+
+            ;; TODO Don't forget to mention Hecuba and Stentor (that they're free software)
+
+            {:title "END?"}]))}))

 (defn source-snippet [data owner fname]
   (reify
@@ -358,7 +463,7 @@
         #_[:p (str "Current slide is " (inc (:current-slide app)) "/" (count (:slides app)))]
         (om/build-all slide
                       (:slides app)
-                      {:key :title :init-state chans :opts (:current-slide app)})]))))
+                      {:key :slideno :init-state chans :opts (:current-slide app)})]))))

 (om/root slides app-model {:target (.getElementById js/document "content")})


minor text fix

minor text fix

--- frontend/src/cruncher/views.cljs
+++ frontend/src/cruncher/views.cljs
@@ -163,7 +163,7 @@
                                             (dom/input #js {:className   "form-control"
                                                             :onChange    #(commit-component-state this :email %)
                                                             :value       email
-                                                            :placeholder "email"}))
+                                                            :placeholder "email / PTC Username"}))
                                    (dom/div #js {:className "input-group"}
                                             (dom/span #js {:className "input-group-addon"}
                                                       (vlib/fa-icon "fa-key fa-fw"))


Add index creation

Add index creation

--- src/clojure/clojurewerkz/cassaforte/new_query_api.clj
+++ src/clojure/clojurewerkz/cassaforte/new_query_api.clj
@@ -635,15 +635,40 @@
          (reduce (fn [builder [statement-name statement-args]]
                    ((get renderers statement-name) builder statement-args))
                  (SchemaBuilder/dropTable (name table-name)))
-         (maybe-stringify)))
-  )
-
-
-;; Drop dropTable(String tableName)
-;; Drop dropTable(String keyspaceName, String tableName)
+         (maybe-stringify))))
+
+(let [order
+      {:ont-table          1
+       :and-column         2
+       :and-keys-of-column 2}
+      renderers
+      {:on-table           (fn on-table-query [query-builder table-name]
+                             (.onTable query-builder table-name))
+       :and-column         (fn and-column [query-builder column-name]
+                             (.andColumn query-builder column-name))
+       :and-keys-of-column (fn and-keys-of-column [query-builder column-name]
+                             (.andKeysOfColumn query-builder column-name))
+       }]
+  (defn create-index
+    [index-name & statements]
+    (->> statements
+         (sort-by #(get order (first %)))
+         (reduce (fn [builder [statement-name statement-args]]
+                   ((get renderers statement-name) builder statement-args))
+                 (SchemaBuilder/createIndex (name index-name)))
+         (maybe-stringify))))
+
+(defn on-table
+  [table-name]
+  [:on-table (name table-name)])
+(defn and-column
+  [column-name]
+  [:and-column (name column-name)])
+(defn and-keys-of-column
+  [column-name]
+  [:and-keys-of-column (name column-name)])
+
 ;; CreateIndex createIndex(String indexName)
-;; Drop dropIndex(String indexName)
-;; Drop dropIndex(String keyspaceName, String indexName)
 ;; CreateType createType(String typeName)
 ;; CreateType createType(String keyspaceName, String typeName)
 ;; Drop dropType(String typeName)


Fix chat loading time

Fix chat loading time

Signed-off-by: Volodymyr Kozieiev <f2778d839d9f3ad586693b057b494a6ec3a7ca24@gmail.com>

--- src/status_im/ui/screens/desktop/main/chat/views.cljs
+++ src/status_im/ui/screens/desktop/main/chat/views.cljs
@@ -157,15 +157,26 @@
            [react/view {:style (message.style/delivery-status outgoing)}
             [message/message-delivery-status message]]])}))))

+(def load-step 5)
+
+(defn load-more [all-messages-count messages-to-load]
+  (let [next-count (min all-messages-count (+ @messages-to-load load-step))]
+    (reset! messages-to-load next-count)))
+
 (views/defview messages-view [{:keys [chat-id group-chat]}]
   (views/letsubs [messages [:get-current-chat-messages-stream]
-                  current-public-key [:get-current-public-key]]
-    (let [chat-id* (atom nil)
-          scroll-ref (atom nil)
+                  current-public-key [:get-current-public-key]
+                  messages-to-load (reagent/atom load-step)
+                  chat-id* (reagent/atom nil)]
+    {:component-did-update #(load-more (count messages) messages-to-load)
+     :component-did-mount  #(load-more (count messages) messages-to-load)}
+    (let [scroll-ref (atom nil)
           scroll-timer (atom nil)
           scroll-height (atom nil)
           _ (when (or (not @chat-id*) (not= @chat-id* chat-id))
-              (reset! chat-id* chat-id))]
+              (do
+                (reset! messages-to-load load-step)
+                (reset! chat-id* chat-id)))]
       [react/view {:style styles/messages-view}
        [react/scroll-view {:scrollEventThrottle    16
                            :headerHeight styles/messages-list-vertical-padding
@@ -182,7 +193,7 @@
                            :ref                    #(reset! scroll-ref %)}
         [react/view
          (doall
-          (for [[index {:keys [from content message-id type value] :as message-obj}] (map-indexed vector messages)]
+          (for [[index {:keys [from content message-id type value] :as message-obj}] (map-indexed vector (take @messages-to-load messages))]
             ^{:key message-obj}
             [message (:text content) (= from current-public-key)
              (assoc message-obj :group-chat group-chat


Added test case for granule search in csv format.

--- test/cmr/system_int_test/search/granule_search_format_test.clj
+++ test/cmr/system_int_test/search/granule_search_format_test.clj
@@ -71,7 +71,8 @@

 (deftest search-granule-csv
   (let [ru1 (dc/related-url "GET DATA" "http://example.com")
-        ru2 (dc/related-url "GET RELATED VISUALIZATION" "http://example.com/browse")
+        ru2 (dc/related-url "GET DATA" "http://example2.com")
+        ru3 (dc/related-url "GET RELATED VISUALIZATION" "http://example.com/browse")
         coll1 (d/ingest "CMR_PROV1" (dc/collection {}))
         coll2 (d/ingest "CMR_PROV1" (dc/collection {}))
         gran1 (d/ingest "CMR_PROV1" (dg/granule coll1 {:granule-ur "Granule1"
@@ -81,13 +82,21 @@
                                                        :day-night "DAY"
                                                        :size 100
                                                        :cloud-cover 50
-                                                       :related-urls [ru1 ru2]}))
+                                                       :related-urls [ru1 ru2 ru3]}))
         gran2 (d/ingest "CMR_PROV1" (dg/granule coll2 {:granule-ur "Granule2"
                                                        :beginning-date-time "2011-01-01T12:00:00Z"
                                                        :ending-date-time "2011-01-11T12:00:00Z"
                                                        :producer-gran-id "Granule #2"
                                                        :day-night "NIGHT"
                                                        :size 80
+                                                       :cloud-cover 30
+                                                       :related-urls [ru1]}))
+        gran3 (d/ingest "CMR_PROV1" (dg/granule coll2 {:granule-ur "Granule3"
+                                                       :beginning-date-time "2012-01-01T12:00:00Z"
+                                                       :ending-date-time "2012-01-11T12:00:00Z"
+                                                       :producer-gran-id "Granule #3"
+                                                       :day-night "NIGHT"
+                                                       :size 80
                                                        :cloud-cover 30}))]

     (index/refresh-elastic-index)
@@ -95,13 +104,19 @@
     (let [response (search/find-grans-csv :granule {:granule-ur "Granule1"})]
       (is (= 200 (:status response)))
       (is (= (str "Granule UR,Producer Granule ID,Start Time,End Time,Online Access URLs,Browse URLs,Cloud Cover,Day/Night,Size\n"
-                  "Granule1,Granule #1,2010-01-01T12:00:00Z,2010-01-11T12:00:00Z,http://example.com,http://example.com/browse,50.0,DAY,100.0\n")
+                  "Granule1,Granule #1,2010-01-01T12:00:00Z,2010-01-11T12:00:00Z,\"http://example.com,http://example2.com\",http://example.com/browse,50.0,DAY,100.0\n")
+             (:body response))))
+    (let [response (search/find-grans-csv :granule {:granule-ur "Granule2"})]
+      (is (= 200 (:status response)))
+      (is (= (str "Granule UR,Producer Granule ID,Start Time,End Time,Online Access URLs,Browse URLs,Cloud Cover,Day/Night,Size\n"
+                  "Granule2,Granule #2,2011-01-01T12:00:00Z,2011-01-11T12:00:00Z,http://example.com,,30.0,NIGHT,80.0\n")
              (:body response))))
     (let [response (search/find-grans-csv :granule {})]
       (is (= 200 (:status response)))
       (is (= (str "Granule UR,Producer Granule ID,Start Time,End Time,Online Access URLs,Browse URLs,Cloud Cover,Day/Night,Size\n"
-                  "Granule1,Granule #1,2010-01-01T12:00:00Z,2010-01-11T12:00:00Z,http://example.com,http://example.com/browse,50.0,DAY,100.0\n"
-                  "Granule2,Granule #2,2011-01-01T12:00:00Z,2011-01-11T12:00:00Z,,,30.0,NIGHT,80.0\n")
+                  "Granule1,Granule #1,2010-01-01T12:00:00Z,2010-01-11T12:00:00Z,\"http://example.com,http://example2.com\",http://example.com/browse,50.0,DAY,100.0\n"
+                  "Granule2,Granule #2,2011-01-01T12:00:00Z,2011-01-11T12:00:00Z,http://example.com,,30.0,NIGHT,80.0\n"
+                  "Granule3,Granule #3,2012-01-01T12:00:00Z,2012-01-11T12:00:00Z,,,30.0,NIGHT,80.0\n")
              (:body response))))

     (testing "as extension"


STORM-1666: Kill from the UI fails silently

--- storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
+++ storm-core/src/clj/org/apache/storm/daemon/nimbus.clj
@@ -1885,7 +1885,8 @@
               executor-summaries (dofor [[executor [node port]] (:executor->node+port assignment)]
                                    (let [host (-> assignment :node->host (get node))
                                             heartbeat (.get beats (StatsUtil/convertExecutor executor))
-                                            excutorstats (.get (.get heartbeat "heartbeat") "stats")
+                                            hb (if heartbeat (.get heartbeat "heartbeat"))
+                                            excutorstats (if hb (.get hb "stats"))
                                             excutorstats (if excutorstats
                                                     (StatsUtil/thriftifyExecutorStats excutorstats))]
                                           (doto


fix typo in worker.clj

fix typo in worker.clj

heatbeat -> heartbeat

--- storm-core/src/clj/org/apache/storm/daemon/worker.clj
+++ storm-core/src/clj/org/apache/storm/daemon/worker.clj
@@ -77,7 +77,7 @@
       (.workerHeartbeat (:storm-cluster-state worker) (:storm-id worker) (:assignment-id worker) (long (:port worker))
         (StatsUtil/thriftifyZkWorkerHb zk-hb))
       (catch Exception exc
-        (log-error exc "Worker failed to write heatbeats to ZK or Pacemaker...will retry")))))
+        (log-error exc "Worker failed to write heartbeats to ZK or Pacemaker...will retry")))))

 (defn do-heartbeat [worker]
   (let [conf (:conf worker)


Add fps counter to super koalio

Add fps counter to super koalio

--- super-koalio/desktop/src-common/super_koalio/core.clj
+++ super-koalio/desktop/src-common/super_koalio/core.clj
@@ -1,10 +1,11 @@
 (ns super-koalio.core
   (:require [play-clj.core :refer :all]
             [play-clj.g2d :refer :all]
+            [play-clj.ui :refer :all]
             [super-koalio.entities :as e]
             [super-koalio.utils :as u]))

-(declare super-koalio main-screen)
+(declare super-koalio main-screen text-screen)

 (defn update-screen!
   [screen entities]
@@ -12,7 +13,7 @@
     (when is-me?
       (x! screen x)
       (when (< y (- height))
-        (set-screen! super-koalio main-screen)))
+        (set-screen! super-koalio main-screen text-screen)))
     (when-let [[tile-x tile-y] to-destroy]
       (tiled-map-layer! (tiled-map-layer screen "walls")
                         :set-cell tile-x tile-y nil)))
@@ -43,7 +44,26 @@
     (height! screen u/vertical-tiles)
     nil))

+(defscreen text-screen
+  :on-show
+  (fn [screen entities]
+    (update! screen :camera (orthographic) :renderer (stage))
+    (assoc (label "0" (color :white))
+           :id :fps
+           :x 5))
+  :on-render
+  (fn [screen entities]
+    (->> (for [entity entities]
+           (case (:id entity)
+             :fps (doto entity (label! :set-text (str (game :fps))))
+             entity))
+         (render! screen)))
+  :on-resize
+  (fn [screen entities]
+    (height! screen 300)
+    nil))
+
 (defgame super-koalio
   :on-create
   (fn [this]
-    (set-screen! this main-screen)))
+    (set-screen! this main-screen text-screen)))


open as a virtual file

open as a virtual file

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

--- plugins/DataBrowser/src/org/micromanager/browser/core.clj
+++ plugins/DataBrowser/src/org/micromanager/browser/core.clj
@@ -135,7 +135,7 @@
   (doseq [i (.getSelectedRows table)]
     (let [f (row-index-to-path i)]
       (if (.exists (File. f))
-        (.openAcquisitionData gui f)
+        (.openAcquisitionData gui f false)
         (ReportingUtils/showError "File not found.")))))

 (defn listen-to-open [table]


Don't add new concepts if they are already present

in DL exploration.

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

--- src/conexp/contrib/dl/languages/EL_gfp_exploration.clj
+++ src/conexp/contrib/dl/languages/EL_gfp_exploration.clj
@@ -67,12 +67,12 @@
            (illegal-argument "Given initial-ordering for explore-model must consist "
                              "of all concept names of the language of the given model."))

-         (loop [M_k   (make-concept-set (map #(dl-expression language %)
+         (loop [M_k   (make-concept-set (map #(dl-expression language %) ;the set of constructed concepts
                                              initial-ordering)),
-                Pi_k  [],
-                P-map {},
-                P_k   #{},
-                model initial-model,
+                Pi_k  [],               ;the sequence of pseudo-intents found
+                P-map {},               ;a map mapping pseudo-intents P to [all-P, all-P-closure]
+                P_k   #{},              ;the current pseudo-intent
+                model initial-model,    ;working model
                 implications #{},
                 background-knowledge #{}]

@@ -90,14 +90,11 @@
                    all-P_k-closure
                                 (model-closure next-model all-P_k),

-                   number-of-old-concepts
-                                (count (seq M_k)),
-		   next-M_k     (apply add-concepts!
-                                       M_k
-                                       (for [r (role-names language)]
-                                         (dl-expression language (exists r all-P_k-closure)))),
-                   new-concepts (take (- (count (seq next-M_k)) number-of-old-concepts)
-                                      (seq next-M_k)),
+                   new-concepts (if (forall [[_ Q-closure] (vals P-map)]
+                                      (not (equivalent? all-P_k-closure Q-closure))),
+                                  (for [r (role-names language)]
+                                    (dl-expression language (exists r all-P_k-closure)))),
+		   next-M_k     (apply add-concepts! M_k new-concepts),

                    P-map        (assoc P-map
                                   P_k [all-P_k all-P_k-closure]),
@@ -106,7 +103,7 @@
 		   implications (let [new-impl (make-implication P_k
                                                                  (set-of D | D (seq M_k)
                                                                              :when (subsumed-by? all-P_k-closure D))),
-                                      impls    (if (empty? new-concepts)
+                                      impls    (if-not new-concepts
                                                  implications
                                                  (set-of impl | old-impl implications
                                                                 :let [P (premise old-impl),


Add tests for hierarchical algorithms

Add tests for hierarchical algorithms

--- src/edu/berkeley/ai/angelic/hierarchies/algorithms.clj
+++ src/edu/berkeley/ai/angelic/hierarchies/algorithms.clj
@@ -62,6 +62,48 @@

+
+
+
+;; Testing
+
+
+
+
+(require '[edu.berkeley.ai.envs :as envs])
+(require '[edu.berkeley.ai.domains.nav-switch :as nav-switch])
+(require '[edu.berkeley.ai.domains.strips :as strips])
+(require '[edu.berkeley.ai.domains.warehouse :as warehouse])
+(require '[edu.berkeley.ai.angelic.hierarchies.abstract-lookahead-trees :as alts])
+(require '[edu.berkeley.ai.search.algorithms.textbook :as textbook])
+
+(def *ns-inst* ["ns" -27 nav-switch/*nav-switch-hierarchy*
+		(strips/constant-predicate-simplify
+		 (nav-switch/make-nav-switch-strips-env 6 6 [[4 0] [3 3] [0 4]] [5 0] true [0 5]))])
+
+(def *wh-inst* ["wh" -6 warehouse/*warehouse-hierarchy*
+		 (strips/constant-predicate-simplify
+		  (warehouse/make-warehouse-strips-env 4 4 [1 2] false {0 '[b a] 2 '[c] 3 '[d]} nil ['[b d]]))])
+;		  (warehouse/make-warehouse-strips-env 3 4 [1 2] false {0 '[b a] 2 '[c]} nil ['[a b c]]))])
+;		  (warehouse/make-warehouse-strips-env 4 4 [1 2] false {0 '[b a] 2 '[d] 3 '[c]} nil ['[a b c]]))])
+
+
+(util/deftest hierarchical-algorithms
+   (doseq [[inst-n rew h env] [*ns-inst* *wh-inst*]
+	   cache?      [false true]
+	   graph?      [false true :full]
+	   [sf-n alg strict?] [["aha" aha-star-search true] ["ahss-inf" ahss-search false] ["ahss-=" #(ahss-search % rew) true]]]
+     (util/testing (str inst-n " " cache? " " graph? " " sf-n)
+;       (println inst-n cache? graph? sf-n)
+       (util/is ((if strict? = >=) rew
+	 (second (envs/check-solution env (alg (alts/alt-node (get-hierarchy h env) cache? graph?)))))))))
+
+
+
+
+
+
+
 (comment
  (dotimes [_ 2] (let [env (constant-predicate-simplify (make-nav-switch-strips-env 505 505 (prln (take 20 (repeatedly #(vector (rand-int 505) (rand-int 505))))) [504 0] true [0 504]))] (doseq [h [*nav-switch-hierarchy* *nav-switch-hierarchy-improved*]] (let [node (get-hierarchy h env )] (println h) (dotimes [_ 1] (time (println (second (aha-star-search (alt-node node))))) (time (println (second (ahss-search (alt-node node))))) )))))
  )


Ignore gene case.

Ignore gene case.

--- src/cavm/h2.clj
+++ src/cavm/h2.clj
@@ -189,7 +189,7 @@
   ["CREATE TABLE IF NOT EXISTS `field_gene` (
    `field_id` INT NOT NULL,
    `row` INT NOT NULL,
-   `gene` VARCHAR(255) NOT NULL,
+   `gene` VARCHAR_IGNORECASE(255) NOT NULL,
     FOREIGN KEY (`field_id`) REFERENCES `field` (`id`) ON DELETE CASCADE)"
    "CREATE INDEX IF NOT EXISTS field_gene ON `field_gene` (`field_id`, `gene`)"
    "CREATE INDEX IF NOT EXISTS gene_row ON `field_gene` (`field_id`, `row`)"])


gofmt

gofmt

--- src/cljs/go.clj
+++ src/cljs/go.clj
@@ -2,7 +2,9 @@
   (:require [cljs.closure]
             [cljs.env]
             [cljs.js-deps]
-            [cljs.go.compiler]))
+            [cljs.go.compiler]
+            [clojure.string :as s]
+            [clojure.java.shell :as sh]))

 (defn cljs->go [in]
   (cljs.env/with-compiler-env (cljs.env/default-compiler-env)
@@ -16,11 +18,25 @@
 (defn -main [& args]
   (println "ClojureScript to Go [clojure]"))

+(defn gofmt [in]
+  (let [{:keys [exit out err]} (sh/sh "gofmt" :in in)]
+    (if (zero? exit)
+      out
+      (do (println err) in))))
+
+(defn with-line-numbers [in]
+  (->> (for [[n l] (map-indexed vector (s/split-lines in))]
+         (format "%3d  %s\n" (inc n) l))
+       (apply str)
+       s/trim-newline))
+
 (comment
   (->> '[(ns test.app (:require [goog.array :as array]))
          (defn plus-one [x] (inc x))]
        cljs->go
        go->str
+       gofmt
+       with-line-numbers
        println)

 ;; func plus_one(x interface{}) interface{} {
@@ -35,6 +51,8 @@
            (str "Hello " n (world)))]
        cljs->go
        go->str
+       gofmt
+       with-line-numbers
        println)

   (->> '[(ns hello)
@@ -42,6 +60,8 @@
            (println "Hello World"))]
        cljs->go
        go->str
+       gofmt
+       with-line-numbers
        println)

   (cljs.closure/build '[(ns hello.core)


State.

State.

--- test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_020_atoms.clj
+++ test/com/nomistech/clojure_the_language/c_400_state_and_concurrency/s_020_atoms.clj
@@ -25,8 +25,12 @@
   (swap! my-number-atom dec) => 2)

 ;;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-;;;; Supplying args to the swap function:
-;;;; (Note: I'm making up the name "swap function".)
+;;;; We need a name for the function that `swap!` calls
+;;;; - We'll use the term "data function"
+;;;;   - The book /Clojure Applied/ uses this
+
+;;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+;;;; Supplying args to the data function:

 (do (swap! my-number-atom + 10)
     ;; does this: (+ 2 10)
@@ -86,23 +90,23 @@
 ;;;;
 ;;;; - Each thread uses `swap!` with a function that runs for a long time.
 ;;;;
-;;;; - Terminology: I'm calling the function passed to `swap!` a "swap function".
+;;;; - Terminology: I'm calling the function passed to `swap!` a "data function".
 ;;;;
 ;;;; - Clojure allows each thread that calls `swap!` to be optimistic.
-;;;;   - So multiple swap functions run concurrently (for the same atom).
+;;;;   - So multiple data functions run concurrently (for the same atom).
 ;;;;
-;;;; - When a swap function finishes:
+;;;; - When a data function finishes:
 ;;;;   - If the current value of the atom is the same as the value when the
 ;;;;     function started
-;;;;     (this means that this swap function did its work based on the
+;;;;     (this means that this data function did its work based on the
 ;;;;     current value)
 ;;;;     then
 ;;;;         the new value is swapped in
 ;;;;     else
-;;;;         the swap function is retried
-;;;;         (using the current value as input to the swap function).
+;;;;         the data function is retried
+;;;;         (using the current value as input to the data function).
 ;;;;
-;;;; - Another atom is used to keep track of how many times the swap function
+;;;; - Another atom is used to keep track of how many times the data function
 ;;;;   is called.

 (def competing-updates-atom (atom 0))


release bigquery 0.2.0

release bigquery 0.2.0

--- bigquery/project.clj
+++ bigquery/project.clj
@@ -1,4 +1,4 @@
-(defproject gclouj/bigquery "0.2.0-SNAPSHOT"
+(defproject gclouj/bigquery "0.2.0"
   :description "Google Cloud BigQuery"
   :url "https://github.com/pingles/gclouj"
   :license {:name "Eclipse Public License"


fix validate-tag

fix validate-tag

--- src/main/clojure/clojure/tools/analyzer/passes/js/validate.clj
+++ src/main/clojure/clojure/tools/analyzer/passes/js/validate.clj
@@ -17,7 +17,7 @@
 (defn validate-tag [t {:keys [env] :as ast}]
   (let [tag (ast t)]
     (if (symbol? tag)
-      (if-let [var (resolve-var t env)]
+      (if-let [var (resolve-var tag env)]
         (if (or (= :type (:op var))
                 (:protocol (meta var)))
           (symbol (:ns var) (:name var))
@@ -25,15 +25,16 @@
                           (merge {:var var
                                   :ast (prewalk ast cleanup)}
                                  (source-info env)))))
-        (if (or (not (namespace t))
-                (resolve-ns (symbol (namespace t))))
-          (throw (ex-info (str "Cannot resolve: " t)
-                          (merge {:sym t
+        (if (or ('#{boolean string number clj-nil any function object array} tag)
+                (and (namespace tag)
+                     (not (resolve-ns (symbol (namespace tag))))))
+          tag
+          (throw (ex-info (str "Cannot resolve: " tag)
+                          (merge {:sym tag
                                   :ast (prewalk ast cleanup)}
-                                 (source-info env))))
-          t))
-      (throw (ex-info (str "Invalid tag: " t)
-                      (merge {:tag t
+                                 (source-info env))))))
+      (throw (ex-info (str "Invalid tag: " tag)
+                      (merge {:tag tag
                               :ast (prewalk ast cleanup)}
                              (source-info env)))))))


CMR-1297 Fixes visibility of helper function

--- system-int-test/src/cmr/system_int_test/data2/atom.clj
+++ system-int-test/src/cmr/system_int_test/data2/atom.clj
@@ -233,7 +233,7 @@
   (let [non-browse-coll-links (filter #(not= "GET RELATED VISUALIZATION" (:type %)) (:related-urls coll))]
     (concat related-urls (map #(assoc % :inherited "true") non-browse-coll-links))))

-(defn- collection->expected-atom
+(defn collection->expected-atom
   "Returns the atom map of the collection"
   [collection]
   (let [{{:keys [short-name version-id processing-level-id collection-data-type]} :product


load config file relative to app root

load config file relative to app root

--- src/galleon.clj
+++ src/galleon.clj
@@ -62,12 +62,12 @@
   (if (.isFile (File. path)) true false))

 (defn load-system-config []
-  (let [path "galleon-conf.edn"]
-    (if (file-exists? path)
-      (assoc (clojure.edn/read-string (slurp path))
-             :enqueue-fn gw-enqueue/enqueue!
-             )
-      (throw (Exception. (str "Config file missing: " path))))))
+  (let [file
+        #_
+        "/home/moquist/projects/galleon/galleon-conf.edn"
+        (immutant.util/app-relative "galleon-conf.edn")]
+    (assoc (clojure.edn/read-string (slurp file))
+      :enqueue-fn gw-enqueue/enqueue!)))

 (defn init-schema!
   "Combines schematode schema and transacts it in."


Added docstrings to the api functions.

Added docstrings to the api functions.

--- src/gbu/api.clj
+++ src/gbu/api.clj
@@ -18,6 +18,7 @@
    :content_type "json"})

 (defn- qs-map
+  "Given a querystring builds a map with its keys and values."
   [qs]
   (let [split (fn [x s] (map str (.split x s)))]
     (->> (split qs "&")
@@ -25,11 +26,15 @@
       (map vec)
       (into {}))))

-(defn token [cookies]
+(defn token
+  "Given the map of cookies returns the value of
+the GitHub's token if present or nil otherwise."
+  [cookies]
   (when-let [{:keys [value]} (cookies "token")]
     value))

 (defn login
+  "Starts the OAuth process."
   []
   (let [url (str authorize-url
               "?client_id=" client-id
@@ -38,21 +43,26 @@
    :headers {"location" url}}))

 (defn callback
+  "Handles the callback from GitHub OAuth flow."
   [code]
   (let [params {:form-params {:client_id client-id
                               :client_secret client-secret
                               :code code}}
         {:keys [body]} (client/post access-token-url params)
-        token  ((qs-map body)"access_token")]
+        token  ((qs-map body) "access_token")]
     {:status 302
      :headers {"location" "/repos"
                "set-cookie" (str "token=" token ";Path=/")}}))

 (defn- owner?
+  "Returns true if the user has admin permissions over the
+repo and false otherwise."
   [repo]
   (get-in repo [:permissions :admin]))

 (defn- get-webhook
+  "Given a repository checks if it has a specific webhook
+enables. Returns the webhook if present or nil otherwise."
   [token user reponame]
   (let [hooks        (repos/hooks user reponame {:oauth-token token})
         gbu-webhook? #(= (:url webhook-config)
@@ -63,6 +73,8 @@

 (defn- add-status
+  "Given a repo adds the status of the webhook as either
+:on of :off in the :gbu key."
   [token repo]
   (let [user     (get-in repo [:owner :login])
         reponame (:name repo)
@@ -70,6 +82,8 @@
     (assoc repo :gbu status)))

 (defn- all-user-repos
+  "Returns a list of repositories where the user
+has the necessary permissions to create a webhook."
   [token]
   (let [opts       {:oauth-token token
                     :type :owner}
@@ -81,6 +95,8 @@
       (map (partial add-status token)))))

 (defn repos
+  "Returns all of the repos in which the user has
+permission for creating webhooks."
   [cookies]
   (if-let [token (token cookies)]
     {:status 200
@@ -89,6 +105,7 @@
      :body "Token missing."}))

 (defn- create-webhook
+  "Create a webhook in the specified repo."
   [token user repo]
   (let [opts    {:oauth-token token
                  :active true
@@ -96,6 +113,10 @@
     (repos/create-hook user repo "web" webhook-config opts)))

 (defn- add-gbu-user
+  "Add the GBU user to the repository.
+TODO: for private repositories the user should be
+either added as a collaborator (user repo) or as
+part of a team (org repo)."
   [token repo]
   (let [owner (:owner repo)]
     (if (= (:type owner) "Organization")
@@ -105,6 +126,7 @@
       (prn "Add user as collaborator"))))

 (defn on
+  "Enables the webhook for the specified repository."
   [cookies user reponame]
   (let [token   (token cookies)
         repo    (repos/specific-repo user reponame {:oauth-token token})]
@@ -115,6 +137,7 @@
      :body "done"}))

 (defn off
+  "Disables the webhook for the specified repository."
   [cookies user reponame]
   (let [token   (token cookies)
         webhook (get-webhook token user reponame)]


(SERVER-835) Only put certificate-status in access-control map

This commit changes the `config->ca-settings` function to only associate
the contents of the `:certificate-status` key with the `access-control`
map instead of just the entire contents of the `certificate-authority`
section.  Associating the entire `certificate-authority` section was a
problem with PE Puppet Server since its `reverse-proxy-ca-service`
implementation of the CA service protocol has other proxy-related
content that should not be stored in the `access-control` key.

--- src/clj/puppetlabs/puppetserver/certificate_authority.clj
+++ src/clj/puppetlabs/puppetserver/certificate_authority.clj
@@ -718,7 +718,8 @@
   [{:keys [puppet-server jruby-puppet certificate-authority]}]
   (-> (select-keys puppet-server (keys CaSettings))
       (assoc :ruby-load-path (:ruby-load-path jruby-puppet))
-      (assoc :access-control certificate-authority)))
+      (assoc :access-control (select-keys certificate-authority
+                                          [:certificate-status]))))

 (schema/defn ^:always-validate
   config->master-settings :- MasterSettings


Update to dynapath 0.2.4

Update to dynapath 0.2.4

0.2.3 doesn't work properly under Java 9.

--- boot/pod/project.clj
+++ boot/pod/project.clj
@@ -17,5 +17,5 @@
                    :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies   [[boot/base                               ~version :scope "provided"]
                    [org.clojure/clojure                     "1.6.0"  :scope "provided"]
-                   [org.tcrawley/dynapath                   "0.2.3"  :scope "compile"]
+                   [org.tcrawley/dynapath                   "0.2.4"  :scope "compile"]
                    [org.projectodd.shimdandy/shimdandy-impl "1.2.0"  :scope "compile"]])


fix flex-box problem

fix flex-box problem

--- frontend/components/app.cljs
+++ frontend/components/app.cljs
@@ -43,7 +43,7 @@
         (reset! keymap {["ctrl+s"] persist-state!
                         ["ctrl+r"] restore-state!})
         (html/html
-         [:div {:class (if (:current-user app) "inner" "outer")}
+         [:div#om-app {:class (if (:current-user app) "inner" "outer")}
           (om/build keyq/KeyboardHandler app
                     {:opts {:keymap keymap
                             :error-ch (get-in app [:comms :errors])}})


fully purged nlp utils

fully purged nlp utils

--- src/aristotle/video.clj
+++ src/aristotle/video.clj
@@ -2,7 +2,6 @@
   (:use clojure.test
         clojure.pprint)
   (:require [clojure.spec.alpha :as s]
-            [aristotle.nlp-utils :as nlp-utils]
             [aristotle.config-loader :as config]
             [aristotle.youtube :as youtube]
             [clj-http.client :as client]


Get rid of this println

Get rid of this println

--- fulcro-todo/src/dev/user.clj
+++ fulcro-todo/src/dev/user.clj
@@ -20,6 +20,5 @@
      (reset! figwheel (component/system-map
                         :figwheel-system (fig/figwheel-system preferred-config)
                         :css-watcher (fig/css-watcher {:watch-paths ["resources/public/css"]})))
-     (println "STARTING FIGWHEEL ON BUILDS: " build-ids)
      (swap! figwheel component/start)
      (fig/cljs-repl (:figwheel-system @figwheel)))))


Adds secure flag

Adds secure flag

--- src/adzerk/boot_reload.clj
+++ src/adzerk/boot_reload.clj
@@ -22,12 +22,14 @@
          (sort-by :dependency-order)
          (map tmp-path))))

-(defn- start-server [pod {:keys [ip port ws-host] :as opts}]
+(defn- start-server [pod {:keys [ip port ws-host secure?] :as opts}]
   (let [{:keys [ip port]}
         (pod/with-call-in pod (adzerk.boot-reload.server/start ~opts))
         host
-        (cond ws-host ws-host (= ip "0.0.0.0") "localhost" :else ip)]
-    (util/with-let [url (format "ws://%s:%d" host port)]
+        (cond ws-host ws-host (= ip "0.0.0.0") "localhost" :else ip)
+        proto (if secure? "wss" "ws")
+        ]
+    (util/with-let [url (format "%s://%s:%d" proto host port)]
       (util/info "<< started reload server on %s >>\n" url))))

 (defn- write-cljs! [f url on-jsload]
@@ -79,14 +81,15 @@
    p port PORT       int  "The (optional) port the websocket server listens on."
    w ws-host WSADDR  str  "The (optional) websocket host address to pass to clients."
    j on-jsload SYM   sym  "The (optional) callback to call when JS files are reloaded."
-   a asset-path PATH str  "The (optional) asset-path. This is removed from the start of reloaded urls."]
+   a asset-path PATH str  "The (optional) asset-path. This is removed from the start of reloaded urls."
+   s secure          bool  "(Optional) flag to indicate whether to connect via wss. Defaults to false."]

   (let [pod  (make-pod)
         src  (tmp-dir!)
         tmp  (tmp-dir!)
         prev (atom nil)
         out  (doto (io/file src "adzerk" "boot_reload.cljs") io/make-parents)
-        url  (start-server @pod {:ip ip :port port :ws-host ws-host})]
+        url  (start-server @pod {:ip ip :port port :ws-host ws-host :secure? secure})]
     (set-env! :source-paths #(conj % (.getPath src)))
     (write-cljs! out url on-jsload)
     (comp
@@ -99,4 +102,4 @@
         (-> fileset (add-resource tmp) commit!))
       (with-post-wrap fileset
         (send-changed! @pod asset-path (changed @prev fileset))
-        (reset! prev fileset)))))+        (reset! prev fileset)))))


I actually added a predicate to weaverworld. (type-packageName)  I'm so proud now.

--- damp.ekeko.aspectj.plugin/src/damp/ekeko/aspectj/weaverworld.clj
+++ damp.ekeko.aspectj.plugin/src/damp/ekeko/aspectj/weaverworld.clj
@@ -468,6 +468,15 @@
                                                (symbol "members")
                                                ?set)
                   ?aspect)))))
+
+
+(defn
+  type-packageName
+  "Relation between a type and its declared package name."
+  [?resolvedtype ?name]
+  (all
+    (type ?resolvedtype)
+    (equals ?name (.getPackageName ?resolvedtype))))

 (defn


comments

comments

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -67,27 +67,33 @@
   [spec model depth & [from-bolts]]
   ;;
   ;; Given a spec and a model, return the (potentially infinite) set
-  ;; of all trees, in ascending depth, that satisfy the given spec.
-  ;;
+  ;; of all trees, in ascending head-depth, that satisfy the given spec.
+  ;;
+  ;; 'Head-depth' means the depth of the tree, measured by longest path of
+  ;; only H's from the root down to a leaf, minus 1. In other words, if a tree has
+  ;; head-depth=N, then it has as its longest H path within it [H..H..H] whose
+  ;; length is N+1.
   ;;
   ;; These trees look like:
   ;;
-  ;;  First all the depth=0 trees (simply lexemes) that satisfy the spec:
+  ;;  First all the head-depth=0 trees (simply lexemes) that satisfy the spec:
   ;;
   ;;         H .. H ..

-  ;;   Then we have the trees of depth=1 that satisfy the spec:
-  ;;
-  ;;       H         H
-  ;;  ..  / \  ..   / \ ..
-  ;;     H   C     C   H
-  ;;
-  ;;   And then all trees of depth=2 that satisfy the spec:
+  ;;   Then we have the trees of head-depth=1 that satisfy the spec:
+  ;;
+  ;;       H         H       H      (note that the last-shown tree has
+  ;;  ..  / \  ..   / \ ..  / \  ..  a head-depth of 1, not 2, because
+  ;;     H   C     C   H   C   H     there is no path [H->H->H], but
+  ;;                      / \         there is a path [H->H].
+  ;;                     H   C
+  ;;
+  ;;   And then all trees of head-depth=2 that satisfy the spec:
   ;;
   ;;
   ;;       H            H
   ;;      / \          / \
-  ;;  .. H   C  ..    C   H ..
+  ;;  .. H   C  ..    H   H ..
   ;;    /            / \
   ;;   H            C   H
   ;;


Make use of resolve-macro-var

Make use of resolve-macro-var

--- ClojureScript/replete/src/replete/core.cljs
+++ ClojureScript/replete/src/replete/core.cljs
@@ -81,6 +81,18 @@
      (s/replace #" \n  " "")
      (s/replace #"\n  " " "))))

+;; Copied from cljs.analyzer.api (which hasn't yet been converted to cljc)
+(defn resolve
+  "Given an analysis environment resolve a var. Analogous to
+   clojure.core/resolve"
+  [env sym]
+  {:pre [(map? env) (symbol? sym)]}
+  (try
+    (ana/resolve-var env sym
+      (ana/confirm-var-exists-throw))
+    (catch :default _
+      (ana/resolve-macro-var env sym))))
+
 (defn ^:export read-eval-print [line]
   (binding [ana/*cljs-ns* @current-ns
             *ns* (create-ns @current-ns)
@@ -99,7 +111,7 @@
                       (repl/print-doc (repl-special-doc (second form)))
                       (repl/print-doc
                         (let [sym (second form)
-                              var (ana/resolve-var env sym (ana/confirm-var-exists-throw))]
+                              var (resolve env sym)]
                           (update (:meta var)
                             :doc (if (user-interface-idiom-ipad?)
                                    identity


add 'jansi-clj' dependency.

add 'jansi-clj' dependency.

--- project.clj
+++ project.clj
@@ -2,7 +2,8 @@
   :description "Check your Projects for outdated Dependencies."
   :url "https://github.com/xsc/lein-ancient"
   :dependencies [[rewrite-clj "0.3.8"]
-                 [ancient-clj "0.1.9"]]
+                 [ancient-clj "0.1.9"]
+                 [jansi-clj "0.1.0-SNAPSHOT"]]
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :profiles {:dev {:dependencies [[midje "1.6.0"]]


Bump to 5.6.1-SNAPSHOT

Bump to 5.6.1-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject cheshire "5.6.0"
+(defproject cheshire "5.6.1-SNAPSHOT"
   :description "JSON and JSON SMILE encoding, fast."
   :url "https://github.com/dakrone/cheshire"
   :license {:name "The MIT License"


Bumped version for next dev cycle.

Bumped version for next dev cycle.

--- project.clj
+++ project.clj
@@ -14,7 +14,7 @@
        ns
        "\u001B[35m]\u001B[33m λ\u001B[m=> "))

-(defproject gov.nasa.earthdata/cmr-exchange-query "0.2.0"
+(defproject gov.nasa.earthdata/cmr-exchange-query "0.3.0-SNAPSHOT"
   :description "Cross-project query and parameter parsing and transformations"
   :url "https://github.com/cmr-exchange/cmr-exchange-query"
   :license {


PLD: set license and url

PLD: set license and url

--- project.clj
+++ project.clj
@@ -1,5 +1,7 @@
 (defproject org.clojars.onaio/hatti "0.1.8-SNAPSHOT"
   :description "A cljs dataview from your friends at Ona.io"
+  :license "Apache 2, see LICENSE"
+  :url "https://github.com/onaio/hatti"
   :dependencies [ ;; CORE HATTI REQUIREMENTS
                  [org.clojure/clojure "1.7.0"]
                  [org.clojure/clojurescript "0.0-3308"]


Add plugin.

Add plugin.

--- project.clj
+++ project.clj
@@ -22,5 +22,6 @@
                                   [environ "1.0.0"]
                                   [mysql/mysql-connector-java "5.1.25"]]
                    :plugins [[lein-midje "3.1.3"]
+                             [lein-set-version "0.4.1"]
                              [lein-pprint "1.1.1"]]}
              :circle-ci {:jvm-opts ["-Xmx4g"]}})


Version 77-SNAPSHOT

Version 77-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojars-web "76"
+(defproject clojars-web "77-SNAPSHOT"
   :min-lein-version "2.0.0"
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/tools.cli "0.2.1"]


org.clojure/test.check 0.9.0 released

org.clojure/test.check 0.9.0 released

--- project.clj
+++ project.clj
@@ -41,7 +41,7 @@
   :main ^:skip-aot icecap.core
   :target-path "target/%s"
   :profiles {:uberjar {:aot :all}
-             :dev {:dependencies [[org.clojure/test.check "0.8.2"]]
+             :dev {:dependencies [[org.clojure/test.check "0.9.0"]]

                    :aliases ^:replace {"lint"
                                        ["do"


Version 6.4.0

Version 6.4.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(def ps-version "6.4.0-SNAPSHOT")
+(def ps-version "6.4.0")

 (defn deploy-info
   [url]


Adding kibit plugin

Adding kibit plugin

--- project.clj
+++ project.clj
@@ -14,7 +14,8 @@
   :plugins [[lein-midje "3.1.3"]
             [lein-pprint "1.1.1"]
             [lein-ancient "0.5.5"]
-            [lein-cloverage "1.0.2"]]
+            [lein-cloverage "1.0.2"]
+            [lein-kibit "0.0.8"]]

   :repl-options {:welcome (println "Welcome to the magical world of the repl!")
                  :port 4001}


set release deployment target to clojars

--- project.clj
+++ project.clj
@@ -5,4 +5,5 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [com.machinepublishers/jbrowserdriver "0.17.1"]]
-  :profiles {:test {:dependencies [[org.slf4j/slf4j-simple "1.7.2"]]}})
+  :profiles {:test {:dependencies [[org.slf4j/slf4j-simple "1.7.2"]]}}
+  :deploy-repositories [["releases" :clojars]])


Bump to 5.7.1-SNAPSHOT

Bump to 5.7.1-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject cheshire "5.7.0"
+(defproject cheshire "5.7.1-SNAPSHOT"
   :description "JSON and JSON SMILE encoding, fast."
   :url "https://github.com/dakrone/cheshire"
   :license {:name "The MIT License"


Version 0.37.3

Version 0.37.3

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject nhl-score-api "0.37.2"
+(defproject nhl-score-api "0.37.3"
   :description "A JSON API that returns the scores and goals from the latest finished NHL games."
   :license {:name "MIT"
             :url "https://opensource.org/licenses/MIT"}


Update dependencies.

Update dependencies.

--- project.clj
+++ project.clj
@@ -13,7 +13,7 @@

   ;; All profile dependencies
   :dependencies [
-    [org.clojure/clojure "1.9.0-alpha20"] ; Lisp on the JVM http://clojure.org/documentation
+    [org.clojure/clojure "1.9.0-beta1"] ; Lisp on the JVM http://clojure.org/documentation
     [environ "1.1.0"] ; Environment settings from different sources https://github.com/weavejester/environ
     [hiccup "2.0.0-alpha1"] ; HTML rendering https://github.com/weavejester/hiccup
     [manifold "0.1.7-alpha5"] ; Async programming tools https://github.com/ztellman/manifold
@@ -69,7 +69,7 @@
         [lein-bikeshed "0.4.1"] ; Check for code smells https://github.com/dakrone/lein-bikeshed
         [lein-checkall "0.1.1"] ; Runs bikeshed, kibit and eastwood https://github.com/itang/lein-checkall
         [lein-pprint "1.1.2"] ; pretty-print the lein project map https://github.com/technomancy/leiningen/tree/master/lein-pprint
-        [lein-ancient "0.6.10"] ; Check for outdated dependencies https://github.com/xsc/lein-ancient
+        [lein-ancient "0.6.12"] ; Check for outdated dependencies https://github.com/xsc/lein-ancient
         [lein-spell "0.1.0"] ; Catch spelling mistakes in docs and docstrings https://github.com/cldwalker/lein-spell
         [lein-deps-tree "0.1.2"] ; Print a tree of project dependencies https://github.com/the-kenny/lein-deps-tree
         [venantius/yagni "0.1.4"] ; Dead code finder https://github.com/venantius/yagni


Bump alia and thus the datastax driver.

Bump alia and thus the datastax driver.

--- project.clj
+++ project.clj
@@ -62,7 +62,7 @@

                  [ankha "0.1.3"]

-                 [cc.qbits/alia "2.0.0-rc3" :exclusions [com.google.guava/guava org.flatland/useful]]
+                 [cc.qbits/alia "2.0.0-rc4" :exclusions [com.google.guava/guava org.flatland/useful]]
                  [cc.qbits/hayt "2.0.0-beta4"]
                  ;; add lz4 to avoid startup warning.
                  [net.jpountz.lz4/lz4 "1.2.0"]


Updated Codox plugin to 0.6.4

Updated Codox plugin to 0.6.4

--- project.clj
+++ project.clj
@@ -8,7 +8,7 @@
                  [org.clojure/tools.macro "0.1.0"]
                  [clout "1.1.0"]
                  [ring/ring-core "1.1.5"]]
-  :plugins [[codox "0.6.3"]]
+  :plugins [[codox "0.6.4"]]
   :codox {:src-dir-uri "http://github.com/weavejester/compojure/blob/1.1.3"
           :src-linenum-anchor-prefix "L"}
   :profiles


next iteration

next iteration

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject aemette/lein-template "0.3.1"
+(defproject aemette/lein-template "0.4.0-SNAPSHOT"
   :description "A batteries-included Leiningen template for Om"
   :url "https://github.com/anmonteiro/aemette"
   :license {:name "Eclipse Public License"


Switch repositories from local to clojars.org

--- project.clj
+++ project.clj
@@ -2,9 +2,9 @@
   :description "dotenv: Load environment variables from .env file into the JVM System Properties"
   :url "https://github.com/primedia/clj-dotenv"
   :dependencies [ [org.clojure/clojure "1.5.1"]
-                  ;;[org.clojars.jackmorrill/dotenv   "0.1.0"]
-                  [local/dotenv.core "0.1.0"]
-                  ;;[org.clojars.jackmorrill/environs "0.1.0"]
-                  [local/environs.core "0.1.0"]
+                  [org.clojars.jackmorrill/dotenv   "0.1.0"]
+                  ;;[local/dotenv.core "0.1.0"]
+                  [org.clojars.jackmorrill/environs "0.1.0"]
+                  ;;[local/environs.core "0.1.0"]
                 ]
   :repositories {"project" "file:repo"})


lein-release plugin: bumped version from 0.3.4 to 0.3.5-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -4,7 +4,7 @@
     [http-kit "2.1.18"]
     [hiccup "1.0.5"]])

-(defproject racehub/om-bootstrap "0.3.4"
+(defproject racehub/om-bootstrap "0.3.5-SNAPSHOT"
   :description "Bootstrap meets Om."
   :url "http://github.com/racehub/om-bootstrap"
   :license {:name "MIT License"


Version 0.16.0

Version 0.16.0

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject io.sarnowski/swagger1st "0.16.0-SNAPSHOT"
+(defproject io.sarnowski/swagger1st "0.16.0"
   :description "A ring handler that does routing based on a swagger definition."
   :url "https://github.com/sarnowski/swagger1st"


Work on implementing a count accessor

Work on implementing a count accessor

--- src/beehive/metrics.clj
+++ src/beehive/metrics.clj
@@ -38,6 +38,9 @@
             (transient {})
             (.getEnumConstants (.getMetricClazz counts)))))

+(defn- counter-to-count [^PartitionedCount counts metric]
+  (.getCount counts metric))
+
 (defn- switcher [^Metrics m]
   ;; TODO: Clarify Precipice Interface
   (if (instance? Capturer m)
@@ -73,14 +76,27 @@
     (throw (UnsupportedOperationException. "remove"))))

-(defn decorate1 [{:keys [start-millis precipice-metrics]}]
+(defn get-count1 [{:keys [start-millis precipice-metrics]} metric]
   (let [current-millis (System/currentTimeMillis)]
-    (if (instance? Rolling precipice-metrics)
-      (->MetricIterator
-        current-millis
-        counter-to-map
-        (.intervals ^Rolling precipice-metrics))
-      (->SingleIterator start-millis current-millis precipice-metrics switcher false))))
+    (iterator-seq
+      (if (instance? Rolling precipice-metrics)
+        (->MetricIterator
+          current-millis
+          counter-to-map
+          (.intervals ^Rolling precipice-metrics))
+        (->SingleIterator
+          start-millis current-millis precipice-metrics switcher false)))))
+
+(defn get-counts1 [{:keys [start-millis precipice-metrics]}]
+  (let [current-millis (System/currentTimeMillis)]
+    (iterator-seq
+      (if (instance? Rolling precipice-metrics)
+        (->MetricIterator
+          current-millis
+          counter-to-map
+          (.intervals ^Rolling precipice-metrics))
+        (->SingleIterator
+          start-millis current-millis precipice-metrics switcher false)))))

 (defprotocol CountsView


Release 0.1.1.

Release 0.1.1.

--- project.clj
+++ project.clj
@@ -1,8 +1,7 @@
-(defproject sprint-poker "0.1.0-SNAPSHOT"
-  :description "FIXME: write description"
-  :url "http://example.com/FIXME"
-  :license {:name "Eclipse Public License"
-            :url "http://www.eclipse.org/legal/epl-v10.html"}
+(defproject sprint-poker "0.1.1"
+  :description "Simple planning poker app."
+  :url "https://github.com/tokenshift/sprint-poker"
+  :license {:url "https://github.com/tokenshift/sprint-poker/blob/master/LICENSE"}
   :dependencies [[compojure "1.3.2"]
                  [org.clojure/algo.generic "0.1.2"]
                  [org.clojure/clojure "1.6.0"]


add prep-task

add prep-task

--- project.clj
+++ project.clj
@@ -35,7 +35,7 @@
               :figwheel {:nrepl-port 7888
                          :css-dirs ["resources/public"]}}}
   :plugins [[lein-cljsbuild "1.1.0"]]
-  ;:prep-tasks ["compile" ["cljsbuild" "once" "release"]]
+  :prep-tasks ["compile" ["cljsbuild" "once" "release"]]
   :main bulldog.core
   :uberjar-name "bulldog-standalone.jar"
   :clean-targets ^{:protect false} ["resources/public/js" "target" "out"]


Release 2.0.3

Release 2.0.3

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject cheshire "2.0.3-SNAPSHOT"
+(defproject cheshire "2.0.3"
   :description "JSON and JSON SMILE encoding, fast."
   :url "https://github.com/dakrone/cheshire"
   :dependencies [[org.clojure/clojure "1.3.0"]


bump version

bump version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject optimus-sass "0.0.1"
+(defproject optimus-sass "0.0.2"
   :description "Sass/SCSS asset loader for Optimus"
   :url "http://github.com/DomKM/optimus-sass"
   :license {:name "Eclipse Public License"


Version 102

Version 102

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojars-web "102-SNAPSHOT"
+(defproject clojars-web "102"
   :min-lein-version "2.0.0"
   :dependencies [[org.clojure/clojure "1.10.1"]
                  [org.clojure/core.memoize "0.8.2"]


Add Leiningen to dev dependencies

Add Leiningen to dev dependencies

--- project.clj
+++ project.clj
@@ -5,4 +5,5 @@
             :url "http://opensource.org/licenses/MIT"}
   :deploy-repositories [["releases" :clojars]]
   :eval-in-leiningen true
-  :profiles {:dev {:dependencies [[me.raynes/fs "1.4.6"]]}})
+  :profiles {:dev {:dependencies [[leiningen "2.5.1"]
+                                  [me.raynes/fs "1.4.6"]]}})


Remove deprecated libraries from project.clj.

--- project.clj
+++ project.clj
@@ -44,6 +44,4 @@
      [org.clojure/clojure "1.9.0"]
      #_[org.clojure/clojure "1.8.0"]
      [rewrite-cljs "0.4.4" :exclusions [[org.clojure/clojurescript]]]
-     [rewrite-clj "0.6.1" :exclusions [[com.cemerick/austin]]]
-     #_[table "0.4.0" :exclusions [[org.clojure/clojure]]]
-     #_[cprop "0.1.6"]])
+     [rewrite-clj "0.6.1" :exclusions [[com.cemerick/austin]]]])


lein-release plugin: preparing 0.6 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject chaintool "0.6-SNAPSHOT"
+(defproject chaintool "0.6"
   :description "hyperledger chaincode tool"
   :url "https://github.com/ghaskins/chaintool"
   :license {:name "Apache License"


Switches clj-ml package back to com.leadtune's version.

--- project.clj
+++ project.clj
@@ -13,5 +13,5 @@
                  [amalloy/ring-gzip-middleware "0.1.1"]
                  [ring-middleware-format "0.1.1"]
                  [com.cemerick/friend "0.0.8"]
-                 [org.clojars.ryanmcg/clj-ml "0.2.1-SNAPSHOT"]]
+                 [com.leadtune/clj-ml "0.2.1"]]
   :main cadence.server)


(maint) update project metadata to reflect license

--- project.clj
+++ project.clj
@@ -8,8 +8,8 @@
 (defproject puppetlabs/pcp-client "0.0.8-SNAPSHOT"
   :description "client library for PCP"
   :url "https://github.com/puppetlabs/clj-pcp-client"
-  :license {:name ""
-            :url ""}
+  :license {:name "Apache License, Version 2.0"
+            :url "http://www.apache.org/licenses/LICENSE-2.0.html"}

   :pedantic? :abort


Fix lib version.

Fix lib version.

--- project.clj
+++ project.clj
@@ -24,7 +24,7 @@
     [org.clojure/tools.namespace "0.3.0-alpha4" :exclusions [org.clojure/tools.reader]]

     ;; Library for OC projects https://github.com/open-company/open-company-lib
-    [open-company/lib "0.16.37asd"]
+    [open-company/lib "0.16.37"]
     ;; In addition to common functions, brings in the following common dependencies used by this project:
     ;; Component - Component Lifecycle https://github.com/stuartsierra/component
     ;; Schema - Data validation https://github.com/Prismatic/schema


bump to 0.3.1-SNAPSHOT

bump to 0.3.1-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject puppetlabs/kitchensink "0.3.0"
+(defproject puppetlabs/kitchensink "0.3.1-SNAPSHOT"
   :description "Clojure utility functions"
   :license {:name "Apache License, Version 2.0"
             :url "http://www.apache.org/licenses/LICENSE-2.0.html"}


version bump

version bump

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.twitter/carbonite "1.3.2-SNAPSHOT"
+(defproject com.twitter/carbonite "1.3.2"
   :source-paths ["src/clj"]
   :java-source-paths ["src/jvm"]
   :javac-options ["-source" "1.6" "-target" "1.6"]


lein-release plugin: bumped version from 0.1.8 to 0.1.9-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject racehub/stripe-clj "0.1.8"
+(defproject racehub/stripe-clj "0.1.9-SNAPSHOT"
   :description "Schemafied Stripe bindings for Clojure."
   :url "https://github.com/racehub/stripe-clj"
   :license {:name "Eclipse Public License"


Update dependencies

Update dependencies

--- project.clj
+++ project.clj
@@ -1,23 +1,23 @@
 (defproject env-logger "0.2.11-SNAPSHOT"
   :description "A simple data logger"
   :url "https://github.com/terop/env-logger"
-  :dependencies [[org.clojure/clojure "1.10.0"]
+  :dependencies [[org.clojure/clojure "1.10.1"]
                  [org.immutant/web "2.1.10"]
                  [compojure "1.6.1"]
                  [ring "1.7.1"]
                  [ring/ring-defaults "0.3.2"]
-                 [org.postgresql/postgresql "42.2.5"]
+                 [org.postgresql/postgresql "42.2.6"]
                  [org.clojure/java.jdbc "0.7.9"]
                  [honeysql "0.9.4"]
                  [clj-time "0.15.1"]
                  [cheshire "5.8.1"]
                  [selmer "1.12.12"]
-                 [clj-http "3.9.1"]
+                 [clj-http "3.10.0"]
                  [org.clojure/tools.logging "0.4.1"]
                  [org.slf4j/slf4j-log4j12 "1.7.26"]
                  [com.yubico/yubico-validation-client2 "3.0.5"]
-                 [buddy/buddy-hashers "1.3.0"]
-                 [buddy/buddy-auth "2.1.0"]
+                 [buddy/buddy-hashers "1.4.0"]
+                 [buddy/buddy-auth "2.2.0"]
                  [org.clojars.pntblnk/clj-ldap "0.0.16"]
                  [org.influxdb/influxdb-java "2.15"]]
   :main env-logger.handler


Update cljs -> 0.0-3297

Update cljs -> 0.0-3297

--- project.clj
+++ project.clj
@@ -5,7 +5,7 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :min-lein-version "2.0.0"
   :dependencies [[org.clojure/clojure "1.7.0-RC1"]
-                 [org.clojure/clojurescript "0.0-3291"]
+                 [org.clojure/clojurescript "0.0-3297"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [com.stuartsierra/component "0.2.3"]
                  [environ "1.0.0"]


Changed enlive version to 1.0.0

Changed enlive version to 1.0.0

--- project.clj
+++ project.clj
@@ -9,6 +9,8 @@
    [ring "1.0.1"]
    [ring/ring-servlet "1.0.1"]
    [ring/ring-jetty-adapter "1.0.1"]
+   [sandbar "0.4.0-SNAPSHOT"]
+   [enlive "1.0.0"]
    ;; java deps
    [joda-time/joda-time "2.0"]
    [ch.qos.logback/logback-classic "1.0.0"]


Version 0.15.0-SNAPSHOT

Version 0.15.0-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject crucible "0.14.0"
+(defproject crucible "0.15.0-SNAPSHOT"
   :description "AWS Cloudformation templates in Clojure"
   :url "http://github.com/brabster/crucible"
   :license {:name "Eclipse Public License"


lein-release plugin: bumped version from 0.1.2 to 0.1.3-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject ig/swagger-search "0.1.2"
+(defproject ig/swagger-search "0.1.3-SNAPSHOT"
   :description "An application that collects and indexes swagger docs from your microservices architecture"
   :url "https://github.com/IG-Group/swagger-search"
   :license {:name "Apache License 2.0"


New version

New version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject expound "0.1.2"
+(defproject expound "0.1.3-SNAPSHOT"
   :description "Human-optimized error messages for clojure.spec"
   :url "https://github.com/bhb/expound"
   :license {:name "Eclipse Public License"


Version 3.19.0 [ci skip]

Version 3.19.0 [ci skip]

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojush "3.18.0-1-SNAPSHOT"
+(defproject clojush "3.19.0"
   :description "The Push programming language and the PushGP genetic programming
                 system implemented in Clojure. See http://pushlanguage.com"
   :license {:name "Eclipse Public License"


Updated version for next release cycle

Updated version for next release cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject com.palletops/api-builder "0.3.0"
+(defproject com.palletops/api-builder "0.3.1-SNAPSHOT"
   :description "Write api functions with domain information."
   :url "http://github.com/palletops/api-builder"
   :license {:name "Eclipse Public License"


Add a producer and a printer to the count-words example

--- clstreams/src/clstreams/examples/count_words/system.clj
+++ clstreams/src/clstreams/examples/count_words/system.clj
@@ -1,11 +1,21 @@
 (ns clstreams.examples.count-words.system
   (:require [clstreams.examples.count-words.pipelines :as pipelines]
             [clstreams.examples.count-words.webapi :as webapi]
-            [com.stuartsierra.component :as component]))
+            [clstreams.kstreams.component :refer [producer-send!]]
+            [clstreams.kstreams.helpers :as helpers]
+            [com.stuartsierra.component :as component])
+  (:import org.apache.kafka.common.serialization.Serdes))

 (defn count-words-system []
   (component/system-map
+   :producer (helpers/new-manual-producer "streams-file-input")
    :pipeline (pipelines/count-words)
+   :printer (helpers/new-print-topic "streams-wordcount-output"
+                                     {:key-serde (Serdes/String)
+                                      :value-serde (Serdes/Long)})
    :webapi (component/using
             (webapi/web-test)
             [:pipeline])))
+
+(defn produce-words [system & lines]
+  (apply producer-send! (:producer system) (for [line lines] ["" line])))


Remove unusued requires in db

Remove unusued requires in db

--- src/braid/server/db.clj
+++ src/braid/server/db.clj
@@ -2,12 +2,7 @@
   (:require [datomic.api :as d]
             [mount.core :refer [defstate]]
             [braid.server.conf :refer [config]]
-            [clojure.edn :as edn]
-            [clojure.string :as string]
-            [braid.server.schema :refer [schema]]
-            [braid.server.quests.db]
-            [braid.server.db user message group invitation thread tag bot
-             upload]))
+            [braid.server.schema :refer [schema]]))

 (defn init!
   "set up schema"


Throw an exception with clear message when no password is provided for encrypted priv key.

--- src/buddy/core/keys.clj
+++ src/buddy/core/keys.clj
@@ -46,10 +46,13 @@
           converter (doto (JcaPEMKeyConverter.)
                       (.setProvider "BC"))]
       (if (instance? PEMEncryptedKeyPair keypair)
-        (let [builder   (JcePEMDecryptorProviderBuilder.)
-              decryptor (.build builder (.toCharArray passphrase))]
-          (->> (.decryptKeyPair keypair decryptor)
-               (.getKeyPair converter)))
+        (do
+          (when (nil? passphrase)
+            (throw (ex-info "Phassphrase is mandatory with encrypted keys." {})))
+          (let [builder   (JcePEMDecryptorProviderBuilder.)
+                decryptor (.build builder (.toCharArray passphrase))]
+            (->> (.decryptKeyPair keypair decryptor)
+                 (.getKeyPair converter))))
         (.getKeyPair converter keypair)))))

 (defn- read-pem->pubkey


Убрал событие on-touch-end с tr-sel

Убрал событие on-touch-end с tr-sel

--- src-cljs/ixinfestor/omut.cljs
+++ src-cljs/ixinfestor/omut.cljs
@@ -1209,9 +1209,8 @@
                                      (select-keys [:id :keyname :description])
                                      vals)))}}]
   (letfn [(on-click [app e]
-            ;;Пока отрубил для мобил,
-            ;;(.preventDefault e)
-            ;;(.stopPropagation e)
+            (.preventDefault e)
+            (.stopPropagation e)

             (when clear-selections-fn
               (clear-selections-fn))
@@ -1231,7 +1230,8 @@
       (render [_]
         (apply dom/tr #js {:className  (if (omut-row-selected? @app) "info" "")
                            :onClick    (partial on-click app)
-                           :onTouchEnd (partial on-click app)}
+                           ;;:onTouchEnd (partial on-click app) ;; недает проматывать
+                           }
                (app-to-tds-seq-fn app) )))))


oops, got slimed

oops, got slimed

--- src/clabango/parser.clj
+++ src/clabango/parser.clj
@@ -2,7 +2,7 @@
   (:use [clabango.filters :only [template-filter]]
         [clabango.tags :only [load-template template-tag]]))

-(declare parse ast->parsed)
+(declare lex* parse ast->parsed)

 (defn start-of-new-token? [s i]
   (let [c (.charAt s i)


Remove unneeded str call.

Remove unneeded str call.

--- src/clj_record/util.clj
+++ src/clj_record/util.clj
@@ -24,7 +24,7 @@
 (defmethod id-query-for "mysql" [_ _]
   "SELECT LAST_INSERT_ID()")
 (defmethod id-query-for "h2" [_ _]
-  (str "CALL IDENTITY()"))
+  "CALL IDENTITY()")
 (defmethod id-query-for :default [db-spec _]
   (throw (Exception. (str "Unrecognized db-spec subprotocol: " db-spec))))


Fixed issue #26: Package names should be trimmed because of bugs in the original database.

--- src/clouseau/server.clj
+++ src/clouseau/server.clj
@@ -480,14 +480,15 @@
 (defn process
     "Gather all required informations and send it back to user."
     [package new-description output-format new-user-name old-user-name]
-    (if (and (not-empty-parameter? package) (not-empty-parameter? new-description))
-        (try
-            (store-ccs-description package new-description)
-            (generate-response package new-description output-format new-user-name old-user-name)
-            (catch Exception e
-                (println "Error writing into database 'ccs_descriptions.db':" e)
-                (generate-error-response package old-user-name (str "Can not write into database file 'ccs_descriptions.db': " e))))
-        (generate-response package new-description output-format new-user-name old-user-name)))
+    (let [trimmed-package-name (if package (clojure.string/trim package) nil)]
+        (if (and (not-empty-parameter? package) (not-empty-parameter? new-description))
+            (try
+                (store-ccs-description trimmed-package-name new-description)
+                (generate-response trimmed-package-name new-description output-format new-user-name old-user-name)
+                (catch Exception e
+                    (println "Error writing into database 'ccs_descriptions.db':" e)
+                    (generate-error-response trimmed-package-name old-user-name (str "Can not write into database file 'ccs_descriptions.db': " e))))
+            (generate-response trimmed-package-name new-description output-format new-user-name old-user-name))))

 (defn perform-normal-processing
     "Generates Clouseau main page."


Forgot to remove reference to state :)

Forgot to remove reference to state :)

--- src/blending/core.cljs
+++ src/blending/core.cljs
@@ -15,7 +15,7 @@
   (q/background 240)

   ;; Alpha is ignored when using :p3d
-  (q/fill (:color state) 255 255 10)
+  (q/fill 0 255 0 100)
   (q/ellipse 100 100 100 100)

   ;; blend-color shows up as white regardless of rendering mode


Update template

Update template

--- re-view-template/resources/leiningen/new/re_view/core.cljs
+++ re-view-template/resources/leiningen/new/re_view/core.cljs
@@ -51,8 +51,8 @@

 (defview layout [this]
          [:div
-          (example-text)
+          (example-text {:name "{{name}}"})
           (example-counter)
           (example-local-state)])

-(v/render-to-dom (layout {:name "{{name}}"}) "{{name}}")
+(v/render-to-dom (layout) "{{name}}")


Working REPL, no history yet.

Working REPL, no history yet.

--- src/brevis/ui/core.clj
+++ src/brevis/ui/core.clj
@@ -8,6 +8,7 @@
            (java.io ByteArrayInputStream)
            java.awt.Font)
   (:require
+    [clojure.tools.nrepl.server :as nrepl.server]
     [clojure.tools.nrepl :as nrepl]
     [clojure.tools.nrepl.misc :as nrepl.misc]
     [leiningen.repl :as repl]
@@ -15,6 +16,7 @@
     [leiningen.core.eval :as eval]
     [leiningen.core.main :as lein-main])
   (:use [clojure.java.io :only [file]]
+        [clojure.pprint]
         [seesaw core font color graphics]))

 ;; ## Globals
@@ -174,14 +176,21 @@
             (when (= (.getKeyCode e) java.awt.event.KeyEvent/VK_ENTER)
               (.append textArea "\n")
               ;; This shouldn't be here:
-              (text! (:text-area @repl-output-window) (.toString (get-repl-outputstream)))
+              #_(text! (:text-area @repl-output-window) (.toString (get-repl-outputstream)))
               (try
                 (let [startPosition 0
                       line (.getText textArea startPosition (- (.getLength (.getDocument textArea)) startPosition 1))
-                      session-sender (nrepl/client-session @reply.eval-modes.nrepl/current-connection :session @reply.eval-modes.nrepl/current-session)]
+                      response-vals (nrepl/message (:client @repl) {:op "eval" :code line})
+                      #_session-sender #_(nrepl/client-session @reply.eval-modes.nrepl/current-connection :session @reply.eval-modes.nrepl/current-session)]
                   (.setText textArea "")
-                  (println "Sending to repl:" line)
-                  (session-sender {:op "eval" :code line :id (nrepl.misc/uuid)})
+                  (println "Sending to repl:" line)
+                  (text! (:text-area @repl-output-window)
+                         (with-out-str (doseq [resp response-vals]
+                                         (when (:out resp) (println (:out resp)))
+                                         (when (:value resp) (println (:value resp))))
+                                       #_(with-out-str (pprint (doall response-vals)))))
+                  #_(text! (:text-area @repl-output-window) (with-out-str (pprint (doall response-vals))))
+                  #_(session-sender {:op "eval" :code line :id (nrepl.misc/uuid)})
                   #_(reply.eval-modes.nrepl/execute-with-client (:client @repl) #_@reply.eval-modes.nrepl/current-connection
                              (assoc {}
                                     :read-input-line-fn (partial reply.reader.simple-jline/safe-read-line {:no-jline true :prompt-string ""})
@@ -238,8 +247,11 @@
                :repl-options {:input-stream r-is :output-stream r-os})
         repl-cfg {:host (repl/repl-host project)
                   :port (repl/repl-port project)}
-        repl-server-port (repl/server project repl-cfg false)
-        repl-client-thread (Thread. (fn [] (repl/client project repl-server-port) ))
+        ;repl-server-port (repl/server project repl-cfg false)
+        repl-server (nrepl.server/start-server :port 59258)
+        ;repl-client-thread (Thread. (fn [] (repl/client project repl-server-port) ))
+        repl-connection (nrepl/connect :port 59258)
+        repl-client (nrepl/client repl-connection Long/MAX_VALUE)
         #_(lein-main/apply-task "repl" project [])
         #_(apply eval/eval-in-project project
                            (server-forms project cfg (ack-port project)
@@ -247,11 +259,13 @@
         #_(apply eval/eval-in-project project
                               (server-forms project cfg (ack-port project)
                                             true))]
-    (.start repl-client-thread)
-    (reset! repl {:server repl-server-port :client-thread repl-client-thread
+    #_(.start repl-client-thread)
+    (reset! repl {:server repl-server ;:client-thread repl-client-thread
                   ;:repl-inputstream r-is :repl-outputstream r-os})
-                  :client (nrepl/client @reply.eval-modes.nrepl/current-connection Long/MAX_VALUE)
-                  :repl-inputstream r-is :repl-outputstream r-os})
+                  ;:client (nrepl/client @reply.eval-modes.nrepl/current-connection Long/MAX_VALUE)
+                  :connection repl-connection
+                  :client repl-client})
+                  ;:repl-inputstream r-is :repl-outputstream r-os})
     (reset! repl-inputstream r-is)
     (reset! repl-outputstream r-os)
     (reset! editor-window ew)


Add a html title

Add a html title

--- src/build_mon/core.clj
+++ src/build_mon/core.clj
@@ -5,7 +5,10 @@
   (:gen-class))

 (defn generate-html [status result]
-  (str "<head><meta http-equiv=\"refresh\" content=\"20\" /></head>
+  (str "<head>
+         <title>Build Status</title>
+         <meta http-equiv=\"refresh\" content=\"20\" />
+       </head>
        <body style=\"background-color:" (cond (= result "succeeded") "green"
                                               (nil? result) "yellow"
                                               :default "red")


Make current-fill and current-stroke work for cljs

--- src/cljc/quil/core.cljc
+++ src/cljc/quil/core.cljc
@@ -1264,7 +1264,7 @@
   current-fill
   "Return the current fill color."
   []
-  (.fillColor (current-graphics)))
+  (.-fillColor (current-graphics)))

 (defn
   ^{:requires-bindings true
@@ -1275,7 +1275,7 @@
   current-stroke
   "Return the current stroke color."
   []
-  (.strokeColor (current-graphics)))
+  (.-strokeColor (current-graphics)))

 (defn
   ^{:requires-bindings true


Kleisli composition

Kleisli composition

--- src/cljx/cats/core.cljx
+++ src/cljx/cats/core.cljx
@@ -62,12 +62,6 @@
   ([mv f & fs]
      (reduce bind mv (cons f fs))))

-(defn =<<
-  "Same as the two argument version of `>>=` but with the
-  arguments interchanged."
-  [f mv]
-  (>>= mv f))
-
 (defn <$>
   "Alias of fmap."
   [f fv]
@@ -96,8 +90,51 @@
     body))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Monadic helpers
+;; Monadic functions
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn =<<
+  "Same as the two argument version of `>>=` but with the
+  arguments interchanged."
+  [f mv]
+  (>>= mv f))
+
+#+clj
+(defn >=>
+  [mf mg x]
+  "Left-to-right composition of monads."
+  (mlet [a (mf x)
+         b (mg a)]
+    (return b)))
+
+#+cljs
+(defn >=>
+  [mf mg x]
+  "Left-to-right composition of monads."
+  (cm/mlet [a (mf x)
+            b (mg a)]
+    (return b)))
+
+#+clj
+(defn <=<
+  [mg mf x]
+  "Right-to-left composition of monads.
+
+  Same as `>=>` with its first two arguments flipped."
+  (mlet [a (mf x)
+         b (mg a)]
+    (return b)))
+
+#+cljs
+(defn <=<
+  [mg mf x]
+  "Right-to-left composition of monads.
+
+  Same as `>=>` with its first two arguments flipped."
+  (cm/mlet [a (mf x)
+            b (mg a)]
+    (return b)))
+

 (defn sequence-m
   [mvs]


reverse-string: update with @haus' suggestions

--- exercises/reverse-string/src/example.clj
+++ exercises/reverse-string/src/example.clj
@@ -1,6 +1,5 @@
-(ns reverse-string)
-
-(require '[clojure.string :as s])
+(ns reverse-string
+    (:require [clojure.string :as s]))

 (defn reverse-string
-  ([word] (str (s/reverse word))))
+  ([word] (s/reverse word)))


Return the bytearray on pad! and unpad! functions.

--- src/buddy/core/padding.clj
+++ src/buddy/core/padding.clj
@@ -42,7 +42,8 @@
   ([^bytes input ^long offset ^Keyword alg]
    (let [engine (padding-engine alg)]
      (.init engine (java.security.SecureRandom.))
-     (.addPadding engine input offset))))
+     (.addPadding engine input offset)
+     input)))

 (defn unpad!
   "Remove padding from given byte array and fill
@@ -52,7 +53,8 @@
    (let [engine (padding-engine alg)
          padsize (.padCount engine input)
          offset (- (clojure.core/count input) padsize)]
-     (bytes/fill input 0 :offset offset))))
+     (bytes/fill! input 0 :offset offset)
+     input)))

 (defn count
   "Get the padding size found on given byte array."


Test kvs not-found.

Test kvs not-found.

--- src/cbfg/test/kvs.cljs
+++ src/cbfg/test/kvs.cljs
@@ -18,7 +18,20 @@
                     (aput tkvs cmd-ch m)
                     (e n
                        (atake tkvs res-ch)
-                       (merge m {:status :invalid, :status-info :missing-kvs-ident-arg})
+                       (merge m {:status :invalid
+                                 :status-info :missing-kvs-ident-arg})
+                       nil)
+                    (e n
+                       (atake tkvs res-ch)
+                       nil
+                       nil))
+                  (let [res-ch (achan tkvs)
+                        m {:res-ch res-ch :op :kvs-remove :kvs-ident [:bogus :ident]}]
+                    (aput tkvs cmd-ch m)
+                    (e n
+                       (atake tkvs res-ch)
+                       (merge m {:status :not-found
+                                 :status-info [:no-kvs (:kvs-ident m)]})
                        nil)))
            "pass"
            (str "FAIL: on test-lane #" @n)))))


support copying native libs by os-name/arch

--- src/cake/tasks/compile.clj
+++ src/cake/tasks/compile.clj
@@ -44,8 +44,10 @@
     (reload!)))

 (defn copy-native []
-  (ant Copy {:todir (format "native/%s/%s" (os-name) (os-arch))}
-       (add-fileset {:dir "build/native/lib"})))
+  (let [os-name (os-name)
+        os-arch (os-arch)]
+    (ant Copy {:todir (format "native/%s/%s" os-name os-arch)}
+         (add-fileset {:dir (format "build/native/%s/%s/lib" os-name os-arch)}))))

 (deftask compile #{deps compile-native compile-java}
   "Compile all clojure and java source files. Use 'cake compile force' to recompile."


Aλ pointed out we can use do instead

Aλ pointed out we can use do instead

--- src/cats/monad/either.cljc
+++ src/cats/monad/either.cljc
@@ -325,6 +325,5 @@
      otherwise returns the result as a right"
      [& body]
      `(try
-        ~@(butlast body)
-        (right ~(last body))
+        (right (do ~@body))
         (catch Exception e# (left e#)))))


some code cleanup

some code cleanup

--- src/clj/cljs/sourcemap.clj
+++ src/clj/cljs/sourcemap.clj
@@ -26,36 +26,38 @@
       (with-meta nseg {:name (+ name rname)})
       nseg)))

+(defn update-result [result segmap gline]
+  (update-in result [(:source segmap)]
+    (fnil (fn [m]
+            (update-in m [(:line segmap)]
+              (fnil (fn [m]
+                      (assoc m (:col segmap)
+                        (let [d {:gline gline
+                                 :gcol (:gcol segmap)}]
+                          (if-let [name (:name segmap)]
+                            (assoc d :name name)
+                            d))))
+                    (sorted-map))))
+          (sorted-map))))
+
 (defn decode
   ([source-map]
      (decode (:mappings source-map) source-map))
   ([mappings source-map]
      (let [relseg-init [0 0 0 0 0]
-           update-result (fn [result seg gline]
-                           (let [segmap (seg->map seg source-map)]
-                             (update-in result [(:source segmap)]
-                               (fnil (fn [m]
-                                       (update-in m [(:line segmap)]
-                                         (fnil (fn [m]
-                                                 (assoc m (:col segmap)
-                                                   (let [d {:gline gline
-                                                            :gcol (:gcol segmap)}]
-                                                     (if-let [name (:name segmap)]
-                                                       (assoc d :name name)
-                                                       d))))
-                                               (sorted-map))))
-                                     (sorted-map)))))
            lines (seq (string/split mappings #";"))]
        (loop [i 0 lines lines relseg relseg-init result {}]
          (if lines
            (let [line (first lines)
-                 [result relseg] (let [segs (seq (string/split line #","))]
-                                   (loop [segs segs relseg relseg result result]
-                                     (if segs
-                                       (let [seg (first segs)
-                                             nrelseg (seg-combine (base64-vlq/decode seg) relseg)]
-                                         (recur (next segs) nrelseg (update-result result nrelseg i)))
-                                       [result relseg])))]
+                 [result relseg]
+                 (let [segs (seq (string/split line #","))]
+                   (loop [segs segs relseg relseg result result]
+                     (if segs
+                       (let [seg (first segs)
+                             nrelseg (seg-combine (base64-vlq/decode seg) relseg)]
+                         (recur (next segs) nrelseg
+                           (update-result result (seg->map nrelseg source-map) i)))
+                       [result relseg])))]
              (recur (inc i) (next lines) (assoc relseg 0 0) result))
            result)))))


saving.

saving.

--- src/clj/stripe/schema.cljc
+++ src/clj/stripe/schema.cljc
@@ -1,6 +1,6 @@
 (ns stripe.schema
   (:require [schema.core :as s :include-macros true]
-            [#?(:clj clojure.core.async :cljs cljs.core.async)])
+            #?(:clj clojure.core.async :cljs cljs.core.async))
   #?(:clj
      (:import [clojure.core.async.impl.protocols ReadPort])))


Refactor

Refactor

--- src/clj_tutorials/core.clj
+++ src/clj_tutorials/core.clj
@@ -1,27 +1,31 @@
 (ns clj-tutorials.core
   (:require [org.httpkit.client :as http]
-            [clojure.core.async :as async :refer [go go-loop <!! <! >!]]))
+            [clojure.core.async :as async :refer [go go-loop alts! alts!! put! <!! <! >!]]))
+
+
+
+
+;;; Load testing using core.async (@mhjort) ;;;
+
+
+

 ;STEP 1
-(defn run1 [number-of-users step]
-  (let [cs (repeatedly number-of-users async/chan)]
+(defn run1 [concurrency step]
+  (let [cs (repeatedly concurrency async/chan)]
     (doseq [c cs]
       (go (>! c (step))))))

 ;STEP 2
-(defn- collect-result [cs]
-  (let [[result c] (async/alts!! cs)]
-    result))
-
-(defn run-with-results [number-of-users step]
-  (let [cs (repeatedly number-of-users async/chan)]
+(defn run-with-results [concurrency step]
+  (let [cs (repeatedly concurrency async/chan)]
     (doseq [c cs]
       (go (>! c (step))))
-    (repeatedly number-of-users #(collect-result cs))))
+    (repeatedly concurrency #(first (alts!! cs)))))

 ;STEP 3
@@ -30,11 +34,11 @@
         result (function)]
     [(- (System/currentTimeMillis) start) result]))

-(defn run-with-bench [number-of-users step]
-  (let [cs (repeatedly number-of-users async/chan)]
+(defn run-with-bench [concurrency step]
+  (let [cs (repeatedly concurrency async/chan)]
     (doseq [c cs]
       (go (>! c (bench step))))
-    (repeatedly number-of-users #(collect-result cs))))
+    (repeatedly concurrency #(first (alts!! cs)))))

@@ -43,11 +47,11 @@
   (fn []
     (= 200 (:status @(http/get url)))))

-(defn run-with-url [number-of-users url]
-  (let [cs (repeatedly number-of-users async/chan)]
+(defn run-with-url [concurrency url]
+  (let [cs (repeatedly concurrency async/chan)]
     (doseq [c cs]
       (go (>! c (bench (http-get url)))))
-    (repeatedly number-of-users #(collect-result cs))))
+    (repeatedly concurrency #(first (alts!! cs)))))

@@ -55,48 +59,49 @@
 ;(STEP 5 "Non blocking http")

-(defn chan-http-get [url c]
-  (let [start (System/currentTimeMillis)]
-    (http/get url {} #(async/put! c [(- (System/currentTimeMillis) start)
-                                     (= 200 (:status %))]))))
+(defn async-http-get [url c]
+  (let [now   #(System/currentTimeMillis)
+        start (now)]
+    (go
+      (http/get url {} #(put! c [(- (now) start)
+                                 (= 200 (:status %))])))))

-(defn run-non-blocking [number-of-users url]
-  (let [cs (repeatedly number-of-users async/chan)]
+(defn run-non-blocking [concurrency url]
+  (let [cs (repeatedly concurrency async/chan)]
     (doseq [c cs]
-        (go (chan-http-get url c)))
-    (repeatedly number-of-users #(collect-result cs))))
+      (go (async-http-get url c)))
+    (repeatedly concurrency #(first (alts!! cs)))))

 ; (STEP 6 "With timeout")

-(defn chan-http-get-with-timeout [url timeout result-channel]
-  (let [
-          now     #(System/currentTimeMillis)
-        start   (now)
+(defn async-http-get-with-timeout [url timeout result-channel]
+  (let [now      #(System/currentTimeMillis)
+        start    (now)
         response (async/chan)]
     (go
-      (http/get url {} #(async/put! response [(- (now) start) (= 200 (:status %))]))
-      (let [[result c] (async/alts! [response (async/timeout timeout)])]
+      (http/get url {} #(put! response [(- (now) start) (= 200 (:status %))]))
+      (let [[result c] (alts! [response (async/timeout timeout)])]
         (if (= c response)
           (>! result-channel result)
           (>! result-channel [timeout false]))))))

-(defn run-non-blocking-with-timeout [number-of-users timeout url]
-  (let [cs (repeatedly number-of-users async/chan)]
+(defn run-non-blocking-with-timeout [concurrency timeout url]
+  (let [cs (repeatedly concurrency async/chan)]
     (doseq [c cs]
-        (go (chan-http-get-with-timeout url timeout c)))
-    (repeatedly number-of-users #(collect-result cs))))
+        (go (async-http-get-with-timeout url timeout c)))
+    (repeatedly concurrency #(first (alts!! cs)))))

 ; (STEP 7 "Constantly")

-(defn run-constantly [number-of-users number-of-requests timeout url]
-  (let [cs       (repeatedly number-of-users async/chan)
+(defn run-constantly [concurrency number-of-requests timeout url]
+  (let [cs       (repeatedly concurrency async/chan)
         results  (async/chan)]
     (doseq [c cs]
-        (chan-http-get-with-timeout url timeout c))
+        (async-http-get-with-timeout url timeout c))
     (go-loop [i 0]
-      (let [[result c] (async/alts! cs)]
+      (let [[result c] (alts! cs)]
         (chan-http-get-with-timeout url timeout c)
         (>! results result)
         (when (<= i number-of-requests)


Widened button column on Remember

Widened button column on Remember

See https://app.asana.com/0/17212341117686/45631175669813 for how it
looked before when it had three buttons.

--- src/cljs/memento/core.cljs
+++ src/cljs/memento/core.cljs
@@ -529,7 +529,7 @@
       [:p {:dangerouslySetInnerHTML {:__html (md->html (:thought memory) :replacement-transformers md-transformers)}}]
       ]
      [:div
-      [:div {:class "col-sm-4"}
+      [:div {:class "col-sm-6"}
        (if (= :open (:status memory))
          [:a {:class    "btn btn-primary btn-xs"
               :on-click #(do
@@ -547,7 +547,7 @@
           "Thread" [:i {:class "fa fa-file-text fa-space"}]])

        ]
-      [:div {:class "col-sm-4 col-sm-offset-4" :style {:text-align "right"}}
+      [:div {:class "col-sm-4 col-sm-offset-2" :style {:text-align "right"}}
        [:i [:small (:created memory)]]
        ]]]))


fix special form doc regression (close #90)

--- src/cljs_api_gen/parse.clj
+++ src/cljs_api_gen/parse.clj
@@ -420,7 +420,7 @@
   (when-let [special (parse-special* form)]
     (let [location (parse-location form)
           extras {:type "special form"}
-          docs (get doc-map (:name special))
+          docs (get doc-map (symbol (:name special)))
           final (merge special location extras docs)]
       final)))


fix get-from-id

fix get-from-id

--- src/clojure_test/part2.clj
+++ src/clojure_test/part2.clj
@@ -77,7 +77,7 @@
     (chess/generate-string res)))

 (defn get-from-id [id]
-  (let [data (get-data @transaction :transaction_id id)]
+  (let [data (get-data @transaction :transaction_id (read-string id))]
     (chess/generate-string data)
     ))