main page

main page

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

--- src/adder/Pages.clj
+++ src/adder/Pages.clj
@@ -0,0 +1,406 @@
+;This is the main page, contains links to every page in the project as well as GET/POST/PUT
+
+
+
+
+;Useful links and topics about selectors,maps and parsing
+
+;http://stackoverflow.com/questions/12681759/how-to-add-a-string-containing-html-with-clojure-enlive?rq=1
+;http://stackoverflow.com/questions/2130448/getting-started-with-css-in-compojure
+
+;http://stackoverflow.com/questions/7466957/combine-multiple-html-fragment-files-with-enlive-clojure?rq=1
+;http://stackoverflow.com/questions/16387016/how-to-write-this-clojure-enlive-program-so-it-can-parse-multiple-urls?rq=1
+
+;https://devcenter.heroku.com/articles/clojure-web-application
+;http://people.cs.umass.edu/~liberato/blog/2013/02/06/moving-from-noir-to-compojure-and-lib-noir/
+;https://groups.google.com/forum/#!forum/enlive-clj
+;https://groups.google.com/forum/#!forum/compojure
+
+(ns adder.pages
+  (:use compojure.core
+        [hiccup core form page element]
+        [adder.PageParser]
+        [adder.reorder]
+        [adder.dbManagement]
+        [adder.image-reader]
+		[adder.middleware])
+  (:require [compojure.handler :as handler])
+
+  (:import [java.io InputStream InputStreamReader BufferedReader]
+           [java.net URL HttpURLConnection]))
+
+(defn view-layout [& content]
+  (html5 [:head
+				[:title "Movie Helper"]]
+		[:body content]
+		[:div.img]
+		))
+
+;MAIN PAGE
+
+(defn view-input []
+  (view-layout
+
+			(label "lblnews" ">>> This's just in! Fresh news from CINEMABLEND.COM: <<<")
+			[:br]
+
+		   (link-to (create-url) (take 1(parse-news-cine)))
+		   [:br]
+		   (link-to "http://localhost:3000/news" " See all news in list")
+		   [:br]
+			[:h2 "Find your Movie"]
+			[:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"  }
+			(form-to [:post "/"]
+			[:br][:br]
+      (text-field {:placeholder "Enter movie name" } :a) [:br]
+      (submit-button "Search")
+	  [:br][:br][:br]
+	  (str "
"
+         (str "
"
+		   "" ">>> Your Watchlist <<<" "	"
+		   "
"
+			"
"
+		   "" "" "Add a new film to your watchlist" "" "	"
+		   "
"
+		   "
"
+           "" "" "Add new movie-series to your watchlist" "" "	"
+           "
"
+         "
"))
+		 [:br][:br] [:br]
+		 (str "
"
+			(str "
"
+		   "" ">>> Browse your movies here <<<" "	"
+		   "
"
+			"
"
+		   "" "" "View complete list of your movies" "" "	"
+		   "
"
+		   "
"
+           "" "" "View list of your movie series" "" "	"
+           "
"
+         "
")))
+		[:br]
+		(label "lblnews" ">>> Latest news from FIRSTSHOWING.NET <<<")
+		[:br]
+	    (take 1(parse-news))
+	    [:br]
+	    (label "lblauthor" "Written by: ")
+	    (take 1(parse-author))[:br]
+		(link-to "http://www.firstshowing.net/category/movie-news/" "Check out more news from FIRSTSHOWING.NET here!")
+		[:br]]
+		))
+
+;CHANGE WINDOW
+
+(defn change-window []
+  (view-layout
+    [:h2 "You have successfully made changes to your Watchlist"]
+	[:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"  }
+    (form-to [:post "/"]
+	  [:br]
+      [:br]
+	  [:br]
+	  (str "
"
+          (str "
"
+		   "" ">>> From here, you can: <<<" "	"
+		   "
"
+		   "
"
+           "" "" "View complete list of your movies" "" "	"
+           "
"
+		   "
"
+           "" "" "View list of your movie series" "" "	"
+           "
"
+			"
"
+		   "" "" "Add a new film to your watchlist" "" "	"
+		   "
"
+		   "
"
+           "" "" "Add new movie-series to your watchlist" "" "	"
+           "
"
+         "
"))
+		 )]
+		 ))
+
+;OUTPUT PAGE,SEARCH RESULTS
+
+(defn create-flick-url [a]
+  (str "http://www.rottentomatoes.com/search/?search=" a ""))
+
+
+ (defn create-link [a]
+	(apply str "http://www.rottentomatoes.com" (take 1(name+search (create-flick-url a)))))
+
+	(defn create-link2 [a]
+	(apply str (image+search (create-flick-url a))))
+
+
+
+(defn view-output [a]
+
+  (view-layout
+	(include-js "http://code.jquery.com/jquery-2.1.1.min.js")
+	(include-js "http://yourjavascript.com/9314102313/skripta.js")
+	[:h2 "Check review of each movie, from rottentomatoes.com, that match your search: "]
+	[:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"  }
+		[:form {:method "post" :action "/"}
+			(interleave
+				(for [movie-read-link (name+search (create-flick-url a))]
+					[:a {:href movie-read-link} "Read here"])
+				(for [flick-image (image+search (create-flick-url a))]
+					[:img {:src flick-image} [:br] [:br][:br]]))
+					]]))
+
+
+
+;VARIOUS PAGES FOR DATABASE
+
+(defn view-movie-series "view all available movie-series" []
+  (html5
+			[:head
+				[:title "movie-series film collection"]]
+			[:h2 "All movie-series:"]
+			[:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"}
+    (str "
"
+         ( apply str (seq (for [movie-series (list-series)]
+
+           (str "
"
+           ""(:series_production movie-series) "	"
+           ""(:series_name movie-series) "	"
+          ;"" (link-to (:read-link ) "See it here!") "	" ;
+           "" "" "See all saved movies from this movie-series" "" "	"
+           "" "" "Edit movie-series" "" "	"
+           "" "" "Delete movie-series" "" "	"
+           ;"" "" "Add new movie-series" "" "	"
+           "
"
+           )
+         )))
+         "
"
+           "" "" "Add new movie-series" "" "	"
+           "
"
+         "
")]))
+
+(defn save-movie-series []
+  (view-layout
+
+    [:h2 "Add new movie-series"]
+	[:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"  }
+    (form-to [:post "/addnewmovie-series"]
+
+      (label "lblseriesName" "Movie-series title: ")
+      (text-field  :txtname) [:br]
+
+      (label "lblProducer" "Production name: ")
+      (text-field  :txtproname) [:br]
+
+      (submit-button "Save"))
+	  [:br]
+	  [:br]
+	  (str ""  ">> Return to Homepage <<" "")
+	  ]))
+
+(defn update-movie-series [sid]
+  (view-layout
+    [:h2 "Update movie-series"]
+	[:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"  }
+    (form-to [:put (format "/editmovie-series/%s" sid)];editmovie-series
+
+      (label "lblseriesName" "Movie-series name: ")
+      (text-field  :txtname (first (map :series_name (list-one-series sid)))) [:br]
+
+      (label "lblProducer" "Production name: ")
+      (text-field  :txtproname (first (map :series_production (list-one-series sid)))) [:br]
+
+      (submit-button "Update"))
+	  [:br]
+	  [:br]
+	  (str ""  ">> Return to Homepage <<" "")
+	  ]))
+
+(defn delete-movie-series [sid]
+  (view-layout
+    [:h2 "Delete selected movie-series"]
+    (form-to [:delete (format "/deletemovie-series/%s" sid)];deletemovie-series
+            [:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"}
+      (label "lblseriesName" "Movie-series name: ")
+      (text-field  :txtname (first (map :series_name (list-one-series sid)))) [:br]
+
+      (label "lblProducer" "Production name: ")
+      (text-field  :txtproname (first (map :series_production (list-one-series sid)))) [:br]
+
+      (submit-button "Delete")])))
+
+
+(defn view-movies "view all available movies" []
+  (html5
+			[:head
+				[:title "movie-series film collection"]]
+			[:h2 "All movies:"]
+			[:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"}
+    (str "
"
+         ( apply str (seq (for [film (list-movies)]
+           (str
+		   "
"
+           ""(:name film) "	"
+           ""(:duration film) "	"
+           ""(:Producer film) "	"
+           "" (str ""  "Edit information" "") "	"
+           "" (str ""  "Delete movie" "") "	"
+           "
"))))
+         "
"
+         "" (str ""  "Add movie to your watchlist" "")
+         "	"
+         "
"
+         "
")]))
+
+
+(defn view-movies-from-one-movie-series "view all available movies from one movie-series" [sid]
+  (html5
+			[:head
+				[:title "movie-series film collection"]]
+
+			[:h2 "All movies from movie-series:"]
+			[:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"}
+    (str "
"
+         ( apply str (seq (for [film (list-all-movies-from-serie sid)]
+           (str "
"
+           ""(:name film) "	"
+           ""(:duration film) "	"
+           ""(:Producer film) "	"
+           ;"" (str ""  "Add new here!" "") "	"
+           "" (str ""  "Update it here!" "") "	"
+           "" (str ""  "Delete it here!" "") "	"
+           "
")
+         ))) "
" "" (str ""  "Add new here!" "") "	" "
"
+         "
")]))
+
+(defn view-film-input-update [cid]
+  (view-layout
+    [:h2 "Update film"]
+    (form-to [:put (format "/addfilm/%s" cid)]
+            [:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"}
+      (label "movname" "Film title: ")
+      (text-field  :txtname (first (map :name (list-one-film cid)))) [:br] ;(first (:name (list-one-film cid)))
+
+      (label "proname" "Producer name: ")
+      (text-field  :txtproname (first (map :producer (list-one-film cid)))) [:br]
+
+      (label "duration" "Duration(minutes): ")
+      (text-field  :txtduration  (first (map :duration (list-one-film cid))))
+      [:br]
+      (submit-button "Update")])))
+
+(defn view-film-input-delete [cid]
+  (view-layout
+    [:h2 "Delete film"]
+    (form-to [:delete (format "/deletefilm/%s" cid)]
+            [:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"}
+      (label "movname" "Film title: ")
+      (text-field  :txtname (first (map :name (list-one-film cid)))) [:br]
+
+      (label "proname" "Producer name: ")
+      (text-field  :txtproname (first (map :Producer (list-one-film cid)))) [:br]
+      (label "duration" "Duration(minutes): ")
+      (text-field  :txtduration  (first (map :duration (list-one-film cid))))
+      [:br]
+      (submit-button "Delete")])))
+
+(defn view-film-input []
+  (view-layout
+  [:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"}
+    [:h2 "Add new film"]
+    (form-to [:post "/addfilm" ]
+
+      (label "movname" "Film title: ")
+      (text-field  :txtname) [:br]
+
+      (label "proname" "Producer name: ")
+      (text-field  :txtproname) [:br]
+
+      (label "duration" "Duration(minutes): ")
+      (text-field  :txtduration)[:br]
+      (submit-button "Save"))
+	  [:br]
+	  [:br]
+	  (str ""  ">> Return to Homepage <<" "")
+	  ]))
+
+(defn view-news []
+  (view-layout
+  [:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px :text-align: center"}
+    [:h2 "All news from cinemablend.com"]
+
+		(interpose [:br] (parse-news-cine))
+
+	  [:br]
+	  (str ""  ">> Visit cinemablend here <<" "")
+	  [:br]
+	  (str ""  ">> Return to Homepage <<" "")
+	  ]))
+
+
+(defn view-film-input-in-movie-series [sid]
+  (view-layout
+  [:body {:style "font: 14pt/16pt helvetica; background-color: #F2FB78; padding-top:100px; text-align: center"}
+    [:h2 "Add new film"]
+    (form-to [:post (format "/addnewfilmtofran/%s" sid)]
+
+      (label "movname" "Film title: ")
+      (text-field  :txtname) [:br]
+
+      (label "proname" "Producer name: ")
+      (text-field  :txtproname) [:br]
+
+      (label "duration" "Duration(minutes): ")
+      (text-field  :txtduration)[:br]
+      (submit-button "Save"))]))
+
+;GET/POST/PUT SECTION
+
+
+(defroutes main-routes
+   (GET "/" []
+      (view-input))
+
+  (POST "/" [a]
+	(do
+       (println "A" a )
+  (view-output a)))
+
+  (GET "/news" []
+        (view-news))
+
+  (GET "/listmovies" []
+        (view-movies))
+
+  (GET "/addfilm/:cid" [cid] (view-film-input-update cid))
+  (PUT "/addfilm/:cid" [cid txtname txtproname txtduration] (update-flick (read-string cid) {:name txtname :Producer txtproname :duration txtduration}) (change-window))
+
+  (GET "/addnewfilmtofran/:sid" [sid] (view-film-input-in-movie-series sid))
+  (POST "/addnewfilmtofran/:sid" [sid txtname txtproname txtduration]
+        (insert-flick txtname txtproname txtduration (read-string sid))(change-window))
+
+  (GET "/addfilm" [] (view-film-input))
+  (POST "/addfilm" [txtname txtproname txtduration]
+        (insert-flick txtname txtproname txtduration 90) (change-window))
+
+  (GET "/deletefilm/:cid" [cid] (view-film-input-delete cid))
+  (DELETE "/deletefilm/:cid" [cid] (delete-flick cid)(change-window))
+
+  (GET "/listmoviesfran/:sid" [sid]
+        (view-movies-from-one-movie-series sid))
+
+  (GET "/listseries" []
+        (view-movie-series))
+
+  (GET "/addnewmovie-series" [] (save-movie-series))
+  (POST "/addnewmovie-series" [txtname txtproname] (insert-serie txtname txtproname)(change-window))
+
+  (GET "/editmovie-series/:sid" [sid] (update-movie-series sid));editmovie-series
+  (PUT "/editmovie-series/:sid" [sid txtname txtproname] (update-serie (read-string sid) {:series_name txtname :series_production txtproname})(change-window))
+
+  (GET "/deletemovie-series/:sid" [sid] (delete-movie-series sid))
+  (DELETE "/deletemovie-series/:sid" [sid] (delete-series sid)(change-window))
+
+
+  )
+
+
+(def app (handler/site main-routes)) ; wrap the params to allow destructuring to work


added option to pass fn to subscription

added option to pass fn to subscription

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/Otann/probe.git/'


Repetition

Repetition

fatal: unable to access 'https://github.com/michaelsbradleyjr/shen.clj.git/': The requested URL returned error: 403


Add tests for talking to player.

Add tests for talking to player.

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

--- test/isla/test/talk.clj
+++ test/isla/test/talk.clj
@@ -0,0 +1,22 @@
+(ns isla.test.talk
+  (:use [isla.talk])
+  (:use [clojure.test])
+  (:use [clojure.pprint]))
+
+;; list-rooms
+
+(deftest test-0-rooms
+  (is (re-find #"no way out of this room"
+               (list-rooms []))))
+
+(deftest test-1-room
+  (is (re-find #"see a door to the palace"
+               (list-rooms [{:name "palace"}]))))
+
+(deftest test-2-rooms
+  (is (re-find #"see a door to the palace and the garden"
+               (list-rooms [{:name "palace"} {:name "garden"}]))))
+
+(deftest test-3-rooms
+  (is (re-find #"see a door to the palace, the garden and the bedroom."
+               (list-rooms [{:name "palace"} {:name "garden"} {:name "bedroom"}]))))


Allow 'origin' access-control header sent by safari

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


First Mithril app mounted in Cljs!

First Mithril app mounted in Cljs!

--- src/cljs/modern_cljs/core.cljs
+++ src/cljs/modern_cljs/core.cljs
@@ -2,9 +2,17 @@
 (ns modern-cljs.core
   (:require [foo.bar] [m]))

+(defn ^:export ctrl []
+  (println "Calling major Tom")
+  (js-obj "var" (str "tosi: " (rand-int 10))))
+(defn ^:export viewer [arg]
+  (println "Seeing things")
+  (js/m "div" (.-var arg)))
+(def app (js-obj "controller" ctrl "view" viewer))
+
 (enable-console-print!)
 (println "Hello All!!!")
 (js/foo)
-(.render js/m
+(.mount js/m
   (.getElementById js/document "app")
-  (js/m "div" "jei!"))
+  app)


move subworker functionality to separate commented file for future

fatal: unable to access 'https://github.com/sbondaryev/cljs-worker.git/': The requested URL returned error: 403


Fix routes/org-projects-route

Fix routes/org-projects-route


Add docstrings to keycode vars and colorscheme

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


Reformat: fix indentation in map

Reformat: fix indentation in map


A most useless auto gensym

A most useless auto gensym

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


add ring middleware

add ring middleware

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


Eliminate unused ns.

Eliminate unused ns.

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


conform with graphql schema

conform with graphql schema

fatal: unable to access 'https://github.com/starcity-properties/odin.git/': The requested URL returned error: 403


Spacemacs cider

Spacemacs cider

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/scott-abernethy/dot-files.git/'


Catch GCP credentials error

Catch GCP credentials error


Breaking the test for now, so that I don't forget about the test when merging. :)

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


Stup git-branch workflow.

Stup git-branch workflow.

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

--- src/incise/deploy/workflows/git_branch.clj
+++ src/incise/deploy/workflows/git_branch.clj
@@ -0,0 +1,9 @@
+(ns incise.deploy.workflows.git-branch)
+
+(defn setup-branch [branch])
+
+(defn deploy [{:keys [branch commit push]}]
+  {:pre [(string? branch)]}
+  (setup-branch)
+  (when commit
+    (when push nil)))


WIP table-events ...

WIP table-events ...

error: pathspec 'src/all/cider_ci/server/utils/table_events.clj' did not match any file(s) known to git

--- src/all/cider_ci/server/utils/table_events.clj
+++ src/all/cider_ci/server/utils/table_events.clj
@@ -0,0 +1,84 @@
+(ns cider-ci.server.utils.table-events
+  (:refer-clojure :exclude [str keyword])
+  (:require
+    [cider-ci.utils.core :refer [str keyword presence]]
+    [cider-ci.utils.honeysql :as sql]
+    [cider-ci.utils.rdbms :as ds]
+
+    [clj-time.core :as time]
+    [clojure.core.async :as async]
+    [clojure.java.jdbc :as jdbc]
+
+    [clj-logging-config.log4j :as logging-config]
+    [clojure.tools.logging :as logging]
+    [logbug.debug :as debug]
+    [logbug.thrown :as thrown]
+    ))
+
+(def ^:private pub-chan (async/chan))
+(def ^:private pub (async/pub pub-chan :table-name))
+
+(defn- publish [row]
+  (async/>!! pub-chan {:table-name (:table_name row)
+                       :data row})
+  row)
+
+
+;(dotimes [i 20] (async/>!! pub-chan {:table-name :test :event {:message "blah" :i i :time (time/now)}}))
+
+(defn subscribe [chan table-name]
+  ;TODO the following fails with sliding-buffer, but it should not
+  ;(assert (async/unblocking-buffer? chan))
+  (async/sub pub table-name chan))
+
+
+;;;
+
+(def last-event-row* (atom nil))
+
+(def base-query
+  (-> (sql/select :*)
+      (sql/from :events)
+      (sql/order-by [:created_at :asc]
+                    [:id :asc])))
+
+(defn extend-query [query last-event-row]
+  (if-not last-event-row
+    query
+    (-> query
+        (sql/merge-where [:>= :created_at (:created_at last-event-row)])
+        (sql/merge-where [:<> :id (:id last-event-row)]))))
+
+(defn build-publish-new-rows-query [last-event-row]
+  (-> base-query
+      (extend-query last-event-row)
+      (sql/format)))
+
+(defn publish-new-rows! []
+  (swap! last-event-row*
+         (fn [last-event-row]
+           (or (->> (build-publish-new-rows-query last-event-row)
+                    (jdbc/query @ds/ds)
+                    (map publish)
+                    last)
+               last-event-row))))
+
+;(publish-new-rows!)
+
+(defn init []
+  (swap! last-event-row*
+         (fn [last-event-row]
+           (->> (-> base-query
+                    (sql/format))
+                (jdbc/query @ds/ds)
+                first))))
+
+; testing
+(def sub-chan (async/chan (async/sliding-buffer 10)))
+(subscribe sub-chan "projects")
+(async/go-loop [] (let [msg (async/<! sub-chan)] (println msg) (logging/debug msg) (recur)))
+
+
+
+;#### debug ###################################################################
+(debug/debug-ns *ns*)


Don't croak on error handling.

Don't croak on error handling.

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


assoc charge-id invoice-id

assoc charge-id invoice-id

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


Create separate devcard for libtests

Create separate devcard for libtests

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

--- src/devcards/discuss/devcards/lib.cljs
+++ src/devcards/discuss/devcards/lib.cljs
@@ -0,0 +1,37 @@
+(ns discuss.devcards.lib
+  (:require [cljs.test :refer-macros [testing is are]]
+            [devcards.core :as dc :refer-macros [defcard deftest defcard-om]]
+            [discuss.utils.common :as lib]))
+
+(def test-state (atom {:val {:discussion {:add_premise_text "There are many parks in neighbouring towns holds, because...", :bubbles [{:votecounts 29, :votecounts_message "29 more participants with this opinion.", :data_argument_uid "None", :omit_url false, :data_is_supportive "True", :is_status false, :id "1464001655.6145825", :data_statement_uid "51", :is_user true, :is_info false, :data_type "statement", :url "http://localhost:4284/discuss/town-has-to-cut-spending", :is_system false, :message "There are many parks in neighbouring towns."} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url true, :data_is_supportive "None", :is_status true, :id "now", :data_statement_uid "None", :is_user false, :is_info false, :data_type "None", :url "None", :is_system false, :message "Now"} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url true, :data_is_supportive "None", :is_status false, :id "1464001655.6119502", :data_statement_uid "None", :is_user false, :is_info false, :data_type "None", :url "None", :is_system true, :message "What is your most important reason why  there are many parks in neighbouring towns holds?
Because..."} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url false, :data_is_supportive "None", :is_status false, :id "end", :data_statement_uid "None", :is_user false, :is_info true, :data_type "None", :url "None", :is_system false, :message "You are the first one, who said that There are many parks in neighbouring towns.
Please enter your reason for your statement."}], :mode "justify", :is_supportive true, :save_statement_url "ajax_set_new_start_statement", :search {:issue "1", :distance_name "Levensthein", :values [{:distance "00038", :url "api/town-has-to-cut-spending/justify/53/t", :statement_uid 53, :index 0, :text "Parks are very important for our climate."} {:distance "00040", :url "api/town-has-to-cut-spending/justify/51/t", :statement_uid 51, :index 1, :text "There are many parks in neighbouring towns."} {:distance "00067", :url "api/town-has-to-cut-spending/justify/44/t", :statement_uid 44, :index 2, :text "Spending of the city for these festivals are higher than the earnings."} {:distance "00081", :url "api/town-has-to-cut-spending/justify/54/t", :statement_uid 54, :index 3, :text "Our swimming pools are very old and it would take a major investment to repair them."}]}}, :issues {:date "3 hours ago", :slug "town-has-to-cut-spending", :uid 1, :all [{:uid "1", :url "", :arg_count 18, :title "Town has to cut spending ", :date "3 hours ago", :slug "town-has-to-cut-spending", :enabled "disabled", :info "Our town needs to cut spending. Please discuss ideas how this should be done."} {:uid "2", :url "api/cat-or-dog", :arg_count 30, :title "Cat or Dog", :date "3 hours ago", :slug "cat-or-dog", :enabled "enabled", :info "Your familiy argues about whether to buy a cat or dog as pet. Now your opinion matters!"} {:uid "3", :url "api/elektroautos", :arg_count 9, :title "Elektroautos", :date "3 hours ago", :slug "elektroautos", :enabled "enabled", :info "Elektroautos - Die Autos der Zukunft? Bitte diskutieren Sie dazu."} {:uid "4", :url "api/unterstuumltzung-der-sekretariate", :arg_count 0, :title "Unterstützung der Sekretariate", :date "3 hours ago", :slug "unterstuumltzung-der-sekretariate", :enabled "enabled", :info "Unsere Sekretariate in der Informatik sind arbeitsmäßig stark überlastet. Bitte diskutieren Sie Ma&szlignahmen zur Unterstützung der Sekretariate."}], :title "Town has to cut spending ", :info "Our town needs to cut spending. Please discuss ideas how this should be done.", :intro "Current discussion is about", :tooltip "The discussion was started 3 hours ago and already has 18 argument.", :arg_count 18}, :items [{:url "add", :already_used_text "", :id "item_start_premise", :already_used false, :premises [{:id 0, :title "None of the above! Let me state my own reason!"}], :attitude "justify"}], :layout {:loading? false, :add? false, :add-type :add-justify-premise, :template :discussion, :add-text "Let me enter my reason!", :title "discuss", :error-msg nil, :reference "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt", :intro "The current discussion is about:", :error? false}, :debug {:last-api "api/get/statements/1/3/are", :response {:issues {:date "3 hours ago", :slug "town-has-to-cut-spending", :uid 1, :all [{:uid "1", :url "", :arg_count 18, :title "Town has to cut spending ", :date "3 hours ago", :slug "town-has-to-cut-spending", :enabled "disabled", :info "Our town needs to cut spending. Please discuss ideas how this should be done."} {:uid "2", :url "api/cat-or-dog", :arg_count 30, :title "Cat or Dog", :date "3 hours ago", :slug "cat-or-dog", :enabled "enabled", :info "Your familiy argues about whether to buy a cat or dog as pet. Now your opinion matters!"} {:uid "3", :url "api/elektroautos", :arg_count 9, :title "Elektroautos", :date "3 hours ago", :slug "elektroautos", :enabled "enabled", :info "Elektroautos - Die Autos der Zukunft? Bitte diskutieren Sie dazu."} {:uid "4", :url "api/unterstuumltzung-der-sekretariate", :arg_count 0, :title "Unterstützung der Sekretariate", :date "3 hours ago", :slug "unterstuumltzung-der-sekretariate", :enabled "enabled", :info "Unsere Sekretariate in der Informatik sind arbeitsmäßig stark überlastet. Bitte diskutieren Sie Ma&szlignahmen zur Unterstützung der Sekretariate."}], :title "Town has to cut spending ", :info "Our town needs to cut spending. Please discuss ideas how this should be done.", :intro "Current discussion is about", :tooltip "The discussion was started 3 hours ago and already has 18 argument.", :arg_count 18}, :items [{:url "add", :already_used_text "", :id "item_start_premise", :already_used false, :premises [{:id 0, :title "None of the above! Let me state my own reason!"}], :attitude "justify"}], :extras {:is_reportable false, :lang_is_de false, :link_en_class "active", :lang_is_en true, :nickname "Christian", :is_user_neutral false, :close_premise_container false, :is_user_female false, :logged_in true, :users_avatar "https://secure.gravatar.com/avatar/5fb6235d584543384ee61ac6814195bb?s=80&d=wavatar", :link_de_class "", :users_name "Christian", :show_bar_icon false, :is_user_male true, :restart_url "api/town-has-to-cut-spending", :add_premise_container_style "", :add_statement_container_style "display: none", :is_editable false, :show_display_style false}, :discussion {:add_premise_text "There are many parks in neighbouring towns holds, because...", :bubbles [{:votecounts 29, :votecounts_message "29 more participants with this opinion.", :data_argument_uid "None", :omit_url false, :data_is_supportive "True", :is_status false, :id "1464001655.6145825", :data_statement_uid "51", :is_user true, :is_info false, :data_type "statement", :url "http://localhost:4284/discuss/town-has-to-cut-spending", :is_system false, :message "There are many parks in neighbouring towns."} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url true, :data_is_supportive "None", :is_status true, :id "now", :data_statement_uid "None", :is_user false, :is_info false, :data_type "None", :url "None", :is_system false, :message "Now"} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url true, :data_is_supportive "None", :is_status false, :id "1464001655.6119502", :data_statement_uid "None", :is_user false, :is_info false, :data_type "None", :url "None", :is_system true, :message "What is your most important reason why  there are many parks in neighbouring towns holds?
Because..."} {:votecounts 0, :votecounts_message "You are the first one with this opinion.", :data_argument_uid "None", :omit_url false, :data_is_supportive "None", :is_status false, :id "end", :data_statement_uid "None", :is_user false, :is_info true, :data_type "None", :url "None", :is_system false, :message "You are the first one, who said that There are many parks in neighbouring towns.
Please enter your reason for your statement."}], :mode "justify", :is_supportive true, :save_statement_url "ajax_set_new_start_statement"}}}, :user {:nickname "Christian", :token "Christian-f96bad3afea854b9e2781a235f39d90ce32ed80e80732cf08defa279b202cbb0f3a811bc4d8150b2ad1463c21f45a36f1f5a444c52f19c09359e3bc8f9cc9dd5", :logged-in? true, :mouse-x 445, :mouse-y 783}, :clipboard {:selections nil, :current nil}, :sidebar {:show? true}}}))
+
+(deftest lib-test
+         (testing "Convert strings to integer."
+           (is (= 4
+                  (lib/str->int "4")))
+           (is (= 9999999999999999999999999
+                  (lib/str->int "9999999999999999999999999")))
+           (is (nil? (lib/str->int "")))
+           (is (nil? (lib/str->int "foo"))))
+
+         (testing "cljs to json conversion stuff."
+           (let [json "{\"distance_name\": \"Levensthein\", \"values\": {\"00020_020\": \"Foobaraaaaaaaaaaaaaa.\", \"00033_013\": \"This is the only park in our city.\"}}"]
+             (is (= {:distance_name "Levensthein", :values {:00020_020 "Foobaraaaaaaaaaaaaaa.", :00033_013 "This is the only park in our city."}} (lib/json->clj json)))))
+
+         (testing "Get issue for uid."
+           (is (= "Elektroautos"
+                  (:title (lib/get-issue 3))))
+           (is (= "3"
+                  (:uid (lib/get-issue "Elektroautos"))))
+           (is (nil? (lib/get-issue "This should not be an issue in our app-state"))))
+
+         (testing "Get reference by id."
+           (let [refs [{:url "api/town-has-to-cut-spending/justify/70/t", :uid 1, :text "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"} {:url "api/elektroautos/justify/72/t", :uid 3, :text "Es sei "ein gutes Gefühl", sagt Vater Richard Dolphin\n"} {:url "api/town-has-to-cut-spending/justify/73/t", :uid 4, :text "meisten Nachbarkommunen"} {:url "api/town-has-to-cut-spending/justify/74/t", :uid 5, :text "deutschen Kommunen"} {:url "api/town-has-to-cut-spending/justify/75/t", :uid 6, :text "Es sei "ein gutes Gefühl", sagt Vater Richard Dolphin "} {:url "api/town-has-to-cut-spending/justify/76/t", :uid 7, :text "Tatsächlich ist Düsseldorf ein außergewöhnlicher Fall unter den deutschen Kommunen . Knapp 300 Millionen Euro plant die Stadt in diesem Jahr für Kinderfeste, Jugendbücher und Betreuungseinrichtungen ein, selten hat sie so viel für Familien ausgegeben. Vor ein paar Monaten wurden gar die Kindergartengebühren für Drei- bis Sechsjährige abgeschafft. Sparen muss Düsseldorf nicht, der Haushalt für das Jahr 2010 ist ausgeglichen, ein Kunststück, das der Stadt bereits zum elften Mal in Folge gelingt. Ja, mehr noch: Seit 2007 ist die Stadt schuldenfrei, inzwischen hat sie sich sogar ein ansehnliches Polster angespart.\n\nEinige Städte haben im vergangenen Aufschwung immerhin jedes Jahr mehr Geld eingenommen als ausgegeben. Doch die meisten Nachbarkommunen  von Düsseldorf stehen kurz vor dem Zusammenbruch, wie sich auch aus einer gerade erschienenen Studie der Bertelsmann-Stiftung ersehen lässt. "Die Schere zwischen armen und reichen Kommunen geht weiter auseinander", schreiben die Autoren. Es stelle sich die Frage, wie den rund 60 besonders armen Städten in Nordrhein-Westfalen der Haushaltsausgleich gelingen solle, wenn "sie nicht einmal während einer beispiellosen Wachstumsphase" der vergangenen Jahre dazu in der Lage waren. Die Hälfte der Städte im Bundesland hat"}]]
+             (is (= {:url "api/town-has-to-cut-spending/justify/70/t", :uid 1, :text "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"}
+                    (lib/get-reference 1 refs)))
+             (is (= {:url "api/town-has-to-cut-spending/justify/70/t", :uid 1, :text "Eine Krise in den neunziger Jahren brachte die Wende für die Stadt"}
+                    (lib/get-reference "1" refs)))
+             (is (nil? (lib/get-reference "foo" refs)))
+             (is (nil? (lib/get-reference -1 refs)))))
+
+         test-state)


[TH] improved error logging

[TH] improved error 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/democracyworks/electorate-works.git/'


DRY up empty result code in http formula

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


more tests for food/add

more tests for food/add

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/expez/jada.git/'


string/upper-case instead of .toUpperCase

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


use lower-case when encoding UUIDs

use lower-case when encoding UUIDs

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


add synchronized verbose functions.

add synchronized verbose functions.

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

--- src/leiningen/ancient/verbose.clj
+++ src/leiningen/ancient/verbose.clj
@@ -0,0 +1,31 @@
+(ns leiningen.ancient.verbose
+  (:require [leiningen.core.main :as main]
+            [jansi-clj.core :as color]))
+
+(def lock
+  (Object.))
+
+(defmacro verbosef
+  [& fmt]
+  `(locking lock
+     (main/info (format ~@fmt))))
+
+(defmacro debugf
+  [& fmt]
+  `(locking lock
+     (main/debug "(debug)" (format ~@fmt))))
+
+(defmacro infof
+  [& fmt]
+  `(locking lock
+     (main/info "(info) " (format ~@fmt))))
+
+(defmacro warnf
+  [& fmt]
+  `(locking lock
+     (main/warn (color/yellow "(warn) ") (format ~@fmt))))
+
+(defmacro errorf
+  [& fmt]
+  `(locking lock
+     (main/warn (color/red "(error)") (format ~@fmt))))


Generator module

Generator module

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


(chaining)

(chaining)

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


perform-test-cases and perform-test-case, solutions references

error: pathspec 'Breadth' did not match any file(s) known to git
error: pathspec 'First' did not match any file(s) known to git
error: pathspec 'Search' did not match any file(s) known to git
error: pathspec 'Shortest' did not match any file(s) known to git
error: pathspec 'Reach.clj' did not match any file(s) known to git


refactor get-bfs-test-cases

refactor get-bfs-test-cases


Abstracting the port for Heroku's sake

Abstracting the port for Heroku'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/batasrki/blog-post-app.git/'


notes

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


experimenting w/ different core-plans

experimenting w/ different core-plans


rev gensym prefix

rev gensym prefix


stubs for dynvar w/ default val for meta of comp/*


cleanup implementation a bit using new macros.

--- src/metabase/api/query.clj
+++ src/metabase/api/query.clj
@@ -32,7 +32,7 @@
 (defn query-clone
   "Create a new query by cloning an existing query.  Returns a 403 if user doesn't have acces to read query."
   [query-id]
-  (let-404 [query (sel :one Query :id query-id)]
+  (let-400 [query (sel :one Query :id query-id)]
     ;; TODO - validate that user has read perms on query
     (let [new-query-id (ins Query
                          :created_at (new java.util.Date)
@@ -50,18 +50,19 @@
 (defn query-create
   "Create a new query from user posted data."
   [body]
-  (let-400 [db (sel :one Database :id (:database body))]
-    (let [new-query-id (ins Query
-                         :created_at (new java.util.Date)
-                         :updated_at (new java.util.Date)
-                         :type "rawsql"
-                         :name (or (:name body) (str "New Query: " (new java.util.Date)))
-                         :details (json/write-str {:sql (:sql body) :timezone (:timezone body)})
-                         :version 1
-                         :public_perms (or (:public_perms body) common/perms-none)
-                         :creator_id 1 ;; TODO - current user id
-                         :database_id (:id db))]
-      (sel :one Query :id (:id new-query-id)))))
+  (check (exists? Database :id (:database body)) [400 "Specified database does not exist."])
+  ;; TODO - validate that user has perms to create against this database
+  (let [new-query-id (ins Query
+                       :created_at (new java.util.Date)
+                       :updated_at (new java.util.Date)
+                       :type "rawsql"
+                       :name (or (:name body) (str "New Query: " (new java.util.Date)))
+                       :details (json/write-str {:sql (:sql body) :timezone (:timezone body)})
+                       :version 1
+                       :public_perms (or (:public_perms body) common/perms-none)
+                       :creator_id 1 ;; TODO - current user id
+                       :database_id (:database body))]
+    (sel :one Query :id (:id new-query-id))))

 (defendpoint POST "/" [:as {body :body}]


Remove :data from schema validation errors

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


Added Jolley's solution

Added Jolley's solution

error: pathspec 'src/main/cljc/clojure_club/meadow_finder/jjolley.cljc' did not match any file(s) known to git


count parse failures

count parse failures

fatal: unable to access 'https://github.com/dgopstein/atom-finder.git/': The requested URL returned error: 403


Fix tests for handle-electorate-create

Fix tests for handle-electorate-create

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


better error when resource not found

better error when resource not found

fixes #333

--- sidecar/src/figwheel_sidecar/components/figwheel_server.clj
+++ sidecar/src/figwheel_sidecar/components/figwheel_server.clj
@@ -111,7 +111,7 @@
          (route/resources "/" {:root http-server-root})
          (or resolved-ring-handler (fn [r] false))
          (GET "/" [] (resource-response "index.html" {:root http-server-root}))
-         (route/not-found "
Page not found
"))
+         (route/not-found "

Figwheel Server: Resource not found

Keep on figwheelin'

"))
         ;; adding cors to support @font-face which has a strange cors error
         ;; super promiscuous please don't uses figwheel as a production server :)
         (cors/wrap-cors


Add plugin example

Add plugin example

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


Story ID: RPC-236 Summary: WIP: testing terminal/get-exp-act

error: pathspec 'test/untangled_spec/reporters/terminal_spec.clj' did not match any file(s) known to git

--- test/untangled_spec/reporters/terminal_spec.clj
+++ test/untangled_spec/reporters/terminal_spec.clj
@@ -0,0 +1,35 @@
+(ns untangled-spec.reporters.terminal-spec
+  (:require [untangled-spec.reporters.terminal :refer [get-exp-act]]
+            [untangled-spec.assertions :refer [triple->assertion]]
+            [clojure.test :as t :refer (are is deftest with-test run-tests testing do-report assert-expr)]
+            [untangled-spec.core :refer [specification component behavior provided assertions]])
+  (:import clojure.lang.ExceptionInfo))
+
+(specification "untangled-spec.terminal-spec"
+  (component "get-exp-act"
+    (behavior "with no :extra field, just returns [actual expected]"
+      (assertions
+        (get-exp-act {:actual 0 :expected 1}) => [0 1]))
+    (let [test-case (fn [x] (-> x triple->assertion eval get-exp-act))]
+      (provided "with :extra, ie: from triple->assertion"
+        (clojure.test/do-report x) => x
+        (component "=>"
+          (behavior "basic"
+            (is (= [5 3] (test-case '(5 => 3)))))
+          (behavior "complex"
+            (is (= [5 3] (test-case '((+ 3 2) => (+ 2 1)))))))
+
+        (component "=fn=>"
+          (behavior "basic"
+            (is (= [5 'even?] (test-case '(5 =fn=> even?)))))
+          (behavior "lambda"
+            (is (re-find #"even\?"
+                         (->> '(5 =fn=> #(even? %))
+                              test-case second str))))
+          (behavior "complex"
+            (is (= [7 '(fn [x] (even? x))]
+                   (test-case '((+ 5 2) =fn=> (fn [x] (even? x))))))))
+
+        (component "=throws=>"
+          (behavior "simple"
+            ))))))


Simple DB corrections

Simple DB corrections

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/acessocard/microscope.git/'


Factored out with-java-out-str, introducing with-out-str-not-threadsafe

error: pathspec 'jvm-runner/test/codewars/test/utils.clj' did not match any file(s) known to git

--- jvm-runner/test/codewars/test/utils.clj
+++ jvm-runner/test/codewars/test/utils.clj
@@ -0,0 +1,21 @@
+(ns codewars.test.utils
+  "A small collection of utilities for testing"
+  (:import [java.io PrintStream ByteArrayOutputStream StringWriter]))
+
+(defmacro with-java-out-str
+  "A version of clojure.core/with-out-str suitable for wrapping java's System.out"
+  [& body]
+  `(let [original-out# (PrintStream. (. System out))
+         byte-out# (ByteArrayOutputStream.)]
+     (-> byte-out# (PrintStream.) System/setOut)
+     ~@body
+     (System/setOut original-out#)
+     (.toString byte-out#)))
+
+(defmacro with-out-str-not-threadsafe
+  "A version of clojure.core/with-out-str that is not threadsafe"
+  [& body]
+  `(let [s# (StringWriter.)]
+     (with-redefs [*out* s#]
+       ~@body
+       (str s#))))


Add a util file

Add a util file

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

--- src/grimoire/util.clj
+++ src/grimoire/util.clj
@@ -0,0 +1,30 @@
+(ns grimoire.util
+  "A namespace of stupid little helper bits including tye Grimoire munge
+  operations."
+  (:refer-clojure :exclude [munge])
+  (:require [clojure.string :as str]))
+
+(defn munge
+  "This is the munge function as used by the current version of Grimoire. Munges
+  the characters #\"[.?/]\" and nothing more. Should only be applied to
+  symbols. Namespaces, packages, groups and soforth need not be name munged."
+  [s]
+  (-> s
+      (str/replace "?" "_QMARK_")
+      (str/replace "." "_DOT_")
+      (str/replace "/" "_SLASH_")
+      (str/replace #"^_*" "")
+      (str/replace #"_*$" "")))
+
+(defn update-munge
+  "This function attempts to transform the legacy (Grimoire 0.2.X, 0.1.X)
+  munging of strings into the modern munging above. Note that update-munge is
+  _not_ and unmunge operation."
+  [s]
+  (-> s
+      (str/replace #"_?DASH_?"  "-")
+      (str/replace #"_?BANG_?"  "!")
+      (str/replace #"_?STAR_?"  "*")
+      (str/replace #"_?EQ_?"    "=")
+      (str/replace #"_?LT_?"    "<")
+      (str/replace #"_?GT_?"    ">")))


removed add-job

removed add-job

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


Started byte messenger benchmark

Started byte messenger benchmark

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

--- src/basinet/samples/byte_messenger.clj
+++ src/basinet/samples/byte_messenger.clj
@@ -0,0 +1,22 @@
+(ns basinet.samples.byte-messenger
+  (:require [basinet :as b]
+            [basinet.tcp :as tcp]))
+
+(defn- handle-connection [socket]
+  (with-open [source (b/source socket)
+              sink (b/sink socket)]
+    (dotimes [i 100]
+      (let [bytes (doall (repeatedly 10 #(b/pop source)))]
+        (reduce #(do (b/push %1 %2) %1) sink  (reverse bytes))))))
+
+(defn server
+  ([] (server 10000))
+  ([port] (server "localhost" port))
+  ([host port] (server "localhost" port 10))
+  ([host port connections]
+     (with-open [acceptor (tcp/acceptor host port)]
+       (dotimes [i connections]
+         (let [handler (agent (b/pop acceptor))]
+           (send-off handler handle-connection))))))
+
+


Add missing sample_submit_job.clj file

Add missing sample_submit_job.clj file

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

--- resources/leiningen/new/onyx_app/sample_submit_job.clj
+++ resources/leiningen/new/onyx_app/sample_submit_job.clj
@@ -0,0 +1,33 @@
+(ns {{app-name}}.jobs.sample-submit-job
+  (:require [clojure.java.io :refer [resource]]
+            [com.stuartsierra.component :as component]
+            [{{app-name}}.workflows.sample-workflow :refer [workflow]]
+            [{{app-name}}.catalogs.sample-catalog :refer [build-catalog] :as sc]
+            [{{app-name}}.lifecycles.sample-lifecycle :refer [build-lifecycles] :as sl]
+            [{{app-name}}.flow-conditions.sample-flow-conditions :as sf]
+            [{{app-name}}.functions.sample-functions]
+            [{{app-name}}.dev-inputs.sample-input :as dev-inputs]
+            [onyx.api]))
+
+(defn submit-job [dev-env]
+  (let [dev-cfg (-> "dev-peer-config.edn" resource slurp read-string)
+        peer-config (assoc dev-cfg :onyx/id (:onyx-id dev-env))
+        ;; Turn :read-lines and :write-lines into core.async I/O channels
+        stubs [:read-lines :write-lines]
+        ;; Stubs the catalog entries for core.async I/O
+        dev-catalog (sc/in-memory-catalog (build-catalog 20 50) stubs)
+        ;; Stubs the lifecycles for core.async I/O
+        dev-lifecycles (sl/in-memory-lifecycles (build-lifecycles) dev-catalog stubs)]
+    ;; Automatically pipes the data structure into the channel, attaching :done at the end
+    (sl/bind-inputs! dev-lifecycles {:read-lines dev-inputs/lines})
+    (let [job {:workflow workflow
+               :catalog dev-catalog
+               :lifecycles dev-lifecycles
+               :flow-conditions sf/flow-conditions
+               :task-scheduler :onyx.task-scheduler/balanced}]
+      (onyx.api/submit-job peer-config job)
+      ;; Automatically grab output from the stubbed core.async channels,
+      ;; returning a vector of the results with data structures representing
+      ;; the output.
+      (sl/collect-outputs! dev-lifecycles [:write-lines]))))
+


fix alumni account overview

fix alumni account overview

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


Example test.

Example 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 support for basic bolts

Add support for basic bolts

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


trying a different parameter

trying a different parameter


argitaletxeak-lortu parametrorik ez

argitaletxeak-lortu parametrorik ez

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


Adding aRuleForDivisibilityBy7.clj kata. Still need to finish it.

error: pathspec 'hackerrank/functional_programming/clojure/codewars/aRuleForDivisibilityBy7.clj' did not match any file(s) known to git

--- hackerrank/functional_programming/clojure/codewars/aRuleForDivisibilityBy7.clj
+++ hackerrank/functional_programming/clojure/codewars/aRuleForDivisibilityBy7.clj
@@ -0,0 +1,49 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; --------------------------- ;;
+;; A Rule of Divisibility by 7 ;;
+;; --------------------------- ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; A number m of the form 10x + y is divisible by 7 if and only if x − 2y is divisible by 7. In other words, subtract twice the last digit from the number formed by the remaining digits. Continue to do this until a number known to be divisible or not by 7 is obtained; you can stop when this number has at most 2 digits because you are supposed to know if a number between 0 and 99 is divisible by 7 or not.
+
+;; The original number is divisible by 7 if and only if the last number obtained using this procedure is divisible by 7.
+
+;; Examples:
+
+;; 1 - m = 371 -> 37 − (2×1) -> 37 − 2 = 35 ; thus, since 35 is divisible by 7, 371 is divisible by 7.
+
+;; The number of steps to get the result is 1.
+
+;; 2 - m = 1603 -> 160 - (2 x 3) -> 154 -> 15 - 8 = 7 and 7 is divisible by 7.
+
+;; 3 - m = 372 -> 37 − (2×2) -> 37 − 4 = 33 ; thus, since 33 is not divisible by 7, 372 is not divisible by 7.
+
+;; The number of steps to get the result is 2.
+
+;; 4 - m = 477557101->47755708->4775554->477547->47740->4774->469->28 and 28 is divisible by 7, so is 477557101.
+
+;; The number of steps is 7.
+
+(defn is-divisible-by-7 [n]
+  "Returns true if n % 7 == 0"
+  (= (= (mod n 7) 0) 0))
+
+(defn seven [m]
+  (loop [steps 1]
+    (let [x (quot m 10)
+          y (* (mod m 10) 2)
+          res (- x y)]
+      (if (is-divisible-by-7 res)
+          (list res steps)))
+      ;; (if-not (and (>= x 0) (< x 99))
+      ;; )
+    (recur (inc steps))))
+
+;; testing
+(let [v 371 x (seven v) y [35 1]] (println v ": " x "=> " y "? " (= x y)))
+(let [v 1603 x (seven v) y [7 2]] (println  v ": " x "=> " y "? " (= x y)))
+
+
+
+
+


Mongo's SSL key in details is :ssl, not :use-ssl

--- src/metabase/driver/mongo/util.clj
+++ src/metabase/driver/mongo/util.clj
@@ -44,13 +44,12 @@
   "Run F with a new connection (bound to `*mongo-connection*`) to DATABASE.
    Don't use this directly; use `with-mongo-connection`."
   [f database]
-  ;; The Mongo SSL detail is keyed by :use-ssl because the frontend has accidentally been saving all of the Mongo DBs with {:ssl true}
-  (let [{:keys [dbname host port user pass use-ssl]
-         :or   {port 27017, pass "", use-ssl false}} (cond
-                                                       (string? database)            {:dbname database}
-                                                       (:dbname (:details database)) (:details database) ; entire Database obj
-                                                       (:dbname database)            database            ; connection details map only
-                                                       :else                         (throw (Exception. (str "with-mongo-connection failed: bad connection details:" (:details database)))))
+  (let [{:keys [dbname host port user pass ssl]
+         :or   {port 27017, pass "", ssl false}} (cond
+                                                   (string? database)            {:dbname database}
+                                                   (:dbname (:details database)) (:details database) ; entire Database obj
+                                                   (:dbname database)            database            ; connection details map only
+                                                   :else                         (throw (Exception. (str "with-mongo-connection failed: bad connection details:" (:details database)))))
         user             (when (seq user) ; ignore empty :user and :pass strings
                            user)
         pass             (when (seq pass)
@@ -58,7 +57,7 @@
         server-address   (mg/server-address host port)
         credentials      (when user
                            (mcred/create user dbname pass))
-        connect          (partial mg/connect server-address (build-connection-options :ssl? use-ssl))
+        connect          (partial mg/connect server-address (build-connection-options :ssl? ssl))
         conn             (if credentials
                            (connect credentials)
                            (connect))


Problem 0048.

Problem 0048.

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


Added function for persisting Environment resources. Fixes #36

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

--- src/prop_shop/data/environment.clj
+++ src/prop_shop/data/environment.clj
@@ -0,0 +1,13 @@
+(ns prop-shop.data.environment
+  "Provides data access and manipulation for Environment resources."
+  {:author "Justin Timbers"}
+  (:require [prop-shop.data.base :as b]))
+
+
+(defn add-environment
+  "Persists a new Environment with the provided name."
+  {:added "0.1"}
+  [name]
+  (b/add-entity
+    {:name name
+     :type :environment}))


Make it less machine-specific.

Make it less machine-specific.


[lein] Add leiningen user profile config

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

--- lein/.lein/profiles.clj
+++ lein/.lein/profiles.clj
@@ -0,0 +1,2 @@
+{:user {:plugins [[nightlight/lein-nightlight "1.6.3"]
+                  [lein-auto "0.1.3"]]}}


Move to using 20 go blocks with associated chans

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/MitchellJThomas/medir.git/'


test case for ns clinvar-submitter.ld

test case for ns clinvar-submitter.ld

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

--- test/clinvar_submitter/ld_test.clj
+++ test/clinvar_submitter/ld_test.clj
@@ -0,0 +1,17 @@
+(ns clinvar-submitter.ld-test
+  (:require [clojure.test :refer :all]
+            [clinvar-submitter.ld :refer :all]))
+
+(deftest read-ld-test
+  (testing "Test if an identifier is in symbol table"
+           (let [t (read-ld "data/test_interp_1.dmwg.json" "data/context-new.jsonld")]
+           (is (= "http://reg.genome.network/allele/CA229854"
+           (resolve-id t "http://reg.genome.network/allele/CA229854")
+                   (println " Identifier is in symbol table"))))))
+
+(deftest ld-get-test
+  (testing "Test if an map key value is in symbol table"
+  (let [t (read-ld "data/test_interp_1.dmwg.json" "data/context-new.jsonld")]
+  (is (= t
+         (ld-get t "cg:A156" "cg:A158")
+         (println " Map is in symbol table"))))))


zigzag

zigzag

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


adding back config/get-project-builds

adding back config/get-project-builds

--- sidecar/src/figwheel_sidecar/config.clj
+++ sidecar/src/figwheel_sidecar/config.clj
@@ -587,6 +587,12 @@
   (config-source->prepped-figwheel-internal (initial-config-source)))

 (def fetch-config fetch-figwheel-config)
+
+(defn get-project-builds []
+  (-> (->lein-project-config-source)
+      ->config-data
+      all-builds
+      map-to-vec-builds))

 #_(fetch-config)


First cljs file

First cljs file

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

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -0,0 +1,3 @@
+(ns overtoneinterface.client.main)
+
+(js/alert "hey!")


lein profiles version updates

lein profiles 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/sw1nn/dotfiles.git/'


Add dancer example.

Add dancer example.

error: pathspec 'src/cljs/quil_site/examples/dancer.cljs' did not match any file(s) known to git

--- src/cljs/quil_site/examples/dancer.cljs
+++ src/cljs/quil_site/examples/dancer.cljs
@@ -0,0 +1,57 @@
+(ns quil-site.examples.dancer
+  (:require [quil.core :as q :include-macros true]
+            quil-site.main ;DELETE
+  ))
+
+(defn setup []
+  (q/frame-rate 30))
+
+(defn pulse [low high rate]
+  (let [diff (- high low)
+        half (/ diff 2)
+        mid (+ low half)
+        s (/ (q/millis) 1000.0)
+        x (q/sin (* s (/ 1.0 rate)))]
+    (+ mid (* x half))))
+
+(defn t []
+  (* 0.001 (q/millis)))
+
+(def speed 0.5)
+
+(defn stem [base-x]
+  (let [magic (/ 8 (q/width))
+        x-max (/ (q/width) 4)
+        x-max-top (/ x-max 2)
+        y-max (/ (q/height) 2)
+
+        x (+ base-x
+             (pulse (- x-max-top) x-max-top 1.0))
+        y (+ (- y-max)
+             (* 0.5 y-max
+                (q/sin (+ (* speed (t))
+                          (* magic base-x))))
+             (* (/ 3) y-max (q/sin (* 2 (t)))))]
+    (q/bezier base-x 0 base-x 0
+              0 (- x-max) x y)))
+(defn draw []
+  (q/background (pulse 230 250 1.0))
+  (q/stroke 0)
+  (q/stroke-weight 1)
+  (q/no-fill)
+  (let [size (q/width)
+        x-max (/ size 4)]
+    (q/with-translation [(/ size 2) (q/height)]
+      (doseq [x (range (- x-max) x-max 2)]
+        (stem x)))))
+
+(defn run-sketch [host size] ;DELETE
+(q/sketch
+   :host host
+   :size [size size]
+   :setup setup
+   :draw draw)
+) ;DELETE
+
+(quil-site.main/register-example! "dancer" "Erik Svedäng" run-sketch :interactive? false) ;DELETE
+


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


Two nitpicky changes in util.

Two nitpicky changes in util.

--- src/clj/backtype/storm/util.clj
+++ src/clj/backtype/storm/util.clj
@@ -107,8 +107,7 @@
     (toks->path (conj toks name))
     ))

-(defn not-nil? [o]
-  (not (nil? o)))
+(def not-nil? (complement nil?))

 (defn barr [& vals]
   (byte-array (map byte vals)))
@@ -517,7 +516,7 @@
     ))

 (defn nil-to-zero [v]
-  (if v v 0))
+  (or v 0))

 (defn bit-xor-vals [vals]
   (reduce bit-xor 0 vals))


Completed subcircle manipulation.

Completed subcircle manipulation.

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


ICache protocol

ICache protocol

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


Enabled latest-version.(json|svg) when group diffs

When the group is known but doesn't match the artifact name, so that it
can be viewed as JSON or SVG e.g.

  /:group-id/:artifact-id/latest-version.:file-format

--- src/clojars/routes/artifact.clj
+++ src/clojars/routes/artifact.clj
@@ -31,6 +31,19 @@
                     (db/recent-versions group-id artifact-id 5)
                     (db/count-versions group-id artifact-id)))))

+(defn response-based-on-format
+  "render appropriate response based on the file type suffix provided:
+  JSON or SVG"
+  [file-format artifact-id & [group-id]]
+  (let [group-id (or group-id artifact-id)]
+  (cond
+    (= file-format "json") (-> (response/response (view/make-latest-version-json group-id artifact-id))
+                               (response/header "Cache-Control" "no-cache")
+                               (response/content-type "application/json; charset=UTF-8"))
+    (= file-format "svg") (-> (response/response (view/make-latest-version-svg group-id artifact-id))
+                              (response/header "Cache-Control" "no-cache")
+                              (response/content-type "image/svg+xml")))))
+
 (defroutes routes
   (GET ["/:artifact-id", :artifact-id #"[^/]+"] [artifact-id]
        (show artifact-id artifact-id))
@@ -58,20 +71,14 @@
         :artifact-id #"[^/]+"
         :file-format #"(svg|json)$"]
        [artifact-id file-format]
-       (cond
-         (= file-format "json") (-> (response/response (view/make-latest-version-json artifact-id artifact-id))
-                                    (response/header "Cache-Control" "no-cache")
-                                    (response/content-type "application/json; charset=UTF-8"))
-         (= file-format "svg") (-> (response/response (view/make-latest-version-svg artifact-id artifact-id))
-                                    (response/header "Cache-Control" "no-cache")
-                                    (response/content-type "image/svg+xml"))))
+       (response-based-on-format file-format artifact-id))

-  (GET ["/:group-id/:artifact-id/latest-version.svg"
-        :group-id #"[^/]+" :artifact-id #"[^/]+"]
-       [group-id artifact-id]
-       (-> (response/response (view/make-latest-version-svg group-id artifact-id))
-           (response/header "Cache-Control" "no-cache")
-           (response/content-type "image/svg+xml")))
+  (GET ["/:group-id/:artifact-id/latest-version.:file-format"
+        :group-id #"[^/]+"
+        :artifact-id #"[^/]+"
+        :file-format #"(svg|json)$"]
+       [group-id artifact-id file-format]
+       (response-based-on-format file-format artifact-id group-id))

   (POST ["/:group-id/:artifact-id/promote/:version"
          :group-id #"[^/]+" :artifact-id #"[^/]+" :version #"[^/]+"]


[WM] require non-empty unschedule identifier maps

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


Add schema validation to new handlers

Add schema validation to new handlers

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


day25

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

--- src/adventofcode2017/day25.clj
+++ src/adventofcode2017/day25.clj
@@ -0,0 +1,43 @@
+(ns adventofcode2017.day25)
+
+(loop [[tape cursor state] [{} 0 :A]
+       steps 0]
+  (if (= 12481997 steps)
+    (count (filter #(= 1 %) (vals tape)))
+    (case state
+      :A
+      (recur (if (zero? (get tape cursor 0))
+               [(assoc tape cursor 1) (inc cursor) :B]
+               [(assoc tape cursor 0) (dec cursor) :C])
+             (inc steps))
+
+      :B
+      (recur (if (zero? (get tape cursor 0))
+               [(assoc tape cursor 1) (dec cursor) :A]
+               [(assoc tape cursor 1) (inc cursor) :D])
+             (inc steps))
+
+      :C
+      (recur (if (zero? (get tape cursor 0))
+               [(assoc tape cursor 0) (dec cursor) :B]
+               [(assoc tape cursor 0) (dec cursor) :E])
+             (inc steps))
+
+      :D
+      (recur (if (zero? (get tape cursor 0))
+               [(assoc tape cursor 1) (inc cursor) :A]
+               [(assoc tape cursor 0) (inc cursor) :B])
+             (inc steps))
+
+      :E
+      (recur (if (zero? (get tape cursor 0))
+               [(assoc tape cursor 1) (dec cursor) :F]
+               [(assoc tape cursor 1) (dec cursor) :C])
+             (inc steps))
+
+      :F
+      (recur (if (zero? (get tape cursor 0))
+               [(assoc tape cursor 1) (inc cursor) :D]
+               [(assoc tape cursor 1) (inc cursor) :A])
+             (inc steps)))))
+; 3362


Added tests for chatroom!

Added tests for chatroom!

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

--- test/grooming/chatroom_test.clj
+++ test/grooming/chatroom_test.clj
@@ -0,0 +1,12 @@
+(ns grooming.chatroom-test
+  (:require [clojure.test :refer :all]
+            [grooming.chat.chatroom :refer :all]))
+
+(deftest join-and-leave-chat
+  (is (= {:foobar {:members #{"id"}
+                   :created-by "id"}}
+         (join "id" :foobar))
+      "Join chat")
+  (is (= {}
+         (leave "id" :foobar))
+      "Leave chat"))


Some set up work for the virtual peer.

Some set up work for the virtual peer.

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

--- src/onyx/peer/virtual_peer.clj
+++ src/onyx/peer/virtual_peer.clj
@@ -0,0 +1,53 @@
+(ns onyx.peer.virtual-peer
+  (:require [clojure.core.async :refer [chan alts!! >!! <!! close!]]
+            [com.stuartsierra.component :as component]
+            [onyx.extensions :as extensions]))
+
+(defn payload-loop [payload-ch shutdown-ch status-ch]
+  (loop [pipeline nil]
+    (when-let [[v ch] (alts!! [payload-ch shutdown-ch])]
+      (when-not (nil? pipeline)
+        (component/stop pipeline))
+      (when (= ch payload-ch)
+        (let [new-pipeline (comment "Make a new one")]
+          (recur new-pipeline))))))
+
+(defrecord VirtualPeer []
+  component/Lifecycle
+
+  (start [{:keys [sync queue] :as component}]
+    (prn "Starting Task Pipeline")
+
+    (let [peer (extensions/create sync :peer)
+          payload (extensions/create sync :payload)
+          pulse (extensions/create sync :pulse)
+          shutdown (extensions/create sync :shutdown)
+
+          payload-ch (chan 1)
+          shutdown-ch (chan 1)
+          status-ch (chan 1)]
+
+      (extensions/write-place sync peer {:pulse pulse :shutdown shutdown :payload payload})
+      (extensions/on-change sync payload #(>!! payload-ch %))
+
+      (assoc component
+        :payload-ch payload-ch
+        :shutdown-ch shutdown-ch
+        :status-ch status-ch
+
+        :payload-thread (future (payload-loop payload-ch shutdown-ch status-ch)))))
+
+  (stop [component]
+    (prn "Stopping Task Pipeline")
+
+    (close! (:payload-ch component))
+    (close! (:shutdown-ch component))
+    (close! (:status-ch component))
+
+    (future-cancel (:payload-thread component))
+
+    component))
+
+(defn virtual-peer []
+  (map->VirtualPeer {}))
+


stub for the main files

stub for the main files

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

--- src/fogus/me/trammel.clj
+++ src/fogus/me/trammel.clj
@@ -0,0 +1,6 @@
+(ns fogus.me.trammel
+  (:include '[clojure.test :as test]))
+
+(defmacro defcontract [& specs]
+  nil)
+


Hacks to make map.html serve up correctly via a WAR file, i.e. on heroku.

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


Switching over to using hashes

Switching over to using hashes

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


rev requires,imports

rev requires,imports


NEW ABSTRACTION - cgens (composite generators). These are composites of ugens and/or other cgens.

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

--- src/overtone/sc/cgen.clj
+++ src/overtone/sc/cgen.clj
@@ -0,0 +1,162 @@
+(ns
+    ^{:doc "CGens, or Composite Generators are composite UGens and/or other CGens. These are purely an Overtone abstraction whereas UGens have matching counterparts on SuperCollider Server. CGens allow you to build and share re-usable sub-synth components which act like ugens."
+      :author "Sam Aaron"}
+  overtone.sc.cgen
+
+  (:use [overtone util]
+        [overtone.sc ugen]
+        [overtone.sc.ugen defaults doc]))
+
+(defn- parse-cgen-params
+  "Parse a defcgen's param list throwing exceptions where it isn't well-formed
+  Returns a list of maps containing at least the key :name"
+  [params]
+  (when-not (vector? params)
+    (throw (IllegalArgumentException. (str "defcgen expected a vector of arguments, instead it found a " (class params) ", " params))))
+  (loop [parsed []
+         to-parse params]
+    (if (empty? to-parse)
+      parsed
+      (if (not (symbol? (first to-parse)))
+        (throw (IllegalArgumentException. (str "Expecting a symbol describing the cgen param name. Instead got a " (class (first to-parse)) ": " (first to-parse))))
+
+        (if (map? (second to-parse))
+          (recur (conj parsed (merge (second to-parse) {:name (keyword (name (first to-parse)))}))
+                 (drop 2 to-parse))
+          (recur (conj parsed {:name (keyword (name (first to-parse)))})
+                 (drop 1 to-parse)))))))
+
+(defn- parse-cgen-bodies
+  "Parse each of the defcgen's body throwing exceptions when the form isn't well-formed.
+  Returns the default rate and a map of rates to associated bodies"
+  [bodies]
+  (when (empty? bodies)
+    (throw (IllegalArgumentException. (str "defcgen was expecting one or more bodies implementing the various rates this cgen will support i.e. (:ar (sin-osc 440))"))))
+  (let [[rate bodies] (loop [default-rate nil
+                             parsed       {}
+                             to-parse     bodies]
+                        (if (empty? to-parse)
+                          [default-rate parsed]
+                          (let [body (first to-parse)]
+                            (if (= :default (first body))
+                              (recur (second body) parsed (rest to-parse))
+                              (if (= 2 (count body))
+                                (if-not (or (= :ar (first body))
+                                            (= :ir (first body))
+                                            (= :kr (first body))
+                                            (= :dr (first body)))
+                                  (throw (IllegalArgumentException. (str "defcgen was expecting on of the following keywords as the first item in each cgen body form: :ar, :ir, :kr, :dr or :default. Found " (first body))))
+                                  (recur default-rate (assoc parsed (first body) (second body)) (rest to-parse)))
+                                (throw (IllegalArgumentException. (str "defcgen was expecting each of the bodies to have two elements - a rate and an implementation form"))))))))
+        default-rate  (if rate
+                        rate
+                        (if (= 1 (count bodies))
+                          (ffirst bodies)
+                          (default-ugen-rate (keys bodies))))]
+    (when-not (get bodies default-rate)
+      (throw (IllegalArgumentException. (str "defcgen's default rate needs to have an implementation. Please supply an implementation for rate: " default-rate))))
+    [default-rate bodies]))
+
+(defn- cgen-form
+  "Pull out various bits of cgen information from a defcgen form"
+  [u-form]
+  (let [doc                         (if (string? (first u-form))
+                                      (first u-form)
+                                      "Please add some docs!")
+        u-form                      (if (string? (first u-form))
+                                      (rest u-form)
+                                      u-form)
+        params                      (parse-cgen-params (first u-form))
+        [default-rate rated-bodies] (parse-cgen-bodies (rest u-form))]
+
+    [doc params rated-bodies default-rate]))
+
+(defn- mk-cgen-fn
+  "Make the function which gets executed when a cgen is called."
+  [param-names defaults body]
+  (let [args     (gensym 'args)
+        bindings (reduce (fn [final param]
+                           (conj final (symbol (name param)) `(get (arg-mapper ~args ~param-names ~defaults) ~param)))
+                         []
+                         param-names)]
+    `(fn [& ~args]
+       (let [~@bindings]
+         (with-ugens
+           ~body)))))
+
+(defn generate-full-doc
+  "generate a full docstring from a the specified cgen information"
+  [doc categories rate params rates]
+  (let [spec {:doc          doc
+              :categories   categories
+              :default-rate rate
+              :args         (map stringify-map-vals params)
+              :rates        (into #{} rates)}]
+    (:full-doc (with-full-doc spec))))
+
+(defn cgen
+  "Create a cgen (composite generator) - a composition of ugens and/or other
+  cgens used as a general purpose synth building block.
+  A cgen behaves similarly to a ugen - it has a default rate, named params, full
+  docstring and may be mixed with both ugens and cgens in the construction of
+  synths."
+  ([name doc params body categories rate] (cgen name doc params body categories rate #{rate}))
+  ([name doc params body categories rate rates]
+     (let [param-names (vec (map :name params))
+           param-names (vec (map :name params))
+           defaults    (reduce (fn [s el] (assoc s (:name el) (:default el)))
+                               {}
+                               params)
+           full-doc    (generate-full-doc doc categories rate params rates)
+           cgen-fn     (mk-cgen-fn param-names defaults body)]
+       `(callable-map {:params ~params
+                       :doc ~doc
+                       :full-doc ~full-doc
+                       :categories ~categories
+                       :rate ~rate
+                       :name ~(str name)
+                       :src (quote ~body)
+                       :type :cgen}
+                      ~cgen-fn))))
+
+(defmacro defcgen
+  "Define one or more related cgens (composite generators) with differnt rates.
+
+  A cgen has a name, docstring and 0 or more params which themselves have names
+  and optional info maps with the keys :default and :doc. Next you need to
+  describe a number of rated bodies which may reference the named params.
+  Finally, an optional :default may be specified which will define the default
+  rate for this cgen, or if ommitted the standard rate precedence is used.
+
+  An example cgen definition is as follows:
+
+  (defcgen pm-osc
+    \"phase modulation sine oscillator pair.\"
+    [car-freq {:default 0.0 :doc \"Carrier frequency\"}
+     mod-freq {:default 0.0 :doc \"Modulation frequency\"}
+     pm-index {:default 0.0 :doc \"Phase modulation index\"}
+     mod-phase {:default 0.0 :doc \"Modulation phase\"}]
+    (:ar (sin-osc:ar car-freq (* pm-index (sin-osc:ar mod-freq mod-phase))))
+    (:kr (sin-osc:kr car-freq (* pm-index (sin-osc:kr mod-freq mod-phase))))
+    (:default :ar))"
+  [c-name & c-form]
+  (let [[doc params bodies default-rate] (cgen-form c-form)
+        arglists                         (vec (map #(symbol (name (:name %))) params))
+        arglists                         (list 'quote arglists)
+        rates                            (into #{} (keys bodies))
+        categories                       [["Composite Ugen"]]
+        full-doc                         (generate-full-doc doc categories default-rate params rates)
+        metadata                         {:doc full-doc
+                                          :arglists arglists}
+        default-body                     (get bodies default-rate)
+        default-cgen                     (cgen c-name doc params default-body categories default-rate)
+        default-c-name                   (with-meta c-name metadata)
+        cgen-defs                        [`(def ~default-c-name ~default-cgen)]]
+
+    (conj cgen-defs
+     (for [rate rates]
+       (let [body   (get bodies rate)
+             cgen   (cgen c-name doc params body categories rate)
+             c-name (symbol (str (name default-c-name) rate))
+             c-name (with-meta c-name metadata)]
+         `(def ~c-name ~cgen))))))


Update file names in template

Update file names in template

--- src/leiningen/new/cryogen.clj
+++ src/leiningen/new/cryogen.clj
@@ -57,7 +57,7 @@
                ["resources/templates/md/pages/another-page.md" (render "md/pages/another-page.md")]
                ["resources/templates/md/posts/2014-03-10-first-post.md" (render "md/posts/2014-03-10-first-post.md")]
                ["resources/templates/md/posts/2014-11-04-second-post.md" (render "md/posts/2014-11-04-second-post.md")]
-               ["resources/templates/md/posts/2014-12-11-docs.md" (render "md/posts/2014-12-11-docs.md")]
+               ["resources/templates/md/posts/2016-01-07-docs.md" (render "md/posts/2016-01-07-docs.md")]
                ;;Asciidoc templates
                ["resources/templates/asc/pages/adoc-page.asc" (render "asc/pages/adoc-page.asc")]
                ["resources/templates/asc/posts/2014-10-10-adoc-post.asc" (render "asc/posts/2014-10-10-adoc-post.asc")]


Remove unused function

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


Added initial pipeline in core [ci skip]

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


add etcd module

add etcd module

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

--- src/clj/dokkaa_builder/etcd.clj
+++ src/clj/dokkaa_builder/etcd.clj
@@ -0,0 +1,91 @@
+(ns dokkaa-builder.etcd
+  (:require [clj-http.client :as http]
+            [cheshire.core :as json])
+  (:refer-clojure :exclude [set get]))
+
+(defn remove-trailing-slash [url]
+  (if (and url (.endsWith url "/"))
+    (recur (.substring url 0 (dec (count url))))
+    url))
+
+(defn key->url [base-url k]
+    (if (and k (.startsWith k "/"))
+      (recur base-url (clojure.string/replace-first k #"/" ""))
+      (str base-url "/v2/keys/" k)))
+
+(defn- query-params [url {:keys [prev-val prev-index prev-exist wait recursive]}]
+  (let [params (cond-> []
+                       prev-val (conj (str "prevValue=" prev-val))
+                       prev-index (conj (str "prevIndex=" prev-index))
+                       prev-exist (conj (str "prevExist=" prev-exist))
+                       wait (conj (str "wait=" wait))
+                       recursive (conj (str "recursive=" recursive)))]
+    (if (empty? params)
+      url
+      (str url "?" (clojure.string/join "&" params)))))
+
+(defn- param-map [{:keys [value ttl]}]
+  (cond-> {}
+          value (merge {:value value})
+          ttl (merge {:ttl ttl})))
+
+(defn- parse-response [resp]
+  (json/parse-string (:body resp) true))
+
+(defn -invoke
+  ([base-url f k]
+     (-invoke base-url f k {}))
+  ([base-url f k {:keys [] :as keys}]
+     (let [url (-> base-url
+                   (remove-trailing-slash)
+                   (key->url k)
+                   (query-params (select-keys keys [:prev-val
+                                                    :prev-index
+                                                    :prev-exist
+                                                    :wait
+                                                    :recursive])))]
+       (try
+         (-> url
+             (f {:form-params (param-map (select-keys keys [:value :ttl]))})
+             (parse-response))
+         (catch Exception e
+           nil)))))
+
+(defn set [base-url k v & {:keys [] :as keys}]
+  "Will set the value of a key, the following options are
+   allowed: :ttl, :prev-val :prev-index and :prev-exist."
+  (-invoke base-url
+           http/put
+           k
+           (merge {:value v} keys)))
+
+(defn get [base-url k]
+  "Perform a listing of the given key, returning a map of its
+   details, or nil if the key does not exist."
+  (-invoke base-url http/get k))
+
+(defn exists? [base-url k]
+  "Returns true if the key exists."
+  (not (nil? (get base-url k))))
+
+(defn dir? [base-url k]
+  "Returns true if the key exists and is a directory."
+  (true? (:dir (get base-url k))))
+
+(defn delete! [base-url k]
+  "Performs a delete of the specified key."
+  (-invoke base-url http/delete k))
+
+(defn wait [base-url k & {:keys [] :as keys}]
+  "Takes an instance and returns a future, blocking until a
+   change is made on the requested key. Valid options are
+   :recursive true."
+  (future (-invoke base-url
+                   http/get
+                   k
+                   (merge {:wait true} keys))))
+
+(defn machines [admin-url]
+  (parse-response (http/get (-> admin-url
+                                remove-trailing-slash
+                                (str "/v2/admin/machines")))))


trying to build select

trying to build select

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


pagination with lazy-seq

pagination with lazy-seq

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

--- src/sandbox/lazyseq/pages.clj
+++ src/sandbox/lazyseq/pages.clj
@@ -0,0 +1,13 @@
+(ns sandbox.lazyseq.pages)
+
+(defn get-page [page-num]
+  (cond
+    (= page-num 1) "Page 1"
+    (= page-num 2) "Page 2"
+    (= page-num 3) "Page 3"
+    :default nil))
+
+(defn paged-sequence [page-num]
+  (let [page (get-page page-num)]
+    (when page
+      (cons page (lazy-seq (paged-sequence (inc page-num)))))))


ttest

ttest

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


note decompression functionality, drop outdated language about byte arrays

--- src/clj_http/client.clj
+++ src/clj_http/client.clj
@@ -172,12 +172,10 @@
    * :accept-encoding
    * :as

-  Note that where Ring uses InputStreams for the request and response bodies,
-  the clj-http uses ByteArrays for the bodies.
-
   The following additional behaviors over also automatically enabled:
    * string request bodies are converted to byte arrays
-   * exceptions are thrown for status codes other than 200-207, 300-303, or 307"}
+   * exceptions are thrown for status codes other than 200-207, 300-303, or 307
+   * gzip and deflate responses are accepted and decompressed"}
   request
   (-> #'core/request
     (wrap-redirects)


require :as for clojure.core

require :as for clojure.core

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


Return result from read-handler

Return result from read-handler

Oops, previous commit introduced a bug here.

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


eval code

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


Fix misplaced if plus a few other typos.

--- src/clojars/repo.clj
+++ src/clojars/repo.clj
@@ -3,7 +3,7 @@
             [clojars.db :refer [find-jar add-jar update-jar]]
             [clojars.config :refer [config]]
             [clojars.maven :as maven]
-            [clojars.promote :as promote]
+            [clojars.event :as ev]
             [compojure.core :refer [defroutes PUT ANY]]
             [compojure.route :refer [not-found]]
             [clojure.java.io :as io]
@@ -62,10 +62,10 @@
                       (save-to-file file body)
                       (catch java.io.IOException e
                         (.delete file)
-                        (throw e))))
-                  (ev/record-deploy {:group groupname
-                                     :artifact-id artifact-id
-                                     :version version} account filename)))
+                        (throw e)))))
+                (ev/record-deploy {:group groupname
+                                   :artifact-id artifact
+                                   :version version} account filename))
               {:status 201 :headers {} :body nil}
               (catch Exception e
                 (pst e)


more Email Validation

more Email Validation

Clojure

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


Subscribe now needs to know who it will subscribe

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/acessocard/microscope.git/'


hrefs are absolute

hrefs are absolute

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/Zallin/fhirvc.git/'