Trantsakzioak erabili

Trantsakzioak erabili

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 some fixtures to ease testing.

Added some fixtures to ease testing.

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

--- test/lambda_blog/fixtures.clj
+++ test/lambda_blog/fixtures.clj
@@ -0,0 +1,77 @@
+(ns lambda-blog.fixtures
+  (:refer-clojure :exclude [replace])
+  (:require [clojure.set :refer [union]]
+            [lambda-blog.export :refer [clean copy export]]
+            [lambda-blog.templates.archives :refer [archives]]
+            [lambda-blog.templates.entry :refer [entry-page]]
+            [lambda-blog.templates.recent :refer [entries-by-tag recent-entries]]
+            [lambda-blog.templates.rss :refer [rss-feed]]
+            [lambda-blog.templates.static :refer [static-page]]))
+
+(def entry1 {:contents "Entry 1 contents"
+             :id 'entry-1
+             :summary "Entry 1 summary"
+             :tags #{'test 'entry 'foo}
+             :timestamp "2016-01-06T16:23:00"
+             :title "Test Entry 1"})
+
+(def entry2 {:author "somebody else"
+             :contents "Entry 2 contents"
+             :id 'entry-2
+             :summary "Entry 2 summary"
+             :tags #{'test 'entry 'bar}
+             :timestamp "2016-01-06T16:53:00"
+             :title "Test Entry 2"})
+
+(def static1 {:contents "Static Page 1 contents"
+              :id 'static-1
+              :timestamp "2015-12-31T18:00:00"
+              :title "Static Page 1"})
+
+(def static2 {:banner-contents "Custom banner contents"
+              :contents "Static Page 2 contents"
+              :id 'static-2
+              :timestamp "2015-12-31T18:01:00"
+              :title "Static Page 2"})
+
+(def blog {:author "me"
+           :banner-contents "Some banner contents"
+           :brand "Test Blog"
+           :entries [entry1 entry2]
+           :favicon "media/favicon.png"
+           :footer-contents "Some footer contents"
+           :footer-scripts ["js/bootstrap.min.js"
+                            "js/lambda-blog.js"]
+           :logo "media/logo-main.png"
+           :logo-button "media/logo-button.png"
+           :navigation [["Static Page 1" "./static-1.html"]
+                        ["Static Page 2" "./static-2.html"]
+                        ["Dropdown" [["test1" "test1"]
+                                     ["test2" "test2"]]]
+                        ["RSS Feed" "./index.xml"]
+                        ["Archives" "./archives.html"]]
+           :output-dir "/out/"
+           :root "localhost:8000"
+           :scripts ["js/jquery-1.11.0.min.js"
+                     "js/jquery.tablesorter.min.js"]
+           :static [static1 static2]
+           :stylesheets ["style/theme.css"
+                         "style/lambda-blog.css"
+                         "style/font-awesome.min.css"]
+           :title "Test Blog"})
+
+(defn export-blog [{:keys [entries output-dir static] :as blog}]
+  (clean blog)
+  (copy blog "resources/media" "media")
+  (copy blog "resources/style" "style")
+  (copy blog "resources/fonts" "fonts")
+  (copy blog "resources/js" "js")
+  (doseq [e entries]
+    (export blog "posts/<id>.html" entry-page e))
+  (doseq [s static]
+    (export blog "<id>.html" static-page s))
+  (export blog "index.html" recent-entries)
+  (export blog "index.xml" rss-feed)
+  (export blog "archives.html" archives)
+  (doseq [t (apply union (map :tags entries))]
+    (export blog "tags/<tag>.html" (partial entries-by-tag t) blog #(assoc % :tag t) )))


Fixup

Fixup

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

--- src/uxbox/migrations/misc.clj
+++ src/uxbox/migrations/misc.clj
@@ -0,0 +1,11 @@
+(ns uxbox.migrations.misc
+  "A namespace for define the core uxbox migrations
+  procedures like a transaction log."
+  (:require [migrante.core :as mg :refer (defmigration)]
+            [uxbox.util.template :as tmpl]))
+
+(defmigration txlog-0001
+  "A initial migration for the transaction log used mainly
+  by the persistence module."
+  :up (let [tmpl (tmpl/render "migrations/txlog-0001-up.sql")]
+        (mg/execute tmpl)))


update test

update test

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


Add id to 'header' div

Add id to 'header' div

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


Fix page styling so it doesn't have surplus height


drift configuration

drift configuration

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

--- src/er_cassandra/drift_migrate_config.clj
+++ src/er_cassandra/drift_migrate_config.clj
@@ -0,0 +1,14 @@
+(ns er-cassandra.drift-migrate-config
+  (:require
+   [plumbing.core :refer :all]
+   [er-cassandra.drift-migrations :as m]))
+
+(defnk cassandra
+  [alia-session keyspace namespace directory]
+
+  {:directory directory
+   :init (m/create-init-fn alia-session keyspace namespace)
+   :current-version m/current-version
+   :update-version m/update-version
+   :ns-content m/ns-content
+   :finished m/finished})


Jonathan/Tony Rename test handler

Jonathan/Tony Rename test handler

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

--- test/checkin/handler_test.clj
+++ test/checkin/handler_test.clj
@@ -0,0 +1,8 @@
+(ns checkin.handler-test
+  (:require [midje.sweet :refer :all]
+            [checkin.handler :refer :all]))
+
+(facts "about http response codes"
+       (fact "should return 200 on home page"
+             (:status (app {:uri "/"
+                   :request-method :get})) => 200))


start of test framework

start of test framework

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

--- test/cljs/ohds/framework.cljs
+++ test/cljs/ohds/framework.cljs
@@ -0,0 +1,31 @@
+(ns ohds.framework
+  (:require
+   [reagent.core :as reagent]))
+
+(def isClient (not (nil? (try (.-document js/window)
+                              (catch js/Object e nil)))))
+
+(def rflush reagent/flush)
+
+(defn add-test-div [name]
+  (let [doc     js/document
+        body    (.-body js/document)
+        div     (.createElement doc "div")]
+    (.appendChild body div)
+    div))
+
+(defn with-mounted-component [comp f]
+  (when isClient
+    (let [div (add-test-div "_testreagent")]
+      (let [comp (reagent/render-component comp div #(f comp div))]
+        (reagent/unmount-component-at-node div)
+        (reagent/flush)
+        (.removeChild (.-body js/document) div)))))
+
+
+(defn found-in [re div]
+  (let [res (.-innerHTML div)]
+    (if (re-find re res)
+      true
+      (do (println "Not found: " res)
+          false))))


clean up require order, add datomic.api for convenience

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


Adds in-memory storage

Adds in-memory storage

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

--- src/wordly/storage.clj
+++ src/wordly/storage.clj
@@ -0,0 +1,12 @@
+;; In order to avoid a dependency on an external datastore,
+;; we just keep the count data in memory.
+
+(ns wordly.storage)
+
+(defonce store (atom {}))
+
+(defn put [url data]
+  (swap! store assoc url data))
+
+(defn get [url]
+  (clojure.core/get @store url))


blunk

blunk

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/yokalona/threen.git/'


lortu-erabiltzailea atera

lortu-erabiltzailea atera


Issue #3 support comment

Issue #3 support comment

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


Add math utils namespace.

Add math utils namespace.

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

--- src/uxbox/math.cljs
+++ src/uxbox/math.cljs
@@ -0,0 +1,33 @@
+(ns uxbox.math
+  "A collection of math utils."
+  (:require [goog.math :as math]))
+
+(defn sin
+  "Returns the sine of a number"
+  [^number v]
+  (js/Math.sin v))
+
+(defn cos
+  "Returns the cosine of a number."
+  [^number v]
+  (js/Math.cos v))
+
+(defn tan
+  "Returns the tangent of a number."
+  [^number v]
+  (js/Math.tan v))
+
+(defn neg
+  "Negate the number"
+  [^number v]
+  (- v))
+
+(defn radiants
+  "Converts degrees to radians."
+  [^number degrees]
+  (math/toRadians degrees))
+
+(defn degrees
+  "Converts radians to degrees."
+  [^number radiants]
+  (math/toDegrees radiants))


Refactoring fix

Refactoring fix

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


extract/cites.clj: added generic citation finder/linker

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

--- src/org/altlaw/extract/cites.clj
+++ src/org/altlaw/extract/cites.clj
@@ -0,0 +1,20 @@
+(ns org.altlaw.extract.cites
+  (:import (java.net URLEncoder)))
+
+(def *citation-regex* #"\d+ (?:F\.2d|F\.3d|U\.S\.) \d+")
+
+(defn find-citations [text]
+  (re-seq *citation-regex* text))
+
+(defn link-citations [html]
+  (let [buffer (StringBuffer.)
+        matcher (re-matcher *citation-regex* html)]
+    (loop []
+      (if (.find matcher)
+        (let [cite (.group matcher)
+              link (str "" cite "")]
+          (.appendReplacement matcher buffer link)
+          (recur))
+        (do (.appendTail matcher buffer)
+            (str buffer))))))


Introducing environ

Introducing environ

--- jvm-runner/project.clj
+++ jvm-runner/project.clj
@@ -5,7 +5,10 @@
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [cheshire "5.3.1"]
                  [org.tcrawley/dynapath "0.2.3"]
-                 [junit/junit "4.11"]]
+                 [junit/junit "4.11"]
+                 [environ "0.5.0"]]
+  :plugins [[lein-environ "0.5.0"]]
   :source-paths      ["src/clojure"]
   :java-source-paths ["src/java"]
+  :env {:timeout "2000"}
   :main codewars.core)


Adding list-replication.clj completed

Adding list-replication.clj completed

error: pathspec 'hackerrank/functional_programming/clojure/tutorial/list-replication.clj' did not match any file(s) known to git

--- hackerrank/functional_programming/clojure/tutorial/list-replication.clj
+++ hackerrank/functional_programming/clojure/tutorial/list-replication.clj
@@ -0,0 +1,17 @@
+;; (defn printme [num value]
+;;   (loop [x num]
+;;     (if (> x 0)
+;;       (do
+;;         (println value)
+;;         (recur (dec x))))))
+;;
+;; ((fn counter [num lst]
+;;    (printme num (first lst))
+;;    (if (> (count (rest lst)) 0)
+;;     (counter num (rest lst)))) 2 [1 2 3 4 52])
+
+((fn [num lst]
+  (map (fn [x] (repeat num)) lst)) 2 [1 2 3])
+
+((fn [num lst]
+  (mapcat (partial repeat num) lst)) 2 [1 2 3])


Eliminate corresponding paranoid test

Eliminate corresponding paranoid test

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


Tests for `parkour.io.seqf`.

Tests for `parkour.io.seqf`.

error: pathspec 'test/parkour/io/seqf_test.clj' did not match any file(s) known to git

--- test/parkour/io/seqf_test.clj
+++ test/parkour/io/seqf_test.clj
@@ -0,0 +1,17 @@
+(ns parkour.io.seqf-test
+  (:require [clojure.test :refer :all]
+            [clojure.core.reducers :as r]
+            [parkour (conf :as conf) (fs :as fs) (wrapper :as w)
+                     (mapreduce :as mr)]
+            [parkour.io (dsink :as dsink) (seqf :as seqf)])
+  (:import [org.apache.hadoop.io LongWritable Text]))
+
+;; Just do a round-trip test for now, because I don't feel like fighting with
+;; the Java sequence file API.
+(deftest test-roundtrip
+  (let [records [["foo" 9] ["bar" 8] ["baz" 7] ["quux" 6]],
+        p (fs/path "tmp/seqf")]
+    (fs/path-delete p)
+    (with-open [out (->> p (seqf/dsink Text LongWritable) dsink/sink-for)]
+      (mr/sink out records))
+    (is (= records (->> p seqf/dseq w/unwrap (into []))))))


remove ununsed test code

remove ununsed test code

--- test/org/httpkit/server_test.clj
+++ test/org/httpkit/server_test.clj
@@ -31,12 +31,6 @@
      :headers (into {} (map (fn [idx]
                               [(str "key-" idx) (str "value-" idx)])
                             (range 0 count)))}))
-
-(map (fn [idx]
-       [(str "key-" idx) (str "value-" idx)])
-     (range 0 10))
-
-;; (into {} [[1 2]])

 (defn multipart-handler [req]
   (let [{:keys [title file]} (:params req)]


Fully pad hex number used in mount point

--- Clojure/src/ambly/repl/jsc.clj
+++ Clojure/src/ambly/repl/jsc.clj
@@ -219,7 +219,7 @@

 (defn- mount-webdav
   [repl-env bonjour-name endpoint-address endpoint-port]
-  (let [webdav-mount-point (str "/Volumes/Ambly-" (format "%X" (hash bonjour-name)))
+  (let [webdav-mount-point (str "/Volumes/Ambly-" (format "%08X" (hash bonjour-name)))
         output-dir (io/file webdav-mount-point)]
     (when (.exists output-dir)
       (shell/sh "umount" webdav-mount-point))


Make list pretty

Make list pretty


Initial commit of rule to generate identifiers for object properties

error: pathspec 'kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/pre-identifier-merge/step_a-ontology_to_ice/step_b/ontology_id_denotes_object_property.clj' did not match any file(s) known to git

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/pre-identifier-merge/step_a-ontology_to_ice/step_b/ontology_id_denotes_object_property.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/pre-identifier-merge/step_a-ontology_to_ice/step_b/ontology_id_denotes_object_property.clj
@@ -0,0 +1,19 @@
+;; ----------------------------------------------------------------------
+;; --------- Object Property Identifier Denotes Object Property ---------
+;; ----------------------------------------------------------------------
+`{:name "ontology-id-denotes-object-property-gen"
+  :description "This rule generates an object property identifier for every non-top-level object property."
+  :head ((?/id obo/IAO_0000219 ?/object_property) ;; obo:denotes
+         (?/id rdf/type ccp/IAO_EXT_0000306)) ;; ccp:object property identifier
+  :reify ([?/id {:ln (:localname ?/object_property)
+                 :ns "ccp" :prefix "" :suffix ""}])
+  :sparql-string "prefix ccp: <http://ccp.ucdenver.edu/obo/ext/>
+                  prefix obo: <http://purl.obolibrary.org/obo/>
+                  select ?object_property {
+                  ?property_id rdf:type ccp:IAO_EXT_0000308 . # ccp:top-level object property identifier
+                  ?property_id obo:IAO_0000219 ?top_level_property . # obo:denotes
+                  ?object_property rdfs:subPropertyOf* ?top_level_property .
+                  minus {?object_property owl:deprecated true} .
+                  minus {?object_property rdf:type ccp:IAO_EXT_0000308} # ccp:top-level object property identifier
+                  }"
+  }


Optimization of db-spec

Optimization of db-spec

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


add icons to cat-item switches for visual reinforcement


add q4

add q4

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

--- q4.clj
+++ q4.clj
@@ -0,0 +1,11 @@
+(defn cutbar-rec [m n current]
+  (cond
+    (>= current n) 0
+    (< current m) (inc (cutbar-rec m n (* 2 current)))
+    :else (inc (cutbar-rec m n (+ current m)))))
+
+(defn cutbar [m n]
+  (cutbar-rec m n 1))
+
+(def answer-1 (cutbar 3 20))
+(def answer-2 (cutbar 5 100))


auth namespace

auth namespace

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

--- src/clj/swarmpit/auth.clj
+++ src/clj/swarmpit/auth.clj
@@ -0,0 +1,20 @@
+(ns swarmpit.auth
+  (:require [clj-jwt.core :refer :all]
+            [clj-jwt.key :refer [private-key public-key]]
+            [clj-time.core :refer [now plus days]]))
+
+(def rsa-prv-key (private-key "rsa/private.key" "pass phrase"))
+(def rsa-pub-key (public-key "rsa/public.key"))
+
+(def claim
+  {:iss "foo"
+   :exp (plus (now) (days 1))
+   :iat (now)})
+
+(defn generate-token
+  [claim]
+  (-> claim jwt (sign :RS256 rsa-prv-key) to-str))
+
+(defn verify-token
+  [token]
+  (-> token str->jwt (verify rsa-pub-key)))


Use correct notification type for tv-signup search


Added stub for text renderer

Added stub for text renderer

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

--- src/clouseau/text_renderer.clj
+++ src/clouseau/text_renderer.clj
@@ -0,0 +1,41 @@
+;;;
+;;;   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.text-renderer)
+
+


Add password-protected repository in sample.project.clj.

--- sample.project.clj
+++ sample.project.clj
@@ -71,8 +71,10 @@
   :warn-on-reflection true
   ;; Set this in order to only use the :repositories you list below.
   :omit-default-repositories true
-  :repositories { "java.net" "http://download.java.net/maven/2"
-                  "modularity" "http://m2.modularity.net.au/releases"}
+  :repositories {"java.net" "http://download.java.net/maven/2"
+                 "private" {:url "http://private.repo"
+                            :username "milgrim"
+                            :password "locative.1"}}
   ;; If you'd rather use a different directory structure, you can set these.
   :source-path "src/main/clojure"
   :library-path "target/dependency"


CMR-2018: Added test file

CMR-2018: Added test file

error: pathspec 'system-int-test/test/cmr/system_int_test/search/umm_spec_integration_test.clj' did not match any file(s) known to git

--- system-int-test/test/cmr/system_int_test/search/umm_spec_integration_test.clj
+++ system-int-test/test/cmr/system_int_test/search/umm_spec_integration_test.clj
@@ -0,0 +1,23 @@
+(ns cmr.system-int-test.search.umm-spec-integration-test.clj
+  "Round trip test for MMT ingesting to CMR. Converts example UMM-JSON to ISO-19115 then ingests
+  and searches based on various fields."
+  (:require [clojure.test :refer :all]
+            [cmr.system-int-test.utils.ingest-util :as ingest]
+            [cmr.umm-spec.models.collection :as umm-c]
+            [cmr.umm-spec.models.common :as umm-cmn]
+            [clj-time.core :as t]
+            [cmr.umm-spec.core :as umm-spec]
+            [cmr.common.mime-types :as mt]
+            [cmr.umm-spec.test.expected-conversion :as expected-conversion]))
+
+(deftest translate-metadata
+  (doseq [input-format valid-formats
+          output-format valid-formats]
+    (testing (format "Translating %s to %s" (name input-format) (name output-format))
+      (let [input-str (umm-spec/generate-metadata :collection input-format expected-conversion/example-record)
+            expected (expected-conversion/convert expected-conversion/example-record input-format output-format)
+            {:keys [status headers body]} (ingest/translate-metadata :collection input-format input-str output-format)
+            content-type (:content-type headers)]
+        (is (= 200 status))
+        (is (= (mt/format->mime-type output-format) content-type))
+        (is (= expected (umm-spec/parse-metadata :collection output-format body))))))


Added boolean query matcher

Added boolean query matcher

error: pathspec 'src/help_me_im_dumb/query-engine.clj' did not match any file(s) known to git

--- src/help_me_im_dumb/query-engine.clj
+++ src/help_me_im_dumb/query-engine.clj
@@ -0,0 +1,18 @@
+(ns help-me-im-dumb.query-engine
+  (:require [help-me-im-dumb.index :as index]))
+
+(declare boolean-query-matcher)
+
+(defn query->results
+  [matcher q]
+  (map index/docid->url (matcher q)))
+
+(defn boolean-query-matcher
+  "Super dumb query matcher. Returns all docs with all words"
+  [q]
+  (apply
+   clojure.set/intersection
+   (map
+    #(into #{} (index/term->postings %))
+    (clojure.string/split q #"\s+"))))
+


Add statistics ns that had been lying around (for use with private c3)

error: pathspec 'src/lt/plugins/kukui/statistics.cljs' did not match any file(s) known to git

--- src/lt/plugins/kukui/statistics.cljs
+++ src/lt/plugins/kukui/statistics.cljs
@@ -0,0 +1,62 @@
+(ns lt.plugins.kukui.statistics
+  (:require [lt.plugins.kukui.db :as db]
+            [lt.objs.command :as cmd]))
+
+(defn chart [{:keys [data type] :as options}]
+  (assert (and data type))
+  (let [defaults (cond
+                  (= :pie type) {:tooltip {:format {:value
+                                                    (fn [val ratio id]
+                                                      val)}}}
+                  :else {})]
+    (cmd/exec!
+     :c3.open-chart
+     (merge defaults
+            {:data {:columns data :type (name type)}}))))
+
+(comment
+  (chart {:data (map (fn [[type tag-map]]
+                       [type (apply + (vals tag-map))])
+                     (db/all-tag-counts-by-type-and-tag))
+          :type :pie})
+
+  ;; Average # of tags per type item?
+  (chart {:data (db/all-attr-counts :type)
+          :type :pie})
+
+  ;; Scatter of tag counts vs type counts
+  (let [type-counts (into {} (db/all-attr-counts :type))
+        tag-counts (into {}
+                         (map (fn [[type tag-map]]
+                                [type (apply + (vals tag-map))])
+                              (db/all-tag-counts-by-type-and-tag)))
+        data (mapcat
+              (fn [type]
+                [[(str type "_x") (get type-counts type 0)]
+                 [type (get tag-counts type 0)]])
+              (set (keys type-counts) (keys tag-counts)))]
+    (cmd/exec!
+     :c3.open-chart
+     {:data {:xs (into {}
+                       (map #(vector % (str % "_x"))
+                            (set (keys type-counts keys tag-conts))))
+             :columns
+             data
+             :type "scatter"}
+      }))
+
+  ;; For each type, which types associate-with/are-associated-by other types?
+
+
+  (cmd/exec!
+   :c3.open-chart
+   {:data { ;:xs {:hey "hey_x"}
+           :labels {:format {:y (fn [v id]
+                                  ;; (prn v id)
+                                  id)}}
+           :columns
+           [#_["hey_x" 4 10]
+            ["hey" 5 1]]
+           :type "line"}
+    })
+  )


Populate feed_types table

Populate feed_types table

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/demas/cowl.git/'


Prettify documentation a bit

Prettify documentation a bit

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/manenko/re-widgets.git/'


Tests for constructs functions

Tests for constructs functions

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

--- test/tenor/test/constructs.clj
+++ test/tenor/test/constructs.clj
@@ -0,0 +1,57 @@
+(ns tenor.test.constructs
+  (:use [tenor.constructs]
+        [tenor.melody]
+        [tenor.harmony]
+        [clojure.test]))
+
+(defn is-sorted [a-list]
+  (apply <= a-list))
+
+(deftest test-make-note
+  (is (= (make-note "F4") :F4)))
+
+(deftest test-generate-meter
+  (let [meter (generate-meter 11)]
+    (is (= (reduce + meter) 11))))
+
+(deftest test-segment-beat
+  (let [segmented-beat (segment-beat 4 4)]
+    (is (is-sorted segmented-beat))
+    (is (<= (last segmented-beat) 16))))
+
+(deftest test-generate-random-scale
+  (let [random-scale (generate-random-scale)]
+    (is (is-sorted random-scale))
+    (is (= 8 (count random-scale)))))
+
+(deftest test-segment-measure
+  (let [segmented-measure (segment-measure [1 4 4 3])]
+    (is (is-sorted segmented-measure))
+    (is (<= (last segmented-measure) 12))))
+
+(deftest test-string-measures
+  (let [strung-measures (string-measures '((1 2 3) (1 3 4)) 4)]
+    (is (is-sorted strung-measures))
+    (is (= '(1 2 3 5 7 8) strung-measures))))
+
+(deftest test-generate-intervals
+  (let [generated-intervals (generate-intervals
+                              conjunct-motion
+                              (scale :a3 :minor) 8)]
+    (is (= 8 (count generated-intervals)))
+    (is (= 1 (first generated-intervals)))
+    (is (<= (last (sort generated-intervals)) 8))))
+
+(deftest test-intervals->notes
+  (let [notes (intervals->notes '(1 2 3) (scale :a3 :minor))]
+    (is (= '(57 59 60) notes))))
+
+(deftest test-generate-rhythm
+  (let [generated-rhythm (generate-rhythm 4 4)]
+    (is (is-sorted generated-rhythm))
+    (is (<= (last generated-rhythm) 16))))
+
+(deftest test-generate-entity-map
+  (let [entity-map (generate-entity-map conjunct-motion 1 2)]
+    (is (= 1 (:pos (first entity-map))))))
+


solved 4Clojure: Map Default

solved 4Clojure: Map Default

error: pathspec 'src/4clojure/map-defaults.clj' did not match any file(s) known to git

--- src/4clojure/map-defaults.clj
+++ src/4clojure/map-defaults.clj
@@ -0,0 +1,14 @@
+(defn map-default [default coll]
+  (assoc {} (first coll) default)
+  (loop [l {} r coll]
+    (if (empty? r)
+      l
+      (recur
+        (assoc l (first r) default)
+        (rest r)))))
+
+(= 2 (:foo {:bar 0, :baz 1} 2))
+
+(= (map-default 0 [:a :b :c]) {:a 0 :b 0 :c 0})
+(= (map-default "x" [1 2 3]) {1 "x" 2 "x" 3 "x"})
+(= (map-default [:a :b] [:foo :bar]) {:foo [:a :b] :bar [:a :b]})


Add namespace for concurrency primitives.

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

--- src/apio/concurrency/core.clj
+++ src/apio/concurrency/core.clj
@@ -0,0 +1,6 @@
+(ns apio.concurrency.core
+  (import (java.util.concurrent ForkJoinPool)))
+
+;; TODO: initialize forkjoin pool in dynamic context
+;; using dynamic loaded configuration.
+(def *thread-pool* (ForkJoinPool.))


add api token workflow

add api token workflow

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

--- src/clj/dokkaa_builder/workflows.clj
+++ src/clj/dokkaa_builder/workflows.clj
@@ -0,0 +1,16 @@
+(ns dokkaa-builder.workflows
+  (:require [cemerick.friend :as friend]
+            [cheshire.core :as j]
+            [dokkaa-builder.redis :refer [wcar*]]
+            [dokkaa-builder.auth :as auth]
+            [ring.util.request :as request]))
+
+
+(defn api-token []
+  (fn [req]
+    (when-let [token (get-in req [:params :api-token])]
+      (when-let [user (auth/token->user token)]
+        (vary-meta {:identity {:user user} :roles #{:user}}
+                   merge {::friend/workflow :api-token
+                          ::friend/redirect-on-auth? false
+                          :type ::friend/auth})))))


[WM] Bump all rabbit timeouts to 10 secs

Seeing 404s because sometimes these requests take longer than 5
secs (but so far haven't seen any take longer than 10).

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


created balance module

created balance module

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


Changing log

Changing log

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/iot-paas-home/telegram-iot-gateway.git/'


Add a test for the permanent fs

Add a test for the permanent fs

error: pathspec 'test/doctopus/storage/storage_impls/permanent_fs_test.clj' did not match any file(s) known to git

--- test/doctopus/storage/storage_impls/permanent_fs_test.clj
+++ test/doctopus/storage/storage_impls/permanent_fs_test.clj
@@ -0,0 +1,13 @@
+(ns doctopus.storage.storage-impls.permanent-fs-test
+  (:require [clojure.test :refer :all]
+            [doctopus.files :as files]
+            [doctopus.storage.storage-impls.permanent-fs :refer :all]
+            [me.raynes.fs :as fs]))
+
+(def test-vec (files/read-html "resources/test/html"))
+
+(deftest permanent-fs-test
+  (testing "Can we save to the permanent filesystem?"
+    (save-fn ))
+  (testing "Can we load from the permanent filesystem?")
+  (testing "Can we remove from the permanent filesystem?"))


Percentile watermark test.

Percentile watermark test.

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

--- test/onyx/windowing/trigger_percentile_watermark_test.clj
+++ test/onyx/windowing/trigger_percentile_watermark_test.clj
@@ -0,0 +1,50 @@
+(ns onyx.windowing.trigger-percentile-watermark-test
+  (:require [clojure.test :refer [deftest is]]
+            [onyx.triggers.triggers-api :as api]
+            [onyx.api]))
+
+(deftest watermark-test
+  (let [t 1444443468904
+        window {:window/id :collect-segments
+                :window/task :identity
+                :window/type :fixed
+                :window/aggregation :onyx.windowing.aggregation/count
+                :window/window-key :event-time
+                :window/range [5 :minutes]}
+        trigger {:trigger/window-id :collect-segments
+                 :trigger/refinement :accumulating
+                 :trigger/on :percentile-watermark
+                 :trigger/watermark-percentage 0.50
+                 :trigger/sync ::no-op
+                 :trigger/id :trigger-id}
+        segment {:event-time t}
+        event {}]
+    (is
+     (api/trigger-fire?
+      event trigger
+      {:window window :segment segment
+       :lower-extent (- t 75)
+       :upper-extent (+ t 25)})))
+
+  (let [t 1444443468904
+        window {:window/id :collect-segments
+                :window/task :identity
+                :window/type :fixed
+                :window/aggregation :onyx.windowing.aggregation/count
+                :window/window-key :event-time
+                :window/range [5 :minutes]}
+        trigger {:trigger/window-id :collect-segments
+                 :trigger/refinement :accumulating
+                 :trigger/on :percentile-watermark
+                 :trigger/watermark-percentage 0.50
+                 :trigger/sync ::no-op
+                 :trigger/id :trigger-id}
+        segment {:event-time t}
+        event {}]
+    (is
+     (not
+      (api/trigger-fire?
+       event trigger
+       {:window window :segment segment
+        :lower-extent (- t 25)
+        :upper-extent (+ t 75)})))))


Add require for ovation.logging

Add require for ovation.logging

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


not sure why some unit tests are passing empty bodies `{}`. But ignore those

--- test/metabase/http_client.clj
+++ test/metabase/http_client.clj
@@ -65,9 +65,9 @@
    (let [request-map (cond-> {:accept :json
                               :headers {"X-METABASE-SESSION" (when credentials (if (map? credentials) (authenticate credentials)
                                                                                credentials))}}
-                       http-body (assoc
-                                  :content-type :json
-                                  :body (cheshire/generate-string http-body)))
+                       (not (empty? http-body)) (assoc
+                                                 :content-type :json
+                                                 :body (cheshire/generate-string http-body)))
         request-fn (case method
                      :get  client/get
                      :post client/post


Serve custom directory when :http-server-root is present

compojure.route/resources takes in map for options

--- support/src/figwheel/core.clj
+++ support/src/figwheel/core.clj
@@ -49,7 +49,10 @@
    (if ring-handler
      (routes (GET "/figwheel-ws" [] (reload-handler server-state)) ring-handler)
      (routes (GET "/figwheel-ws" [] (reload-handler server-state))))
-   {:port server-port}))
+   {:port server-port
+
+
+    }))

 (defn append-msg [q msg]
   (conj (take 30 q) msg))
@@ -263,7 +266,7 @@

 (defn start-static-server [{:keys [js-dirs http-server-root] :as opts}]
   (let [http-s-root (or http-server-root "public")]
-    (start-server (merge opts {:ring-handler (route/resources "/" :root http-s-root)
+    (start-server (merge opts {:ring-handler (route/resources "/" {:root http-s-root})
                                :http-server-root http-s-root}))))

 (defn stop-server [{:keys [http-server]}]


Testing Jaro Winkler

Testing Jaro Winkler

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


library of figures

library of figures

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


JVM options -server and concurrent mark & sweep gc

--- project.clj
+++ project.clj
@@ -52,11 +52,15 @@
   :ring {:handler ruuvi-server.launcher/ring-handler,
          :init ruuvi-server.launcher/ring-init,
          :destroy ruuvi-server.launcher/ring-destroy}
+
   :profiles {:dev
              {:dependencies
               [
                [midje "1.4.0" :exclusions [org.clojure/clojure]]
                ]}}
+
+  :jvm-opts ["-server" "-XX:+UseConcMarkSweepGC"]
+
   ;; enable OTF (on-the-fly compilation)
   ;; :hooks [lein-otf.hooks]


Version 0.16.6-SNAPSHOT

Version 0.16.6-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojars-web "0.16.5"
+(defproject clojars-web "0.16.6-SNAPSHOT"
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/tools.cli "0.2.1"]
                  [org.apache.maven/maven-model "3.0.4"


unbump teller dep

unbump teller dep

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


Added leiningen-run to the project. Now you can run it with: lein run

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/croeder/clojure-koans-work.git/'


Enable AOT compilation

Enable AOT compilation

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


Kehaar 0.7.0 with bounded thread pools

Kehaar 0.7.0 with bounded thread pools

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


[WM] update dependencies to latest versions

pedestal-toolbox in particular contains a bug fix we should get into
every -http-api component post-haste.

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-http-api.git/'


Update project.clj to best practicies

Update project.clj to best practicies

1. Don't aot main by default, but aot everything for the uberjar
2. Use seperate target directories
3. Use composite profiles to enable personal overrides of parts
of a profile

--- project.clj
+++ project.clj
@@ -1,4 +1,5 @@
 (defproject clojars-web "0.18.1-SNAPSHOT"
+  :min-lein-version "2.0.0"
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/tools.cli "0.2.1"]
                  [yeller-clojure-client "1.2.1"]
@@ -36,17 +37,23 @@
                  [yesql "0.5.1"]
                  [com.zaxxer/HikariCP "2.4.1"]
                  [org.slf4j/slf4j-nop "1.7.7"]]
-  :profiles {:dev {:dependencies [[kerodon "0.7.0"]
-                                  [clj-http-lite "0.2.1"]]
-                   :resource-paths ["local-resources"]}}
-  :aliases {"migrate" ["run" "-m" "clojars.db.migrate"]}
-  :main clojars.main
-  :min-lein-version "2.0.0"
+  :main ^:skip-aot clojars.main
+  :target-path "target/%s/"
   :release-tasks [["vcs" "assert-committed"]
                   ["change" "version" "leiningen.release/bump-version" "release"]
                   ["vcs" "commit"]
                   ["vcs" "tag"]
                   ["change" "version" "leiningen.release/bump-version"]
                   ["vcs" "commit"]
-                  ["vcs" "push"]])
-
+                  ["vcs" "push"]]
+  :aliases {"migrate" ["run" "-m" "clojars.db.migrate"]}
+  :profiles
+  {:dev  [:project/dev  :profiles/dev]
+   :test [:project/test :profiles/test]
+   :uberjar {:aot :all}
+   :profiles/dev  {}
+   :profiles/test {}
+   :project/dev   {:dependencies [[kerodon "0.7.0"]
+                                  [clj-http-lite "0.2.1"]]
+                   :resource-paths ["local-resources"]}
+   :project/test  {}})


Fixed bug in counting users

Fixed bug in counting users

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


Handle user defined tagged literals when parsing application/edn. Users can define their own tagged literals via data_readers.clj or associng them to *data-readers*. This map has to be passed into clojure.edn/read-string or clojure.tools.reader.edn/read-string as the first argument. Otherwise they won't get recognized and an exception is thrown. With this change edn/read-string has the same behaviour as core/read-string minus the security problems.

--- src/clj_http/client.clj
+++ src/clj_http/client.clj
@@ -42,7 +42,8 @@
   [& args]
   {:pre [edn-enabled?]}
   (apply (ns-resolve (symbol "clojure.tools.reader.edn")
-                     (symbol "read-string")) args))
+                     (symbol "read-string"))
+         {:readers @(resolve '*data-readers*)} args))

 (defn ^:dynamic parse-html
   "Resolve and apply crouton's HTML parsing."


Add a basic drawing cell function

Add a basic drawing cell function

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

--- src/cljs/life/core.cljs
+++ src/cljs/life/core.cljs
@@ -0,0 +1,15 @@
+(ns life.core
+  (:require [om.core :as om :include-macros true]
+            [om.dom :as dom :include-macros true]))
+
+(defonce app-state (atom))
+
+(enable-console-print!)
+
+(defn draw-cells []
+  (let [context (.getContext (.getElementById js/document "canvas") "2d")]
+    (doseq [n (take 10 (repeatedly 1)) ]
+      (.fillRect context (* n 15) (* n 15) 10 10))))
+
+(defn main []
+  (draw-cells))


Always show dependents overflow page

Always show dependents overflow page

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


add rountrip test for client to core binding

--- test/clj_http/client_test.clj
+++ test/clj_http/client_test.clj
@@ -1,6 +1,17 @@
 (ns clj-http.client-test
   (:use clojure.test)
   (:require [clj-http.client :as client]))
+
+(def base-req
+  {:scheme "http"
+   :server-name "localhost"
+   :server-port 8080})
+
+(deftest rountrip
+  (let [resp (client/request (merge base-req {:uri "/get" :method :get}))]
+    (is (= 200 (:status resp)))
+    (is (= "4" (get-in resp [:headers "content-length"])))
+    (is (= "get\n" (:body resp)))))

 (def echo-client identity)


Remove duplicate statistics for publish-async

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


Introducing equality test vectors

Introducing equality test vectors

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


Cranky note.

Cranky note.

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


Egileak eta etiketak koma bidez aukeran

Egileak eta etiketak koma bidez aukeran

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


Fixed error when running the app locally.

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/danielfm/licensator.git/'


remove core_test, nothing to test yet

remove core_test, nothing to test yet

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


Added type hints and explicitly boxed the recur arg (#122)

During large file uploading through-put was ~2MB/s a couple of type
hints later and we're looking at ~200MB/s.

--- src/yada/bmh.clj
+++ src/yada/bmh.clj
@@ -14,7 +14,7 @@
 ;; T[pattern[i]] ← length(pattern) - 1 - i
 ;; return T

-(defn- preprocess [pattern]
+(defn- preprocess [^bytes pattern]
   (let [T (byte-array 256)]
     (dotimes [i 255]
       (aset-byte T i (count pattern)))
@@ -39,16 +39,17 @@
 ;;     skip ← skip + T[haystack[skip + length(needle) - 1]]
 ;;   return not-found

-(defn search [{:keys [length index pattern]} haystack & [limit]]
+(defn search [{:keys [length ^bytes index ^bytes pattern]} ^bytes haystack & [limit]]
   (let [limit (or limit (count haystack))]
-    (loop [skip 0 founds []]
+    (loop [skip (long 0) founds []]
       (if (>= (- limit skip) length)
         (let [found
               (loop [i (dec length)]
                 (when (= (aget haystack (+ skip i)) (aget pattern i))
                   (if (= i 0) skip (recur (dec i)))))]
-          (recur (+ skip (let [x (aget haystack (+ skip length -1))]
-                           (if (pos? x) (aget index x) length)))
+          (recur (long
+                  (+ skip (let [x (aget haystack (+ skip length -1))]
+                            (if (pos? x) (aget index x) length))))
                  (if found (conj founds found) founds)))
         ;; Return
         founds))))


Fixing broken logic on producer

Fixing broken logic on producer

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


Allow string or integer codes

Allow string or integer codes

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


Add a simple test for init

Add a simple test for init

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

--- worker/test/worker/main_test.clj
+++ worker/test/worker/main_test.clj
@@ -0,0 +1,7 @@
+(ns worker.main-test
+  (:use clojure.test
+        worker.main))
+
+(deftest init-test
+  (is (= nil (init "http://github.com/peritus/geocommit" "github.com/peritus/geocommit"))))
+


consistency, but not necessarily better

consistency, but not necessarily better

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


Tasks to load and clean tools

Tasks to load and clean tools

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

--- src/staircase/tasks.clj
+++ src/staircase/tasks.clj
@@ -0,0 +1,53 @@
+(ns staircase.tasks
+  (:import [java.io FileNotFoundException])
+  (use [clojure.tools.logging :only (info)]
+       [clojure.java.io :as io]
+       staircase.config
+       clj-jgit.porcelain))
+
+(defn- clone-repo [uri options]
+  (git-clone2 uri options)
+  (load-repo (:path options)))
+
+(defn- load-or-clone [uri path options]
+  (try
+    (load-repo path)
+    (catch FileNotFoundException fnf (clone-repo uri (assoc options :path path)))))
+
+(defn- process-args [names]
+  (if-let [settings (config :tools)]
+    (let [tool-names  (keys settings)
+          names       (if (empty? names) tool-names (filter (set names) tool-names))]
+      [settings names])
+    [{} []]))
+
+;; Pull in all the configured tools.
+(defn load-tools [& names]
+  (let [[settings names] (process-args names)]
+    (doseq [tool-name names
+            :let [tool-settings (settings tool-name)
+                  repo-uri  (:uri tool-settings)
+                  repo-path (str "tools/" (name tool-name))
+                  options   (or (:options tool-settings) {})]]
+      (info "Updating" repo-path "from" repo-uri "with options:" (prn-str options))
+      (let [repo         (load-or-clone repo-uri repo-path options)
+            fetch-result (git-fetch repo)
+            git-ref      (or (:ref tool-settings) "master")]
+        (git-checkout repo git-ref)))))
+
+(defn- rm-r [path]
+  (let [f' (fn [f file] ;; y-combinator for non-tail recursion.
+             (when (.exists file)
+              (when (.isDirectory file)
+                (doseq [child (.listFiles file)]
+                  (f f child)))
+              (io/delete-file file)))]
+    (f' f' (io/as-file path))))
+
+(defn clean-tools [& names]
+  (let [[settings names] (process-args names)]
+    (doseq [tool-name names
+            :let [repo-path (str "tools/" (name tool-name))]]
+      (info "Deleting" repo-path)
+      (rm-r repo-path))))
+


First pass at config component

First pass at config component

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

--- src/strange_coop/components/config.clj
+++ src/strange_coop/components/config.clj
@@ -0,0 +1,91 @@
+(ns strange-coop.components.config
+  (:require [com.stuartsierra.component :as component]
+            [environ.core :refer [env]]
+            [strange-coop.util :as util :refer [log]]))
+
+(defn deep-merge
+  "Like merge, but merges maps recursively."
+  [& maps]
+  (if (every? map? maps)
+    (apply merge-with deep-merge maps)
+    (last maps)))
+
+(defn deep-merge-in
+  [m path & maps]
+  (apply update-in m path deep-merge maps))
+
+(def defaults
+  {:nrepl-port 9999
+   :satellite {:url "http://localhost:3000/"}
+   :channels {:buffer-size 100}
+   :day-state-machine {:day-threshold   0.13
+                       :night-threshold 0.03}
+   :pins  {:motor-hb     {:pins   [16 17 18]
+                          :header :P8}}
+           :light-sensor [:P9 33]
+           :temp-sensor  [:P9 35]
+           :floor-button [:P8 11 :normally-off]
+           :roof-button  [:P8 12 :normally-on]})
+
+(defn ->long [x]
+  (Long/parseLong x))
+
+(def rules
+  "Mapping of env keys to parsing options"
+  {:nrepl-port         {:parse ->long}
+   :satellite-url      {:path [:satellite :url]}
+   :satellite-username {:path [:satellite :username]}
+   :satellite-password {:path [:satellite :password]}
+   })
+
+(defn get-environ-config [rules env]
+  (reduce
+    (fn [config [name {:keys [parse path]}]]
+      (assoc-in config (or path [name]) ((or parse identity) (get env name))))
+    {}
+    rules))
+
+(defrecord Config [overrides config]
+  component/Lifecycle
+  (start [component]
+    (log "Starting config component")
+    (deep-merge-in component [:config]
+                   defaults
+                   (get-environ-config rules env)
+                   overrides))
+  (stop [component]
+    (log "Stopping config component")
+    (dissoc component :config)))
+
+(defn new-config
+  [overrides]
+  (map->Config {:overrides overrides}))
+
+(defn get-in-config
+  "Little helper for making getting config variables less awkward"
+  ([component path]
+   (get-in-config component path nil))
+  ([component path default]
+   (get-in component (into [:config :config] path) default)))
+
+
+;;; Sketches
+;;; ========
+
+;; Maybe we should just scrap having a separate level for :config... ???
+
+;(defn make-rule
+  ;([name]
+   ;{:name name :path name})
+  ;([name k v & {:as kw-args}]
+   ;(merge (make-rule name) {k v} kw-args)))
+;(def rule make-rule)
+;(defmacro with-merges
+  ;[{:keys [subpath parse]}
+     ;(rule :motor-hb-n-pins
+           ;:path [:motor-hb :n-pins]
+           ;:parse ->long)
+     ;(rule :motor-hb-power-pin
+           ;:path [:motor-hb :power-pin]
+           ;:parse ->long)
+


Record the file offset between reads.

Record the file offset between reads.

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/cstorey/nrod.git/'


Upgrade potemkin

Upgrade potemkin

--- project.clj
+++ project.clj
@@ -23,7 +23,7 @@
    [metosin/ring-http-response "0.6.5"]
    [metosin/ring-swagger "0.22.1" :exclusions [potemkin]]
    [prismatic/schema "1.0.4"]
-   [potemkin "0.4.1" :exclusions [riddley]]
+   [potemkin "0.4.2" :exclusions [riddley]]
    [ring-basic-authentication "1.0.5"]
    [org.clojure/core.async "0.2.374"]
    [org.clojure/tools.reader "0.9.1"]


Instructions for choosing logging

Instructions for choosing logging


Version 1.15.0

Version 1.15.0

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


Use kehaar's version of langohr

Use kehaar's version of langohr

It has been tested with that version and I think it makes more sense to let it bring this in.

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


updated environ to 1.0

updated environ to 1.0

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/ananthmv/stream.git/'


Update deps to latest versions

Update deps to latest versions

including clojure to 1.8.0

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


bump deps

bump deps

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


Update Clojure and core.async

Update Clojure and core.async


Version 161-SNAPSHOT

Version 161-SNAPSHOT

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/tobias/clojars-web.git/'


Upgrade garden

Upgrade garden

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


Version 1.9.1

Version 1.9.1


Add description & URL to project.clj

Add description & URL to project.clj

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


[WM] Increase preference.create timeout to 10s

Trying to debug some behavior I'm seeing in prod with this.

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


Higher level utils for working with events

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

--- src/clj_chrome_devtools/events.clj
+++ src/clj_chrome_devtools/events.clj
@@ -0,0 +1,58 @@
+(ns clj-chrome-devtools.events
+  "Listening to events coming from Chrome."
+  (:require [clj-chrome-devtools.impl.connection :as connection]
+            [clojure.core.async :as async :refer [go-loop go <! >! <!! >!!]]))
+
+(def default-wait-ms 30000)
+
+(defn listen-to
+  "Subscribe to listen to given domain event. Both domain and event are keywords.
+  Returns a core.async channel where events can be read from."
+  [domain event]
+  (connection/listen-to domain event))
+
+
+(defn wait-for-event
+  "Synchronously wait for an event with specific parameters."
+  ([domain event params]
+   (wait-for-event domain event params 30000))
+  ([domain event params timeout-ms]
+   (let [timeout-ch (async/timeout timeout-ms)
+         ch (listen-to domain event)
+         read! #(async/alts!! [timeout-ch ch])
+         cleanup! #(async/close! ch)]
+     (loop [[val chan] (read!)]
+       (cond
+         (= chan timeout-ch)
+         (do (cleanup!)
+             (throw (ex-info "Timeout! Specified event was not received."
+                             {:domain domain :event event :params params
+                              :timeout timeout-ms})))
+
+            (= params (select-keys (:params val) (keys params)))
+            (do (cleanup!)
+                (:params val))
+
+            :default
+            (recur (read!)))))))
+
+(defmacro with-event-wait
+  "Execute body that causes some later events and wait for the event before returning.
+  If the event is not received after waiting timeout-ms milliseconds, an exception is thrown."
+  ([domain event body]
+   `(with-event-wait ~domain ~event ~default-wait-ms ~body))
+  ([domain event timeout-ms body]
+   `(let [domain# ~domain
+          event# ~event
+          timeout-ms# ~timeout-ms
+          ch# (listen-to domain# event#)
+          p# (async/promise-chan)]
+      ;; Fulfill promise channel from event channel
+      (go (>! p# (<! ch#)))
+      (let [response# ~body
+            t# (async/timeout timeout-ms#)
+            [_# chan#] (async/alts!! [t# p#])]
+        (if (= chan# t#)
+          (throw (ex-info "Timeout! Specified event was not received."
+                          {:domain domain# :event event# :timeout timeout-ms#}))
+          response#)))))


Clean up rest specs

Clean up rest specs

- Replace hard-coded status codes with const-defined ones in HttpStatus
- DRY out assertions for status codes and body contents.

--- spec/freefrog/rest_spec.clj
+++ spec/freefrog/rest_spec.clj
@@ -24,7 +24,8 @@
             [freefrog.rest :as r]
             [freefrog.persistence :as p])
   (:use [ring.adapter.jetty] [ring.util.codec :only [url-encode]])
-  (:import [javax.persistence EntityNotFoundException]))
+  (:import [javax.persistence EntityNotFoundException]
+           [org.apache.http HttpStatus]))

 (def test-server (ref nil))

@@ -65,6 +66,18 @@
 (defn govt-meeting-not-found-thrower [& args]
   (throw (EntityNotFoundException. "Governance meeting does not exist")))

+(defmacro it-responds-with-status [expected-status response]
+  `(it "should return the right response code"
+    (should= ~expected-status (:status ~response))))
+
+(defmacro it-responds-with-body [expected-body response]
+  `(it "should contain the appropriate body"
+    (should= ~expected-body (:body ~response))))
+
+(defmacro it-responds-with-body-containing [expected-body response]
+  `(it "should contain the appropriate body"
+    (should-contain ~expected-body (:body ~response))))
+
 (describe "governance rest api"
   (before-all (start-test-server))
   (after-all (stop-test-server))
@@ -79,23 +92,22 @@

     (context "requesting the governance endpoint"
       (with response (http-request :get "/circles/1234/governance"))
-      (it "should return a 404"
-        (should= 404 (:status @response))
-        (should= "Circle does not exist" (:body @response))))
+
+      (it-responds-with-status HttpStatus/SC_NOT_FOUND @response)
+      (it-responds-with-body "Circle does not exist" @response))

     (context "posting to the governance endpoint"
       (with response (http-request :post "/circles/1234/governance"))
-      (it "should return a 400"
-        (should= 400 (:status @response))
-        (should-contain "Circle does not exist" (:body @response))))
+
+      (it-responds-with-status HttpStatus/SC_BAD_REQUEST @response)
+      (it-responds-with-body "Circle does not exist" @response))

     (context "putting to the agenda endpoint"
       (with response (http-request :put
                                    "/circles/1234/governance/5678/agenda"
                                    {:body "New agenda"}))
-      (it "should return a 400"
-        (should= 400 (:status @response))
-        (should-contain "Circle does not exist" (:body @response)))))
+      (it-responds-with-status HttpStatus/SC_BAD_REQUEST @response)
+      (it-responds-with-body "Circle does not exist" @response)))

   (context "with a circle"
     (around [it]
@@ -105,21 +117,23 @@

     (context "requesting the governance endpoint"
       (with response (http-request :get "/circles/1234/governance"))
-      (it "should return the entire governance document"
-        (should= 200 (:status @response))
-        (should= (json/generate-string sample-gov-log) (:body @response))))
-
-    (context "posting to the governance endpoint with an unsupported content-type"
+
+      (it-responds-with-status HttpStatus/SC_OK @response)
+      (it-responds-with-body (json/generate-string sample-gov-log)
+                                        @response))
+
+    (context "posting to the governance endpoint with application/json"
       (with response (http-request :post
                                    "/circles/1234/governance"
                                    {:content-type "application/json"}))
-      (it "should return a 415"
-        (should= 415 (:status @response))))
+      (it "should not respond to application/json"
+        (should= HttpStatus/SC_UNSUPPORTED_MEDIA_TYPE (:status @response))))

     (context "posting to the governance endpoint"
       (with response (http-request :post "/circles/1234/governance"))
-      (it "should return a 201"
-        (should= 201 (:status @response))
+
+      (it-responds-with-status HttpStatus/SC_CREATED @response)
+      (it "should return the location of the newly created governance log"
         (should= (str host-url "/circles/1234/governance/5678")
                  (get-location @response))))

@@ -132,9 +146,9 @@
         (with response (http-request :put
                                      "/circles/1234/governance/5678/agenda"
                                      {:body "New agenda"}))
-        (it "should return a 400"
-          (should= 400 (:status @response))
-          (should-contain "Governance meeting does not exist" (:body @response)))))
+        (it-responds-with-status HttpStatus/SC_BAD_REQUEST @response)
+        (it-responds-with-body "Governance meeting does not exist"
+                                          @response)))

     (context "with an existing governance endpoint"
       (context "with an empty open agenda"
@@ -147,24 +161,22 @@
                                        "/circles/1234/governance/5678/agenda"
                                        {:body "New agenda"
                                         :content-type "application/json"}))
-          (it "should return a 415"
-            (should= 415 (:status @response))))
+          (it-responds-with-status 415 @response))

         (context "putting to the agenda endpoint"
           (with response (http-request :put
                                        "/circles/1234/governance/5678/agenda"
                                        {:body "New agenda"}))

-          (it "should return a 201"
-            (should= 201 (:status @response))))
+          (it-responds-with-status HttpStatus/SC_CREATED @response))

         (context "getting the agenda endpoint"
           (with response (http-request :get "/circles/1234/governance/5678/agenda"))
+          (it-responds-with-status HttpStatus/SC_OK @response)
+          (it-responds-with-body "" @response)
           (it "should return an empty agenda"
-            (should= 200 (:status @response))
             (should-contain "text/plain" (get-in @response
-                                                 [:headers "Content-Type"]))
-            (should= "" (:body @response)))))
+                                                 [:headers "Content-Type"])))))

       (context "with an existing open agenda"
         (around [it]
@@ -173,8 +185,7 @@

         (context "getting the governance resource"
           (with response (http-request :get "/circles/1234/governance/5678"))
-          (it "should return a 200"
-            (should= 200 (:status @response)))
+          (it-responds-with-status HttpStatus/SC_OK @response)
           (it "should return that an open meeting exists"
             (should-contain "true" (get-in @response
                                            [:headers "Open-Meeting"]))))
@@ -182,24 +193,22 @@
         (context "putting to the governance resource"
           (with response (http-request :put "/circles/1234/governance/5678"))
           ;(xit "should persist a closed governance log")
-          (it "should return a 204"
-            (should= 204 (:status @response))))
+          (it-responds-with-status HttpStatus/SC_NO_CONTENT @response))

         (context "putting to the agenda endpoint"
           (with response (http-request :put
                                        "/circles/1234/governance/5678/agenda"
                                        {:body "New agenda"}))

-          (it "should return a 204"
-            (should= 204 (:status @response))))
+          (it-responds-with-status HttpStatus/SC_NO_CONTENT @response))

         (context "getting the agenda endpoint"
           (with response (http-request :get "/circles/1234/governance/5678/agenda"))
-          (it "should return an empty agenda"
-            (should= 200 (:status @response))
+          (it-responds-with-status HttpStatus/SC_OK @response)
+          (it-responds-with-body "Current agenda" @response)
+          (it "should return the contents of the existing, open agenda"
             (should-contain "text/plain" (get-in @response
-                                                 [:headers "Content-Type"]))
-            (should= "Current agenda" (:body @response)))))
+                                                 [:headers "Content-Type"])))))

       (context "with an existing closed agenda"
         (around [it]
@@ -209,30 +218,25 @@

         (context "getting the governance resource"
           (with response (http-request :get "/circles/1234/governance/5678"))
-          (it "should return a 200"
-            (should= 200 (:status @response)))
-          (it "should return the details of the governance resource"
-            (should-contain "{\"agenda\":\"Current closed agenda\""
-                            (:body @response))))
+          (it-responds-with-status HttpStatus/SC_OK @response)
+          (it-responds-with-body-containing "{\"agenda\":\"Current closed agenda\""
+                                            @response))

         (context "putting to the governance resource"
           (with response (http-request :put "/circles/1234/governance/5678"))
-          (it "should return a 204"
-            (should= 204 (:status @response))))
+          (it-responds-with-status HttpStatus/SC_NO_CONTENT @response))

         (context "putting to the agenda endpoint"
           (with response (http-request :put
                                        "/circles/1234/governance/5678/agenda"
                                        {:body "New agenda"}))

-          (it "should return a 400"
-            (should= 400 (:status @response))
-            (should-contain "Agenda is closed" (:body @response))))
+          (it-responds-with-status HttpStatus/SC_BAD_REQUEST @response)
+          (it-responds-with-body "Agenda is closed." @response))

         (context "getting the agenda endpoint"
           (with response (http-request :get "/circles/1234/governance/5678/agenda"))
-          (it "should return 400"
-            (should= 400 (:status @response))
-            (should-contain "Agenda is closed" (:body @response))))))))
-
-(run-specs)+          (it-responds-with-status HttpStatus/SC_BAD_REQUEST @response)
+          (it-responds-with-body "Agenda is closed." @response))))))
+
+(run-specs)


No need for a second cond->

No need for a second cond->

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


No need to emit expanded macros internal to the compiler.


Fixes #8 by cunning use of `reverse`.

Fixes #8 by cunning use of `reverse`.

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/decomputed/decomputed.com.git/'


Nice typo, breaks compilation.

Nice typo, breaks compilation.

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 xml to book info conversion

add xml to book info conversion

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

--- src/shelver/price.clj
+++ src/shelver/price.clj
@@ -0,0 +1,22 @@
+(ns shelver.price
+  (:require [clojure.zip :as zip]
+            [clojure.data.zip.xml :as zx]
+            [clojure.data.xml :as xml]
+            [shelver.util :refer :all]))
+
+(defrecord BookInfo [isbn isbn13 title authors])
+
+(defn xml->book-info [xml-book]
+  (let [create-field-fn (fn [part]
+                     #(vector part (-> % (zx/xml1-> part) zx/text)))
+        field-fns (map create-field-fn [:isbn :isbn13 :title])
+        authors-fn #(->> (zx/xml-> % :authors :author :name)
+                        (map zx/text)
+                         set
+                         (vector :authors))]
+    (->> (zip/xml-zip xml-book)
+         ((apply juxt authors-fn field-fns))
+         (into {}))))
+
+(defprotocol PriceClient
+  (get-price [this book-info]))


Add TODO

Add TODO

--- src/main/clojure/pigpen/io.clj
+++ src/main/clojure/pigpen/io.clj
@@ -55,6 +55,7 @@
                 {:args '~(clojure.core/mapcat (juxt str identity) fields)
                  :field-type-in :native})))

+;; TODO load-json
 (defmacro load-clj
   "Loads clojure data from a file. Each line should contain one value and will
 be parsed using clojure.edn/read-string into a value.
@@ -136,6 +137,7 @@
                 {:args (:fields ~relation), :field-type-out :native})
      (raw/store$ ~location raw/default-storage {})))

+;; TODO store-json
 (defmacro store-clj
   "Stores the relation into location using edn (clojure format). Each value is
 written as a single line.


more version updates

more version updates

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


Remove useless count.

Remove useless count.

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


Create Main.clj

Create Main.clj

result:
https://paiza.jp/poh/ando/share/13885a78

error: pathspec 'POH7/SantaFuku/Main.clj' did not match any file(s) known to git

--- POH7/SantaFuku/Main.clj
+++ POH7/SantaFuku/Main.clj
@@ -0,0 +1,37 @@
+; Try POH
+; author: Leonardone @ NEETSDKASU
+(def gs read-line)
+(defn gi [] (read-string (gs)))
+(defn gss [] (list* (.split (gs) " ")))
+(defn gis [] (map read-string (gss)))
+(defn ngt [n f] (for [_ (range n)] (f)))
+(defn ngs [n] (ngt n gs))
+(defn ngi [n] (ngt n gi))
+(defn ngss [n] (ngt n gss))
+(defn ngis [n] (ngt n gis))
+; ============================================
+
+
+(defn minval [vs v]
+    (let [vss (sort vs)]
+        (first (reduce (fn [[r b] e] [(min r (- e b)) e]) [v 0] vss))
+    ))
+(defn solve [x y z da]
+    (let [buildf (fn [[xs ys] [d a]] (if (= d 0) [(cons a xs) ys] [xs (cons a ys)]))
+          [xs ys] (reduce buildf [[x] [y]] da)
+          xmin (minval xs x)
+          ymin (minval ys y)
+          ]
+        (* xmin ymin z)
+    ))
+
+
+(defn main []
+    (let [[x y z n] (gis)
+          da (ngis n)
+          ans (solve x y z da)]
+        (println ans)
+    ))
+
+
+(main)


Starting to work on Jaro-Winkler

Starting to work on Jaro-Winkler

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

--- src/clj_fuzzy/jaro_winkler.clj
+++ src/clj_fuzzy/jaro_winkler.clj
@@ -0,0 +1,49 @@
+;; -------------------------------------------------------------------
+;; clj-fuzzy Jaro-Winkler Distance
+;; -------------------------------------------------------------------
+;;
+;;
+;;   Author: PLIQUE Guillaume (Yomguithereal)
+;;   Version: 0.1
+;;
+(ns clj-fuzzy.jaro-winkler)
+
+(defn- longest-sequence [seq1 seq2]
+  (if (>= (count seq1) (count seq2))
+    [seq1 seq2]
+    [seq2 seq1]))
+
+(defn- match-window [min-len] (max (dec (int (/ min-len 2))) 0))
+
+(defn- submatch [ch shortest window-start window-end seq1-matches seq2-matches]
+  (loop [j 0]
+    (if (and (< j window-end)
+             (not (seq1-matches j))
+             (= ch (get shortest j)))
+      [(conj seq1-matches ch)
+       (conj seq2-matches (get shortest j))]
+      (recur (inc j)))))
+
+;; Change for fors
+(defn- matches [seq1 seq2]
+  (let [[longest shortest] (longest-sequence seq1 seq2)
+        max-len (count longest)
+        min-len (count shortest)
+        mwindow (match-window min-len)]
+    (loop [i 0
+           seq1-matches []
+           seq2-matches []]
+      (if (< i max-len)
+        ;; Return
+        [seq1-matches seq2-matches]
+        ;; Recur
+        (let [window-start (max (dec mwindow) 0)
+              window-end (min (+ i mwindow) min-len)
+              [nseq1-matches nseq2-matches] (submatch (get longest i)
+                                                       shortest
+                                                       window-start
+                                                       window-end
+                                                       seq1-matches
+                                                       seq2-matches)]
+          (recur (inc i) nseq1-matches nseq2-matches))))))
+


Add new validation

Add new validation

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

--- src/graphql_clj/validation.clj
+++ src/graphql_clj/validation.clj
@@ -0,0 +1,86 @@
+(ns graphql-clj.validation
+  (:require [clojure.walk :as walk]
+            [clojure.zip :as z]
+            [zip.visit :as zv]
+            [graphql-clj.parser :as parser]))
+
+(defn- verify-node [node ancestor]
+  (if (= :type-definition (:node-type node))
+    (do
+      (println "type-definition:", (:node-type node))
+      node)
+    node))
+
+(defn validate-query-document
+  [query-document]
+  (let [ancestor (atom [])])
+  (walk/prewalk verify-node query-document))
+
+;; Zipper
+
+(defn node->branch? [node]
+  (case (:node-type node)
+    :schema-definition false
+    :type-definition true
+    (println "error: unknow node-type for branch:" (:node-type node))))
+
+(defn make-node-with-node-type
+  [node children]
+  (case (:node-type node)
+    ;; :operation-definition (assoc node :selection-set children)
+    :type-definition (assoc node :fields children :changed "visited")
+    (println "error: don't know how to create node for:" (:node-type node))))
+
+(defn node->children
+  [node]
+  (println "node->children:" (:node-type node))
+  (case (:node-type node)
+    :type-definition (:fields node)
+    (println "error: don't know to make children from:" node)))
+
+(defn branch? [node]
+  (println "branch?")
+  (cond
+    (:operation-definitions node) true
+    (:type-system-definitions node) true
+    (:node-type node) (node->branch? node)
+    :default (do
+               (println "error no branch for node:" node)
+               false)))
+
+(defn make-node-fn
+  [node children]
+  (println "make-node-fn:" (or (:operation-definitions node)
+                               (:node-type node)
+                               (:type-system-definitions node)))
+  (if (map? node)
+    (cond
+      (:operation-definitions node) (assoc node :operation-definitions children)
+      (:type-system-definitions node) (assoc node :type-system-definitions children)
+      (:node-type node) (make-node-with-node-type node children)
+      :default node)
+    (println "error: don't know how to make node from:" node "--- map?:" (map? node))))
+
+(defn children
+  [node]
+  (println "children")
+  (cond
+    (:operation-definitions node) (do
+                                    (:operation-definitions node))
+    (:type-system-definitions node) (:type-system-definitions node)
+    (:node-type node) (node->children node)
+    :default (do
+               (println "error: no children for node:" node)
+               nil)))
+
+(defn document-zipper
+  [document]
+  (z/zipper branch? children make-node-fn document))
+
+(defn debug [& args]
+  (println "args:" args))
+
+(defn visit
+  [document]
+  (zv/visit (document-zipper document) {} [debug]))
+


panic

panic

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/yokalona/threen.git/'


tweet.clj: 트윗 기능 추가.

tweet.clj: 트윗 기능 추가.

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

--- src/tweetbook/models/tweet.clj
+++ src/tweetbook/models/tweet.clj
@@ -0,0 +1,23 @@
+(ns tweetbook.models.tweet
+  (:require [tweetbook.models.config :as config])
+  (:use [twitter.oauth]
+        [twitter.callbacks]
+        [twitter.callbacks.handlers]
+        [twitter.api.restful]
+        [overtone.at-at]
+        [tweetbook.models.db]))
+
+(def thread-pool (mk-pool))
+(def tweet-interval config/tweet-interval)
+(def tweetbot-creds
+  (let [creds config/oauth-settings]
+    (make-oauth-creds (creds :consumer-key)
+                      (creds :consumer-secret)
+                      (creds :access-token)
+                      (creds :access-token-secret))))
+
+(defn tweet [msg]
+  (statuses-update :oauth-creds tweetbot-creds :params {:status msg}))
+
+(defn tweet-random []
+  (tweet (random-msg)))


added more recovery code

added more recovery code

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

--- src/crawler/recover.clj
+++ src/crawler/recover.clj
@@ -0,0 +1,83 @@
+(ns crawler.recover
+  "Module containing code to recover a sitemap")
+
+(defn crawl-stream
+  [corpus-file]
+  (let [stream (-> corpus-file
+                   clojure.java.io/reader
+                   (java.io.PushbackReader.))]
+    (take-while
+     identity
+     (repeatedly
+      #(try
+         (read stream)
+         (catch Exception e nil))))))
+
+(defn web-graph
+  [stream]
+  (map
+   #(dissoc % :body)
+   stream))
+
+(defn xpath-histogram
+  [xpaths]
+  (reduce
+   (fn [acc a-node]
+     (merge-with +' acc {(:src-xpath a-node) 1}))
+   {}
+   xpaths))
+
+(defn choose-xpaths
+  [xpath-histogram]
+  (let [scores-sum (reduce
+                    (fn [acc [xpath n]]
+                      (+ acc n))
+                    0
+                    xpath-histogram)
+
+        normalized (reverse
+                    (sort-by
+                     second
+                     (map
+                      (fn [[xpath n]]
+                        [xpath (/ n scores-sum)])
+                      xpath-histogram)))
+        hist-stuff (reduce
+                    (fn [acc [xpath count]]
+                      (if (>= (:count acc) 0.9)
+                        acc
+                        {:count (+ (:count acc) count)
+                         :xpaths (conj (:xpaths acc) xpath)}))
+                    {:count  0
+                     :xpaths []}
+                    normalized)]
+    (:xpaths hist-stuff)))
+
+(defn recover-leaves
+  "For recovery, we want to recover close to 90% of
+   threads."
+  ([corpus-file]
+     (recover-leaves nil (-> corpus-file crawl-stream web-graph)))
+
+  ([srcs corpus-stream]
+     (let [source-set    (set srcs)
+
+           stream        (web-graph corpus-stream)
+           leaves        (if (not srcs)
+                           (filter
+                           (fn [x] (:leaf? x))
+                           stream)
+                           (filter
+                            (fn [x]
+                             (some #{(:src-url x)} source-set))
+                            stream))
+
+           histogram     (xpath-histogram leaves)
+           chosen-xpaths (choose-xpaths histogram)
+           src-links     (map
+                          (fn [x] (:src-url x))
+                          (filter
+                           #(some #{(:src-xpath %)} (set chosen-xpaths))
+                           leaves))]
+
+       src-links)))


added p19.clj

added p19.clj

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


added integration test

added integration test

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

--- test/push/integration_test.clj
+++ test/push/integration_test.clj
@@ -0,0 +1,13 @@
+(ns push.integration-test
+  (:use midje.sweet)
+  (:use [push.interpreter]))
+
+(future-fact "simple scripts containing literals sort them as expected" :integration
+  (all-stacks (run-script [1 2.3 false \T "foo" '(1 2 3)])) =>
+    { :integer '(1)
+      :float '(2.3)
+      :boolean '(false)
+      :char '(\T)
+      :string '("foo")
+      :code '( '(1 2 3) )}
+  )


Sucky docs is better than no docs.

Sucky docs is better than no docs.