Added uniprot trembl protein assign taxon rule

Removed rule from taxon rules file. Updated variables for ccp ext
ontology and updated file formatting

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

--- resources/rules/post_identifier_merge/temp/taxon/uniprot_trembl_protein_assign_taxon.clj
+++ resources/rules/post_identifier_merge/temp/taxon/uniprot_trembl_protein_assign_taxon.clj
@@ -0,0 +1,28 @@
+;; -----------------------------------------------------------
+;; --------- Uniprot Trembl Protein Taxon Assignment ---------
+;; -----------------------------------------------------------
+`{:name "uniprot-trembl-protein-assign-taxon"
+  :description "This rule assigns a taxon to proteins represented by uniprot trembl protein identifiers"
+  :head (
+         ;; create a taxon restriction
+         (?/protein obo/RO_0002162 ?/taxon) ; RO:in_taxon
+         (?/restriction rdf/type owl/Restriction)
+         (?/restriction owl/onProperty obo/RO_0002162) ; RO:in_taxon
+         (?/restriction owl/someValuesFrom ?/taxon)
+         (?/protein rdfs/subClassOf ?/restriction))
+
+  :body ((?/record rdf/type ccp/IAO_EXT_0000987) ; ccp:Sparse_UniProt_record
+         (?/record obo/BFO_0000051 ?/protein_field_value) ; BFO:has_part
+         (?/protein_field_value rdf/type ccp/IAO_EXT_0000990) ; ccp:Sparse_UniProt_record__accession_field_value
+         (?/protein_field_value rdf/type ?/protein_ice_id)
+         (?/protein_ice_id obo/IAO_0000219 ?/protein) ; IAO:denotes
+
+         ;; retrieve the organism
+         (?/record obo/BFO_0000051 ?/taxon_field_value) ; BFO:has_part
+         (?/taxon_field_value rdf/type ccp/IAO_EXT_0000992) ; ccp:Sparse_UniProt_record__organism_field_value
+         (?/taxon_field_value rdf/type ?/taxon_ice_id)
+         (?/taxon_ice_id obo/IAO_0000219 ?/taxon)) ; IAO:denotes
+
+   :reify ([?/restriction {:ln (:restriction)
+                 :ns "ccp" :prefix "R_"}])
+   }


Whitespace.

Whitespace.

--- src/onyx/peer/coordinator.clj
+++ src/onyx/peer/coordinator.clj
@@ -223,7 +223,6 @@

           (:drained? status)
           (emit-final-completion-barrier state)
-

           (and (:scheduled? barrier) (> (System/nanoTime) (:next-barrier-time barrier)))
           (periodic-barrier state)


api file

api file

error: pathspec 'src/clj/just-married/api.clj' did not match any file(s) known to git

--- src/clj/just-married/api.clj
+++ src/clj/just-married/api.clj
@@ -0,0 +1,16 @@
+(ns just-married.api
+  (:require [just-married.core :as core]
+            [compojure.handler :refer [site]]
+            [environ.core :refer [env]]
+            [ring.middleware.json :refer [wrap-json-response]]
+            [ring.adapter.jetty :as jetty]
+            #_[ring.middleware.logger :as logger]
+            [ring.middleware.defaults :refer [api-defaults wrap-defaults]]))
+
+;; (def app
+;;   (logger/wrap-with-logger
+;;    (wrap-json-response app-routes api-defaults)))
+
+(defn -main [& [port]]
+  (let [port (Integer. (or port (env :port) 5000))]
+    (jetty/run-jetty (site #'app) {:port port :join? false})))


Test system

Test system

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


Using goog.crypt's sha256

Using goog.crypt's sha256

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


Forgot to switch.

Forgot to switch.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/jagtalon/what-the-fuck-do-you-want-to-listen-to.git/'


clj project template

clj project template

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

--- resources/project.clj
+++ resources/project.clj
@@ -0,0 +1,14 @@
+(defproject $PROJECT_NAME_HYPHENATED$ "0.1.0-SNAPSHOT"
+  :description "FIXME: write description"
+  :url "http://example.com/FIXME"
+  :license {:name "Eclipse Public License"
+            :url "http://www.eclipse.org/legal/epl-v10.html"}
+  :dependencies [[org.clojure/clojure "1.7.0"]
+                 [org.clojure/clojurescript "0.0-3308"]
+                 [org.omcljs/om "0.8.8"]
+                 [org.omcljs/ambly "0.6.0"]]
+:plugins [[lein-cljsbuild "1.0.6"]]
+:cljsbuild {:builds {:dev {:source-paths ["src"]
+                           :compiler {:output-to "target/out/main.js"
+                                      :output-dir "target/out"
+                                      :optimizations :none}}}})


run the tests

run the tests

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


Added role printing.

Added role printing.

Minor bugfix with the previous kibit change.

Refactoring.

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


try catch finally + do

try catch finally + do

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


Fix spelling in forgot password page

Fix spelling in forgot password page

--- src/clojars/web/user.clj
+++ src/clojars/web/user.clj
@@ -124,7 +124,7 @@
   (html-doc "Forgot password or username?" {}
     [:div.small-section
      [:h1 "Forgot something?"]
-     [:p "Don't worry, it happens to the best of us. Enter your email or username below, and we'll set you a password reset link, along with your username."]
+     [:p "Don't worry, it happens to the best of us. Enter your email or username below, and we'll send you a password reset link along with your username."]
      (form-to [:post "/forgot-password"]
               (label :email-or-username "Email or Username")
               (text-field {:placeholder "bob"


Phantom seed in REPL, should have started a new one

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


Fix cljs main

Fix cljs main

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


update prepare-order fields to take empty values

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


improve-logging: added middleware test

improve-logging: added middleware test

error: pathspec 'src/test/clojure/com/xebia/visualreview/middleware_test.clj' did not match any file(s) known to git

--- src/test/clojure/com/xebia/visualreview/middleware_test.clj
+++ src/test/clojure/com/xebia/visualreview/middleware_test.clj
@@ -0,0 +1,37 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copyright 2015 Xebia B.V.
+;
+; Licensed under the Apache License, Version 2.0 (the "License")
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+;  http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(ns com.xebia.visualreview.middleware-test
+  (:require [clojure.test :refer :all]
+            [com.xebia.visualreview.middleware :as middleware]
+            [com.xebia.visualreview.service-util :as service-util]
+            [com.xebia.visualreview.test-util :refer :all])
+  (:import (java.sql SQLException)))
+
+(deftest wrap-exception
+  (is (=  {:status 500
+           :headers {}
+           :body "Internal error occured"}
+          ((middleware/wrap-exception (fn [_] (throw (new Exception "my message")))) {})) "Converts unhandled exceptions to a 500 response")
+  (is (=  {:status 500
+           :headers {}
+           :body "Internal database error occured"}
+          ((middleware/wrap-exception (fn [_] (throw (new SQLException "my sql message")))) {})) "Converts unhandled database exceptions to a 500 response")
+  (is (=  {:status 500
+           :headers {}
+           :body "Internal service error occured"}
+          ((middleware/wrap-exception (fn [_] (service-util/throw-service-exception "my message" 1234))) {})) "Converts unhandled service exceptions to a 500 response"))
+


Define request function without callback

--- src/clj_gatling/simulation.clj
+++ src/clj_gatling/simulation.clj
@@ -5,6 +5,17 @@
             [clojure.core.async :as async :refer [go go-loop close! put! <!! alts! <! >!]]))

 (defn- now [] (System/currentTimeMillis))
+
+(defn asynchronize [f ctx]
+  (go
+    (try
+      (let [result (f ctx)]
+        (if (instance? clojure.core.async.impl.channels.ManyToManyChannel result)
+          (let [[success? new-ctx] (<! result)]
+            [success? (now) new-ctx])
+          [(first result) (now) (second result)]))
+      (catch Exception _
+        [false (now) ctx]))))

 (defn- bench [f]
   (fn [start-promise end-promise callback context]
@@ -20,6 +31,24 @@
             (:fn request))))

 (defn async-function-with-timeout [request timeout sent-requests user-id context]
+  (swap! sent-requests inc)
+  (let [start (now)
+        response (asynchronize (:action request) (assoc context :user-id user-id))]
+    (go
+      (let [[[result end new-ctx] c] (alts! [response (async/timeout timeout)])]
+        (if (= c response)
+          [{:name (:name request)
+            :id user-id
+            :start start
+            :end end
+            :result result} new-ctx]
+          [{:name (:name request)
+            :id user-id
+            :start start
+            :end (now)
+            :result false} context])))))
+
+(defn async-function-with-timeout-old [request timeout sent-requests user-id context]
   (let [start-promise (promise)
         end-promise (promise)
         response (async/chan)
@@ -94,9 +123,29 @@
     (println "Running scenario" (:name scenario)
              "with concurrency" concurrency)))

+(defn legacy-request-fn->action [request]
+  (let [f (if-let [url (:http request)]
+            (partial http/async-http-request url)
+            (:fn request))
+        c (async/chan)]
+    (fn [ctx]
+      (f (fn [result & [new-ctx]]
+           (if new-ctx
+             (put! c [result new-ctx])
+             (put! c [result ctx])))
+         ctx)
+      c)))
+
+(defn convert-from-legacy [scenarios]
+  (map (fn [scenario]
+         (update scenario
+                 :requests
+                 (fn [requests]
+                   (map #(assoc % :action (legacy-request-fn->action %)) requests))))
+       scenarios))
+
 (defn- run-scenario [options scenario]
   (print-scenario-info scenario)
-
   (let [responses (async/merge (map #(run-scenario-constantly options scenario %)
                                     (:users scenario)))
         results (async/chan)]
@@ -117,7 +166,7 @@
                                                :context (:context options)
                                                :simulation-start simulation-start
                                                :sent-requests sent-requests))
-        responses (async/merge (map run-scenario-with-opts scenarios))
+        responses (async/merge (map run-scenario-with-opts (convert-from-legacy scenarios)))
         results (async/chan)]
     (go-loop []
              (if-let [result (<! responses)]


added default serialization tests

added default serialization tests

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

--- test/dalap/test/defaults.clj
+++ test/dalap/test/defaults.clj
@@ -0,0 +1,40 @@
+(ns dalap.test.defaults
+  (:use [clojure.test])
+
+  (:use [dalap.walk :only [walk]])
+  (:use [dalap.defaults :only [serialize visit]]))
+
+(def basic-sample-data
+  [1 2 3 "abc"
+   \x \space 1.2
+   " " 'foo :bar
+   nil nil [nil]])
+
+(def basic-sample-data-str "123abcx 1.2 foo:bar")
+
+(defmacro assert-serialized
+  ([in out] `(assert-serialized ~in ~out nil))
+  ([in out msg] `(is (= (serialize ~in) ~out) ~msg)))
+
+(deftest test-basic-types
+  (assert-serialized {:a 1} ":a1")
+  (assert-serialized nil "")
+  (assert-serialized 'Foo "Foo")
+
+  (assert-serialized basic-sample-data basic-sample-data-str)
+  ;; these contained forms should all be equivalent
+  (is (apply =
+             (for [input [basic-sample-data
+                          (seq [[[basic-sample-data]]])
+                          (list (list basic-sample-data))
+                          (for [el basic-sample-data] el)
+                          basic-sample-data-str]]
+               (serialize input))))
+
+  (doseq [el basic-sample-data]
+    (if (not (sequential? el))
+      (is (=
+           (serialize el)
+           (serialize [el])
+           (visit el nil)
+           (str el))))))


A real protocol

A real protocol


Cache site lists, partner sites, and campus addresses

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


Add simple test for routes

Add simple test for routes

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

--- test/subman/t_routes.clj
+++ test/subman/t_routes.clj
@@ -0,0 +1,6 @@
+(ns subman.t-routes
+  (:require [midje.sweet :refer [fact => truthy]]
+            [subman.routes :as routes]))
+
+(fact "routes should be ok"
+      routes/main-routes => truthy)


humane test output.

humane test output.

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


adding search

adding search

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


address PR feedback

address PR feedback


Fix text primitive on android

Fix text primitive on android

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


add pdf handling functions

add pdf handling functions

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


Corrected requeue in fatal error failure.

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


Fix typo in github user api endpoint url

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


util/crawler.clj: created HTTP crawler that uses download log

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

--- src/org/altlaw/util/crawler.clj
+++ src/org/altlaw/util/crawler.clj
@@ -0,0 +1,128 @@
+(ns org.altlaw.util.crawler
+  (:require [org.altlaw.db.download-log :as dl]
+            [clojure.contrib.singleton :as sing]
+            [clojure.contrib.java-utils :as j])
+  (:import (org.restlet Client Context)
+           (org.restlet.data Request Protocol Method Form)
+           (org.apache.commons.codec.binary Base64)
+           (org.apache.commons.io IOUtils)))
+
+(defn- crawler-client-context []
+  ;; Automatically follow HTTP redirects
+  (doto (Context.)
+    (.. getParameters (add "followRedirects" "true"))))
+
+(def #^{:private true} crawler-http-client
+     ;; Client is thread-safe.
+     (sing/global-singleton
+      (fn []
+        (doto (Client. Protocol/HTTP)
+          (.setContext (crawler-client-context))))))
+
+(defn- make-www-form
+  "Creates a POST form from a keyword=>value map.
+  Returns a WWW-Form-Encoded Representation object."
+  [fields]
+  (assert (map? fields))
+  (let [form (Form.)]
+    (doseq [[key value] fields]
+      (.add form (j/as-str key) (j/as-str value)))
+    (.getWebRepresentation form)))
+
+(defn- set-client-agent [request]
+  (.. request getClientInfo
+      (setAgent "AltLaw.org crawler <feedback@altlaw.org>")))
+
+(defn- make-request
+  "Creates a GET or POST Request object."
+  ([url]
+     (assert (string? url))
+     (doto (Request. Method/GET url)
+       (set-client-agent)))
+  ([url form-fields]
+     (assert (string? url))
+     (doto (Request. Method/POST url)
+       (set-client-agent)
+       (.setEntity (make-www-form form-fields)))))
+
+(defn- request-headers-vec [request]
+  [["Host" (str (.. request getResourceRef getHostDomain))]
+   ["Agent" (.. request getClientInfo getAgent)]])
+
+(defn- basic-request-map [request]
+  {:request_http_version "1.1"
+   :request_uri (str (.. request getResourceRef))
+   :request_method (.. request getMethod getName)
+   :request_headers (request-headers-vec request)})
+
+(defn- extended-request-map [request]
+  (when (= Method/POST (.getMethod request))
+    {:request_form_fields
+     (into {} (.getValuesMap (.getEntityAsForm request)))}))
+
+(defn- request-map
+  "Returns a keyword=>value map for the request part of a download
+  record."
+  [request]
+  (merge (basic-request-map request)
+         (extended-request-map request)))
+
+(defn- encode-response-body
+  "Returns the response entity as a Base64-encoded string, or nil if
+  no response entity."
+  [response]
+  (when (.isAvailable (.. response getEntity))
+    (String. (Base64/encodeBase64Chunked
+              (IOUtils/toByteArray
+               (.. response getEntity getStream)))
+             "US-ASCII")))
+
+(defn- headers-vec [message]
+  (when (.. message getAttributes (get "org.restlet.http.headers"))
+    (vec (map (fn [[k v]] [k v])
+              (.. message getAttributes
+                  (get "org.restlet.http.headers") getValuesMap)))))
+
+(defn- basic-response-map [response]
+  {:response_status_code (.. response getStatus getCode)
+   :response_headers (headers-vec response)})
+
+(defn- extended-response-map [response]
+  (when-let [body (encode-response-body response)]
+    {:response_body_base64 body}))
+
+(defn- response-map
+  "Returns a keyword=>value map for the response part of a download
+  record."
+  [response]
+  (merge (basic-response-map response)
+         (extended-response-map response)))
+
+(defn- execute-request
+  "Calls the client to handle the request, logs the URL in the
+  download log, and returns the download record as a keyword=>value
+  map."
+  [request]
+  (let [response (.handle (crawler-http-client) request)
+        result (merge (request-map request)
+                      (response-map response))]
+    (dl/log-download (:request_uri result))
+    result))
+
+(defn crawl
+  "Given a URL, downloads it and returns a download record as a
+  keyword=>value map.  form-fields is a key=>value map of POST form
+  parameters.  Logs the URL in the download log, but does not save the
+  download log."
+  ([url]
+     (execute-request (make-request url)))
+  ([url form-fields]
+     (execute-request (make-request url form-fields))))
+
+(defn handle-download-request
+  "Given a partial download record as a keyword=>value map, runs
+  crawl."
+  [request]
+  (if (:request_form_fields request)
+    (crawl (:request_uri request) (:request_form_fields request))
+    (crawl (:request_uri request))))


Added bus-control ns

Added bus-control ns

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

--- src/overtime/bus_control.clj
+++ src/overtime/bus_control.clj
@@ -0,0 +1,23 @@
+(ns overtime.bus-control
+  (:require [overtone.core :as ot]
+            [overtime.utils :as u]
+            [clojure.tools.logging :as log]
+            [overtime.sound-control :as snd]))
+
+
+(defonce ^:private busses (atom {}))
+
+
+(defn- init-busses
+  [bus-data]
+  (into {} (for [[bus-key num-chans] bus-data] [bus-key (ot/control-bus num-chans)])))
+
+(defn init
+  [bus-data]
+  (let [new-busses (init-busses bus-data)]
+    (reset! busses new-busses)
+    (log/debug "Created" (count new-busses) "control busses for keys" (keys new-busses))
+    true))
+
+(defn control-bus [key] (u/check-nil (key @busses) "Control Bus" key))
+(defmethod snd/sound-param :control-bus [_type data] (control-bus data))


added figwheel runner for intellij

added figwheel runner for intellij

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

--- bin/figwheel.clj
+++ bin/figwheel.clj
@@ -0,0 +1,7 @@
+; A CLJ script for running figwheel in an IntelliJ REPL
+; Run this using clojure.main from a JVM launch
+; See https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL
+
+(use 'figwheel-sidecar.repl-api)
+(start-figwheel! {:all-builds (figwheel-sidecar.repl/get-project-cljs-builds)})
+(cljs-repl)


Koan 9 solved

Koan 9 solved

error: pathspec 'src/fourclojure/4_clojure.clj' did not match any file(s) known to git

--- src/fourclojure/4_clojure.clj
+++ src/fourclojure/4_clojure.clj
@@ -0,0 +1,8 @@
+(ns fourclojure.4-clojure)
+
+((fn [f & ms]
+   (into {} (for [[k v]
+                  (group-by first
+                            (for [m ms [k v] m]
+                              [k v]))]
+              {k (reduce f (map second v))}))) concat {:a [3], :b [6]} {:a [4 5], :c [8 9]} {:b [7]})


more notes

more notes

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


Implement validation logic

Implement validation logic

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

--- src/cljs38/validation.cljs
+++ src/cljs38/validation.cljs
@@ -0,0 +1,26 @@
+(ns cljs38.validation)
+
+(defn sum [values]
+    (reduce + values))
+
+(defn sum-to? [expected, values]
+    (= expected (sum values)))
+
+(defn get-row [board, indexes]
+    (map (partial nth board) indexes))
+
+(defn is-valid-row? [expected, board, row]
+    (sum-to? expected (get-row board row)))
+
+(defn won-game? [expected, board, rows]
+  (letfn [
+    (validate-row [row]
+        (is-valid-row? expected board row))
+
+    (validate-rows []
+        (map validate-row rows))
+
+    (all-rows-valid? [results]
+        (every? true? results))]
+
+    (all-rows-valid? (validate-rows))))


Listen for transport events.

Listen for transport events.

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


Getting rid of chrome to placate travis

Getting rid of chrome to placate travis

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


Added user namespace to stop system

Added user namespace to stop system


Add db

Add db

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

--- src/trak/db.cljs
+++ src/trak/db.cljs
@@ -0,0 +1,15 @@
+(ns trak.db
+  (:require [datascript.core :as d]
+            [cljs.core.async :refer [<!]]
+            [trak.api :as api])
+  (:require-macros [cljs.core.async.macros :refer [go]]))
+
+;; Create database
+(defonce conn (d/create-conn {:application/state-type {:db/unique :db.unique/identity}
+                              :application/state      {}
+
+                              :subscription/name      {}
+                              :subscription/channel   {}
+                              }))
+
+


Add the ability to populate objects with thumbnails and url resolved paths.

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

--- src/uxbox/images.clj
+++ src/uxbox/images.clj
@@ -0,0 +1,52 @@
+;; This Source Code Form is subject to the terms of the Mozilla Public
+;; License, v. 2.0. If a copy of the MPL was not distributed with this
+;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+;;
+;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
+
+(ns uxbox.images
+  "Image postprocessing."
+  (:require [storages.core :as st]
+            [uxbox.media :as media]
+            [uxbox.util.paths :as paths]
+            [uxbox.util.images :as images]
+            [uxbox.util.data :refer (dissoc-in)]))
+
+(defn make-thumbnail
+  [path {:keys [size format quality] :as cfg}]
+  (let [parent (paths/parent path)
+        [filename ext] (paths/split-ext path)
+
+        suffix-parts [(nth size 0) (nth size 1) quality format]
+        final-name (apply str filename "-" (interpose "." suffix-parts))
+        final-path (paths/path parent final-name)
+
+        images-storage media/images-storage
+        thumbs-storage media/thumbnails-storage]
+    (if @(st/exists? thumbs-storage final-path)
+      (str (st/public-url thumbs-storage final-path))
+      (let [datapath @(st/lookup images-storage path)
+            content (images/thumbnail datapath cfg)
+            path @(st/save thumbs-storage final-path content)]
+        (str (st/public-url thumbs-storage path))))))
+
+(defn populate-thumbnail
+  [entry {:keys [src dst] :as cfg}]
+  (let [src (if (vector? src) src [src])
+        dst (if (vector? dst) dst [dst])]
+    (assoc-in entry dst
+              (make-thumbnail (get-in entry src) cfg))))
+
+(defn populate-thumbnails
+  [entry & settings]
+  (reduce populate-thumbnail entry settings))
+
+(defn populate-urls
+  [entry storage src dst]
+  (let [src (if (vector? src) src [src])
+        dst (if (vector? dst) dst [dst])
+        value (get-in entry src)
+        url (str (st/public-url storage value))]
+    (-> entry
+        (dissoc-in src)
+        (assoc-in dst url))))


Trying to pass port manually

Trying to pass port manually

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


Add initial impl for fixtures loading.

Add initial impl for fixtures loading.

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

--- src/uxbox/fixtures.clj
+++ src/uxbox/fixtures.clj
@@ -0,0 +1,68 @@
+;; This Source Code Form is subject to the terms of the Mozilla Public
+;; License, v. 2.0. If a copy of the MPL was not distributed with this
+;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+;;
+;; Copyright (c) 2016 Andrey Antukh <niwi@niwi.nz>
+
+(ns uxbox.fixtures
+  "A initial fixtures."
+  (:require [buddy.hashers :as hashers]
+            [mount.core :as mount]
+            [clj-uuid :as uuid]
+            [suricatta.core :as sc]
+            [uxbox.config :as cfg]
+            [uxbox.persistence :as up]
+            [uxbox.migrations]
+            [uxbox.services.auth :as sauth]
+            [uxbox.services.projects :as sproj])
+  (:import java.util.UUID))
+
+(defn- mk-uuid
+  [prefix i]
+  (uuid/v5 uuid/+namespace-oid+ (str prefix i)))
+
+(defn- create-user
+  [conn i]
+  (println "create user" i)
+  (sauth/create-user conn
+                     {:username (str "user" i)
+                      :id (mk-uuid "user" i)
+                      :password (hashers/encrypt "123123")
+                      :email (str "user" i ".test@uxbox.io")}))
+
+(defn- create-project
+  [conn i ui]
+  (println "create project" i "for user" ui)
+  (sproj/create-project conn
+                        {:id (mk-uuid "project" i)
+                         :user (mk-uuid "user" ui)
+                         :name (str "project " i)}))
+
+(defn- create-page
+  [conn i pi ui]
+  (println "create page" i "for user" ui "for project" pi)
+  (sproj/create-page conn
+                     {:id (mk-uuid "page" i)
+                      :user (mk-uuid "user" ui)
+                      :project (mk-uuid "project" pi)
+                      :name (str "page " i)
+                      :width 1024
+                      :height 768
+                      :layout "tablet"}))
+
+(defn init
+  []
+  (mount/start)
+  (with-open [conn (up/get-conn)]
+    (sc/atomic conn
+      (doseq [i (range 10)]
+        (create-user conn i))
+
+      (doseq [ui (range 10)]
+        (doseq [i (range 10)]
+          (create-project conn (str ui i) ui)))
+
+      (doseq [pi (range 10)]
+        (doseq [ui (range 10)]
+          (doseq [i (range 10)]
+            (create-page conn (str pi ui i) (str ui i) ui)))))))


Add a missing file.

Add a missing file.

error: pathspec 'metlog-vault/src-server/metlog_vault/config.clj' did not match any file(s) known to git

--- metlog-vault/src-server/metlog_vault/config.clj
+++ metlog-vault/src-server/metlog_vault/config.clj
@@ -0,0 +1,21 @@
+(ns metlog-vault.config
+  (:use metlog-vault.util)
+  (:require [clojure.tools.logging :as log]
+            [cprop.core :as cprop]
+            [cprop.source :as cprop-source]))
+
+(defn- maybe-config-file [ prop-name ]
+  (if-let [prop (System/getProperty prop-name)]
+    (if (.exists (java.io.File. prop))
+      (do
+        (log/info (str "Config file found: " prop " (specified by property: " prop-name ")"))
+        (cprop-source/from-file prop))
+      (do
+        (log/warn (str "CONFIG FILE NOT FOUND: " prop " (specified by property: " prop-name ")"))
+        {}))
+    {}))
+
+(defn load-config [ ]
+  (cprop/load-config :merge [(cprop-source/from-resource "config.edn")
+                             (maybe-config-file "conf")
+                             (maybe-config-file "creds")]))


Look for host and port in env.

Look for host and port in env.

--- src/drake/fs/hive.clj
+++ src/drake/fs/hive.clj
@@ -6,17 +6,17 @@
             [clojure.java.jdbc :as jdbc])
   (:import [java.net URI]))

-(defn datasource [host port & [user password]]
+(defn datasource [& {:keys [user password host port]}]
   (let [user (or user
                  (get (System/getenv) "DRAKE_HIVE_USER")
                  (get (System/getenv) "USER")
                  "hive")
-        password (or password
-                     (get (System/getenv) "DRAKE_HIVE_PASSWORD")
-                     "")]
+        password (or password (get (System/getenv) "DRAKE_HIVE_PASSWORD") "")
+        host (or host (get (System/getenv) "DRAKE_HIVE_HOST" "127.0.0.1"))
+        port (or port (get (System/getenv) "DRAKE_HIVE_PORT" "10000"))]
     {:classname "org.apache.hive.jdbc.HiveDriver"
      :subprotocol "hive2"
-     :subname (format "//%s:%d" host port)
+     :subname (format "//%s:%s" host port)
      :user user
      :password password}))

@@ -28,14 +28,14 @@
         [_ database table] (-> (or (.getPath uri) "")
                                (remove-extra-slashes)
                                (s/split #"/"))]
-    (cond (not database) (throw (Exception. (str "malformed hive uri (missing database): " path)))
-          (not table) (throw (Exception. (str "malformed hive uri (missing table): " path)))
-          :else {:path (format "hive://%s:%d/%s/%s" host port database table)
-                 :host host
-                 :port port
-                 :database database
-                 :table table
-                 :datasource (datasource host port)})))
+    (when-not database
+      (throw+ {:msg (str "malformed hive uri (missing database): " path)}))
+    (when-not table
+      (throw+ {:msg (str "malformed hive uri (missing table): " path)}))
+    {:normalized (format "/%s/%s" database table)
+     :database database
+     :table table
+     :datasource (datasource :host host :port port)}))

 (defn query [ds sql & args]
   (rest (jdbc/query ds (cons sql args) :as-arrays? true)))


KC: Fixed failing tests

KC: Fixed failing tests

Signed-off-by: KipSigei <4198580992cab843b49a2b32863c8b4b159788b1@gmail.com>

--- src/hatti/shared.cljs
+++ src/hatti/shared.cljs
@@ -40,7 +40,9 @@
    {:views {:all [:overview :map :table :chart :saved-charts :settings]
             :selected :overview
             :settings {:all [:form-info :settings :basemaps
-                             :integrated-apps :media-files :xls-reports :service-configuration]
+                             :integrated-apps :media-files
+                             :xls-reports
+                             :service-configuration]
                        :active-tab :form-info
                        :integrated-apps {:active-section :apps-list
                                          :add? false}}}


remove pprint

remove pprint

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


Fix list instead of map typo

Fix list instead of map typo

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


DOH!! Stupid error was dumping strings instead of geos.

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


Clean up AUDIT request details logging

Clean up AUDIT request details logging

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


Refer to clojure.string functions via alias

--- src/sablono/util.cljc
+++ src/sablono/util.cljc
@@ -1,8 +1,7 @@
 (ns sablono.util
   #?(:cljs (:import goog.Uri))
-  (:refer-clojure :exclude [replace])
   (:require [clojure.set :refer [rename-keys]]
-            [clojure.string :refer [blank? capitalize join split replace]]))
+            [clojure.string :as str]))

 (def ^:dynamic *base-url* nil)

@@ -23,13 +22,13 @@
   (if (or (keyword? k)
           (string? k)
           (symbol? k))
-    (let [[first-word & words] (split (name k) #"-")]
+    (let [[first-word & words] (str/split (name k) #"-")]
       (if (or (empty? words)
               (= "aria" first-word)
               (= "data" first-word))
-        k (-> (map capitalize words)
+        k (-> (map str/capitalize words)
               (conj first-word)
-              join
+              str/join
               keyword)))
     k))

@@ -67,7 +66,7 @@
                :else (seq %))
             classes)
        (flatten)
-       (join " ")))
+       (str/join " ")))

 (defn wrapped-type?
   "Return true if the element `type` needs to be wrapped."


Harmony procedures

Harmony procedures

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

--- src/tenor/harmony.clj
+++ src/tenor/harmony.clj
@@ -0,0 +1,38 @@
+;; tenor/harmony.clj
+;; Procedures to create harmony from a melody
+
+(ns tenor.harmony
+  (:use [overtone.live]))
+
+;; --- Construct chords from notes and note positions --- ;;
+
+(defn random-chords [position note]
+  (if (weighted-coin 0.33)
+    (let [selected-chord (chord (find-note-name note) (rand-nth (keys CHORD)))]
+      (hash-map :pos position, :note (into [] selected-chord)))))
+
+(defn major-chords [position note]
+  (if (weighted-coin 0.33)
+    (let [selected-chord (chord (find-note-name note) :major)]
+      (hash-map :pos position, :note (into [] selected-chord)))))
+
+(defn minor-chords [position note]
+  (if (weighted-coin 0.33)
+    (let [selected-chord (chord (find-note-name note) :minor)]
+      (hash-map :pos position, :note (into [] selected-chord)))))
+
+(defn random-chords-octave-down [position note]
+  (if (weighted-coin 0.33)
+    (let [selected-chord (chord (find-note-name (- note 12)) (rand-nth (keys CHORD)))]
+      (hash-map :pos position, :note (into [] selected-chord)))))
+
+(defn major-chords-octave-down [position note]
+  (if (weighted-coin 0.33)
+    (let [selected-chord (chord (find-note-name (- note 12)) :major)]
+      (hash-map :pos position, :note (into [] selected-chord)))))
+
+(defn minor-chords-octave-down [position note]
+  (if (weighted-coin 0.33)
+    (let [selected-chord (chord (find-note-name (- note 12)) :minor)]
+      (hash-map :pos position, :note (into [] selected-chord)))))
+


Added my clojure code golf, passes tests

error: pathspec '06-code-golf/tf-06.clj' did not match any file(s) known to git

--- 06-code-golf/tf-06.clj
+++ 06-code-golf/tf-06.clj
@@ -0,0 +1,11 @@
+":";exec java -cp "$HOME/.m2/repository/org/clojure/clojure/1.5.1/clojure-1.5.1.jar" clojure.main $0 $*
+
+(require '[clojure.string :as s])
+
+(doseq [c (take 25
+            (sort-by val >
+              (frequencies
+                (remove
+                  #(some (partial = %) (s/split (slurp "../stop_words.txt") #","))
+                  (re-seq #"[a-z]{2,}" (s/lower-case (slurp (first *command-line-args*))))))))]
+  (printf "%s - %d\n" (first c) (nth c 1)))


clojure sol 4

clojure sol 4

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

--- clojure/4.clj
+++ clojure/4.clj
@@ -0,0 +1,5 @@
+(defn is-palindrome? [n]
+  (= (str n) (apply str (reverse (str n)))))
+(println (apply max (for [x (range 100 999) y (range 100 999)
+                          :let [z (* x y)]
+                          :when (and (>= y x) (is-palindrome? z))] z)))


Remove vestigial requires

Remove vestigial requires

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


refactor: group require statements

refactor: group require statements

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/rodrigo-garcia-leon/semanario-universidad-newsletter.git/'


Update step complete verification for personal/income

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


Wrap too-long docstring

Wrap too-long docstring

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


CMR-2354 Adds initial UMM version migration unit test

error: pathspec 'umm-spec-lib/test/cmr/umm_spec/test/versioning.clj' did not match any file(s) known to git

--- umm-spec-lib/test/cmr/umm_spec/test/versioning.clj
+++ umm-spec-lib/test/cmr/umm_spec/test/versioning.clj
@@ -0,0 +1,28 @@
+(ns cmr.umm-spec.test.versioning
+  (:require [cmr.umm-spec.versioning :as v]
+            [clojure.test :refer :all]))
+
+(deftest migrate-1_0-up-to-1_1
+  (is (nil?
+        (:TilingIdentificationSystems
+          (v/migrate-umm {:TilingIdentificationSystem nil}
+                         :collection "1.0" "1.1"))))
+  (is (= [{:TilingIdentificationSystemName "foo"}]
+         (:TilingIdentificationSystems
+           (v/migrate-umm {:TilingIdentificationSystem {:TilingIdentificationSystemName "foo"}}
+                          :collection "1.0" "1.1")))))
+
+(deftest migrate-1_1-down-to-1_0
+  (is (nil?
+        (:TilingIdentificationSystem
+          (v/migrate-umm {:TilingIdentificationSystems nil}
+                         :collection "1.1" "1.0"))))
+  (is (nil?
+        (:TilingIdentificationSystem
+          (v/migrate-umm {:TilingIdentificationSystems []}
+                         :collection "1.1" "1.0"))))
+  (is (= {:TilingIdentificationSystemName "foo"}
+         (:TilingIdentificationSystem
+           (v/migrate-umm {:TilingIdentificationSystems [{:TilingIdentificationSystemName "foo"}
+                                                         {:TilingIdentificationSystemName "bar"}]}
+                          :collection "1.1" "1.0")))))


Created ontology concept record creation rule

error: pathspec 'kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/bio_to_ice/step_c/ontology_concept_record_gen.clj' did not match any file(s) known to git

--- kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/bio_to_ice/step_c/ontology_concept_record_gen.clj
+++ kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/bio_to_ice/step_c/ontology_concept_record_gen.clj
@@ -0,0 +1,34 @@
+;; -----------------------------------------------
+;; --------- Ontology Concept Record Gen ---------
+;; -----------------------------------------------
+;; creates ontology concept record for every ontology concept
+`{:name "ontology-concept-record-gen"
+  :head ((?/record rdf/type ccp/IAO_EXT_0000191) ; ontology concept record
+         (?/record obo/BFO_0000051 ?/id_field_value) ; has part
+         (?/id_field_value rdf/type ccp/IAO_EXT_0000194) ; id field value
+         (?/id_field_value rdf/type ?/id) ; ontology concept identifier
+         (?/id_field_value rdfs/label ?/id_string)
+         (?/record obo/BFO_0000051 ?/definition_field_value) ; has part
+         (?/definition_field_value rdf/type ccp/IAO_EXT_0000195) ; ontology concept record definition field value
+         (?/definition_field_value rdfs/label ?/definition)
+         (?/record obo/BFO_0000051 ?/label_field_value)
+         (?/label_field_value rdf/type ccp/IAO_EXT_0000196) ; ontology concept record label field value
+         (?/label_field_value rdfs/label ?/label))
+  :reify ([?/record {:ln (:sha-1 ?/id)
+                    :ns "ccp" :prefix "R_" :suffix ""}]
+           [?/id_field_value {:ln (:sha-1 ?/id)
+               :ns "ccp" :prefix "F_" :suffix ""}]
+           [?/definition_field_value {:ln (:sha-1 ?/definition)
+               :ns "ccp" :prefix "F_" :suffix ""}]
+           [?/label_field_value {:ln (:sha-1 ?/label)
+               :ns "ccp" :prefix "F_" :suffix ""}])
+  :sparql-string "prefix ccp: <http://ccp.ucdenver.edu/obo/ext/>
+                  prefix obo: <http://purl.obolibrary.org/obo/>
+                  prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
+                  select ?id ?class ?definition ?label ?id_string {
+                  ?id rdf:type ccp:IAO_EXT_0000088 .
+                  ?id obo:IAO_0000219 ?class .
+                  optional {?class obo:IAO_0000115 ?definition } .
+                  optional {?class rdfs:label ?label } .
+                  optional {?class oboInOwl:id ?id_string } .
+                  }" }


include absolute offsets of markers in score map

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


cleanup

cleanup

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


remove obsolete comment

remove obsolete comment

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


Include pipeline as a separate package.

Include pipeline as a separate package.

--- project.clj
+++ project.clj
@@ -45,10 +45,12 @@
            {:subpackage "templater"
             :path "src/templater"
             }
-           ;; {:subpackage "ontologies"
-           ;;  :path "src/rdf/grafter/rdf/ontologies"}
            {:type :clojure
             :path "src/ontologies"
+            :levels 2
+            }
+           {:type :clojure
+            :path "src/pipeline"
             :levels 2
             }
            {:type :clojure


Update oc.lib.

Update oc.lib.

--- project.clj
+++ project.clj
@@ -18,7 +18,7 @@
     [hiccup "2.0.0-alpha1"] ; HTML rendering https://github.com/weavejester/hiccup
     [jfree/jfreechart "1.0.13"] ; Java chart library http://www.jfree.org/jfreechart/
     [manifold "0.1.7-alpha5"] ; Async programming tools https://github.com/ztellman/manifold
-    [open-company/lib "0.10.9-2151229"] ; Library for OC projects https://github.com/open-company/open-company-lib
+    [open-company/lib "0.11.7"] ; Library for OC projects https://github.com/open-company/open-company-lib
     ; In addition to common functions, brings in the following common dependencies used by this project:
     ; Component - Component Lifecycle https://github.com/stuartsierra/component
     ; Schema - Data validation https://github.com/Prismatic/schema


several dependencies added

several dependencies added

--- project.clj
+++ project.clj
@@ -1,9 +1,17 @@
 (defproject basilisk "0.1.0-SNAPSHOT"
-  :description "FIXME: write description"
-  :url "http://example.com/FIXME"
-  :license {:name "Eclipse Public License"
-            :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :dependencies [[org.clojure/clojure "1.8.0"]]
+  :description "Data warehouse plaftform for Codamic."
+  :url "http://github.com/Codamic/basilisk"
+  :license {:name "GNU Public Licence version 2"
+            :url "http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"}
+
+  :dependencies [[org.clojure/clojure "1.8.0"]
+                 [clj-http "2.2.0"]
+                 [org.clojure/tools.cli "0.3.5"]
+                 [hickory "0.6.0"]
+                 [riemann-clojure-client "0.4.2"]
+                 [org.clojure/core.async "0.2.382"]]
+
   :main ^:skip-aot basilisk.core
   :target-path "target/%s"
-  :profiles {:uberjar {:aot :all}})
+  :profiles {:uberjar {:aot :all}}
+  )


Bump to 0.1.0-beta7

Bump to 0.1.0-beta7

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject reply "0.1.0-SNAPSHOT"
+(defproject reply "0.1.0-beta7"
   :description "REPL-y: A fitter, happier, more productive REPL for Clojure."
   :dependencies [[org.clojure/clojure "1.3.0"]
                  [org.clojars.trptcolin/jline "2.7-alpha5"]


Allow missing update-at

Allow missing update-at


Refactor

Refactor

The previous solution with ->> and into was ugly. #clojure came to the
rescue with a prettier variant.

--- src/refactor_nrepl/ns/resolve_missing.clj
+++ src/refactor_nrepl/ns/resolve_missing.clj
@@ -5,11 +5,11 @@
             [refactor-nrepl.ns.slam.hound.regrow :as slamhound]))

 (defn- candidates [sym]
-  (->> (when-let [p (prefix sym)]
-         (slamhound/candidates :import (symbol p) [] {}))
-       (into (list))
-       (into (slamhound/candidates :import (symbol (suffix sym)) [] {}))
-       (into (slamhound/candidates :refer sym [] {}))))
+  (reduce into
+          [(when-let [p (prefix sym)]
+             (slamhound/candidates :import (symbol p) [] {}))
+           (slamhound/candidates :import (symbol (suffix sym)) [] {})
+           (slamhound/candidates :refer sym [] {})]))

 (defn- get-type [sym]
   (let [info (info-clj 'user sym)]


minor fix

minor fix

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


get-view use threads and 100 element chan buffer


services devcards

services devcards


reorg

reorg

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


use better with-fresh-db pattern

use better with-fresh-db pattern

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


remove log

remove log


Fix incorrect function name in populate-mq

This is a holdover from the days of using data.json instead of Cheshire; I
missed this function during that port.

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

--- src/com/puppetlabs/cmdb/cli/populatemq.clj
+++ src/com/puppetlabs/cmdb/cli/populatemq.clj
@@ -17,7 +17,7 @@
       (doseq [file (.listFiles (ds/file-str dirname))]
         (let [content (json/parse-string (slurp file) true)
               msg {:command "replace catalog" :version 1 :payload content}
-              msg (json/json-str msg)]
+              msg (json/generate-string msg)]
           (mq-producer/publish producer mq-endpoint msg)
           (log/info (format "Published %s" file)))))))


Add login routes

Add login routes

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

--- s3/src/s3/loginroutes.clj
+++ s3/src/s3/loginroutes.clj
@@ -0,0 +1,49 @@
+(ns s3.loginroutes
+  (:use [compojure.core :only (defroutes POST GET PUT DELETE)])
+
+  (:require [s3.auth :as auth]
+            [s3.user :as user]))
+
+(defn logout [params headers]
+  (let [redirect-location (if-let [param-referer (:referer params)]
+                            param-referer
+                            (if-let [referer (headers "referer")] referer "/"))]
+    {:status  301
+     :headers {"Content-Type" "text/html"
+               "Location"     redirect-location}
+     :cookies {"authToken" {:value "" :max-age 0 :path "/"}
+               "authUser"  {:value "" :max-age 0 :path "/"}}
+     :body    ""}))
+
+(defroutes
+  routes
+
+  (POST "/rest/v2/login" {params :params headers :headers}
+        (let [username (:username params)
+              password (:password params)
+              redirect-location (if-let [param-referer (:referer params)]
+                                  param-referer
+                                  (if-let [referer (headers "referer")] referer "/"))]
+          (if (auth/authenticate username password)
+            (let [case-user (user/get-case-user username)
+                  authToken (auth/auth-token case-user)
+                  authUser (:username (user/get-case-user username))]
+              {:status  301
+               :headers {"Content-Type" "text/html"
+                         "Location"     redirect-location}
+               :cookies {"authToken" {:value authToken :max-age (* 60 60 24 2 365) :path "/"}
+                         "authUser"  {:value authUser :max-age (* 60 60 24 2 365) :path "/"}}
+               :body    ""
+               })
+            {:status  301
+             :headers {"Content-Type"     "text/html"
+                       "Location"         (str redirect-location "?status=login_failed")
+                       "X-Ontrail-Status" "login-failed"}
+             :body    ""
+             })))
+
+  (GET "/rest/v2/logout" {params :params headers :headers}
+       (logout params headers))
+
+  (POST "/rest/v2/logout" {params :params headers :headers}
+        (logout params headers)))


implemented "CLEAR" functionality

implemented "CLEAR" functionality

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/another-john/dejuri.git/'


Replace sorted-merge-by with a faster implementation

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


REALLY GOOOOOOOOOOOOOOOOOOOOOOOOOD

REALLY GOOOOOOOOOOOOOOOOOOOOOOOOOD

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

--- src/epicea/vfibers/core.clj
+++ src/epicea/vfibers/core.clj
@@ -0,0 +1,164 @@
+(ns epicea.vfibers.core
+  (:require [clojure.spec :as spec]
+            [epicea.utils.defmultiple :refer [defmultiple]]
+            [epicea.utils.toposort :as toposort]
+            [epicea.utils.access :as access]))
+
+
+(spec/def ::unique-tag (partial = ::node))
+
+(spec/def ::node (spec/keys :req-un [::unique-tag]))
+
+(defn node? [x]
+  (spec/valid? ::node x))
+
+(def empty-node {:unique-tag ::node})
+(def settings {:default-base empty-node})
+
+(defn key? [x]
+  (or (symbol? x)
+      (keyword? x)))
+
+(defn valid-args? [x]
+  (and (coll? x)
+       (every? #(or (node? %)
+                    (key? %))
+               x)))
+
+(def -simple? (access/key-accessor :simple? (merge settings {:valid-value? boolean?})))
+
+;; what primitive value it evaluates to
+(def -datatype (access/key-accessor :datatype (merge settings {:valid-value? keyword?})))
+
+;; What the node actually represents: used for dynamic dispatch
+(def -nodetype (access/key-accessor :nodetype settings))
+(def -expr (access/key-accessor :expr settings))
+(def -args (access/key-accessor :args (merge settings {:valid-value? valid-args?})))
+(def -refcount (access/key-accessor :refcount (merge settings {:valid-value? number?})))
+
+(defn node-of-type?
+  ([type node]
+   (= type (access/get node -datatype)))
+  ([type] #(node-of-type? type %)))
+
+(defn simple-expr? [x]
+  (or (keyword? x)
+      (symbol? x)
+      (number? x)
+      (string? x)
+      (boolean? x)))
+
+(defn primitive-expr
+  ([tp value]
+   (access/build -datatype tp
+                 -expr value
+                 -nodetype :primitive
+                 -simple? (simple-expr? value)))
+  ([tp]
+   (access/build -datatype tp
+                 -nodetype :primitive
+                 -simple? false)))
+
+(declare add-subexpr)
+
+(defn add-simple-subexpr [dst key x]
+  (assert (node? x))
+  (assert (key? key))
+  (assert (map? dst))
+  (merge dst {key x
+              x key}))
+
+(defmultiple make-sym (:checked-get -datatype)
+  (:default [_] (gensym)))
+
+
+(defn add-arg [[m syms] arg]
+  (if (contains? m arg)
+    [m (conj syms (get m arg))]
+    (let [g (make-sym arg)]
+      [(add-subexpr m g arg) (conj syms g)])))
+
+(defn add-complex-subexpr [dst key x]
+  (let [args (access/get x -args)
+        [dst syms] (reduce add-arg [dst []] args)]
+    (merge
+     dst
+     {key (access/set x -args syms)
+      x key})))
+
+(defn add-subexpr [dst key x]
+  (if (contains? dst key)
+    dst
+    (if (access/has? x -args)
+      (add-complex-subexpr dst key x)
+      (add-simple-subexpr dst key x))))
+
+(declare make-map)
+
+(defn add-vector [dst expr]
+  (reduce
+   (fn [[dst result] x]
+     (let [[new-map e] (make-map dst x)]
+       [new-map (conj result e)]))
+   [dst []] expr))
+
+(defn add-seq [dst expr]
+  (let [[m v] (add-vector dst (vec expr))]
+    [m (seq v)]))
+
+(defn add-coll [dst expr]
+  (let [[m v] (add-vector dst (vec expr))]
+    [m (into (empty expr) v)]))
+
+(defn reset-refcount [m]
+  (into (empty m)
+        (map (fn [[k v]]
+               [k (access/remove v -refcount)])
+             m)))
+
+(defn get-refcount [x]
+  (if-let [[n] ((:get-optional -refcount) x)]
+    n 0))
+
+(defn inc-ref [x]
+  (access/set x -refcount (inc (get-refcount x))))
+
+(defn inc-ref-recursive [m0 key]
+  (assert (map? m0))
+  (let [m (update-in m0 [key] inc-ref)
+        v (get m key)]
+    (if (and (= 1 (get-refcount v))
+             (access/has? v -args))
+      (reduce (fn [dst k] (inc-ref-recursive dst k))
+              m (access/get v -args))
+      m)))
+
+(defn add-node [dst expr]
+  (let [g (make-sym expr)]
+    [(inc-ref-recursive
+      (add-subexpr dst g expr) g)
+     g]))
+
+(defn make-map [dst expr]
+  (cond
+    (node? expr) (add-node dst expr)
+    (vector? expr) (add-vector dst expr)
+    (seq? expr) (add-seq dst expr)
+    (map? expr) (add-coll dst expr)
+    (set? expr) (add-coll dst expr)
+    :default [dst expr]))
+
+(def get-nodetype (:checked-get -nodetype))
+
+(defmultiple make-node (fn [node args] (get-nodetype node))
+  (:primitive [x _] (access/get x -expr)))
+
+(defn bind? [x]
+  (not (or (access/get x -simple?)
+           (<= (get-refcount x) 1))))
+
+
+(defn make-code [expr0]
+  (let [[node-map expr] (make-map {} expr0)]
+    node-map))
+


adding lein helpers

adding lein helpers

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

--- lein/lein.symlink/profiles.clj
+++ lein/lein.symlink/profiles.clj
@@ -0,0 +1 @@
+{:user {:plugins [[lein-difftest "2.0.0"]]}}


add multi-variable regression

add multi-variable regression

error: pathspec 'src/mekena/multi-linear-reg.clj' did not match any file(s) known to git

--- src/mekena/multi-linear-reg.clj
+++ src/mekena/multi-linear-reg.clj
@@ -0,0 +1,119 @@
+(ns mekena.multi-linear-reg
+  (:require [incanter.core :as incore]
+            [incanter.io :as io]
+            [incanter.stats :as stats]
+            [incanter.charts :as charts]))
+
+;; Stanford Machine Learning using Clojure and Incanter
+;; machine learning multi-variate linear regression
+;; config params
+(def alpha 0.01)
+(def iterations 1500)
+
+;; read housing data
+(def mtrx (io/read-dataset "./resources/ex1data2.txt"))
+;; select the x and y columns of the matrix
+(def square-footage (incore/sel mtrx :cols 0))
+(def bedrooms (incore/sel mtrx :cols 1))
+(def price (incore/sel mtrx :cols 2))
+
+(incore/view (charts/scatter-plot
+              :col0
+              :col1
+              :data mtrx
+              :x-label "Population of City in 10,000s"
+              :y-label "Profit in $10,000s"))
+
+(defn h-ftn
+  "The hypothesis function : X . theta
+  h-theta(x) = (theta0 * 1) + (theta1 * x1) + (theta2 * x2) ..
+  we add a column of 1 to x to produce a [m x (n+1)] matrix.
+  theta [(n+1) x 1], produces a matrix of [m x 1]"
+  [x theta]
+  (incore/mmult x theta))
+
+(defn prepare-x
+  "append a column of 1s as x0. Used as multiplier for theta0. Keep all cols except last"
+  [mtrx]
+  (-> mtrx
+      incore/nrow
+      (repeat 1)
+      vec
+      (incore/bind-columns (incore/to-matrix mtrx))
+      (incore/sel :except-cols (incore/ncol mtrx))))
+
+(defn calc-new-theta
+  [x y theta]
+  (let [x' (incore/trans x)]
+    (-> x
+        (incore/mmult theta)
+        (incore/minus y)
+        ((partial incore/mmult x'))
+        (incore/div (count x))
+        (incore/mult alpha)
+        ((partial incore/minus theta)))))
+
+;(defn calc-theta
+  ;[x y theta]
+  ;(map - theta ((juxt (partial calc-theta0 x y) (partial calc-theta1 x y)) theta)))
+
+(defn gradient-descent-history
+  "Get theta values for last 10 iterations, for debugging really"
+  [x y]
+  (drop (- iterations 10) (take iterations (iterate (partial calc-theta x y) [0 1]))))
+
+;; need to group the xs together or just return all butlast
+(defn gradient-descent
+  "Calculate gradient descent."
+  ([mtrx] (gradient-descent mtrx iterations))
+  ([mtrx iter]
+   (let [x (prepare-x mtrx)
+         y (incore/sel mtrx :cols (count mtrx))]
+     (drop (dec iter)
+           (take iter
+                 (iterate (partial calc-new-theta x y)
+                          (repeat (inc (count mtrx)) 1)))))))
+
+;(defn predict-value
+  ;[x xs ys]
+  ;(as-> xs _
+    ;(gradient-descent _ ys)
+    ;(flatten _)
+    ;(+ (first _) (* x (second _)))))
+
+;(defn compute-mse
+  ;"Calculate the cost (mse : mean square error) function: 1/2m * Sigma(from 1,m) (Theta^T*X - Y)^2"
+  ;[x y theta]
+  ;(let [t0 (first theta)
+        ;t1 (second theta)]
+    ;(as-> x _
+      ;(h-ftn t0 t1 _)
+      ;(map - _ y)
+      ;(map (fn [n] (* n n)) _)
+      ;(reduce + _)
+      ;(/ _ (* 2 (count x))))))
+
+;(defn calc-mse-hist
+  ;"Verify that mean error square to decreasing"
+  ;[x y]
+  ;(->> y
+       ;(gradient-descent-history x)
+       ;(map (partial compute-mse x y))))
+
+;;; now plot the regression
+;(defn plot-linear-reg
+  ;[x y]
+  ;(let [view (charts/scatter-plot
+               ;:col0
+               ;:col1
+               ;:data mtrx
+               ;:x-label "Population of City in 10,000s"
+               ;:y-label "Profit in $10,000s")
+        ;slope-incpt (first (gradient-descent x y))
+        ;intercept (first slope-incpt)
+        ;slope (second slope-incpt)]
+    ;(incore/view (charts/add-function
+                  ;view
+                  ;(fn [x] (+ intercept (* x slope)))
+                  ;(apply min x)
+                  ;(apply max x)))))


Day #23

Day #23

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

--- src/adventofcode1/twentythree.clj
+++ src/adventofcode1/twentythree.clj
@@ -0,0 +1,277 @@
+(ns adventofcode1.twentythree
+  "http://adventofcode.com/2016/day/23"
+  (:require
+   [clojure.spec :as s]
+   [clojure.spec.gen :as gen]
+   [clojure.spec.test :as stest]
+   [com.gfredericks.test.chuck.generators :as gen']
+   [clojure.test.check :as tc]
+   [clojure.test.check.generators :as tcgen]
+   [clojure.test.check.properties :as tcprop]
+
+   [clojure.core.match :refer [match]]
+   [clojure.math.combinatorics :as combo]
+   [clojure.string :as str]
+   [com.rpl.specter :as sp]
+
+   spyscope.core
+   mw.utils
+   adventofcode1.spec-test-instrument-debug))
+
+;; specter ideas: for example how to go to any eelement
+;; https://github.com/nathanmarz/specter/issues/57
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; computer definition
+
+;; Initially, only "a" to "d"
+(s/def ::regs (s/map-of string? integer?))
+(s/def ::ip   integer?)
+
+(s/def ::computer (s/keys :req-un [::ip ::regs]))
+
+;; since :y doesn't always exists, I might have to remove it
+(s/def ::cmd  (s/keys :reg-un [::cmd ::x ::y]))
+(s/def ::cmds (s/coll-of ::cmd))
+
+
+
+(s/fdef init-computer
+        :args (s/cat)
+        :ret  ::computer)
+
+(defn init-computer
+  []
+  {:ip 0
+   :regs {"a" 0 "b" 0 "c" 0 "d" 0}})
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; helpers
+
+(defn parse-int
+  [s]
+  (int (bigint s)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; parse instructions
+
+(defn parse-cpy-value
+  [cmd]
+  (if-let [[_ x y] (re-find (re-matcher #"^cpy (-?\d+) ([a-z]+)$" cmd))]
+    {:cmd :cpy-value :x (parse-int x) :y y}))
+
+(defn parse-cpy-reg
+  [cmd]
+  (if-let [[_ x y] (re-find (re-matcher #"^cpy ([a-z]+) ([a-z]+)$" cmd))]
+    {:cmd :cpy-reg :x x :y y}))
+
+(defn parse-inc
+  [cmd]
+  (if-let [[_ x] (re-find (re-matcher #"^inc ([a-z]+)$" cmd))]
+    {:cmd :inc :x x}))
+
+(defn parse-dec
+  [cmd]
+  (if-let [[_ x] (re-find (re-matcher #"^dec ([a-z]+)$" cmd))]
+    {:cmd :dec :x x}))
+
+;; does this instruction exists? yes!
+(defn parse-jnz-value
+  [cmd]
+  (if-let [[_ x y] (re-find (re-matcher #"^jnz (-?\d+) (-?\d+)$" cmd))]
+    {:cmd :jnz-value :x (parse-int x) :y (parse-int y)}))
+
+(defn parse-jnz-value-2
+  [cmd]
+  (if-let [[_ x y] (re-find (re-matcher #"^jnz (-?\d+) ([a-z]+)$" cmd))]
+    {:cmd :jnz-value :x (parse-int x) :y y}))
+
+;; do we know the 2nd arg is always a number? Yes, at least in my sample
+(defn parse-jnz-x-reg
+  [cmd]
+  (if-let [[_ x y] (re-find (re-matcher #"^jnz ([a-z]+) (-?\d+)$" cmd))]
+    {:cmd :jnz-x-reg :x x :y (parse-int y)}))
+
+(defn parse-tgl
+  [cmd]
+  (if-let [[_ x] (re-find (re-matcher #"^tgl ([a-z]+)$" cmd))]
+    {:cmd :tgl :x x}))
+
+
+
+(defn parse-cmd
+  [cmd]
+  (let [ret (or (parse-cpy-value cmd)
+                (parse-cpy-reg cmd)
+                (parse-inc cmd)
+                (parse-dec cmd)
+                (parse-jnz-value cmd)
+                (parse-jnz-value-2 cmd)
+                (parse-jnz-x-reg cmd)
+                (parse-tgl cmd))]
+    (if (nil? ret)(assert false {:error :not-a-command :data cmd})
+        ret)))
+
+;; testdata defined further down
+(declare sample-data)
+(declare sample-data-2nd)
+(declare puzzle-input-a)
+(declare puzzle-input-b)
+
+(defn parse-cmds
+  ([](parse-cmds (str/split-lines puzzle-input-a)))
+  ([cmds]
+   (vec (map parse-cmd cmds))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; execution
+
+(s/fdef tgl
+        :args (s/cat :cmds ::cmds :cmd ::cmd :ip ::ip :regs ::regs)
+        :ret  (s/tuple ::cmds ::ip ::regs))
+
+(defn tgl
+  [cmds cmd ip regs]
+  (let [idx (+ ip (get regs (:x cmd)))]
+    (if (or (neg? idx) (>= idx (count cmds)))
+      [cmds (inc ip) regs]
+      (let
+          [before (nth cmds idx)
+           after
+           (match [(:cmd before)(:y before)]
+             [:inc nil] :dec
+             [_    nil] :inc
+             [:jnz-x-reg _] :cpy-reg
+             [:jnz-value _] :cpy-value
+             [:cpy-reg _]   :jnz-x-reg
+             [:cpy-value _] :jnz-value)
+           cmds2 (assoc cmds idx (sp/setval [:cmd] after before))]
+        [cmds2 (inc ip) regs]))))
+
+(s/fdef maybe-deref
+        :args (s/cat :regs ::regs :key (s/or :value integer? :reg string?))
+        :ret  integer?)
+
+(defn maybe-deref
+  [regs s]
+  (if (integer? s)
+    s
+    (let [res (get regs s)
+          _ (assert (not (nil? res)))]
+      res)))
+
+(s/fdef exec
+        :args (s/cat :cmds ::cmds :cmd ::cmd :ip ::ip :regs ::regs)
+        :ret  (s/tuple ::cmds ::ip ::regs))
+
+(defn exec
+  [cmds cmd ip regs]
+  (match (:cmd cmd)
+    :cpy-value [cmds (inc ip) (assoc regs (:y cmd) (:x cmd))]
+    :cpy-reg   [cmds (inc ip) (assoc regs (:y cmd) (get regs (:x cmd)))]
+    :inc       [cmds (inc ip) (assoc regs (:x cmd) (inc (get regs (:x cmd))))]
+    :dec       [cmds (inc ip) (assoc regs (:x cmd) (dec (get regs (:x cmd))))]
+    :jnz-value (if-not (zero? (:x cmd))
+                 [cmds
+                  (+ ip (maybe-deref regs (:y cmd)))
+                  regs]
+                 [cmds (inc ip) regs])
+    :jnz-x-reg (if-not (zero? (get regs (:x cmd)))
+                 [cmds (+ ip (:y cmd)) regs]
+                 [cmds (inc ip) regs])
+    :tgl       (tgl cmds cmd ip regs)))
+
+
+(defn main
+  ;; ([](main (parse-cmds (str/split-lines sample-data-2nd)) (init-computer)))
+  ;;([](main (parse-cmds (str/split-lines sample-data)) (init-computer)))
+  ;; first puzzle
+  ;;([](main (parse-cmds (str/split-lines puzzle-input-a)) (init-computer)))
+  ;; 2nd puzzle
+  ([](main 0 (parse-cmds (str/split-lines puzzle-input-b))
+           {:ip 0 :regs {"a" 7 "b" 0 "c" 0 "d" 0}}))
+  ([ctr cmds comp]
+   (if (zero? (mod ctr 100000)) (println (str ctr ": " comp)))
+   (let [{:keys [ip regs]} comp]
+     ;; we are finished if there is no more cmds to run
+     (if (or (neg? ip)(>= ip (count cmds)))
+         comp
+         (let [[cmds2 ip2 regs2] (exec cmds (nth cmds ip) ip regs)]
+           (recur (inc ctr) cmds2 {:ip ip2 :regs regs2}))))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; sample data
+
+(def sample-data
+  "cpy 41 a
+inc a
+inc a
+dec a
+jnz a 2
+dec a")
+
+(def sample-data-2nd
+   "cpy 2 a
+tgl a
+tgl a
+tgl a
+cpy 1 a
+dec a
+dec a")
+
+(def puzzle-input-a
+  "cpy 1 a
+cpy 1 b
+cpy 26 d
+jnz c 2
+jnz 1 5
+cpy 7 c
+inc d
+dec c
+jnz c -2
+cpy a c
+inc a
+dec b
+jnz b -2
+cpy c b
+dec d
+jnz d -6
+cpy 14 c
+cpy 14 d
+inc a
+dec d
+jnz d -2
+dec c
+jnz c -5")
+
+(def puzzle-input-b
+  "cpy a b
+dec b
+cpy a d
+cpy 0 a
+cpy b c
+inc a
+dec c
+jnz c -2
+dec d
+jnz d -5
+dec b
+cpy b c
+cpy c d
+dec d
+inc c
+jnz d -2
+tgl c
+cpy -16 c
+jnz 1 c
+cpy 99 c
+jnz 77 d
+inc a
+inc d
+jnz d -2
+inc c
+jnz c -5")
+
+(clojure.spec.test/instrument)


Log statements.

Log statements.

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


fixing piggieback repl printing

fixing piggieback repl printing

fixes #283

--- sidecar/src/figwheel_sidecar/repl.clj
+++ sidecar/src/figwheel_sidecar/repl.clj
@@ -59,9 +59,8 @@
         (recur)))))

 (defn add-repl-print-callback! [{:keys [browser-callbacks]}]
-  (let [pr-fn (resolve-repl-println)]
-    (swap! browser-callbacks assoc "figwheel-repl-print"
-           (fn [args] (apply pr-fn args)))))
+  (swap! browser-callbacks assoc "figwheel-repl-print"
+         (fn [args] (apply repl-println args))))

 (defn valid-stack-line? [{:keys [function file url line column]}]
   (and (not (nil? function))


Initial Jenkins sync job

Initial Jenkins sync job

error: pathspec 'src/buildviz/jenkins/sync.clj' did not match any file(s) known to git

--- src/buildviz/jenkins/sync.clj
+++ src/buildviz/jenkins/sync.clj
@@ -0,0 +1,51 @@
+(ns buildviz.jenkins.sync
+  (:require [cheshire.core :as j]
+            [clj-http.client :as client]
+            [clj-time
+             [coerce :as tc]
+             [format :as tf]]
+            [clojure.string :as string]
+            [clojure.tools.logging :as log]))
+
+(defn- get-jobs [jenkins-url]
+  (let [response (j/parse-string (:body (client/get (string/join [jenkins-url "/api/json"])))
+                                 true)]
+    (map :name (get response :jobs))))
+
+(defn- get-builds [jenkins-url job-name]
+  (let [response (j/parse-string (:body (client/get (string/join [jenkins-url (format "/job/%s/api/json?pretty=true&tree=builds[number,timestamp,result,duration]" job-name)])))
+                                 true)]
+    (->> (get response :builds)
+         (map #(assoc % :job-name job-name)))))
+
+
+(defn- jenkins-build->buildviz-build [{:keys [job-name number timestamp duration result]}]
+  {:job-name job-name
+   :build-id number
+   :build {:start timestamp
+           :end (+ timestamp duration)
+           :outcome (if (= result "SUCCESS")
+                      "pass"
+                      "fail")}})
+
+(defn put-build [buildviz-url job-name build-id build]
+  (client/put (string/join [buildviz-url (format "/builds/%s/%s" job-name build-id)])
+              {:content-type :json
+               :body (j/generate-string build)}))
+
+
+(defn put-to-buildviz [buildviz-url {:keys [job-name build-id build]}]
+  (log/info (format "Syncing %s %s: build" job-name build-id))
+  (put-build buildviz-url job-name build-id build))
+
+
+(defn -main [& c-args]
+
+  (let [jenkins-url "http://localhost:8080"
+        buildviz-url "http://localhost:3000"]
+
+    (->> (get-jobs jenkins-url)
+         (mapcat (partial get-builds jenkins-url))
+         (map jenkins-build->buildviz-build)
+         (map (partial put-to-buildviz buildviz-url))
+         doall)))


Namespace for core garden css

Namespace for core garden css

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

--- src/clj/gtfve/styles/core.clj
+++ src/clj/gtfve/styles/core.clj
@@ -0,0 +1,8 @@
+(ns gtfve.styles.core
+  (:require [garden.def :refer [defstylesheet defstyles]]
+            [garden.units :refer [px]]))
+
+(defstyles main
+  [[:.site-header {}]
+   [:.side-panel {}]
+   [:.maps-panel {}]])


Add comment field and multiline support for items

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


Allow specification of start/end times.

Allow specification of start/end times.


added es index test helpers

added es index test helpers

error: pathspec 'test/cia/test_helpers/index.clj' did not match any file(s) known to git

--- test/cia/test_helpers/index.clj
+++ test/cia/test_helpers/index.clj
@@ -0,0 +1,40 @@
+(ns cia.test-helpers.index
+  (:require [cia.store :as store]
+            [cia.stores.es.index :as es-index :refer [es-conn]]
+            [cia.stores.es.mapping :as mapping]
+            [cia.stores.es.store :as es-store]
+            [cia.test-helpers.core :as h]
+            [clojure.java.io :as io]))
+
+(defn fixture-init-index [test]
+  (try
+    (es-index/init!)
+    (es-index/delete! es-conn)
+    (es-index/create! es-conn)
+    (test)
+    (es-index/delete! es-conn)
+    (catch org.elasticsearch.client.transport.NoNodeAvailableException e
+      (do  (println "ES unavailable")
+           (test)))))
+
+(defn fixture-clean-index [f]
+  (es-index/flush! es-conn)
+  (f))
+
+(defn init-state [f]
+  (fn []
+    (f {:conn es-conn})))
+
+(def es-stores
+  {store/actor-store          (init-state es-store/->ActorStore)
+   store/judgement-store      (init-state es-store/->JudgementStore)
+   store/feedback-store       (init-state es-store/->FeedbackStore)
+   store/campaign-store       (init-state es-store/->CampaignStore)
+   store/coa-store            (init-state es-store/->COAStore)
+   store/exploit-target-store (init-state es-store/->ExploitTargetStore)
+   store/incident-store       (init-state es-store/->IncidentStore)
+   store/indicator-store      (init-state es-store/->IndicatorStore)
+   store/ttp-store            (init-state es-store/->TTPStore)})
+
+
+(def fixture-es-store (h/fixture-store es-stores))


fix indentation

fix indentation

--- src/metabase/api/user.clj
+++ src/metabase/api/user.clj
@@ -4,4 +4,4 @@

 (defapi current [_]
   (or-404-> (*current-user*)
-            (hydrate [:org_perms :organization])))
+    (hydrate [:org_perms :organization])))


Added unit tests for util.

Added unit tests for util.

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

--- test/simulacrum/util_test.clj
+++ test/simulacrum/util_test.clj
@@ -0,0 +1,31 @@
+(ns simulacrum.util-test
+  (:require [clojure.test :refer :all]
+            [simulacrum.util :as util]))
+
+
+(deftest test-get-last-line
+  (let [test-data "This is some
+                  multi-line
+                  text.
+                  Enjoy!"]
+    (is (= "Enjoy!" (util/get-last-line test-data)))))
+
+(deftest test-in?
+  (is (= true (util/in? [1 2] 1)))
+  (is (= true (util/in? [1 2] 2)))
+  (is (= false (util/in? [1 2] 0)))
+  (is (= false (util/in? [1 2] 3))))
+
+(deftest test-check-input
+  (is (= 1 (util/check-input 1)))
+  (is (= 3 (util/check-input 3)))
+  (is (= 5 (util/check-input 5)))
+  (is (= 5 (util/check-input 5)))
+  (is (thrown-with-msg?
+        clojure.lang.ExceptionInfo
+        #"Input must be between 1 and 5"
+        (util/check-input 0)))
+  (is (thrown-with-msg?
+        clojure.lang.ExceptionInfo
+        #"Input must be between 1 and 5"
+        (util/check-input 6))))


Tokens processing added

Tokens processing added

error: pathspec 'src/tools/compiler/lexer.clj' did not match any file(s) known to git

--- src/tools/compiler/lexer.clj
+++ src/tools/compiler/lexer.clj
@@ -0,0 +1,54 @@
+;;
+;; Author José Albert Cruz Almaguer <jalbertcruz@gmail.com>
+;; Copyright 2015 by José Albert Cruz Almaguer.
+;;
+;; This program is licensed to you under the terms of version 3 of the
+;; GNU Affero General Public License. This program is distributed WITHOUT
+;; ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
+;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
+;; AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
+;;
+
+(ns tools.compiler.lexer
+  (:require [clojure.string :as cstr])
+  )
+
+(def tkns-desc-init '[
+                       [space "[\t \n]+"]
+                       ])
+
+(declare tkns-desc tkns)
+
+(defn setTokens-desc [descs]
+  (def tkns-desc (apply conj tkns-desc-init descs))
+  (def tkns (map (fn [[name pattern]]
+                   [name (re-pattern (str "^" pattern))]) tkns-desc))
+  )
+
+(def tab-size 3)
+
+(defn all-tokens-in-str [ln]
+  (loop [cln (cstr/replace ln #"\r" "") res [] row 1 col 1]
+    (let [primero (first (filter #(re-find (% 1) cln) tkns))]
+      (if (seq primero)
+        (let [lex (re-find (primero 1) cln)]
+          (if (= (primero 0) 'space)
+            (let [
+                   nrow (+ row (count (filter #(= % \newline) lex)))
+                   [col-init text-2-count] (if (= nrow row) ; si no hay \n
+                                             [col lex]
+                                             [1 (peek (cstr/split lex #"\n"))]
+                                             )
+                   ncol (reduce + col-init (map #(case %
+                                                   \tab tab-size
+                                                   \space 1
+                                                   1) text-2-count))
+                   ]
+              (recur (.substring cln (count lex)) (conj res [(primero 0) lex row col]) nrow ncol))
+            (recur (.substring cln (count lex)) (conj res [(primero 0) lex row col]) row (+ col (count lex)))))
+        (if (seq cln)
+          (recur (.substring cln 1) (conj res ['error (.substring cln 0 1) row col]) row (inc col))
+          (conj res ['eot nil row col]))))))
+
+(defn tokens-in-str [ln]
+  (for [[tk lex r c] (all-tokens-in-str ln) :when (not= tk 'space)] [tk lex r c]))


Made assoc-query-params public to match assoc-form-params

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


[WM TH] add timeouts waiting on user-works response

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


fix api.meta.field-test when ran independently

--- test/metabase/api/meta/field_test.clj
+++ test/metabase/api/meta/field_test.clj
@@ -10,8 +10,9 @@

 ;; ## GET /api/meta/field/:id
 (expect
-    (match-$ (sel :one Field :id (field->id :users :name))
-      {:description nil
+    (match-$ (let [field-id (field->id :users :name)] ; !!! field->id causes lazy loading of the test data and Metabase DB
+               (sel :one Field :id field-id))         ; If it's not evaluated before sel then the Metabase DB won't exist when sel
+      {:description nil                               ; is executed
        :table_id (table->id :users)
        :table (match-$ (sel :one Table :id (table->id :users))
                 {:description nil


Avoid bad error code for multiples of 256 test failures (#1052)

Closes https://github.com/threatgrid/iroh/issues/4564
Related https://github.com/circleci/circleci.test/issues/43

Exit codes wrap modulo 256, this is bad so this PR returns exit code 0 on success and 1 on failure.

[§](#qa) QA
============================

No QA is needed.

[§](#release-notes) Release Notes
=============================================================

```
intern: avoid bad error code for multiples of 256 test failures
```

[§](#squashed-commits) Squashed Commits
======================================================================

--- dev/ctia/dev/split_tests.clj
+++ dev/ctia/dev/split_tests.clj
@@ -285,4 +285,6 @@
                      (shutdown-agents)
                      (System/exit 1)))]
      (shutdown-agents)
-     (System/exit (+ (:error summary) (:fail summary))))))
+     (System/exit (min 1
+                       (+ (:error summary)
+                          (:fail summary)))))))


Forgot to add test runner

Forgot to add test runner

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

--- test/fatlip/test_runner.cljs
+++ test/fatlip/test_runner.cljs
@@ -0,0 +1,39 @@
+(ns ^:figwheel-always fatlip.test-runner
+  (:require
+   [cljs.test :as test :include-macros true :refer [report]]
+   [fatlip.order-test]
+   [fatlip.plot-test]
+   [fatlip.sparse-test]
+   [figwheel.client :as fw]))
+
+(enable-console-print!)
+
+(defn color-favicon-data-url [color]
+  (let [cvs (.createElement js/document "canvas")]
+    (set! (.-width cvs) 16)
+    (set! (.-height cvs) 16)
+    (let [ctx (.getContext cvs "2d")]
+      (set! (.-fillStyle ctx) color)
+      (.fillRect ctx 0 0 16 16))
+    (.toDataURL cvs)))
+
+(defn change-favicon-to-color [color]
+  (let [icon (.getElementById js/document "favicon")]
+    (set! (.-href icon) (color-favicon-data-url color))))
+
+(defmethod report [::test/default :summary] [m]
+  (println "\nRan" (:test m) "tests containing"
+           (+ (:pass m) (:fail m) (:error m)) "assertions.")
+  (println (:fail m) "failures," (:error m) "errors.")
+  (if (< 0 (+ (:fail m) (:error m)))
+    (change-favicon-to-color "#d00")
+    (change-favicon-to-color "#0d0"))) ;;<<-- change color
+
+(defn runner []
+  (test/run-tests 'fatlip.sparse-test
+                  'fatlip.order-test
+                  'fatlip.plot-test))
+
+(fw/start {:websocket-url "ws://localhost:3449/figwheel-ws"
+           :build-id "test"
+           :on-jsload (fn [] (runner))})


remove test functions

remove test functions

--- src/metabase/api/card.clj
+++ src/metabase/api/card.clj
@@ -11,10 +11,6 @@
   (-> (sel :many Card :organization_id org (order :name :ASC))
       (hydrate :creator)))

-(defendpoint GET "/pass/" []
-  (check-403 true)
-  {:status "OK"})
-
 (defendpoint GET "/:id" [id]
   (->404 (sel :one Card :id id)
          (hydrate :can_read :can_write)))
@@ -24,10 +20,6 @@
     (check-403 @(:can_write card))
     (del Card :id id)))

-(defendpoint GET "/fail" []
-  (check-403 false)
-  {:status "OK"})
-
 (defendpoint GET "/:id/favorite" [id]
   {:favorite (boolean (some->> *current-user-id*
                                (sel :one CardFavorite :card_id id :owner_id)))})


fix bug preventing awobmolg.alda from eval-ing at the CLI

The Alda score evaluator was throwing an error about not being able to resolve the symbol $current-offset, when trying to do "boot parse --map -f test/examples/awobmolg.alda". Interestingly, I was still able to evaluate the score from the REPL within the alda.lisp namespace. The problem ended up being in alda.lisp/chord*, a macro that was generating a literal symbol '$current-offset, which was only eval-able within the alda.lisp namespace. Fully qualifying the symbol (`$current-offset) fixed it. :+1:

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


Rewrite CAS

Rewrite CAS


this is already imported

this is already imported

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


Initial stab at channels component

Initial stab at channels component

fatal: unable to access 'https://github.com/metasoarous/strange-coop.git/': The requested URL returned error: 403