Require cljs.compiler to fix JSValue emit-constant exception

--- src/sablono/compiler.clj
+++ src/sablono/compiler.clj
@@ -1,6 +1,10 @@
 (ns sablono.compiler
-  (:require [cljs.tagged_literals]
+  (:require [cljs.compiler :as cljs]
             [sablono.util :refer :all])
+  ;; TODO: Fix emit-constant exception for JSValue.
+  ;; Require of cljs.tagged_literals causes trouble, but a require of
+  ;; cljs.compiler seems to work. Also, switching JSValue to a record
+  ;; in ClojureScript seems to fix the problem.
   (:import cljs.tagged_literals.JSValue))

 (defprotocol ICompile


Removed debug code from session

Removed debug code from session

--- src/compojure/http/session.clj
+++ src/compojure/http/session.clj
@@ -68,14 +68,10 @@

 (defmethod read-session :memory
   [id]
-  (print "READ: ")
-  (prn (@memory-sessions id))
   (@memory-sessions id))

 (defmethod write-session :memory
   [session]
-  (print "WRITE: ")
-  (prn session)
   (dosync
     (alter memory-sessions
       assoc (session :id) session)))


Always println

Always println

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


Adds a test for streaming joins.

Adds a test for streaming joins.

error: pathspec 'test/onyx/peer/join_test.clj' did not match any file(s) known to git

--- test/onyx/peer/join_test.clj
+++ test/onyx/peer/join_test.clj
@@ -0,0 +1,145 @@
+(ns onyx.peer.join-test
+  (:require [midje.sweet :refer :all]
+            [onyx.queue.hornetq-utils :as hq-util]
+            [onyx.peer.task-lifecycle-extensions :as l-ext]
+            [onyx.api]))
+
+(def config (read-string (slurp (clojure.java.io/resource "test-config.edn"))))
+
+(def batch-size 2)
+
+(def echo 1)
+
+(def id (str (java.util.UUID/randomUUID)))
+
+(def name-queue (str (java.util.UUID/randomUUID)))
+
+(def age-queue (str (java.util.UUID/randomUUID)))
+
+(def out-queue (str (java.util.UUID/randomUUID)))
+
+(def hq-config {"host" (:host (:non-clustered (:hornetq config)))
+                "port" (:port (:non-clustered (:hornetq config)))})
+
+(def coord-opts
+  {:hornetq/mode :udp
+   :hornetq/server? true
+   :hornetq.udp/cluster-name (:cluster-name (:hornetq config))
+   :hornetq.udp/group-address (:group-address (:hornetq config))
+   :hornetq.udp/group-port (:group-port (:hornetq config))
+   :hornetq.udp/refresh-timeout (:refresh-timeout (:hornetq config))
+   :hornetq.udp/discovery-timeout (:discovery-timeout (:hornetq config))
+   :hornetq.server/type :embedded
+   :hornetq.embedded/config (:configs (:hornetq config))
+   :zookeeper/address (:address (:zookeeper config))
+   :zookeeper/server? true
+   :zookeeper.server/port (:spawn-port (:zookeeper config))
+   :onyx/id id
+   :onyx.coordinator/revoke-delay 5000})
+
+(def peer-opts
+  {:hornetq/mode :udp
+   :hornetq.udp/cluster-name (:cluster-name (:hornetq config))
+   :hornetq.udp/group-address (:group-address (:hornetq config))
+   :hornetq.udp/group-port (:group-port (:hornetq config))
+   :hornetq.udp/refresh-timeout (:refresh-timeout (:hornetq config))
+   :hornetq.udp/discovery-timeout (:discovery-timeout (:hornetq config))
+   :zookeeper/address (:address (:zookeeper config))
+   :onyx/id id})
+
+(def conn (onyx.api/connect :memory coord-opts))
+
+(hq-util/create-queue! hq-config name-queue)
+
+(hq-util/create-queue! hq-config age-queue)
+
+(hq-util/create-queue! hq-config out-queue)
+
+(def people
+  [{:id 1 :name "Mike" :age 23}
+   {:id 2 :name "Dorrene" :age 24}
+   {:id 3 :name "Benti" :age 23}
+   {:id 4 :name "John" :age 19}
+   {:id 5 :name "Shannon" :age 31}
+   {:id 6 :name "Kristen" :age 25}])
+
+(def names (map #(select-keys % [:id :name]) people))
+
+(def ages (map #(select-keys % [:id :age]) people))
+
+(hq-util/write-and-cap! hq-config name-queue names 1)
+
+(hq-util/write-and-cap! hq-config age-queue ages 1)
+
+(defn join-person [local-state segment]
+  (let [state @local-state]
+    (if-let [record (get state (:id segment))]
+      (let [result (merge record segment)]
+        (swap! local-state dissoc (:id segment))
+        result)
+      (do (swap! local-state assoc (:id segment) (dissoc segment :id))
+          []))))
+
+(def catalog
+  [{:onyx/name :names
+    :onyx/ident :hornetq/read-segments
+    :onyx/type :input
+    :onyx/medium :hornetq
+    :onyx/consumption :concurrent
+    :hornetq/queue-name name-queue
+    :hornetq/host (:host (:non-clustered (:hornetq config)))
+    :hornetq/port (:port (:non-clustered (:hornetq config)))
+    :onyx/batch-size batch-size}
+
+   {:onyx/name :ages
+    :onyx/ident :hornetq/read-segments
+    :onyx/type :input
+    :onyx/medium :hornetq
+    :onyx/consumption :concurrent
+    :hornetq/queue-name age-queue
+    :hornetq/host (:host (:non-clustered (:hornetq config)))
+    :hornetq/port (:port (:non-clustered (:hornetq config)))
+    :onyx/batch-size batch-size}
+
+   {:onyx/name :join-person
+    :onyx/fn :onyx.peer.join-test/join-person
+    :onyx/type :transformer
+    :onyx/consumption :sequential
+    :onyx/batch-size batch-size}
+
+   {:onyx/name :out
+    :onyx/ident :hornetq/write-segments
+    :onyx/type :output
+    :onyx/medium :hornetq
+    :onyx/consumption :concurrent
+    :hornetq/queue-name out-queue
+    :hornetq/host (:host (:non-clustered (:hornetq config)))
+    :hornetq/port (:port (:non-clustered (:hornetq config)))
+    :onyx/batch-size batch-size}])
+
+(def workflow
+  [[:names :join-person]
+   [:ages :join-person]
+   [:join-person :out]])
+
+(defmethod l-ext/inject-lifecycle-resources :join-person
+  [_ event]
+  {:onyx.core/params [(atom {})]})
+
+(def v-peers (onyx.api/start-peers conn 1 peer-opts))
+
+(onyx.api/submit-job conn {:catalog catalog :workflow workflow})
+
+(def results (hq-util/consume-queue! hq-config out-queue echo))
+
+(doseq [v-peer v-peers]
+  (try
+    ((:shutdown-fn v-peer))
+    (catch Exception e (prn e))))
+
+(try
+  (onyx.api/shutdown conn)
+  (catch Exception e (prn e)))
+
+(fact (into #{} (butlast results)) => (into #{} people))
+


Add support for Aerobio map file generation from streaming SAM

error: pathspec 'services/tnseq-phase1.clj' did not match any file(s) known to git

--- services/tnseq-phase1.clj
+++ services/tnseq-phase1.clj
@@ -0,0 +1,37 @@
+
+{
+ :name "tnseq-phase1",
+ :path  "",
+
+ :graph {:bt1 {:type "tool"
+               :path "bowtie2"
+               :args ["-p" "16" "--very-sensitive" "-x" "#1" "-U" "#2"]
+               }
+         :bt2 {:type "tool"
+               :path "bowtie2"
+               :args ["-f" "-N" "1" "--reorder"
+                      "--no-unal" "--no-head"
+                      "-p" "8"
+                      "-x" "#1" "-U" "#3"]
+               }
+         :mmap {:type "func"
+                :name "make-maps"
+                :args ["#4"]}
+         :st1 {:type :tool
+               :path "samtools"
+               :args ["view" "-b"]}
+         :st2 {:type :tool
+               :path "samtools"
+               :args ["sort" "--threads" "8"]}
+         :st3 {:type :tool
+               :path "samtools"
+               :args ["index" "-" "#6"]}
+         :cl1 {:type "func"
+               :name "write-bam"
+               :args ["#5"]}
+         :edges {:bt2 [:mmap]
+                 :bt1 [:st1] :st1 [:st2] :st2 [:cl1 :st3]}}
+
+ ;; instructional data used in /help
+ :description "Process collapsed fastas from bowtie alignment, to bam conversion and map file making, to bam sort, to bam indexing, to bam write - all via streaming connections."
+ }


DB spec

DB spec

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

--- src/arachnida/db_spec.clj
+++ src/arachnida/db_spec.clj
@@ -0,0 +1,9 @@
+(ns arachnida.db-spec
+    "Namespace that contains configuration of all JDBC sources.")
+
+(def data-db
+    {:classname   "org.sqlite.JDBC"
+     :subprotocol "sqlite"
+     :subname     "data.db"
+    })
+


Updated scRNA gene type assertion rule to work with ccp ext ontology

error: pathspec 'resources/rules/post_identifier_merge/ice_to_bio/scrna_gene_type_assertions.clj' did not match any file(s) known to git

--- resources/rules/post_identifier_merge/ice_to_bio/scrna_gene_type_assertions.clj
+++ resources/rules/post_identifier_merge/ice_to_bio/scrna_gene_type_assertions.clj
@@ -0,0 +1,21 @@
+;; ---------------------------------------------
+;; --------- scRNA Gene Type Assertion ---------
+;; ---------------------------------------------
+ `{:name "scrna-gene-type-assertion"
+   :description "This rule asserts scRNA gene type"
+   :head ((?/gene rdfs/subClassOf obo/S0_0000013)) ; SO:scRNA
+
+   :body ((?/record rdf/type ccp/IAO_EXT_0000681) ; ccp:NCBI_gene_info_record
+         (?/record obo/BFO_0000051 ?/dna_field_value) ; BFO:has_part
+         (?/gene_field_value rdf/type ccp/IAO_EXT_0000876) ; ccp:NCBI_gene_info_record__gene_identifier_field_value
+         (?/gene_field_value rdf/type ?/gene_ice_id)
+         (?/gene_ice_id obo/IAO_0000219 ?/gene) ; IAO:denotes
+
+         ;; retrieve gene type
+         (?/record obo/BFO_0000051 ?/type_field_value) ; BFO:has_part
+         (?/type_field_value rdf/type ccp/IAO_EXT_0000884) ; ccp:NCBI_gene_info_record__type_of_gene_field_value
+         (?/type_field_value rdf/type ?/type_ice_id)
+         (?/type_ice_id obo/IAO_0000219 ?/type) ; IAO:denotes
+
+         (= ?/type "scRNA"))
+   }


Add tools in Leiningen user profile

Add tools in Leiningen user profile

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


cleanup figwheel configuration

cleanup figwheel configuration

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/wilkerlucio/youtube-looper.git/'


Small renaming

Small renaming

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


Add chapter 4 stubs.

Add chapter 4 stubs.

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

--- src/little_clojurer/chapter4.clj
+++ src/little_clojurer/chapter4.clj
@@ -0,0 +1,43 @@
+(ns little-clojurer.chapter4
+  (:require [little-clojurer.chapter3 :refer :all]))
+
+(defn addtup
+  "Sum all numbers in a list, return total."
+  [tup]
+  nil)
+
+
+(defn tup+
+  "Takes two tuples of the same length, return a new tuple with the same length where each item is the sum of two items from the original tuples with the same index."
+  [tup1 tup2]
+  nil)
+
+
+(defn pick
+  "Return item in the given index of given table."
+  [index l]
+  nil)
+
+
+(defn rempick
+  "Return list with item in the given index removed."
+  [index l]
+  nil)
+
+
+(defn no-nums
+  "Return l with all numbers removed."
+  [l]
+  nil)
+
+
+(defn all-nums
+  "Return l with all non-numbers removed."
+  [l]
+  nil)
+
+
+(defn occur
+  "Return the number of times given item occurs in given list."
+  [item l]
+  nil)


Fixes #11 while still letting people know where to import lifecycles/functions, but also allows referesh while in dev mode

error: pathspec 'resources/leiningen/new/onyx_app/launch_prod_peers_bare.clj' did not match any file(s) known to git

--- resources/leiningen/new/onyx_app/launch_prod_peers_bare.clj
+++ resources/leiningen/new/onyx_app/launch_prod_peers_bare.clj
@@ -0,0 +1,22 @@
+(ns {{app-name}}.launcher.launch-prod-peers
+    (:require [clojure.core.async :refer [chan <!!]]
+              [clojure.java.io :refer [resource]]
+;             [{{app-name}}.lifecycles.lifecycle]
+;             [{{app-name}}.functions.functions]
+              [onyx.plugin.core-async]
+              [onyx.api]))
+
+(defn -main [onyx-id n & args]
+  (let [n-peers (Integer/parseInt n)
+        peer-config (assoc (-> "prod-peer-config.edn"
+                               resource slurp read-string) :onyx/id onyx-id)
+        peer-group (onyx.api/start-peer-group peer-config)
+        peers (onyx.api/start-peers n-peers peer-group)]
+    (.addShutdownHook (Runtime/getRuntime)
+                      (Thread.
+                       (fn []
+                         (doseq [v-peer peers]
+                           (onyx.api/shutdown-peer v-peer))
+                         (onyx.api/shutdown-peer-group peer-group))))
+    ;; Block forever.
+    (<!! (chan))))


Format dates

Format dates

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


Bit more cleanup

Bit more cleanup


skeleton for kafka factstore

skeleton for kafka factstore

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

--- sample/src/sample/impl/kafka.clj
+++ sample/src/sample/impl/kafka.clj
@@ -0,0 +1,31 @@
+(ns sample.impl.kafka
+  (:require [clj-karabiner.tree :as t]
+            [clj-karabiner.tree.bplustree :as bt]
+
+            [sample.factstore :as fs]
+            [sample.pubsub :as ps]))
+
+
+(defrecord KafkaFactStore []
+
+  fs/FactStoreWriter
+
+  (assert* [this fs]
+    )
+
+  fs/FactStoreReader
+
+  (get-tail [this start]
+    )
+
+  ps/Publisher
+
+  (subscribe [this subscriber]
+    )
+
+  (unsubscribe [this subscriber]
+    ))
+
+
+(defn kafka-factstore []
+  (->KafkaFactStore))


APIarekin eragiketa batzuk burutu

APIarekin eragiketa batzuk burutu

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


Add brute-force search engine sketch.

Add brute-force search engine sketch.

error: pathspec 'src/vault/index/engine/brute.clj' did not match any file(s) known to git

--- src/vault/index/engine/brute.clj
+++ src/vault/index/engine/brute.clj
@@ -0,0 +1,27 @@
+(ns vault.index.engine.brute
+  (:require
+    [vault.blob.core :as blob]
+    [vault.index.search :as search]))
+
+
+(defrecord BruteIndex [blob-store projection])
+
+(extend-type BruteIndex
+  search/Engine
+
+  (search
+    [this pattern opts]
+    (filter (partial search/matches? pattern)
+            (mapcat projection
+                    (blob/list (:blob-store this)))))
+
+  (update!
+    [this record]
+    ; It's not clear that this maps well to a brute-force search engine.
+    ; TODO: figure out better semantics here.
+    nil))
+
+
+(defn brute-index
+  [blob-store projection]
+  (BruteIndex. blob-store projection))


remove rf-hasmeta (alread commented out)

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


Removing unused crypt libraries

Removing unused crypt libraries

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/xcthulhu/clj-bitauth.git/'


indentation

indentation

--- sidecar/src/figwheel_sidecar/config.clj
+++ sidecar/src/figwheel_sidecar/config.clj
@@ -125,9 +125,9 @@

 (defn fix-build-options [build-options]
   (->> build-options
-       (apply-to-key normalize-dir :output-dir)
-       (apply-to-key name :main)
-       (apply-to-key name :id)))
+    (apply-to-key normalize-dir :output-dir)
+    (apply-to-key name :main)
+    (apply-to-key name :id)))

 (defn fix-build [opts]
   (update-in opts [(if (:build-options opts) :build-options :compiler)] fix-build-options))


replace confirmation popover for archiving and move active icon to left of list

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


adjust comment per Ben's suggesting in last PR which I failed to respond to


[WM] send updated notifications right away

They are missing required elements for scheduling by the time they get
back to the update handler.


fix bug on googlesearch opening 2 windows per search

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/cneira/googlesearch.git/'


added tests

added tests

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


Clearer name.

Clearer name.

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


Send :membership

Send :membership

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


Diagnosing a failing test on CI

Diagnosing a failing test on CI

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


Add namespace for state

Add namespace for state

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

--- src/cljs/gtfve/state.cljs
+++ src/cljs/gtfve/state.cljs
@@ -0,0 +1,5 @@
+(ns gtfve.state)
+
+(defn initial-state []
+  :error-message nil
+  :environment :development)


Require render namespace.

Require render namespace.

--- src/sablono/core.cljx
+++ src/sablono/core.cljx
@@ -3,6 +3,7 @@
   (:require [clojure.string :refer [replace upper-case]]
             [clojure.walk :refer [postwalk-replace]]
             [sablono.util :refer [as-str to-uri]]
+            [sablono.render :as render]
             #+clj [sablono.compiler :as compiler])
   #+cljs (:require-macros [sablono.core :refer [defelem]]))


Send to zendesk if start/stop service call doesn't respond.

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


Add configuration processing

Add configuration processing

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

--- src/eventstore/config.clj
+++ src/eventstore/config.clj
@@ -0,0 +1,12 @@
+(ns eventstore.config)
+
+(defn load-props
+  "Receives a path and loads the Java properties for the file represented by the path inside the classpath (typically, a resource)."
+  [file-name]
+  (with-open [^java.io.Reader reader (clojure.java.io/reader (clojure.java.io/resource file-name))]
+    (let [props (java.util.Properties.)]
+      (.load props reader)
+      (into {} (for [[k v] props] [(keyword k) (read-string v)])))))
+
+(def config (load-props "config.properties"))
+


combine lines

combine lines


simplify -cached-rf impl for Volatile

simplify -cached-rf impl for Volatile


-reset! impls for Atom,Volatile

-reset! impls for Atom,Volatile


declarations and "pre defs" at the start of the Main API section


Creates pattern_recognition.clj.

Creates pattern_recognition.clj.

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

--- src/cadence/pattern_recognition.clj
+++ src/cadence/pattern_recognition.clj
@@ -0,0 +1,29 @@
+(ns cadence.pattern-recognition
+  (:require [cadence.model :as model]
+            [noir.session :as sess]
+            [cadence.model.validators :as is-valid])
+  (:use noir.core
+        clojure.walk))
+
+(def training-min (atom 6))
+
+(defn pick-cadences
+  "Returns a modfied version of cads which may or may not include ncad depending on its smilarity to them."
+  [session ncad]
+  ; TODO Actually make a desciion here instead of always conjoining.
+  (let [trcads-key "training-cadences"
+        cads (get session trcads-key)]
+    (assoc session trcads-key (if (nil? cads)
+                                        #{ncad}
+                                        (conj cads ncad)))))
+
+(defn keep-cadence
+  "Modifies temporary storage of cadences either adding the new cadence, removing an old one, or neither."
+  [cadence]
+  (let [trcads (sess/get :training-cadences false)]
+    (when-not trcads (sess/put! :training-cadences #{}))
+    (sess/swap! pick-cadences cadence)))
+
+(defn kept-cadences
+  "A helper function to get the set of training from the session."
+  [] (sess/get :training-cadences #{}))


remove vesigial file in clj source dir

remove vesigial file in clj source dir

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/QuiltProject/sedan.git/'


4clojure:: the big-divide -> reasonable nums works fine -> huge nums blows with OOM

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

--- src/clojure_learning/big_divide.clj
+++ src/clojure_learning/big_divide.clj
@@ -0,0 +1,37 @@
+;;;;;;;;;;;;;;;;;
+;; The Big Divide
+;; Difficulty:	Medium
+;; Topics:	math
+;; Write a function which calculates the sum of all natural numbers under n (first argument) which are evenly
+;; divisible by at least one of a and b
+;; Note: Some test cases have a very large n, so the most obvious solution will exceed the time limit.
+(ns clojure_learning.big-divide
+    (use [clojure.repl])
+    (import [clojure.test]))
+
+(defn find-sum-of-nums-div-with
+  [until-num or-div-x or-div-y]
+  (apply +
+      (reduce
+        (fn [acc x]
+          (if (or (zero? (rem x or-div-x)) (zero? (rem x or-div-y)))
+            (conj acc x)
+            acc))
+        [] (range 0 until-num))))
+
+;; wtf?! that was easy :)
+(find-sum-of-nums-div-with 1000 3 5) ;; 233168
+
+;; while this takes a huge time to process! -> implement the lazy version!!!
+;; (find-sum-nums-div-with 100000000 3 5)
+
+(defn find-sum-of-nums-div-with
+  [until-num or-div-x or-div-y]
+    (letfn [(find-divisibles-from [curr bound step]
+              (lazy-seq
+                (when-not (> curr bound)
+                  (cons curr (find-divisibles-from (+ curr step) bound step)))))]
+      (find-divisibles-from 0 until-num or-div-x)
+      ))
+
+(find-sum-of-nums-div-with 100000000 3 5)


Making my own directory for the stateful apps

error: pathspec 'src/main/clj/clojure_club/stateful_apps/wmatson/core.clj' did not match any file(s) known to git

--- src/main/clj/clojure_club/stateful_apps/wmatson/core.clj
+++ src/main/clj/clojure_club/stateful_apps/wmatson/core.clj
@@ -0,0 +1,2 @@
+(ns main.clj.clojure-club.stateful-apps.wmatson.core)
+


args/? -> wrapped/?

args/? -> wrapped/?


Update core.cljs

Update core.cljs

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/parenode/clojure-cup-2015.git/'


experimenting w/ caches

experimenting w/ caches


cosmetic

cosmetic

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/kenichirow/recipes.git/'


Don't try to split a nil query

Don't try to split a nil query

--- src/clojars/web/search.clj
+++ src/clojars/web/search.clj
@@ -89,12 +89,13 @@
   (html-doc (str query " - search - page " page) {:account account :query query :description (format "Clojars search results page %d for '%s'" page query)}
     [:div.light-article.row
      [:h1 (format "Search for '%s'" query)]
-     (when-let [mvn-tuple (on-maven-central query)]
-       (flash "Given your search terms, you may also want to "
-              (link-to (apply maven-search-link mvn-tuple) "search Maven Central")
-              "."
-              [:br]
-              [:small "org.clojure artifacts are distributed via Maven Central instead of Clojars."]))
+     (when query
+       (when-let [mvn-tuple (on-maven-central query)]
+         (flash "Given your search terms, you may also want to "
+           (link-to (apply maven-search-link mvn-tuple) "search Maven Central")
+           "."
+           [:br]
+           [:small "org.clojure artifacts are distributed via Maven Central instead of Clojars."])))
      [:p.search-query-syntax "For details on the search query syntax, see the "
       (link-to "http://github.com/clojars/clojars-web/wiki/Search-Query-Syntax" "guide")
       "."]


Placeholder for widening domains of Clojure.core functions

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

--- src/such/wider_domains.clj
+++ src/such/wider_domains.clj
@@ -0,0 +1 @@
+(ns such.wider-domains)


don't test email connection on unit tests.

--- src/metabase/api/email.clj
+++ src/metabase/api/email.clj
@@ -1,11 +1,12 @@
 (ns metabase.api.email
   "/api/email endpoints"
   (:require [clojure.tools.logging :as log]
+            [clojure.set :as set]
             [compojure.core :refer [GET PUT DELETE POST]]
             [metabase.api.common :refer :all]
+            [metabase.config :as config]
             [metabase.email :as email]
-            [metabase.models.setting :as setting]
-            [clojure.set :as set]))
+            [metabase.models.setting :as setting]))

 (defonce ^:private ^:const mb-to-smtp-settings
   {:email-smtp-host     :host
@@ -57,8 +58,11 @@
   (let [email-settings (select-keys settings (keys mb-to-smtp-settings))
         smtp-settings  (-> (set/rename-keys email-settings mb-to-smtp-settings)
                            (assoc :port (Integer/parseInt (:email-smtp-port settings))))
-        response       (email/test-smtp-connection smtp-settings)]
-    (clojure.pprint/pprint response)
+        response       (if-not (config/is-test?)
+                         ;; in normal conditions, validate connection
+                         (email/test-smtp-connection smtp-settings)
+                         ;; for unit testing just respond with a success message
+                         {:error :SUCCESS})]
     (if (= :SUCCESS (:error response))
       ;; test was good, save our settings
       (setting/set-all email-settings)


Begin on alias reduction (check for cycles).

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

--- src/smallex/reductions.clj
+++ src/smallex/reductions.clj
@@ -0,0 +1,19 @@
+(ns smallex.reductions
+  (:require [clojure.walk :as walk]))
+
+(defn- find-alias-deps
+  "Returns a set of alias deps, given an expression."
+  [expr]
+  (case (:type expr)
+    (:string :char-set) #{}
+    :symbol #{(:value expr)}
+    :op (set (mapcat find-alias-deps (:args expr)))))
+
+(defn check-cyclic-aliases
+  "Given a grammar, returns an error if there is a cyclic alias. Returns nil if
+  the aliases aren't cyclic."
+  [grammar]
+  (let [alias-deps (into {} (for [[k v] (:aliases grammar)]
+                              [k (find-alias-deps v)]))]
+    ;; TODO: Topological sort here.
+    ))


Konexioa pasa

Konexioa pasa

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


add sprite functions

add sprite functions

error: pathspec 'src/cljs/infinitelives/pixi/sprite.cljs' did not match any file(s) known to git

--- src/cljs/infinitelives/pixi/sprite.cljs
+++ src/cljs/infinitelives/pixi/sprite.cljs
@@ -0,0 +1,38 @@
+(ns infinitelives.pixi.sprite
+  (:require [PIXI]
+            )
+)
+
+(defn make-point
+  "Make a PIXI Point from x and y"
+  [x y]
+  (PIXI/Point. x y))
+
+(defn make-sprite
+  "construct a sprite by its texture. optionally pass in other things"
+  [texture & {:keys [x y xhandle yhandle]
+              :or {x 0 y 0 xhandle 0.5 yhandle 0.5}}]
+  (let [s (PIXI/Sprite. texture)]
+    (set! (.-anchor s) (make-point xhandle yhandle))
+    (set! (.-x s) x)
+    (set! (.-y s) y)
+    s))
+
+(defn set-pos!
+  ([sprite x y]
+   (set! (.-position.x sprite) x)
+   (set! (.-position.y sprite) y))
+  ([sprite [x y]]
+   (set-pos! sprite x y)))
+
+(defn set-anchor! [sprite x y]
+  (set! (.-anchor sprite) (make-point x y)))
+
+(defn set-pivot! [sprite x y]
+  (set! (.-pivot.x sprite) x)
+  (set! (.-pivot.y sprite) y))
+
+(defn set-scale! ([sprite s]
+                  (set! (.-scale sprite) (make-point s s)))
+  ([sprite sx sy]
+   (set! (.-scale sprite) (make-point sx sy))))


sicp:: deriv example main algorithm

sicp:: deriv example main algorithm

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

--- stuf/src/sandbox/deriv.clj
+++ stuf/src/sandbox/deriv.clj
@@ -0,0 +1,17 @@
+(ns sandbox.deriv)
+
+(defn deriv [exp var]
+  (cond ((number? exp) 0)
+        ((variable? exp)
+         (if (same-variable? exp var) 1 0))
+        ((sum? exp)
+         (make-sum (deriv (addend exp) var)
+                   (deriv (augend exp) var)))
+        ((product? exp)
+         (make-sum
+          (make-product (multiplier exp)
+                        (deriv (multiplicated exp) var))
+          (make-product (deriv (multiplier exp) var)
+                        (multiplicand exp))))
+        (else
+         (println "unknown expresion type -- DERIV" exp))))


最简单的字符串拼接

最简单的字符串拼接

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

--- hello.clj
+++ hello.clj
@@ -0,0 +1,32 @@
+;; 先将Clojure转为Python更容易些,就像clj->js一样更容易实现
+;; "(fn [a] a)" => "lambda a: a"
+;; 1.获得表达式的类型
+(defmacro get-type [form]
+  `(type (first '~form)) )
+(macroexpand-1 (get-type (fn [a] a))) ;;=> clojure.lang.Symbol
+;; (= (first '(fn [a] a)) 'fn) ;;=> true
+;; 2. 生成类型判断的基本函数
+(defmacro init-type [] `(defun ~name ))
+;; 3. 列表处理转换
+(first '(fn [a] a)) ;;=> fn
+(nth '(fn [a] a) 1) ;;=> [a]
+(nth '(fn [a] a) 2) ;;=> a
+(type (nth '(fn [a] a) 1)) ;;=> clojure.lang.PersistentVector
+;;(defmacro pyfn [form]  )
+;; 4. 从最简单的什么都没有的字符串拼接填充模板开始,到模式编辑转换
+(def fnbody '(fn [a] a))
+(str
+ ;; 这里是关键字转换
+ (if (= (first fnbody) 'fn)
+   "lambda"
+   )
+ " "
+ ;; 这里是参数
+ (if (vector? (nth fnbody 1)) ;; 基本类型vector,symbol
+   (str (first (nth fnbody 1)) ":") ;; : 是python高频的符号,def函数和for循环等都有
+   )
+ " "
+ ;; 这里是body
+ ;;(nth (rest (rest '(fn [a] (+ a 1)))) 0) ;; => (+ a 1)
+ (nth (rest (rest fnbody)) 0)
+ ) ;; => "lambda a: a"


[EN] Use with-fresh-db

[EN] Use with-fresh-db

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


Reorder imports.

Reorder imports.

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


The alias shouldn't be a string

The alias shouldn't be a string

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


Fix commit order on tree simplification

Fix commit order on tree simplification

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


Add missing file that should have been committed months ago. Adds fns for uploading SSL certificates to AWS, useful for creating SSL load balancers at the repl

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

--- src/circle/backend/aws_iam.clj
+++ src/circle/backend/aws_iam.clj
@@ -0,0 +1,24 @@
+(ns circle.backend.aws-iam
+  "fns for working with AWS Identity & Access Management"
+  (:use [circle.aws-credentials :only (aws-credentials)])
+  (:import com.amazonaws.services.identitymanagement.AmazonIdentityManagementClient
+           com.amazonaws.services.identitymanagement.model.UploadServerCertificateRequest
+           com.amazonaws.services.identitymanagement.model.GetServerCertificateRequest))
+
+(defmacro with-iam-client
+  [client & body]
+  `(let [~client (AmazonIdentityManagementClient. aws-credentials)]
+     ~@body))
+
+(defn upload-certificate
+  "Uploads an SSL certificate. cert is the certificate public key, it
+  begins with ---BEGIN CERTIFICATE---. priv key begins with --BEGIN
+  RSA PRIVATE KEY--- "
+  [{:keys [name certificate private-key]}]
+  (with-iam-client client
+    (let [result (.uploadServerCertificate client (UploadServerCertificateRequest. name certificate private-key))]
+      (.getServerCertificateMetadata result))))
+
+(defn get-certificate [name]
+  (with-iam-client client
+    (-> client (.getServerCertificate (GetServerCertificateRequest. name)) (.getServerCertificate) (bean) (update-in [:serverCertificateMetadata] bean))))


Adjust divider locations

Adjust divider locations

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


Prefer the Nightcode-selected path over the one in profiles.clj


add iterate manual

add iterate manual

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


connection components with channels

connection components with channels

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

--- src/ca_recipe/components/main.clj
+++ src/ca_recipe/components/main.clj
@@ -0,0 +1,22 @@
+(ns ca-recipe.component.main)
+
+(defn [twitter-chan (async/chan 100)
+       twitter-response-chan (async/chan 10)
+       facebook-chan (async/chan 100)
+       facebook-response-chan (async/chan 10)
+       alert-chan (async/chan 100)
+       response-chan (async/chan 100)
+       feed-chan (async/merge [twitter-chan facebook-chan])
+       response-pub (async/pub response-chan :feed)]
+  (async/sub response-pub :twitter twitter-response-chan)
+  (async/sub response-pub :facebook facebook-response-chan)
+
+  (component/system-map
+   :twitter (feed/new-feed twitter twitter-chan twitter-response-chan)
+   :facebook (feed/new-feed facebook facebook-chan facebook-response-chan)
+   :knowledge-engine
+   (knowkedge/new-knowledge-engine knowledge feed-chan alert-chan)
+   :approvals (component/using
+               (approvals/new-approvals approvals alert-chan response-chan)
+               [:knowledge-engine])))
+


Be kinder to the Slack API.

Be kinder to the Slack API.


Skipping validation for pre and code blocks

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/hudren/ebook-novel.git/'


Remove unused get-normal-posts function

Remove unused get-normal-posts function

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


seconds l

seconds l


Returning to synchronous hash map usage

Returning to synchronous hash map usage

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/dillius/peak-tolerable-stupidity.git/'


sampling code resides here

sampling code resides here

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

--- src/crawler/sample.clj
+++ src/crawler/sample.clj
@@ -0,0 +1,13 @@
+(ns crawler.sample
+  "Module to sample decision responses.
+   A decision is represented by an XPath
+   A sample picks out some links. Visiting is left
+   to the user")
+
+(defn sample
+  "Given a set of decisions, we produce an instance of
+   each decision. In URLspeak:
+   a decision is an XPath
+   a sample is some links from an XPath"
+  [decisions]
+  '*)


Libururik ez badut abisatu

Libururik ez badut abisatu

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


Add mutation to create community-safety entity

Also update query-by-account to use query from blueprints

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


little bit of tidy up.

little bit of tidy up.

--- src/metabase/task/send_pulses.clj
+++ src/metabase/task/send_pulses.clj
@@ -28,7 +28,6 @@
 ;; simple job which looks up all databases and runs a sync on them
 (jobs/defjob SendPulses
              [ctx]
-             ;; determine what time it is right now (hour-of-day & day-of-week) in local timezone
              (send-pulses))

 (defn task-init []
@@ -96,8 +95,9 @@
           (= :slack channel_type) (send-pulse-slack pulse results details))))))

 (defn send-pulses
-  ""
+  "Send any `Pulses` which are scheduled to run in the current day/hour."
   []
+  ;; determine what time it is right now (hour-of-day & day-of-week) in local timezone
   (let [now               (time/to-time-zone (time/now) (time/time-zone-for-id (or (setting/get :report_timezone) "UTC")))
         curr-hour         (time/hour now)
         curr-weekday      (:id (get pulse-channel/days-of-week (time/day-of-week now)))


Added doc strings from Eric Schulte's Shen Mode, https://github.com/eschulte/shen-mode

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


Refactor: make main component more declarative...

... by scuttling away all of the filthy details into a new
sub-component, and by having that sub-component, named 'app-container',
consume the three main 'column' components in such a way that their
formatting in the code resembles the visual representation in the
browser.

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/Reefersleep/sleepydo.git/'


Allow nil as a primitive child

Allow nil as a primitive child

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/nvbn/rerenderer.git/'


whoops fix typo

whoops fix typo

--- test/metabase/driver/query_processor_test.clj
+++ test/metabase/driver/query_processor_test.clj
@@ -797,7 +797,7 @@
                               :type     :query
                               :query    {:source_table (:id &events)
                                          :aggregation  ["count"]
-                                         :filter       ["<" (:id &events.timestamp) (metabase.util/date-yyyy-mm-dd->unix-timestamp "1765-01-01")]}})
+                                         :filter       ["<" (:id &events.timestamp) "1765-01-01"]}})
        :data
        :rows
        first


New json-response helper using cheshire

New json-response helper using cheshire

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

--- src/wishlistd/json.clj
+++ src/wishlistd/json.clj
@@ -0,0 +1,8 @@
+(ns wishlistd.json
+  (:use [cheshire.core]))
+
+(defn json
+  "Wraps the response in the json content type and generates JSON from the content. Uses Chesire for date support."
+  [content]
+  {:headers {"Content-Type" "application/json"}
+   :body (generate-string content)})


Double ;; so Marginalia finds it

Double ;; so Marginalia finds it


Reformat: indent 'header' style map

Reformat: indent 'header' style map


formatting

formatting

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


First sketch for gui plugins

First sketch for gui plugins

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

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

--- src/conexp/gui/plugins.clj
+++ src/conexp/gui/plugins.clj
@@ -0,0 +1,17 @@
+(ns conexp.gui.plugins)
+
+; structure for plugin management, gets a frame to operate on
+
+; (defmacro define-plugin ...)
+
+; (defn register-plugin ...)
+
+; (defn load-plugin ...)
+
+; (defn unload-plugin ...)
+
+; (defn loaded-plugins ...)
+
+; (defn registered-plugins ...)
+
+nil


Exclude class from normalize ns

Exclude class from normalize ns

--- src/sablono/normalize.cljc
+++ src/sablono/normalize.cljc
@@ -1,4 +1,5 @@
 (ns sablono.normalize
+  (:refer-clojure :exclude [class])
   (:require [clojure.set :as set]
             [clojure.string :as str]
             [sablono.util :as util]))


require core.async

require core.async


Added dependent block

Added dependent block

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/skprasadu/crud-ui-framework.git/'


continue working on new main

continue working on new main

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/colophon/clarango.git/'


needed to add file

needed to add file

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

--- src/bitsplit_cli/utils.cljs
+++ src/bitsplit_cli/utils.cljs
@@ -0,0 +1,12 @@
+(ns bitsplit-cli.utils
+    (:use
+        [bitsplit.storage.protocol :only (all save!)]
+        [bitsplit.client.protocol :only (addresses)]))
+
+(defn sync-addresses! [{:keys [client storage]}]
+    (let [current (all storage)
+          addrs (addresses client)
+          valid (select-keys current addrs)]
+        (when (not= valid current)
+            (doseq [[address splits] valid]
+                (save! client address splits)))))


Lorturen errore zenbakia konpondu (404, ez 400)

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


Added unique id to data creator.

Added unique id to data creator.

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/altamiracorp/honeycomb.git/'


give full permission to job-result-dir

give full permission to job-result-dir

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


require logging

require logging


added a task to automatically generate swagger client libraries

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

--- src/ctia/task/codegen.clj
+++ src/ctia/task/codegen.clj
@@ -0,0 +1,56 @@
+(ns ctia.task.codegen
+  ^{:doc "A task to generate swagger client libraries for a handful of languages"}
+  (:require [ctia.init :refer [start-ctia!]]
+            [clojure.java.io :as io]
+            [clojure.java.shell :as shell]
+            [ctia.properties :refer [properties]]))
+
+(def codegen-version "2.1.6")
+(def codegen-repo "http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/")
+(def supported-languages ["clojure"
+                          "java"
+                          "haskell-servant"
+                          "python"
+                          "ruby"])
+
+(def jar-uri (str codegen-repo
+                  codegen-version
+                  "/swagger-codegen-cli-"
+                  codegen-version ".jar"))
+
+(def local-jar-uri (str "/tmp/swagger-codegen-" codegen-version ".jar"))
+
+(defn spec-uri []
+  (let [port (get-in @properties [:ctia :http :port] 3000)]
+    (str "http://localhost:" port "/swagger.json")))
+
+(defn exec-command [& args]
+  (when-let [err (:err (apply shell/sh args))]
+    (println err)))
+
+(defn setup []
+  (println "starting CTIA...")
+  (start-ctia! :join? false :silent? true)
+  (when-not (.exists (io/file local-jar-uri))
+    (do (println "downloading swagger-codegen" codegen-version "...")
+        (exec-command "curl" "-o" local-jar-uri jar-uri))))
+
+(defn generate-language [lang output-dir]
+  (println "generating" lang "client...")
+  (exec-command "java"
+                "-jar"
+                local-jar-uri
+                "generate"
+                "-i" (spec-uri)
+                "-l" lang
+                "--group-id" "cisco"
+                "-o" (str (or output-dir "/tmp/ctia-client") "/" lang)))
+
+(defn -main [output-dir]
+  "invoke with lein run -m ctia.task.codegen <output-dir>"
+  (setup)
+  (doseq [lang supported-languages]
+    (generate-language lang output-dir))
+
+  (println "done")
+  (System/exit 0))


good so far

good so far

--- src/bluebell/utils/core.clj
+++ src/bluebell/utils/core.clj
@@ -168,6 +168,7 @@
 (defn normalize-coll [coll]
   (cond
     (map? coll) (vec (apply concat (vec coll)))
+    (set? coll) (sort (vec coll))
     :default (vec coll)))

 (defn make-map [proto coll]


cleanup type hints

cleanup type hints


Update Source roots when adding a link

Update Source roots when adding a link

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


[DG] Removed the unnecessary try

[DG] Removed the unnecessary try

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


[TH DG] Handle nil default resources

[TH DG] Handle nil default resources


added user.clj

added user.clj

error: pathspec 'resources/leiningen/new/reagent_frontend/env/dev/clj/user.clj' did not match any file(s) known to git

--- resources/leiningen/new/reagent_frontend/env/dev/clj/user.clj
+++ resources/leiningen/new/reagent_frontend/env/dev/clj/user.clj
@@ -0,0 +1,11 @@
+(ns user
+ (:require [figwheel-sidecar.repl-api :as ra]))
+
+(defn start-fw []
+ (ra/start-figwheel!))
+
+(defn stop-fw []
+ (ra/stop-figwheel!))
+
+(defn cljs []
+ (ra/cljs-repl))


Move defmethod docstrings to comments

Move defmethod docstrings to comments

There currently isn't support for docstrings via "defmethod", so we have to
move those docs to comments.

Relevant discussion from #clojure:

grim_radical: is there a way to add a docstring via "defmethod"?
grim_radical: i see how to do it for defmulti, but i'd like to add some
method-specific docs
Vinzent: grim_radical, I don't think it's possible
grim_radical: Vinzent: bummer. :(
raek: grim_radical: in defmulti/defmethod there is only one var involved (and
therefore only one place for the metadata to go), namely the one that is
defined by defmulti
grim_radical: raek: ah, ok
brehaut: grim_radical: if you used https://gist.github.com/432752 to install
the methods so you could define the functions independently so that they each
have a var to hang a doc on
grim_radical: brehaut: neat! i'll definitely take a look at that
brehaut: grim_radical: you wont get much advantage over just using a ;; comment

Signed-off-by: Deepak Giridharagopal <d11186354d1ef01ca06ae37d7e23e827da13e85f@puppetlabs.com>

--- src/com/puppetlabs/cmdb/query/resource.clj
+++ src/com/puppetlabs/cmdb/query/resource.clj
@@ -165,10 +165,12 @@
   :content-types-provided (constantly {resource-list-c-t resource-list-as-json}))

 ;; ## SQL query compiler
+;;
+;; Compile an '=' predicate, the basic atom of a resource query. This
+;; will produce a query that selects a set of hashes matching the
+;; predicate, which can then be combined with connectives to build
+;; complex queries.
 (defmethod compile-query->sql "="
-  "Compile an '=' predicate, the basic atom of a resource query. This will
-produce a query that selects a set of hashes matching the predicate, which
-can then be combined with connectives to build complex queries."
   [db [op path value :as term]]
   (let [count (count term)]
     (if (not (= 3 count))
@@ -230,9 +232,9 @@
   (let [ids (range (count queries))]
     (map #(format "%s resources_%d" %1 %2) queries ids)))

+;; Join a set of predicates together with an 'and' relationship,
+;; performing an intersection (via natural join).
 (defmethod compile-query->sql "and"
-  "Join a set of predicates together with an 'and' relationship, performing an
-intersection (via natural join)."
   [db [op & terms]]
   {:pre [(every? vector? terms)]
    :post [(string? (first %))
@@ -248,9 +250,9 @@
                    (format "(%s)"))]
     (apply vector query params)))

+;; Join a set of predicates together with an 'or' relationship,
+;; performing a union operation.
 (defmethod compile-query->sql "or"
-  "Join a set of predicates together with an 'or' relationship, performing a
-union operation."
   [db [op & terms]]
   {:pre [(every? vector? terms)]
    :post [(string? (first %))
@@ -264,9 +266,10 @@
                    (format "(%s)"))]
     (apply vector query params)))

+;; Join a set of predicates together with a 'not' relationship,
+;; performing a set difference. This will reject resources matching
+;; _any_ child predicate.
 (defmethod compile-query->sql "not"
-  "Join a set of predicates together with a 'not' relationship, performing a
-set difference. This will reject resources matching _any_ child predicate."
   [db [op & terms]]
   {:pre [(every? vector? terms)]
    :post [(string? (first %))


Add test for map collection separator.

Add test for map collection separator.

--- test/puget/printer_test.clj
+++ test/puget/printer_test.clj
@@ -51,7 +51,9 @@
          '(1 2 3)               "(1 2 3)"
          [4 "five" 6.0]         "[4 \"five\" 6.0]"
          {:foo 8 :bar 'baz}     "{:bar baz, :foo 8}" ; gets sorted
-         #{:omega :alpha :beta} "#{:alpha :beta :omega}"))) ; also sorted
+         #{:omega :alpha :beta} "#{:alpha :beta :omega}")) ; also sorted
+  (testing "Map collection separator"
+    (is (= "{:bar\n [:a :b]}" (pprint-str {:bar [:a :b]} {:width 10, :map-coll-separator :line})))))

 (defrecord TestRecord [foo bar])
@@ -62,6 +64,7 @@
       (should-fail-when-strict r)
       (is (= "#puget.printer_test.TestRecord{:bar \\y, :foo \\x}\n"
              (with-out-str (pprint r)))))))
+

 (deftype ADeref []
   clojure.lang.IDeref
@@ -108,8 +111,7 @@
     (let [v (APending.)]
       (should-fail-when-strict v)
       (is (re-seq #"#<puget.printer_test.APending@[0-9a-f]+ pending"
-                  (pprint-str v)))))
-  )
+                  (pprint-str v))))))

 (deftest canonical-tagged-value


Fix all-clients-receive-join test when /etc/hosts has addition 127.0.0.1 mappings

--- test/subrosa/test/rooms.clj
+++ test/subrosa/test/rooms.clj
@@ -53,7 +53,7 @@
       (transmit s2 "NICK dan2")
       (transmit s2 "USER dan 0 * :Dan Larkin")
       (transmit s2 "JOIN #foo")
-      (is (received? s1 #":dan2!dan@localhost JOIN #foo")))))
+      (is (received? s1 #":dan2!dan@.* JOIN #foo")))))

 (deftest list-rooms
   (with-connection s


starting to implement protocols

starting to implement protocols

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

--- src/main/clojure/com/narkisr/protocols.clj
+++ src/main/clojure/com/narkisr/protocols.clj
@@ -0,0 +1,25 @@
+(ns com.narkisr.protocols
+  (:use (clojure.contrib (def :only [defmacro-]))))
+
+(defn with-type [type x]
+  (with-meta x {:type type}))
+
+(defn into-syms [keys]
+  (vec (map #(. % sym) (into [:name :mode :xattrs :lastmod] keys))))
+
+(defmacro fstype [name & keys]
+  `(defrecord ~name ~(into-syms keys)))
+
+(fstype Directory :files)
+(fstype Meta :file)
+(fstype File :content :size)
+
+(defprotocol Handle
+             (delete [this])
+             (create [this]))
+
+(defprotocol FsElement
+             )
+
+(defprotocol FsContainer
+             )


Added some store methods

Added some store methods

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/kuona/kuona-collector-lib.git/'


transport.sse: formatting

transport.sse: formatting

--- src/riemann/transport/sse.clj
+++ src/riemann/transport/sse.clj
@@ -63,23 +63,21 @@
             {:strs [query]}        (http-query-map query-string)
             ast                    (query/ast query)]

-        ;; first send all known events
+        ; first send all known events
         (when index
           (doseq [event (index/search index ast)]
             (enqueue ch (event-to-server-sent-event event))))

+        ; now subscribe to the core
         (let [pred (query/fun ast)
               sub  (subscribe! pubsub "index" (sse-out stats ch pred) true)]
-
-          ;; now subscribe to the core
           (info "New SSE subscription to index for:" query)

-          (on-closed ch
-                     (fn []
-                       (info "Closing SSE channel " remote-addr query)
-                       (unsubscribe! pubsub sub)))
+          (on-closed ch (fn []
+                          (info "Closing SSE channel " remote-addr query)
+                          (unsubscribe! pubsub sub)))

-          (enqueue resp-ch {:status 200  :headers headers :body ch})))
+          (enqueue resp-ch {:status 200 :headers headers :body ch})))
       (sse-error-uri resp-ch uri))))

 (defrecord SSEServer [host port headers core server stats]
@@ -101,7 +99,7 @@
   (start! [this]
           (locking this
             (when-not @server
-              (reset! server (start-http-server
+              (reset! server (start-http-server
                               (sse-handler core stats headers)
                               {:host host :port port}))
               (info "SSE server" host port "online"))))
@@ -156,8 +154,8 @@
            the same host, you will probably need to add an
            Access-Control-Allow-Origin header here"
   ([] (sse-server {}))
-  ([{:keys [host port headers]
-     :or   {host    "127.0.0.1"
+  ([{:keys [host port headers]
+     :or   {host    "127.0.0.1"
             port    5558
             headers {}}}]
      (SSEServer.


Added reminder about important task

Added reminder about important task

--- 2-collectors/clojure-collector/src/snowplow/clojure_collector/core.clj
+++ 2-collectors/clojure-collector/src/snowplow/clojure_collector/core.clj
@@ -24,6 +24,8 @@
             [snowplow.clojure-collector.responses :as responses]
             [snowplow.clojure-collector.config    :as config]))

+; TODO: important, need to add support for no domain name into appropriate response
+
 (defn- send-cookie-and-pixel'
   "Wrapper for send-cookie-and-pixel, pulling
    in the configuration settings"


reorganize sync.clj a bit

reorganize sync.clj a bit

--- src/metabase/driver/generic_sql/sync.clj
+++ src/metabase/driver/generic_sql/sync.clj
@@ -8,57 +8,11 @@
             (metabase.models [field :refer [Field]]
                              [table :refer [Table]])))

+(declare sync-fields
+         table-names
+         update-table-row-count)

-(defn table-names
-  "Fetch a list of table names for DATABASE."
-  [database]
-  (with-jdbc-metadata database
-    (fn [md] (->> (-> md
-                    (.getTables nil nil nil (into-array String ["TABLE"])) ; ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
-                    jdbc/result-set-seq)
-               (mapv :table_name)))))
-
-(defn jdbc-columns
-  "Fetch information about the various columns for Table with TABLE-NAME by getting JDBC metadata for DATABASE."
-  [database table-name]
-  (with-jdbc-metadata database
-    (fn [md] (->> (-> md
-                    (.getColumns nil nil table-name nil) ; ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
-                    jdbc/result-set-seq)
-               (mapv #(select-keys % [:column_name :type_name]))))))
-
-
-(defn get-table-row-count
-  "Get the number of rows in TABLE."
-  [table]
-  (-> (korma-entity table)
-      (select (aggregate (count :*) :count))
-      first
-      :count))
-
-(defn update-table-row-count
-  "Update the `:rows` column for TABLE with the count from `get-table-row-count`."
-  [{:keys [id] :as table}]
-  {:pre [(integer? id)]}
-  (let [new-count (get-table-row-count table)]
-    (upd Table id :rows new-count)))
-
-(def ^:dynamic *column->base-type*
-  "COLUMN->BASE-TYPE should be a map of column types returned by the DB to Field base types."
-  {})
-
-(defn sync-fields
-  "Sync `Fields` for TABLE. "
-  [{:keys [id name db] :as table}]
-  (dorun (map (fn [{:keys [type_name column_name]}]
-                (or (exists? Field :table_id id :name column_name)
-                    (ins Field
-                      :table_id id
-                      :name column_name
-                      :base_type (or (*column->base-type* (keyword type_name))
-                                     (throw (Exception. (str "Column '" column_name "' has an unknown type: '" type_name
-                                                             "'. Please add the type mapping to corresponding driver (e.g. metabase.driver.postgres.sync).")))))))
-              (jdbc-columns db name))))
+;; # PUBLIC FUNCTIONS

 (defn sync-database
   [{:keys [id] :as database}]
@@ -84,3 +38,70 @@
       (update-table-row-count table)
       (sync-fields table)
       (log/debug "Synced" (:name table)))))
+
+
+;; # IMPLEMENTATION
+
+;; ## Variables
+
+(def ^:const ^:private low-cardinality-threshold
+  "Fields with less than this many distinct values should automatically be marked with `special_type` `:category`."
+  40)
+
+(def ^:dynamic *column->base-type*
+  "COLUMN->BASE-TYPE should be a map of column types returned by the DB to Field base types."
+  {})
+
+
+;; ## Fetch Tables/Columns
+
+(defn table-names
+  "Fetch a list of table names for DATABASE."
+  [database]
+  (with-jdbc-metadata database
+    (fn [md] (->> (-> md
+                    (.getTables nil nil nil (into-array String ["TABLE"])) ; ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
+                    jdbc/result-set-seq)
+               (mapv :table_name)))))
+
+(defn jdbc-columns
+  "Fetch information about the various columns for Table with TABLE-NAME by getting JDBC metadata for DATABASE."
+  [database table-name]
+  (with-jdbc-metadata database
+    (fn [md] (->> (-> md
+                    (.getColumns nil nil table-name nil) ; ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
+                    jdbc/result-set-seq)
+                 (mapv #(select-keys % [:column_name :type_name]))))))
+
+;; ## Table Info
+
+(defn get-table-row-count
+  "Get the number of rows in TABLE."
+  [table]
+  (-> (korma-entity table)
+      (select (aggregate (count :*) :count))
+      first
+      :count))
+
+(defn update-table-row-count
+  "Update the `:rows` column for TABLE with the count from `get-table-row-count`."
+  [{:keys [id] :as table}]
+  {:pre [(integer? id)]}
+  (let [new-count (get-table-row-count table)]
+    (upd Table id :rows new-count)))
+
+
+;; ## Field Info
+
+(defn sync-fields
+  "Sync `Fields` for TABLE. "
+  [{:keys [id name db] :as table}]
+  (dorun (map (fn [{:keys [type_name column_name]}]
+                (or (exists? Field :table_id id :name column_name)
+                    (ins Field
+                      :table_id id
+                      :name column_name
+                      :base_type (or (*column->base-type* (keyword type_name))
+                                     (throw (Exception. (str "Column '" column_name "' has an unknown type: '" type_name
+                                                             "'. Please add the type mapping to corresponding driver (e.g. metabase.driver.postgres.sync).")))))))
+              (jdbc-columns db name))))


Add parse command

Add parse command

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

--- src/yetibot/core/commands/parse.clj
+++ src/yetibot/core/commands/parse.clj
@@ -0,0 +1,12 @@
+(ns yetibot.core.commands.parse
+  (:require
+    [yetibot.core.parser :refer [parser]]
+    [yetibot.core.hooks :refer [cmd-hook]]))
+
+(defn parse-cmd
+  "parse <text> # parse <text> into an AST using yetibot's internal parser"
+  [{match :match}]
+  (-> match parser str))
+
+(cmd-hook #"parse"
+  _ parse-cmd)


Added stub for the test-db-interface module

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

--- test/clouseau/test_db_interface.clj
+++ test/clouseau/test_db_interface.clj
@@ -0,0 +1,43 @@
+;;;
+;;;   Clouseau
+;;;
+;;;    Copyright (C) 2015 Pavel Tisnovsky <ptisnovs@redhat.com>
+;;;
+;;; Clouseau is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2, or (at your option)
+;;; any later version.
+;;;
+;;; Clouseau is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with Clouseau; see the file COPYING.  If not, write to the
+;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+;;; 02110-1301 USA.
+;;;
+;;; Linking this library statically or dynamically with other modules is
+;;; making a combined work based on this library.  Thus, the terms and
+;;; conditions of the GNU General Public License cover the whole
+;;; combination.
+;;;
+;;; As a special exception, the copyright holders of this library give you
+;;; permission to link this library with independent modules to produce an
+;;; executable, regardless of the license terms of these independent
+;;; modules, and to copy and distribute the resulting executable under
+;;; terms of your choice, provided that you also meet, for each linked
+;;; independent module, the terms and conditions of the license of that
+;;; module.  An independent module is a module which is not derived from
+;;; or based on this library.  If you modify this library, you may extend
+;;; this exception to your version of the library, but you are not
+;;; obligated to do so. If you do not wish to do so, delete this
+;;; exception statement from your version.
+;;;
+
+(ns clouseau.test-core
+  (:require [clojure.test :refer :all]
+            [clouseau.db-interface :refer :all]))
+
+


Added help comments

Added help comments

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


CMR-2588 Adds additional migration to correct migration_transaction_id_seq start value

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

--- metadata-db-app/src/migrations/037_fix_global_transaction_ids_again.clj
+++ metadata-db-app/src/migrations/037_fix_global_transaction_ids_again.clj
@@ -0,0 +1,37 @@
+(ns migrations.037-fix-global-transaction-ids-again
+  (:require [config.mdb-migrate-helper :as h]
+            [cmr.metadata-db.services.concept-validations :as v]))
+
+;; NOTE: This migration is the same as 036, with the exception of the start value
+;; of the migration_transaction_id_seq sequence.
+
+(defn up
+  "Migrates the database up to version 36."
+  []
+  (println "migrations.037-fix-global-transaction-ids-again up...")
+  ;; This sequence was created by a previous migration, but we want to start over, so we have to
+  ;; drop it and re-create it.
+  (h/sql "DROP SEQUENCE METADATA_DB.MIGRATION_TRANSACTION_ID_SEQ")
+  (h/sql (format "CREATE SEQUENCE METADATA_DB.MIGRATION_TRANSACTION_ID_SEQ
+                           START WITH %s
+                           INCREMENT BY 1
+                           CACHE 400
+                           ORDER"
+                 ;; This is the only important difference from 036:
+                 (inc v/MAX_REVISION_ID)))
+
+  ;; Now we want to update every existing record (except for granules) with a transaction-id
+  ;; generated from this sequence.
+  (doseq [table (h/get-concept-tablenames :collection :service :tag :tag-association :access-group)
+          row (h/query (format "SELECT id FROM %s ORDER BY concept_id ASC, revision_id ASC" table))]
+    (h/sql (format "UPDATE %s
+                    SET transaction_id = METADATA_DB.MIGRATION_TRANSACTION_ID_SEQ.NEXTVAL
+                    WHERE id = %s"
+                   table
+                   (:id row)))))
+
+(defn down
+  "Migrates the database down from version 36."
+  []
+  (println "migrations.037-fix-global-transaction-ids-again down...")
+  (println "nothing to do: previous transaction-id values cannot be restored"))


marketo form helper

marketo form helper

error: pathspec 'frontend/analytics/marketo.cljs' did not match any file(s) known to git

--- frontend/analytics/marketo.cljs
+++ frontend/analytics/marketo.cljs
@@ -0,0 +1,29 @@
+(ns frontend.analytics.marketo
+  (:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer close!]]
+            [frontend.async :refer [put!]]
+            [frontend.utils :as utils :include-macros true]
+            [frontend.utils.ajax :as ajax]
+            [goog.net.Cookies]))
+
+(defn munchkin?
+  "Check if munchkin is defined. If not, then we probably won't be able to sumbit
+   the form to them."
+  []
+  (boolean (aget js/window "mktoMunchkin")))
+
+(defn munchkin-defaults []
+  {:_mkto_trk (.get (goog.net.Cookies. js/window.document) "_mkto_trk")
+   :munchkinId "894-NPA-635"})
+
+(defn submit-munchkin-form
+  "Submits the marketo form with a fallback to /about/contact"
+  [form-id params]
+  (if (munchkin?)
+    (ajax/managed-form-post "http://app-abm.marketo.com/index.php/leadCapture/save2"
+                            :params (merge (munchkin-defaults)
+                                           {:formVid form-id
+                                            :formid form-id}
+                                           params))
+    (ajax/managed-form-post "/about/contact"
+                            :params {:email (:Email params)
+                                     :message params})))


better err msg when eval response is not readable

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


Persistent Clojure example

Persistent Clojure example

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

--- clojure/persistent_example.clj
+++ clojure/persistent_example.clj
@@ -0,0 +1,5 @@
+(def a (list (repeat 100 :dog)))
+(def b (conj a :cat))
+
+(use 'clojure.test)
+(is (identical? a (rest b)))


change repl-api comment

change repl-api comment

--- sidecar/src/figwheel_sidecar/repl_api.clj
+++ sidecar/src/figwheel_sidecar/repl_api.clj
@@ -3,12 +3,9 @@
    [figwheel-sidecar.repl :as fr]
    [figwheel-sidecar.config :as fc]))

-;; this is intended to help you boot figwheel ontop of an nREPL
-;; requires that you have piggeiback nrepl middleware installed
-;; Currently having problems with the foreign deps resolution.
-;; See::
-;; http://dev.clojure.org/jira/browse/CLJS-1036
 (defn start-figwheel!
+  "If you aren't connected to an env where fighweel is running already.
+  You this method will start the figwheel server with the passed build info."
   [{:keys [figwheel-options all-builds build-ids] :as autobuild-options}]
   (if-not fr/*autobuild-env*
     (let [env (fr/create-autobuild-env
@@ -36,10 +33,8 @@
                              :output-dir "resources/public/js/out"
                              :source-map true
                              :source-map-timestamp true
-                             :recompile-dependents false
                              :cache-analysis true
                              :optimizations :none}}]})
-
   )

 (defn build-once


more notes

more notes

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


Ignoring callback nonsense

Ignoring callback nonsense

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/xcthulhu/clj-bitauth.git/'


Start implementing a database as a component

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

--- src/clj/comic_reader/comic_repository.clj
+++ src/clj/comic_reader/comic_repository.clj
@@ -0,0 +1,27 @@
+(ns comic-reader.comic-repository
+  (:require [com.stuartsierra.component :as component]
+            [datomic.api :as d]))
+
+(def db-uri "datomic:mem://comic-reader")
+
+(defrecord ComicRepository [db-uri connection comic-scraper]
+  component/Lifecycle
+
+  (start [component]
+    (if connection
+      component
+      (do (d/create-database db-uri)
+
+          (println "Connecting to database...")
+          (let [conn (d/connect db-uri)]
+            (assoc component :connection conn)))))
+
+  (stop [component]
+    (if (not connection)
+      component
+      (do (println "Releasing database connection...")
+          (d/release connection)
+          (assoc component :connection nil)))))
+
+(defn new-repository [db-uri]
+  (map->ComicRepository {:db-uri db-uri}))


Add a metric name index protocol and implementation

This is based on lucene and provides both an in-memory
and on-disk implementation

error: pathspec 'src/org/spootnik/cyanite/path.clj' did not match any file(s) known to git

--- src/org/spootnik/cyanite/path.clj
+++ src/org/spootnik/cyanite/path.clj
@@ -0,0 +1,35 @@
+(ns org.spootnik.cyanite.path
+  "Implements a path store which tracks metric names. The
+   default implementation provides lucene based implementations"
+  (:require [clucy.core                  :as search]
+            [clojure.tools.logging       :refer [error info debug]]))
+
+(defprotocol Pathstore
+  "The pathstore provides a way to insert paths and later look them up"
+  (register [this tenant path])
+  (search [this tenant path]))
+
+(defn lucene-pathstore
+  [index]
+  (reify Pathstore
+    (register [this tenant path]
+      (search/add index {:tenant tenant :path path}))
+    (search [this tenant path]
+      (let [query (format "tenant:'%s' path:'%s'" tenant path)]
+        (->> (loop [init []
+                    page 0]
+               (let [paths (map :path (search/search index query 1000000
+                                                     :page page
+                                                     :results-per-page 100))]
+
+                 (if (< (count paths) 100)
+                   (concat init paths)
+                   (recur (concat init paths) (inc page))))))))))
+
+(defn lucene-memory-pathstore
+  [_]
+  (lucene-pathstore (search/memory-index)))
+
+(defn lucene-file-pathstore
+  [{:keys [path]}]
+  (lucene-pathstore (search/disk-index path)))


[WM] Bump ext. service timeout to 10s

[WM] Bump ext. service timeout to 10s

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


template method with full grad report

template method with full grad report

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

--- src/sandbox/template/template.clj
+++ src/sandbox/template/template.clj
@@ -0,0 +1,26 @@
+(ns sandbox.template.template)
+
+(defn make-grade-reporter [num-to-letter print-grade-report]
+  (fn [grades]
+    (print-grade-report (map num-to-letter grades))))
+
+(defn full-grade-converter [grade]
+  (cond
+    (and (<= grade 5.0) (> grade 4.0)) "A"
+    (and (<= grade 4.0) (> grade 3.0)) "B"
+    (and (<= grade 3.0) (> grade 2.0)) "C"
+    (and (<= grade 2.0) (> grade 0)) "D"
+    (= grade 0) "F"
+    :else "N/A"))
+
+(defn print-histogram [grades]
+  (let [grouped (group-by identity grades)
+        counts (sort (map
+                      (fn [[grade grades]] [grade (count grades)])
+                      grouped))]
+    (doseq [[grade num] counts]
+      (println (str grade ":" (apply str (repeat num "*")))))))
+
+(def full-grade-reporter (make-grade-reporter full-grade-converter print-histogram))
+
+(def sample-grades [5.0 4.0 4.4 2.2 3.3 3.5])


Fix tests

Fix 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/physion/ovation-webapi.git/'


package

package

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


[WM] allow ocd-divisions in addresses

[WM] allow ocd-divisions in addresses

I also made it stop specifying which address types it will accept, because it should be agnostic. It wasn't clear to me how best to add ocd-divisions to the code that was there before, so I made both changes at once for expediency's sake.

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


rev types

rev types


Remove unused schema definitions

Remove unused schema definitions


remove 'eugene' repository

remove 'eugene' repository

--- project.clj
+++ project.clj
@@ -24,8 +24,7 @@
                  [ring/ring-jetty-adapter "1.1.0"]
                  [ring/ring-devel "1.1.0"]
                  [ring-basic-authentication "1.0.1"]]
-  :repositories {"eugene" "http://ec2-54-193-4-63.us-west-1.compute.amazonaws.com/mvn/repository"
-                 "hiro-tan" "http://hiro-tan.org/mvn/repository"
+  :repositories {"hiro-tan" "http://hiro-tan.org/mvn/repository"
                  "s3" {:url "s3p://ekoontz-repo/releases/"
                        :username :env/aws_access_key ;; gets environment variable AWS_ACCESS_KEY
                        :passphrase :env/aws_secret_key} ;; gets environment variable AWS_SECRET_KEY


fix of collection/rename

fix of collection/rename

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/colophon/clarango.git/'


moving into let

moving into let

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


Explicitly load database driver class when building the connection pool

When executing via leiningen, the order of class loading is slightly different
than when executing via JAR. The canonical way of initializing a JDBC driver is
to call (Class/forName ...) on it, therefore making the JDBC driver management
machinery aware of it. We weren't explicitly doing this, and were lucky that
execution via leiningen worked.

This patch makes the loading of the driver class explicit, thereby Doing The
Right Thing.

Signed-off-by: Deepak Giridharagopal <d11186354d1ef01ca06ae37d7e23e827da13e85f@puppetlabs.com>

--- src/com/puppetlabs/jdbc.clj
+++ src/com/puppetlabs/jdbc.clj
@@ -27,7 +27,7 @@

 (defn make-connection-pool
   "Create a new database connection pool"
-  [{:keys [subprotocol subname username password
+  [{:keys [classname subprotocol subname username password
            partition-conn-min partition-conn-max partition-count
            stats log-statements log-slow-statements]
     :or {partition-conn-min 1
@@ -35,6 +35,8 @@
          partition-count    5
          stats              true}
     :as db}]
+  ;; Load the database driver class
+  (Class/forName classname)
   (let [config (doto (new BoneCPConfig)
                  (.setDefaultAutoCommit false)
                  (.setLazyInit true)


Complete parsing & handling of SNS messages

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


[examples] add project.clj to caffe-mnist subdir from refactor

error: pathspec 'examples/caffe-mnist/project.clj' did not match any file(s) known to git

--- examples/caffe-mnist/project.clj
+++ examples/caffe-mnist/project.clj
@@ -0,0 +1,7 @@
+(defproject caffe-mnist "0.1.0-SNAPSHOT"
+  :dependencies [[org.clojure/clojure "1.8.0"]
+                 [thinktopic/cortex "0.2.1-SNAPSHOT"]
+                 [thinktopic/cortex-datasets "0.3.0-SNAPSHOT"]
+                 [thinktopic/cortex-caffe "0.1.0-SNAPSHOT"]]
+  :main caffe-mnist.core
+)


test for token consumption

test for token consumption

error: pathspec 'server/test/gratefulplace/db/transactions/t_password_reset.clj' did not match any file(s) known to git

--- server/test/gratefulplace/db/transactions/t_password_reset.clj
+++ server/test/gratefulplace/db/transactions/t_password_reset.clj
@@ -0,0 +1,23 @@
+(ns gratefulplace.db.transactions.t-password-reset
+  (:require [gratefulplace.db.test :as tdb]
+            [gratefulplace.db.maprules :as mr]
+            [gratefulplace.db.mapification :refer :all]
+            [flyingmachine.cartographer.core :as c]
+            [gratefulplace.db.query :as q]
+            [gratefulplace.db.transactions.password-reset :as pr]
+            [cemerick.friend.credentials :as friend])
+  (:use midje.sweet
+        gratefulplace.controllers.test-helpers))
+
+(setup-db-background)
+(defn user
+  ([]
+     (user "flyingmachine"))
+  ([username]
+     (q/one [:user/username username])))
+
+(fact "generating a token and consuming it will change a password"
+  (pr/create-token (user))
+  (pr/consume-token (user) "newpass")
+  (friend/bcrypt-verify "newpass" (:user/password (user)))
+  => true)


Add a template var for paper-vbm-form-status

This figures out whether or not a notification recipient should be receiving a paper VBM application form in the mail so we can just base content decisions on that directly in the templates.


fix specs for resolveable symbols, and output-fields

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/Zintinio/Breeze.git/'


Adding query options to hook param-map

Adding query options to hook param-map

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


more comments in code

more comments in code

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


add avro support

add avro support

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

--- src/fileape/avro/writer.clj
+++ src/fileape/avro/writer.clj
@@ -0,0 +1,77 @@
+(ns fileape.avro.writer
+  (:require [clojure.java.io :as io]
+            [clojure.tools.logging :refer [warn]])
+  (:import (io.confluent.kafka.schemaregistry.client CachedSchemaRegistryClient SchemaRegistryClient SchemaMetadata)
+           (org.apache.avro Schema AvroRuntimeException)
+           (org.apache.avro.generic GenericDatumWriter)
+           (org.apache.avro.file DataFileWriter CodecFactory)
+           (java.io File)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;; utility functions
+
+(defn ^CodecFactory valid-codec [codec-name]
+  (try
+    (CodecFactory/fromString (name (or codec-name "deflate")))
+    (catch AvroRuntimeException _ (do
+                                    (warn "invalid codec " codec-name " using deflate")
+                                    (CodecFactory/fromString "deflate")))))
+
+(defn ^DataFileWriter create-data-writer [file ^Schema schema avro-codec]
+  (doto
+    (DataFileWriter. (GenericDatumWriter. schema))
+    (.setCodec (valid-codec avro-codec))
+    (.create schema ^File (io/file file))))
+
+(defn create-client-if-not-exist [env avro-schema-registry-url]
+  (if (:schema-client env)
+    (:schema-client env)
+    (let [schema-client (CachedSchemaRegistryClient. (str avro-schema-registry-url) (int 1000))]
+      (dosync
+        (alter env assoc :schema-client schema-client))
+      schema-client)))
+
+(defn -load-schema
+  "Allow schema-client to be passed in, otherwise create one using the avro-schema-registry-url"
+  [k env {:keys [avro-schema-registry-url schema-client]}]
+  {:pre [(or avro-schema-registry-url schema-client) env k]}
+  (let [^SchemaRegistryClient client (if schema-client
+
+                                       schema-client
+
+                                       (create-client-if-not-exist env avro-schema-registry-url))
+
+        ^SchemaMetadata metadata (.getLatestSchemaMetadata client (str k))
+        schema (.getByID client (.getId metadata))]
+
+    schema))
+
+(def load-schema (memoize -load-schema))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;; public functions
+
+(defn open-avro-file!
+  "If schema-client is added to conf, it will be used instead of creating a schema client"
+  [k file env conf]
+  {:pre [(or (:avro-schema-registry-url conf)
+             (:schema-client conf))]}
+
+  (let [avro-codec (:avro-codec conf)
+        schema (load-schema k env conf)]
+
+    {:data-writer (create-data-writer file schema avro-codec)
+     :schema      schema
+     :file        file
+     :type        type}))
+
+
+(defn write!
+  "
+   datum: should be an avro record
+  "
+  [{:keys [^DataFileWriter data-writer]} datum]
+  (.append data-writer datum))
+
+(defn close! [{:keys [^DataFileWriter data-writer]}]
+  (.close data-writer))


Don't set null as datasource username and password

--- src/ruuvi_server/database/pool.clj
+++ src/ruuvi_server/database/pool.clj
@@ -8,9 +8,8 @@
   (info "Create connection pool")
   (let [connection-pool (doto (DataSource.)
                           (.setDriverClassName (dbh :classname))
-                          (.setUrl (str "jdbc:" (:subprotocol dbh) ":" (:subname dbh)))
-                          (.setUsername (:user dbh))
-                          (.setPassword (:password dbh))
-                          )]
+                          (.setUrl (str "jdbc:" (:subprotocol dbh) ":" (:subname dbh))))]
+    (when (:user dbh) (.setUserName connection-pool (:user dbh)))
+    (when (:user dbh) (.setPassword connection-pool (:password dbh)))
     (merge dbh {:datasource connection-pool}
            )))


example calls added in main for POST/PUT/PATCH/DELETE and HEAD; everything seems to be working but HEAD


test the internal sharding

test the internal sharding

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

--- test/bzzz/sharding_test.clj
+++ test/bzzz/sharding_test.clj
@@ -0,0 +1,50 @@
+(ns bzzz.sharding-test
+  (:use clojure.test
+        bzzz.core
+        bzzz.util
+        bzzz.analyzer
+        bzzz.index-store
+        bzzz.index-search
+        bzzz.query))
+
+(def test-index-name "__lein-test-testing-index-sharding-test")
+
+(deftest test-app
+  (testing "cleanup-before"
+    (delete-all test-index-name))
+
+  (testing "sharding"
+    (dotimes [x 100]
+      (let [doc-generator (fn [n]
+                            {:name "jack"
+                             :id (str "id-" (* 100 n))})
+            list-generator (fn [n]
+                             (into []
+                                   (for [i (range n)]
+                                     (doc-generator i))))
+            docs (list-generator 1000)]
+        (let [r (store {:index test-index-name
+                        :must-refresh true
+                        :documents docs
+                        :number-of-shards 3})
+              r1 (store {:index test-index-name
+                         :must-refresh true
+                         :documents docs
+                         :number-of-shards 3})]
+          (is (= 3 (count r)))
+          (let [rc0 (into [] (for [item r]
+                               (for [[k v] item]
+                                 (:attempt-to-write v))))
+                rc1 (into [] (for [item r1]
+                               (for [[k v] item]
+                                 (:attempt-to-write v))))
+                m0 (into {} (for [[item] rc0] [item true]))
+                m1 (into {} (for [[item] rc1] [item true]))]
+            (is (= m0 m1)))
+
+          (doseq [item r]
+            (doseq [[k v] item]
+              (is (> (:attempt-to-write v) 300))))))))
+
+  (testing "cleanup-after"
+    (delete-all test-index-name)))


Removing unneeded contexts

Removing unneeded contexts

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


stop using local rand-range/choose fns, long since fixed upstream in test.check/double-check

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


don't include :entity_fields on base entity because that forces those columns to be returned on EVERY query, which is not always desired.  instead we need to find a way to make the fields list composable.

--- src/metabase/models/org.clj
+++ src/metabase/models/org.clj
@@ -3,12 +3,4 @@
         ))

 (defentity Org
-  (table :core_organization)
-;  (entity-fields
-;    :id
-;    :name
-;    :description
-;    :logo_url
-;    :inherits
-;    :slug)
-  )
+  (table :core_organization))


Add onyx.tasks.function - not much boilerplate

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

--- src/onyx/tasks/function.clj
+++ src/onyx/tasks/function.clj
@@ -0,0 +1,9 @@
+(ns onyx.tasks.function
+  (:require [onyx.schema :as os]
+            [schema.core :as s]))
+
+(s/defn function
+  [task-name :- s/Keyword opts]
+  {:task {:task-map (merge {:onyx/name task-name
+                            :onyx/type :function}
+                           opts)}})