Write a basic unit test for the http handler

Refs #14.

error: pathspec 'test/icecap/handlers/http_test.clj' did not match any file(s) known to git

--- test/icecap/handlers/http_test.clj
+++ test/icecap/handlers/http_test.clj
@@ -0,0 +1,24 @@
+(ns icecap.handlers.http-test
+  (:require [clojure.core.async :as a]
+            [manifold.deferred :as d]
+            [icecap.handlers.core :refer [execute]]
+            [icecap.handlers.http]
+            [aleph.http :as h]
+            [clojure.test :refer :all]))
+
+(def step
+  {:type :http :url "http://www.example.com"})
+
+(def fake-response
+  {})
+
+(defn fake-request
+  [_]
+  (d/success-deferred fake-response))
+
+(deftest execute-tests
+  (with-redefs
+    [h/request fake-request]
+    (is (let [ch (execute step)
+              [result] (a/<!! (a/into [] ch))]
+          (= result fake-response)))))


Cube in rotation moving in a virtual box example done

fatal: unable to access 'https://github.com/fredokun/yaw.git/': The requested URL returned error: 403


Added rough code for application log in json format 	modified:   test/loganalyzer/core_test.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/StephenBergeron/Specter.git/'


Initial version of TF parsing and DSL super fun times. Supports chaining of basic operations like nobodies business

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

--- src/tensorflow_clj/proto_much.clj
+++ src/tensorflow_clj/proto_much.clj
@@ -0,0 +1,133 @@
+(ns tensorflow-clj.proto-much
+  (:require [flatland.protobuf.core :as proto]
+            [tensorflow-clj.experimental :as exp]
+            [tensorflow-clj.util :as util]
+            [random-string.core :as randy-str])
+  (:import
+    (org.tensorflow.framework.*)
+    (org.tensorflow.framework.GraphDef)))
+
+(def proto-graph-def (proto/protodef org.tensorflow.framework.GraphDef))
+(def graph-node (proto/protodef org.tensorflow.framework.NodeDef))
+
+(defn write-node [node]
+  (apply
+    (partial proto/protobuf graph-node)
+    (->> node
+         (into [])
+         (apply concat))))
+
+(def linreg-graph (proto/protobuf-load graph (util/slurp-binary "misc/linreg.pb")))
+(-> linreg-graph :node count)
+(map :name (-> linreg-graph :node))
+
+(def addconst-graph (proto/protobuf-load graph (util/slurp-binary "misc/addconst.pb")))
+(-> addconst-graph :node count)
+
+(defn gen-name [prefix]
+  ;(str prefix "_" (randy-str/string 16))
+  prefix)
+
+(defn convert-op-key [op-key]
+  (-> op-key
+      name
+      clojure.string/lower-case
+      clojure.string/capitalize))
+
+(def example-graph
+  {
+   :inputs [:in1 :in2]
+   :outputs [:mul]
+   :mappings [
+              [[:in1 :in2] :add1]
+              [[:in1 :in2] :add2]
+              [[:add1 :add2] :mul]
+              ]
+   :node-defs {
+               :in1 {
+                     :op :placeholder
+                     :dtype :float
+                     }
+               :in2 {
+                     :op :placeholder
+                     :dtype :float
+                     }
+               :mul {
+                     :op :mul
+                     }
+               :add1 {
+                      :op :add
+                      }
+               :add2 {
+                      :op :add
+                      }
+               }
+   })
+
+
+{:node [{:name "Const",
+         :op "Const",
+         :attr [{:key "value", :value {:tensor {:dtype :dt-float, :tensor-shape {}, :float-val [3.0]}}}
+                {:key "dtype", :value {:type :dt-float}}]}
+        {:name "Placeholder",
+         :op "Placeholder",
+         :attr [{:key "dtype", :value {:type :dt-float}} {:key "shape", :value {:shape {}}}]}
+        {:name "mul", :op "Mul", :input ["Const" "Placeholder"], :attr [{:key "T", :value {:type :dt-float}}]}],
+ :versions {:producer 21}}
+
+(defn build-node-def [node-name-map inputs-map key entry]
+  (let [attr (case (-> entry :op)
+               :placeholder [{:key "dtype", :value {:type "DT_FLOAT"}} {:key "shape", :value {:shape {}}}]
+               :mul [{:key "T", :value {:type "DT_FLOAT"}}]
+               :add [{:key "T", :value {:type "DT_FLOAT"}}]
+               )]
+    {
+     :name (get node-name-map key)
+     :op (-> entry :op convert-op-key)
+     :input (map #(get node-name-map %) (get inputs-map key))
+     :attr attr
+     }
+    ))
+
+(defn build-inputs-map [inputs]
+  (let [keys (map second inputs)]
+    (zipmap keys (map first inputs))))
+
+(defn build-tf-graph [graph-def]
+  (let [{:keys [inputs outputs mappings node-defs]} graph-def
+        node-keys (keys node-defs)
+        node-name-map (zipmap node-keys (map #(-> % name gen-name) node-keys))
+        inputs-map (build-inputs-map mappings)
+        node-defs (map #(apply (partial build-node-def node-name-map inputs-map) %) node-defs)]
+    {:node node-defs
+     :versions {:producer 21}}))
+
+(build-tf-graph example-graph)
+
+(defn write-graph [graph]
+  (apply
+    (partial proto/protobuf proto-graph-def)
+    (->> graph
+         (into [])
+         (apply concat))))
+
+(write-graph (build-tf-graph example-graph))
+(write-graph {:node [{:name "Const",
+                      :op "Const",
+                      :attr [{:key "value", :value {:tensor {:dtype "DT_FLOAT", :tensor-shape {}, :float-val [3.0]}}}
+                             {:key "dtype", :value {:type "DT_FLOAT"}}]}
+                     {:name "Placeholder",
+                      :op "Placeholder",
+                      :attr [{:key "dtype", :value {:type "DT_FLOAT"}} {:key "shape", :value {:shape {}}}]}
+                     {:name "mul", :op "Mul", :input ["Const" "Placeholder"], :attr [{:key "T", :value {:type "DT_FLOAT"}}]}],
+              :versions {:producer 21}})
+
+(exp/exec-graph-sess-fn
+  (fn [graph session]
+    ;(.importGraphDef graph (util/slurp-binary "misc/addconst.pb"))
+    ;(.importGraphDef graph (proto/protobuf-dump addconst-graph))
+    (.importGraphDef graph (proto/protobuf-dump (write-graph (build-tf-graph example-graph))))
+    (exp/run-graph-thing session  {:in1 (float 3.0) :in2 (float 2.0)} :mul)))
+
+(use 'clojure.repl)
+(pst *e)


adding logs and cleaning up code spacing

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-notification-works.git/'


logdriver form #99

logdriver form
#99

error: pathspec 'src/cljs/swarmpit/component/service/form_logdriver.cljs' did not match any file(s) known to git

--- src/cljs/swarmpit/component/service/form_logdriver.cljs
+++ src/cljs/swarmpit/component/service/form_logdriver.cljs
@@ -0,0 +1,77 @@
+(ns swarmpit.component.service.form-logdriver
+  (:require [material.component :as comp]
+            [swarmpit.component.state :as state]
+            [rum.core :as rum]))
+
+(enable-console-print!)
+
+(def cursor [:page :service :wizard :logdriver])
+
+(def headers [{:name  "Name"
+               :width "35%"}
+              {:name  "Value"
+               :width "35%"}])
+
+(defn- form-driver [value]
+  (comp/form-comp
+    "DRIVER NAME"
+    (comp/select-field
+      {:value    value
+       :onChange (fn [_ _ v]
+                   (state/update-value [:name] v cursor))}
+      (comp/menu-item
+        {:key         "none"
+         :value       "none"
+         :primaryText "none"})
+      (comp/menu-item
+        {:key         "json-file"
+         :value       "json-file"
+         :primaryText "json-file"})
+      (comp/menu-item
+        {:key         "journald"
+         :value       "journald"
+         :primaryText "journald"}))))
+
+(defn- form-name [value index]
+  (comp/form-list-textfield
+    {:name     (str "form-name-text-" index)
+     :key      (str "form-name-text-" index)
+     :value    value
+     :onChange (fn [_ v]
+                 (state/update-item index :name v (conj cursor :opts)))}))
+
+(defn- form-value [value index]
+  (comp/form-list-textfield
+    {:name     (str "form-value-text-" index)
+     :key      (str "form-value-text-" index)
+     :value    value
+     :onChange (fn [_ v]
+                 (state/update-item index :value v (conj cursor :opts)))}))
+
+(defn- render-variables
+  [item index]
+  (let [{:keys [name
+                value]} item]
+    [(form-name name index)
+     (form-value value index)]))
+
+(defn- form-table
+  [opts]
+  (comp/form-table headers
+                   opts
+                   nil
+                   render-variables
+                   (fn [index] (state/remove-item index (conj cursor :opts)))))
+
+(defn- add-item
+  []
+  (state/add-item {:name  ""
+                   :value ""} (conj cursor :opts)))
+
+(rum/defc form < rum/reactive []
+  (let [{:keys [name opts]} (state/react cursor)]
+    [:div
+     (comp/mui (form-driver name))
+     (comp/form-subsection-add "Add log driver option" add-item)
+     (if (not (empty? opts))
+       (form-table opts))]))


Make step: personal/about look pretty

Make step: personal/about look pretty

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/'


remove superfluous 'Error' message in --help message

--- src/brainbot/nozzle/main.clj
+++ src/brainbot/nozzle/main.clj
@@ -41,7 +41,8 @@
                  ;; ["--root" "Root directory of web server" :default "public"])
                  ["--iniconfig" "(required) ini configuration filename"])]
     (when (:help options)
-      (die banner :exit-code 0))
+      (do (println banner)
+          (System/exit 0)))
     (when-not (:iniconfig options)
       (die "--iniconfig option missing"))
     (assoc (dissoc options :help) :sections args)))


allow organization

allow organization

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/'


Use comma-sep

Use comma-sep

fatal: unable to access 'https://github.com/shaunstanislaus/cljs2go.git/': The requested URL returned error: 403


Move clojure test out of ruby section

Move clojure test out of ruby section

error: pathspec 'assignments/clojure/kindergarden-garden/test.clj' did not match any file(s) known to git

--- assignments/clojure/kindergarden-garden/test.clj
+++ assignments/clojure/kindergarden-garden/test.clj
@@ -0,0 +1,31 @@
+(load-file "garden.clj")
+
+(assert (= [:radishes :clover :grass :grass] (:alice (garden "RC\nGG"))))
+(assert (= [:violets :clover :radishes :clover] (:alice (garden "VC\nRC"))))
+
+(def small-garden (garden "VVCG\nVVRC"))
+(assert (= [:clover :grass :radishes :clover] (:bob small-garden)))
+
+(def medium-garden (garden "VVCCGG\nVVCCGG"))
+(assert (= [:clover :clover :clover :clover] (:bob medium-garden)))
+(assert (= [:grass :grass :grass :grass] (:charlie medium-garden)))
+
+(def full-garden (garden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV"))
+(assert (= [:violets  :radishes :violets  :radishes] (:alice   full-garden)))
+(assert (= [:clover   :grass    :clover   :clover]   (:bob     full-garden)))
+(assert (= [:violets  :violets  :clover   :grass]    (:charlie full-garden)))
+(assert (= [:radishes :violets  :clover   :radishes] (:david   full-garden)))
+(assert (= [:clover   :grass    :radishes :grass]    (:eve     full-garden)))
+(assert (= [:grass    :clover   :violets  :clover]   (:fred    full-garden)))
+(assert (= [:clover   :grass    :grass    :clover]   (:ginny   full-garden)))
+(assert (= [:violets  :radishes :radishes :violets]  (:harriet full-garden)))
+(assert (= [:grass    :clover   :violets  :clover]   (:ileana  full-garden)))
+(assert (= [:violets  :clover   :violets  :grass]    (:joseph  full-garden)))
+(assert (= [:grass    :clover   :clover   :grass]    (:kincaid full-garden)))
+(assert (= [:grass    :violets  :clover   :violets]  (:larry   full-garden)))
+
+(def surprise-garden (garden "VCRRGVRG\nRVGCCGCV" ["Samantha" "Patricia" "Xander" "Roger"]))
+(assert (= [:violets  :clover   :radishes :violets] (:patricia surprise-garden)))
+(assert (= [:radishes :radishes :grass    :clover]  (:roger    surprise-garden)))
+(assert (= [:grass    :violets  :clover   :grass]   (:samantha surprise-garden)))
+(assert (= [:radishes :grass    :clover   :violets] (:xander   surprise-garden)))


add nested functionality test (initial commit)

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

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


Added a custom mappings hello world example

fatal: unable to access 'https://github.com/clj-bots/pin-ctrl.git/': The requested URL returned error: 403


[TH DG] Helps when you use the scheduling channel


Added some Clojure test code for a morphism computation issue

error: pathspec 'clojure/org/gavrog/clojure/test.clj' did not match any file(s) known to git

--- clojure/org/gavrog/clojure/test.clj
+++ clojure/org/gavrog/clojure/test.clj
@@ -0,0 +1,10 @@
+(ns org.gavrog.clojure.test)
+
+(def G (first (iterator-seq (org.gavrog.joss.pgraphs.io.Net/iterator "x.cgd"))))
+(def C (.getGraph (first (.connectedComponents G))))
+(def M (.minimalImage C))
+(def nodes (iterator-seq (.nodes M)))
+(def I (org.gavrog.joss.geometry.Operator/identity 3))
+
+(def phi
+  (org.gavrog.joss.pgraphs.basic.Morphism. (nth nodes 0) (nth nodes 1) I))


deploy refactor

deploy refactor

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 debug logging to S3 writes

Add debug logging to S3 writes

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/'


Don't trace local mode fns

Don't trace local mode fns


Replace either w/ conditional in schemas

The error messages are SO MUCH BETTER with this.

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/'


tick: correct payload for :one-off

tick: correct payload for :one-off

fatal: unable to access 'https://github.com/pyr/bundes.git/': The requested URL returned error: 403


unit: remove comment

unit: remove comment

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/pyr/bundes.git/'


added some indexes

added some indexes

--- src/lobos/migrations.clj
+++ src/lobos/migrations.clj
@@ -9,20 +9,28 @@
   )

 (defmigration add-trackers-table
-  (up [] (create
-          (table-entity :trackers
-                        (varchar :tracker_identifier 256 :not-null)
-                        (timestamp :latest_activity)
-                        (varchar :shared_secret 64)
-                        )))
+  (up []
+      (create
+              (table-entity :trackers
+                            (varchar :tracker_identifier 256 :not-null :unique)
+                            (varchar :name 256)
+                            (timestamp :latest_activity :index)
+                            (varchar :shared_secret 64)
+                            ))
+      (create (index :trackers :ix_trackers_name [:name]))
+     )
   (down [] (drop (table :trackers))))

 (defmigration add-events-table
-  (up [] (create
-          (table-entity :events
-                        (refer-to :trackers)
-                        (timestamp :event_time :not-null)
-                        )))
+  (up []
+      (create
+       (table-entity :events
+                     (refer-to :trackers)
+                     (timestamp :event_time :not-null)
+                     ))
+      (create (index :events :ix_events_event_time [:event_time]))
+      )
+
   (down [] (drop (table :events))))

 (defmigration add-event-locations-table
@@ -59,7 +67,7 @@
   (down [] (drop (table :event_extension_values))))

 (defn do-migration [direction db-config]
-  (println "Do" (name direction))
+  (println "Execute" (name direction))
   (open-global (create-connection-pool *database-config*))
   (if (= :rollback direction)
     (rollback)


riemann.config/include takes relative paths.

(include "foo.clj") evaluates the file "foo.clj" relative to the
current config file. This makes breaking up configurations into multiple
files easier.

There's also a *config-file* path which gives the config file currently
being evaluated.

--- src/riemann/config.clj
+++ src/riemann/config.clj
@@ -16,11 +16,12 @@
             [riemann.graphite :as graphite-client]
             [clojure.tools.nrepl.server :as repl])
   (:use clojure.tools.logging
+        [clojure.java.io :only [file]]
         riemann.client
         riemann.email
         [riemann.pagerduty :only [pagerduty]]
         [riemann.librato :only [librato-metrics]]
-        [riemann.streams])
+        riemann.streams)
   (:gen-class))

 (def core "The currently running core."
@@ -154,6 +155,10 @@
        forms
        (recur (conj forms form) reader)))))

+(def ^:dynamic *config-file*
+  "The config file currently being included."
+  nil)
+
 (defn validate-config
   "Check that a config file has valid syntax."
   [file]
@@ -166,7 +171,14 @@
   "Include another config file.

   (include \"foo.clj\")"
-  [file]
-  (binding [*ns* (find-ns 'riemann.config)]
-    (validate-config file)
-    (load-string (slurp file))))
+  [filename]
+  (let [dir (-> (or *config-file* "ZARDOZ")
+              (file)
+              (.getCanonicalPath)
+              (file)
+              (.getParent))
+        path (str (file dir filename))]
+    (binding [*config-file* path
+              *ns* (find-ns 'riemann.config)]
+      (validate-config path)
+      (load-string (slurp path)))))


defck

defck

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

--- src/om_bootstrap/rum.clj
+++ src/om_bootstrap/rum.clj
@@ -0,0 +1,47 @@
+(ns om-bootstrap.rum
+  (:require rum
+            [plumbing.core :refer [fnk]]
+            [sablono.compiler :as s]))
+
+(defn- parse-defc [xs]
+  (loop [res  {}
+         xs   xs
+         mode nil]
+    (let [x    (first xs)
+          next (next xs)]
+      (cond
+        (and (empty? res) (symbol? x))
+          (recur {:name x} next nil)
+        (vector? x) (assoc res :argvec x
+                               :render next)
+        (string? x) (recur (assoc res :doc x) next nil)
+        (= '< x)    (recur res next :mixins)
+        (= mode :mixins)
+          (recur (update-in res [:mixins] (fnil conj []) x) next :mixins)
+        :else
+          (throw (IllegalArgumentException. (str "Syntax error at " xs)))))))
+
+(defn- -defck [render-ctor body]
+  (let [{:keys [name doc mixins argvec render]} (parse-defc body)]
+   `(let [render-fn#    (fnk ~argvec ~(s/compile-html `(do ~@render)))
+          render-mixin# (~render-ctor render-fn#)
+          class#        (rum/build-class (concat [render-mixin#] ~mixins) ~(str name))
+          ctor#         (fn [& args#]
+                          (let [state# (rum/args->state args#)]
+                            (rum/element class# state# nil)))]
+      (def ~name ~doc (with-meta ctor# {::class class#})))))
+
+(defmacro defck
+  "Defc does couple of things:
+
+     1. Wraps body into sablono/compile-html
+     2. Generates render function from that
+     3. Takes render function and mixins, builds React class from them
+     4. Using that class, generates constructor fn [paramsk]->ReactElement
+     5. Defines top-level var with provided name and assigns ctor to it
+
+   Usage:
+
+       (defc name doc-string? [< mixins+]? [paramsk] render-body+)"
+  [& body]
+  (-defck 'rum/render->mixin body))


Adding a simple microphone input instrument.

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

--- src/overtone/inst/io.clj
+++ src/overtone/inst/io.clj
@@ -0,0 +1,7 @@
+(ns overtone.inst.io
+  (:use overtone.core))
+
+(definst mic [amp 1]
+  (let [src (in (num-output-buses:ir))]
+    (* amp src)))
+


First cut of the Memcache service.

First cut of the Memcache service.

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

--- src/appengine_magic/services/memcache.clj
+++ src/appengine_magic/services/memcache.clj
@@ -0,0 +1,71 @@
+(ns appengine-magic.services.memcache
+  (:refer-clojure :exclude (contains? get))
+  (:import [com.google.appengine.api.memcache MemcacheService MemcacheServiceFactory]))
+
+
+(defonce *default-memcache-service* (atom nil))
+(defonce *namespaced-memcache-services* (atom {}))
+
+
+(defn- get-memcache-service [& {:keys [service namespace]}]
+  (cond (and (nil? service) (nil? namespace))
+          (do (when (nil? @*default-memcache-service*)
+                (reset! *default-memcache-service* (MemcacheServiceFactory/getMemcacheService)))
+              @*default-memcache-service*)
+        (not (nil? service))
+          service
+        (not (nil? namespace))
+          (let [s (@*namespaced-memcache-services* namespace)]
+            (if-not (nil? s)
+                s
+                ((swap! *namespaced-memcache-services* assoc
+                        namespace (MemcacheServiceFactory/getMemcacheService namespace))
+                 namespace)))))
+
+
+(defrecord Statistics [bytes-returned-for-hits
+                       hit-count
+                       item-count
+                       max-time-without-access
+                       miss-count
+                       total-item-bytes])
+
+
+(defn stats [& {:keys [service namespace]}]
+  (let [service (get-memcache-service :service service :namespace namespace)
+        stats (.getStatistics service)]
+    (Statistics. (.getBytesReturnedForHits stats)
+                 (.getHitCount stats)
+                 (.getItemCount stats)
+                 (.getMaxTimeWithoutAccess stats)
+                 (.getMissCount stats)
+                 (.getTotalItemBytes stats))))
+
+
+(defn clear
+  "Clears the entire cache. Does not respect namespaces!"
+  [& {:keys [service namespace]}]
+  (let [service (get-memcache-service :service service :namespace namespace)]
+    (.clearAll service)))
+
+
+(defn contains? [key & {:keys [service namespace]}]
+  (let [service (get-memcache-service :service service :namespace namespace)]
+    (.contains service key)))
+
+
+(defn delete [key & {:keys [service namespace millis-no-readd]}]
+  (let [service (get-memcache-service :service service :namespace namespace)]
+    (if millis-no-readd
+        (.delete service key millis-no-readd)
+        (.delete service key))))
+
+
+(defn get [key & {:keys [service namespace]}]
+  (let [service (get-memcache-service :service service :namespace namespace)]
+    (.get service key)))
+
+
+(defn put [key value & {:keys [service namespace]}]
+  (let [service (get-memcache-service :service service :namespace namespace)]
+    (.put service key value)))


Animated pulse

Animated pulse

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/dominikzarzecki/meteor-impacts-timelapse.git/'


simplify benchmarks

simplify benchmarks

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/'


6 clojure

6 clojure

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

--- clojure/6.clj
+++ clojure/6.clj
@@ -0,0 +1,7 @@
+(defn square [a] (* a a))
+(def sum (partial reduce +))
+(def sum-squares (comp sum (partial map square)))
+(def square-sum (comp * square sum))
+(defn diff-square-sum-and-sum-squares [xs]
+  (- (square-sum xs) (sum-squares xs)))
+(println (diff-square-sum-and-sum-squares (range 1 101)))


Add new geom impl under uxbox.util.geom ns.

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

--- src/uxbox/util/geom.cljs
+++ src/uxbox/util/geom.cljs
@@ -0,0 +1,564 @@
+;; This Source Code Form is subject to the terms of the Mozilla Public
+;; License, v. 2.0. If a copy of the MPL was not distributed with this
+;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+;;
+;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
+
+(ns uxbox.util.geom
+  (:require [uxbox.util.geom.matrix :as gmt]
+            [uxbox.util.geom.point :as gpt]
+            [uxbox.util.math :as mth]
+            [uxbox.state :as st]))
+
+;; --- Types
+
+(def ^:const +hierarchy+
+  (-> (make-hierarchy)
+      (derive ::rect ::shape)
+      (derive :icon ::rect)
+      (derive :rect ::rect)
+      (derive :line ::shape)
+      (derive :circle ::shape)
+      (derive :text ::rect)
+      (derive :group ::rect)))
+
+(defn shape?
+  [type]
+  (isa? +hierarchy+ type ::shape))
+
+;; --- Relative Movement
+
+(declare move-rect)
+(declare move-circle)
+(declare move-group)
+
+(defn move
+  "Move the shape relativelly to its current
+  position applying the provided delta."
+  [shape dpoint]
+  (case (:type shape)
+    :icon (move-rect shape dpoint)
+    :rect (move-rect shape dpoint)
+    :line (move-rect shape dpoint)
+    :circle (move-circle shape dpoint)
+    :group (move-group shape dpoint)))
+
+(defn- move-rect
+  "A specialized function for relative movement
+  for rect-like shapes."
+  [shape {dx :x dy :y}]
+  (assoc shape
+         :x1 (+ (:x1 shape) dx)
+         :y1 (+ (:y1 shape) dy)
+         :x2 (+ (:x2 shape) dx)
+         :y2 (+ (:y2 shape) dy)))
+
+(defn- move-circle
+  "A specialized function for relative movement
+  for circle shapes."
+  [shape {dx :x dy :y}]
+  (assoc shape
+         :cx (+ (:cx shape) dx)
+         :cy (+ (:cy shape) dy)))
+
+(defn- move-group
+  "A specialized function for relative movement
+  for group shapes."
+  [shape {dx :x dy :y}]
+  (assoc shape
+         :dx (+ (:dx shape 0) dx)
+         :dy (+ (:dy shape 0) dy)))
+
+;; --- Absolute Movement
+
+(declare absolute-move-rect)
+(declare absolute-move-circle)
+(declare absolute-move-group)
+
+(defn absolute-move
+  "Move the shape to the exactly specified position."
+  [shape point]
+  (case (:type shape)
+    :icon (absolute-move-rect shape point)
+    :rect (absolute-move-rect shape point)
+    :line (absolute-move-rect shape point)
+    :circle (absolute-move-circle shape point)
+    :group (absolute-move-group shape point)))
+
+(defn- absolute-move-rect
+  "A specialized function for absolute moviment
+  for rect-like shapes."
+  [shape {:keys [x y] :as pos}]
+  (let [dx (if x (- (:x1 shape) x) 0)
+        dy (if y (- (:y1 shape) y) 0)]
+    (move shape (gpt/point dx dy))))
+
+(defn- absolute-move-circle
+  "A specialized function for absolute moviment
+  for rect-like shapes."
+  [shape {:keys [x y] :as pos}]
+  (let [dx (if x (- (:cx shape) x) 0)
+        dy (if y (- (:cy shape) y) 0)]
+    (move shape (gpt/point dx dy))))
+
+(defn- absolute-move-group
+  "A specialized function for absolute moviment
+  for rect-like shapes."
+  [shape {:keys [x y] :as pos}]
+  (throw (ex-info "Not implemented (TODO)" {})))
+
+;; --- Rotation
+
+;; TODO: maybe we can consider apply the rotation
+;;       directly to the shape coordinates?
+
+(defn rotate
+  "Apply the rotation to the shape."
+  [shape rotation]
+  (assoc shape :rotation rotation))
+
+;; --- Size
+
+(declare rect-size)
+
+(defn size
+  "Calculate the size of the shape."
+  [shape]
+  (case (:type shape)
+    :rect (rect-size shape)
+    :icon (rect-size shape)
+    :line (rect-size shape)))
+
+(defn- rect-size
+  "A specialized function for calculate size
+  for rect-like shapes."
+  [{:keys [x1 y1 x2 y2] :as shape}]
+  {:width (- x2 x1)
+   :height (- y2 y1)})
+
+;; --- Vertex Movement (Relative)
+
+(declare move-rect-vertex)
+(declare move-circle-vertex)
+
+(defn move-vertex
+  "Resize the shape moving one of its vertex using
+  relative delta."
+  [shape vid dpoint]
+  (case (:type shape)
+    :rect (move-rect-vertex shape vid dpoint)
+    :icon (move-rect-vertex shape vid dpoint)
+    :circle (move-circle-vertex shape vid dpoint)))
+
+(defn- move-rect-vertex
+  "A specialized function for vertex movement
+  for rect-like shapes."
+  [shape vid {dx :x dy :y}]
+  (let [{:keys [x1 x2 y1 y2]} shape]
+    (case vid
+      1 (assoc shape
+               :x1 (min x2 (+ x1 dx))
+               :y1 (min y2 (+ y1 dy)))
+      2 (assoc shape
+               :x2 (max x1 (+ x2 dx))
+               :y1 (min y2 (+ y1 dy)))
+      3 (assoc shape
+               :x1 (min x2 (+ x1 dx))
+               :y2 (max y1 (+ y2 dy)))
+      4 (assoc shape
+               :x2 (max x1 (+ x2 dx))
+               :y2 (max y1 (+ y2 dy))))))
+
+(defn- move-circle-vertex
+  "A specialized function for vertex movement
+  for circle shapes."
+  [shape vid {dx :x dy :y lock :lock}]
+  (let [[dx dy] (if lock [dx dx] [dx dy])]
+    (case vid
+      1 (assoc shape
+               :rx (- (:rx shape) dx)
+               :ry (- (:ry shape) dy))
+      2 (assoc shape
+               :rx (+ (:rx shape) dx)
+               :ry (- (:ry shape) dy))
+      3 (assoc shape
+               :rx (- (:rx shape) dx)
+               :ry (+ (:ry shape) dy))
+      4 (assoc shape
+               :rx (+ (:rx shape) dx)
+               :ry (+ (:ry shape) dy)))))
+
+;; --- Resize (Absolute)
+
+(declare resize-rect)
+(declare resize-line)
+(declare resize-circle)
+(declare normalize-shape)
+(declare equalize-sides)
+
+(defn resize
+  "Resize the shape using absolute position.
+  NOTE: used in draw operation."
+  [shape point]
+  (case (:type shape)
+    :rect (resize-rect shape point)
+    :icon (resize-rect shape point)
+    :text (resize-rect shape point)
+    :line (resize-line shape point)
+    :circle (resize-circle shape point)))
+
+(defn- resize-rect
+  "A specialized function for absolute resize
+  for rect-like shapes."
+  [shape {:keys [x y lock] :as pos}]
+  (if lock
+    (-> (assoc shape :x2 x :y2 y)
+        (equalize-sides)
+        (normalize-shape))
+    (normalize-shape (assoc shape :x2 x :y2 y))))
+
+(defn- resize-circle
+  "A specialized function for absolute resize
+  for circle shapes."
+  [shape {:keys [x y lock] :as pos}]
+  (let [cx (:cx shape)
+        cy (:cy shape)
+
+        rx (mth/abs (- x cx))
+        ry (mth/abs (- y cy))]
+    (if lock
+      (assoc shape :rx rx :ry rx)
+      (assoc shape :rx rx :ry ry))))
+
+(defn- resize-line
+  "A specialized function for absolute resize
+  for line shapes."
+  [shape {:keys [x y] :as pos}]
+  (assoc shape :x2 x :y2 y))
+
+(defn- normalize-shape
+  "Normalize shape coordinates."
+  [shape]
+  (let [x1 (min (:x1 shape) (:x2 shape))
+        y1 (min (:y1 shape) (:y2 shape))
+        x2 (max (:x1 shape) (:x2 shape))
+        y2 (max (:y1 shape) (:y2 shape))]
+    (assoc shape :x1 x1 :x2 x2 :y1 y1 :y2 y2)))
+
+(defn- equalize-sides
+  "Fix shape sides to be equal according to the lock mode."
+  [shape]
+  (let [{:keys [x1 x2 y1 y2]} shape
+        x-side (mth/abs (- x2 x1))
+        y-side (mth/abs (- y2 y1))
+        max-side (max x-side y-side)]
+    (cond
+      (and (> x1 x2) (> y1 y2))
+      (assoc shape :x2 (- x1 max-side) :y2 (- y1 max-side))
+
+      (and (< x1 x2) (< y1 y2))
+      (assoc shape :x2 (+ x1 max-side) :y2 (+ y1 max-side))
+
+      (and (> x1 x2) (< y1 y2))
+      (assoc shape :x2 (- x1 max-side) :y2 (+ y1 max-side))
+
+      (and (< x1 x2) (> y1 y2))
+      (assoc shape :x2 (+ x1 max-side) :y2 (- y1 max-side)))))
+
+;; --- Setup (Initialize)
+
+(declare setup-rect)
+(declare setup-circle)
+(declare setup-group)
+
+(defn setup
+  "A function that initializes the first coordinates for
+  the shape. Used mainly for draw operations."
+  [shape props]
+  (case (:type shape)
+    :rect (setup-rect shape props)
+    :icon (setup-rect shape props)
+    :line (setup-rect shape props)
+    :text (setup-rect shape props)
+    :circle (setup-circle shape props)
+    :group (setup-group shape props)))
+
+(defn- setup-rect
+  "A specialized function for setup rect-like shapes."
+  [shape {:keys [x1 y1 x2 y2]}]
+  (assoc shape
+         :x1 x1
+         :y1 y1
+         :x2 x2
+         :y2 y2))
+
+(defn- setup-group
+  "A specialized function for setup group shapes."
+  [shape {:keys [x1 y1 x2 y2] :as props}]
+  (assoc shape :initial props))
+
+(defn- setup-circle
+  "A specialized function for setup circle shapes."
+  [shape {:keys [x1 y1 x2 y2]}]
+  (assoc shape
+         :cx x1
+         :cy y1
+         :rx (mth/abs (- x2 x1))
+         :ry (mth/abs (- y2 y1))))
+
+;; --- Outer Rect
+
+(declare generic-outer-rect)
+(declare line-outer-rect)
+(declare circle-outer-rect)
+(declare group-outer-rect)
+(declare apply-rotation-transformation)
+
+(defn outer-rect
+  ([shape]
+   (outer-rect @st/state shape))
+  ([state shape]
+   (case (:type shape)
+     :rect (generic-outer-rect state shape)
+     :text (generic-outer-rect state shape)
+     :icon (generic-outer-rect state shape)
+     :line (line-outer-rect state shape)
+     :circle (circle-outer-rect state shape)
+     :group (group-outer-rect state shape))))
+
+(defn outer-rect-coll
+  [shapes]
+  {:pre [(seq shapes)]}
+  (let [shapes (map outer-rect shapes)
+        x (apply min (map :x shapes))
+        y (apply min (map :y shapes))
+        x' (apply max (map (fn [{:keys [x width]}] (+ x width)) shapes))
+        y' (apply max (map (fn [{:keys [y height]}] (+ y height)) shapes))
+        width (- x' x)
+        height (- y' y)]
+    {:width width
+     :height height
+     :x x
+     :y y}))
+
+(defn- generic-outer-rect
+  [state {:keys [x1 y1] :as shape}]
+  (-> (assoc shape :x x1 :y y1)
+      (merge (size shape))
+      (apply-rotation-transformation)))
+
+(defn- line-outer-rect
+  [state {:keys [x1 y1 x2 y2 group] :as shape}]
+  (let [group (get-in state [:shapes-by-id group])
+        props {:x (+ x1 (:dx group 0))
+               :y (+ y1 (:dy group 0))
+               :width (- x2 x1)
+               :height (- y2 y1)}]
+    (-> (merge shape props)
+        (apply-rotation-transformation))))
+
+(defn- circle-outer-rect
+  [state {:keys [cx cy rx ry group] :as shape}]
+  (let [group (get-in state [:shapes-by-id group])
+        props {:x (+ (- cx rx) (:dx group 0))
+               :y (+ (- cy ry) (:dy group 0))
+               :width (* rx 2)
+               :height (* ry 2)}]
+    (-> (merge shape props)
+        (apply-rotation-transformation))))
+
+(defn- group-outer-rect
+  [state {:keys [id group rotation dx dy] :as shape}]
+  (let [shapes (->> (:items shape)
+                    (map #(get-in @st/state [:shapes-by-id %]))
+                    (map (partial outer-rect state)))
+        x (apply min (map :x shapes))
+        y (apply min (map :y shapes))
+        x' (apply max (map (fn [{:keys [x width]}] (+ x width)) shapes))
+        y' (apply max (map (fn [{:keys [y height]}] (+ y height)) shapes))
+        width (- x' x)
+        height (- y' y)
+        x (+ x dx)
+        y (+ y dy)]
+    (-> (merge shape {:width width :height height :x x :y y})
+        (apply-rotation-transformation))))
+
+(declare apply-rotation)
+
+(defn- apply-rotation-transformation
+  [{:keys [x y width height rotation] :as shape}]
+  (let [center-x (+ x (/ width 2))
+        center-y (+ y (/ height 2))
+
+        angle (mth/radians (or rotation 0))
+        x1 (- x center-x)
+        y1 (- y center-y)
+
+        x2 (- (+ x width) center-x)
+        y2 (- y center-y)
+
+        [rx1 ry1] (apply-rotation [x1 y1] rotation)
+        [rx2 ry2] (apply-rotation [x2 y2] rotation)
+
+        [d1 d2] (cond
+                  (and (>= rotation 0)
+                       (< rotation 90))
+                  [(mth/abs ry1)
+                   (mth/abs rx2)]
+
+                  (and (>= rotation 90)
+                       (< rotation 180))
+                  [(mth/abs ry2)
+                   (mth/abs rx1)]
+
+                  (and (>= rotation 180)
+                       (< rotation 270))
+                  [(mth/abs ry1)
+                   (mth/abs rx2)]
+
+                  (and (>= rotation 270)
+                       (<= rotation 360))
+                  [(mth/abs ry2)
+                   (mth/abs rx1)])
+        final-x (- center-x d2)
+        final-y (- center-y d1)
+        final-width (* d2 2)
+        final-height (* d1 2)]
+    (merge shape
+           {:x final-x
+            :y final-y
+            :width final-width
+            :height final-height})))
+
+;; --- Transformation Matrix
+
+(declare rect-transformation-matrix)
+(declare text-transformation-matrix)
+(declare circle-transformation-matrix)
+(declare icon-transformation-matrix)
+(declare group-transformation-matrix)
+
+(defn transformation-matrix
+  ([shape]
+   (transformation-matrix @st/state shape))
+  ([state shape]
+   (case (:type shape)
+     :rect (rect-transformation-matrix state shape)
+     :text (text-transformation-matrix state shape)
+     :circle (circle-transformation-matrix state shape)
+     :icon (icon-transformation-matrix state shape)
+     :group (group-transformation-matrix state shape))))
+
+(defn- rect-transformation-matrix
+  [state {:keys [x1 y1 rotation] :or {rotation 0} :as shape}]
+  (let [{:keys [width height]} (size shape)
+        center-x (+ x1 (/ width 2))
+        center-y (+ y1 (/ height 2))]
+    (-> (gmt/matrix)
+        (gmt/translate center-x center-y)
+        (gmt/rotate rotation)
+        (gmt/translate (- center-x) (- center-y)))))
+
+(defn- text-transformation-matrix
+  [state {:keys [x1 y1 rotation] :or {rotation 0} :as shape}]
+  (let [{:keys [width height]} (size shape)
+        center-x (+ x1 (/ width 2))
+        center-y (+ y1 (/ height 2))]
+    (-> (gmt/matrix)
+        (gmt/translate center-x center-y)
+        (gmt/rotate rotation)
+        (gmt/translate (- center-x) (- center-y)))))
+
+(defn- icon-transformation-matrix
+  [state {:keys [x1 y1 rotation view-box] :or {rotation 0} :as shape}]
+  (let [{:keys [width height]} (size shape)
+        orig-width (nth view-box 2)
+        orig-height (nth view-box 3)
+        scale-x (/ width orig-width)
+        scale-y (/ height orig-height)
+        center-x (- width (/ width 2))
+        center-y (- height (/ height 2))]
+    (-> (gmt/matrix)
+        (gmt/translate x1 y1)
+        (gmt/translate center-x center-y)
+        (gmt/rotate rotation)
+        (gmt/translate (- center-x) (- center-y))
+        (gmt/scale scale-x scale-y))))
+
+(defn- circle-transformation-matrix
+  [state {:keys [cx cy rx ry rotation] :or {rotation 0} :as shape}]
+  (-> (gmt/matrix)
+      (gmt/translate cx cy)
+      (gmt/rotate rotation)
+      (gmt/translate (- cx) (- cy))))
+
+;; --- Helpers
+
+(defn apply-rotation
+  [[x y :as v] rotation]
+  (let [angle (mth/radians rotation)
+        rx (- (* x (mth/cos angle))
+              (* y (mth/sin angle)))
+        ry (+ (* x (mth/sin angle))
+              (* y (mth/cos angle)))]
+    (let [r [(mth/precision rx 6)
+             (mth/precision ry 6)]]
+      r)))
+
+(defn resolve-parent
+  "Recursively resolve the real shape parent."
+  ([shape]
+   (resolve-parent @st/state shape))
+  ([state {:keys [group] :as shape}]
+   (if group
+     (resolve-parent state (get-in state [:shapes-by-id group]))
+     shape)))
+
+(defn contained-in?
+  "Check if a shape is contained in the
+  provided selection rect."
+  [shape selrect]
+  (let [sx1 (:x selrect)
+        sx2 (+ sx1 (:width selrect))
+        sy1 (:y selrect)
+        sy2 (+ sy1 (:height selrect))
+        rx1 (:x shape)
+        rx2 (+ rx1 (:width shape))
+        ry1 (:y shape)
+        ry2 (+ ry1 (:height shape))]
+    (and (neg? (- (:y selrect) (:y shape)))
+         (neg? (- (:x selrect) (:x shape)))
+         (pos? (- (+ (:y selrect)
+                     (:height selrect))
+                  (+ (:y shape)
+                     (:height shape))))
+         (pos? (- (+ (:x selrect)
+                     (:width selrect))
+                  (+ (:x shape)
+                     (:width shape)))))))
+
+;; TODO: maybe remove, seems it not used anymore.
+
+(defn translate-coords
+  "Given a shape and initial coords, transform
+  it mapping its coords to new provided initial coords."
+  ([shape x y]
+   (translate-coords shape x y -))
+  ([shape x y op]
+   (let [x' (:x shape)
+         y' (:y shape)]
+     (assoc shape :x (op x' x) :y (op y' y)))))
+
+;; This function will be deleted when selrect is implemented properly
+
+(defn parent-satisfies?
+  "Resolve the first parent that satisfies a condition."
+  [{:keys [group] :as shape} pred]
+  (let [shapes-by-id (:shapes-by-id @st/state)]
+    (if group
+      (loop [parent (get shapes-by-id group)]
+        (cond
+          (pred parent) true
+          (:group parent) (recur (get shapes-by-id (:group parent)))
+          :else false))
+      false)))


consumer loop

consumer loop

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/ChallenHB/samsara.git/'


todo: better parsing

todo: better parsing

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

--- src/latte/parse.clj
+++ src/latte/parse.clj
@@ -0,0 +1,26 @@
+;;{
+;; # Parsing tools
+;;
+;; In this namespace all the user-facing syntactic artefacts of LaTTe
+;; are checked for well-formedness. This is not concerned with term-level parsing.
+;; The emphasis is on precision and clarity of (potential) error messages
+;;}
+
+(ns latte.parse
+  (:require [latte-kernel.presyntax :as stx]))
+
+
+(defn parse-definition [args]
+  (if (< (count args) 3)
+    [:ko "Definition form requires at least 3 arguments." {:nb-args (count args)}]
+    (let [def-name (first args)
+          [status msg infos] (check-def-name def-name)]
+      (if (= status :ko)
+        [status msg infos]
+        (let [def-doc (if (string? (second args))
+                        )])
+
+
+
+
+


fix bug in func call

fix bug in func call

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/micbie/evemm.git/'


Adding cache to tenant resources check

Adding cache to tenant resources check

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/'


Add routing/dispatch on pages and stub event page

error: pathspec 'src/cljs/event_planner/pages/events.cljs' did not match any file(s) known to git

--- src/cljs/event_planner/pages/events.cljs
+++ src/cljs/event_planner/pages/events.cljs
@@ -0,0 +1,4 @@
+(ns event-planner.pages.events)
+
+(defn events-page [id]
+  [:div "Wow my id is: " id])


Adding one more test

Adding one more test


todo's added

todo's added

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


Refactored various snippets of code from ginormous handle-click function into smaller functions that has a single responsibility.

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/hzhu/memory-game-reagent.git/'


Use a set over a vector

Use a set over a vector

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/'


core zum Austausch mit Stammi usw.

core
zum Austausch mit Stammi usw.

--- src/hello_world/core.clj
+++ src/hello_world/core.clj
@@ -0,0 +1,52 @@
+;; When executed, this file will run a basic web server
+;; on http://localhost:8080.
+
+(ns ring.example.params
+  (:use ring.middleware.params
+        ring.util.response
+        ring.adapter.jetty))
+
+(defn page [name]
+  (str ""
+       (if name
+         (str "Nice to meet you, " name "!")
+         (str "<form>"
+              "Name: <input name='name' type='text'>"
+              "<input type='submit'>"
+              "</form>"))
+       ""))
+
+(defn handler [{{name "name"} :params}]
+  (-> (response (page name))
+      (content-type "text/html")))
+
+;(def sqlquery
+;    (j/query mysql-db ["select * from konten"]))
+
+(def app
+  (-> (handler wrap-params)
+;     (sqlquery)
+      ))
+
+(require '[clojure.java.jdbc :as j])
+
+(let [db-host "localhost"
+      db-port 3306
+      db-name "mgm_schema"]
+
+  (def mysql-db {:classname "com.mysql.jdbc.Driver" ; must be in classpath
+           :subprotocol "mysql"
+           :subname (str "//" db-host ":" db-port "/" db-name)
+           ; Any additional keys are passed to the driver
+           ; as driver-specific properties.
+           :user "johorst"
+           :password "666jojojo"}))
+;geht:
+;(j/insert! mysql-db :konten
+;           {:Kontonummer 9 :Kontostand 3}
+;           {:Kontonummer 10 :Kontostand 1})
+
+
+(run-jetty app {:port 8080})
+;(def server (run-jetty app {:port 8080 :join? false}))
+


pep-024 solved

pep-024 solved

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

--- src/pep_024/solution.clj
+++ src/pep_024/solution.clj
@@ -0,0 +1,8 @@
+(ns pep-024.solution
+  (:require [clojure.math.combinatorics :as combo]))
+
+(defn solve [n]
+  (apply str (last (take n (combo/permutations [0 1 2 3 4 5 6 7 8 9])))))
+
+(defn -main [& _]
+  (solve 1e6))


ensure that urls open once, and dead man application replaces itself

--- sidecar/src/figwheel_sidecar/components/cljs_autobuild.clj
+++ sidecar/src/figwheel_sidecar/components/cljs_autobuild.clj
@@ -113,6 +113,23 @@
      libs
      (not-empty (mapv :file foreign-libs)))))

+;; open url build middleware
+
+(def open-url-once (memoize clojure.java.browse/browse-url))
+
+(defn open-urls [build-state]
+  (when-let [urls (not-empty
+                (-> build-state
+                    :build-config
+                    :figwheel
+                    :open-urls))]
+    (doseq [url urls] (open-url-once url))))
+
+(defn open-urls-hook [build-fn]
+  (fn [build-state]
+    (build-fn build-state)
+    (open-urls build-state)))
+
 (defn extract-data-for-deadman-app [build-config e]
   (-> build-config
       :figwheel
@@ -123,7 +140,8 @@
                            :exception-data (cljs-ex/parse-exception e)}])))

 (defn deadman-header-comment []
-  "/* NOT YOUR COMPILED CLOJURESCRIPT - TEMPORARY FIGHWEEL GENERATED PROGRAM
+  "/* FIGWHEEL BAD COMPILE RECOVERY APPLICATION */
+/* NOT YOUR COMPILED CLOJURESCRIPT - TEMPORARY FIGWHEEL GENERATED PROGRAM
  * This is only created in the case where the compile fails and you don't have a
  * generated output-to file.
  */")
@@ -142,19 +160,10 @@
            (slurp #_(io/file (str "../sidecar/resources/compiled-utils/figwheel-helper-deploy.js"))
                   (io/resource "compiled-utils/figwheel-helper-deploy.js"))))))

-(defn open-urls [build-state]
-  (when-let [urls (not-empty
-                (-> build-state
-                    :build-config
-                    :figwheel
-                    :open-urls))]
-    (doseq [url urls]
-      (clojure.java.browse/browse-url url))))
-
-(defn open-urls-hook [build-fn]
-  (fn [build-state]
-    (build-fn build-state)
-    (open-urls build-state)))
+(defn deadman-output-to-file? [output-to-file]
+  (when (.exists (io/file output-to-file))
+    (when-let [first-line (first (line-seq (io/reader output-to-file)))]
+      (re-matches #".*FIGWHEEL BAD COMPILE.*"  (str first-line)))))

 ;; this is just used for the initial build
 (defn catch-print-hook
@@ -172,7 +181,8 @@
           ;; the user is in an interactive development environment
           ;; if not we need to stop and let them know
           ;; this only applies if :output-to doesn't exist
-          (when-not (.exists (io/file output-to-filepath))
+          (when (or (not (.exists (io/file output-to-filepath)))
+                    (deadman-output-to-file? output-to-filepath))
             ;; must be a fighweel build
             ;; and not a node build
             (if (and (:figwheel build-config)


Move emacs helpers to clj folder

Move emacs helpers to clj folder

error: pathspec 'src/clj/koeeoadi/emacs-helpers.clj' did not match any file(s) known to git

--- src/clj/koeeoadi/emacs-helpers.clj
+++ src/clj/koeeoadi/emacs-helpers.clj
@@ -0,0 +1,9 @@
+(ns koeeoadi.emacs-helpers)
+
+(defn plist-to-map [plist]
+  (let [plist-to-map' (fn [x]
+                        (if (coll? x)
+                          (into {} (mapv #(into [] %) (partition 2 2 x)))
+                          x))]
+    (vec (reverse (mapv plist-to-map' plist)))))
+


Warn every 10th message if queue size gets too big

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/Yleisradio/rabid.git/'


Added helpers file

Added helpers file

Added handy console.log function

error: pathspec 'src/cljs/funnel_front/lib/helpers.cljs' did not match any file(s) known to git

--- src/cljs/funnel_front/lib/helpers.cljs
+++ src/cljs/funnel_front/lib/helpers.cljs
@@ -0,0 +1,5 @@
+(ns funnel-front.lib.helpers)
+
+;; https://groups.google.com/forum/#!topic/clojure/ghHqHuXE0pY
+(defn clog! [to-print]
+  (.log js/console (pr-str to-print)))


results sandbox

results sandbox

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

--- src/atom_finder/results_sandbox.clj
+++ src/atom_finder/results_sandbox.clj
@@ -0,0 +1,101 @@
+(ns atom-finder.atom-stats
+  (:require
+   [atom-finder.util :refer :all]
+   [atom-finder.classifier-util :refer :all]
+   [atom-finder.constants :refer :all]
+   [atom-finder.comment-change :refer :all]
+   [clojure.pprint :refer [pprint]]
+   [schema.core :as s]
+   )
+  )
+
+;(def mem-data-old mem-data)
+;(def commen-aggs-old comment-aggs)
+(comment
+(time (do
+(->> "gcc-atom-comment-context_2017-05-17_1.edn"
+     read-data
+     (def mem-data) time)
+(->> mem-data
+     flatten-res
+     (filter :ast-size-before) ; remove commits that didn't parse
+     (def flat-data) time)
+(->> flat-data
+     (map #(dissoc % :atom :revstr :bug-ids :file))
+     (def comment-counts)
+     time
+     )
+(->> comment-counts
+     ;pprint)
+     (apply merge-with +)
+     (def comment-aggs)
+     time
+     )
+
+(pprint (sort comment-aggs))
+
+(pprint (map-values #(format "%05f" (float %))
+  {:inner-atom-comment-rate     (safe-div (:inner-comments-added-near-atoms comment-aggs)
+                                          (:inner-atom-count comment-aggs))
+   :inner-non-atom-comment-rate (safe-div (:inner-comments-added-away-atoms comment-aggs)
+                                          (:inner-ast-size comment-aggs))
+   :outer-atom-comment-rate (safe-div (:outer-comments-added-near-atoms comment-aggs)
+                                      (:outer-atom-count comment-aggs))
+   :outer-non-atom-comment-rate (safe-div (:outer-comments-added-away-atoms comment-aggs)
+                                          (:outer-ast-size comment-aggs))
+   }))
+
+))
+
+(defn file-level-key? [key] (not (re-find #"atom" (str key))))
+
+(def keep-numeric-vals (partial dissoc-by (comp not number? last)))
+
+(s/defn sum-atom-counts
+  [n-atoms :- s/Int map-list]; :- [{:ast-size-before s/Int s/Any s/Any}]]
+  (->> map-list
+       (map keep-numeric-vals)
+       (apply merge-with +)
+       ;(map-values-kv (fn [k v] (if (file-level-key? k) (long (/ v n-atoms)) v)))
+       ))
+
+(defn stats-by-file-type
+  [flat-data]
+  (let [n-atoms (->> flat-data (take 100) (map :atom) distinct (remove nil?) count)]
+    (->> flat-data
+         (group-by (comp file-ext :file))
+         (map-values (partial sum-atom-counts n-atoms))
+         ))
+  )
+
+
+(->> flat-data
+     ;(filter #(= :omitted-curly-braces (:atom %)))
+     (group-by (comp :atom))
+     (map-values stats-by-file-type)
+     (def file-type-stats)
+     time)
+
+(do
+(println (clojure.string/join "," (concat ["atom" ".ext"] (->> file-type-stats first val first val keys))))
+(for [[atom exts] file-type-stats]
+  (for [[ext data] exts]
+    (println (clojure.string/join "," (concat [atom ext] (vals data)))))))
+
+
+(->> "~/opt/src/gcc/gcc/rtl.h"
+     parse-file
+     ((:finder (atom-lookup :omitted-curly-braces)))
+     (map write-ast)
+     (map (comp println println println))
+     )
+
+(->> ;"version.h"
+     ;"ChangeLog"
+ "mimetypes.default"
+     parse-file
+     print-tree)
+     ;flatten-tree
+     ;count)
+
+)


Download jpg image

Download jpg image

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/just-cloud/uxtweet-client.git/'


Add pre/post-conditions for `annotate-with-attempt`

--- src/com/puppetlabs/cmdb/command.clj
+++ src/com/puppetlabs/cmdb/command.clj
@@ -260,6 +260,9 @@
   "Adds an `attempt` annotation to `msg` indicating there was a failed attempt
   at handling the message, including the error and trace from `e`."
   [{:keys [annotations] :as msg} e]
+  {:pre [(map? annotations)]
+   :post [(= (count (get-in % [:annotations :attempts]))
+             (inc (count (:attempts annotations))))]}
   (let [attempts (get annotations :attempts [])
         attempt {:timestamp (pl-utils/timestamp)
                  :error (str e)


added profiles.clj to dotfiles

added profiles.clj to dotfiles

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/diminishedprime/dotfiles.git/'


Update codeina plugin version to 0.3.0.

Update codeina plugin version to 0.3.0.

--- profiles.clj
+++ profiles.clj
@@ -7,7 +7,7 @@
             :target "doc/dist/latest/api"
             :src-uri "http://github.com/funcool/cats/blob/master/"
             :src-uri-prefix "#L"}
-  :plugins [[funcool/codeina "0.3.0-SNAPSHOT"]
+  :plugins [[funcool/codeina "0.3.0"]
             [lein-ancient "0.6.7" :exclusions [org.clojure/tools.reader]]]}
  :bench
  [:dev


Initial work on 31-edo. A more extensible perform system seems to be required.

error: pathspec 'src/overtone/music/tuning/31edo.clj' did not match any file(s) known to git

--- src/overtone/music/tuning/31edo.clj
+++ src/overtone/music/tuning/31edo.clj
@@ -0,0 +1,27 @@
+(ns
+    ^{:doc "Functions that allow use of the 31-edo scale system."
+      :author "David \"DAemon\" Allen"}
+    overtone.music.tuning.31edo
+    (:use [overtone.music.tuning]
+     [overtone.music.pitch]
+     [clojure.java.io]
+     [clojure.set]
+     [clojure.math.numeric-tower]))
+
+(defn notes-31-edo [note-name]
+    (let [symbol (.toLowerCase (name note-name)) ; TODO This should be (lower-case x)
+          note (first symbol)
+          modifier (rest symbol)]
+        (mod (+ (get {\c  0, \d  5, \e  10, \f  13, \g  18, \a  23, \b  28} note)
+              (* -2 (count (filter #(= \b %) modifier)))
+              (* 2 (count (filter #(= \# %) modifier)))) 31)))
+(def reverse-notes-31-edo {0 :c, 1 :dbb, 2 :c#, 3 :db, 4 :c##,
+                           5 :d, 6 :ebb, 7 :d#, 8 :eb, 9 :d##,
+                           10 :e, 11 :fb, 12 :e#,
+                           13 :f, 14 :gbb, 15 :f#, 16 :gb, 17 :f##,
+                           18 :g, 19 :abb, 20 :g#, 21 :ab, 22 :g##,
+                           23 :a, 24 :bbb, 25 :a#, 26 :bb, 27 :a##,
+                           28 :b, 29 :cb, 30 :b#})
+
+(defmethod perfn :31edo [[symb initial freq]]
+    (perfn (list :edo 31 initial freq)))


Add lightweight abstraction for data encoding with nippy.

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

--- src/continuo/util/codecs.clj
+++ src/continuo/util/codecs.clj
@@ -0,0 +1,26 @@
+;; Copyright 2015 Andrey Antukh <niwi@niwi.nz>
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License")
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;;     http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
+(ns continuo.util.codecs
+  (:require [taoensso.nippy :as nippy]))
+
+(defn data->bytes
+  "Serialize a clojure data into a binary format."
+  [data]
+  (nippy/freeze data))
+
+(defn bytes->data
+  "Deserialize bytes into clojure data structures."
+  [input]
+  (nippy/thaw input))


removed the dosync

removed the dosync

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/amedw/mud-server.git/'


Add piano-phase.clj

Add piano-phase.clj

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

--- src/overtone_workspace/piano_phase.clj
+++ src/overtone_workspace/piano_phase.clj
@@ -0,0 +1,27 @@
+(ns overtone-workspace.piano-phase
+  (:use overtone.live
+        overtone.inst.sampled-piano))
+
+;; Steve Reich's Piano Phase
+
+(def piece [:E4 :F#4 :B4 :C#5 :D5 :F#4 :E4 :C#5 :B4 :F#4 :D5 :C#5])
+
+(defn player
+  [t speed notes]
+  (let [n      (first notes)
+        notes  (next notes)
+        t-next (+ t speed)]
+    (when n
+      (at t
+        (sampled-piano (note n)))
+      (apply-by t-next #'player [t-next speed notes]))))
+
+(def num-notes 1000)
+
+(do
+  (player (now) 338 (take num-notes (cycle piece)))
+  (player (now) 335 (take num-notes (cycle piece))))
+
+(volume 0.25)
+
+;;(stop)


develop on latest reactor

develop on latest reactor

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/'


Formatting

Formatting

--- src/yada/core.clj
+++ src/yada/core.clj
@@ -170,9 +170,11 @@
   [ctx]
   (cond-> ctx
     (not-empty (filter (comp (partial = :basic) :type) (-> ctx :http-resource :security)))
-    (assoc :authentication (:basic-authentication (ring.middleware.basic-authentication/basic-authentication-request (:request ctx) (fn [user password] {:user user :password password}))))))
-
-;; Authorization
+    (assoc :authentication
+           (:basic-authentication (ring.middleware.basic-authentication/basic-authentication-request
+                                   (:request ctx)
+                                   (fn [user password] {:user user :password password}))))))
+
 (defn authorization
   "Authorization"
   [ctx]
@@ -183,13 +185,13 @@
                 (merge
                  {:status 401 ::http-response true}
                  (when-let [basic-realm (first (sequence realms-xf (-> ctx :http-resource :security)))]
-                   {:headers {"www-authenticate" (format "Basic realm=\"%s\"" basic-realm)}}))
-                ))
+                   {:headers {"www-authenticate" (format "Basic realm=\"%s\"" basic-realm)}}))))
+
       (if-let [auth (service/authorization res)]
         (assoc ctx :authorization auth)
         ctx))
-    (d/error-deferred (ex-info "" {:status 403
-                                   ::http-response true}))))
+
+    (d/error-deferred (ex-info "" {:status 403 ::http-response true}))))

 ;; Now we do a fetch, so the resource has a chance to
 ;; load any metadata it may need to answer the questions
@@ -252,19 +254,17 @@
    (fn [last-modified]
      (if-let [last-modified (round-seconds-up last-modified)]

-       (if-let [if-modified-since (some-> (:request ctx)
-                                          (get-in [:headers "if-modified-since"])
-                                          ring.util.time/parse-date)]
-
+       (if-let [if-modified-since
+                (some-> (:request ctx)
+                        (get-in [:headers "if-modified-since"])
+                        ring.util.time/parse-date)]
          (if (<=
               (.getTime last-modified)
               (.getTime if-modified-since))

            ;; exit with 304
            (d/error-deferred
-            (ex-info "" (merge {:status 304
-                                ::http-response true}
-                               ctx)))
+            (ex-info "" (merge {:status 304 ::http-response true} ctx)))

            (assoc-in ctx [:response :last-modified] (ring.util.time/format-date last-modified)))

@@ -283,9 +283,7 @@
 (defn if-match
   [ctx]

-  (if-let [matches (some->> (get-in (:request ctx) [:headers "if-match"])
-                            (parse-csv)
-                            set)]
+  (if-let [matches (some->> (get-in (:request ctx) [:headers "if-match"]) parse-csv set)]

     ;; We have an If-Match to process
     (cond
@@ -299,7 +297,8 @@
       ;; Create a map of representation -> etag
       (-> ctx :http-resource :version?)
       (let [version (p/version (:resource ctx) ctx)
-            etags (into {} (map (juxt identity (partial p/to-etag version)) (-> ctx :http-resource :representations)))]
+            etags (into {} (map (juxt identity (partial p/to-etag version))
+                                (-> ctx :http-resource :representations)))]

         (if (empty? (set/intersection matches (set (vals etags))))
           (d/error-deferred
@@ -316,8 +315,7 @@
           ;; etag will do for the response.
           (assoc-in ctx [:response :etag]
                     (get etags (:representation ctx))))))
-    ctx
-    ))
+    ctx))

 (defn invoke-method
   "Methods"
@@ -544,5 +542,4 @@
        :service-available? (:service-available? options)
        :authorization (or (:authorization options) (NoAuthorizationSpecified.))
        :version? (satisfies? p/ResourceVersion resource)
-       :existence? (satisfies? p/RepresentationExistence resource)
-       }))))
+       :existence? (satisfies? p/RepresentationExistence resource)}))))


default values for email-from-address and email-from-name

--- src/metabase/email.clj
+++ src/metabase/email.clj
@@ -12,8 +12,8 @@
 ;; ## CONFIG

 (defsetting mandrill-api-key "API key for Mandrill.")
-(defsetting email-from-address "Email address used as the sender of system notifications.")
-(defsetting email-from-name "Name used as the sender of the system notifications. (optional)")
+(defsetting email-from-address "Email address used as the sender of system notifications." "notifications@metabase.com")
+(defsetting email-from-name "Name used as the sender of the system notifications. (optional)" "Metabase")

 ;; ## PUBLIC INTERFACE


CMR-4172: Added CMR_SERVICES table db migration.

error: pathspec 'metadata-db-app/src/migrations/055_setup_services_table.clj' did not match any file(s) known to git

--- metadata-db-app/src/migrations/055_setup_services_table.clj
+++ metadata-db-app/src/migrations/055_setup_services_table.clj
@@ -0,0 +1,58 @@
+(ns migrations.055-setup-services-table
+  (:require
+   [config.mdb-migrate-helper :as h]))
+
+(def ^:private services-column-sql
+  "id NUMBER,
+  concept_id VARCHAR(255) NOT NULL,
+  native_id VARCHAR(1030) NOT NULL,
+  metadata BLOB NOT NULL,
+  format VARCHAR(255) NOT NULL,
+  revision_id INTEGER DEFAULT 1 NOT NULL,
+  revision_date TIMESTAMP WITH TIME ZONE DEFAULT SYSTIMESTAMP NOT NULL,
+  created_at TIMESTAMP WITH TIME ZONE DEFAULT SYSTIMESTAMP NOT NULL,
+  deleted INTEGER DEFAULT 0 NOT NULL,
+  user_id VARCHAR(30),
+  service_name VARCHAR(20),
+  transaction_id INTEGER DEFAULT 0 NOT NULL")
+
+(def ^:private services-constraint-sql
+  (str "CONSTRAINT services_pk PRIMARY KEY (id), "
+       ;; Unique constraint on native id and revision id
+       "CONSTRAINT services_con_rev UNIQUE (native_id, revision_id)
+       USING INDEX (create unique index services_ucr_i ON cmr_services (native_id, revision_id)), "
+
+       ;; Unique constraint on concept id and revision id
+       "CONSTRAINT services_cid_rev UNIQUE (concept_id, revision_id)
+       USING INDEX (create unique index services_cri ON cmr_services (concept_id, revision_id))"))
+
+(defn- create-services-table
+  []
+  (h/sql
+   (format "CREATE TABLE METADATA_DB.cmr_services (%s, %s)"
+           services-column-sql services-constraint-sql)))
+
+
+(defn- create-services-indices
+  []
+  (h/sql "CREATE INDEX services_crdi ON METADATA_DB.cmr_services (concept_id, revision_id, deleted)")
+  (h/sql "CREATE INDEX services_vn ON METADATA_DB.cmr_services (service_name)"))
+
+(defn- create-services-sequence
+  []
+  (h/sql "CREATE SEQUENCE cmr_services_seq"))
+
+(defn up
+  "Migrates the database up to version 55."
+  []
+  (println "migrations.055-setup-services-table up...")
+  (create-services-table)
+  (create-services-indices)
+  (create-services-sequence))
+
+(defn down
+  "Migrates the database down from version 55."
+  []
+  (println "migrations.055-setup-services-table down...")
+  (h/sql "DROP SEQUENCE METADATA_DB.cmr_services_seq")
+  (h/sql "DROP TABLE METADATA_DB.cmr_services"))


unit tests for bind-current-user middleware.

--- test/metabase/middleware/auth_test.clj
+++ test/metabase/middleware/auth_test.clj
@@ -1,6 +1,7 @@
 (ns metabase.middleware.auth-test
   (:require [expectations :refer :all]
             [korma.core :as korma]
+            [metabase.api.common :refer [*current-user-id* *current-user*]]
             [metabase.middleware.auth :refer :all]
             [metabase.models.session :refer [Session]]
             [metabase.test-data :as test-data]
@@ -82,7 +83,7 @@
       (select-keys [:metabase-userid]))))

-;;; expired sessionid
+;; expired sessionid
 (let [sessionid (.toString (java.util.UUID/randomUUID))
       user-id (test-data/user->id :rasta)]
   (assert sessionid)
@@ -96,7 +97,7 @@
     (auth-enforced-handler (request-with-sessionid sessionid))))

-;;; inactive user sessionid
+;; inactive user sessionid
 (let [sessionid (.toString (java.util.UUID/randomUUID))
       user-id (test-data/user->id :trashbird)]              ; NOTE that :trashbird is our INACTIVE test user
   (assert sessionid)
@@ -107,4 +108,36 @@
   (expect
     {:status (:status response-unauthentic)
      :body (:body response-unauthentic)}
-    (auth-enforced-handler (request-with-sessionid sessionid))))+    (auth-enforced-handler (request-with-sessionid sessionid))))
+
+
+;;;;  ===========================  TEST bind-current-user middleware  ===========================
+
+
+;; create a simple example of our middleware wrapped around a handler that simply returns our bound variables for users
+(def user-bound-handler
+  (bind-current-user (fn [req] {:userid *current-user-id*
+                                :user (select-keys @*current-user* [:id :email])})))
+
+
+(defn request-with-userid
+  "Creates a mock Ring request with the given userid applied"
+  [userid]
+  (-> (mock/request :get "/anyurl")
+    (assoc :metabase-userid userid)))
+
+
+;; with valid user-id
+(let [{:keys [id email] :as user} (test-data/fetch-user :rasta)]
+  (assert user)
+  (expect
+    {:userid id
+     :user {:id id
+            :email email}}
+    (user-bound-handler (request-with-userid id))))
+
+;; with invalid user-id (not sure how this could ever happen, but lets test it anyways)
+(expect
+  {:userid 0
+   :user {}}
+  (user-bound-handler (request-with-userid 0)))


adding batch benchmark

adding batch benchmark

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/'


provide default fields value when copying fields


Панель для отображение диференциала

Панель для отображение диференциала

error: pathspec 'radiolamp-6P3S/src/r6p3s/ui/diff_panel.cljs' did not match any file(s) known to git

--- radiolamp-6P3S/src/r6p3s/ui/diff_panel.cljs
+++ radiolamp-6P3S/src/r6p3s/ui/diff_panel.cljs
@@ -0,0 +1,70 @@
+(ns r6p3s.ui.diff-panel
+  (:require [om.core :as om :include-macros true]
+            [om.dom :as dom :include-macros true]
+            [r6p3s.core :as rc]
+            [r6p3s.ui.glyphicon :as glyphicon]
+            [r6p3s.ui.table :as table]
+            [r6p3s.ui.group-box :as group-box]))
+
+
+
+
+(declare show-value)
+
+
+(defn render
+  [diff-state {:keys [class-name
+                      style
+                      filter-pred-fn
+                      fields-map]
+               :or   {filter-pred-fn (fn [_] true)
+                      fields-map     {}
+                      rbs-data       {}}}]
+  (when-not (empty? diff-state)
+    (let [[b a _] diff-state]
+      (->> (set (into (keys a) (keys b)))
+           (filter filter-pred-fn)
+           (map (fn [k]
+                  (let [{:keys [text] :as meta} (fields-map k)
+                        icon                    (cond (and a b) "arrow-right text-warning"
+                                                      b         "plus text-danger"
+                                                      a         "minus text-primary"
+                                                      :else     "asterisk")]
+                    (dom/tr
+                     #js {}
+                     (dom/td #js {:style #js {:textAlign "right"}}
+                             (dom/b nil
+                                    (or text (str k))))
+
+                     (when a
+                       (dom/td nil
+                               (show-value meta (get a k))))
+
+                     (dom/td nil
+                             (glyphicon/render icon))
+                     (when b
+                       (dom/td nil
+                               (show-value meta (get b k))))))))
+           (apply dom/tbody nil)
+           (dom/table #js {:className class-name
+                           :style     style})))))
+
+
+
+
+(defmulti show-value (fn [{type :type} value] type))
+
+(defmethod show-value :default
+  [_ value]
+  (cond
+    (nil? value)   "ничего"
+    (true? value)  "да"
+    (false? value) "нет"
+    :else (str value)))
+
+
+
+
+
+
+


initial work inserting client code

initial work inserting client code

--- sidecar/src/figwheel_sidecar/auto_builder.clj
+++ sidecar/src/figwheel_sidecar/auto_builder.clj
@@ -77,9 +77,78 @@
     (builder
      (update-in build [:build-options] (partial merge default-options)))))

+;; connection
+
+(defn connect-script-temp-dir [build]
+  (str "target/figwheel_temp/" (name (:id build))))
+
+(defn connect-script-path [build]
+  (str (connect-script-temp-dir build) "/figwheel/connect.cljs"))
+
+(def figwheel-client-hook-keys [:on-jsload
+                                :before-jsload
+                                :on-cssload
+                                :on-compile-fail
+                                :on-compile-fail])
+
+(defn extract-connection-script-required-ns [{:keys [figwheel]}]
+  (let [names (vals (select-keys figwheel figwheel-client-hook-keys))]
+    (list 'ns 'figwheel.connect
+          (concat (list :require ['figwheel.client])
+                  (map #(vector (symbol (namespace (symbol %))))
+                       names)))))
+
+(defn extract-connection-script-figwheel-start [{:keys [figwheel]}]
+  (let [func-map (select-keys figwheel figwheel-client-hook-keys)
+        func-map (into {} (map (fn [[k v]] [k (symbol v)]) func-map))
+        res (merge figwheel func-map)]
+    (list 'figwheel.client/start res)))
+
+(comment
+
+  (extract-connection-script-required-ns {:figwheel {:on-jsload "blah.blah/on-jsload"}})
+
+  (extract-connection-script-required-ns {:figwheel {}})
+
+  (extract-connection-script-figwheel-start {:figwheel {:on-jsload "blah.blah/on-jsload" :websocket-url "hey"}})
+
+  )
+
+(defn figwheel-build? [build]
+  (and (= (get-in build [:build-options :optimizations]) :none)
+       (:figwheel build)))
+
+(defn create-connect-script! [build]
+  ;;; consider doing this is the system temp dir
+  (.mkdirs (io/file (connect-script-temp-dir build)))
+  (let [temp-file (io/file (connect-script-path build))]
+    (.deleteOnExit temp-file)
+    (with-open [file (io/writer temp-file)]
+      (binding [*out* file]
+        (println
+         (apply str (mapcat
+                     prn-str
+                     (list (extract-connection-script-required-ns build)
+                           (extract-connection-script-figwheel-start build)
+                           '(.log js/console "this should be working")))))))
+    temp-file))
+
+(defn create-connect-script-if-needed! [build]
+  (when (figwheel-build? build)
+    (when-not (.exists (io/file (connect-script-path build)))
+      (create-connect-script! build))))
+
+(defn insert-client-script [build]
+  (create-connect-script-if-needed! build)
+  build)
+
+(defn insert-figwheel-client-script [builder]
+  (fn [build] (builder (insert-client-script build))))
+
 (defn builder [figwheel-server]
   (-> cbuild/build-source-paths*
     (default-build-options {:recompile-dependents false})
+    (insert-figwheel-client-script)
     (warning
      (fn [build]
        (auto/warning-message-handler
@@ -92,12 +161,42 @@
     (auto/error (partial handle-exceptions figwheel-server))
     (auto/before auto/compile-start)))

+(defn add-connect-script [build]
+  ;; maybe should just add it to source paths here
+  ;; if you create it once here it could be deleted by a lein clean
+  (if (figwheel-build? build)
+    (do
+      ;; create a fresh one at the beginning of each autobuild
+      (create-connect-script! build)
+      (update-in build [:source-paths] conj (connect-script-temp-dir build)))
+    build))
+
+(defn update-figwheel-connect-options [figwheel-server build]
+  (if (:figwheel build)
+    (let [build (config/prep-build-for-figwheel-client build)]
+      (if-let [host (get-in build [:figwheel :websocket-host])]
+        (-> build
+          (update-in [:figwheel] dissoc :websocket-host)
+          (assoc-in [:figwheel :websocket-url]
+                    (str "ws://" host ":" (:server-port figwheel-server) "/figwheel-ws")))
+        build))
+    build))
+
+(comment
+
+  (update-figwheel-client-options {:port 5555} {:figwheel {:websocket-host "llllll"} :yeah 6})
+
+  (update-figwheel-client-options {:port 5555} {:figwheel true})
+
+  )
+
 (defn autobuild* [{:keys [builds figwheel-server]}]
-  (auto/autobuild*
-   {:builds  builds
-    :builder (builder figwheel-server)
-    :each-iteration-hook (fn [_ build]
-                           (fig/check-for-css-changes figwheel-server))}))
+  (let [builds (map (partial update-figwheel-connect-options figwheel-server) builds)]
+    (auto/autobuild*
+     {:builds  (mapv add-connect-script builds)
+      :builder (builder figwheel-server)
+      :each-iteration-hook (fn [_ build]
+                             (fig/check-for-css-changes figwheel-server))})))

 (defn check-autobuild-config [all-builds build-ids figwheel-server]
   (let [builds (config/narrow-builds* all-builds build-ids)]


Documentation helper functions

Documentation helper functions

error: pathspec 'src/onyx/doc.cljc' did not match any file(s) known to git

--- src/onyx/doc.cljc
+++ src/onyx/doc.cljc
@@ -0,0 +1,15 @@
+(ns onyx.information-model
+  (:require [onyx.information-model]))
+
+(defn lookup-categories [model kw]
+  (->> (keys model)
+       (map (fn [k]
+              [(set (keys (get-in model [k :model]))) k]))
+       (filter (fn [[s k]]
+                 (s kw)))
+       (map second)))
+
+(defn lookup-doc [kw]
+  (mapv (fn [cat] (get-in model [cat :model kw]))
+        (lookup-categories model kw)))
+


add report to collect all actions

add report to collect all actions

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

--- src/shuppet/report.clj
+++ src/shuppet/report.clj
@@ -0,0 +1,8 @@
+(ns shuppet.report)
+
+(def ^:dynamic report (atom []))
+
+(defn add
+  "add a new entry to the report"
+  [action message & [info-map]]
+  (swap! report conj (merge {:action action :message message} info-map)))


need password css

need password css

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/'


[l.d.utils] Update SDK version numbers

[l.d.utils] Update SDK version numbers

--- src/leiningen/droid/utils.clj
+++ src/leiningen/droid/utils.clj
@@ -192,17 +192,15 @@
 (defn proj [] (read-project "sample/project.clj"))

 (defn sdk-version-number
-  "If version keyword is passed (for example, =:ics= or
-  =:jelly-bean=), resolves it to the version number. Otherwise just
-  returns the input."
+  "If version keyword is passed (for example, `:ics` or `:jelly-bean`), resolves
+  it to the version number. Otherwise just returns the input."
   [kw-or-number]
   (if (keyword? kw-or-number)
     (case kw-or-number
-      :froyo       8
-      :gingerbread 10
-      :honeycomb   13
       :ics         15
-      :jelly-bean  17
+      :jelly-bean  18
+      :kitkat      19
+      :lollipop    21
       (abort "Unknown Android SDK version: " kw-or-number))
     kw-or-number))


Add a 'junit-with-default' emission plugin.

It creates both the junit reports and the default stdout.

error: pathspec 'src/midje/emission/plugins/junit/with_default.clj' did not match any file(s) known to git

--- src/midje/emission/plugins/junit/with_default.clj
+++ src/midje/emission/plugins/junit/with_default.clj
@@ -0,0 +1,16 @@
+(ns ^{:doc "JUnit formatter for Midje that keeps original stdout output."}
+  midje.emission.plugins.junit.with-default
+  (:require [midje.emission.plugins.junit :as junit]
+            [midje.emission.plugins.default :as default]
+            [midje.emission.state :as state]))
+
+(defn merge-functions [oldf newf]
+  (fn [& args]
+    (apply oldf args)
+    (apply newf args)))
+
+(def emission-map (merge-with merge-functions
+                              default/emission-map
+                              junit/emission-map))
+
+(state/install-emission-map emission-map)


update metrics view with new branding

update metrics view with new branding


Add utils

Add utils

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

--- src/clj/clojurewerkz/statistiker/utils.clj
+++ src/clj/clojurewerkz/statistiker/utils.clj
@@ -0,0 +1,11 @@
+(ns clojurewerkz.statistiker.utils)
+
+(defn- add-unique-id-single
+  [a b]
+  (assoc a :unique-id b))
+
+(defn add-unique-id
+  "Adds unique 0-based incremented id field to each map in `coll`. Field
+   is `:unique-id`."
+  [coll]
+  (map add-unique-id-single coll (iterate inc 0)))


Add different distance functions

Add different distance functions

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

--- src/clj/clojurewerkz/statistiker/distance.clj
+++ src/clj/clojurewerkz/statistiker/distance.clj
@@ -0,0 +1,23 @@
+(ns clojurewerkz.statistiker.distance
+  (:import [org.apache.commons.math3.ml.distance CanberraDistance ChebyshevDistance EuclideanDistance ManhattanDistance]))
+
+(def euclidean-distance-instance (EuclideanDistance.))
+(def canberra-distance-instance (CanberraDistance.))
+(def chebyshev-distance-instance (ChebyshevDistance.))
+(def manhattan-distance-instance (ManhattanDistance.))
+
+(defn euclidean-distance
+  [a b]
+  (.compute euclidean-distance-instance (double-array a) (double-array b)))
+
+(defn canberra-distance
+  [a b]
+  (.compute canberra-distance-instance (double-array a) (double-array b)))
+
+(defn chebyshev-distance
+  [a b]
+  (.compute chebyshev-distance-instance (double-array a) (double-array b)))
+
+(defn manhattan-distance
+  [a b]
+  (.compute manhattan-distance-instance (double-array a) (double-array b)))


race condition avoidance.  To reduce the probability of another scheduler reclaiming the "last" message while it's being worked on, stop sending out new messages 2 minutes before the window has officially elapsed.  (2 minutes is an estimate of the max time to send a single 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/'


Problem 0060.

Problem 0060.

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

--- src/project_euler/problem_0060.clj
+++ src/project_euler/problem_0060.clj
@@ -0,0 +1,63 @@
+(ns project-euler.problem_0060)
+
+;; The primes 3, 7, 109, and 673, are quite remarkable.
+;; By taking any two primes and concatenating them in any order the result will always be prime.
+;; For example, taking 7 and 109, both 7109 and 1097 are prime.
+;; The sum of these four primes, 792, represents the lowest sum for a set of four primes with this property.
+
+;; Find the lowest sum for a set of five primes for which any two primes concatenate to produce another prime.
+
+;; from problem 0007 ----------------------------------
+;;....................................................
+
+(defn prime?
+  [n]
+  {:pre [(integer? n) (> n 0)]}
+  (or (== 2 n)
+      (let [mmax (+ (Math/sqrt n) 1)]
+        (not (some #(== 0 (rem n %)) (concat [2] (range 3 mmax 2))))
+        )))
+
+;;----------------------------------------------------------------------------
+
+;; #{194119 3 5923 67 37} is a solution, but not those with the lowest sum...
+
+(defn concat-numbers [x y]
+  (loop [x x, q y]
+    (if (zero? q)
+      (+' x y)
+      (recur (*' x 10) (quot q 10)))))
+
+(defn concats-are-primes? [x y]
+  (and (prime? (concat-numbers x y)) (prime? (concat-numbers y x))))
+
+
+(defn solutions-from [init-seq p-set]
+  (let [npc-seq (->> (for [xs init-seq, y p-set] [xs y])
+                     (filter (fn [[xs y]] (every? (partial concats-are-primes? y) xs)))
+                     (map (fn [[xs y]] (sort (conj xs y))))
+                     (set)
+                     )]
+    (println (count npc-seq))
+    npc-seq
+    ))
+
+(defn solutions [maxs]
+  (reduce solutions-from
+          (map (fn [p] [p]) (filter prime? (range 2 (first maxs))))
+          (map #(filter prime? (range 2 %)) (next maxs))
+          ))
+
+
+;; #{194119 3 5923 67 37} is a solution, but not those with the lowest sum...
+;; sum == 76721 is a solution but not the best...
+;; (467 941 2099 19793 25253) (sum == 48553) ok..... but not the best
+;; (7 1237 2341 12409 18433) (sum == 34427) ok..... grrrr.....
+;; (13 5197 5701 6733 8389) (sum == 26033) :)
+(defn solution [] (->> (solutions [5300 7000 9000 13020 26033])
+                       (map #(apply + %))
+                       ;;(apply min)
+                       ))
+
+;;-> 26033
+


AdminDocResource.clj: added resource class for posting new documents

error: pathspec 'src/org/altlaw/www/admin/AdminDocResource.clj' did not match any file(s) known to git

--- src/org/altlaw/www/admin/AdminDocResource.clj
+++ src/org/altlaw/www/admin/AdminDocResource.clj
@@ -0,0 +1,66 @@
+(ns org.altlaw.www.admin.AdminDocResource
+  (:gen-class :extends org.restlet.resource.Resource)
+  (:require [org.altlaw.www.DocResource :as doc]
+            [org.altlaw.jobs.post.distindex :as index]
+            [org.altlaw.db.content :as content]
+            [org.altlaw.db.privacy :as privacy]
+            [org.altlaw.www.case-pages :as pages]
+            [org.altlaw.www.render :as rend]
+            [org.altlaw.util.date :as date]
+            [org.altlaw.util.courts :as courts]
+            [clojure.contrib.stacktrace :as stack])
+  (:import (org.restlet.resource Variant StringRepresentation ResourceException)
+           (org.restlet.data MediaType Language CharacterSet Reference Status)
+           (org.apache.solr.client.solrj SolrQuery)))
+
+(defn print-document [d]
+  (doseq [[k v] (dissoc d :text :html)]
+    (pr k) (print \tab) (prn v))
+  (pr :text) (print \tab) (prn (:text d))
+  (pr :html) (print \tab) (prn (:html d)))
+
+(defmulti represent (fn [docid media-type] media-type))
+
+(defmethod represent MediaType/TEXT_HTML [docid media-type]
+  (StringRepresentation.
+   (with-out-str
+    (print-document (doc/prepare-html-document
+                     (doc/get-document docid))))
+   MediaType/TEXT_PLAIN
+   Language/ENGLISH_US
+   CharacterSet/UTF_8))
+
+
+;;; ACCEPTING NEW DOCUMENTS
+
+(defn store [entity]
+  (let [data (read-string (.getText entity))]
+    (index/index-document doc/*solr* data)
+    (content/put-content-string (:html data) {})))
+
+
+;;; RESOURCE METHODS
+
+(defn -allowGet [this] true)
+(defn -allowPut [this] false)
+(defn -allowPost [this] true)
+(defn -allowDelete [this] false)
+
+(defn -getVariants [this]
+  [(Variant. MediaType/TEXT_HTML)])
+
+(defn -represent [this variant]
+  (try
+   (binding [doc/*solr* (.. this getContext getAttributes (get "org.altlaw.solr.server"))]
+     (let [docid (.. this getRequest getAttributes (get "docid"))]
+       (represent docid (.getMediaType variant))))
+   (catch Exception e
+     (if (and (instance? org.jets3t.service.S3ServiceException
+                         (stack/root-cause e)))
+       (throw (ResourceException. Status/CLIENT_ERROR_NOT_FOUND e))
+       (throw e)))))
+
+(defn -acceptRepresentation [this entity]
+  (binding [doc/*solr* (.. this getContext getAttributes (get "org.altlaw.solr.server"))]
+    (store entity)))
+


Removed stupid test code!

Removed stupid test code!

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/couragelabs/coachbot.git/'


Selecting random element from a Clojure sorted-set.

error: pathspec 'Clojure/random-sorted-set.clj' did not match any file(s) known to git

--- Clojure/random-sorted-set.clj
+++ Clojure/random-sorted-set.clj
@@ -0,0 +1,16 @@
+; :mode=clojure:
+
+; Hack to select random element from a Clojure sorted-set.
+; The distribution will not be uniform, and will be something very uneven.
+
+(defn my-comp [a b]
+    (if (or (= :random a) (= :random b))
+        (- (* 2 (rand-int 2)) 1)
+        (compare a b)))
+
+; Create test collection (of strings) using the special comparator
+(def coll (apply sorted-set-by my-comp (map str (range 1 1000))))
+
+(map #(first (subseq coll > %)) ["500" "200" "700" :random :random])
+; ("501" "201" "701" "626" "286")
+


common markdown reader

common markdown reader

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

--- src/axo/markdown_reader.clj
+++ src/axo/markdown_reader.clj
@@ -0,0 +1,28 @@
+(ns axo.markdown-reader
+   (:require [clojure.java.io :as io])
+   (:import [com.vladsch.flexmark.parser Parser]
+            [com.vladsch.flexmark.ast Heading]))
+
+(defn node-tree-seq
+ [root]
+ (let [walk (fn walk
+              [level coll]
+              (loop [lv level
+                     c coll
+                     r []]
+                (if-let [node (first c)]
+                   (if (instance? Heading node)
+                     (if (> (.getLevel node) lv)
+                        (let [[children rest-coll] (walk (.getLevel node) (rest c))]
+                          (recur lv rest-coll (conj r node children)))
+                        [r c])
+                     ;; normal node
+                     (recur lv (rest c) (conj r node)))
+                   [r c])))]
+   (first (walk 0 (seq (.getChildren root))))))
+
+(defn read-file
+  [path]
+  (with-open [reader (io/reader path)]
+    (let [parser (.build (Parser/builder))]
+      (.parseReader parser reader))))


rename Core type -> Program

rename Core type -> Program

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/'


Saio kanala pasa

Saio kanala pasa

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/'


lib.zerol/tests-ui - multiple-counters test added. Doesn't look really that nice

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/artemyarulin/zerol.git/'


[WM] don't send google-election-id if nil

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-notification-works.git/'


Initial set of client-server messages.

Initial set of client-server messages.

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

--- src/tranjlator/messages.clj
+++ src/tranjlator/messages.clj
@@ -0,0 +1,37 @@
+(ns tranjlator.messages)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Client -> Server
+
+(defn ->chat
+  [language content sha user-name]
+  {:topic "original"
+   :language language
+   :content content
+   :content-sha sha
+   :original-sha sha
+   :user-name user-name})
+
+(defn ->user-join
+  [user-name]
+  {:topic "user-join"
+   :user-name user-name})
+
+(defn ->user-leave
+  [user-name]
+  {:topic "user-leave"
+   :user-name user-name})
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Server -> Client
+
+(defn ->translation
+  [language content original-sha content-sha sender-name]
+  {:topic language
+   :language language
+   :content content
+   :original-sha original-sha
+   :content-sha content-sha
+   :translated-sha content-sha
+   :user-name sender-name})


(drop 1 s) is the same thing as just doing (rest s)

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/Yoshiyuka/cthulhu.git/'


bump deps

bump deps

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/'


Refactor stack trace code to use thread-last

Seems like a long enough chain to warrant.

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -71,10 +71,11 @@
 (defn raw-stacktrace->frames
   "Parse a raw JSC stack representation, parsing it into stack frames."
   [raw-stacktrace]
-  (apply vector
-    (remove nil?
-      (map stack-line->frame
-        (string/split-lines raw-stacktrace)))))
+  (->> raw-stacktrace
+    string/split-lines
+    (map stack-line->frame)
+    (remove nil?)
+    vec))

 (defn jsc-eval
   "Evaluate a JavaScript string in the JSC REPL process."


Add cemerick.cljs.test to benchmark test

--- test/sablono/benchmark.cljs
+++ test/sablono/benchmark.cljs
@@ -2,10 +2,11 @@
   (:require-macros [cemerick.cljs.test :refer [is deftest testing]]
                    [dommy.macros :refer [node]]
                    [sablono.core :refer [html]])
-  (:require [reagent.core :as reagent]
+  (:require [cemerick.cljs.test :as t]
             [crate.core :as crate]
             [dommy.template :as template]
             [goog.dom :as gdom]
+            [reagent.core :as reagent]
             [sablono.test :refer [body]]))

 (defn reagent-template [datum]


bad edit.

bad edit.

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/'