middleware

middleware

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

--- src/adder/middleware.clj
+++ src/adder/middleware.clj
@@ -0,0 +1,50 @@
+(ns adder.middleware
+  (:require [clj-stacktrace.repl :as strp]))
+
+(defn- log [msg & vals]
+  (let [line (apply format msg vals)]
+    (locking System/out (println line))))
+
+(defn wrap-if [handler pred wrapper & args]
+  (if pred
+    (apply wrapper handler args)
+    handler))
+
+(defn wrap-request-logging [handler]
+  (fn [{:keys [request-method uri] :as req}]
+    (let [start  (System/currentTimeMillis)
+          resp   (handler req)
+          finish (System/currentTimeMillis)
+          total  (- finish start)]
+      (log "request %s %s (%dms)" request-method uri total)
+      resp)))
+
+(defn wrap-exception-logging [handler]
+  (fn [req]
+    (try
+      (handler req)
+      (catch Exception e
+        (log "Exception:\n%s" (strp/pst-str e))
+        (throw e)))))
+
+(defn wrap-failsafe [handler]
+  (fn [req]
+    (try
+      (handler req)
+      (catch Exception e
+        {:status 500
+         :headers {"Content-Type" "text/plain"}
+         :body "We're sorry, something went wrong."}))))
+
+(defn wrap-bounce-favicon [handler]
+  (fn [req]
+    (if (= [:get "/favicon.ico"] [(:request-method req) (:uri req)])
+      {:status 404
+       :headers {}
+       :body ""}
+      (handler req))))
+
+(defn wrap-utf [handler]
+  (fn [req]
+    (let [resp (handler req)]
+      (assoc-in resp [:headers "Content-Type"] "text/html; charset=utf-8"))))


finite/reprocessed->ts?/* helpers

finite/reprocessed->ts?/* helpers

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


add test for line-items

add test for line-items

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


Don't always have enough info to coerce - the tag can be a set of various branches.

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/shaunstanislaus/cljs2go.git/'


make import-loinc invokable via `lein task'

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/fhirbase/fhirterm.git/'


render support

render support

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/tiagoantao/turtle.git/'


Make some functions public for convenience

--- src/yada/request_body.clj
+++ src/yada/request_body.clj
@@ -101,7 +101,7 @@

 (defmethod default-matcher :default [_] (constantly nil))

-(defn- coerced! [raw-data schema schema->matcher]
+(defn coerced! [raw-data schema schema->matcher]
   (let [coercer (sc/coercer schema schema->matcher)
         result (coercer raw-data)]
     (when (error? result)
@@ -114,13 +114,13 @@
       {:parsed parsed}
       schema (assoc :coerced (coerced! parsed schema (or matcher (default-matcher media-type)))))))

-(defn- body-schema [ctx]
+(defn body-schema [ctx]
   (get-in ctx [:resource :methods (:method ctx) :parameters :body]))

-(defn- body-matcher [ctx]
+(defn body-matcher [ctx]
   (get-in ctx [:resource :methods (:method ctx) :coercion-matchers :body]))

-(defn- default-process-request-body
+(defn default-process-request-body
   [ctx body-stream media-type & _]
   (let [result (parse-coerce-stream
                  body-stream


Stop updating DNS on new site import

Stop updating DNS on new site import

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


Add guard around pgp_key migration

Add guard around pgp_key migration

The production db has the field, but doesn't have the migration
recorded, so we ignore a duplicate run.

--- src/clojars/db/migrate.clj
+++ src/clojars/db/migrate.clj
@@ -30,7 +30,13 @@
                         "ON jars (group_name, jar_name, created DESC)")))

 (defn add-pgp-key [trans]
-  (sql/db-do-commands trans "ALTER TABLE users ADD COLUMN pgp_key TEXT"))
+  (try
+    (sql/db-do-commands trans "ALTER TABLE users ADD COLUMN pgp_key TEXT")
+    (catch BatchUpdateException e
+      ;; production db doesn't have this migration recorded, but has the field
+      ;; ignore the dupe in that case
+      (when-not (re-find #"duplicate column name" (.getMessage e))
+        (throw e)))))

 (defn add-added-by [trans]
   (sql/db-do-commands trans "ALTER TABLE groups ADD COLUMN added_by TEXT"))


Fix json search

Fix json search

--- src/clojars/web/search.clj
+++ src/clojars/web/search.clj
@@ -14,8 +14,7 @@
       m)))

 (defn json-gen [query]
-  (let [results (filter #(not (nil? (:jar_name %)))
-                        (search/search query))]
+  (let [results (search/search query)]
     (json/generate-string {:count (count results)
                            :results (map jar->json results)})))


Renamed the song so it doesn't have a number in it.

error: pathspec 'src/overtunes/songs/canone-alla-quarta.clj' did not match any file(s) known to git

--- src/overtunes/songs/canone-alla-quarta.clj
+++ src/overtunes/songs/canone-alla-quarta.clj
@@ -0,0 +1,46 @@
+(ns overtunes.songs.canone-alla-quarta
+  (:use
+    [overtone.live :only [at now]]
+    [overtone.inst.sampled-piano :only [sampled-piano] :rename {sampled-piano piano}]))
+
+(defn sum-n [series n] (reduce + (take n series)))
+(defn scale [intervals]
+  #(if (neg? %)
+     (let [downward-scale (comp - (scale (reverse intervals)))]
+       (-> % - downward-scale))
+     (sum-n (cycle intervals) %)))
+
+(defn translate [f x y] #(-> % (+ x) f (+ y)))
+(def major (scale [2 2 1 2 2 2 1]))
+(defn modulate [scale mode] (translate scale mode (- (scale mode))))
+(def g-major (translate major 0 74))
+;(def scales (repeat (modulate g-major 0)))
+(def scales (repeat g-major))
+
+(defn bpm [per-minute] #(-> % (/ per-minute) (* 60) (* 1000)))
+(defn syncopate [timing durations] #(->> % (sum-n durations) timing))
+(defn run [a b]
+  (if (<= a b)
+    (range a (inc b))
+    (reverse (run b a))))
+
+(def durations (flatten [(repeat 2 1/4) 1/2 (repeat 6 1/4) (repeat 8 1/4) 3/2 (repeat 10 1/4) 1/2 (repeat 2 1/4) 9/4 3/4 (repeat 12 1/4) 1/2 1 1/2 (repeat 12 1/4) 1]))
+(def pitches (flatten [0 (run -1 3) (run 2 0) 4 (run 1 8) (run 7 -1) 0 (run 0 -3) 4 4 (run 2 -3) -1 1 (run 4 6) 1 1 1 2 -1 -2 0 1 -1 -2 (run 5 0)]))
+(def bass (map #(- % 7) (flatten (map #(repeat 3 %) (concat (run 0 -3) (run -5 -3) [-7])))))
+
+(defn melody# [timing notes]
+  (let [note# #(at (timing %1) (piano ((nth scales %1) %2)))]
+    (dorun (map-indexed note# notes))))
+
+(defn play# []
+  (let [timing (-> (bpm 90) (translate 0 (now)))
+        rhythm-from #(syncopate (translate timing % 0) durations)
+        leader pitches
+        follower (->> leader (map -) (map #(- % 4)))]
+    (melody# timing bass)
+    (melody# (rhythm-from 1/2) leader)
+    (melody# (rhythm-from 7/2) follower)
+    (melody# (syncopate (translate timing 23 0) [1 1/4 1/4 1/4 1/4 1]) [-7 -7 -5 -3 -1 0])
+    ))
+
+(play#)


Bugfix in test

Bugfix in test

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


more robust restart test

more robust restart test

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


Empty is tests, WIP

Empty is tests, WIP

error: pathspec 'test/is/empty.cljs' did not match any file(s) known to git


TODO's

TODO'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/mstang/pathdatabase.git/'


Make main test.

Make main test.

error: pathspec 'test/clj_elm/main_test.clj' did not match any file(s) known to git

--- test/clj_elm/main_test.clj
+++ test/clj_elm/main_test.clj
@@ -0,0 +1,8 @@
+(ns clj-elm.main-test
+  (:require [clj-elm.main :refer :all]
+            [clj-elm.data :as data]
+            ;; [clojure.core.typed :as t :only [atom doseq let fn defn ref dotimes defprotocol loop for]]
+            ;; [clojure.core.typed :refer :all :exclude [atom doseq let fn defn ref dotimes defprotocol loop for]]
+            [midje.sweet :refer :all]
+            [midje.repl :refer (autotest load-facts)]
+            [incanter.core :as c :exclude [update]]))


Add stub for triangle

Add stub for triangle

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

--- exercises/triangle/src/triangle.clj
+++ exercises/triangle/src/triangle.clj
@@ -0,0 +1,5 @@
+(ns triangle)
+
+(defn type [] ;; <- Arglist goes here
+      ;; your code goes here
+      )


chambed impl'd w defn-expand

chambed impl'd w defn-expand


Add subscription handlers

Add subscription handlers

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


Implement post-migrations route.

Implement post-migrations route.

--- src/cadence/views/user.clj
+++ src/cadence/views/user.clj
@@ -178,5 +178,8 @@

 (defn post-migrations
   "A nice place to view migrations."
-  [request]
-  (resp/json {:yo [1 2 3]}))
+  [{{id "object_id" action "action"} :form-params}]
+  (let [write-result ((case action
+                        "Rollback" migration/rollback-by-id
+                        "Apply" migration/migrate-by-id) id)]
+    (resp/json {:count (.getField write-result "n")})))


add note

add note

--- src/metabase/driver/postgres/metadata.clj
+++ src/metabase/driver/postgres/metadata.clj
@@ -1,5 +1,8 @@
 (ns metabase.driver.postgres.metadata
   (:require [metabase.driver.metadata :refer [field-count field-distinct-count]]))
+
+;; TODO - These implementations are wack. We should just use korma to do this
+;; and these should be moved to the `generic-sql` driver

 (defmethod field-count :postgres
   [{:keys [db table name] :as field}]


Starting on indices

Starting on indices


change parse-file

change parse-file

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/jchli/jepsen-aurora.git/'


Start of work on a performance monitoring worksheet

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

--- worksheets/performance_monitoring.clj
+++ worksheets/performance_monitoring.clj
@@ -0,0 +1,86 @@
+;; gorilla-repl.fileformat = 1
+
+;; **
+;;; # Performance monitoring
+;;;
+;;; We've begun puttng graph profile information into mongo. Time to start working on some monitoring tools.
+;; **
+
+;; @@
+(ns performance-monitoring
+  (:require [gorilla-plot.core :as plot]
+            [gorilla-repl.table :as table]
+            [polismath.utils :refer :all]
+            [polismath.db :as db]
+            [polismath.env :as env]
+            [monger.core :as mg]
+            [monger.collection :as mc]))
+;; @@
+;; =>
+;;; {"type":"html","content":"nil","value":"nil"}
+;; <=
+
+;; **
+;;; Below are the various plotting things we've done so far:
+;; **
+
+;; @@
+(defn stat-plot
+  [attr & opts]
+  (apply plot/list-plot (map attr gp1-rep-stats) opts))
+
+(defn stat-plots
+  [attrs colors]
+  (apply plot/compose (map #(stat-plot %1 :color %2 :width 500) attrs colors)))
+
+(stat-plots [:pat :pdt] ["steelblue" "red"])
+;; @@
+;; =>
+;;; {"type":"html","content":"#'performance-monitoring/stat-plots","value":"#'performance-monitoring/stat-plots"}
+;; <=
+
+;; @@
+(defn plot-attrs
+  [users x-attr y-attr & {:keys [] :as kw-args}]
+  (let [plot-args (merge {:opacity 0.3
+                          :symbol-size 20}
+                         kw-args)]
+    (apply-kwargs
+      plot/list-plot
+      (map
+        #(gets % [x-attr y-attr])
+        users)
+      plot-args)))
+
+
+(plot-attrs icusers :remote-created-at :n-owned-convs-ptptd
+            :plot-range [:all [0 20]])
+;; @@
+
+;; **
+;;; Now let's start loading up some data to play around with.
+;;;
+;; **
+
+;; @@
+(defn load-conv-profiles
+  "Very bare bones reloading of the conversation; no cleanup for keyword/int hash-map key mismatches,
+  as found in the :repness"
+  [zid]
+  (mc/find-one-as-map
+    (db/mongo-db (env/env :mongolab-uri))
+    (db/mongo-collection-name "profile")
+    {:zid zid}))
+
+;; @@
+;; =>
+;;; {"type":"html","content":"#'performance-monitoring/load-conv-profiles","value":"#'performance-monitoring/load-conv-profiles"}
+;; <=
+
+;; @@
+(load-conv-profiles 11586)
+;; @@
+
+;; @@
+mc/
+;; @@


konponketa

konponketa

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


cleanup

cleanup

--- src/metabase/api/common/throttle.clj
+++ src/metabase/api/common/throttle.clj
@@ -64,7 +64,7 @@
                       ^Integer initial-delay-ms
                       ;; For each subsequent failure past ATTEMPTS-THRESHOLD, increase the delay by
                       ;; (num-attempts-over-theshold ^ DELAY-EXPONENT). e.g. if INITIAL-DELAY-MS is 15 and
-                      ;; DELAY-EXPONENT is 2, the first attempt past attempts-threshold will require the user to wait
+                      ;; DELAY-EXPONENT is 2, the first attempt past ATTEMPTS-THRESHOLD will require the user to wait
                       ;; 15 seconds (15 * 1^2), the next attempt after that 60 seconds (15 * 2^2), then 135, and so on.
                       ^Integer delay-exponent])


bump versions

bump versions

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/jeelabs/jet.git/'


s/(into #{})/(set)

s/(into #{})/(set)


More robust EchoNest error handling.

More robust EchoNest error handling.

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/jagtalon/what-the-fuck-do-you-want-to-listen-to.git/'


[scamp] add 'key-swap-test for node replacement

error: pathspec 'modules/scamp/test/scamp/util_test.clj' did not match any file(s) known to git

--- modules/scamp/test/scamp/util_test.clj
+++ modules/scamp/test/scamp/util_test.clj
@@ -0,0 +1,17 @@
+(ns scamp.util-test
+  (:require [schema.core :as s]
+            [clojure.test :refer [deftest is]]
+            [scamp.core :as scamp]
+            [scamp.util :as util]))
+
+(s/set-fn-validation! true)
+
+(deftest key-swap-test
+  (let [old-node-contact-address "friend-01"
+        new-node-contact-address "friend-02"
+        node-neighbors {"this-node" {:weight 43}
+                        old-node-contact-address {:weight 8}}
+        old-node-val (node-neighbors old-node-contact-address)]
+    (is (= ((util/key-swap node-neighbors old-node-contact-address new-node-contact-address)
+            new-node-contact-address)
+           old-node-val))))


update korma

update korma

--- compojure/hello/project.clj
+++ compojure/hello/project.clj
@@ -4,7 +4,7 @@
   :dependencies [[org.clojure/clojure "1.5.1"]
                  [compojure "1.1.5"]
                  [ring/ring-json "0.2.0"]
-                 [korma "0.3.0-RC4"]
+                 [korma "0.3.0-RC5"]
                  [log4j "1.2.15" :exclusions [javax.mail/mail javax.jms/jms com.sun.jdmk/jmxtools com.sun.jmx/jmxri]]
                  [mysql/mysql-connector-java "5.1.6"]
                  ]


initial clojure

initial clojure

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

--- clojure/compose/compose.cljs
+++ clojure/compose/compose.cljs
@@ -0,0 +1,6 @@
+(ns compose.compose)
+
+(enable-console-print!)
+
+(defn ^:export xyz [x]
+  (prn x))


initial commit

initial commit

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


Forgot a file

Forgot a file

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

--- src/hphelper/shared/helpers.clj
+++ src/hphelper/shared/helpers.clj
@@ -0,0 +1,21 @@
+(ns hphelper.shared.helpers
+  (:require [clojure.spec :as s]
+            [hphelper.shared.spec :as ss]
+            [taoensso.timbre :as log]
+            )
+  (:gen-class)
+  )
+
+(defn is-hp-name?
+  "Checks a game to make sure n is a valid player's name. Returns the name if true,
+  else returns nil."
+  [g ^String n]
+  (let [names (->> g :hps vals (map :name) (into []))]
+    (log/trace "is-hp-name?" (pr-str n) "in:" names)
+    (log/trace "is-hp-name?" (hash n) "in:" (into [] (map hash names)))
+    (if (some #{n} names)
+      (do (log/trace "is-hp-name? returned true.") n)
+      (do (log/trace "is-hp-name? returned false.") nil)
+      )
+    )
+  )


fix namespace

fix namespace

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


Add lazytest.tap namespace for TAP-style reports

error: pathspec 'src/main/clojure/com/stuartsierra/lazytest/tap.clj' did not match any file(s) known to git

--- src/main/clojure/com/stuartsierra/lazytest/tap.clj
+++ src/main/clojure/com/stuartsierra/lazytest/tap.clj
@@ -0,0 +1,45 @@
+(ns com.stuartsierra.lazytest.tap
+  (:use [com.stuartsierra.lazytest
+         :only (assertion-result? result-seq success?)]
+        [com.stuartsierra.lazytest.report
+         :only (source-name line-and-file print-result)]
+        [clojure.stacktrace
+         :only (print-cause-trace)]))
+
+(defn print-tap-plan
+  "Prints a TAP plan line like '1..n'.  n is the number of tests"
+  [n]
+  (println (str "1.." n)))
+
+(defn print-tap-diagnostic
+  "Prints a TAP diagnostic line.  data is a (possibly multi-line)
+  string."
+  [data]
+  (doseq [line (.split #^String data "\n")]
+    (println "#" line)))
+
+(defn print-tap-pass
+  "Prints a TAP 'ok' line.  msg is a string, with no line breaks"
+  [msg]
+  (println "ok" msg))
+
+(defn print-tap-fail
+  "Prints a TAP 'not ok' line.  msg is a string, with no line breaks"
+  [msg]
+  (println "not ok" msg))
+
+(defn tap-test-id [r]
+  (str (source-name r) " " (line-and-file r)))
+
+(defn report-tap-test [r]
+  (if (assertion-result? r)
+    (if (success? r)
+      (print-tap-pass (tap-test-id r))
+      (do (print-tap-fail (tap-test-id r))
+          (print-tap-diagnostic (with-out-str (print-result r)))))
+    (doseq [c (:children r)]
+      (report-tap-test c))))
+
+(defn report-tap [r]
+  (print-tap-plan (count (filter assertion-result? (result-seq r))))
+  (report-tap-test r))


Remove extra parens when no stacktrace available.

`weasel.repl/process-message` for `:eval-js` currently tries to *call* the string "No stacktrace available" when processing an error with no stacktrace. This results in a new error and the repl hanging. Instead it should just return the string as a value, which would match the behavior of `clojure.browser.repl/evaluate-javascript`.

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/modnakasta/weasel.git/'


Update list of signer names

Update list of signer names

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


Do not clean up user file when rmr is unsuccessful

--- storm-core/src/clj/backtype/storm/daemon/supervisor.clj
+++ storm-core/src/clj/backtype/storm/daemon/supervisor.clj
@@ -192,12 +192,23 @@
         (log-message log-prefix " interrupted.")))
       (.exitValue process)))

+(defn- rmr-as-user
+  "Launches a process owned by the given user that deletes the given path
+  recursively.  Throws RuntimeException if the directory is not removed."
+  [conf id user path]
+  (worker-launcher-and-wait conf
+                            user
+                            ["rmr" path]
+                            :log-prefix (str "rmr " id))
+  (if (exists-file? path)
+    (throw (RuntimeException. (str path " was not deleted")))))
+
 (defn try-cleanup-worker [conf id user]
   (try
     (if (.exists (File. (worker-root conf id)))
       (do
         (if (conf SUPERVISOR-RUN-WORKER-AS-USER)
-          (worker-launcher-and-wait conf user ["rmr" (worker-root conf id)] :log-prefix (str "rmr " id) )
+          (rmr-as-user conf id user (worker-root conf id))
           (do
             (rmr (worker-heartbeats-root conf id))
             ;; this avoids a race condition with worker or subprocess writing pid around same time
@@ -228,7 +239,7 @@
         (worker-launcher-and-wait conf user ["signal" pid "9"] :log-prefix (str "kill -9 " pid))
         (ensure-process-killed! pid))
       (if as-user
-        (worker-launcher-and-wait conf user ["rmr" (worker-pid-path conf id pid)] :log-prefix (str "rmr for " pid))
+        (rmr-as-user conf id user (worker-pid-path conf id pid))
         (try
           (rmpath (worker-pid-path conf id pid))
           (catch Exception e)) ;; on windows, the supervisor may still holds the lock on the worker directory


Add tests for new handlers

Add tests for new handlers


Added util tests.

Added util tests.

error: pathspec 'test/cmr/opendap/tests/unit/geom/util.clj' did not match any file(s) known to git


Add lab.cljc

Add lab.cljc

error: pathspec 'dev/lab.cljc' did not match any file(s) known to git

--- dev/lab.cljc
+++ dev/lab.cljc
@@ -0,0 +1,16 @@
+(ns lab)
+
+(comment
+  Overview and goal
+  Existing techniques: schema-based and schemaless
+  Technologies: clojure, clojurescript, java, js, libraries ...
+  Frame specification: parts, reading, writing
+  Buffer implementations: java, js, node, output types
+  Schema specification: parts, structuring, varints
+  Code generation: parsing, validating, code generation
+  Data generation
+  Testing: local and cross-platform
+  Microbenchmarks: size and performance
+  Profiling: jvisualvm
+  Publishing: open source, github, license
+  Improvements: performance, extensibility)


Agents

Agents

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

--- clojure/agent_example.clj
+++ clojure/agent_example.clj
@@ -0,0 +1,8 @@
+(def counter (agent 0 :validator #(>= % 0)))
+
+(dotimes [i 50000] (send counter + 1))
+
+(println @counter)   ; Will likely be < 50000
+(Thread/sleep 2000)
+(println @counter)   ; Will likely be 50000
+(shutdown-agents)


Set up the initial configuration

Set up the initial configuration

i.e. message queues, web server, etc

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

--- src/immutant/init.clj
+++ src/immutant/init.clj
@@ -0,0 +1,12 @@
+(ns immutant.init
+  (:require [immutant.web :as web]
+            [immutant.messaging :as msg]
+            [mdr2.web :refer [app]]))
+
+(web/start app)
+
+(msg/start "queue.create")
+(msg/start "queue.encode")
+(msg/start "queue.archive")
+
+


MOve comment to more useful place.

MOve comment to more useful place.

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/mtravers/incidents.git/'


refactor :ready to use with-compiler-env


moneyincomes tags

moneyincomes tags

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/TwiceII/gccnew.git/'


Add tests for larger scans

Add tests for larger scans

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


decorator functional imlementation

decorator functional imlementation

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

--- src/sandbox/decorator/decorator.clj
+++ src/sandbox/decorator/decorator.clj
@@ -0,0 +1,11 @@
+(ns sandbox.decorator.decorator)
+
+(defn add [a b] (+ a b))
+(defn subtract [a b] (- a b))
+(defn multiply [a b] (* a b))
+(defn divide [a b] (/ a b))
+
+(defn make-logger [calc-fn]
+  (fn [a b]
+    (let [result (calc-fn a b)]
+      (println (str "Result is: " result)) result)))


On OSX return "Mac OS" in os-dispatch rather than "Windows".

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/pascience/cloxp-install.git/'


Error indicators

Error indicators

--- ClojureScript/replete/src/replete/repl.cljs
+++ ClojureScript/replete/src/replete/repl.cljs
@@ -387,14 +387,30 @@
            "(" file (when line (str ":" line))
            (when column (str ":" column)) ")"))))))

+(defn- is-reader-or-analysis?
+  "Indicates if an exception is a reader or analysis exception."
+  [e]
+  (and (instance? ExceptionInfo e)
+       (some #{[:type :reader-exception] [:tag :cljs/analysis-error]} (ex-data e))))
+
+(defn- get-error-column-indicator
+  [error]
+  (when (instance? ExceptionInfo error)
+    (when-let [cause (ex-cause error)]
+      (when (is-reader-or-analysis? cause)
+        (when-let [column (:column (ex-data cause))]
+          (str (apply str (take column (repeat " "))) "↑\n"))))))
+
 (defn print-error
   ([error]
    (print-error error false))
   ([error include-stacktrace?]
    (let [e (or (.-cause error) error)]
-     (println (.-message e)
-       (when include-stacktrace?
-         (str "\n" (.-stack e)))))))
+     (println
+       (str (get-error-column-indicator error)
+         (.-message e)
+         (when include-stacktrace?
+           (str "\n" (.-stack e))))))))

 (defn- get-macro-var
   [env sym macros-ns]


bottles clojure

bottles clojure

error: pathspec 'Programs/02-99-Bottles-of-Beer/solutions/askl56-bottles-of-beer.clj' did not match any file(s) known to git

--- Programs/02-99-Bottles-of-Beer/solutions/askl56-bottles-of-beer.clj
+++ Programs/02-99-Bottles-of-Beer/solutions/askl56-bottles-of-beer.clj
@@ -0,0 +1,12 @@
+(defn sing
+  [start]
+  (doseq [n (range start 0 -1)]
+    (printf "%d bottles of beer on the wall,
+%d bottles of beer,
+Take one down, pass it around,
+%d bottles of beer on the wall.\n\n"
+          n
+          n
+          (dec n))))
+
+(sing 99)


example application within library / tool project is easier to handle

At this point, having the example in the main project makes reloading the
client side (CLJS recompile, CSS, HTML) much easier.

error: pathspec 'src/clj/com/matthiasnehlsen/inspect/main.clj' did not match any file(s) known to git

--- src/clj/com/matthiasnehlsen/inspect/main.clj
+++ src/clj/com/matthiasnehlsen/inspect/main.clj
@@ -0,0 +1,26 @@
+(ns com.matthiasnehlsen.inspect.main
+  (:gen-class)
+  (:require
+   [com.matthiasnehlsen.inspect :as inspect :refer [inspect]]
+   [clojure.tools.namespace.repl :refer [refresh]]
+   [clojure.tools.logging :as log]
+   [com.stuartsierra.component :as component]
+   [clojure.pprint :as pp]
+   [clojure.core.async :as async :refer [<! chan put! timeout go-loop]]))
+
+(defn interval-put-loop
+  "put msg on chan every interval milliseonds"
+  [interval msg-type msg]
+  (go-loop [] (<! (timeout interval)) (inspect msg-type msg) (recur)))
+
+(interval-put-loop     1 :interval-put/every-millisecond {:msg "every millisecond"})
+(interval-put-loop  1000 :interval-put/every-second {:msg "every second"})
+(interval-put-loop  5000 :interval-put/every-five-seconds {:msg "every five seconds"})
+(interval-put-loop 10000 :interval-put/every-ten-seconds {:msg "every ten seconds"})
+(interval-put-loop 60000 :interval-put/every-minute {:msg "every minute"})
+
+(defn reload [] (inspect/stop) (refresh) (inspect/start))
+
+(defn -main [& args]
+  (log/info "Application started")
+  (inspect/start))


added newsletter/twitter/irc links to front page

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


Add missing web.util namespace with the delay-call function

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

--- src/web/util.cljs
+++ src/web/util.cljs
@@ -0,0 +1,12 @@
+(ns web.util
+  (:require [cljs.core.async :refer [<! timeout]])
+  (:require-macros [cljs.core.async.macros :refer [go]]))
+
+(defn delay-call
+  ([ms f]
+   (delay-call ms f (constantly true)))
+  ([ms pred f]
+   (go
+     (<! (timeout ms))
+     (when (pred)
+       (f)))))


fix payments view and descriptions

fix payments view and descriptions

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


handle responses better

handle responses better

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


clean up payment source for further integration


Added the common file

Added the common file

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

--- src/ardoq/swagger/common.clj
+++ src/ardoq/swagger/common.clj
@@ -0,0 +1,51 @@
+(ns ardoq.swagger.common
+  (:require [ardoq.swagger.client :as api]
+            [cheshire.core :refer [generate-string parse-string]]
+            [clojure.java.io :as io]
+            [clojure.string :as s]
+            [clojurewerkz.urly.core :as urly]
+            [clostache.parser :as tpl]
+            [medley.core :refer [map-vals]]
+            [clj-http.client :as http]))
+
+(defn find-or-create-model [client type]
+  (if-let [model (first (filter #(= type (:name %)) (api/find-all (api/map->Model {}) client)))]
+    model
+    (-> (api/map->Model (parse-string (slurp (io/resource (if (= type = "Swagger") "modelv1.json" "modelv2.json"))) true))
+        (api/create client))))
+
+(defn- field-exists? [client field-name {:keys [_id] :as model}]
+  (not (empty? (filter
+                (fn [{:keys [name model]}]
+                  (and (= name field-name)
+                       (= model (str _id))))
+                (api/find-all (api/map->Field {}) client)))))
+
+(defn find-or-create-fields [client {model-id :_id :as model}]
+  (when-not (field-exists? client "method" model)
+    (-> (api/->Field "method" "method" "Text" (str model-id) [(api/type-id-by-name model "Operation")])
+        (api/create client)))
+  (when-not (field-exists? client "produces" model)
+    (-> (api/->Field "produces" "produces" "List" (str model-id) [(api/type-id-by-name model "Operation") (api/type-id-by-name model "Resource")])
+        (api/create client)))
+  (when-not (field-exists? client "consumes" model)
+    (-> (api/->Field "consumes" "consumes" "List" (str model-id) [(api/type-id-by-name model "Operation") (api/type-id-by-name model "Resource")])
+        (api/create client))))
+
+(defn generate-operation-description [data models]
+  (reduce
+   (fn [description [model-id {:keys [_id] :as model}]]
+     (s/replace description (re-pattern (str "\\|" (name model-id) "\\|")) (str "|[" (name model-id) "](comp://" _id ")|")))
+   (tpl/render-resource "operationTemplate.tpl" data)
+   models))
+
+(defn update-comp [client component {:keys [produces consumes]}]
+  ;; Updates a component based on previous modelling. Uses the swagger file to detect what it needs.
+  (api/update
+   (cond-> (api/map->Component component)
+     produces (assoc :produces produces)
+     consumes (assoc :consumes consumes)) client))
+
+(defn save-models [models client]
+  (map-vals #(let [schema (:schema %)]
+               (assoc (api/create (dissoc % :schema) client) :schema schema)) models))


simplify loop expression

simplify loop expression

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


Add exemple with multiple hitboxes on each pad

error: pathspec 'examples/yaw/pad_ball_3.clj' did not match any file(s) known to git

--- examples/yaw/pad_ball_3.clj
+++ examples/yaw/pad_ball_3.clj
@@ -0,0 +1,273 @@
+(ns yaw.pad-ball-3
+  "A simple 3D example using a reagent-like approach."
+  (:require
+   [clojure.set :as set]
+   [yaw.world :as world]
+   [yaw.reaction :as react]
+   [yaw.render :as render]))
+
+(def +myctrl+ (world/start-universe!))
+
+;;; =====================
+;;; The state part
+;;; =====================
+
+(react/register-state ::pad1-state {:pos [3 0 -5]
+                                    :delta [0 0.05 0]})
+
+(react/register-state ::pad2-state {:pos [-3 0 -5]
+                                    :delta [0 0.05 0]})
+
+(react/register-state ::ball-state {:pos [-2 0 -5]
+                                    :delta [0.02 0 0]})
+
+(def init-pad1-state
+  {:pos [3 0 -5]
+   :delta [0 0.05 0]})
+
+(def init-pad2-state
+  {:pos [-3 0 -5]
+   :delta [0 0.05 0]})
+
+(def init-ball-state
+  {:pos [-2 0 -5]
+   :delta [0.02 0 0]})
+
+;;; =====================
+;;; Subscription(s)
+;;; =====================
+
+(react/register-subscription
+ ::pad1-changed
+ (fn [db]
+   (::pad1-state  db)))
+
+(react/register-subscription
+ ::pad2-changed
+ (fn [db]
+   (::pad2-state  db)))
+
+(react/register-subscription
+ ::ball-changed
+ (fn [db]
+   (::ball-state  db)))
+
+;;; ====================
+;;; Event handlers
+;;; ====================
+
+(react/register-event
+ :react/initialize
+ (fn []
+   (react/init-state ::pad1-state init-pad1-state)
+   (react/init-state ::pad2-state init-pad2-state)
+   (react/init-state ::ball-state init-ball-state)))
+
+(react/register-event
+ :react/frame-update
+ (fn []
+   (react/dispatch [::move-ball])))
+
+(declare update-ball-state)
+
+(react/register-event
+ ::move-up-pad1
+ (fn []
+   (react/update-state ::pad1-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv + pos delta)
+                          :delta delta}))))
+(react/register-event
+ ::move-down-pad1
+ (fn []
+   (react/update-state ::pad1-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv - pos delta)
+                          :delta delta}))))
+
+
+(react/register-event
+ ::move-up-pad2
+ (fn []
+   (react/update-state ::pad2-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv + pos delta)
+                          :delta delta}))))
+(react/register-event
+ ::move-down-pad2
+ (fn []
+   (react/update-state ::pad2-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv - pos delta)
+                          :delta delta}))))
+
+
+(react/register-event
+ ::move-ball
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos (mapv + pos delta) :delta delta}))))
+
+(react/register-event
+ ::ball-collision-top
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                        (let [delta' (assoc delta 0 (- (get delta 0)))
+                              delta' (assoc delta' 1 0.01)]
+                          {:pos pos :delta delta'})))))
+
+(react/register-event
+ ::ball-collision-middle
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         {:pos pos :delta (assoc delta 0 (- (get delta 0)))}))))
+
+(react/register-event
+ ::ball-collision-bottom
+ (fn []
+   (react/update-state ::ball-state
+                       (fn [{pos :pos
+                             delta :delta}]
+                         (let [delta' (assoc delta 0 (- (get delta 0)))
+                               delta' (assoc delta' 1 -0.01)]
+                          {:pos pos :delta delta'})))))
+
+(world/register-input-callback! (:world @+myctrl+)
+ (fn [key _ action _]
+   (cond
+    (and (= key 265) ; HACK: GLFW constant for up arrow!
+            (or (= action 2) (= action 1))) ; HACK: GLFW_PRESS or REPEATED
+     (react/dispatch [::move-up-pad1])
+    (and (= key 264) ; HACK: GLFW constant for down arrow!
+            (or (= action 2) (= action 1))) ; HACK: GLFW_PRESS or REPEATED
+      (react/dispatch [::move-down-pad1])
+    (and (= key 87) ; HACK: GLFW constant for z!
+            (or (= action 2) (= action 1))) ; HACK: GLFW_PRESS or REPEATED
+     (react/dispatch [::move-up-pad2])
+    (and (= key 83) ; HACK: GLFW constant for s!
+            (or (= action 2) (= action 1))) ; HACK: GLFW_PRESS or REPEATED
+      (react/dispatch [::move-down-pad2]))))
+
+
+;;; =====================
+;;; The view part
+;;; =====================
+
+;; TODO Why can't we use this function twice to define both pads ?
+; (defn the-pad
+;   [id state]
+;   [:group (keyword "test" (str "pad-group-" id))
+;           {:pos (:pos @state)
+;             :rot [0 0 0]
+;             :scale 1}
+;    [:item (keyword "test" (str "pad-" id))
+;           {:mesh :mesh/cuboid
+;             :pos [0 0 0]
+;             :rot [0 0 0]
+;             :mat :red
+;             :scale 0.3}]
+;    [:hitbox (keyword "test" (str "hitbox-" id))
+;             {:pos [0 0 0]
+;               :scale 0.6
+;               :length [1 3 1]}]])
+
+(defn the-pad1
+  [state]
+  [:group :test/pad-group-1
+          {:pos (:pos @state)
+            :rot [0 0 0]
+            :scale 1}
+   [:item :test/pad-item-1
+          {:mesh :mesh/cuboid
+            :pos [0 0 0]
+            :rot [0 0 0]
+            :mat :red
+            :scale 0.3}]
+   [:hitbox :test/pad-hitbox-top-1
+            {:pos [0 0.5 0]
+              :scale 0.6
+              :length [0.80 1.1 1.01]}]
+   [:hitbox :test/pad-hitbox-middle-1
+            {:pos [0 0 0]
+              :scale 0.6
+              :length [1.10 0.5 1.01]}]
+   [:hitbox :test/pad-hitbox-bottom-1
+            {:pos [0 -0.5 0]
+              :scale 0.6
+              :length [0.80 1.1 1.01]}]])
+
+(defn the-pad2
+  [state]
+  [:group :test/pad-group-2
+          {:pos (:pos @state)
+            :rot [0 0 0]
+            :scale 1}
+   [:item :test/pad-item-2
+          {:mesh :mesh/cuboid
+            :pos [0 0 0]
+            :rot [0 0 0]
+            :mat :red
+            :scale 0.3}]
+   [:hitbox :test/pad-hitbox-top-2
+            {:pos [0 0.5 0]
+              :scale 0.6
+              :length [0.80 1.1 1.01]}]
+   [:hitbox :test/pad-hitbox-middle-2
+            {:pos [0 0 0]
+              :scale 0.6
+              :length [1.10 0.5 1.01]}]
+   [:hitbox :test/pad-hitbox-bottom-2
+            {:pos [0 -0.5 0]
+              :scale 0.6
+              :length [0.80 1.1 1.01]}]])
+
+(defn the-ball
+  [state]
+  [:group :test/ball {:pos (:pos @state)
+                      :rot [0 0 0]
+                      :scale 1}
+   [:item :test/box {:mesh :mesh/box
+                     :pos [0 0 0]
+                     :rot [0 0 0]
+                     :mat :white
+                     :scale 0.3}]
+   [:hitbox :test/ball-hitbox {:pos [0 0 0]
+                              :scale 0.6
+                              :length [1 1 1]}
+    [{:group-id :test/pad-group-1 :hitbox-id :test/pad-hitbox-top-1 :collision-handler #(react/dispatch [::ball-collision-top])}
+     {:group-id :test/pad-group-1 :hitbox-id :test/pad-hitbox-middle-1 :collision-handler #(react/dispatch [::ball-collision-middle])}
+     {:group-id :test/pad-group-1 :hitbox-id :test/pad-hitbox-bottom-1 :collision-handler #(react/dispatch [::ball-collision-bottom])}
+     {:group-id :test/pad-group-2 :hitbox-id :test/pad-hitbox-top-2 :collision-handler #(react/dispatch [::ball-collision-top])}
+     {:group-id :test/pad-group-2 :hitbox-id :test/pad-hitbox-middle-2 :collision-handler #(react/dispatch [::ball-collision-middle])}
+     {:group-id :test/pad-group-2 :hitbox-id :test/pad-hitbox-bottom-2 :collision-handler #(react/dispatch [::ball-collision-bottom])}]]])
+
+
+(defn scene []
+  [:scene
+   [:ambient {:color :white :i 0.4}]
+   [:sun {:color :red :i 1 :dir [-1 0 0]}]
+   [:light ::light {:color :yellow :pos [0.5 0 -4]}]
+   (let [pad-state1 (react/subscribe +myctrl+ [::pad1-changed])]
+    [the-pad1 pad-state1])
+   (let [pad-state2 (react/subscribe +myctrl+ [::pad2-changed])]
+    [the-pad2 pad-state2])
+   (let [ball-state (react/subscribe +myctrl+ [::ball-changed])]
+     [the-ball ball-state])
+    ])
+
+;;; =====================
+;;; The main part
+;;; =====================
+
+(react/activate! +myctrl+ [scene])
+ ;; (react/dispatch :react/initialize)


Adding some experimental code

Adding some experimental code

for proper permises and propabilities.

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

error: pathspec 'src/conexp/contrib/experimental/min-hyp-trans.clj' did not match any file(s) known to git

--- src/conexp/contrib/experimental/min-hyp-trans.clj
+++ src/conexp/contrib/experimental/min-hyp-trans.clj
@@ -0,0 +1,88 @@
+(ns conexp.contrib.experimental.min-hyp-trans
+  (:use conexp.main
+        [clojure.contrib.combinatorics :only (selections)]))
+
+;;;
+
+(defn all-contexts-by-type [p q]
+  (let [bits (selections [0 1] (* p q))]
+    (map #(make-context-from-matrix p q %) bits)))
+
+(defn min-hypergraph-transversal? [ctx Q]
+  (boolean
+   (and (forall [m Q]
+          (exists [g (objects ctx)]
+           (= #{m} (intersection Q (object-derivation ctx #{g})))))
+        (forall [g (objects ctx)]
+          (not-empty (intersection Q (object-derivation ctx #{g})))))))
+
+(defn min-hypergraph-transversals [p q Q]
+  (loop [ctxs     (all-contexts-by-type p q),
+         mhyp-cnt 0N]
+    (if (empty? ctxs)
+      mhyp-cnt
+      (recur (rest ctxs)
+             (if (min-hypergraph-transversal? (first ctxs) Q)
+               (inc mhyp-cnt)
+               mhyp-cnt)))))
+
+(defn minhypt-sum$ [n k j p]
+  (if (>= j k)
+    (let [p (conj p (+ n 1))]
+      (reduce *
+              1N
+              (map #(expt (- (expt 2N k) 1N k (- %))
+                          (- (nth p (+ % 1))
+                             (nth p %)
+                             1N))
+                   (range 0 (+ k 1)))))
+    (reduce +
+            0N
+            (map #(minhypt-sum$ n k (inc j) (conj p %))
+                 (range (+ 1 (nth p j))
+                        (+ n (- k) (+ j 1) 1))))))
+
+(defn minhypt-sum [n m k]
+  (let [sums (minhypt-sum$ n k 0 [0])]
+    (* (reduce * 1N (range 1N (+ 1 k)))
+       (expt 2N (* n (- m k)))
+       sums)))
+
+(defn mean-minhypt-sum$ [n k j p]
+  (if (>= j k)
+    (let [p (conj p (+ n 1.0))]
+      (reduce *
+              (expt 0.5 (* k k))
+              (map #(expt (- 1.0
+                             (* (+ 1.0 k (- %))
+                                (expt 0.5 k)))
+                          (- (nth p (+ % 1))
+                             (nth p %)
+                             1.0))
+                   (range 0.0 (+ k 1.0)))))
+    (reduce +
+            0.0
+            (map #(mean-minhypt-sum$ n k (inc j) (conj p %))
+                 (range (+ 1.0 (nth p j))
+                        (+ n (- k) (+ j 1.0) 1.0))))))
+
+(defn mean-minhypt-sum [n m k]
+  (* (reduce * 1.0 (range 1.0 (+ 1.0 k)))
+     (mean-minhypt-sum$ n k 0.0 [0.0])))
+
+(defn binomial [n k]
+  (prod i 1 k
+        (/ (- n (- k i))
+           i)))
+
+(defn expected-number-of-proper-premises [n m]
+  (* (expt 0.5 n)
+     (sum k 0 m
+          (* (binomial (- m 1) k)
+             (sum l 0 n
+                  (* (binomial n l)
+                     (mean-minhypt-sum l (- m 1) k)))))))
+
+;;;
+
+nil


minor documentation.

minor documentation.

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


Twitter not animation

Twitter not animation

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


Added a comment for get-flight-time-fuel

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/em7/em7OptiFL-core.git/'


Revert "Move formats to a more prominent position"

This reverts commit 88cee15088263c7afc65ee74270b8e3fc52f1409.

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


packet.clj dropped

packet.clj dropped

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

--- src/clj/beat_detector/packet.clj
+++ src/clj/beat_detector/packet.clj
@@ -0,0 +1,17 @@
+(ns beat-detector.packet
+  (:require [beat-detector.loader :as loader]))
+
+; A Packet is a bundle data that contains all the necessary informations
+; that it can be immediately processed by beat detection; i.e. current
+; energy history buffer, raw datas that appends those stored in energy
+; buffer, position of current instance, num of samples in one instance,
+; num of samples in one sound history buffer, and num of frequency
+; subbands.
+(defrecord Packet [buffer raw pos n-inst n-hist n-freq])
+
+(defn pack
+  "Returns an empty-buffer packet containing raw."
+  ([raw]
+   (pack raw nil loader/n-inst loader/n-hist loader/n-freq))
+  ([raw pos n-inst n-hist n-freq]
+   (->Packet nil raw pos n-inst n-hist n-freq)))


Improved more tests

Improved more tests

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-Digital/pdg-core.git/'


remove unnecessary handlers

remove unnecessary handlers


remove unused stub

remove unused stub

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


Add decomposition, with infinite loops

Add decomposition, with infinite loops

--- src/angelic/search/implicit/fah_astar_eval2.clj
+++ src/angelic/search/implicit/fah_astar_eval2.clj
@@ -32,8 +32,11 @@
 #_ (def  ^{:private true} cache-trait summaries/uncached-summarizer-node)
   (def ^{:private true} cache-trait summaries/eager-cached-summarizer-node)
 #_ (def ^{:private true} cache-trait summaries/less-eager-cached-summarizer-node)
-#_ (def ^{:private true} cache-trait summaries/lazy-cached-summarizer-node)
+ (def ^{:private true} cache-trait summaries/lazy-cached-summarizer-node)
 #_ (def ^{:private true} cache-trait summaries/pseudo-cached-summarizer-node)
+
+(def *no-identical-nonterminal-outputs* true)
+(def *decompose-cache* #_nil true) ;; nil for none, or bind to hashmap

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;       Utilities      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -203,23 +206,18 @@
   (summaries/summary-changed-local! stub)
   (add-output! stub sp))

-;; TODO: put a switch here.
 ;; Would be nice to assert consistency, but hard to get before-summary...
 ;; This version keeps children with same input inside.
 ;; Actually makes things worse sometimes (more evaluations?!) -- with first, better with last.
 (defn add-sp-child! [sp child-sp]
   (assert (not (terminal? sp)))
-  (if (and (= (output-set sp) (output-set child-sp))
-            (not (terminal? child-sp)#_(summary/solved? (summaries/summary (tree-summarizer child-sp))))) ;;no
+  (if (and *no-identical-nonterminal-outputs*
+           (= (output-set sp) (output-set child-sp))
+           (not (terminal? child-sp)))
     (do (connect-and-watch! sp child-sp #(add-sp-child! sp %))
         (summaries/summary-changed! sp ))
     (do (summaries/summary-changed-local! sp)
         (add-output! sp child-sp))))
-#_
-(defn add-sp-child! [sp child-sp]
-  (assert (not (terminal? sp)))
-  (summaries/summary-changed-local! sp)
-  (add-output! sp child-sp))

 ;; Note: All nonterminal subproblems use or-summary for ri-fn
 (defn make-simple-subproblem
@@ -246,11 +244,11 @@

-(declare make-fs-seq-stub make-atomic-stub)
+(declare make-fs-seq-stub get-atomic-stub)

 (defn- make-atomic-subproblem [stub function-set subsuming-sp out-set reward status]
   (let [inp-set  (input-set stub)
-        ri-fn    (fn [s ri] (make-atomic-stub s ri function-set))]
+        ri-fn    (fn [s ri] (get-atomic-stub s ri function-set))]
     (cond (not (= status :live))
           (make-simple-subproblem
            stub subsuming-sp out-set true
@@ -277,11 +275,11 @@
   (when subsuming-sp (summaries/connect! child (tree-summarizer subsuming-sp) true)))

 ;; Note: this is double-stage to lazily generate children.  Could be simpler single-stage.
-(defn- make-atomic-stub [subsuming-sp inp-set function-set]
+(defn- make-atomic-stub [name subsuming-sp inp-set function-set]
   (let [state (atom :ready) ;; set to [out-set reward] after first eval, then :go after second.
         ret
         (traits/reify-traits
-         [(simple-stub [:Atomic (fs/fs-name function-set) #_ inp-set] inp-set)
+         [(simple-stub name inp-set)
           simple-watched simple-cached-node]
          summaries/Summarizable
          (summarize [s]
@@ -306,6 +304,13 @@
     (connect-subsuming! ret subsuming-sp)
     ret))

+;; TODO: do something more with subsuming?
+(defn- get-atomic-stub [subsuming-sp inp-set function-set]
+  (let [name [:Atomic (fs/fs-name function-set) inp-set]]
+   (if *decompose-cache*
+     (util/cache-with ^HashMap *decompose-cache* name
+       (make-atomic-stub name subsuming-sp inp-set function-set))
+     (make-atomic-stub name subsuming-sp inp-set function-set))))

@@ -381,7 +386,7 @@
 (defn- make-fs-seq-stub
   ([inp-set fs] (make-fs-seq-stub inp-set fs (map fs/fs-name fs)))
   ([inp-set [first-fs & rest-fs] fs-names]
-     (let [left-stub (make-atomic-stub nil inp-set first-fs)]
+     (let [left-stub (get-atomic-stub nil inp-set first-fs)]
        (if (empty? rest-fs)
          left-stub
          (make-pair-stub1 nil left-stub (rest fs-names)
@@ -413,7 +418,7 @@
    #(let [n (second (subproblem-name %))] (when-not (= (first n) :noop) n))))

 (defn- get-root-subproblem [inp-set fs]
-  (let [root-stub (make-atomic-stub nil inp-set fs)
+  (let [root-stub (get-atomic-stub nil inp-set fs)
         ret       (atom nil)]
     (add-watcher! root-stub (fn [root] (reset! ret root)))
     (evaluate! root-stub)
@@ -424,9 +429,10 @@

 (defn implicit-fah-a*-eval2 [henv]
-  (->> (fs/make-init-pair henv)
-       (apply get-root-subproblem)
-       solve))
+  (binding [*decompose-cache* (when *decompose-cache* (HashMap.))]
+   (->> (fs/make-init-pair henv)
+        (apply get-root-subproblem)
+        solve)))

 ; (do (use '[angelic env hierarchy] 'angelic.domains.nav-switch 'angelic.search.implicit.fah-astar-expand 'angelic.search.implicit.fah-astar-eval 'angelic.search.implicit.fah-astar-eval2 'angelic.domains.discrete-manipulation) (require '[angelic.search.explicit.hierarchical :as his]))


rm todo comment

rm todo 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/jtbeckha/alda.git/'


Intercom/user analysis worksheet

Intercom/user analysis worksheet

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

--- worksheets/user_analysis.clj
+++ worksheets/user_analysis.clj
@@ -0,0 +1,242 @@
+;; gorilla-repl.fileformat = 1
+
+;; **
+;;; # User Analysis
+;;;
+;;; Intercom is great, but falls short on analysis.
+;; **
+
+;; @@
+(ns user-analysis
+  (:require [gorilla-plot.core :as plot]
+            [polismath.db :as db]
+            [polismath.intercom :as ic]
+            [polismath.pretty-printers :as pp]
+            [korma.core :as ko]))
+;; @@
+;; =>
+;;; {"type":"html","content":"nil","value":"nil"}
+;; <=
+
+;; **
+;;; ### First, let's load up the intercom data.
+;;;
+;;; Note that at the time of this writing though, we are still getting bad `remote_created_at` attributes in the data everytime someone logs in.
+;;; So first, we'll do a mass update, then load the data.
+;; **
+
+;; @@
+;; WARNING - recompute here!
+; (ic/update-intercom-db)
+(println "Done with update")
+(def icusers (ic/get-icusers))
+(println "Done getting icusers")
+;; @@
+;; ->
+;;; Done with update
+;;; Done getting icusers
+;;;
+;; <-
+;; =>
+;;; {"type":"html","content":"nil","value":"nil"}
+;; <=
+
+;; **
+;;; Great!
+;;; Now let's take a look at the shape here.
+;; **
+
+;; @@
+(pp/wide-pp (first icusers))
+;; @@
+;; ->
+;;; {"unsubscribed_from_emails" false,
+;;;  "segments" {"type" "segment.list", "segments" [{"type" "segment", "id" "532c94b472cdbb2586000044"}]},
+;;;  "remote_created_at" 1394217883,
+;;;  "custom_attributes" {"avg_n_ptpts" nil, "n_owned_convs" nil, "n_ptptd_convs" 1, "n_owned_convs_ptptd" nil, "avg_n_visitors" nil},
+;;;  "session_count" 0,
+;;;  "created_at" 1394217883,
+;;;  "name" "Lang Say",
+;;;  "last_request_at" nil,
+;;;  "user_id" "488",
+;;;  "location_data" {},
+;;;  "updated_at" 1411322966,
+;;;  "user_agent_data" nil,
+;;;  "tags" {"type" "tag.list", "tags" [{"type" "tag", "id" "16031", "name" "Starbucks"}]},
+;;;  "avatar" {"type" "avatar", "image_url" nil},
+;;;  "app_id" "nb5hla8s",
+;;;  "type" "user",
+;;;  "id" "531a139b93bb867153000edd",
+;;;  "companies" {"type" "company.list", "companies" []},
+;;;  "social_profiles" {"type" "social_profile.list", "social_profiles" []},
+;;;  "email" "lsay@starbucks.com"}
+;;;
+;; <-
+;; =>
+;;; {"type":"html","content":"nil","value":"nil"}
+;; <=
+
+;; **
+;;; And now let's do a deep replacement of string keys with keywords (and replace underscores with dashes).
+;; **
+
+;; @@
+(defn kwify-key [k]
+  (-> k
+      (clojure.string/replace "_" "-")
+      ; HACK! When I use this to redefine var icusers, it stringifies with :
+      (clojure.string/replace ":" "")
+      (keyword)))
+
+(defn kwify-hash [h]
+  (if (map? h)
+    (->> h
+         (map (fn [[k v]] [(kwify-key k) (kwify-hash v)]))
+         (into {}))
+    ; Should come in here later and if coll, iterate over possible maps; don't need yet though
+    (if (coll? h)
+      (map kwify-hash h)
+      h)))
+
+(pp/wide-pp (kwify-hash (first icusers)))
+;; @@
+;; ->
+;;; {:session-count 0,
+;;;  :unsubscribed-from-emails false,
+;;;  :location-data {},
+;;;  :n-ptptd-convs 1,
+;;;  :app-id "nb5hla8s",
+;;;  :user-id "488",
+;;;  :name "Lang Say",
+;;;  :user-agent-data nil,
+;;;  :companies {:type "company.list", :companies ()},
+;;;  :avatar {:type "avatar", :image-url nil},
+;;;  :custom-attributes {:avg-n-ptpts nil, :n-owned-convs nil, :n-ptptd-convs 1, :n-owned-convs-ptptd nil, :avg-n-visitors nil},
+;;;  :email "lsay@starbucks.com",
+;;;  :avg-n-ptpts 0,
+;;;  :n-owned-convs-ptptd 0,
+;;;  :type "user",
+;;;  :remote-created-at 1394217883,
+;;;  :avg-n-visitors 0,
+;;;  :n-owned-convs 0,
+;;;  :updated-at 1411322966,
+;;;  :created-at 1394217883,
+;;;  :social-profiles {:type "social_profile.list", :social-profiles ()},
+;;;  :segments {:type "segment.list", :segments ({:type "segment", :id "532c94b472cdbb2586000044"})},
+;;;  :last-request-at nil,
+;;;  :id "531a139b93bb867153000edd",
+;;;  :tags {:type "tag.list", :tags ({:type "tag", :id "16031", :name "Starbucks"})}}
+;;;
+;; <-
+;; =>
+;;; {"type":"html","content":"nil","value":"nil"}
+;; <=
+
+;; **
+;;; Wohoo!
+;;; Great.
+;;; Now let's build some normalization to a flatter, more focused structure easier to plot and do analysis with.
+;;;
+;; **
+
+;; @@
+; XXX - For the hash-map-subset, and various plumbing things
+(require '[polismath.utils :refer :all]
+         '[plumbing.core :as pc])
+
+(defn zeroify-nulls [h]
+  (pc/map-vals
+    (fn [v] (if v v 0))
+    h))
+
+(defn normalize-icuser
+  "Grabs only pertinent information; does kwify-hash for you"
+  [icuser]
+  (as-> icuser user
+        (kwify-hash user)
+        (-> user
+            :custom-attributes
+            zeroify-nulls
+            (into user))))
+
+(def icusers (map normalize-icuser icusers))
+;; @@
+;; =>
+;;; {"type":"html","content":"#'user-analysis/icusers","value":"#'user-analysis/icusers"}
+;; <=
+
+;; @@
+(first icusers)
+;; @@
+;; =>
+;;; {"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":session-count","value":":session-count"},{"type":"html","content":"0","value":"0"}],"value":"[:session-count 0]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":unsubscribed-from-emails","value":":unsubscribed-from-emails"},{"type":"html","content":"false","value":"false"}],"value":"[:unsubscribed-from-emails false]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":location-data","value":":location-data"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[],"value":"{}"}],"value":"[:location-data {}]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":n-ptptd-convs","value":":n-ptptd-convs"},{"type":"html","content":"1","value":"1"}],"value":"[:n-ptptd-convs 1]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":app-id","value":":app-id"},{"type":"html","content":""nb5hla8s"","value":"\"nb5hla8s\""}],"value":"[:app-id \"nb5hla8s\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":user-id","value":":user-id"},{"type":"html","content":""488"","value":"\"488\""}],"value":"[:user-id \"488\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":name","value":":name"},{"type":"html","content":""Lang Say"","value":"\"Lang Say\""}],"value":"[:name \"Lang Say\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":user-agent-data","value":":user-agent-data"},{"type":"html","content":"nil","value":"nil"}],"value":"[:user-agent-data nil]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":companies","value":":companies"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":type","value":":type"},{"type":"html","content":""company.list"","value":"\"company.list\""}],"value":"[:type \"company.list\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":companies","value":":companies"},{"type":"list-like","open":"(","close":")","separator":" ","items":[],"value":"()"}],"value":"[:companies ()]"}],"value":"{:type \"company.list\", :companies ()}"}],"value":"[:companies {:type \"company.list\", :companies ()}]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":avatar","value":":avatar"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":type","value":":type"},{"type":"html","content":""avatar"","value":"\"avatar\""}],"value":"[:type \"avatar\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":image-url","value":":image-url"},{"type":"html","content":"nil","value":"nil"}],"value":"[:image-url nil]"}],"value":"{:type \"avatar\", :image-url nil}"}],"value":"[:avatar {:type \"avatar\", :image-url nil}]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":custom-attributes","value":":custom-attributes"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":avg-n-ptpts","value":":avg-n-ptpts"},{"type":"html","content":"nil","value":"nil"}],"value":"[:avg-n-ptpts nil]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":n-owned-convs","value":":n-owned-convs"},{"type":"html","content":"nil","value":"nil"}],"value":"[:n-owned-convs nil]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":n-ptptd-convs","value":":n-ptptd-convs"},{"type":"html","content":"1","value":"1"}],"value":"[:n-ptptd-convs 1]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":n-owned-convs-ptptd","value":":n-owned-convs-ptptd"},{"type":"html","content":"nil","value":"nil"}],"value":"[:n-owned-convs-ptptd nil]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":avg-n-visitors","value":":avg-n-visitors"},{"type":"html","content":"nil","value":"nil"}],"value":"[:avg-n-visitors nil]"}],"value":"{:avg-n-ptpts nil, :n-owned-convs nil, :n-ptptd-convs 1, :n-owned-convs-ptptd nil, :avg-n-visitors nil}"}],"value":"[:custom-attributes {:avg-n-ptpts nil, :n-owned-convs nil, :n-ptptd-convs 1, :n-owned-convs-ptptd nil, :avg-n-visitors nil}]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":email","value":":email"},{"type":"html","content":""lsay@starbucks.com"","value":"\"lsay@starbucks.com\""}],"value":"[:email \"lsay@starbucks.com\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":avg-n-ptpts","value":":avg-n-ptpts"},{"type":"html","content":"0","value":"0"}],"value":"[:avg-n-ptpts 0]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":n-owned-convs-ptptd","value":":n-owned-convs-ptptd"},{"type":"html","content":"0","value":"0"}],"value":"[:n-owned-convs-ptptd 0]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":type","value":":type"},{"type":"html","content":""user"","value":"\"user\""}],"value":"[:type \"user\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":remote-created-at","value":":remote-created-at"},{"type":"html","content":"1394217883","value":"1394217883"}],"value":"[:remote-created-at 1394217883]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":avg-n-visitors","value":":avg-n-visitors"},{"type":"html","content":"0","value":"0"}],"value":"[:avg-n-visitors 0]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":n-owned-convs","value":":n-owned-convs"},{"type":"html","content":"0","value":"0"}],"value":"[:n-owned-convs 0]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":updated-at","value":":updated-at"},{"type":"html","content":"1411322966","value":"1411322966"}],"value":"[:updated-at 1411322966]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":created-at","value":":created-at"},{"type":"html","content":"1394217883","value":"1394217883"}],"value":"[:created-at 1394217883]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":social-profiles","value":":social-profiles"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":type","value":":type"},{"type":"html","content":""social_profile.list"","value":"\"social_profile.list\""}],"value":"[:type \"social_profile.list\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":social-profiles","value":":social-profiles"},{"type":"list-like","open":"(","close":")","separator":" ","items":[],"value":"()"}],"value":"[:social-profiles ()]"}],"value":"{:type \"social_profile.list\", :social-profiles ()}"}],"value":"[:social-profiles {:type \"social_profile.list\", :social-profiles ()}]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":segments","value":":segments"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":type","value":":type"},{"type":"html","content":""segment.list"","value":"\"segment.list\""}],"value":"[:type \"segment.list\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":segments","value":":segments"},{"type":"list-like","open":"(","close":")","separator":" ","items":[{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":type","value":":type"},{"type":"html","content":""segment"","value":"\"segment\""}],"value":"[:type \"segment\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":id","value":":id"},{"type":"html","content":""532c94b472cdbb2586000044"","value":"\"532c94b472cdbb2586000044\""}],"value":"[:id \"532c94b472cdbb2586000044\"]"}],"value":"{:type \"segment\", :id \"532c94b472cdbb2586000044\"}"}],"value":"({:type \"segment\", :id \"532c94b472cdbb2586000044\"})"}],"value":"[:segments ({:type \"segment\", :id \"532c94b472cdbb2586000044\"})]"}],"value":"{:type \"segment.list\", :segments ({:type \"segment\", :id \"532c94b472cdbb2586000044\"})}"}],"value":"[:segments {:type \"segment.list\", :segments ({:type \"segment\", :id \"532c94b472cdbb2586000044\"})}]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":last-request-at","value":":last-request-at"},{"type":"html","content":"nil","value":"nil"}],"value":"[:last-request-at nil]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":id","value":":id"},{"type":"html","content":""531a139b93bb867153000edd"","value":"\"531a139b93bb867153000edd\""}],"value":"[:id \"531a139b93bb867153000edd\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":tags","value":":tags"},{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":type","value":":type"},{"type":"html","content":""tag.list"","value":"\"tag.list\""}],"value":"[:type \"tag.list\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":tags","value":":tags"},{"type":"list-like","open":"(","close":")","separator":" ","items":[{"type":"list-like","open":"{","close":"}","separator":", ","items":[{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":type","value":":type"},{"type":"html","content":""tag"","value":"\"tag\""}],"value":"[:type \"tag\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":id","value":":id"},{"type":"html","content":""16031"","value":"\"16031\""}],"value":"[:id \"16031\"]"},{"type":"list-like","open":"","close":"","separator":" ","items":[{"type":"html","content":":name","value":":name"},{"type":"html","content":""Starbucks"","value":"\"Starbucks\""}],"value":"[:name \"Starbucks\"]"}],"value":"{:type \"tag\", :id \"16031\", :name \"Starbucks\"}"}],"value":"({:type \"tag\", :id \"16031\", :name \"Starbucks\"})"}],"value":"[:tags ({:type \"tag\", :id \"16031\", :name \"Starbucks\"})]"}],"value":"{:type \"tag.list\", :tags ({:type \"tag\", :id \"16031\", :name \"Starbucks\"})}"}],"value":"[:tags {:type \"tag.list\", :tags ({:type \"tag\", :id \"16031\", :name \"Starbucks\"})}]"}],"value":"{:session-count 0, :unsubscribed-from-emails false, :location-data {}, :n-ptptd-convs 1, :app-id \"nb5hla8s\", :user-id \"488\", :name \"Lang Say\", :user-agent-data nil, :companies {:type \"company.list\", :companies ()}, :avatar {:type \"avatar\", :image-url nil}, :custom-attributes {:avg-n-ptpts nil, :n-owned-convs nil, :n-ptptd-convs 1, :n-owned-convs-ptptd nil, :avg-n-visitors nil}, :email \"lsay@starbucks.com\", :avg-n-ptpts 0, :n-owned-convs-ptptd 0, :type \"user\", :remote-created-at 1394217883, :avg-n-visitors 0, :n-owned-convs 0, :updated-at 1411322966, :created-at 1394217883, :social-profiles {:type \"social_profile.list\", :social-profiles ()}, :segments {:type \"segment.list\", :segments ({:type \"segment\", :id \"532c94b472cdbb2586000044\"})}, :last-request-at nil, :id \"531a139b93bb867153000edd\", :tags {:type \"tag.list\", :tags ({:type \"tag\", :id \"16031\", :name \"Starbucks\"})}}"}
+;; <=
+
+;; **
+;;; OK!
+;;; Now let's get down to business and start doing some plotting.
+;;; We'll start by creating a little helper function for carrying out the plotting for us.
+;; **
+
+;; @@
+(defn plot-attrs
+  [users x-attr y-attr & {:keys [] :as kw-args}]
+  (let [plot-args (merge {:opacity 0.3
+                          :symbol-size 20}
+                         kw-args)]
+    (apply-kwargs
+      plot/list-plot
+      (map
+        #(gets % [x-attr y-attr])
+        users)
+      plot-args)))
+
+
+(plot-attrs icusers :remote-created-at :n-owned-convs-ptptd
+            :plot-range [:all [0 20]])
+;; @@
+;; =>
+;;; {"type":"vega","content":{"axes":[{"type":"x","scale":"x"},{"type":"y","scale":"y"}],"scales":[{"name":"x","type":"linear","range":"width","zero":false,"domain":{"data":"a48f8797-a049-4649-8c9b-75fa7c246dfa","field":"data.x"}},{"name":"y","type":"linear","range":"height","nice":true,"zero":false,"domain":[0,20]}],"marks":[{"type":"symbol","from":{"data":"a48f8797-a049-4649-8c9b-75fa7c246dfa"},"properties":{"enter":{"x":{"field":"data.x","scale":"x"},"y":{"field":"data.y","scale":"y"},"fill":{"value":"steelblue"},"fillOpacity":{"value":0.3}},"update":{"shape":"circle","size":{"value":20},"stroke":{"value":"transparent"}},"hover":{"size":{"value":60},"stroke":{"value":"white"}}}}],"data":[{"name":"a48f8797-a049-4649-8c9b-75fa7c246dfa","values":[{"x":1394217883,"y":0},{"x":1394218418,"y":0},{"x":1395873111,"y":0},{"x":1396036942,"y":0},{"x":1394564928,"y":0},{"x":1395087096,"y":1},{"x":1395084025,"y":0},{"x":1395089010,"y":0},{"x":1395091899,"y":0},{"x":1395097516,"y":0},{"x":1395264371,"y":0},{"x":1395458598,"y":0},{"x":1397787856,"y":0},{"x":1397792641,"y":0},{"x":1397795847,"y":1},{"x":1397796123,"y":0},{"x":1397798536,"y":0},{"x":1397798630,"y":0},{"x":1397801313,"y":0},{"x":1397804700,"y":0},{"x":1397807335,"y":0},{"x":1397809521,"y":1},{"x":1397821495,"y":0},{"x":1397823287,"y":1},{"x":1397825374,"y":0},{"x":1397829562,"y":0},{"x":1397835950,"y":0},{"x":1397837727,"y":0},{"x":1397839368,"y":1},{"x":1397839372,"y":0},{"x":1397839744,"y":0},{"x":1397840473,"y":1},{"x":1397840724,"y":0},{"x":1397841631,"y":0},{"x":1397842334,"y":0},{"x":1397843450,"y":0},{"x":1397845450,"y":0},{"x":1397848257,"y":0},{"x":null,"y":null},{"x":1397852145,"y":0},{"x":1397852439,"y":2},{"x":1397855737,"y":0},{"x":1397856028,"y":0},{"x":1397856571,"y":0},{"x":1397864528,"y":0},{"x":1397870420,"y":0},{"x":1397871323,"y":0},{"x":1397884094,"y":0},{"x":null,"y":null},{"x":1397889490,"y":0},{"x":1397891200,"y":1},{"x":1397910368,"y":0},{"x":1397922477,"y":0},{"x":1397933896,"y":0},{"x":1397960622,"y":0},{"x":1398037285,"y":0},{"x":1398040091,"y":0},{"x":1398059379,"y":1},{"x":1398068471,"y":0},{"x":1398090313,"y":1},{"x":1398090780,"y":1},{"x":1398115496,"y":1},{"x":1398309749,"y":0},{"x":1400601833,"y":0},{"x":1401072003,"y":1},{"x":1401293202,"y":1},{"x":1401915381,"y":2},{"x":1402493664,"y":0},{"x":null,"y":null},{"x":null,"y":null},{"x":1402950134,"y":0},{"x":1402980088,"y":2},{"x":1403058868,"y":0},{"x":1403058911,"y":0},{"x":1403059077,"y":0},{"x":1403059240,"y":1},{"x":1403116362,"y":0},{"x":1403137362,"y":1},{"x":1403203529,"y":0},{"x":1403267254,"y":2},{"x":null,"y":null},{"x":1403527604,"y":0},{"x":1380495318,"y":53},{"x":1404030909,"y":1},{"x":1404202358,"y":0},{"x":1404774976,"y":0},{"x":1382028798,"y":60},{"x":1392355292,"y":2},{"x":1405011571,"y":1},{"x":1405356781,"y":1},{"x":1385416947,"y":4},{"x":1405383652,"y":5},{"x":1395095614,"y":8},{"x":1405534704,"y":1},{"x":1405721564,"y":0},{"x":1405787737,"y":2},{"x":null,"y":null},{"x":1406120891,"y":0},{"x":1406149597,"y":0},{"x":1406149889,"y":15},{"x":1406152973,"y":0},{"x":1406220380,"y":0},{"x":1406308916,"y":0},{"x":1406620624,"y":2},{"x":1398113399,"y":0},{"x":1406899048,"y":1},{"x":1406916665,"y":1},{"x":1407221921,"y":1},{"x":1407222947,"y":0},{"x":1402557967,"y":6},{"x":1407875492,"y":1},{"x":1408088823,"y":0},{"x":1408090721,"y":0},{"x":1408091561,"y":0},{"x":1408091867,"y":1},{"x":1408092683,"y":0},{"x":1408092926,"y":1},{"x":1408093916,"y":0},{"x":1408094033,"y":0},{"x":1408095113,"y":0},{"x":1408096950,"y":0},{"x":1408098010,"y":2},{"x":1408098271,"y":0},{"x":1408098370,"y":0},{"x":1408100118,"y":0},{"x":1408101244,"y":0},{"x":1408102884,"y":0},{"x":1408112694,"y":0},{"x":1408113602,"y":0},{"x":1408114216,"y":0},{"x":1408116305,"y":0},{"x":1408142844,"y":0},{"x":1408162185,"y":0},{"x":1408165869,"y":0},{"x":1408166896,"y":1},{"x":1408167330,"y":2},{"x":1408174480,"y":0},{"x":1408185398,"y":0},{"x":1408208610,"y":0},{"x":1408208885,"y":0},{"x":1408238057,"y":0},{"x":1408242514,"y":0},{"x":1408272519,"y":1},{"x":1408280251,"y":1},{"x":1408320497,"y":0},{"x":1408320778,"y":0},{"x":1402622201,"y":2},{"x":1408338407,"y":0},{"x":1408378096,"y":0},{"x":1408490683,"y":0},{"x":1392346759,"y":0},{"x":1408655060,"y":0},{"x":1408669115,"y":0},{"x":1408995793,"y":0},{"x":1409083202,"y":0},{"x":1409083935,"y":0},{"x":1409084400,"y":2},{"x":1409085357,"y":0},{"x":1409086212,"y":0},{"x":1409086302,"y":1},{"x":1409087173,"y":1},{"x":1409087711,"y":0},{"x":1409088485,"y":0},{"x":1409088962,"y":0},{"x":1409089668,"y":3},{"x":1409090107,"y":0},{"x":1409090434,"y":0},{"x":1409090562,"y":0},{"x":1409091103,"y":1},{"x":1409091187,"y":0},{"x":1409091437,"y":0},{"x":1409091447,"y":0},{"x":1409091561,"y":0},{"x":1409091748,"y":0},{"x":1409092441,"y":0},{"x":1409092490,"y":1},{"x":1409092966,"y":0},{"x":1409093590,"y":0},{"x":1409094134,"y":0},{"x":1409094366,"y":1},{"x":1409094713,"y":0},{"x":1409095166,"y":1},{"x":1409095399,"y":0},{"x":1409096757,"y":1},{"x":1409096830,"y":0},{"x":1409096833,"y":0},{"x":1409097564,"y":1},{"x":1409098313,"y":0},{"x":1409099091,"y":0},{"x":1409102519,"y":1},{"x":1409103676,"y":0},{"x":1409104454,"y":0},{"x":1409104842,"y":0},{"x":1409104981,"y":0},{"x":1409105293,"y":0},{"x":1409105461,"y":0},{"x":1409105676,"y":1},{"x":1409107107,"y":0},{"x":1409107445,"y":0},{"x":1409108731,"y":0},{"x":1409109334,"y":0},{"x":1409109697,"y":1},{"x":1409111052,"y":0},{"x":1409111545,"y":0},{"x":1409111648,"y":0},{"x":1409111692,"y":0},{"x":1409112065,"y":0},{"x":1409112192,"y":0},{"x":1409112423,"y":0},{"x":1409113365,"y":0},{"x":1409115066,"y":0},{"x":1409116488,"y":0},{"x":1409116718,"y":0},{"x":1409118157,"y":0},{"x":1409118306,"y":0},{"x":1409118616,"y":0},{"x":1409119011,"y":0},{"x":1409119192,"y":0},{"x":1409119431,"y":1},{"x":1409119605,"y":0},{"x":1409120742,"y":0},{"x":1409120784,"y":0},{"x":1409121736,"y":0},{"x":1409124099,"y":2},{"x":1409124343,"y":0},{"x":1409124592,"y":0},{"x":1409124663,"y":0},{"x":1409126268,"y":0},{"x":1409126884,"y":0},{"x":1409127079,"y":0},{"x":1409127852,"y":1},{"x":1409127857,"y":0},{"x":1409131045,"y":1},{"x":1409131653,"y":0},{"x":1409133229,"y":0},{"x":1409133621,"y":0},{"x":1409134444,"y":0},{"x":1409138329,"y":0},{"x":1409138713,"y":0},{"x":1409140516,"y":0},{"x":1409140538,"y":0},{"x":1409141613,"y":0},{"x":1409142358,"y":0},{"x":1409143127,"y":0},{"x":1409145475,"y":0},{"x":1409147469,"y":1},{"x":1409147504,"y":0},{"x":1409149224,"y":0},{"x":1409149247,"y":0},{"x":1409149251,"y":0},{"x":1409150376,"y":0},{"x":1409151934,"y":0},{"x":1409153714,"y":0},{"x":1409156024,"y":0},{"x":1409157388,"y":0},{"x":1409158667,"y":1},{"x":1409158750,"y":0},{"x":1409158839,"y":0},{"x":1409159156,"y":0},{"x":1409159435,"y":0},{"x":1409159915,"y":1},{"x":1409160398,"y":0},{"x":1409160606,"y":0},{"x":1409161478,"y":0},{"x":1409161943,"y":0},{"x":1409162716,"y":0},{"x":1409163039,"y":0},{"x":1409164670,"y":0},{"x":1409165496,"y":0},{"x":1409167317,"y":0},{"x":1409169657,"y":1},{"x":1409170271,"y":1},{"x":1409172332,"y":1},{"x":1409173254,"y":0},{"x":1409173450,"y":0},{"x":1409176914,"y":1},{"x":1409177161,"y":0},{"x":1409177700,"y":1},{"x":1409178866,"y":0},{"x":1409179254,"y":0},{"x":1409180130,"y":0},{"x":1409180660,"y":0},{"x":1409187405,"y":1},{"x":1409192043,"y":0},{"x":1409193882,"y":0},{"x":1409195283,"y":0},{"x":1409198255,"y":0},{"x":1409215423,"y":1},{"x":1409218518,"y":0},{"x":1409222421,"y":0},{"x":1409244562,"y":0},{"x":1409244815,"y":3},{"x":null,"y":null},{"x":1409358312,"y":1},{"x":1409360254,"y":0},{"x":1409439734,"y":0},{"x":1409516985,"y":1},{"x":1409639527,"y":0},{"x":1409643719,"y":0},{"x":1409672505,"y":0},{"x":1409674385,"y":1},{"x":1403378632,"y":2},{"x":1409775891,"y":0},{"x":1409785166,"y":4},{"x":1409799806,"y":0},{"x":1409812953,"y":0},{"x":1409902757,"y":0},{"x":1409937599,"y":0},{"x":1409941879,"y":1},{"x":1409955415,"y":0},{"x":1409970538,"y":0},{"x":1409973115,"y":0},{"x":1409991235,"y":0},{"x":1409994472,"y":0},{"x":1409991480,"y":0},{"x":1409994656,"y":0},{"x":1410015484,"y":0},{"x":1376790638,"y":0},{"x":1410173830,"y":1},{"x":1410223996,"y":0},{"x":1384841630,"y":0},{"x":1410335561,"y":1},{"x":1410383447,"y":0},{"x":1410489181,"y":0},{"x":1410678456,"y":0},{"x":1410882461,"y":0},{"x":1411137752,"y":1},{"x":1411147774,"y":0},{"x":1411147961,"y":0},{"x":null,"y":null},{"x":1411279707,"y":0}]}],"width":400,"height":247.2187957763672,"padding":{"bottom":20,"top":10,"right":10,"left":50}},"value":"#gorilla_repl.vega.VegaView{:content {:axes [{:type \"x\", :scale \"x\"} {:type \"y\", :scale \"y\"}], :scales [{:name \"x\", :type \"linear\", :range \"width\", :zero false, :domain {:data \"a48f8797-a049-4649-8c9b-75fa7c246dfa\", :field \"data.x\"}} {:name \"y\", :type \"linear\", :range \"height\", :nice true, :zero false, :domain [0 20]}], :marks [{:type \"symbol\", :from {:data \"a48f8797-a049-4649-8c9b-75fa7c246dfa\"}, :properties {:enter {:x {:field \"data.x\", :scale \"x\"}, :y {:field \"data.y\", :scale \"y\"}, :fill {:value \"steelblue\"}, :fillOpacity {:value 0.3}}, :update {:shape \"circle\", :size {:value 20}, :stroke {:value \"transparent\"}}, :hover {:size {:value 60}, :stroke {:value \"white\"}}}}], :data [{:name \"a48f8797-a049-4649-8c9b-75fa7c246dfa\", :values ({:x 1394217883, :y 0} {:x 1394218418, :y 0} {:x 1395873111, :y 0} {:x 1396036942, :y 0} {:x 1394564928, :y 0} {:x 1395087096, :y 1} {:x 1395084025, :y 0} {:x 1395089010, :y 0} {:x 1395091899, :y 0} {:x 1395097516, :y 0} {:x 1395264371, :y 0} {:x 1395458598, :y 0} {:x 1397787856, :y 0} {:x 1397792641, :y 0} {:x 1397795847, :y 1} {:x 1397796123, :y 0} {:x 1397798536, :y 0} {:x 1397798630, :y 0} {:x 1397801313, :y 0} {:x 1397804700, :y 0} {:x 1397807335, :y 0} {:x 1397809521, :y 1} {:x 1397821495, :y 0} {:x 1397823287, :y 1} {:x 1397825374, :y 0} {:x 1397829562, :y 0} {:x 1397835950, :y 0} {:x 1397837727, :y 0} {:x 1397839368, :y 1} {:x 1397839372, :y 0} {:x 1397839744, :y 0} {:x 1397840473, :y 1} {:x 1397840724, :y 0} {:x 1397841631, :y 0} {:x 1397842334, :y 0} {:x 1397843450, :y 0} {:x 1397845450, :y 0} {:x 1397848257, :y 0} {:x nil, :y nil} {:x 1397852145, :y 0} {:x 1397852439, :y 2} {:x 1397855737, :y 0} {:x 1397856028, :y 0} {:x 1397856571, :y 0} {:x 1397864528, :y 0} {:x 1397870420, :y 0} {:x 1397871323, :y 0} {:x 1397884094, :y 0} {:x nil, :y nil} {:x 1397889490, :y 0} {:x 1397891200, :y 1} {:x 1397910368, :y 0} {:x 1397922477, :y 0} {:x 1397933896, :y 0} {:x 1397960622, :y 0} {:x 1398037285, :y 0} {:x 1398040091, :y 0} {:x 1398059379, :y 1} {:x 1398068471, :y 0} {:x 1398090313, :y 1} {:x 1398090780, :y 1} {:x 1398115496, :y 1} {:x 1398309749, :y 0} {:x 1400601833, :y 0} {:x 1401072003, :y 1} {:x 1401293202, :y 1} {:x 1401915381, :y 2} {:x 1402493664, :y 0} {:x nil, :y nil} {:x nil, :y nil} {:x 1402950134, :y 0} {:x 1402980088, :y 2} {:x 1403058868, :y 0} {:x 1403058911, :y 0} {:x 1403059077, :y 0} {:x 1403059240, :y 1} {:x 1403116362, :y 0} {:x 1403137362, :y 1} {:x 1403203529, :y 0} {:x 1403267254, :y 2} {:x nil, :y nil} {:x 1403527604, :y 0} {:x 1380495318, :y 53} {:x 1404030909, :y 1} {:x 1404202358, :y 0} {:x 1404774976, :y 0} {:x 1382028798, :y 60} {:x 1392355292, :y 2} {:x 1405011571, :y 1} {:x 1405356781, :y 1} {:x 1385416947, :y 4} {:x 1405383652, :y 5} {:x 1395095614, :y 8} {:x 1405534704, :y 1} {:x 1405721564, :y 0} {:x 1405787737, :y 2} {:x nil, :y nil} {:x 1406120891, :y 0} {:x 1406149597, :y 0} {:x 1406149889, :y 15} {:x 1406152973, :y 0} {:x 1406220380, :y 0} {:x 1406308916, :y 0} {:x 1406620624, :y 2} {:x 1398113399, :y 0} {:x 1406899048, :y 1} {:x 1406916665, :y 1} {:x 1407221921, :y 1} {:x 1407222947, :y 0} {:x 1402557967, :y 6} {:x 1407875492, :y 1} {:x 1408088823, :y 0} {:x 1408090721, :y 0} {:x 1408091561, :y 0} {:x 1408091867, :y 1} {:x 1408092683, :y 0} {:x 1408092926, :y 1} {:x 1408093916, :y 0} {:x 1408094033, :y 0} {:x 1408095113, :y 0} {:x 1408096950, :y 0} {:x 1408098010, :y 2} {:x 1408098271, :y 0} {:x 1408098370, :y 0} {:x 1408100118, :y 0} {:x 1408101244, :y 0} {:x 1408102884, :y 0} {:x 1408112694, :y 0} {:x 1408113602, :y 0} {:x 1408114216, :y 0} {:x 1408116305, :y 0} {:x 1408142844, :y 0} {:x 1408162185, :y 0} {:x 1408165869, :y 0} {:x 1408166896, :y 1} {:x 1408167330, :y 2} {:x 1408174480, :y 0} {:x 1408185398, :y 0} {:x 1408208610, :y 0} {:x 1408208885, :y 0} {:x 1408238057, :y 0} {:x 1408242514, :y 0} {:x 1408272519, :y 1} {:x 1408280251, :y 1} {:x 1408320497, :y 0} {:x 1408320778, :y 0} {:x 1402622201, :y 2} {:x 1408338407, :y 0} {:x 1408378096, :y 0} {:x 1408490683, :y 0} {:x 1392346759, :y 0} {:x 1408655060, :y 0} {:x 1408669115, :y 0} {:x 1408995793, :y 0} {:x 1409083202, :y 0} {:x 1409083935, :y 0} {:x 1409084400, :y 2} {:x 1409085357, :y 0} {:x 1409086212, :y 0} {:x 1409086302, :y 1} {:x 1409087173, :y 1} {:x 1409087711, :y 0} {:x 1409088485, :y 0} {:x 1409088962, :y 0} {:x 1409089668, :y 3} {:x 1409090107, :y 0} {:x 1409090434, :y 0} {:x 1409090562, :y 0} {:x 1409091103, :y 1} {:x 1409091187, :y 0} {:x 1409091437, :y 0} {:x 1409091447, :y 0} {:x 1409091561, :y 0} {:x 1409091748, :y 0} {:x 1409092441, :y 0} {:x 1409092490, :y 1} {:x 1409092966, :y 0} {:x 1409093590, :y 0} {:x 1409094134, :y 0} {:x 1409094366, :y 1} {:x 1409094713, :y 0} {:x 1409095166, :y 1} {:x 1409095399, :y 0} {:x 1409096757, :y 1} {:x 1409096830, :y 0} {:x 1409096833, :y 0} {:x 1409097564, :y 1} {:x 1409098313, :y 0} {:x 1409099091, :y 0} {:x 1409102519, :y 1} {:x 1409103676, :y 0} {:x 1409104454, :y 0} {:x 1409104842, :y 0} {:x 1409104981, :y 0} {:x 1409105293, :y 0} {:x 1409105461, :y 0} {:x 1409105676, :y 1} {:x 1409107107, :y 0} {:x 1409107445, :y 0} {:x 1409108731, :y 0} {:x 1409109334, :y 0} {:x 1409109697, :y 1} {:x 1409111052, :y 0} {:x 1409111545, :y 0} {:x 1409111648, :y 0} {:x 1409111692, :y 0} {:x 1409112065, :y 0} {:x 1409112192, :y 0} {:x 1409112423, :y 0} {:x 1409113365, :y 0} {:x 1409115066, :y 0} {:x 1409116488, :y 0} {:x 1409116718, :y 0} {:x 1409118157, :y 0} {:x 1409118306, :y 0} {:x 1409118616, :y 0} {:x 1409119011, :y 0} {:x 1409119192, :y 0} {:x 1409119431, :y 1} {:x 1409119605, :y 0} {:x 1409120742, :y 0} {:x 1409120784, :y 0} {:x 1409121736, :y 0} {:x 1409124099, :y 2} {:x 1409124343, :y 0} {:x 1409124592, :y 0} {:x 1409124663, :y 0} {:x 1409126268, :y 0} {:x 1409126884, :y 0} {:x 1409127079, :y 0} {:x 1409127852, :y 1} {:x 1409127857, :y 0} {:x 1409131045, :y 1} {:x 1409131653, :y 0} {:x 1409133229, :y 0} {:x 1409133621, :y 0} {:x 1409134444, :y 0} {:x 1409138329, :y 0} {:x 1409138713, :y 0} {:x 1409140516, :y 0} {:x 1409140538, :y 0} {:x 1409141613, :y 0} {:x 1409142358, :y 0} {:x 1409143127, :y 0} {:x 1409145475, :y 0} {:x 1409147469, :y 1} {:x 1409147504, :y 0} {:x 1409149224, :y 0} {:x 1409149247, :y 0} {:x 1409149251, :y 0} {:x 1409150376, :y 0} {:x 1409151934, :y 0} {:x 1409153714, :y 0} {:x 1409156024, :y 0} {:x 1409157388, :y 0} {:x 1409158667, :y 1} {:x 1409158750, :y 0} {:x 1409158839, :y 0} {:x 1409159156, :y 0} {:x 1409159435, :y 0} {:x 1409159915, :y 1} {:x 1409160398, :y 0} {:x 1409160606, :y 0} {:x 1409161478, :y 0} {:x 1409161943, :y 0} {:x 1409162716, :y 0} {:x 1409163039, :y 0} {:x 1409164670, :y 0} {:x 1409165496, :y 0} {:x 1409167317, :y 0} {:x 1409169657, :y 1} {:x 1409170271, :y 1} {:x 1409172332, :y 1} {:x 1409173254, :y 0} {:x 1409173450, :y 0} {:x 1409176914, :y 1} {:x 1409177161, :y 0} {:x 1409177700, :y 1} {:x 1409178866, :y 0} {:x 1409179254, :y 0} {:x 1409180130, :y 0} {:x 1409180660, :y 0} {:x 1409187405, :y 1} {:x 1409192043, :y 0} {:x 1409193882, :y 0} {:x 1409195283, :y 0} {:x 1409198255, :y 0} {:x 1409215423, :y 1} {:x 1409218518, :y 0} {:x 1409222421, :y 0} {:x 1409244562, :y 0} {:x 1409244815, :y 3} {:x nil, :y nil} {:x 1409358312, :y 1} {:x 1409360254, :y 0} {:x 1409439734, :y 0} {:x 1409516985, :y 1} {:x 1409639527, :y 0} {:x 1409643719, :y 0} {:x 1409672505, :y 0} {:x 1409674385, :y 1} {:x 1403378632, :y 2} {:x 1409775891, :y 0} {:x 1409785166, :y 4} {:x 1409799806, :y 0} {:x 1409812953, :y 0} {:x 1409902757, :y 0} {:x 1409937599, :y 0} {:x 1409941879, :y 1} {:x 1409955415, :y 0} {:x 1409970538, :y 0} {:x 1409973115, :y 0} {:x 1409991235, :y 0} {:x 1409994472, :y 0} {:x 1409991480, :y 0} {:x 1409994656, :y 0} {:x 1410015484, :y 0} {:x 1376790638, :y 0} {:x 1410173830, :y 1} {:x 1410223996, :y 0} {:x 1384841630, :y 0} {:x 1410335561, :y 1} {:x 1410383447, :y 0} {:x 1410489181, :y 0} {:x 1410678456, :y 0} {:x 1410882461, :y 0} {:x 1411137752, :y 1} {:x 1411147774, :y 0} {:x 1411147961, :y 0} {:x nil, :y nil} {:x 1411279707, :y 0})}], :width 400, :height 247.2188, :padding {:bottom 20, :top 10, :right 10, :left 50}}}"}
+;; <=
+
+;; @@
+(doseq [u (take 20 icusers)]
+  (println (:social-profiles u)))
+;; @@
+;; ->
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name LinkedIn, :id nil, :username nil, :url https://www.linkedin.com/in/scottaklein})}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name Picasa, :id nil, :username gabbyarens, :url http://picasaweb.google.com/gabbyarens} {:type social_profile, :name Google Plus, :id 100636434306040192022, :username nil, :url https://plus.google.com/100636434306040192022} {:type social_profile, :name Twitter, :id 921729937, :username GabbyArens, :url http://www.twitter.com/GabbyArens})}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name LinkedIn, :id nil, :username nil, :url https://www.linkedin.com/pub/charlie-moore/1/393/116})}
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name Twitter, :id 557452601, :username EmilyLinnDB, :url http://www.twitter.com/EmilyLinnDB} {:type social_profile, :name Facebook, :id 1081980082, :username nil, :url http://facebook.com/1081980082} {:type social_profile, :name Foursquare, :id 21048900, :username nil, :url https://www.foursquare.com/user/21048900} {:type social_profile, :name Klout, :id 103864274393249428, :username EmilyLinnDB, :url http://www.klout.com/user/EmilyLinnDB})}
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name Facebook, :id 559080603, :username freddymarr, :url http://www.facebook.com/freddymarr} {:type social_profile, :name Twitter, :id 262206426, :username Freddymarr, :url http://www.twitter.com/Freddymarr})}
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name Facebook, :id 100001829575037, :username thegeslist, :url https://www.facebook.com/thegeslist} {:type social_profile, :name Foursquare, :id 45326352, :username nil, :url https://www.foursquare.com/user/45326352} {:type social_profile, :name Angel List, :id 173081, :username gary-shaffer, :url https://angel.co/gary-shaffer} {:type social_profile, :name Twitter, :id 819843234, :username gary_gshafe, :url http://www.twitter.com/gary_gshafe})}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name Klout, :id 96264453496773619, :username MrSeanBoyer, :url http://www.klout.com/user/MrSeanBoyer} {:type social_profile, :name Facebook, :id 1525133394, :username sean.boyer.984, :url https://www.facebook.com/sean.boyer.984} {:type social_profile, :name Twitter, :id 425197589, :username MrSeanBoyer, :url http://www.twitter.com/MrSeanBoyer})}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name GooglePlus, :id 102414418410649820029, :username nil, :url https://plus.google.com/102414418410649820029} {:type social_profile, :name AngelList, :id 292514, :username robert-7, :url https://angel.co/robert-7} {:type social_profile, :name GoogleProfile, :id 102414418410649820029, :username nil, :url https://profiles.google.com/102414418410649820029/buzz} {:type social_profile, :name Picasa, :id nil, :username nil, :url http://picasaweb.google.com/robert.d.vaillancourt} {:type social_profile, :name Flickr, :id 55791946@N07, :username eastsideallstars, :url https://www.flickr.com/people/55791946@N07} {:type social_profile, :name LinkedIn, :id nil, :username nil, :url https://www.linkedin.com/pub/robert-vaillancourt/48/5b6/128})}
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name Angel List, :id 106848, :username scott-9, :url https://angel.co/scott-9})}
+;;; {:type social_profile.list, :social-profiles ()}
+;;; {:type social_profile.list, :social-profiles ({:type social_profile, :name Facebook, :id 1226336823, :username sanjeevmrao, :url https://www.facebook.com/sanjeevmrao} {:type social_profile, :name Google Plus, :id 107735257003690698545, :username nil, :url https://plus.google.com/107735257003690698545} {:type social_profile, :name Angel List, :id 81125, :username sanjeev-rao-1, :url https://angel.co/sanjeev-rao-1} {:type social_profile, :name Gravatar, :id 34820475, :username techexecconsulting, :url http://gravatar.com/techexecconsulting} {:type social_profile, :name Twitter, :id 62592620, :username sanjeev_rao, :url http://www.twitter.com/sanjeev_rao})}
+;;;
+;; <-
+;; =>
+;;; {"type":"html","content":"nil","value":"nil"}
+;; <=
+
+;; **
+;;; OK!
+;;; This is looking great!
+;;; Now we need to go back through here and peice together something that interleavs the social data.
+;;; But we're getting close!
+;; **
+
+;; @@
+
+;; @@


Initial version of SQSService

Initial version of SQSService

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

--- src/eulalie/sqs.clj
+++ src/eulalie/sqs.clj
@@ -0,0 +1,57 @@
+(ns eulalie.sqs
+  (:require [eulalie]
+            [eulalie.util.xml   :as x]
+            [eulalie.util.query :as q]
+            [eulalie.service-util :as service-util]
+            [eulalie.sign :as sign]
+
+            [cemerick.url :as url]))
+
+(def target->seq-spec
+  {:add-permission
+   {:accounts [:list "AWSAccountId"]
+    :actions  [:list "ActionName" #{:camel}]}
+   :change-message-visibility-batch
+   {:entries [:list "ChangeMessageVisibilityBatchRequestEntry"]}
+   :create-queue
+   {:attrs   [:kv   "Attribute" "Name" "Value" #{:camel}]}
+   :delete-message-batch
+   {:entries [:map  "DeleteMessageBatchRequestEntry"]}
+   :get-queue-attributes
+   {:attrs   [:list "AttributeName" #{:camel}]}})
+
+(defmulti  prepare-body (fn [target req] target))
+(defmethod prepare-body :default [_ req] req)
+
+(defmethod prepare-body :receive-message [_ {:keys [meta attrs] :as body}]
+                                        ;; ...
+  )
+
+(defrecord SQSService [endpoint version max-retries]
+  eulalie/AmazonWebService
+
+  (prepare-request [service {:keys [target] :as req}]
+    (-> service
+        (q/prepare-query-request req)
+        (update-in [:body] (partial prepare-body target))))
+
+  (transform-request [_ body]
+    (-> body q/format-query-request url/map->query))
+
+  (transform-response [_ resp]
+    (x/string->xml-map resp))
+
+  (transform-response-error [_ {:keys [body] :as resp}]
+    (x/parse-xml-error body))
+
+  (request-backoff [_ retry-count error]
+    (service-util/default-retry-backoff retry-count error))
+
+  (sign-request [_ req]
+    (sign/aws4-sign "sns" req)))
+
+(def service
+  (SQSService.
+   (url/url "https://sqs.us-east-1.amazonaws.com")
+   "2012-11-05"
+   3))