g2g :sunglasses:

g2g :sunglasses:

--- src/metabase/driver/query_processor/annotate.clj
+++ src/metabase/driver/query_processor/annotate.clj
@@ -106,29 +106,6 @@
         (trace-lvars "*" out)
         (== out ag-field)))))

-(defn y []
-  (require 'metabase.driver)
-  (@(ns-resolve 'metabase.driver 'process-query)
-   {:database 320,
-    :type "query",
-    :query
-    {:source_table 371, :aggregation ["rows"], :breakout [], :filter []}}))
-
-;; (require '[metabase.test.data :refer [db-id id]])
-(defn x []
-  (@(ns-resolve 'metabase.driver 'process-query)
-   {:database 339,
-    :type "query",
-    :query
-    {:source_table 820,
-     :aggregation ["count"],
-     :breakout [["fk->" 8896 8855]]}}))
-
-
-
-(defn y* [n]
-  (dorun (repeatedly n y)))
-
 (defn- unknown-field° [field-name out]
   (all
    (== out {:base-type    :UnknownField
@@ -216,8 +193,34 @@
                                                    (name< f1 f2)))
               ((clause-pos< f1 f2)))))))))

-(defn- fk-info-added° [field]
-  )
+(defn- resolve+order-cols [{:keys [result-keys], :as query}]
+  (when (seq result-keys)
+    (first (let [fields       (vec (lvars (count result-keys)))
+                 known-field° (field° query)]
+             (run 1 [q]
+               (everyg (fn [[result-key field]]
+                         (conda
+                           ((known-field°   result-key field))
+                           ((unknown-field° result-key field))))
+                       (zipmap result-keys fields))
+               (sorted-permutation° (fields-sorted° query) fields q))))))
+
+
+;;; # ---------------------------------------- COLUMN DETAILS  ----------------------------------------
+
+;; Format the results in the way the front-end expects.
+
+(defn- format-col [col]
+  (merge {:description nil
+          :id          nil
+          :table_id    nil}
+         (-> col
+             (set/rename-keys  {:base-type    :base_type
+                                :field-id     :id
+                                :field-name   :name
+                                :special-type :special_type
+                                :table-id     :table_id})
+             (dissoc :position))))

 (defn- add-fields-extra-info
   "Add `:extra_info` about `ForeignKeys` to `Fields` whose `special_type` is `:fk`."
@@ -247,35 +250,6 @@
                     :target     dest-field
                     :extra_info (if-not dest-field {}
                                         {:target_table_id (:table_id dest-field)})))))))
-
-(defn- resolve+order-cols [{:keys [result-keys], :as query}]
-  (when (seq result-keys)
-    (first (let [fields       (vec (lvars (count result-keys)))
-                 known-field° (field° query)]
-             (run 1 [q]
-               (everyg (fn [[result-key field]]
-                         (conda
-                           ((known-field°   result-key field))
-                           ((unknown-field° result-key field))))
-                       (zipmap result-keys fields))
-               (sorted-permutation° (fields-sorted° query) fields q))))))
-
-
-;;; # ---------------------------------------- COLUMN DETAILS  ----------------------------------------
-
-;; Format the results in the way the front-end expects.
-
-(defn- format-col [col]
-  (merge {:description nil
-          :id          nil
-          :table_id    nil}
-         (-> col
-             (set/rename-keys  {:base-type    :base_type
-                                :field-id     :id
-                                :field-name   :name
-                                :special-type :special_type
-                                :table-id     :table_id})
-             (dissoc :position))))

 (defn post-annotate [qp]
   (fn [query]


Add feed-test

Add feed-test

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/magoyette/marcandregoyette.com.git/'


Add retries to delete-message

Add retries to delete-message

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/scheduled-message-works.git/'


Add geom:point tests.

Add geom:point tests.

error: pathspec 'test/uxbox/util/geom_tests.cljs' did not match any file(s) known to git

--- test/uxbox/util/geom_tests.cljs
+++ test/uxbox/util/geom_tests.cljs
@@ -0,0 +1,85 @@
+(ns uxbox.util.geom-tests
+  (:require [cljs.test :as t :include-macros true]
+            [cljs.pprint :refer (pprint)]
+            [uxbox.util.geom.point :as gpt]
+            [uxbox.util.geom.matrix :as gmt]))
+
+(t/deftest point-constructors-test
+  (let [p (gpt/point 1 2)]
+    (t/is (= (:x p) 1))
+    (t/is (= (:y p) 2))
+    (t/is (gpt/point? p)))
+
+  (let [p (gpt/point 1)]
+    (t/is (= (:x p) 1))
+    (t/is (= (:y p) 1)))
+
+  (let [p (gpt/point)]
+    (t/is (= (:x p) 0))
+    (t/is (= (:y p) 0)))
+
+  (let [p (gpt/point [1 2])]
+    (t/is (= (:x p) 1))
+    (t/is (= (:y p) 2))))
+
+(t/deftest point-rotate-test
+  (let [p1 (gpt/point 10 0)
+        p2 (gpt/rotate p1 90)]
+    (t/is (= (:x p2) 0))
+    (t/is (= (:y p2) 10))
+    (t/is (gpt/point? p2))))
+
+(t/deftest point-add-test
+  (let [p1 (gpt/point 1 1)
+        p2 (gpt/point 2 2)
+        p3 (gpt/add p1 p2)]
+    (t/is (= (:x p3) 3))
+    (t/is (= (:y p3) 3))
+    (t/is (gpt/point? p3))))
+
+(t/deftest point-substract-test
+  (let [p1 (gpt/point 3 3)
+        p2 (gpt/point 2 2)
+        p3 (gpt/substract p1 p2)]
+    (t/is (= (:x p3) 1))
+    (t/is (= (:y p3) 1))
+    (t/is (gpt/point? p3))))
+
+(t/deftest point-distance-test
+  (let [p1 (gpt/point 0 0)
+        p2 (gpt/point 10 0)
+        d (gpt/distance p1 p2)]
+    (t/is (number? d))
+    (t/is (= d 10))))
+
+(t/deftest point-length-test
+  (let [p1 (gpt/point 10 0)
+        ln (gpt/length p1)]
+    (t/is (number? ln))
+    (t/is (= ln 10))))
+
+(t/deftest point-angle-test
+  (let [p1 (gpt/point 0 10)
+        angle (gpt/angle p1)]
+    (t/is (number? angle))
+    (t/is (= angle 90)))
+  (let [p1 (gpt/point 0 10)
+        p2 (gpt/point 10 10)
+        angle (gpt/angle p1 p2)]
+    (t/is (number? angle))
+    (t/is (= angle 45))))
+
+(t/deftest point-quadrant-test
+  (let [p1 (gpt/point 10 10)
+        p2 (gpt/point -10 10)
+        p3 (gpt/point -10 -10)
+        p4 (gpt/point 10 -10)]
+
+    (t/is (= 1 (gpt/quadrant p1)))
+    (t/is (= 2 (gpt/quadrant p2)))
+    (t/is (= 3 (gpt/quadrant p3)))
+    (t/is (= 4 (gpt/quadrant p4)))))
+
+
+
+


CRM-277: Added migration to drop concept table since they are created dynamically now.

error: pathspec 'src/migrations/004_drop_concept_table.clj' did not match any file(s) known to git

--- src/migrations/004_drop_concept_table.clj
+++ src/migrations/004_drop_concept_table.clj
@@ -0,0 +1,15 @@
+(ns migrations.004-drop-concept-table
+  (:require [clojure.java.jdbc :as j]
+            [config.migrate-config :as config]))
+
+(defn up
+  "Migrates the database up to version 4."
+  []
+  (println "migrations.004-drop-concept-table up...")
+  (j/db-do-commands config/db "DROP TABLE METADATA_DB.concept"))
+
+(defn down
+  "Migrates the database down from version 4."
+  []
+  (println "migrations.004-drop-concept-table down...")
+  (println "`down` does nothing for this migration."))


donno

donno

fatal: remote error: upload-pack: not our ref 520f7dfa05c40c7cab7679286f19306490d04d2c
fatal: the remote end hung up unexpectedly


monte-carlo-simulations:: estimating PI

monte-carlo-simulations:: estimating PI

error: pathspec 'src/clojure_learning/monte_carlo/estimating_pi.clj' did not match any file(s) known to git

--- src/clojure_learning/monte_carlo/estimating_pi.clj
+++ src/clojure_learning/monte_carlo/estimating_pi.clj
@@ -0,0 +1,64 @@
+(ns clojure-learning.monte-carlo.estimating-pi)
+
+(defrecord Point [x y])
+
+;; juxt:: juxtaposition func will take a coll of functions -> returns a NEW function
+;; such that when applied on some args -> will apply each function on the arg/s and
+;; will return a coll of those resulted values
+(defn gen-point [end]
+  "generating a single point between [0,0] -> [1,1]"
+  (let [[x y] ((juxt rand rand) end)]
+    (->Point x y)))
+
+;; exercising
+(gen-point 1)
+(type (gen-point 1)) ;; clojure_learning.monte_carlo.estimating_pi.Point
+;; {:x 0.961021656080538, :y 0.576415979741155}
+
+(defn gen-points [until]
+  (repeatedly until (partial gen-point 1)))
+
+;; exercising
+(gen-points 100)
+
+;; center of the circle is identified by the Point{0.5, 0.5}
+;; [X,Y]  that is the center of the Circle
+;; R that is the radius of the Circle
+;; [X1,Y1] that may or may not be in the circle.
+;; -> (X - X1)^2 + (Y - Y1)^2 <= R^2
+(defn point-in-circle? [radius center-point searched-point]
+  "pure math Pythagorean theorem that identifies based on the radius, center-point and
+   given-point of the given-point is inside the circle or not"
+  (<= (Math/sqrt (+ (Math/pow (- (.x center-point)
+                                 (.x searched-point)) 2)
+                    (Math/pow (- (.y center-point)
+                                 (.y searched-point)) 2)))
+    radius))
+
+(defn locate-points [points]
+  "should return a map consisting of {:circle-points x :total-points y}"
+  (let [center-point (->Point 0.5 0.5)
+        radius 0.5]
+    (count
+      (filter
+        (partial point-in-circle? radius center-point) points))))
+
+;; exercise::
+(locate-points (gen-points 100000))
+;; 21805 or another invocation 21990
+
+(defn calculate-pi [points-in-circle total-points]
+  "applying a simple math-associative equation to get the value of PI
+   Taken that the circle is inside the square and the division of circle-area
+   with the square area: (pi x R^2) / (2 x R)^2 => pi / 4
+   Now taken the total Npoints-in-circle / Ntotal-points = pi / 4
+   => pi = 4 x (Npoints-in-circle/Ntotal-points)
+   that's why an very big number of points will establish the accuracy of [pi]"
+  (* 4 (/ points-in-circle total-points)))
+
+(defn pi [points-num]
+  "more number of points will ensure a more accurate value for PI"
+  (let [points-in-circle (locate-points (gen-points points-num))]
+    (double (calculate-pi points-in-circle points-num))))
+
+(pi 100000000)


removing one wrapper

removing one wrapper

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/narkisr/cloujsearch.git/'


Add ajax utility namespace

Add ajax utility namespace

error: pathspec 'src/cljs/gtfve/utils/ajax.cljs' did not match any file(s) known to git

--- src/cljs/gtfve/utils/ajax.cljs
+++ src/cljs/gtfve/utils/ajax.cljs
@@ -0,0 +1,30 @@
+(ns gtfve.utils.ajax
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]])
+  (:require [ajax.core :as ajax]
+            [cljs.core.async :as async :refer [put! chan <! close! >!]]))
+
+(defn normalize-error-response [default-response props]
+  (-> default-response
+      (merge props)
+      (assoc :status-code (:status default-response))
+      (assoc :resp (get-in default-response [:response :resp]))
+      (assoc :status :failed)))
+
+(defn managed-ajax [method url & {:as opts}]
+  (let [method-fn (case method
+                    :get ajax/GET
+                    :head ajax/HEAD
+                    :post ajax/POST
+                    :put ajax/PUT
+                    :delete ajax/DELETE
+                    ajax/GET)
+        ch (chan 1)
+        default-opts {:handler #(put! ch {:response %
+                                          :status :success})
+                      :error-handler #(put! ch (normalize-error-response % {:url url}))
+                      :finally #(close! ch)}]
+    (->> default-opts
+         (merge opts)
+         (vector)
+         (apply method-fn url))
+    ch))


robert.bruce's :error-hook function expects explicit true / false

If we get a `nil` value instead, we wrongly try again.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/email-works.git/'


Utility function to determine file from resource

--- src/yada/util.clj
+++ src/yada/util.clj
@@ -2,6 +2,7 @@

 (ns yada.util
   (:require
+   [clojure.java.io :as io]
    [clojure.string :as str]
    [manifold.deferred :as d]
    clojure.core.async.impl.protocols)
@@ -105,3 +106,13 @@
                     -1 [y py]))))
             nil ;; seed
             coll))))
+
+
+;; URLs
+
+(defn as-file [resource]
+  (when resource
+    (case (.getProtocol resource)
+      "file" (io/file (.getFile resource))
+      "jar" (io/file (.getFile (java.net.URL. (first (str/split (.getFile resource) #"!")))))
+      nil)))


A VERY CHARMING IMPL :blush:

A VERY CHARMING IMPL :blush:

--- src/metabase/driver/query_processor/annotate.clj
+++ src/metabase/driver/query_processor/annotate.clj
@@ -71,37 +71,30 @@

 (defn- maybe-create-ag-field [{{ag-type :aggregation-type, ag-field :field} :aggregation}]
   (when (contains? #{:avg :count :distinct :stddev :sum} ag-type)
-    (-> (if (contains? #{:count :distinct} ag-type)
-          {:base-type    :IntegerField
-           :field-name   "count"
-           :special-type :number}
-          (-> ag-field
-              (select-keys [:base-type :special-type])
-              (assoc :field-name (if (= ag-type :distinct) "count"
-                                     (name ag-type)))))
-        (assoc :group (field-groups :aggregation)))))
+    [(if (contains? #{:count :distinct} ag-type)
+        {:base-type    :IntegerField
+         :field-name   "count"
+         :special-type :number}
+        (-> ag-field
+            (select-keys [:base-type :special-type])
+            (assoc :field-name (if (= ag-type :distinct) "count"
+                                   (name ag-type)))))]))

 (defn- query-add-info [query results]
   (let [result-keys (vec (keys (first results)))
-        fields      (for [field (concat (for [[i f] (map-indexed vector (flatten-collect-fields (:breakout query)))]
-                                          (assoc f :group          (field-groups :breakout)
-                                                   :group-position i))
-                                        (for [[i f] (map-indexed vector [(maybe-create-ag-field query)])]
-                                          (assoc f :group          (field-groups :aggregation)
-                                                   :group-position i))
-                                        (for [[i f] (map-indexed vector (when-not (:fields-is-implicit query)
-                                                                          (flatten-collect-fields (:fields query))))]
-                                          (assoc f :group          (field-groups :explicit-fields)
-                                                   :group-position i))
-                                        (for [[i {:keys [position special-type], :as f}] (map-indexed vector (sort-by :field-name (flatten-collect-fields query)))]
-                                          (assoc f :group          (field-groups :other)
-                                                   :group-position (+ (* 1000 position)
-                                                                      (* 100  (or (special-type-groups special-type)
-                                                                                (special-type-groups :other)))
-                                                                      i))))]
-                      (-> field
-                          (assoc :field-name (keyword (:field-name field)))
-                          (dissoc :parent :parent-id :table-name)))]
+        fields      (apply concat (for [[group-name fields] [[:breakout        (flatten-collect-fields (:breakout query))]
+                                                             [:aggregation     (maybe-create-ag-field query)]
+                                                             [:explicit-fields (when-not (:fields-is-implicit query)
+                                                                                (flatten-collect-fields (:fields query)))]
+                                                             [:other           (for [field (sort-by :field-name (flatten-collect-fields query))]
+                                                                                (assoc field :special-type-group (or (special-type-groups (:special-type field))
+                                                                                (special-type-groups :other))))]]]
+                                    (for [[i field] (map-indexed vector fields)]
+                                      (-> field
+                                          (assoc :group          (field-groups group-name)
+                                                 :group-position i
+                                                 :field-name     (keyword (:field-name field)))
+                                          (dissoc :parent :parent-id :table-name)))))]
     (assoc query
            :result-keys  result-keys
            :query-fields (sort-by :group (for [k result-keys]
@@ -116,12 +109,21 @@
   (member1o field (:query-fields query)))

 (defn- fields< [query f1 f2]
-  (fresh [group-1 group-2, group-position-1 group-position-2]
-    (featurec f1 {:group group-1, :group-position group-position-1})
-    (featurec f2 {:group group-2, :group-position group-position-2})
+  (fresh [g1 g2, gp1 gp2]
+    (featurec f1 {:group g1, :group-position gp1})
+    (featurec f2 {:group g2, :group-position gp2})
     (conda
-     ((ar/< group-1 group-2))
-     ((== group-1 group-2) (ar/< group-position-1 group-position-2)))))
+     ((ar/< g1 g2))
+     ((== g1 g2) (conda
+                  ((!= g1 (field-groups :other)) (ar/< gp1 gp2))
+                  ((== g1 (field-groups :other)) (fresh [p1 p2, t1 t2]
+                                                   (featurec f1 {:position p1, :special-type-group t1})
+                                                   (featurec f2 {:position p2, :special-type-group t2})
+                                                   (conda
+                                                    ((ar/< p1 p2))
+                                                    ((== p1 p2) (conda
+                                                                 ((ar/< t1 t2))
+                                                                 ((== t1 t2) (ar/< gp1 gp2))))))))))))

 (defn- resolve+order-cols [query]
   {:post [(sequential? %) (every? map? %)]}
@@ -151,7 +153,7 @@
                                 :field-name   :name
                                 :special-type :special_type
                                 :table-id     :table_id})
-             (dissoc :position :group :group-position))))
+             (dissoc :position :group :group-position :special-type-group))))

 (defn- add-fields-extra-info
   "Add `:extra_info` about `ForeignKeys` to `Fields` whose `special_type` is `:fk`."
@@ -195,26 +197,3 @@
        :columns (mapv name columns)
        :rows    (for [row results]
                   (mapv row columns))})))
-
-;; (require 'metabase.driver)
-;; (require 'metabase.test.data)
-;; (require 'metabase.test.data.datasets)
-;; (defn x []
-;;   (metabase.test.data.datasets/with-dataset
-;;     :postgres
-;;     (metabase.driver/process-query
-;;      {:type :query,
-;;       :database (metabase.test.data/db-id),
-;;       :query
-;;       {:source_table (metabase.test.data/id :venues),
-;;        :filter
-;;        ["INSIDE"
-;;         (metabase.test.data/id :venues :latitude)
-;;         (metabase.test.data/id :venues :longitude)
-;;         10.0649
-;;         -165.379
-;;         10.0641
-;;         -165.371],
-;;        :aggregation ["rows"],
-;;        :breakout [nil],
-;;        :limit nil}})))


Enable scroll on overlay

Enable scroll on overlay

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/leif47/immutabledb-experimental.git/'


Add riemann.transport.util with a tap for later use

error: pathspec 'src/riemann/transport/util.clj' did not match any file(s) known to git

--- src/riemann/transport/util.clj
+++ src/riemann/transport/util.clj
@@ -0,0 +1,82 @@
+(ns riemann.transport.util
+  "Helpers for Netty stuff."
+  (:import [io.netty.channel ChannelHandler
+                             ChannelInboundHandler
+                             ChannelOutboundHandler]))
+
+(defn tap [n]
+  (reify
+    ChannelHandler
+    ChannelInboundHandler
+    ChannelOutboundHandler
+
+    (handlerAdded [_ x]
+      (prn n :handler-added x))
+
+    (handlerRemoved [_ x]
+      (prn n :handler-removed x))
+
+    (exceptionCaught [_ ctx cause]
+      (prn n :exception-caught ctx)
+      (.printStackTrace cause)
+      (.fireExceptionCaught ctx cause))
+
+    (channelRegistered [_ ctx]
+      (prn n :channel-registered ctx)
+      (.fireChannelRegistered ctx))
+
+    (channelUnregistered [_ ctx]
+      (prn n :channel-unregistered ctx)
+      (.fireChannelUnregistered ctx))
+
+    (channelActive [_ ctx]
+      (prn n :channel-active ctx)
+      (.fireChannelActive ctx))
+
+    (channelInactive [_ ctx]
+      (prn n :channel-inactive ctx)
+      (.fireChannelInactive ctx))
+
+    (channelRead [_ ctx msg]
+      (prn n :channel-read ctx msg)
+      (.fireChannelRead ctx msg))
+
+    (channelReadComplete [_ ctx]
+      (prn n :channel-read-complete ctx)
+      (.fireChannelReadComplete ctx))
+
+    (userEventTriggered [_ ctx event]
+      (prn n :user-event-triggered ctx event)
+      (.fireUserEventTriggered ctx event))
+
+    (channelWritabilityChanged [_ ctx]
+      (prn n :channel-writability-changed ctx)
+      (.fireChannelWritabilityChanged ctx))
+
+    (bind [_ ctx local-address promise]
+      (prn n :bind ctx local-address promise)
+      (.bind ctx local-address promise))
+
+    (connect [_ ctx remote-address local-address promise]
+      (prn n :connect ctx remote-address local-address promise)
+      (.connect ctx remote-address local-address promise))
+
+    (disconnect [_ ctx promise]
+      (prn n :disconnect ctx promise)
+      (.disconnect ctx promise))
+
+    (close [_ ctx promise]
+      (prn n :close ctx promise)
+      (.close ctx promise))
+
+    (read [_ ctx]
+      (prn n :read ctx)
+      (.read ctx))
+
+    (write [_ ctx msg promise]
+      (prn n :write ctx msg promise)
+      (.write ctx msg promise))
+
+    (flush [_ ctx]
+      (prn n :flush ctx)
+      (.flush ctx))))


Use dedicated async handlers

Use dedicated async handlers

...instead of :async args to old handlers. And drop the responses. Async handlers don't do responses.


ensure comms-pref can be imported

ensure comms-pref can be imported

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/partner-works.git/'


Adds tester file for Clojure

Adds tester file for Clojure

error: pathspec 'tests/tester.clj' did not match any file(s) known to git


added ratelimit

added ratelimit

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/m1dnight/clojbot.git/'


test fix :smiling_imp:

test fix :smiling_imp:

--- test/metabase/driver/query_processor_test.clj
+++ test/metabase/driver/query_processor_test.clj
@@ -111,7 +111,7 @@
                   :table_id (id :venues)
                   :id (id :venues :latitude)}
     :name        {:extra_info {}
-                  :special_type nil
+                  :special_type :name
                   :base_type :TextField
                   :description nil
                   :name (format-name "name")


point to latest clojure

point to latest clojure

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/shen.clj.git/'


iruzkinak dagokien tokian ipini

iruzkinak dagokien tokian ipini

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/lnmnd/magnet.zer.git/'


prefer juxt to vector literal

prefer juxt to vector literal

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/transwarp.git/'


notes

notes


label the setup and notes sections

label the setup and notes sections


Making migrate.clj compatible with Windows.

--- src/clojars/db/migrate.clj
+++ src/clojars/db/migrate.clj
@@ -6,11 +6,13 @@
            (java.io File)))

 (defn initial-schema [trans]
-  (doseq [cmd (.split (slurp (io/resource (str "queries" (File/separator) "clojars.sql"))) ";\n\n")]
-    ;; needs to succeed even if tables exist since this migration
-    ;; hasn't been recorded in extant DBs before migrations were introduced
-    (try (sql/db-do-commands trans cmd)
-         (catch java.sql.BatchUpdateException _)))) ;; TODO: should we really be swallowing exceptions here?
+  (let [line-sep (System/getProperty "line.separator")
+        splitter (str ";" line-sep line-sep)]
+    (doseq [cmd (.split (slurp (io/resource (str "queries" (File/separator) "clojars.sql"))) splitter)]
+      ;; needs to succeed even if tables exist since this migration
+      ;; hasn't been recorded in extant DBs before migrations were introduced
+      (try (sql/db-do-commands trans cmd)
+           (catch java.sql.BatchUpdateException _))))) ;; TODO: should we really be swallowing exceptions here?

 (defn add-promoted-field [trans]
   (sql/db-do-commands trans "ALTER TABLE jars ADD COLUMN promoted_at DATE"))


Liburua gehitzean liburuaren orria erakutsi

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/lnmnd/magnet.bez.git/'


Nire gogokoak hasieran lortzen dira, ez berriro eskatu


CONTINUE through all netty steps in ning

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/terrancesnyder/engulf.git/'


Upgrade asset-minifier

Upgrade asset-minifier

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/vincentstorme/clojureme.git/'


Bump a few deps.

Bump a few deps.

--- project.clj
+++ project.clj
@@ -23,11 +23,11 @@
                  [clj-time "0.3.8"]
                  [com.cemerick/friend "0.1.2"
                   :exclusions [org.openid4java/openid4java-nodeps]]
-                 [clj-stacktrace "0.2.4"]
+                 [clj-stacktrace "0.2.5"]
                  [ring-anti-forgery "0.2.0"]
                  [valip "0.2.0"]
                  [clucy "0.3.0"]
-                 [org.clojure/tools.nrepl "0.2.0-RC1"]
+                 [org.clojure/tools.nrepl "0.2.3"]
                  [org.bouncycastle/bcpg-jdk15on "1.47"]]
   :profiles {:test {:resource-paths ["test-resources"]
                     :dependencies [[kerodon "0.0.7"]
@@ -36,9 +36,7 @@
                                   [nailgun-shim "0.0.1"]]
                    ;; TODO: set test resources in fixture w/ with-redefs
                    :resource-paths ["local-resources"]}}
-  :plugins [[lein-ring "0.7.3" :exclusions [thneed]]
-            ;fix downloading -snapshot all the time
-            [thneed "1.0.0"]]
+  :plugins [[lein-ring "0.8.5"]]
   :aliases {"migrate" ["run" "-m" "clojars.db.migrate"]}
   :ring {:handler clojars.web/clojars-app}
   :aot [clojars.scp]


rev comment

rev comment


Update redis map version -> user edocu fork of carmine.

Signed-off-by: Roman Selmeci <bb938fc7591901d0e874df22e3ae174886bcb931@infones.com>

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/infones/http-kit.git/'


Version 0.2.21-SNAPSHOT

Version 0.2.21-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject sablono "0.2.20"
+(defproject sablono "0.2.21-SNAPSHOT"
   :description "Lisp style templating for Facebook's React."
   :url "http://github.com/r0man/sablono"
   :author "r0man"


Version 30

Version 30

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


lein-release plugin: bumped version from 0.2.2 to 0.2.3-SNAPSHOT for next development cycle

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject sablono "0.2.2"
+(defproject sablono "0.2.3-SNAPSHOT"
   :description "Lisp style templating for Facebook's React."
   :url "http://github.com/r0man/sablono"
   :author "Roman Scherer"


Bump deps to clojure 1.5.0

Bump deps to clojure 1.5.0


Updating core and proj version

Updating core and proj version

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/B2W-BIT/restQL-server.git/'


Upgrade kehaar to 0.10.3

Upgrade kehaar to 0.10.3

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/voting-method-works.git/'


alphabetize deps because ocd

alphabetize deps because ocd


bump version

bump version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject storm "0.7.2-rc1"
+(defproject storm "0.8.0-SNAPSHOT"
   :source-path "src/clj"
   :test-path "test/clj"
   :java-source-path "src/jvm"


Version 0.6.3-SNAPSHOT

Version 0.6.3-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject sablono "0.6.2"
+(defproject sablono "0.6.3-SNAPSHOT"
   :description "Lisp style templating for Facebook's React."
   :url "http://github.com/r0man/sablono"
   :author "r0man"


fixed 404er page title

fixed 404er page title

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/20centaurifux/my-website.git/'


Fix typo

Fix typo

--- src/org/httpkit/server.clj
+++ src/org/httpkit/server.clj
@@ -8,7 +8,7 @@
 (defn run-server
   "Starts (mostly*) Ring-compatible HTTP server and returns a function that stops
   the server, which can take an optional timeout(ms)
-  param to wait exsiting requests to be finished, like (f :timeout 100).
+  param to wait existing requests to be finished, like (f :timeout 100).

   * See http://http-kit.org/migration.html for differences."
   [handler {:keys [port thread ip max-body max-line worker-name-prefix queue-size]


task3 cljs promises, without tests yet

task3 cljs promises, without tests yet

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/JetBrains/imperative-nodejs.git/'


slightly better UX: autofocus and on-top editables

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/talexand/velcro-notes.git/'


Create process-lisp.clj

Create process-lisp.clj

error: pathspec 'src/iyye/bios/process-lisp.clj' did not match any file(s) known to git

--- src/iyye/bios/process-lisp.clj
+++ src/iyye/bios/process-lisp.clj
@@ -0,0 +1,46 @@
+; Iyye - AI agent
+; Copyright (C) 2016-2017  Sasha Yumzya
+
+; This program is free software: you can redistribute it and/or modify
+; it under the terms of the GNU Affero General Public License as
+; published by the Free Software Foundation, either version 3 of the
+; License, or (at your option) any later version.
+
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU Affero General Public License for more details.
+
+; You should have received a copy of the GNU Affero General Public License
+; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+(ns iyye.bios.process-lisp
+   (:require [clojure.string :as str]
+             [iyye.bios.parse-lisp :as parse]
+             [iyye.bios.ioframes :as ioframes]
+             [iyye.bios.words :as words]))
+
+(defn process-control [tree input IO]
+  (let [cmd (first tree)
+        params (for [cur (rest tree)] (if (seq? cur) (process-control cur "substr" IO) cur))]
+    ;    (println "processing" cmd)
+    (if cmd
+      (dorun (words/action cmd params IO))
+      (ioframes/process-output IO (str "failed to parse: " input)))))
+
+(defn process-lispy-ctrl-input [IO input]
+  (let [tree (parse/get-syntax-tree input)]
+    (future (Thread/sleep 1000)
+            (process-control tree input IO))))
+
+(defn process-lispy-input [IO input]
+  (if (= \# (first input))
+    (process-lispy-ctrl-input IO (subs input 1))
+    (future (Thread/sleep 1000) (ioframes/process-output IO "parsing lispy sentences not implemented yet"))))
+
+(defn process-input [IO input]
+   (if (= input "What is answer to life, the universe and everything?")
+     (future (Thread/sleep 1000) ( ioframes/process-output IO "42" ))
+     (if (= \# (first input))
+       (process-lispy-input IO (subs input 1))
+       (future (Thread/sleep 1000) (ioframes/process-output IO "parsing sentences not implemented" )))))


revealing the mobile nav menu on Profile

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/starcity-properties/odin.git/'


Replace JSValue with JSValueWrapper in tests.

--- test/sablono/compiler_test.clj
+++ test/sablono/compiler_test.clj
@@ -5,11 +5,21 @@
             [sablono.compiler :refer :all])
   (:import cljs.tagged_literals.JSValue))

-(defn replace-js-literals [forms]
+(deftype JSValueWrapper [val]
+  Object
+  (equals [this other]
+    (and (instance? JSValueWrapper other)
+         (= (.val this) (.val other))))
+  (hashCode [this]
+    (.hashCode (.val this)))
+  (toString [this]
+    (.toString (.val this))))
+
+(defn wrap-js-value [forms]
   (prewalk
    (fn [form]
      (if (instance? JSValue form)
-       (.val form) form))
+       (JSValueWrapper. (wrap-js-value (.val form))) form))
    forms))

 (defn replace-gensyms [forms]
@@ -22,8 +32,8 @@

 (defmacro are-html-expanded [& body]
   `(are [form# expected#]
-     (is (= (replace-js-literals expected#)
-            (replace-gensyms (replace-js-literals (html-expand form#)))))
+     (is (= (wrap-js-value expected#)
+            (wrap-js-value (replace-gensyms (html-expand form#)))))
      ~@body))

 (deftest test-to-js
@@ -48,11 +58,10 @@
           (is (= [3] (.val (second (.val v))))))))))

 (deftest test-multiple-children
-  (is (= (replace-js-literals
+  (is (= (wrap-js-value
           '(into-array [(js/React.DOM.div #js {:id "a"})
                         (js/React.DOM.div #js {:id "b"})]))
-         (replace-js-literals
-          (html-expand [:div#a] [:div#b])))))
+         (wrap-js-value (html-expand [:div#a] [:div#b])))))

 (deftest tag-names
   (testing "basic tags"
@@ -69,7 +78,7 @@
      '(let* [attrs (str "bar" "baz")]
             (if (clojure.core/map? attrs)
               (js/React.DOM.div (sablono.interpreter/attributes (sablono.util/merge-with-class {:className ["foo"]} attrs)) nil)
-              (js/React.DOM.div {:className "foo"} (sablono.interpreter/interpret attrs))))
+              (js/React.DOM.div #js {:className "foo"} (sablono.interpreter/interpret attrs))))
      '[:div.a.b] '(js/React.DOM.div #js {:className "a b"})
      '[:div.a.b.c] '(js/React.DOM.div #js {:className "a b c"})
      '[:div#foo.bar.baz] '(js/React.DOM.div #js {:id "foo", :className "bar baz"}))))
@@ -209,7 +218,7 @@
       #js {:href (str "#show/" (:key datum))})
      (js/React.DOM.div
       #js {:id (str "item" (:key datum)), :className "class1 class2"}
-      (js/React.DOM.span {:className "anchor"} (sablono.interpreter/interpret (:name datum)))))))
+      (js/React.DOM.span #js {:className "anchor"} (sablono.interpreter/interpret (:name datum)))))))

 (deftest test-issue-2-merge-classname
   (are-html-expanded
@@ -239,4 +248,4 @@
          (js/React.DOM.span
           #js {:className "caret"}))
         (js/React.DOM.ul
-         #js {:role "menu", :style {:left 0}, :className "dropdown-menu"}))))))
+         #js {:role "menu", :style #js {:left 0}, :className "dropdown-menu"}))))))


Add barebones 3d template

Add barebones 3d template

error: pathspec 'resources/barebones-3d/core.clj' did not match any file(s) known to git

--- resources/barebones-3d/core.clj
+++ resources/barebones-3d/core.clj
@@ -0,0 +1,28 @@
+(defscreen main-screen
+  :on-show
+  (fn [screen entities]
+    (update! screen
+             :renderer (model-batch)
+             :attributes (let [attr-type (attribute-type :color :ambient-light)
+                               attr (attribute :color attr-type 0.8 0.8 0.8 1)]
+                           (environment :set attr))
+             :camera (doto (perspective 75 (game :width) (game :height))
+                       (position! 0 0 3)
+                       (direction! 0 0 0)
+                       (near! 0.1)
+                       (far! 300)))
+    (let [attr (attribute! :color :create-diffuse (color :blue))
+          model-mat (material :set attr)
+          model-attrs (bit-or (usage :position) (usage :normal))
+          builder (model-builder)]
+      (model (model-builder! builder :create-box 2 2 2 model-mat model-attrs)
+             (vector-3 0 0 0))))
+  :on-render
+  (fn [screen entities]
+    (clear! 1 1 1 1)
+    (doto screen
+      (perspective! :rotate-around (vector-3 0 0 0) (vector-3 0 1 0) 1)
+      (perspective! :update))
+    (render! screen entities)))
+
+(set-game-screen! main-screen)


Fix project map issue with latest lein-droid

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/bsmr-clojure/Nightcode.git/'


add multirember a lat

add multirember a lat

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/carolove/clojure-ring-app.git/'


fixing else to return index

fixing else to return index

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/narkisr/cloujsearch.git/'


add basic example spec

add basic example spec

error: pathspec 'spec/clj/battlebots/arena_spec.clj' did not match any file(s) known to git

--- spec/clj/battlebots/arena_spec.clj
+++ spec/clj/battlebots/arena_spec.clj
@@ -0,0 +1,10 @@
+(ns battlebots.arena-spec
+  (:require [speclj.core :refer :all]
+            [battlebots.arena :refer :all]))
+
+(describe "get-arena-dimensions"
+
+  (it "calculates the dimensions of a 2x2 arena"
+    (should (= [2 2] (get-arena-dimensions [[0 0] [0 0]])))))
+
+(run-specs)


Handle default value-to-couch case.

Handle default value-to-couch case.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/physion/ovation-webapi.git/'


Add a few basic tests for the defview macro

error: pathspec 'src/test/app_macros/view_test.cljs' did not match any file(s) known to git

--- src/test/app_macros/view_test.cljs
+++ src/test/app_macros/view_test.cljs
@@ -0,0 +1,49 @@
+(ns app-macros.view-test
+  (:require [cljs.test :refer-macros [deftest is]]
+            [om.next :as om]
+            [app-macros.view :refer-macros [defview]]))
+
+(defview MinimalView)
+
+(deftest minimal-view-works
+  (and (is (not (nil? MinimalView)))
+       (is (not (nil? minimal-view)))))
+
+(defview MinimalViewWithKeyfn
+  (keyfn [{:keys [foo]}] (str foo "-baz")))
+
+(deftest minimal-view-with-key-fn-works
+  (and (is (not (nil? MinimalViewWithKeyfn)))
+       (is (not (nil? minimal-view-with-keyfn)))
+       (is (not (nil? minimal-view-with-keyfn-keyfn)))
+       (is (= "bar-baz" (minimal-view-with-keyfn-keyfn {:foo "bar"})))))
+
+(defview ViewWithQuery
+  (query [this]
+    [:foo :bar]))
+
+(deftest view-with-query-works
+  (is (= [:foo :bar] (om/get-query ViewWithQuery))))
+
+(defview ViewWithProps
+  [user [name email]]
+  (ident [this props] [:user/by-name name])
+  (get-name [this] name)
+  (get-email [this] email))
+
+(comment
+  (deftest view-with-props-works
+    (let [view (view-with-props {:user/name "Jeff"
+                                 :user/email "jeff@jeff.org"})]
+      (println (.-prototype (type view)))
+      (println (.-om$isComponent view))
+      (and (is (= "Jeff" (.get-name view)))
+           (is (= "jeff@jeff.org" (.get-email view))))))
+
+  (cljs.pprint/pprint
+   (macroexpand-1
+    '(defview ViewWithProps
+       [user [name email]]
+       (ident [this props] [:user/by-name name])
+       (get-name [this] name)
+       (get-email [this] email)))))


Format congregation for API

Format congregation for API

--- src/territory_bro/routes.clj
+++ src/territory_bro/routes.clj
@@ -143,7 +143,10 @@
   (auth/with-authenticated-user request
     (require-logged-in!)
     (db/with-db [conn {}]
-      (ok (congregation/get-congregations conn)))))
+      (ok (->> (congregation/get-congregations conn)
+               (map (fn [congregation]
+                      {:id (::congregation/id congregation)
+                       :name (::congregation/name congregation)})))))))

 (defroutes api-routes
   (GET "/" [] (ok "Territory Bro"))


added proper tcp/read-msg function

added proper tcp/read-msg function

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/truckerpath/icfpc-2017.git/'


omg fix typo

omg fix typo

--- src/metabase/models/hydrate.clj
+++ src/metabase/models/hydrate.clj
@@ -247,13 +247,6 @@
   (and (contains? @batched-hydration-keys k)
        (every? (u/rpartial contains? (k->k_id k)) results)))

-(and (contains? @batched-hydration-keys k)
-     (every? (u/rpartial contains? (k->k_id k)) results))
-
-(and (contains? @batched-hydration-keys k)
-     (every? (util/rpartial contains? (k->k_id k)) results))
-
-
 (defn- valid-hydration-form?
   "Is this a valid argument to `hydrate`?"
   [k]


more quotations for our emails.

more quotations for our emails.

--- src/metabase/util/quotation.clj
+++ src/metabase/util/quotation.clj
@@ -7,7 +7,27 @@
    {:quote "Data really powers everything that we do."
     :author "Jeff Weiner"}
    {:quote "I keep saying that the sexy job in the next 10 years will be statisticians, and I'm not kidding."
-    :author "Hal Varian"}])
+    :author "Hal Varian"}
+   {:quote "Data is the new oil!"
+    :author "Clive Humby"}
+   {:quote "If we have data, let's look at data.  If all we have are opinions, let's go with mine."
+    :author "Jim Barksdale"}
+   {:quote "Data that is loved tends to survive."
+    :author "Kurt Bollacker"}
+   {:quote "Torture the data, and it will confess to anything."
+    :author "Ronald Coase"}
+   {:quote "The price of light is less than the cost of darkness."
+    :author "Arthur C. Nielsen"}
+   {:quote "Information is the oil of the 21st century, and analytics is the combustion engine."
+    :author "Peter Sondergaard"}
+   {:quote "Facts do not cease to exist because they are ignored."
+    :author "Aldous Huxley"}
+   {:quote "It's easy to lie with statistics.  It's hard to tell the truth without statistics."
+    :author "Andrejs Dunkels"}
+   {:quote "What gets measured gets managed"
+    :author "Peter Drucker"}
+   {:quote "Anything that is measured and watched improves."
+    :author "Bob Parsons"}])

 (defn random-quote


fix bug that prevented selection of bank, ui fixes


Slight syntax improvement on markov stuff

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/terrancesnyder/engulf.git/'


Finally fixed SQL query

Finally fixed SQL query

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/OttoJursch/sched-system.git/'


do some final cleanup and bug fixing and implement the final bit that takes the results of our dataset query, extracts the lat/lon points, and feeds them into our PinMap overlay java class for rendering.  everything should be working end to end now.

--- src/metabase/api/tiles.clj
+++ src/metabase/api/tiles.clj
@@ -12,10 +12,10 @@
 (def pixel-per-lon-degree (float (/ tile-size 360.0)))
 (def pixel-per-lon-radian (float (/ tile-size (* 2 (java.lang.Math/PI)))))

-(defn radians-to-degrees [rad]
+(defn- radians-to-degrees [rad]
   (float (/ rad (float (/ (java.lang.Math/PI) 180)))))

-(defn tile-lat-lon
+(defn- tile-lat-lon
   "Get the Latitude & Longitude of the upper left corner of a given tile"
   [x y zoom]
   (let [num-tiles (bit-shift-left 1 zoom)
@@ -24,12 +24,12 @@
         lon (float (/ (- corner-x pixel-origin) pixel-per-lon-degree))
         lat-radians (/ (- corner-y pixel-origin) (* pixel-per-lon-radian -1))
         lat (radians-to-degrees (- (* 2 (java.lang.Math/atan (java.lang.Math/exp lat-radians)))
-                                   (/ 2 (java.lang.Math/PI))))]
+                                   (/ (java.lang.Math/PI) 2)))]
     {:lat lat
      :lon lon}))

-(defn query-with-inside-filter
+(defn- query-with-inside-filter
   "Add an 'Inside' filter to the given query to restrict results to a bounding box"
   [details lat-field-id lon-field-id x y zoom]
   (let [{top-lt-lat :lat top-lt-lon :lon} (tile-lat-lon x y zoom)
@@ -47,6 +47,24 @@
         (assoc details :filter (conj ["AND"] (:filter details) inside-filter))))))

+(defn- extract-points
+  "Takes in a dataset query result object and pulls out the Latitude/Longitude pairs into nested `java.util.ArrayLists`.
+   This is specific to the way we plan to feed data into `com.metabase.corvus.api.tiles.GoogleMapPinsOverlay`."
+  [{{:keys [rows cols]} :data}]
+  (if-not (> (count rows) 0)
+    ;; if we have no rows then return an empty list of points
+    (java.util.ArrayList. [])
+    ;; otherwise we go over the data, pull out the lat/lon columns, and convert them to ArrayLists
+    (let [find-col-idx (fn [special-type]
+                         (->> (map-indexed (fn [idx itm] (when (= special-type (:special_type itm)) idx)) cols)
+                              (filter identity)
+                              (first)))
+          lat-col-idx (find-col-idx "latitude")
+          lon-col-idx (find-col-idx "longitude")]
+      (->> (map (fn [row] (java.util.ArrayList. [(nth row lat-col-idx) (nth row lon-col-idx)])) rows)
+           (java.util.ArrayList.)))))
+
+
 ;; This endpoints provides an image with the appropriate pins rendered given a json query
 ;; We evaluate the query and find the set of lat/lon pairs which are relevant and then render the appropriate ones
 ;; It's expected that to render a full map view several calls will be made to this endpoint in parallel
@@ -59,22 +77,19 @@
    lon-field String->Integer
    lat-col-idx String->Integer
    lon-col-idx String->Integer}
-  ;; TODO - tried to use `query String-Dict` above, but got errors with json parsing for some reason
-  (let [testpts (java.util.ArrayList. [(java.util.ArrayList. [37.7785264 -122.3943527])
-                                       (java.util.ArrayList. [37.7853604 -122.4329151])
-                                       (java.util.ArrayList. [37.8001008 -122.4420084])
-                                       (java.util.ArrayList. [37.757088 -122.4209783])
-                                       (java.util.ArrayList. [37.7962227 -122.4115758])])
-        query-dict (clojure.walk/keywordize-keys (json/read-str (get-in request [:params :query])))
-        points-inside-box-query-details (query-with-inside-filter (:query query-dict) lat-field lon-field x y zoom)
-        points (driver/dataset-query points-inside-box-query-details {:executed_by *current-user-id*
-                                                                      :synchronously true})]
+  ;; TODO - tried to use `query String->Dict` above, but got errors with json parsing for some reason
+  (let [query-dict (clojure.walk/keywordize-keys (json/read-str (get-in request [:params :query])))
+        updated-query (assoc query-dict
+                             :query (query-with-inside-filter (:query query-dict) lat-field lon-field x y zoom))
+        result (driver/dataset-query updated-query {:executed_by *current-user-id*
+                                                    :synchronously true})
+        lat-lon-points (extract-points result)]
     ;; manual ring response here.  we simply create an inputstream from the byte[] of our image
     {:status  200
      :headers {"Content-Type" "image/png"}
      :body    (java.io.ByteArrayInputStream.
                 (.toByteArray
-                  (com.metabase.corvus.api.tiles.GoogleMapPinsOverlay. zoom testpts)))}))
+                  (com.metabase.corvus.api.tiles.GoogleMapPinsOverlay. zoom lat-lon-points)))}))

 (define-routes)


Put in game of life code from Clojure Programming

error: pathspec 'src/petulant_life/life.clj' did not match any file(s) known to git

--- src/petulant_life/life.clj
+++ src/petulant_life/life.clj
@@ -0,0 +1,32 @@
+(ns petulant-life.life)
+
+;; This code was taken from Clojure Programming by Chas Emerick, Brian
+;; Carper, and Christophe Grand (O’Reilly).
+
+;; Copyright 2012 Chas Emerick, Brian Carper, and Christophe Grand,
+;; 978-1-449-39470-7.
+
+(defn hex-neighbours
+  [[x y]]
+  (for [dx [-1 0 1] dy (if (zero? dx) [-2 2] [-1 1])]
+    [(+ dx x) (+ dy y)]))
+
+(defn rect-neighbours
+  [[x y]]
+  (for [dx [-1 0 1] dy [-1 0 1] :when (not= 0 dx dy)]
+    [(+ dx x) (+ dy y)]))
+
+(defn stepper
+  "Returns a step function for Life-like cell automata.
+   neighbours takes a location and return a sequential collection
+   of locations. survive? and birth? are predicates on the number
+   of living neighbours."
+  [neighbours birth? survive?]
+  (fn [cells]
+    (set (for [[loc n] (frequencies (mapcat neighbours cells))
+               :when (if (cells loc) (survive? n) (birth? n))]
+           loc))))
+
+(def rect-step (stepper rect-neighbours  #{3} #{2 3}))
+
+(def hex-step  (stepper hex-neighbours   #{2} #{3 4}))


don't pile up nils in "cs"

don't pile up nils in "cs"

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/michaelsbradleyjr/transwarp.git/'


Update dataframe.clj

Update dataframe.clj

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/clojure-ml/cml.git/'


add new disembark ns

add new disembark ns

error: pathspec 'src/gangway/disembark.clj' did not match any file(s) known to git

--- src/gangway/disembark.clj
+++ src/gangway/disembark.clj
@@ -0,0 +1,3 @@
+(ns gangway.disembark)
+
+(defn disembark! [msg])


update logged in user password reset endpoint to use the new password validation with the salt.

--- src/metabase/api/user.clj
+++ src/metabase/api/user.clj
@@ -5,7 +5,7 @@
             [metabase.api.common :refer :all]
             [metabase.db :refer [sel upd exists?]]
             (metabase.models [hydrate :refer [hydrate]]
-                             [user :refer [User]])
+                             [user :refer [User set-user-password]])
             [metabase.util :refer [select-non-nil-keys]]))

@@ -43,9 +43,9 @@
   (check (and password old_password) [400 "You must specify both old_password and password"])
   ; user must be getting their own details OR they must be a superuser to proceed
   (check-403 (or (= id *current-user-id*) (:is_superuser @*current-user*)))
-  (let-404 [user (sel :one [User :password] :id id)]
-    (check (creds/bcrypt-verify old_password (:password user)) [400 "password mismatch"]))
-  (upd User id :password (creds/hash-bcrypt password))
+  (let-404 [user (sel :one [User :password_salt :password] :id id)]
+    (check (creds/bcrypt-verify (str (:password_salt user) old_password) (:password user)) [400 "password mismatch"]))
+  (set-user-password id password)
   (sel :one User :id id))


Preserve manual SNS auth for posterity (deleted in next commit)

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/turbovote-http-api.git/'


fix indentation

fix indentation


[EN] Give outgoing channels a buffer.

[EN] Give outgoing channels a buffer.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/democracyworks/election-authority-works.git/'


Capitalized FROM in db/query

Capitalized FROM in db/query


generated by boot for use by Cursive

generated by boot for use by Cursive

error: pathspec 'spinning/project.clj' did not match any file(s) known to git

--- spinning/project.clj
+++ spinning/project.clj
@@ -0,0 +1,18 @@
+(defproject
+  boot-project
+  "0.1.0-SNAPSHOT"
+  :dependencies
+  [[adzerk/boot-cljs "0.0-3308-0" :scope "test"]
+   [adzerk/boot-cljs-repl "0.1.10-SNAPSHOT" :scope "test"]
+   [adzerk/boot-reload "0.3.1" :scope "test"]
+   [pandeiro/boot-http "0.6.3-SNAPSHOT" :scope "test"]
+   [org.clojure/clojure "1.7.0"]
+   [org.clojure/clojurescript "0.0-3308"]
+   [ankha "0.1.5-SNAPSHOT"]
+   [ion/poly "0.1.0-SNAPSHOT"]
+   [klang "0.2.0-SNAPSHOT"]
+   [org.clojure/core.async "0.1.346.0-17112a-alpha"]
+   [shodan "0.4.2"]
+   [spellhouse/clairvoyant "0.1.0-SNAPSHOT"]]
+  :source-paths
+  ["src"])


Yeah, so add data_readers.clj

Yeah, so add data_readers.clj

error: pathspec 'src/data_readers.clj' did not match any file(s) known to git

--- src/data_readers.clj
+++ src/data_readers.clj
@@ -0,0 +1,2 @@
+{hildebrand/path hildebrand.expr/path-reader}
+


added utils/->fixed-river to fix source-target order in river object


need debug on clojure version

need debug on clojure version

error: pathspec 'Buy-and-Sell-Stock/BaSS.clj' did not match any file(s) known to git

--- Buy-and-Sell-Stock/BaSS.clj
+++ Buy-and-Sell-Stock/BaSS.clj
@@ -0,0 +1,40 @@
+(def *test1 '())
+(def *test2 '(2 1 2 1 0 1 2))
+(def *test3 '(1))
+(def *test4 '(7 1 5 3 6 4))
+(def *test5 '(2 4 1))
+
+(defn max-profit [prices]
+  (let [maxv 0
+        result 0
+        minv (first prices)]
+    (doseq [i prices]
+      (print i)
+      (cond
+        (< (- i minv) 0) (def minv i)
+        (> (- i minv) result) (do (def maxv i)
+                                  (def result (- maxv minv))
+                                  (print result)))
+      (print maxv minv))
+    (def result (if (< result 0) 0 result))
+    result))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


add test for dsl (initial commit)

add test for dsl (initial commit)

error: pathspec 'datomic-dsl/test/datomic_dsl/create_nested_test.clj' did not match any file(s) known to git

--- datomic-dsl/test/datomic_dsl/create_nested_test.clj
+++ datomic-dsl/test/datomic_dsl/create_nested_test.clj
@@ -0,0 +1,7 @@
+;;lein test :only datomic-dsl.create-nested-test
+(ns datomic-dsl.create-nested-test
+  (:require [clojure.test :refer :all]
+            [datomic-dsl.create-nested :refer :all]
+            [datomic-dsl.common-test :refer :all]
+            [clojure.pprint :refer :all]
+            [datomic.api :as d]))


Added memcache tests.

Added memcache tests.

error: pathspec 'test/test/appengine_magic/services/memcache.clj' did not match any file(s) known to git

--- test/test/appengine_magic/services/memcache.clj
+++ test/test/appengine_magic/services/memcache.clj
@@ -0,0 +1,78 @@
+(ns test.appengine-magic.services.memcache
+  (:use clojure.test)
+  (:require [appengine-magic.testing :as ae-testing]
+            [appengine-magic.services.memcache :as ae-memcache]))
+
+
+(use-fixtures :each (ae-testing/local-services :all))
+
+
+(deftest stats
+  (is (= (appengine-magic.services.memcache.Statistics. 0 0 0 0 0 0)
+         (ae-memcache/statistics))))
+
+
+(deftest basic-ops
+  (is (not (ae-memcache/contains? "one")))
+  (is (nil? (ae-memcache/get "one")))
+  (is (ae-memcache/put "one" 1))
+  (is (ae-memcache/contains? "one"))
+  (is (= 1 (ae-memcache/get "one")))
+  (is (ae-memcache/put "two" 2))
+  (is (ae-memcache/delete "one"))
+  (is (not (ae-memcache/contains? "one")))
+  (is (ae-memcache/contains? "two"))
+  (is (= 2 (ae-memcache/get "two")))
+  (is (ae-memcache/increment "two" 1))
+  (is (= 3 (ae-memcache/get "two")))
+  (is (ae-memcache/increment "two" 3))
+  (is (= 6 (ae-memcache/get "two")))
+  (ae-memcache/clear-all)
+  (is (not (ae-memcache/contains? "two"))))
+
+
+(deftest sequential-ops
+  (is (ae-memcache/put-map {"one" 1, "two" 2, "three" 3, "four", 4}))
+  (is (ae-memcache/contains? "one"))
+  (is (ae-memcache/contains? "two"))
+  (is (ae-memcache/contains? "three"))
+  (is (ae-memcache/contains? "four"))
+  (is (ae-memcache/delete ["one" "three"]))
+  (is (not (ae-memcache/contains? "one")))
+  (is (ae-memcache/contains? "two"))
+  (is (not (ae-memcache/contains? "three")))
+  (is (ae-memcache/contains? "four"))
+  (is (ae-memcache/increment-map {"two" (long 10), "four" (long 15)}))
+  (is (= {"two" 12, "four" 19} (ae-memcache/get ["two" "four"]))))
+
+
+(deftest namespaced-ops
+  (ae-memcache/put "one" 1 :namespace "Alpha")
+  (ae-memcache/put "one" 10 :namespace "Bravo")
+  (ae-memcache/put "one" 100 :namespace "Charlie")
+  (ae-memcache/put "two" 101 :namespace "Charlie")
+  (is (not (ae-memcache/contains? "one")))
+  (is (= 1 (ae-memcache/get "one" :namespace "Alpha")))
+  (is (= 10 (ae-memcache/get "one" :namespace "Bravo")))
+  (is (= {"one" 100, "two" 101}
+         (ae-memcache/get ["one" "two"] :namespace "Charlie")))
+  (ae-memcache/delete "one" :namespace "Bravo")
+  (is (ae-memcache/contains? "one" :namespace "Alpha"))
+  (is (ae-memcache/contains? "one" :namespace "Charlie"))
+  (ae-memcache/increment "two" 1 :namespace "Charlie")
+  (ae-memcache/increment-map {"one" (long 3), "two" (long 4)} :namespace "Charlie")
+  (is (= {"one" 103, "two" 106}
+         (ae-memcache/get ["one" "two"] :namespace "Charlie")))
+  (is (= 1 (ae-memcache/get "one" :namespace "Alpha"))))
+
+
+(deftest policy-replace
+  (ae-memcache/put "one" 1 :policy :replace-only)
+  (is (not (ae-memcache/contains? "one")))
+  (ae-memcache/put "one" 1)
+  (is (ae-memcache/contains? "one"))
+  (is (= 1 (ae-memcache/get "one")))
+  (ae-memcache/put "one" 100 :policy :add-if-not-present)
+  (is (= 1 (ae-memcache/get "one")))
+  (ae-memcache/put "one" 101)
+  (is (= 101 (ae-memcache/get "one"))))


Initial commit

Initial commit


cosmetics to p27.clj

cosmetics to p27.clj

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/drcabana/euler-fp.git/'


Add oil production diagram

Add oil production diagram

error: pathspec 'src/clj_simple_chart/bp/diagrams/oil_production.clj' did not match any file(s) known to git

--- src/clj_simple_chart/bp/diagrams/oil_production.clj
+++ src/clj_simple_chart/bp/diagrams/oil_production.clj
@@ -0,0 +1,120 @@
+(ns clj-simple-chart.bp.diagrams.oil-production
+  (:require [clj-simple-chart.bp.bpdata2 :as bpdata]
+            [clj-simple-chart.core :refer :all]
+            [clj-simple-chart.opentype :as opentype]
+            [clj-simple-chart.translate :refer :all]
+            [clj-simple-chart.csv.csvmap :as csv]
+            [clj-simple-chart.axis.core :as axis]
+            [clj-simple-chart.rect :as rect]
+            [clj-simple-chart.chart :as chart]
+            [clj-simple-chart.bp.units :as units]
+            [clj-simple-chart.colors :as colors]
+            [clj-simple-chart.bp.wb-raw :as wb-raw]
+            [clojure.test :as test])
+  (:import (java.time Year)))
+
+(def num-days (.length (Year/of bpdata/max-year)))
+
+(def data (->> bpdata/most-recent-data-countries
+               (filter :oil_production_kbd)
+               (csv/keep-columns [:oil_production_kbd :country :country_code])
+               (mapv #(assoc % :total (/ (:oil_production_kbd %) 1000.0)))
+               (csv/drop-columns [:oil_production_kbd])
+               (sort-by :total)
+               (take-last 20)))
+
+(def norway (first (filter #(= "Norway" (:country %)) data)))
+
+;(def norway-oil-production-mill-sm3
+;  (/ (* (:total norway) (:population norway))
+;     (* 6.29 units/million)))
+;; 2016 value according to BP: 116.06028744038156
+;; 2016 value according to OD: (+ 94.009 20.176 1.879) => 116.06400000000001
+;; So that's a very good match
+
+(def marg 10)
+(def two-marg (* 2 marg))
+
+; https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
+; iPhone 4, 4s
+(def svg-width 320)
+(def svg-height 480)
+
+(def available-width (- svg-width two-marg))
+
+(def domain (mapv :country data))
+
+(def header (opentype/stack
+              {}
+              [{:text (str "Top " (count data) " Oil* Producers") :font "Roboto Black" :font-size 20}
+               {:text "Million Barrels Per Day" :font "Roboto Regular" :font-size 14 :margin-bottom 0}]))
+
+(def footer (opentype/stack
+              {:width available-width}
+              [
+               {:margin-top 5 :text "*Includes crude oil, shale oil, oil sands and NGLs." :font "Roboto Regular" :font-size 14}
+               ;{:margin-top 5 :text "No data for Iraq, Libya, Nigeria, Sudan, ++." :font "Roboto Regular" :font-size 14}
+               ;{:margin-top 2 :text "of coal and natural gas." :font "Roboto Regular" :font-size 14}
+               {:margin-top 2
+                :text       (str "Source: BP (" bpdata/bp-release-year ").") :font "Roboto Regular" :font-size 14}
+               {:valign :bottom :align :right :text "© refsdal.ivar@gmail.com" :font "Roboto Regular" :font-size 14}
+               ]))
+
+(def available-height (- svg-height (+ two-marg
+                                       (:height (meta header))
+                                       (:height (meta footer)))))
+
+(def xx {:type        :linear
+         :axis        :x
+         :orientation :top
+         :ticks       3
+         :domain      [0 15]})
+
+(def yy {:type          :ordinal
+         :axis          :y
+         :domain        domain
+         :orientation   :left
+         :round         true
+         :padding-inner 0.4
+         :padding-outer 0.3})
+
+(def c (chart/chart {:width  available-width
+                     :height available-height
+                     :x      xx
+                     :y      yy}))
+(def x (:x c))
+(def y (:y c))
+
+(def rect (rect/scaled-rect x y))
+
+(defn make-rect [{country :country
+                  coal    :coal
+                  total   :total
+                  :as     item}]
+  {:p country :h total :fill colors/green})
+
+(defn total-text [{country :country
+                   total   :total}]
+  (opentype/text {:x  (point x total)
+                  :dx ".20em"
+                  :y  (center-point y country)
+                  :dy ".32em"}
+                 (format "%.2f" total)))
+
+(defn diagram []
+  [:svg {:xmlns "http://www.w3.org/2000/svg" :width svg-width :height svg-height}
+   [:g {:transform (translate marg marg)}
+    header
+    [:g {:transform (translate (:margin-left c) (+ (:height (meta header)) (:margin-top c)))}
+     (rect (mapv make-rect data))
+     (map total-text data)
+     (axis/render-axis y)
+     (axis/render-axis x)
+     #_[:g {:transform (translate-y (- (:plot-height c) (:height (meta legend))))}
+        #_legend]]
+    [:g {:transform (translate-y (+ (:height (meta header)) available-height))} footer]
+    ]])
+
+(defn render-self []
+  (render "./img/bp-svg/oil-production.svg" "./img/bp-png/oil-production.png" (diagram)))
+


Implement branching history tracking

Implement branching history tracking

--- src-cljs/cljs_workspace/om_history.cljs
+++ src-cljs/cljs_workspace/om_history.cljs
@@ -19,26 +19,50 @@
 (def app-state (atom nil))

 ;; global atom referencing the total history graph
-(def app-history (atom [@app-state]))
+(def app-history (atom [@app-state]))
+
+
+(defn init-history [init-state]
+  (reset! app-state init-state)
+  (reset! app-history [init-state])
+  (reset! (@current-branch :data) @app-history)
+  (add-morph history-view (@current-branch :id) history-indicator))
+
+(def branch-count (atom 1))
+
+(defn generate-uuid []
+  @branch-count)

 ;; global atom referencing the branch that we currently operate on
-(def current-branch (atom @app-history))
-(def branch-count (atom 1))
+(def current-branch (atom {:id (generate-uuid) :data (atom @app-history)}))

 ;; ffd
 (def history-view)

 (defn switch-to-branch [branch]
-  (remove-morph history-view (hash @current-branch) "indexMorph")
-  (set-fill history-view (hash @current-branch) "lightgrey")
-  (set-fill history-view (hash branch) "green")
+  (prn "old branch id: " (@current-branch :id))
+  (prn "new branch id: "  (branch :id))
+  (remove-morph history-view (@current-branch :id) "indexMorph")
+  (set-fill history-view (@current-branch :id) "lightgrey")
+  (set-fill history-view (branch :id) "green")
+  (add-morph history-view (branch :id) history-indicator)
   (reset! current-branch branch))

 (defn nth-history
   ([i]
-    (nth-history i current-branch))
-  ([i branch]
-    (nth @branch i)))
+    (nth-history i @current-branch))
+  ([i {:keys [_ data]}]
+    ;; lookup in unrolled linked list
+    (if (< i (dec (count @data)))
+      (nth @data i)
+      (when-let [cont ((last @data) :cont)]
+        (nth-history (- i (dec (count @data))) cont)
+        nil))))
+
+(defn len [unrolled-list]
+  (+ -1 (count unrolled-list)
+    (when-let [end (last unrolled-list)]
+      (when-let [n (end :cont)] (len n)))))

 (def history-indicator
   {:id "indexMorph"
@@ -47,13 +71,13 @@
            :Extent {:x 4 :y branch-height }}})

 (defn branch-morph [posX posY width height branch]
-         {:id (hash branch) ;; use the hashed version of branch for uuid
+         {:id (branch :id)
           :morph {:Position {:x posX :y posY}
                   :onClick (fn [e] (switch-to-branch branch))}
           :shape {:Fill "green"
                   :BorderColor "darkgreen"
                   :Extent {:x width :y height}}
-           :submorphs [history-indicator]})
+           :submorphs []})

 (def history-view
   (atom {:id "wrapper"
@@ -77,7 +101,7 @@

 (defn revert-to [i]
   (prn "request revert: " i)
-  (let [index (* (dec (count @(@current-branch :coll))) (/ i 100))]
+  (let [index (* (dec (len @(@current-branch :data))) (/ i 100))]
     (when-let [state (when (>= index 1) (nth-history index))]
       (prn "revert to: " index)
       (reset! app-state state)
@@ -85,14 +109,13 @@
       (move-indicator-to i))))

 (defn add-new-branch [branch]
-  (let [new-branch-morph (branch-morph
-                          5 (+ 5 (* branch-height @branch-count))
+    (let [new-branch-morph (branch-morph
+                          5 (+ 5 (* branch-height (dec @branch-count)))
                          (- diagram-width 0) branch-height branch)]
-    (swap! branch-count inc)
-    (add-morph history-view "wrapper" new-branch-morph)
-    (set-extent history-view "wrapper" {:x diagram-width :y (+ 10 (* branch-height @branch-count))})
-    (switch-to-branch branch)
-    (.log js/console (morphic/dict->js @history-view))))
+      (add-morph history-view "wrapper" new-branch-morph)
+      (set-extent history-view "wrapper" {:x (+ diagram-width 10) :y (+ 10 (* branch-height @branch-count))})
+      (switch-to-branch branch))
+    (.log js/console (morphic/dict->js @history-view)))

 ;; snapshot the state when it is changed:

@@ -101,23 +124,24 @@
 ;
 ; -----\----
 ;       \------
-;
-; [ . . . . . {new-branch: \ old-val: _ } . . . ] <
-;                           \                      \
-;                            V                      \
-;                           {:offset-index _ :parent | :coll [ . . . .  ] }
+; [ . . . .  {:cont ---------------------> [ . . . . . ]
+;             :branch | }]
+;                     \
+;                      V
+;                      [ . . . . . { . . }]

 (defn branch-at [i n]
   (prn "Branching at " i)
+  (swap! branch-count inc)
   (let [index i
-        new-branch {:offset-index i :coll (atom []) :parent (atom @current-branch)}
+        new-branch {:id (generate-uuid) :data (atom [])}
         ; split the current branch
-        coll @(@current-branch :coll)
-        [pre-branch post-branch] [(vec (take index coll)) (vec (drop index coll))]
+        data @(@current-branch :data)
+        [pre-branch post-branch] [(vec (take index data)) (vec (drop index data))]
         ; insert the branching point into the old branch
-        branched-branch (into [] (concat pre-branch [{:new-branch new-branch :old-value (first post-branch)}] (rest post-branch)))]
+        branched-branch (into [] (concat pre-branch [{:cont post-branch :branch new-branch}]))]
       ; update the old branch with the inserted version
-      (reset! (@current-branch :coll) branched-branch)
+      (reset! (@current-branch :data) branched-branch)
       ; let current branch pointer point to new branch
       (add-new-branch new-branch)
       (reset! reverted-to -1)))
@@ -128,13 +152,11 @@
       (branch-at @reverted-to n)
       ; else just append to history
       :else
-      (let [b @(@current-branch :coll)]
+      (let [b @(@current-branch :data)]
         (when-not (= (last b) n)
-          (swap! (@current-branch :coll) conj n))
-        (let [c (+ (@current-branch :offset-index) (count b))]
+          (swap! (@current-branch :data) conj n))
+        (let [c (len @(@current-branch :data))]
             (prn (str c " Saved " (pluralize c "State")))))))
-
-

 ; (om/root
 ;   (fn [app owner]


Minor changes to test-core

Minor changes to test-core

--- tests/test_core.cljx
+++ tests/test_core.cljx
@@ -1,8 +1,7 @@
 (ns test-core
   #+cljs
   (:require [cats.core :as m]
-            [cats.monad.maybe :as maybe]
-            [cats.builtin :refer :all])
+            [cats.monad.maybe :as maybe])
   #+cljs
   (:require-macros [cemerick.cljs.test
                     :refer (is deftest with-test run-tests testing test-var)]
@@ -11,7 +10,8 @@
   (:require [clojure.test :refer :all]
             [cats.core :as m :refer [mlet lift-m]]
             [cats.builtin :refer :all]
-            [cats.monad.maybe :as maybe]))
+            [cats.monad.maybe :as maybe])
+  (:use [cats.builtin :only [sequence-monad]]))

 (deftest test-mlet
@@ -74,9 +74,9 @@
       (is (= (maybe/nothing)
              (monad+ (maybe/just 1) (maybe/nothing)))))
     (testing "It can lift a function to a Monad Transformer"
-      (let [maybe-vector-monad (maybe/maybe-transformer sequence-monad)]
+      (let [maybe-sequence-monad (maybe/maybe-transformer sequence-monad)]
         (is (= [(maybe/just 1) (maybe/just 2) (maybe/just  3) (maybe/just  4) (maybe/just  5) (maybe/just 6)]
-               (m/with-monad maybe-vector-monad
+               (m/with-monad maybe-sequence-monad
                  (monad+ [(maybe/just 0) (maybe/just 2) (maybe/just 4)]
                          [(maybe/just 1) (maybe/just 2)]))))))))


Add lein

Add lein

error: pathspec 'lein/profiles.clj' did not match any file(s) known to git

--- lein/profiles.clj
+++ lein/profiles.clj
@@ -0,0 +1,21 @@
+{:repl {:plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]
+                  [refactor-nrepl "2.2.0-SNAPSHOT"]]
+        :dependencies [[alembic "0.3.2"]
+                       [org.clojure/tools.nrepl "0.2.12"]]}}
+
+{:user {:plugins [[lein-dotenv "RELEASE"]
+                  [lein-exec "0.3.4"]
+                  [lein-pprint "1.1.1"]
+                  [lein-ancient "0.6.0-SNAPSHOT"]
+                  [lein-annotations "0.1.0"]
+                  [lein-autoreload "0.1.0"]
+                  [lein-bikeshed "0.2.0"]
+                  [lein-cprint "1.2.0"]
+                  [lein-ns-dep-graph "0.1.0-SNAPSHOT"]
+                  [lein-vanity "0.2.0"]
+                  [lein-ring "0.9.7"]
+                  [lein-cloudbees "1.0.5"]
+                  [org.clojure/tools.trace "0.7.9"]
+                  [venantius/ultra "0.4.0"]]
+        }
+ }


add Apps to navigation

add Apps to navigation

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/clojurecup/cc2014-frontend.git/'


correctly diffs catalogs for editing services

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/starcity-properties/odin.git/'


more achievements

more achievements

--- src-clj/acha/achievement_static.clj
+++ src-clj/acha/achievement_static.clj
@@ -1,12 +1,387 @@
 (ns acha.achievement-static)

 (def table
-  {:christmas
-   {:name "Ruined Christmas"
-    :description "Commit something on 25th of December."
-    :picture "..."}
-   :halloween
-   {:name "This code looks scary"
-    :description "Commit something on 31th of October"
-    :picture "..."}
-   })
+  {:eraser
+       {:name "Eraser"
+        :description "make a commit with no lines added, only deletions"
+        :picture "..."}
+    :massive
+       {:name "Massive"
+        :description "added more than a 1000 lines in a single commit"
+        :picture "..."}
+    :scribbler
+       {:name "Scribbler"
+        :description "created a README"
+        :picture "..."}
+    :owl
+       {:name "Owl"
+        :description "commit at 4am local time"
+        :picture "..."}
+    :flash
+       {:name "Flash"
+        :description "two different commits within 1 minute"
+        :picture "..."}
+    :waste
+       {:name "Waste"
+        :description "Your commit was reverted completely by someone else"
+        :picture "..."}
+    :loneliness
+       {:name "Loneliness"
+        :description "Being the only commiter for a week"
+        :picture "..."}
+    :easy-fix
+       {:name "Easy fix"
+        :description "swap two lines"
+        :picture "..."}
+    :multilingua
+       {:name "Multilingua"
+        :description "edit files in 5 different languages in a single commit"
+        :picture "..."}
+    :necromancer
+       {:name "Necromancer"
+        :description "make a commit to a repo that wasn’t touched for 1 month or more"
+        :picture "..."}
+    :mover
+       {:name "Mover"
+        :description "move file from one place to another without changing it"
+        :picture "..."}
+    :world-balance
+       {:name "World balance"
+        :description "Number of lines added == number of lines deleted"
+        :picture "..."}
+    :get
+       {:name "Get"
+        :description "do commit # 1000, or 1111, or 1234 (counting from beginning, chronologically sorted)"
+        :picture "..."}
+    :narcissist
+       {:name "Narcissist"
+        :description "use your own name in a commit message"
+        :picture "..."}
+    :blamer
+       {:name "Blamer"
+        :description "use someone else’s name in a commit message"
+        :picture "..."}
+    :collision
+       {:name "Collision"
+        :description "publish the first commit with the same N first chars of SHA-1 as existing commit (Collision lvl 7 is pretty rare)"
+        :picture "..."}
+    :lucky
+       {:name "Lucky"
+        :description "Consecutive 777 in SHA-1"
+        :picture "..."}
+    :mark-of-the-beast
+       {:name "Mark of the Beast"
+        :description "Consecutive 666 in SHA-1"
+        :picture "..."}
+    :hydra
+       {:name "Hydra"
+        :description "Make a commit with 3+ parents"
+        :picture "..."}
+    :commenter
+       {:name "Commenter"
+        :description "only add a comment"
+        :picture "..."}
+    :peacemaker
+       {:name "Peacemaker"
+        :description "resolve 100 conflicts"
+        :picture "..."}
+    :ocd
+       {:name "OCD"
+        :description "commit with trailing spaces removed"
+        :picture "..."}
+    :holy-war
+       {:name "Holy war"
+        :description "changed tabs to spaces or vice versa"
+        :picture "..."}
+    :combo
+       {:name "Combo"
+        :description "N commits in a row, N > 10"
+        :picture "..."}
+    :combo-breaker
+       {:name "Combo breaker"
+        :description "make a commit after someone has N commits in a row"
+        :picture "..."}
+    :worker-bee
+       {:name "Worker bee"
+        :description "make 100 non-merge commits"
+        :picture "..."}
+    :fat-ass
+       {:name "Fat Ass"
+        :description "commit 2 Mb file or bigger"
+        :picture "..."}
+    :ooops
+       {:name "Ooops"
+        :description "commit and revert commit within 1 minute"
+        :picture "..."}
+    :deal-with-it
+       {:name "Deal with it"
+        :description "update master branch with force mode"
+        :picture "..."}
+    :dangerous-game
+       {:name "Dangerous game"
+        :description "commit after 6PM friday"
+        :picture "..."}
+    :empty-commit
+       {:name ""
+        :description "do an empty commit"
+        :picture "..."}
+    :get
+       {:name "Get"
+        :description "commit exactly at 00:00"
+        :picture "..."}
+    :what-happened-here
+       {:name "What happened here?"
+        :description "edit a file that hasn’t been touched for a year"
+        :picture "..."}
+    :all-things-die
+       {:name "All things die"
+        :description "delete a file that has been added in initial commit (and at least a year has passed)"
+        :picture "..."}
+    :for-stallman
+       {:name "For Stallman!"
+        :description "add GPL license file to the repo"
+        :picture "..."}
+    :change-of-mind
+       {:name "Change of mind"
+        :description "change license type / edit license file"
+        :picture "..."}
+    :munchkin
+       {:name "Munchkin"
+        :description "Get 5 achivements with 1 commit"
+        :picture "..."}
+    :wrecking-ball
+       {:name "Wrecking ball"
+        :description "Change more than 100 files in one commit"
+        :picture "..."}
+    :alzheimers
+       {:name "Alzheimer's"
+        :description "Commit time overdue author time for 1 month or more"
+        :picture "..."}
+    :unpretending
+       {:name "Unpretending"
+        :description "zero achivments after 100 your own commits"
+        :picture "..."}
+    :good-boy
+       {:name "Good boy"
+        :description "Create 'test[s]' or 'doc[s]' directory (not on first commit)"
+        :picture "..."}
+    gitignore:
+       {:name "Gitignore"
+        :description ".gitignore"
+        :picture "..."}
+    :nothing-to-hide
+       {:name "Nothing to hide"
+        :description "commit id_rsa"
+        :picture "..."}
+    :quest-complete
+       {:name "Quest complete"
+        :description "get all achievements"
+        :picture "..."}
+    :ivory-tower
+       {:name "Ivory tower"
+        :description "Being first to commit Haskell file to a repo"
+        :picture "..."}
+    :chmod-200
+       {:name "Chmod 200"
+        :description "same for Perl"
+        :picture "..."}
+    :back-on-the-rails
+       {:name "Back on the rails"
+        :description "same for Ruby"
+        :picture "..."}
+    :even-lispers-hate-lisp
+       {:name "Even lispers hate Lisp"
+        :description "Clojure"
+        :picture "..."}
+    :even-lispers-hate-lisp-in-a-browser
+       {:name "Even lispers hate Lisp (in a browser)"
+        :description "ClojureScript"
+        :picture "..."}
+    :happily-never-after
+       {:name "Happily never after"
+        :description "JavaScript"
+        :picture "..."}
+    :why-not-ruby
+       {:name "Why not Ruby?"
+        :description "Python"
+        :picture "..."}
+    :write-once-run-anywhere
+       {:name "Write once. Run. Anywhere"
+        :description "Java"
+        :picture "..."}
+    :troubles-14
+       {:name "Troubles++14"
+        :description "C++"
+        :picture "..."}
+    :its-dangerous-to-go-alone-take-linq
+       {:name "It's dangerous to go alone, take LINQ"
+        :description "C#"
+        :picture "..."}
+    :nsverydescriptiveachievementnamewithparame
+       {:name "NSVeryDescriptiveAchievementNameWithParame..."
+        :description "Objective C"
+        :picture "..."}
+    :i-need-to-sort-complex-objects-fast
+       {:name "I need to sort complex objects fast!"
+        :description "Swift"
+        :picture "..."}
+    :not-a-web-scale
+       {:name "Not a Web Scale"
+        :description "SQL"
+        :picture "..."}
+    :its-like-objc-but-for-ericsson-phones
+       {:name "It’s like ObjC, but for Ericsson phones"
+        :description "Erlang"
+        :picture "..."}
+    :well-rewrite-that-later
+       {:name "We’ll rewrite that later"
+        :description "Bash"
+        :picture "..."}
+    :new-facebook-is-born
+       {:name "New Facebook is born"
+        :description "PHP"
+        :picture "..."}
+    :really
+       {:name "Really?"
+        :description "Pascal"
+        :picture "..."}
+    :well-typed-bro
+       {:name "Well typed, bro"
+        :description "Scala"
+        :picture "..."}
+    :zeds-dead-baby
+       {:name "Zed’s dead, baby"
+        :description "XML"
+        :picture "..."}
+    :you-designer-now
+       {:name "You designer now?"
+        :description "CSS"
+        :picture "..."}
+    :you-work-in-google
+       {:name "You work in Google?"
+        :description "Dart"
+        :picture "..."}
+    :you-cant-program-on-windows-can-you
+       {:name "You can't program on Windows, can you?"
+        :description "Windows shell"
+        :picture "..."}
+    :cradle-of-civilization
+       {:name "Cradle of civilization"
+        :description "Basic"
+        :picture "..."}
+    :professional-pride
+       {:name "Professional pride"
+        :description "make a commit at Programmer’s day"
+        :picture "..."}
+    :ruined-christmas
+       {:name "Ruined christmas"
+        :description "commit something at Dec 25"
+        :picture "..."}
+    :this-code-looks-scary
+       {:name "This code looks scary"
+        :description "Halloween"
+        :picture "..."}
+    :new-year-new-bugs
+       {:name "New year, new bugs"
+        :description "New Year"
+        :picture "..."}
+    :anniversary
+       {:name "Anniversary"
+        :description "Commit at project’s birthday"
+        :picture "..."}
+    :in-love-with-work
+       {:name "In love with work"
+        :description "Feb 14"
+        :picture "..."}
+    :rare-occasion
+       {:name "Rare occasion"
+        :description "Feb 29"
+        :picture "..."}
+    :from-russia-with-love
+       {:name "From Russia with love"
+        :description "Russia Day"
+        :picture "..."}
+    :turkey-code
+       {:name "Turkey code"
+        :description "Thanksgiving day"
+        :picture "..."}
+    :mission-impossible
+       {:name "Mission impossible"
+        :description "use word “impossible” in a message"
+        :picture "..."}
+    :the-colour-of-magic
+       {:name "The Colour of Magic"
+        :description "use word “magic” in a message"
+        :picture "..."}
+    :salvation
+       {:name "Salvation"
+        :description "use word “sorry” in a message"
+        :picture "..."}
+    :i-can-sort-it-out-myself
+       {:name "I can sort it out myself"
+        :description "use word “google” in a message"
+        :picture "..."}
+    :second-thoughts
+       {:name "Second thoughts"
+        :description "forget something (use word “forgot”)"
+        :picture "..."}
+    :save-the-day
+       {:name "Save the day"
+        :description "use word “fix”"
+        :picture "..."}
+    :were-safe-now
+       {:name "We’re safe now"
+        :description "use word “secure”"
+        :picture "..."}
+    :catchphrase
+       {:name "Catchphrase"
+        :description "10 commits with the same message"
+        :picture "..."}
+    :bad-motherfucker
+       {:name "Bad motherfucker"
+        :description "swear in a commit message"
+        :picture "..."}
+    :hello-linus
+       {:name "Hello, Linus"
+        :description "10+ swear words in a message"
+        :picture "..."}
+    :a-man-of-few-words
+       {:name "A man of few words"
+        :description "commit with 3-letter message or less"
+        :picture "..."}
+    :leo-tolstoy
+       {:name "Leo Tolstoy"
+        :description "more than 10 lines in a commit message"
+        :picture "..."}
+    :citation-needed
+       {:name "Citation needed"
+        :description "StackOverflow url in commit body or message"
+        :picture "..."}
+    :no-more-letters
+       {:name "No more letters"
+        :description "commit message without letters"
+        :picture "..."}
+    :c00l-kid
+       {:name "C00l kid"
+        :description "use emoji in commit message"
+        :picture "..."}
+    :beggar
+       {:name "Beggar"
+        :description "ask for an achievment in commit message"
+        :picture "..."}
+    :borat
+       {:name "Borat"
+        :description "Misspell word"
+        :picture "..."}
+    :real-hacker
+       {:name "Real Hacker"
+        :description "use word “hack”"
+        :picture "..."}
+    :wow
+       {:name "Wow"
+        :description "use word “wow”"
+        :picture "..."}
+    :never-probably
+       {:name "Never, probably"
+        :description "use word “later”"
+        :picture "..."})


Better test coverage.

Better test coverage.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/screen6/cardinality.git/'


create (execute-all-reports) function which will run through all of our active EmailReports and execute the ones that are scheduled to run in the current hour.  also adds in an hourly task hook for running (execute-all-reports).

--- src/metabase/tasks/email_report.clj
+++ src/metabase/tasks/email_report.clj
@@ -1,18 +1,62 @@
 (ns metabase.tasks.email-report
   "Tasks related to running `EmailReports`."
   (:require [clojure.tools.logging :as log]
+            [clj-time.core :as time]
             [korma.core :refer :all]
             [metabase.db :refer :all]
             [metabase.driver :as driver]
             [metabase.email.messages :refer [send-email-report]]
-            (metabase.models [emailreport :refer [EmailReport execution-details-fields]]
+            (metabase.models [emailreport :refer [EmailReport execution-details-fields mode->id time-of-day->realhour]]
                              [emailreport-executions :refer [EmailReportExecutions]]
                              [emailreport-recipients :refer [EmailReportRecipients]]
                              [hydrate :refer :all])
+            [metabase.task :as task]
             [metabase.util :as u]))

+;; order is important here!!  these indexes match the values from clj-times (day-of-week) function
+;; 0 = Sunday, 6 = Saturday
+(def days-of-week ["sun"
+                   "mon"
+                   "tue"
+                   "wed"
+                   "thu"
+                   "fri"
+                   "sat"])

-(declare execute report-fail report-complete)
+(declare execute-all-reports
+         execute-if-scheduled
+         execute-and-send
+         execute
+         report-fail
+         report-complete)
+
+(defn execute-all-reports
+  "Execute and Send all `EmailReports` in the system.
+   This function checks the schedule on all :active email reports and runs them if appropriate."
+  []
+  (log/debug "Executing ALL EmailReports")
+  (->> (sel :many :fields [EmailReport :id :schedule] :mode (mode->id :active))
+       (map execute-if-scheduled)))
+
+;; this adds our funtion below onto the hourly task runner
+;; TODO - maybe we should put these in a unified place for all scheduled tasks?
+(task/add-hook! #'task/hourly-tasks-hook execute-all-reports)
+
+(defn- execute-if-scheduled
+  "Test if a given report is scheduled to run at the current time and if so execute it."
+  [{{:keys [days_of_week time_of_day timezone]} :schedule id :id}]
+  (log/debug "Processing: " id days_of_week time_of_day timezone)
+  (let [now (time/to-time-zone (time/now) (time/time-zone-for-id (or timezone "UTC"))) ; NOTE this is in LOCAL timezone
+        curr-hour (time/hour now)
+        curr-weekday (get days-of-week (time/day-of-week now))]
+    ;; report schedule should look like:
+    ;;   `{:days_of_week {:mon true :tue true :wed false ...} :time_of_day "morning" :timezone "US/Pacific"}`
+    (when (and (get days_of_week (keyword curr-weekday))   ; scheduled weekdays include curr-weekday
+               (= curr-hour (time-of-day->realhour time_of_day)))  ; scheduled hour matches curr-hour
+      (try
+        (execute-and-send id)
+        (catch Throwable t
+          (log/error (format "Error executing email report: %d" id) t))))))

 (defn execute-and-send
   "Execute and Send an `EmailReport`.  This includes running the data query behind the report, formatting the email,


add useful logging utilities

add useful logging utilities