Copy connect graphql to graphql2

Copy connect graphql to graphql2

error: pathspec 'src/com/wsscode/pathom/connect/graphql2.cljc' did not match any file(s) known to git

--- src/com/wsscode/pathom/connect/graphql2.cljc
+++ src/com/wsscode/pathom/connect/graphql2.cljc
@@ -0,0 +1,407 @@
+(ns com.wsscode.pathom.connect.graphql2
+  (:require [camel-snake-kebab.core :as csk]
+            [clojure.spec.alpha :as s]
+            [clojure.string :as str]
+            [#?(:clj  com.wsscode.common.async-clj
+                :cljs com.wsscode.common.async-cljs) :refer [let-chan go-catch <? <?maybe]]
+            [com.wsscode.pathom.core :as p]
+            [com.wsscode.pathom.connect :as pc]
+            [com.wsscode.pathom.graphql :as pg]
+            [com.wsscode.pathom.diplomat.http :as p.http]
+            [clojure.walk :as walk]))
+
+(declare graphql-resolve graphql-mutation)
+
+(s/def ::ident-map (s/map-of string? (s/map-of string? (s/tuple string? string?))))
+(s/def ::resolver ::pc/sym)
+(s/def ::prefix string?)
+
+(def schema-query
+  [{:__schema
+    [{:queryType
+      [:name]}
+
+     {:mutationType
+      [:name]}
+
+     {:types
+      [:name
+       :kind
+       {:interfaces [:name :kind]}
+       {:fields
+        [:name
+         {:args [:name :defaultValue {:type [:kind :name {:ofType 3}]}]}
+         {:type [:kind :name {:ofType 3}]}]}]}]}])
+
+(defn kebab-key [s]
+  (keyword (pg/kebab-case (name s))))
+
+(defn index-key [s] (name (kebab-key s)))
+
+(defn prefixed-key [prefix p s] (keyword (str prefix "." p) (index-key s)))
+(defn type-key [prefix s] (prefixed-key prefix "types" s))
+(defn interface-key [prefix s] (prefixed-key prefix "interfaces" s))
+(defn mutation-key [prefix s] (symbol prefix (pg/kebab-case s)))
+(defn service-resolver-key [prefix] (mutation-key prefix "resolver"))
+(defn service-mutation-key [prefix] (symbol "com.wsscode.pathom.connect.graphql.service-mutations" prefix))
+
+(defn type->field-entry [prefix {:keys [kind name ofType]}]
+  (case kind
+    "NON_NULL" (recur prefix ofType)
+    "LIST" (recur prefix ofType)
+    "OBJECT" {(type-key prefix name) {}}
+    "INTERFACE" {(interface-key prefix name) {}}
+    {}))
+
+(defn index-type-key [prefix {:keys [name kind]}]
+  (let [key-fun (case kind
+                  "OBJECT" type-key
+                  "INTERFACE" interface-key)]
+    (key-fun prefix name)))
+
+(defn entity-field-key [prefix entity field]
+  (keyword (str prefix "." (index-key entity)) (index-key field)))
+
+(defn index-type [prefix {:keys [fields name interfaces] :as input}]
+  {#{(index-type-key prefix input)}
+   (-> {}
+       ; fields
+       (into (map #(vector (entity-field-key prefix name (:name %))
+                     (type->field-entry prefix (:type %)))) fields)
+       ; interfaces
+       (into (map #(vector (interface-key prefix (:name %)) {}) interfaces)))})
+
+(defn ident-root? [{::keys [ident-map]} {:keys [args]}]
+  (and (= 1 (count args))
+       (get ident-map (-> args first :name))))
+
+(defn ident-root [{::keys [prefix ident-map]} {:keys [name] :as root-field}]
+  (if-let [fields (get ident-map name)]
+    (if (= 1 (count fields))
+      (let [[entity field] (first (vals fields))]
+        (assoc root-field ::entity-field (entity-field-key prefix entity field))))))
+
+(defn ident-map-entry [prefix item]
+  (cond
+    (keyword? item) item
+    (vector? item) (entity-field-key prefix (first item) (second item))))
+
+(defn ident-map-params->io [{::keys [prefix]} params]
+  (->> params vals (into #{} (map (fn [item] (ident-map-entry prefix item))))))
+
+(defn index-schema-io [{::keys [prefix schema ident-map] :as input}]
+  (let [schema (:__schema schema)]
+    (-> {}
+        (into (comp (filter (comp #{"OBJECT" "INTERFACE"} :kind))
+                    (map (partial index-type prefix)))
+              (:types schema))
+        (assoc #{} (into {} (map #(vector (keyword prefix (index-key (:name %)))
+                                    (type->field-entry prefix (:type %))))
+                         (->> schema :queryType :fields)))
+        (as-> <>
+          (reduce (fn [idx {:keys [name type]}]
+                    (let [params    (get ident-map name)
+                          input-set (ident-map-params->io input params)]
+                      (update idx input-set pc/merge-io {(ffirst (type->field-entry prefix type)) {}})))
+            <>
+            (->> schema :queryType :fields
+                 (filter (comp ident-map :name))))))))
+
+(defn args-translate [{::keys [prefix ident-map]} args]
+  (or
+    (if-let [item (get ident-map (-> args first :name))]
+      (if (= 1 (count args))
+        #{(keyword (ident-map-entry prefix item))}))
+    #{}))
+
+(defn index-schema-oir [{::keys    [prefix schema resolver ident-map]
+                         ::pc/keys [index-io]
+                         :as       input}]
+  (let [schema (:__schema schema)
+        roots  (-> schema :queryType :fields)]
+    (-> {}
+        (into (map #(vector (keyword prefix (index-key (:name %)))
+                      {(args-translate input (:args %)) #{resolver}}))
+              roots)
+        (into (comp
+                (filter (comp ident-map :name))
+                (mapcat (fn [{:keys [type name]}]
+                          (let [params    (get ident-map name)
+                                input-set (ident-map-params->io input params)
+                                fields    (-> (get index-io #{(ffirst (type->field-entry prefix type))}) keys)]
+                            (mapv (fn [field]
+                                    [field {input-set #{resolver}}])
+                              fields)))))
+              roots))))
+
+(defn index-autocomplete-ignore [{::keys [prefix schema]}]
+  (let [schema (:__schema schema)]
+    (-> #{}
+        (into (comp (filter (comp #{"OBJECT" "INTERFACE"} :kind))
+                    (map (partial index-type-key prefix)))
+              (:types schema)))))
+
+(defn index-idents [{::keys [prefix ident-map]}]
+  (into #{}
+        (map #(ident-map-entry prefix %))
+        (->> (vals ident-map)
+             (filterv #(= 1 (count %)))
+             (map vals)
+             (apply concat))))
+
+(defn index-graphql-idents [{::keys    [prefix schema ident-map]
+                             ::pc/keys [index-io]}]
+  (let [schema (:__schema schema)
+        fields (-> schema :queryType :fields)
+        idents (filter (comp ident-map :name) fields)]
+    (-> {}
+        (into (mapcat (fn [{:keys [name type]}]
+                        (let [params        (get ident-map name)
+                              ident-key     (keyword (pg/kebab-case name) (pg/kebab-case (str/join "-and-" (keys params))))
+                              entity-fields (mapv (fn [item] (ident-map-entry prefix item)) (vals params))
+                              entity-field  (cond-> entity-fields (= 1 (count entity-fields)) first)
+                              fields        (-> (get index-io #{(ffirst (type->field-entry prefix type))})
+                                                keys)]
+                          (mapv (fn [field]
+                                  [field {::entity-field entity-field
+                                          ::ident-key    ident-key}])
+                            fields))))
+              idents))))
+
+(defn index-mutations [{::keys [prefix schema] :as config}]
+  (let [mutations (-> schema :__schema :mutationType :fields)]
+    (into
+      {(service-mutation-key prefix)
+       (pc/mutation (service-mutation-key prefix) {}
+         (fn [env _] (graphql-mutation config env)))}
+      (map (fn [{:keys [name]}]
+             [(mutation-key prefix name) {::pc/sym (service-mutation-key prefix)}]))
+      mutations)))
+
+(defn index-schema-types [schema]
+  (let [index (->> schema :__schema :types
+                   (group-by :name)
+                   (into {} (map (fn [[k v]] [k (first v)]))))]
+    (-> (assoc schema ::types-index index)
+        (update-in [:__schema :queryType] #(merge % (get index (:name %))))
+        (update-in [:__schema :mutationType] #(merge % (get index (:name %)))))))
+
+(defn remove-pathom-params [params]
+  (if params
+    (reduce-kv
+      (fn [m k v]
+        (if (and (keyword? k)
+                 (= "pathom" (namespace k)))
+          m
+          (assoc m k v)))
+      {}
+      params)))
+
+(defn filter-graphql-subquery [{::p/keys [parent-query]
+                                ::keys   [prefix]
+                                :as      env}]
+  (let [ent (p/entity env)]
+    (->> parent-query
+         (p/lift-placeholders env)
+         p/query->ast
+         (p/transduce-children
+           (comp (filter #(str/starts-with? (or (namespace (:dispatch-key %)) "") prefix))
+                 (map #(update % :params remove-pathom-params))))
+         :children
+         ; remove already known keys
+         (remove #(contains? ent (:key %)))
+         ; remove ident attributes
+         (remove (comp vector? :key)))))
+
+(defn index-schema [{::keys [resolver prefix] :as config}]
+  (let [resolver (or resolver (service-resolver-key prefix))
+        config   (update config ::schema index-schema-types)
+        index-io (index-schema-io config)
+        config   (assoc config ::pc/index-io index-io
+                               ::resolver resolver)]
+    {::pc/index-resolvers
+     {resolver {::pc/sym            resolver
+                ::pc/cache?         false
+                ::pc/compute-output (fn [env]
+                                      (->> (filter-graphql-subquery (assoc env ::prefix prefix))
+                                           (hash-map :type :root :children)
+                                           p/ast->query))
+                ::graphql?          true
+                ::pc/resolve        (fn [env _] (graphql-resolve config env))}}
+
+     ::pc/index-io
+     index-io
+
+     ::pc/index-oir
+     (index-schema-oir config)
+
+     ::pc/autocomplete-ignore
+     (index-autocomplete-ignore config)
+
+     ::pc/idents
+     (index-idents config)
+
+     ::pc/index-mutations
+     (index-mutations config)
+
+     ::field->ident
+     (index-graphql-idents config)}))
+
+;;;; resolver
+
+(s/fdef index-schema
+  :args (s/cat :input (s/keys :req [::schema ::prefix] :opt [::resolver ::ident-map]))
+  :ret  (s/merge ::pc/indexes
+          (s/keys :req [::pc/autocomplete-ignore ::field->ident])))
+
+(defn camel-key [s]
+  (if (vector? s)
+    s
+    (keyword (pg/camel-case (name s)))))
+
+(defn gql-ident-reader [{:keys [ast]
+                         :as   env}]
+  (if (vector? (:key ast))
+    (let [e (p/entity env)]
+      (let [json (get e (keyword (pg/ident->alias (:key ast))))]
+        (p/join json env)))
+    ::p/continue))
+
+(defn index-graphql-errors [errors] (group-by :path errors))
+
+(defn error-stamper [{::keys   [errors base-path]
+                      ::p/keys [path errors*]}]
+  (let [path' (mapv #(cond
+                       (p/ident? %)
+                       (name (camel-key (namespace (first %))))
+
+                       (keyword? %)
+                       (name (camel-key %))
+
+                       :else %)
+                path)]
+    (if-let [local-errors (get errors path')]
+      (do
+        (if errors*
+          (swap! errors* assoc (into base-path (remove p/ident? path)) (first local-errors)))
+        ::error)
+      ::p/continue)))
+
+(defn alias-for-line [query line]
+  (try
+    (if-let [[_ alias] (-> (str/split-lines query)
+                           (nth (dec line))
+                           (->> (re-find #"^\s*([^:]+): \w+")))]
+      alias)
+    (catch #?(:clj Throwable :cljs :default) _ nil)))
+
+(def parser-item
+  (p/parser {::p/env     {::p/reader [error-stamper
+                                      (p/map-reader* {::p/map-key-transform camel-key})
+                                      p/env-placeholder-reader
+                                      gql-ident-reader]}
+             ::p/plugins [(p/env-wrap-plugin
+                            (fn [env]
+                              (update env ::p/placeholder-prefixes
+                                #(or % #{}))))]}))
+
+(defn query->graphql
+  "Like the pg/query-graphql, but adds name convertion so clj names like :first-name turns in firstName."
+  [query]
+  (pg/query->graphql query {::pg/js-name (comp pg/camel-case name)}))
+
+(defn ast->graphql [{:keys     [ast]
+                     ::pc/keys [indexes]}
+                    ent]
+  (let [{::keys [field->ident]} indexes
+        {:keys [key]} ast
+        q [(p/ast->query ast)]]
+    (if-let [{::keys [entity-field ident-key]} (get field->ident key)]
+      (let [ident-value (if (vector? entity-field) (mapv ent entity-field) (get ent entity-field))
+            ident-key'  [ident-key ident-value]]
+        [{ident-key' q}])
+      q)))
+
+(defn build-query [env]
+  (->> (filter-graphql-subquery env)
+       (map #(ast->graphql (assoc env :ast %) (p/entity env)))
+       (reduce p/merge-queries [])))
+
+(defn pull-idents [data]
+  (reduce-kv (fn [x k v]
+               (if (vector? k)
+                 (into x v)
+                 (assoc x k v)))
+    {}
+    data))
+
+(defn request [{::keys [url] :as env} query]
+  (let-chan [response (p.http/request (assoc env ::p.http/url url
+                                                 ::p.http/content-type ::p.http/json
+                                                 ::p.http/method ::p.http/post
+                                                 ::p.http/as ::p.http/json
+                                                 ::p.http/form-params {:query (if (string? query) query (query->graphql query))}))]
+    (::p.http/body response)))
+
+(defn normalize-schema
+  "Depending on encoding settings sometimes the :kind can come as a keyword, the indexer expects it to
+  be a string, this function ensures all :kind fields are strings."
+  [schema]
+  (walk/postwalk
+    (fn [x]
+      (if (and (map? x)
+               (contains? x :kind))
+        (update x :kind #(some-> % name))
+        x))
+    schema))
+
+(defn load-index
+  ([req]
+   (let-chan [{:keys [data]} (request req (pg/query->graphql schema-query))]
+     (index-schema (assoc req ::schema (normalize-schema data)))))
+  ([req indexes]
+   (let-chan [idx (load-index req)]
+     (swap! indexes pc/merge-indexes idx))))
+
+(defn graphql-resolve [config env]
+  (let [env' (merge env config)
+        q    (build-query env')
+        gq   (query->graphql q)]
+    (let-chan [{:keys [data errors]} (request env' gq)]
+      (-> (parser-item {::p/entity               data
+                        ::p/errors*              (::p/errors* env)
+                        ::p/placeholder-prefixes (::p/placeholder-prefixes env')
+                        ::base-path              (vec (butlast (::p/path env)))
+                        ::graphql-query          gq
+                        ::errors                 (index-graphql-errors errors)}
+            q)
+          (pull-idents)))))
+
+(defn graphql-mutation [config env]
+  (let [{:keys     [ast]
+         ::pc/keys [source-mutation]
+         :as       env'} (merge env config)
+        query (p/ast->query {:type :root :children [(assoc ast :key source-mutation :dispatch-key source-mutation)]})
+        gq    (query->graphql query)]
+    (let-chan [{:keys [data errors]} (request env' gq)]
+      (let [parser-response
+            (-> (parser-item {::p/entity      data
+                              ::p/errors*     (::p/errors* env)
+                              ::base-path     (vec (butlast (::p/path env)))
+                              ::graphql-query gq
+                              ::errors        (index-graphql-errors errors)}
+                  (p/ast->query {:type :root :children [(assoc ast :type :join :key (keyword source-mutation) :dispatch-key (keyword source-mutation))]})))]
+        (get parser-response (keyword source-mutation))))))
+
+(defn defgraphql-resolver [{::pc/keys [resolver-dispatch mutate-dispatch]} {::keys [resolver prefix] :as config}]
+  (if resolver-dispatch
+    (defmethod resolver-dispatch resolver [env _]
+      (graphql-resolve config env)))
+
+  (if mutate-dispatch
+    (defmethod mutate-dispatch (service-mutation-key prefix) [env _]
+      (graphql-mutation config env))))
+
+(s/fdef defgraphql-resolver
+  :args (s/cat :env (s/keys :opt [::pc/resolver-dispatch ::pc/mutate-dispatch])
+               :config (s/keys :req [::resolver ::prefix])))


Emit bytes with file and file position.

Emit bytes with file and file position.

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


clean up

clean up

--- sidecar/src/figwheel_sidecar/config_check/type_check.clj
+++ sidecar/src/figwheel_sidecar/config_check/type_check.clj
@@ -137,6 +137,9 @@
 (defn assert-not-empty [root & key-list]
   (mapv (fn [k] [root :not-empty k]) key-list))

+
+;; TODO I'm thinking documentation should only be attached to types
+;; this would be much more consistent
 (defn doc
   ([root type-doc kd]
    (cons [root :doc-type type-doc]
@@ -202,10 +205,7 @@
            error)])
       {:success-type typ})))

-;; TODO this allows a OR reloationship??
-;; lets formalize this as an and relationship
-;; the or-spec handles the OR relationship
-
+;; TODO or relationship
 (defn type-check-value [parent-type value state]
   (if-let [preds (all-predicates parent-type)]
     (let [errors   (map #(type-check-pred % value state) preds)
@@ -233,7 +233,7 @@
     (when-let [pred-func (last (first (schema-rules [:= pred-id])))]
       [pred-func kt])))

-;; this is what implements or
+;; TODO this is what implements or
 (defn type-check-key-value [parent-type ky value state]
   (let [next-types (get-types-from-key-parent parent-type (fix-key ky (:parent-value state)))
         state      (update-in state [:path] conj ky)]
@@ -1146,20 +1146,6 @@
    :break
    (print-document document)])

-#_(pp)
-
-;; Todos
-
-;; handle printing :correct-path with knowledge of available config
-;;     esp. for bad path errors
-
-;; make coloring conditional
-
-;; move current enum functions into type system in config_validation
-;; look at adding smart documentation fns
-;; conditional predicate i.e. conditional on neighbor or sister config parameters
-;; tighten up unknown-key errors to include information about current parent config
-
 (defn type-doc [parent-type]
   (when-let [[_ _ d] (first (schema-rules [:doc-type parent-type]))]
     d))
@@ -1191,24 +1177,6 @@
          (fn [[k d]] d)
          [[:typ (type-doc parent-type)]
           [:ky  (key-doc parent-type ky)]])))
-
-#_(with-schema (index-spec
-              (concat
-               (doc 'Root "The root doc"
-                    {:fan "How many fans do you have."})
-               (spec 'Boot
-                     {:root (ref-schema 'Rap)}
-                     )
-               (spec 'Rap (ref-schema 'Batt))
-               (spec 'Batt (ref-schema 'Root)))
-              )
-  (type-doc 'Root)
-  (key-doc 'Root :fan)
-  (docs-for 'Boot :root)
-  #_(key-doc 'Boot :root)
-
-  #_(doall (*schema-rules* [:doc-key 'Rap]))
-  )

 ;; building examples from docs

@@ -1306,8 +1274,6 @@
 (def summarize-seq (partial summarize-coll "(" ")" summer-seq))
 (def summarize-set (partial summarize-coll "#{" "}" summer-seq))

-#_(summarize-map {:asdf 4 :asd 6})
-
 (defn summarize-term [v]
   (cond
     (map? v)    "{ ... }"
@@ -1330,12 +1296,6 @@
       (nth res 3)
       res)))

-#_(pprint-document (summarize-value-unwrap-top {:aasdfasdfasdf 1
-                                                :basdfasdfasdf 2
-                                                :casdfasdfasdf 2
-                                                :dasdfasdfasdf 2})
-                   {:width 10})
-
 (defn format-key
   ([k] (pr-str k))
   ([k colr] (color (format-key k) colr)))
@@ -1356,7 +1316,6 @@
    [:nest (inc (count (pr-str ky))) fv]
    (format-under-message message)
    :line])
-

 (defmulti print-error :Error)


Added support for unary negative function.

* now the clojure (- val) function to negate a value can be applied
to ugens inside synth definitions.  It will be converted to the
SuperCollider negation operator, which is special number 0 in
the UnaryOpUgen.

* moving generic ugen ops into the ugen folder... housekeeping.

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

--- src/overtone/sc/ugen/generic_ops.clj
+++ src/overtone/sc/ugen/generic_ops.clj
@@ -0,0 +1,98 @@
+(derive :overtone.sc.ugen/ugen root-type)
+
+(def generics #{"+" "-" "*" "/"})
+
+;; TODO: replace a bunch of this boilerplate with a macro...
+
+(defmethod ga/+ [:overtone.sc.ugen/ugen :overtone.sc.ugen/ugen]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (max (op-rate a) (op-rate b))
+        0
+        (list a b)))
+
+(defmethod ga/+ [:overtone.sc.ugen/ugen root-type]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (op-rate a)
+        0
+        (list a b)))
+
+(defmethod ga/+ [root-type :overtone.sc.ugen/ugen]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (op-rate b)
+        0
+        (list a b)))
+
+(defmethod ga/- :overtone.sc.ugen/ugen
+  [a]
+  (ugen (get UGEN-SPEC-MAP "unaryopugen")
+        (op-rate a)
+        0
+        (list a)))
+
+(defmethod ga/- [:overtone.sc.ugen/ugen :overtone.sc.ugen/ugen]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (max (op-rate a) (op-rate b))
+        1
+        (list a b)))
+
+(defmethod ga/- [:overtone.sc.ugen/ugen root-type]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (op-rate a)
+        1
+        (list a b)))
+
+(defmethod ga/- [root-type :overtone.sc.ugen/ugen]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (op-rate b)
+        1
+        (list a b)))
+
+(defmethod ga/* [:overtone.sc.ugen/ugen :overtone.sc.ugen/ugen]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (max (op-rate a) (op-rate b))
+        2
+        (list a b)))
+
+(defmethod ga/* [:overtone.sc.ugen/ugen root-type]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (op-rate a)
+        2
+        (list a b)))
+
+(defmethod ga/* [root-type :overtone.sc.ugen/ugen]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (op-rate b)
+        2
+        (list a b)))
+
+(def div-meth (var-get (resolve (symbol "clojure.contrib.generic.arithmetic" "/"))))
+
+(defmethod div-meth [:overtone.sc.ugen/ugen :overtone.sc.ugen/ugen]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (max (op-rate a) (op-rate b))
+        4
+        (list a b)))
+
+(defmethod div-meth [:overtone.sc.ugen/ugen root-type]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (op-rate a)
+        4
+        (list a b)))
+
+(defmethod div-meth [root-type :overtone.sc.ugen/ugen]
+  [a b]
+  (ugen (get UGEN-SPEC-MAP "binaryopugen")
+        (op-rate b)
+        4
+        (list a b)))


add getting started to test dir

add getting started to test dir

error: pathspec 'test/getting-started.clj' did not match any file(s) known to git

--- test/getting-started.clj
+++ test/getting-started.clj
@@ -0,0 +1,6 @@
+(use 'overtone.sc)
+(boot)
+(hit) ; makes a test noise
+(hit (now) "kick") ; hits the kick drum right now
+(hit (+ (now) 1000) "kick") ; hits the kick drum in 1 second (1,000 ms)
+(quit)


Remove continuation monad related tests.

--- test/cats/labs/continuation_spec.cljc
+++ test/cats/labs/continuation_spec.cljc
@@ -1,54 +0,0 @@
-(ns cats.labs.continuation-spec
-  #?(:cljs
-     (:require [cljs.test :as t]
-               [cats.builtin :as b]
-               [cats.protocols :as p]
-               [cats.labs.continuation :as cont]
-               [cats.monad.maybe :as maybe]
-               [cats.context :as ctx :include-macros true]
-               [cats.core :as m :include-macros true])
-     :clj
-     (:require [clojure.test :as t]
-               [cats.builtin :as b]
-               [cats.protocols :as p]
-               [cats.labs.continuation :as cont]
-               [cats.monad.maybe :as maybe]
-               [cats.context :as ctx]
-               [cats.core :as m])))
-
-(def cont-42 (cont/continuation (fn [c] (c 42))))
-(def inc-cont-fn (fn [x]
-                   (cont/continuation (fn [c] (c (inc x))))))
-
-(t/deftest first-monad-law-left-identity
-  (t/is (= (cont/run-cont cont-42)
-           (cont/run-cont (ctx/with-context cont/context
-                            (m/>>= (m/return 42)
-                                   (fn [v] (cont/continuation (fn [c] c v)))))))))
-
-
-(t/deftest second-monad-law-right-identity
-  (t/is (= (cont/run-cont cont-42)
-           (cont/run-cont
-            (m/>>= cont-42 m/return)))))
-
-(t/deftest third-monad-law-associativity
-  (t/is (= (cont/run-cont
-            (m/>>= (m/mlet [x  cont-42
-                            y  (inc-cont-fn x)]
-                     (m/return y))
-                   inc-cont-fn))
-           (cont/run-cont
-            (m/>>= cont-42
-                   (fn [x] (m/>>= (cont/continuation (fn [c] (c (inc x))))
-                                  inc-cont-fn)))))))
-
-(t/deftest call-cc-allows-create-resumable-computations
-  (let [cc (atom nil)]
-    (t/is (= 44 (cont/run-cont (m/mlet [x cont-42
-                                        y (cont/call-cc (fn [k]
-                                                          (reset! cc k)
-                                                          (k 2)))]
-                                 (m/return (+ x y))))))
-    (t/is (= 45 (cont/run-cont (@cc 3))))
-    (t/is (= 46 (cont/run-cont (@cc 4))))))


ignoring basic-search for now

ignoring basic-search for now

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


Update deps

Update deps

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


bump version to 3.5.0

bump version to 3.5.0

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


Added specification for Leiningen to run main class so that 'lein run run' will work, as will 'lein run 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/croeder/clojure-koans-work.git/'


Switch to version 0.4.0

Switch to version 0.4.0

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


profile update

profile update

--- .lein/profiles.clj
+++ .lein/profiles.clj
@@ -1,19 +1,20 @@
 {:user
  {:repl-options {:init (set! *print-length* 100)}
   :plugins
-  [
-   [refactor-nrepl "2.0.0-SNAPSHOT"]
-   [cider/cider-nrepl "0.10.0-SNAPSHOT"]
-   [lein-midje "3.1.3"]
+  [[lein-midje "3.2"]
    [lein-try "0.4.1"]
    [lein-marginalia "0.7.1"]
    [lein-bin "0.3.5"]
    [lein-ancient "0.5.4"]
    [jonase/eastwood "0.2.1"]
    [lein-auto "0.1.1"]
+   [lein-shell "0.5.0"]
    ]
   :dependencies
   [[alembic "0.3.2"]
    [criterium "0.4.3"]
-   [org.clojure/tools.nrepl "0.2.11"]
-   ]}}
+   [org.clojure/tools.nrepl "0.2.12"]
+   ]}
+ :repl {:plugins [[refactor-nrepl "2.2.0-SNAPSHOT"]
+                  [cider/cider-nrepl "0.10.2"]
+                  ]}}


brevity

brevity

--- src/cats/core.cljc
+++ src/cats/core.cljc
@@ -504,13 +504,9 @@
   returns a value inside the given monadic context, an initial value, and a
   collection of values, perform a left-associative fold."
   [ctx f z xs]
-  (letfn [(foldm'
-            ([xs']
-             (fn [z'']
-               (foldm' z'' xs')))
-            ([z' xs']
-             (if (empty? xs')
-               (return ctx z')
-               (let [[h & t] xs']
-                 (>>= (f z' h) (foldm' t))))))]
+  (letfn [(foldm' [z' xs']
+            (if (empty? xs')
+              (return ctx z')
+              (let [[h & t] xs']
+                (>>= (f z' h) (fn [z''] (foldm' z'' t))))))]
     (foldm' z xs)))


Change comments at the bottom of db.clj to showcase the with-db macro.

--- src/clojars/db.clj
+++ src/clojars/db.clj
@@ -197,10 +197,10 @@

 (comment
-  (with-connection (:db config) (add-jar "atotx" {:name "test3" :group "test3" :version "1.0"
-                                      :description "An dog awesome and non-existent test jar."
-                                      :homepage "http://clojars.org/"
-                                      :authors ["Alex Osborne"
-                                                "a little fish"]}))
-  (with-connection (:db config) (find-user "atotx"))
+  (with-db (add-jar "atotx" {:name "test3" :group "test3" :version "1.0"
+                             :description "An dog awesome and non-existent test jar."
+                             :homepage "http://clojars.org/"
+                             :authors ["Alex Osborne"
+                                       "a little fish"]}))
+  (with-db (find-user "atotx"))
 )


IDE controller ported from Ruby to Clojure

The framework can't actually evaluate/compile this yet, though

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

--- src/ide_controller.clj
+++ src/ide_controller.clj
@@ -0,0 +1,110 @@
+(use 'computer-build.state-machine 'computer-build.vhdl 'clojure.contrib.pprint)
+
+(def ide-controller (state-machine "ide_controller"
+                                   ; inputs
+                                   {:reset std-logic
+                                    :instr_command (std-logic-vector 7 0)
+                                    :instr_address (std-logic-vector 7 0)
+                                    :instr_data (std-logic-vector 15 0)
+                                    :available_instr std-logic
+                                    :ide_data_in (std-logic-vector 15 0)
+                                    :ide_ready std-logic
+                                    :ide_int_request std-logic
+                                    :ide_16_bit_n std-logic
+                                    :ide_dasp_n std-logic
+                                    }
+                                   ; outpus
+                                   {:result_command (std-logic-vector 7 0)
+                                    :result_status (std-logic-vector 7 0)
+                                    :result_data (std-logic-vector 15 0)
+                                    :read_instr std-logic
+                                    :write_result std-logic
+                                    :ide_reset_n std-logic
+                                    :ide_data_out (std-logic-vector 15 0)
+                                    :ide_data_write_n std-logic
+                                    :ide_data_read_n std-logic
+                                    :ide_address (std-logic-vector 2 0)
+                                    :ide_cs_1f0_n std-logic
+                                    :ide_cs_3f0_n std-logic
+                                    :ide_data_OE std-logic
+                                    }
+                                   ; signals
+                                   {:command_buffer (std-logic-vector 7 0)
+                                    :address_buffer (std-logic-vector 7 0)
+                                    :data_buffer (std-logic-vector 7 0)
+                                    }
+                                   ; reset
+                                   '(
+                                     (goto :wait)
+                                     (low :ide_reset_n)
+                                     (low :read_instr)
+                                     (low :write_result)
+                                     (high :ide_data_write_n)
+                                     (high :ide_data_read_n)
+                                     (high :ide_cs_1f0_n)
+                                     (high :ide_cs_3f0_n)
+                                     (<= :ide_address "000")
+                                     (<= :ide_data_out "0000000000000000")
+                                     (<= :result_command "00000000")
+                                     (<= :result_status "00000000")
+                                     (<= :result_data "0000000000000000")
+                                     )
+                                   ; states
+                                   {:wait
+                                    '(
+                                      (high :ide_reset_n)
+                                      (low :write_result)
+                                      (<= :read_instr, :available_instr))
+                                    :decode
+                                    '(
+                                      (<= :command_buffer :instr_command)
+                                      (<= :address_buffer, :instr_address)
+                                      (<= :data_buffer, :instr_data)
+                                      (low :read_instr)
+                                      (case :instr_command
+                                            "00000000"
+                                            ((<= :result_command, :instr_command)
+                                               (<= :result_status, "00000000")
+                                               (<= :result_data, "0000000000000000"))
+                                            "00000011"
+                                            ((<= :result_command, :instr_command)
+                                               (<= :ide_address 0 :instr_address 0)
+                                               (<= :ide_address 1 :instr_address 1)
+                                               (<= :ide_address 2 :instr_address 2))
+                                            "00000010"
+                                            ((<= :result_command, :instr_command)
+                                               (<= :ide_address 0 :instr_address 0)
+                                               (<= :ide_address 1 :instr_address 1)
+                                               (<= :ide_address 2 :instr_address 2)
+                                               (low :ide_cs_1f0_n))))
+                                    :writestatus
+                                    '(
+                                     (high :write_result)
+                                      (high :ide_cs_1f0_n)
+                                      (high :ide_data_read_n))
+                                    :action
+                                    '(
+                                      (if (equal :instr_command "00000011")
+                                        (<= :result_data :ide_data_in)
+                                        (<= :result_data, "0000000000000000"))
+                                      (low :ide_data_OE))
+                                    :data_on_bus
+                                    '(
+                                      (if (equal :command_buffer, "00000011")
+                                        ((high :ide_data_write_n)
+                                        (low :ide_data_read_n))))}
+                                   ; transitions (from condition to)
+                                   [
+                                    '(:wait (equal :available_instr "1") :decode)
+                                    '(:decode (equal :instr_command "00000000") :writestatus)
+                                    '(:decode (equal :instr_command "00000011") :data_on_bus)
+                                    '(:decode (equal :instr_command "00000010") :data_on_bus)
+                                    '(:writestatus :wait)
+                                    '(:action :writestatus)
+                                    '(:data_on_bus (equal :command_buffer, "00000011") :action)
+                                    ]))
+
+(pprint ide-controller)
+(println "=================")
+(generate-vhdl ide-controller)
+


beginnings of a join model

beginnings of a join model

error: pathspec 'dada2-core/src/test/clojure/org/dada2/test_join_model.clj' did not match any file(s) known to git

--- dada2-core/src/test/clojure/org/dada2/test_join_model.clj
+++ dada2-core/src/test/clojure/org/dada2/test_join_model.clj
@@ -0,0 +1,73 @@
+(ns org.dada2.test-join-model
+    (:use
+     [clojure test]
+     [clojure.tools logging]
+     [org.dada2 core]
+     [org.dada2 test-core]
+     [org.dada2 map-model]
+     ;;[org.dada2 join-model]
+     )
+    (:import
+     [org.dada2.core ModelView])
+    )
+;;--------------------------------------------------------------------------------
+;; impl
+
+(defn join-model [name & args]
+  (map-model name nil nil nil nil nil assoc nil))
+
+;;--------------------------------------------------------------------------------
+;; tests
+
+(defrecord Whale [name ^int version ocean]
+  Object
+  (^String toString [_] (str name)))
+
+(defrecord Ocean [name ^int version area]
+  Object
+  (^String toString [_] (str name)))
+
+(defrecord WhaleAndOcean [whale-name ^int version ocean-area]
+  Object
+  (^String toString [_] (str whale-name)))
+
+(deftest test-join-model
+  (let [model (join-model "join-model")
+	view (test-view "test")
+	;; james (->Employee :james 0 :developer 50)
+	;; john  (->Employee :john 0 :developer 50)
+	;; steve  (->Employee :steve 0 :manager 60)
+	]
+    (attach model view)
+    (is (= {} (data model)))
+    (is (= nil (data view)))
+
+    ;; (on-upsert model james)
+    ;; (let [developer (data view)]
+    ;;   (is (= {:developer developer} (data model)))
+    ;;   (is (= {:james james} (data developer))))
+
+    ;; (on-delete model james)
+    ;; (let [developer (data view)]
+    ;;   (is (= {:developer developer} (data model)))
+    ;;   (is (= {} (data developer))))
+
+    ;; (on-upserts model [john steve])
+    ;; (let [model-data (data model)
+    ;; 	  {developers :developer managers :manager} model-data]
+    ;;   (is (= (count model-data) 2))
+    ;;   (is (= [managers] (data view)))
+    ;;   (is (= {:john john} (data developers)))
+    ;;   (is (= {:steve steve} (data managers)))
+    ;;   )
+
+    ;; (on-deletes model [john steve])
+    ;; (let [model-data (data model)
+    ;; 	  {developers :developer managers :manager} model-data]
+    ;;   (is (= (count model-data) 2))
+    ;;   (is (= [] (data view)))
+    ;;   (is (= {} (data developers)))
+    ;;   (is (= {} (data managers)))
+    ;;   )
+
+    ))


Log-ak kendu

Log-ak kendu

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


add q8

add q8

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


Add user_uuid to TeamMembership schema

Add user_uuid to TeamMembership schema

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


texture code

texture code

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

--- src/cljs/infinitelives/pixi/texture.cljs
+++ src/cljs/infinitelives/pixi/texture.cljs
@@ -0,0 +1,5 @@
+(ns infinitelives.pixi.texture
+  (:require [PIXI]))
+
+(defn sub-texture [texture [x y] [w h]]
+  (PIXI/Texture. texture (PIXI/Rectangle. x y w h)))


semantic rules for attributes added

semantic rules for attributes added

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


Reformat: align modal-content style map

Reformat: align modal-content style 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/Reefersleep/sleepydo.git/'


Function rename

Function rename

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


Updated for turboshrimp 2.0.1.

Updated for turboshrimp 2.0.1.

--- examples/controller.clj
+++ examples/controller.clj
@@ -165,12 +165,8 @@
   (.drawImage g image 0 0 (.getWidth view) (.getHeight view) nil))

-(defn get-video-input-stream [drone]
-  (.getInputStream (Socket. (:hostname drone) ar-drone/default-video-port)))
-
-
 (defn connect-video-controller [ui drone]
-  (let [is (get-video-input-stream drone)
+  (let [is (ar-drone/video-input-stream drone)
         fq (pave/make-frame-queue)
         ^JPanel view (seesaw/select ui [:#video])
         decoder (video/decoder)]


(SERVER-860) Initial commit of JRuby pool tests

Add JRuby pool tests describing the behavior we want from our encapsulated
data structure. These are copied directly from @cprice404's
scratch/master/pool-data-structure branch; they need to be modified some to
pass with the current 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/briancain/puppet-server.git/'


Clean up default app view markup

Clean up default app view markup

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/KurtRMueller/re-frame-template.git/'


sum of powers

sum of powers

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

--- src/hackerrank/functional_programming_the_sums_of_powers.clj
+++ src/hackerrank/functional_programming_the_sums_of_powers.clj
@@ -0,0 +1,27 @@
+(ns hackerrank.functional-programming-the-sums-of-powers)
+
+(defn find-ways
+  [remaining pow cur]
+  (let [raised (Math/pow cur pow)]
+    (cond
+      (> raised remaining) 0
+      (= raised remaining) 1
+      :default
+      (let [rem2 (- remaining raised)
+            fw (partial find-ways rem2 pow)]
+        (reduce + (map fw (range cur)))))))
+
+(defn sum-of-powers
+  [sum power]
+  (let [max-int (int (Math/pow sum (/ 1 power)))
+        fw (partial find-ways sum power)]
+    (reduce + (map fw (range 1 (inc max-int))))))
+
+
+(defn -main
+  []
+  (let [sum (read-string (read-line))
+        power (read-string (read-line))]
+    (println (sum-of-powers sum power))))
+
+


Update static/vendors/ace-builds/demo/kitchen-sink/docs/clojure.clj

Signed-off-by: Bernard Ojengwa <fccb4cc00c1ba7e51bf5c2b5f77130b9fe8d917e@gmail.com>

error: pathspec 'static/vendors/ace-builds/demo/kitchen-sink/docs/clojure.clj' did not match any file(s) known to git

--- static/vendors/ace-builds/demo/kitchen-sink/docs/clojure.clj
+++ static/vendors/ace-builds/demo/kitchen-sink/docs/clojure.clj
@@ -0,0 +1,19 @@
+(defn parting
+  "returns a String parting in a given language"
+  ([] (parting "World"))
+  ([name] (parting name "en"))
+  ([name language]
+    ; condp is similar to a case statement in other languages.
+    ; It is described in more detail later.
+    ; It is used here to take different actions based on whether the
+    ; parameter "language" is set to "en", "es" or something else.
+    (condp = language
+      "en" (str "Goodbye, " name)
+      "es" (str "Adios, " name)
+      (throw (IllegalArgumentException.
+        (str "unsupported language " language))))))
+
+(println (parting)) ; -> Goodbye, World
+(println (parting "Mark")) ; -> Goodbye, Mark
+(println (parting "Mark" "es")) ; -> Adios, Mark
+(println (parting "Mark", "xy")) ; -> java.lang.IllegalArgumentException: unsupported language xy


code fix

code fix

--- src/metabase/api/meta/table.clj
+++ src/metabase/api/meta/table.clj
@@ -26,8 +26,9 @@
     (-> (sel :many Table :active true :db_id [in db-ids] (order :name :ASC))
         (hydrate :db)
         ;; if for some reason a Table doesn't have rows set then set it to 0 so UI doesn't barf
-        (#(map #(cond-> %
-                  (not (:rows %)) (assoc :rows 0))
+        (#(map (fn [table]
+                 (cond-> table
+                   (not (:rows table)) (assoc :rows 0)))
                %)))))


[EN] Make -main spawn message handling loop.

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 data namespace

Add data namespace

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

--- src/cljs/gtfve/data.cljs
+++ src/cljs/gtfve/data.cljs
@@ -0,0 +1,57 @@
+(ns gtfve.data
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]])
+  (:require [cljs.core.async :as async :refer [put! chan <! close!]]
+            [goog.labs.format.csv :as csv]
+            [goog.net.XhrIo :as xhr]))
+
+(defonce feed "gtfs/")
+
+(defn- GET
+  "Use XHR to get URL resource.  Returns a channel for getting response text."
+  [url]
+  (let [ch (chan 1)]
+    (xhr/send url
+              (fn [event]
+                (let [res (-> event .-target .getResponseText)]
+                  (go (>! ch res)
+                      (close! ch)))))
+    ch))
+
+(defn csv->map [csv]
+  (letfn [(drop-empty [hmap]
+            (->> hmap
+                 (filter (fn [[_ v]]
+                           (not (empty? v))))
+                 (into {})))]
+    (let [headers (->> (first csv)
+                       (map keyword))
+          rows (rest csv)]
+      (->> rows
+           (map (partial zipmap headers))
+           (map drop-empty)))))
+
+(go
+  (defonce shapes
+    (->> (<! (GET (str feed "shapes.txt")))
+         (csv/parse)
+         (csv->map)))
+
+  (defonce routes
+    (->> (<! (GET (str feed "routes.txt")))
+         (csv/parse)
+         (csv->map)))
+
+  (defonce stops
+    (->> (<! (GET (str feed "stops.txt")))
+         (csv/parse)
+         (csv->map)))
+
+  (defonce stop-times
+    (->> (<! (GET (str feed "stop_times.txt")))
+         (csv/parse)
+         (csv->map)))
+
+  (defonce trips
+    (->> (<! (GET (str feed "trips.txt")))
+         (csv/parse)
+         (csv->map))))


finish clojure version

finish clojure version

error: pathspec 'Detect-Capital/DC.clj' did not match any file(s) known to git

--- Detect-Capital/DC.clj
+++ Detect-Capital/DC.clj
@@ -0,0 +1,23 @@
+(ns dc
+  (:require [clojure.string :as str]))
+
+(defn upper-case? [a]
+  (if (= (str a) (str/upper-case (str a)))
+    true
+    false))
+
+(defn detectCapitalUse [word]
+  (let [flag (if (and (upper-case? (nth word 0))
+                      (upper-case? (nth word 1)))
+               true
+               false)
+        result (atom true)]
+    (doseq [cha (rest word)
+            :when (not= flag (upper-case? cha))]
+      (reset! result false))
+    result))
+
+(detectCapitalUse "USA")
+(detectCapitalUse "FlaG")
+(detectCapitalUse "ggg")
+


Add problem61.clj

Add problem61.clj

error: pathspec 'euler_clojure/src/euler/problem61.clj' did not match any file(s) known to git

--- euler_clojure/src/euler/problem61.clj
+++ euler_clojure/src/euler/problem61.clj
@@ -0,0 +1,86 @@
+(ns euler.problem61
+  "https://projecteuler.net/problem=61
+
+  Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are
+  all figurate (polygonal) numbers and are generated by the following formulae:
+
+      Triangle   P[3,n]=n(n+1)/2  --> 1, 3, 6, 10, 15, ...
+      Square     P[4,n]=n2        --> 1, 4, 9, 16, 25, ...
+      Pentagonal P[5,n]=n(3n−1)/2 --> 1, 5, 12, 22, 35, ...
+      Hexagonal  P[6,n]=n(2n−1)   --> 1, 6, 15, 28, 45, ...
+      Heptagonal P[7,n]=n(5n−3)/2 --> 1, 7, 18, 34, 55, ...
+      Octagonal  P[8,n]=n(3n−2)   --> 1, 8, 21, 40, 65, ...
+
+  The ordered set of three 4-digit numbers: 8128, 2882, 8281, has
+  three interesting properties.
+
+      1. The set is cyclic, in that the last two digits of each number is the
+      first two digits of the next number (including the last number with the
+      first).
+      2. Each polygonal type: triangle (P[3,127]=8128), square (P[4,91]=8281),
+      and pentagonal (P[5,44]=2882), is represented by a different number in the
+      set.
+      3. This is the only set of 4-digit numbers with this property.
+
+  Find the sum of the only ordered set of six cyclic 4-digit numbers for which
+  each polygonal type: triangle, square, pentagonal, hexagonal, heptagonal, and
+  octagonal, is represented by a different number in the set."
+  (:require [clojure.math.numeric-tower :as math]
+            [clojure.math.combinatorics :as comb]))
+
+(defn triangle   [n] (/ (* n (+ n 1)) 2))
+(defn square     [n] (math/expt n 2))
+(defn pentagonal [n] (/ (* n (- (* 3 n) 1)) 2))
+(defn hexagonal  [n] (* n (- (* 2 n) 1)))
+(defn heptagonal [n] (/ (* n (- (* 5 n) 3)) 2))
+(defn octagonal  [n] (* n (- (* 3 n) 2)))
+
+(defn- check-cyclic
+  "Are these four-digit numbers cyclic?"
+  [x y]
+  (= (subvec (vec (str (int x))) 2 4)
+     (subvec (vec (str (int y))) 0 2)))
+
+(def cyclic? (memoize check-cyclic))
+
+(defn all-cyclic?
+  "Is the set of digits cyclic, including the last number with the first?"
+  [node]
+  (every? #(apply cyclic? %) (for [i (range (count node))]
+                               [(nth node i)
+                                (nth node (mod (+ i 1) (count node)))])))
+
+(defn fourdigit? [n] (= 4 (count (str (int n)))))
+
+(defn fourdigit-polys
+  "Given a function representing a polygonal type, return all four-digit
+  members of that type."
+  [func]
+  (let [dw (drop-while (complement fourdigit?) (for [i (iterate inc 0)] (func i)))]
+    (take-while fourdigit? dw)))
+
+(defn problem61 []
+  ;; For every way to order the polygonal types, perform depth-first search.
+  (let [polys [triangle, square, pentagonal, hexagonal, heptagonal, octagonal]
+        perms (comb/permutations polys)]
+    (some identity ; Returns the first 'truthy' result found.
+      (for [perm perms]
+        ;; We will build up candidate solutions incrementally. The starting
+        ;; frontier is therefore full of one-length vectors of all the four
+        ;; digit numbers for the first polygonal type of this permutation.
+        (loop [frontier (vec (for [x (fourdigit-polys (nth perm 0))] (vector x)))]
+          (let [node (peek frontier)
+                z (count node)]
+            (cond
+              ;; This permutation failed.
+              (empty? frontier)
+              nil
+              ;; Success: evaluate to the sum of the values in this node.
+              (and (= z 6) (all-cyclic? node))
+              (apply + node)
+              ;; Append child nodes to the frontier and continue the search.
+              (< z 6)
+              (let [children (for [y (fourdigit-polys (nth perm z))
+                                   :when (cyclic? (last node) y)]
+                               (conj node y))]
+                (recur (into (pop frontier) (reverse children)))))))))))


fix bug in func call

fix bug in func call

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


Add missing events.clj file.

Add missing events.clj file.

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

--- src/cavm/events.clj
+++ src/cavm/events.clj
@@ -0,0 +1,28 @@
+(ns cavm.events
+  (:require [cavm.json :as json])
+  (:require [com.keminglabs.jetty7-websockets-async.core :refer [configurator]]
+            [clojure.core.async :refer [chan go >! <! >!! thread tap untap mult]]
+            [ring.adapter.jetty :refer [run-jetty]]))
+
+(defn handle-client [notify {in :in}]
+  (let [ev (chan)]
+    (tap notify ev)
+    (go (loop []
+          (let [msg (<! ev)]
+            (if (>! in (json/write-str {:queue msg}))
+              (recur)
+              (untap notify ev)))))))
+
+(defn listen [queue notify c]
+  (go (loop []
+        (let [ws-req (<! c)]
+          (>! (:in ws-req) (json/write-str {:queue @queue}))
+          (handle-client notify ws-req)
+          (recur)))))
+
+(defn jetty-config [queue]
+  (let [c (chan)
+        n (chan)]
+    (add-watch queue :notify (fn [_ _ _ curr] (>!! n curr)))
+    (thread (listen queue (mult n) c))
+    (configurator c {:path "/load-events"})))


fix bad usage of *current-user*

fix bad usage of *current-user*

--- src/metabase/api/org.clj
+++ src/metabase/api/org.clj
@@ -12,7 +12,7 @@

 (defendpoint GET "/" []
-  (if (:is_superuser *current-user*)
+  (if (:is_superuser @*current-user*)
     ;; superusers get all organizations
     (sel :many Org)
     ;; normal users simply see the orgs they are members of
@@ -22,7 +22,7 @@
 (defendpoint POST "/" [:as {{:keys [name slug] :as body} :body}]
   (require-params name slug)
   ;; user must be a superuser to proceed
-  (check-403 (:is_superuser *current-user*))
+  (check-403 (:is_superuser @*current-user*))
   (->> (util/select-non-nil-keys body [:slug :name :description :logo_url])
     (mapply ins Org)))


Got expand-nicknames working.

Got expand-nicknames working.

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


Balanced multi-line titles

Balanced multi-line titles

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


Ensure that :delay-minutes is optional

Ensure that :delay-minutes is optional


Fixed dropdown menu. Added material design dropshadows and some hover effects to buttons.

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/CommonCreative/vbn-website.git/'


Fix some imports

Fix some imports

--- src/clj_http/core2.clj
+++ src/clj_http/core2.clj
@@ -8,8 +8,9 @@
   (:import (java.io FilterInputStream InputStream)
            (java.net URI)
            (java.util Locale)
-           (org.apache.http HttpHost HttpRequest)
-           (org.apache.http.client.methods HttpGet)
+           (org.apache.http HttpEntity HttpHost HttpRequest HttpEntityEnclosingRequest HttpResponse)
+           (org.apache.http.client.methods HttpDelete HttpGet HttpPost HttpPut HttpOptions HttpPatch
+                                           HttpHead HttpEntityEnclosingRequestBase)
            (org.apache.http.client.protocol HttpClientContext)
            (org.apache.http.config RegistryBuilder)
            (org.apache.http.conn HttpClientConnectionManager)
@@ -17,6 +18,7 @@
            (org.apache.http.conn.ssl BrowserCompatHostnameVerifier
                                      SSLConnectionSocketFactory SSLContexts)
            (org.apache.http.conn.socket PlainConnectionSocketFactory)
+           (org.apache.http.entity ByteArrayEntity StringEntity)
            (org.apache.http.impl.client BasicCredentialsProvider
                                         CloseableHttpClient HttpClients)
            (org.apache.http.impl.conn PoolingHttpClientConnectionManager)))


explicitly import java.util.Map

explicitly import java.util.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/michaelsbradleyjr/transwarp.git/'


Add deadline info to context

Add deadline info to context


Add more block separators in the code.

Add more block separators in the 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/tcsavage/cats.git/'


Update schema from merge

Update schema from merge

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


Hash keys are now file paths for quicker matching

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/rcarmo/yaki-clj.git/'


add time-range component

add time-range component

error: pathspec 'src/cljs/searchbot/input/timerange.cljs' did not match any file(s) known to git

--- src/cljs/searchbot/input/timerange.cljs
+++ src/cljs/searchbot/input/timerange.cljs
@@ -0,0 +1,55 @@
+(ns searchbot.input.timerange
+  (:require-macros [cljs.core.async.macros :refer [go alt!]])
+  (:require [om.core :as om :include-macros true]
+            [om-tools.core :refer-macros [defcomponent]]
+            [sablono.core :as html :refer-macros [html]]))
+
+(defcomponent timerange [app owner opts]
+  (init-state [_]
+              {:enabled true
+               :active "1h"
+               :base-date (js/Date.)
+               :predefined [{:name "14 days" :val "14d"}
+                            {:name "7 days" :val "7d"}
+                            {:name "2 days" :val "2d"}
+                            {:name "1 days" :val "1d"}
+                            {:name "12 hrs" :val "12h"}
+                            {:name "4 hrs" :val "4h"}
+                            {:name "2 hrs" :val "2h"}
+                            {:name "1 hr" :val "1h"}]})
+  (render-state [_ {:keys [active base-date predefined]}]
+                (html
+                 [:.row
+                  [:.col
+                   [:.card
+                    [:.card-content
+                     [:.row [:label "Last"]]
+                     (for [p (partition 4 predefined)]
+                       [:.row
+                        [:ul.pagination
+                         (for [v p]
+                           [:li.waves-effect
+                            {:class (if (= active (:val v)) "active")
+                             :on-click (fn [_]
+                                         (om/set-state! owner :active (:val v))
+                                         )}
+                            [:a {:href "#!"}
+                             (:val v)]])
+                         ]])
+                     [:.row
+                      [:label "of"]
+                      [:.col.offset-s1
+                       [:input.datepicker
+                        {:ref "base-date" :type "date"
+                         :placeholder (.toDateString base-date)}]
+                       ]]]]]]))
+  (did-mount [_]
+             (-> (om/get-node owner "base-date")
+                 js/$
+                 (.pickadate (clj->js {:format "yyyy-mm-dd" :max true :min -14
+                                       :onSet (fn [context]
+                                                (if (:select context)
+                                                  (om/set-state! owner :base-date (js/Date. (:select context))))
+                                                )})))
+             )
+  )


add confirmation popup before canceling an order

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


fixing js runtime stacktrace  print outs

fixing js runtime stacktrace  print outs

--- sidecar/src/figwheel_sidecar/repl.clj
+++ sidecar/src/figwheel_sidecar/repl.clj
@@ -14,7 +14,8 @@
    [clojure.tools.nrepl.middleware.interruptible-eval :as nrepl-eval]
    [figwheel-sidecar.components.figwheel-server :as server]

-   [figwheel-sidecar.config :as config])
+   [figwheel-sidecar.config :as config]
+   [clojure.pprint :as pp])
   (:import [clojure.lang IExceptionInfo]))

 ;; slow but works
@@ -82,6 +83,14 @@
         {:host host}
         {:host host :port (Integer/parseInt port)})
       {})))
+
+(defn clean-stacktrace [stack-trace]
+    (map #(update-in % [:file]
+                   (fn [x]
+                     (when (string? x)
+                       (first (string/split x #"\?")))
+                     ))
+       stack-trace))

 (defrecord FigwheelEnv [figwheel-server]
   cljs.repl/IJavaScriptEnv
@@ -107,8 +116,12 @@
   cljs.repl/IPrintStacktrace
   (-print-stacktrace [repl-env stacktrace error build-options]
     (doseq [{:keys [function file url line column] :as line-tr}
-            (filter valid-stack-line? (cljs.repl/mapped-stacktrace stacktrace build-options))]
-      (repl-println "\t" (str function " (" (str (or url file)) ":" line ":" column ")")))))
+            (filter valid-stack-line?
+                    (cljs.repl/mapped-stacktrace (clean-stacktrace stacktrace)
+                                                 build-options))]
+
+      (println "  " (str function " (" (str (or url file)) ":" line ":" column ")")))
+    (flush)))

 (defn repl-env
   ([figwheel-server {:keys [id build-options] :as build}]
@@ -203,20 +216,11 @@

 (defn warning-handler [form opts]
   (fn [warning-type env extra]
-    (when (warning-type cljs.analyzer/*cljs-warnings*)
-      (when-let [s (cljs.analyzer/error-message warning-type extra)]
-        (let [warning-data {:line   (:line env)
-                            :column (:column env)
-                            :ns     (-> env :ns :name)
-                            :file (if (= (-> env :ns :name) 'cljs.core)
-                                    "cljs/core.cljs"
-                                    ana/*cljs-file*)
-                            :source-form   form
-                            :message s
-                            :extra   extra}
-              parsed-warning (cljs-ex/parse-warning warning-data)]
-          (debug-prn (with-color
-                       (cljs-ex/format-warning warning-data))))))))
+    (when-let [warning-data (cljs-ex/extract-warning-data warning-type env extra)]
+      (debug-prn (with-color
+                   (cljs-ex/format-warning (assoc warning-data
+                                                  :source-form form
+                                                  :environment :repl)))))))

 (defn catch-warnings-and-exceptions-eval-cljs
   ([repl-env env form]


clear member email form when value added

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


added p13.clj

added p13.clj

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


refactor db and pathom

refactor db and pathom

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

--- src/main/cawala/api/pathom_test.clj
+++ src/main/cawala/api/pathom_test.clj
@@ -0,0 +1,122 @@
+(ns cawala.api.pathom-test
+  (:require [com.wsscode.pathom.core :as p]
+            [com.wsscode.pathom.connect :as pc]
+            [com.wsscode.pathom.profile :as pp]
+            [clojure.core.async :as a]))
+
+(def product->brand {1 "Taylor"})
+(def brand->id {"Taylor" 44151})
+
+(pc/defresolver latest-product [_ _]
+  {::pc/output [{::latest-product [:product/id :product/title :product/price]}]}
+  {::latest-product {:product/id    1
+                     :product/title "Acoustic Guitar"
+                     :product/price 199.99M}})
+
+(pc/defresolver product-brand [_ {:keys [product/id]}]
+  {::pc/input  #{:product/id}
+   ::pc/output [:product/brand]}
+  {:product/brand (get product->brand id)})
+
+(pc/defresolver brand-id-from-name [_ {:keys [product/brand]}]
+  {::pc/input #{:product/brand}
+   ::pc/output [:product/brand-id]}
+  {:product/brand-id (get brand->id brand)})
+
+(pc/defresolver list-things [_ _]
+  {::pc/output [{:items [:number]}]}
+  {:items [{:number 3}
+           {:number 10}
+           {:number 18}]})
+
+(pc/defresolver slow-resolver [_ input]
+  {::pc/input  #{:number}
+   ::pc/output [:number-added]
+   ::pc/batch? true}
+  (a/go
+    (a/<! (a/timeout 1000))
+    (if (sequential? input)
+      (mapv (fn [v] {:number-added (inc (:number v))}) input)
+      {:number-added (inc (:number input))})))
+
+(pc/defmutation send-message [env {:keys [message/text]}]
+  {::pc/sym    'send-message
+   ::pc/params [:message/text]
+   ::pc/output [:message/id :message/text]}
+  {:message/id   123
+   :message/text text})
+
+(pc/defmutation create-user [{::keys [db]} user]
+  {::pc/sym    'user/create
+   ::pc/params [:user/name :user/email]
+   ::pc/output [:user/id]}
+  (let [{:keys [user/id] :as new-user}
+        (-> user
+            (select-keys [:user/name :user/email])
+            (merge {:user/id (java.util.UUID/randomUUID)
+                    :user/created-at (.toString (java.time.Instant/now))}))]
+    (swap! db assoc-in [:users id] new-user)
+    {:user/id id}))
+
+(pc/defresolver user-data [{::keys [db]} {:keys [user/id]}]
+  {::pc/input  #{:user/id}
+   ::pc/output [:user/id :user/name :user/email :user/created-at]}
+  (get-in @db [:users id]))
+
+(pc/defresolver all-users [{::keys [db]} _]
+  {::pc/output [{:user/all [:user/id :user/name :user/email :user/created-at]}]}
+  (vals (get db :users)))
+
+(pc/defmutation user-create [{::keys [db]} user]
+  {::pc/sym    'user/createAs
+   ::pc/params [:user/name :user/email]
+   ::pc/output [:user/id]}
+  (let [{:keys [user/id] :as new-user}
+        (-> user
+            (select-keys [:user/name :user/email])
+            (merge {:user/id (java.util.UUID/randomUUID)
+                    :user/created-at (.toString (java.time.Instant/now))}))]
+    (swap! db assoc-in [:users id] new-user)
+    {:user/id       id
+     :app/id-remaps {(:user/id user) id}}))
+
+;; resolvers are just maps, we can compose many using sequences
+(def app-registry [latest-product product-brand brand-id-from-name list-things
+                   slow-resolver send-message create-user user-data all-users
+                   user-create])
+
+;; Create a parser that uses the resolvers:
+(def parser
+  (p/parallel-parser
+    {::p/env     {::p/reader [p/map-reader pc/parallel-reader pc/open-ident-reader
+                              p/env-placeholder-reader]
+                  ::pc/mutation-join-globals [:app/id-remaps]
+                  ::p/placeholder-prefixes #{">"}
+                  }
+     ::p/mutate  pc/mutate-async
+     ;; setup connect and use our resolvers
+     ::p/plugins [(pc/connect-plugin {::pc/register app-registry})
+                  p/error-handler-plugin
+                  p/request-cache-plugin
+                  p/trace-plugin]}))
+
+;; note the parallel parser call will return a channel, you must read the value
+;; on it to get the parser results
+
+(comment
+  (def q [{::latest-product [:product/title :product/brand]}])
+  (def q [{::latest-product [:product/title :product/brand-id]}])
+  (def q [{[:product/id 1] [:product/brand]}])
+  (def q [{[:product/brand "Taylor"] [:product/brand-id]}])
+  (def q [{([:customer/id 123] {:pathom/context {:customer/first-name "Foo"
+                                                 :customer/last-name "Bar"}})
+           [:customer/full-name]}])
+  (def q [{:items [:number-added]}])
+  (def q '[(send-message {:message/text "Hello Clojurist!"})])
+  (def q '[{(user/create {:user/name "Rick Sanches" :user/email "rick@morty.com"})
+            [:user/id :user/name :user/created-at]}])
+  (def q '[{(user/create {:user/id "TMP_ID" :user/name "Rick Sanches"
+                          :user/email "rick@morty.com"})
+            [:user/id :user/name :user/created-at]}])
+  (a/<!! (parser {} q))
+)


Needs do

Needs 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/michaelsbradleyjr/shen.clj.git/'


Add failing test for https://github.com/dakrone/clj-http/issues/257

Currently commented out (since it fails)

--- test/clj_http/test/core.clj
+++ test/clj_http/test/core.clj
@@ -24,6 +24,8 @@
   (condp = [(:request-method req) (:uri req)]
     [:get "/get"]
     {:status 200 :body "get"}
+    [:get "/empty"]
+    {:status 200 :body nil}
     [:get "/clojure"]
     {:status 200 :body "{:foo \"bar\" :baz 7M :eggplant {:quux #{1 2 3}}}"
      :headers {"content-type" "application/clojure"}}
@@ -563,3 +565,9 @@
 (deftest ^:integration t-numeric-headers
   (run-server)
   (client/request {:method :get :url (localhost "/get") :headers {"foo" 2}}))
+
+;; Currently failing, see: https://github.com/dakrone/clj-http/issues/257
+;; (deftest ^:integration t-empty-response-coercion
+;;   (run-server)
+;;   (let [resp (client/get (localhost "/empty") {:as :clojure})]
+;;     (is (= (:body resp) ""))))


Add basic test structure + failing test

Add basic test structure + failing test

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

--- test/desdemona/cli_test.clj
+++ test/desdemona/cli_test.clj
@@ -0,0 +1,39 @@
+(ns desdemona.cli-test
+  (:require
+   [desdemona.launcher.aeron-media-driver :as aeron]
+   [clojure.test :refer [deftest testing is]])
+  (:import
+   [java.io StringWriter]))
+
+(def fake-block-forever!
+  (constantly ::blocked-forever))
+
+(defn fake-exit
+  [status]
+  [::exited status])
+
+(defmacro with-fake-launcher-side-effects
+  "Runs body with a fake exit, block-forever! and stdout.
+
+  This assumes you're using com.gfredericks.system-slash-exit, because
+  it's _way_ easier to mock out than the alternative.
+
+  Returns [body-value stdout]. If it would have blocked forever, body-value
+  will be ::blocked-forever. If it would have exited, body-value will
+  be [::exited status]."
+  [& body]
+  `(with-redefs [com.gfredericks.system-slash-exit/exit fake-exit
+                 desdemona.launcher.utils/block-forever! fake-block-forever!]
+     (let [stdout# (StringWriter.)]
+       (binding [*out* stdout#]
+         (let [result# ~@body]
+           [result# (str stdout#)])))))
+
+
+(deftest aeron-main-tests
+  "Tests for the aeron-media-driver main."
+  (testing "usage"
+    (let [[result stdout] (with-fake-launcher-side-effects
+                            (aeron/-main "--help"))]
+      (is (= result 0))
+      (is (= stdout nil)))))


free_word.clj: new namespace

free_word.clj: new namespace

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

--- clojure/org/gavrog/clojure/free_word.clj
+++ clojure/org/gavrog/clojure/free_word.clj
@@ -0,0 +1,44 @@
+(ns org.gavrog.clojure.free-word)
+
+(defn normalise [xs]
+  (assert (every? integer? xs))
+  (reduce (fn [w x]
+            (cond (= 0 x)
+                  w
+                  (= (last w) (- x))
+                  (pop w)
+                  :else
+                  (conj w x)))
+          []
+          xs))
+
+(defn- overlap [w1 w2]
+  (let [n1 (count w1)
+        n2 (count w2)
+        n (min n1 n2)
+        k (some (fn [k] (if (= (- (nth w2 k)) (nth w1 (- (dec n1) k))) nil k))
+                (range n))]
+        (or k n)))
+
+(defn product
+  ([] [])
+  ([w] w)
+  ([w1 w2]
+    (let [k (overlap w1 w2)]
+      (into (subvec w1 0 (- (count w1) k)) (subvec w2 k))))
+  ([w1 w2 & ws]
+    (reduce product (product w1 w2) ws)))
+
+(defn inverse [w]
+  (into [] (map - (reverse w))))
+
+(defn raised-to [w m]
+  (let [n (count w)
+        k (overlap w w)]
+    (if (= k n)
+      (if (odd? m) w [])
+      (let [head (subvec w 0 (- (dec n) k))
+            tail (subvec w (inc k))
+            mid (subvec w k (- n k))]
+        (into (reduce into head (repeat m mid)) tail)))))
+


server clojure code

server clojure 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/sbondaryev/cljs-client-server.git/'


ENH: chapter 6, part 1

ENH: chapter 6, part 1

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

--- src/clj_prj03/ch6_functional.clj
+++ src/clj_prj03/ch6_functional.clj
@@ -0,0 +1,41 @@
+;;; Chapter 6: Functional Programming
+
+;;; Part 1
+
+; Pure Functions
+(get [:chumbawuma] 0)
+(reduce + [1 10 5])
+(str "wax on " "wax off")
+
+; Pure functions
+; * always return the same result given the same arguments
+; ("referential transparency")
+; * don't cause any side effects
+
+;; Section 1.1: Referential Transparency
+(+ 1 2)
+
+; this function is referentially transparent
+(defn wisdom
+  [words]
+  (str words ", Daniel-san"))
+(wisdom "Always bathe on Fridays")
+
+; this isn't:
+(defn year-end-evaluation
+  []
+  (if (> (rand) 0.5)
+    "You get a raise!"
+    "Better luck next year!"))
+
+(defn analysis
+  [text]
+  (str "Character count: " (count text)))
+
+(defn analyze-file
+  [filename]
+  (analysis (slurp filename)))
+
+
+;; Section 1.2: Side Effects
+; Clojure core data structures are all immutable!


trying to add the ability to see just a single users questions

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


Eagerly get emails (for the sake of 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/turbovote-http-api.git/'


Adding Dan's test namespace for hoptree

Adding Dan's test namespace for hoptree

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

--- test/forma/hoptree_test.clj
+++ test/forma/hoptree_test.clj
@@ -0,0 +1,47 @@
+(ns forma.hoptree-test
+  (:use [forma.hoptree] :reload)
+  (:use midje.sweet))
+
+(facts "The number of rows and columns in the global MODIS grid; note
+that the rectangle is twice as wide as it is high."
+  (global-dims "500")  => '(43200 86400)
+  (global-dims "1000") => '(21600 43200))
+
+(facts "TileRowCol* generator should act on a vector of the MODIS tile
+coordinates, as well as the set of individual elements as arguments"
+  (global-index "500" (TileRowCol* [28 8 0 0])) => 1658947200
+  (global-index "500" (TileRowCol* 28 8 0 0))   => 1658947200)
+
+(facts "Given the index calculated in the previous test, the row and
+column should be the same for the same pixel, identified by either its
+tile coordinates or its global index."
+  (global-rowcol "500" (TileRowCol* [28 8 0 0]))  => [19200 67200]
+  (global-rowcol "500" (GlobalIndex* 1658947200)) => [19200 67200])
+
+(facts "Translate a global coordinate to a window coordinate, based on
+the window-map that defines the window; and then translate the window
+coordinate to the global index.  Note that since the method
+`global-index` may not operate on a WindowRowCol. instance, the
+`window-map` argument is optional and appears at the end of the
+argument list (which is a different pattern than the `window-rowcol`
+and `window-index` methods. "
+  (let [window-map {:topleft-rowcol [1 1] :width 4 :height 5}]
+    (window-rowcol "500" window-map (GlobalRowCol* [5 1])) => [4 0]
+    (global-index  "500" (GlobalRowCol* [5 1]))            => 432001
+    (global-index  "500" (WindowRowCol* [4 0]) window-map) => 432001))
+
+(facts "Collect the global indices for the 8 adjacent pixels -- as
+well as the own-pixel index -- for a total of 9 indices"
+  (let [idx-coll (neighbor-idx "500" (GlobalIndex* 432001))]
+
+    (count idx-coll) => 9
+
+    idx-coll => '(345600 345601 345602
+                  432000 432001 432002
+                  518400 518401 518402)
+
+    (let [convert (fn [x] (global-rowcol "500" (GlobalIndex* x)))]
+      (map convert idx-coll) => '([4 0] [4 1] [4 2]
+                                  [5 0] [5 1] [5 2]
+                                  [6 0] [6 1] [6 2]))))
+


add some tests for esconnect/compare-directories

error: pathspec 'test/brainbot/nozzle/esconnect_test.clj' did not match any file(s) known to git

--- test/brainbot/nozzle/esconnect_test.clj
+++ test/brainbot/nozzle/esconnect_test.clj
@@ -0,0 +1,25 @@
+(ns brainbot.nozzle.esconnect-test
+  (:require [clojure.test :refer :all]
+            [brainbot.nozzle.esconnect :refer :all]))
+
+(def dir-listing1
+  [{:type "directory" :id "/a/b"}])
+
+(def dir-listing-with-error
+  [{:type "error" :id "/a/b"}])
+
+(def dir-listing-empty
+  [])
+
+(defn =submap
+  [map submap]
+  (= (select-keys map (keys submap)) submap))
+
+(deftest test-compare-directories
+  (testing "compare-directories basic operations"
+    (is (=submap (compare-directories dir-listing1 [])
+                 {:create-directories dir-listing1}))
+    (is (=submap (compare-directories [] dir-listing1)
+                 {:delete-directories dir-listing1}))
+    (is (=submap (compare-directories dir-listing-with-error dir-listing1)
+                 {:delete-directories []}))))


added lein project file

added lein project file

--HG--
extra : rebase_source : d8cdc82c14735447a90052e65374f83926477333

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

--- sherpa-clojure/project.clj
+++ sherpa-clojure/project.clj
@@ -0,0 +1,31 @@
+(def version "0.1.3-SNAPSHOT")
+
+(defproject com.revelytix/sparql-clojure version
+  :description "Defines a SPARQL client and server processing framework using the SHERPA protocol."
+
+  ;; Project dependencies, resolved via Maven
+  ;; Format is: [<groupId>/<artifactId> "version"]
+  :dependencies [[org.clojure/clojure "1.2.1"]
+                 [org.clojure/clojure-contrib "1.2.0"]
+
+                 ;; revelytix projects
+                 [com.revelytix/sherpa-protocol version]
+                 [com.revelytix/sherpa-java version]]
+
+  :dev-dependencies [[jline "0.9.94"]
+                     [swank-clojure "1.2.1"]
+                     [autodoc "0.8.0-RAS"]]
+
+  ;; Use a Maven-like directory structure
+  :source-path "src/main/clojure"
+  :test-path "src/test/clojure"
+  :resources-path "src/main/resources"
+  :dev-resources-path "src/test/resources"
+  :target-dir "target"
+  :compile-path "target/classes"
+
+  :omit-default-repositories true
+
+  :repositories {"rev-repo" {:url "https://build.knoodel.net/maven-repo/content/groups/public"
+                             :username "revelytix-deploy"
+                             :password "f9uUejDk"}})


Some basic tests of transactions

Some basic tests of transactions

error: pathspec 'test/grafter/rdf/sesame_test.clj' did not match any file(s) known to git

--- test/grafter/rdf/sesame_test.clj
+++ test/grafter/rdf/sesame_test.clj
@@ -0,0 +1,40 @@
+(ns grafter.rdf.sesame-test
+  (:require
+   [grafter.rdf.protocols :as pr]
+   [grafter.rdf :refer :all]
+   [grafter.rdf.ontologies.rdf :refer :all]
+   [grafter.rdf.sesame :refer :all]
+   [clojure.test :refer :all]
+   [me.raynes.fs :as fs]))
+
+(def test-db-path "MyDatabases/test-db")
+
+(def ^:dynamic *test-db* nil)
+
+(defn wrap-with-clean-test-db [f]
+  (try
+    (binding [*test-db* (repo (native-store test-db-path))]
+      (f))
+    (finally
+        (fs/delete-dir test-db-path))))
+
+(deftest with-transaction-test
+  (testing "Transactions return last result of form if there's no error."
+    (is (= :return-value (with-transaction *test-db*
+                           :return-value))))
+  (testing "Adding values in a transaction are visible after the transaction commits."
+    (do
+      (with-transaction *test-db*
+        (pr/add *test-db* (graph "http://example.org/test/graph"
+                                 ["http://test/1" [rdf:a "http://test/Test"]])))
+
+      (is (query *test-db* "ASK WHERE { <http://test/1> ?p ?o }")))))
+
+(deftest import-graph
+  (testing "Importing graph"
+
+    ;(import-graph test-db "http://example.org/my-graph" "drafter-live.ttl")
+    )
+  )
+
+(use-fixtures :each wrap-with-clean-test-db)


Add cljs konserve main test.

Add cljs konserve main test.

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

--- test/konserve/konserve_test.cljs
+++ test/konserve/konserve_test.cljs
@@ -0,0 +1,8 @@
+(ns konserve.konserve-test
+  (:require [cljs.test :refer [run-tests]]
+            [konserve.filestore-test]
+            [konserve.serializers-test]))
+
+(run-tests 'konserve.filestore-test
+           'konserve.serializers-test)
+


Fix Query Test

Fix Query Test

--- test/metabase/api/query_test.clj
+++ test/metabase/api/query_test.clj
@@ -3,7 +3,8 @@
   (:require [expectations :refer :all]
             [korma.core :refer :all]
             [metabase.db :refer :all]
-            (metabase.models [query :refer [Query]]
+            (metabase.models [database :refer [Database]]
+                             [query :refer [Query]]
                              [query-execution :refer [QueryExecution]])
             [metabase.test.util :refer [match-$ random-name expect-eval-actual-first]]
             [metabase.test-data :refer :all]))
@@ -16,7 +17,7 @@
                                                   kwargs)))

 ;; ## GET /api/query/form_input
-(expect
+(expect-eval-actual-first
     {:databases [(match-$ @test-db
                    {:id $
                     :name "Test Database"})]
@@ -33,7 +34,10 @@
      :permissions [{:name "None",         :id 0}
                    {:name "Read Only",    :id 1}
                    {:name "Read & Write", :id 2}]}
-  ((user->client :rasta) :get 200 "query/form_input" :org (:id @test-org)))
+  (do
+    @test-db                                                                             ; force lazy creation of test data / Metabase DB if it doesn't already exist
+    (cascade-delete Database :organization_id (:id @test-org) :id [not= (:id @test-db)]) ; delete any other rando test DBs made by other tests
+    ((user->client :rasta) :get 200 "query/form_input" :org (:id @test-org))))

 ;; ## POST /api/query (create)
 ;; Check that we can save a Query


cider is looking for shadow.repl

cider is looking for shadow.repl

bring it back empty for now, it just checks for the ns presence

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

--- src/main/shadow/repl.clj
+++ src/main/shadow/repl.clj
@@ -0,0 +1 @@
+(ns shadow.repl)


Azken liburuak datu gehiago

Azken liburuak datu gehiago

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


confidence

confidence

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


defining an insert-user<! function which uses the insert-user sql script

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

--- src/bitfondue/database.clj
+++ src/bitfondue/database.clj
@@ -0,0 +1,5 @@
+(ns bitfondue.database
+  (:require [yesql.core :refer [defquery]]))
+
+(defquery insert-user<! "bitfondue/sql/insert-user.sql")
+


Straighten the API of the heading function

--- src/catalog/layout/fop.clj
+++ src/catalog/layout/fop.clj
@@ -49,13 +49,13 @@
     (str (string/join "." numbers) ". ")))

 (defn heading
-  ([level title path]
-   (heading level title path []))
-  ([level title path numbers]
+  ([level path]
+   (heading level path []))
+  ([level path numbers]
    [:fo:block (style level
                      {:id (hash path)})
     (section-numbers numbers)
-    (layout/translations title)]))
+    (layout/translations (last path))]))

 (def ^:private running-header-class-name "running-header")

@@ -109,7 +109,7 @@
   (when (map? items)
     [:fo:block {:line-height "150%"
                 :role "TOC"}
-     (when heading? (heading :h1 :inhalt []))
+     (when heading? (heading :h1 [:inhalt]))
      (map-indexed #(toc-entry (get items %2) (conj path %2) (if numbered? [(inc %1)] []) depth) (order (keys items)))]))

 (defn- to-url
@@ -286,7 +286,7 @@
   (keyword (str "h" level)))

 (defn subgenre-sexp [items fmt genre subgenre level numbers]
-  [(heading (level-to-h level) subgenre [fmt genre subgenre] numbers)
+  [(heading (level-to-h level) [fmt genre subgenre] numbers)
    (when-not (#{:kinder-und-jugendbücher} genre)
      (set-marker (layout/translations subgenre)))
    (entries-sexp items)])
@@ -300,7 +300,7 @@
   ([items fmt genre level]
    (genre-sexp items fmt genre level []))
   ([items fmt genre level numbers]
-   [(heading (level-to-h level) genre [fmt genre] numbers)
+   [(heading (level-to-h level) [fmt genre] numbers)
     (set-marker (layout/translations genre))
     (cond
       ;; handle the special case where the editorial or the recommendations are passed in the tree
@@ -310,7 +310,7 @@
       :else (entries-sexp items))]))

 (defn format-sexp [items fmt level]
-  [(heading (level-to-h level) fmt [fmt])
+  [(heading (level-to-h level) [fmt])
    (toc items [fmt] 2)
    (set-marker (layout/translations fmt))
    (case fmt
@@ -470,13 +470,13 @@
            ;; so that they are displayed in the toc
            (toc [] 3 :heading? true :numbered? true))
        (block {:break-before "odd-page"}) ;; the very first format should start on recto
-       (heading :h1 :editorial [:editorial] [1])
+       (heading :h1 [:editorial] [1])
        (md-to-fop editorial)
-       (heading :h1 :hörbuch [:hörbuch] [2])
+       (heading :h1 [:hörbuch] [2])
        (letfn [(numbered-genre [number genre]
                  (genre-sexp (get subitems genre) fmt genre 2 (add-number [2] number)))]
          (apply concat (map-indexed #(numbered-genre %1 %2) (order (keys subitems)))))
-       (heading :h1 :recommendations [:recommendations] [3])
+       (heading :h1 [:recommendations] [3])
        (md-to-fop recommendations)])]])

 (defmethod document-sexp :all-formats


remove debugging prints

remove debugging prints

error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403
fatal: the remote end hung up unexpectedly


rev merge/assoc helper

rev merge/assoc helper

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


don't need to refer ejected-allocate* into core ns


consistent ts/cs tests, use of rest/next


WIP, but it works o_O

WIP, but it works o_O

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

--- src/clj/runbld/results.clj
+++ src/clj/runbld/results.clj
@@ -0,0 +1,88 @@
+(ns runbld.results
+  (:require [clojure.spec :as s]
+            [runbld.schema])
+  (:require [elasticsearch.document :as es.doc]
+            [elasticsearch.connection.http :as es.conn]
+            [runbld.store :as store]))
+
+(def T
+  (name runbld.schema/DocType))
+
+(defn gradle-went-wrong [conn idx build-id]
+  (let [q {:query
+           {:bool
+            {:must [{:match {:log "what went wrong"}}
+                    {:match {:build-id build-id}}]}}
+           :size 1}
+        res (-> (es.doc/search conn idx T {:body q})
+                :hits :hits first :_source)]
+    #_(clojure.pprint/pprint
+       ['went-wrong res])
+    res))
+
+(defn gradle-went-wrong-line [conn idx build-id]
+  (when-let [ord (-> (gradle-went-wrong conn idx build-id) :ord :total)]
+    ord))
+
+(defn gradle-failed-task [conn idx build-id]
+  (let [went-wrong-line (gradle-went-wrong-line conn idx build-id)
+        q {:query
+           {:bool
+            {:must
+             [{:match {:build-id build-id}}
+              {:match {:stream :stderr}}
+              {:match {:log "execution failed"}}
+              {:range
+               {:ord.total
+                {:gte (inc went-wrong-line)}}}]}}
+           :sort {:ord.total :asc}
+           :size 1}
+        res (es.doc/search conn idx {:body q})]
+    (when-let [log (-> res :hits :hits first :_source :log)]
+      (let [[_ taskname] (re-find #"'([^']+)'" log)]
+        taskname))))
+
+(defn gradle-failed-task-begin [conn idx build-id task]
+  (when task
+    (let [q {:query
+             {:bool
+              {:must
+               [{:match {:build-id build-id}}
+                #_{:match {:stream :stderr}}
+                {:match {:log task}}
+                {:match {:log "started"}}]}}
+             :size 1}
+          res (es.doc/search conn idx {:body q})]
+      (-> res :hits :hits first :_source :ord :total))))
+
+(defn gradle-failed-task-end [conn idx build-id task]
+  (when task
+    (let [q {:query
+             {:bool
+              {:must
+               [{:match {:build-id build-id}}
+                #_{:match {:stream :stderr}}
+                {:match {:log task}}
+                {:match {:log "completed"}}]}}
+             :size 1}
+          res (es.doc/search conn idx {:body q})]
+      (-> res :hits :hits first :_source :ord :total))))
+
+(defn gradle-failure-lines [conn idx build-id]
+  (let [task (gradle-failed-task conn idx build-id)
+        start-line (gradle-failed-task-begin conn idx build-id task)
+        end-line (gradle-failed-task-end conn idx build-id task)]
+    (when (and task start-line end-line)
+      (let [q {:query
+               {:bool
+                {:must
+                 [{:match {:build-id build-id}}
+                  {:range
+                   {:ord.total {:gte start-line
+                                :lte end-line}}}]}}
+               :size 500
+               :sort {:ord.total :asc}}
+            res (es.doc/search conn idx {:body q})]
+        (->> (-> res :hits :hits)
+             (map :_source)
+             (map :log))))))


setup core-mutate

setup core-mutate


own ajax wip based on hs comm

own ajax wip based on hs comm

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

--- src/cljs/unfolds/ajax.cljs
+++ src/cljs/unfolds/ajax.cljs
@@ -0,0 +1,26 @@
+(ns unfolds.ajax
+  (:require goog.net.XhrIo
+            goog.net.EventType
+            goog.events))
+
+;; based on
+;; https://github.com/swannodette/om-sync/blob/master/src/om_sync/util.cljs
+;; https://github.com/hackerschool/community/blob/master/client/src/community/util/ajax.cljs
+
+;; or this
+;; (defn edn-xhr [{:keys [method url data on-complete on-error]}]
+;; what is data here? more custom I guess, pr-str data
+;; json makes more sense as default, even if drop-in to transit out whatever
+;; web standard, clearer (un)marshalling
+
+
+(defn request [url {:keys [method on-success on-error headers params]
+                    :or {method "GET"
+                         on-success identity ;; implies what?
+                         on-error identity
+                         headers {}}}]
+  (let [xhr (goog.net.XhrIo.)
+        stringifed-params (if params
+                            (.stringify js/JSON (clj->js params))
+                            nil)]
+    ))


Use quad-trees to (hilariously inefficiently) find the nearest train when mousing over.

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


Refactoring api.web => api.server 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/physion/ovation-webapi.git/'


Fix test failing due to group ordering change

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


Saioa hastean gogoko liburuak lortu

Saioa hastean gogoko liburuak lortu


[#333] PR housekeeping

[#333] PR housekeeping

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


update vertex in mql

update vertex in mql

error: pathspec 'src/clj/morpheus/query/lang/update.clj' did not match any file(s) known to git

--- src/clj/morpheus/query/lang/update.clj
+++ src/clj/morpheus/query/lang/update.clj
@@ -0,0 +1,21 @@
+(ns morpheus.query.lang.update
+  (:require [morpheus.query.lang.AST :as AST]
+            [morpheus.models.vertex.core :as vertex]
+            [morpheus.models.edge.core :as edge]
+            [neb.utils :refer [map-on-keys]]))
+
+(defn update-vertex* [vertex field-exp-map]
+  (loop [exp-pairs field-exp-map
+         vertex-to-update vertex]
+    (if (empty? exp-pairs)
+      vertex-to-update
+      (let [[k exp] (first exp-pairs)]
+        (recur (rest exp-pairs)
+               (assoc-in vertex-to-update k
+                         (AST/eval-with-data vertex exp)))))))
+
+(defn update-vertex [vertex field-exp-map]
+  (vertex/update-vertex!
+    vertex
+    'morpheus.query.lang.update/update-vertex*
+    (map-on-keys AST/parse-map-path field-exp-map)))