Adding zipper-based autoconstruction.

Adding zipper-based autoconstruction.

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

--- src/clojush/experimental/zipper_autoconstruction.clj
+++ src/clojush/experimental/zipper_autoconstruction.clj
@@ -0,0 +1,321 @@
+;; Zipper-based Autoconstructive Evolution
+;; by Kyle Harrington, 2011-2012.
+;;
+;; Note: experimental and under development.
+;;
+;; Harrington, K., E. Tosch, L. Spector, and J. Pollack, (2011)
+;; "Compositional Autoconstructive Dynamics".
+;; In Unifying Themes in Complex Systems Volume VIII: Proceedings of the Eighth International Conference on Complex Systems, pp. 856-870.
+;; http://necsi.edu/events/iccs2011/papers/294.pdf
+;;
+;; Harrington, K. I., L. Spector, J. B. Pollack, and U.M. O'Reilly, (2012)
+;; "Autoconstructive Evolution for Structural Problems".
+;; In ECADA Workshop, Workshop Proceedings of the Genetic and Evolutionary Computation Conference (GECCO-2012), pp. 75-82.
+;; http://pages.cs.brandeis.edu/~kyleh/autogecco2012.pdf
+
+(ns clojush.experimental.zipper-autoconstruction
+  (:use [clojush.globals]
+        [clojush.pushstate]
+	[clojush.util]
+        [clojush.random]
+	[clojush.interpreter]
+        [clojush.instructions.boolean]
+        [clojush.instructions.code]
+        [clojush.instructions.common]
+        [clojush.instructions.numbers]
+        [clojush.instructions.random]
+        [clojush.instructions.string]
+        [clojush.instructions.tag]
+        [clojush.instructions.zip]
+        [clojush.individual]
+        [clojush.evaluate]
+	[clojush.node-selection]
+        [clojush.pushgp.breed]
+        [clojush.pushgp.parent-selection]
+        [clojush.pushgp.report]
+	[clojush.experimental.overlap])
+  (:require [clojure.zip :as zip]))
+
+(def maintain-parents-only true) ;; if true saves only the immediate parents of each individual
+
+(def autoconstructive-atom-generators (list ;'exec_if
+                                            'zip_down ;'zip_up
+                                            'zip_left
+                                            'zip_right ;'zip_rightmost
+                                            ;'zip_shift_right 'zip_shift_left
+                                            ;'zip_rotate_right 'zip_rotate_left
+                                            ;'zip_subtree_dup
+					    ;'zip_remove
+                                            ;'autoconstructing
+                                            ;'zip_reverse
+                                            'zip_rand
+                                            'zip_root
+                                            'zip_rloc 'zip_rrloc))
+
+(def recombinatory-autoconstructive-atom-generators (list 'zip_swap 'zip_subtree_swap))
+#_(def recombinatory-autoconstructive-atom-generators (list 'zip_swap 'zip_subtree_swap
+							  'zip_subtree_swap_bigger))
+
+(defn num-els-stack
+  "Returns the number of elements on a stack."
+  [type state]
+  (count (state type)))
+
+(defn n-on-stack?
+  "Boolean check if there are at least n elements on the specified stack."
+  [n type state]
+  (>= (num-els-stack type state) n))
+
+(defn lt-n-on-stack?
+  "Boolean check if there are fewer than n elements on the specified stack."
+  [n type state]
+  (< (num-els-stack type state) n))
+
+;; Zipper manipulation instructions
+
+(defn rcons
+  [item col]
+  (reverse (cons item (reverse col))))
+
+(defn left-rotation
+  [tree]
+  (if (and (seq? tree)
+	   (not (empty? tree))
+	   (seq? (last tree))
+	   (not (empty? (last tree))))
+    (let [newroot (if (seq? (last tree)) (last tree) (list (last tree)))]
+      (cons (rcons (first newroot)
+		   (butlast tree))
+	    (rest newroot)))
+    tree))
+
+(defn right-rotation
+  [tree]
+  (if (and (seq? tree)
+	   (not (empty? tree))
+	   (seq? (first tree))
+	   (not (empty? (first tree))))
+    (let [newroot (if (seq? (first tree)) (first tree) (list (first tree)))]
+      (rcons (cons (last newroot)
+		   (rest tree))
+	     (butlast newroot)))
+    tree))
+
+(defn left-shift
+  [tree]
+  (if (and (seq? tree)
+	   (not (empty? tree)))
+    (rcons (first tree) (rest tree))
+    tree))
+
+(defn right-shift
+  [tree]
+  (if (and (seq? tree)
+	   (not (empty? tree)))
+    (cons (last tree) (butlast tree))
+    tree))
+
+(defn subtree-dup
+  [tree]
+  (list tree tree))
+
+(defn subtree-reverse
+  [tree]
+  (reverse tree))
+
+(defn zip-modifier
+  [modifier-fn]
+  (fn [state]
+    (if (or (empty? (:zip state))
+	    (not (seq? (zip/node (top-item :zip state))))
+	    (empty? (zip/node (top-item :zip state))))
+      state
+      (let [new-zip-top (zip/replace (top-item :zip state)
+				     (modifier-fn (zip/node (top-item :zip state))))]
+	(if (> (count-points (zip/root new-zip-top)) @global-max-points-in-program)
+	  state
+	  (push-item new-zip-top
+		     :zip (pop-item :zip state)))))))
+
+(define-registered zip_rotate_left (zip-modifier left-rotation))
+(define-registered zip_rotate_right (zip-modifier right-rotation))
+(define-registered zip_shift_left (zip-modifier left-shift))
+(define-registered zip_shift_right (zip-modifier right-shift))
+(define-registered zip_subtree_dup (zip-modifier subtree-dup))
+(define-registered zip_reverse (zip-modifier subtree-reverse))
+
+;; Swap the subtrees at the location of the top 2 zip items
+(define-registered zip_subtree_swap
+  (fn [state]
+    (if (n-on-stack? 2 :zip state)
+      (let [first-zip (top-item :zip state)
+	    second-zip (top-item :zip (pop-item :zip state))
+	    new-first (zip/replace first-zip (zip/node second-zip))
+	    new-second (zip/replace second-zip (zip/node first-zip))]
+	(push-item new-second :zip
+		   (push-item new-first :zip
+			      (pop-item :zip
+					(pop-item :zip state)))))
+      state)))
+
+(define-registered zip_subtree_swap_bigger
+  (fn [state]
+    (if (n-on-stack? 2 :zip state)
+      (let [first-zip (top-item :zip state)
+	    second-zip (top-item :zip (pop-item :zip state))
+	    subtrees (sort-by count-points [(zip/node second-zip) (zip/node first-zip)])
+	    new-first (zip/replace first-zip (last subtrees))
+	    new-second (zip/replace second-zip (first subtrees))]
+	(push-item new-second :zip
+		   (push-item new-first :zip
+			      (pop-item :zip
+					(pop-item :zip state)))))
+      state)))
+
+(define-registered zip_subtree_swap_smaller
+  (fn [state]
+    (if (n-on-stack? 2 :zip state)
+      (let [first-zip (top-item :zip state)
+	    second-zip (top-item :zip (pop-item :zip state))
+	    subtrees (sort-by count-points [(zip/node second-zip) (zip/node first-zip)])
+	    new-first (zip/replace first-zip (first subtrees))
+	    new-second (zip/replace second-zip (last subtrees))]
+	(push-item new-second :zip
+		   (push-item new-first :zip
+			      (pop-item :zip
+					(pop-item :zip state)))))
+      state)))
+
+(define-registered zip_subtree_from_second
+  (fn [state]
+    (if (n-on-stack? 2 :zip state)
+      (let [first-zip (top-item :zip state)
+	    second-zip (top-item :zip (pop-item :zip state))
+	    new-first (zip/replace first-zip (zip/node second-zip))]
+	(push-item second-zip :zip
+		   (push-item new-first :zip
+			      (pop-item :zip
+					(pop-item :zip state)))))
+      state)))
+
+(define-registered zip_rloc
+  (fn [state]
+    (if (n-on-stack? 1 :zip state)
+      (if (or (not (seq? (zip/node (top-item :zip state))))
+              (empty? (zip/node (top-item :zip state))))
+        state
+        (let [top-zip (top-item :zip state)
+              next-zip (loop [z top-zip
+                              c (select-node-index (zip/node top-zip))]
+                         (if (zero? c)
+                           z
+                           (recur (zip/next z) (dec c))))]
+          (push-item next-zip :zip
+                     (pop-item :zip state)))))))
+
+(define-registered zip_rrloc
+  (fn [state]
+    (if (n-on-stack? 1 :zip state)
+      (if (or (not (seq? (zip/node (top-item :zip state))))
+              (empty? (zip/node (top-item :zip state))))
+        state
+        (let [top-zip (zip/seq-zip (zip/root (top-item :zip state)))
+              next-zip (loop [z top-zip
+                              c (select-node-index (zip/node top-zip))]
+                         (if (zero? c)
+                           z
+                           (recur (zip/next z) (dec c))))]
+          (push-item next-zip :zip
+                     (pop-item :zip state)))))))
+
+(define-registered zip_root
+  (fn [state]
+    (if (n-on-stack? 1 :zip state)
+      (if (or (not (seq? (zip/node (top-item :zip state))))
+              (empty? (zip/node (top-item :zip state))))
+        state
+	(push-item (zip/seq-zip (zip/root (top-item :zip state)))
+		   :zip (pop-item :zip state))))))
+
+
+(define-registered zip_rand
+  (fn [state]
+					;    (if (n-on-stack? 1 :zip state)
+    (if-not (empty? (:zip state))
+      (if (or (not (seq? (zip/node (top-item :zip state))))
+              (empty? (zip/node (top-item :zip state))))
+        state
+        (let [top-zip (top-item :zip state)
+              zip-points (count-points (zip/root top-zip))
+              max-subtree-points (- @global-max-points-in-program zip-points)]
+          (push-item (zip/replace top-zip
+                                  (random-code max-subtree-points
+                                               @global-atom-generators))
+                     :zip (pop-item :zip state))))
+      state)))
+
+(def global-ace-atom-generators
+     (concat autoconstructive-atom-generators
+	     recombinatory-autoconstructive-atom-generators))
+
+(defn verify-composition
+  "Verify that the program is valid."
+  [composition-product max-points]
+  (if (or (= :no-stack-item composition-product)
+          (nil? composition-product))
+    :no-program
+    (let [program (zip/root composition-product)]
+      (if (not (seq? program))
+        :single-instruction
+	(cond (> (count-points program) max-points)
+	      :oversize
+	      (= '() program)
+	      :empty-program
+	      (nil? program)
+	      :nil-program
+	      :else
+	      program)))))
+
+(define-registered autoconstructing
+  (fn [state]
+    (push-item (not (nil? (state :autoconstructing))) :boolean state)))
+
+(defn autoconstruct
+  "Get the product of zipper autoconstruction."
+  [autoconstruction-program max-points]
+  (let [state (run-push autoconstruction-program (assoc (make-push-state)
+                                                   :autoconstructing true)
+			)]
+    (verify-composition (top-item :zip state) max-points)))
+
+(defn autoconstructive-mutate
+  "Returns an unvaried child with incremented ancestry."
+  [max-points parent1 parent2]
+  (let [composition-program (concat (cons 'zip_fromexec (list (:program parent2)))
+				    (filter #(not (number? %)) (ensure-list (:program parent1))))
+	product (autoconstruct composition-program max-points)]
+    (if (nil? product)
+      parent1
+      (make-individual :program product :history (:history parent1)
+		       :ancestors (if maintain-ancestors
+				    (if maintain-parents-only
+				      [(:program parent1) (:program parent2)]
+				      (cons (:program parent1) (:ancestors parent1)))
+				    (:ancestors parent1))))))
+
+(defn autoconstructive-crossover
+  "Returns an unvaried child with incremented ancestry."
+  [max-points parent1 parent2]
+  (let [composition-program (concat (cons 'zip_fromexec (list (:program parent1)))
+				    (cons 'zip_fromexec (list (:program parent2)))
+				    (filter #(not (number? %)) (ensure-list (:program parent1))))
+	product (autoconstruct composition-program max-points)]
+    (if (nil? product)
+      parent1
+      (make-individual :program product :history (:history parent1)
+		       :ancestors (if maintain-ancestors
+				    (if maintain-parents-only
+				      [(:program parent1) (:program parent2)]
+				      (cons (:program parent1) (:ancestors parent1)))
+				    (:ancestors parent1))))))
+


Updating the max number of retries to 1. We'll retry just for the sake of (hopefully) trying on another node.

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


Removed empty Clojure solution

Removed empty Clojure solution

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/wtok/project-euler.git/'


clean up

clean up

/bin/sh: 1: Syntax error: "(" unexpected


Coerce language to a keyword when passed to any endpoint

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


Basic map functionality benchmark tests

Basic map functionality benchmark tests

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

--- bench/cljs/fast_map/bench.cljs
+++ bench/cljs/fast_map/bench.cljs
@@ -0,0 +1,94 @@
+(ns cljs.fast-map.bench)
+
+(def small-map-size 100)
+(def small-map-sample 2000)
+
+(def medium-map-size 4000)
+(def medium-map-sample 50)
+
+(def large-map-size 10000)
+(def large-map-sample 20)
+
+(def size->sample
+  {small-map-size small-map-sample
+   medium-map-size medium-map-sample
+   large-map-size large-map-sample})
+
+(defn sized-map [m n]
+  (loop [m m i 0]
+    (if (< i n)
+      (recur (assoc m (str "key" i) i) (inc i))
+      m)))
+
+(defmulti map-bench
+  (fn [benchmark _ _] benchmark))
+
+(defmethod map-bench :assoc [_ m _]
+  (doseq [[size sample] size->sample]
+    (simple-benchmark [] (sized-map m size) sample)))
+
+(defmethod map-bench :dissoc [_ _ {:keys [small-map medium-map large-map]}]
+  (let [maps [small-map medium-map large-map]
+        samples [small-map-sample medium-map-sample large-map-sample]]
+    (doseq [[m sample] (partition 2 (interleave maps samples))]
+     (simple-benchmark
+       []
+       (loop [m m i (count m)]
+         (when (> i 0)
+           (recur (dissoc m (str "key" i)) (dec i))))
+       sample))))
+
+(defmethod map-bench :dissoc-fail [_ _ {:keys [small-map medium-map large-map]}]
+  (let [maps [small-map medium-map large-map]
+        samples [small-map-sample medium-map-sample large-map-sample]]
+    (doseq [[m sample] (partition 2 (interleave maps samples))]
+      (simple-benchmark
+        []
+        (loop [m m i (count m)]
+          (when (> i 0)
+            (recur (dissoc m (str "not-a-key" i)) (dec i))))
+        sample))))
+
+(defmethod map-bench :hash [_ _ {:keys [small-map medium-map large-map]}]
+  (let [maps [small-map medium-map large-map]
+        samples [small-map-sample medium-map-sample large-map-sample]]
+    (doseq [[m sample] (partition 2 (interleave maps samples))]
+      (simple-benchmark [] (hash-unordered-coll m) sample))))
+
+(defmethod map-bench :equals [_ _ {:keys [small-map medium-map large-map]}]
+  (let [maps [small-map medium-map large-map]
+        samples [small-map-sample medium-map-sample large-map-sample]]
+    (doseq [[m sample] (partition 2 (interleave maps samples))]
+      (let [cm (clone m)]
+        (simple-benchmark [] (= m cm) sample)))))
+
+(defmethod map-bench :equals-fail [_ _ {:keys [small-map medium-map large-map]}]
+  (let [maps [small-map medium-map large-map]
+        samples [small-map-sample medium-map-sample large-map-sample]]
+    (doseq [[m sample] (partition 2 (interleave maps samples))]
+      (let [neq-m (assoc m (js-obj) 0)]
+        (simple-benchmark [] (= m neq-m) sample)))))
+
+(defmethod map-bench :sequence [_ _ {:keys [small-map medium-map large-map]}]
+  (let [maps [small-map medium-map large-map]
+        samples [small-map-sample medium-map-sample large-map-sample]]
+    (doseq [[m sample] (partition 2 (interleave maps samples))]
+      (simple-benchmark [] (doseq [[k v] m] [v k]) sample))))
+
+(defmethod map-bench :reduce [_ _ {:keys [small-map medium-map large-map]}]
+  (let [maps [small-map medium-map large-map]
+        samples [small-map-sample medium-map-sample large-map-sample]]
+    (doseq [[m sample] (partition 2 (interleave maps samples))]
+      (simple-benchmark [] (reduce (fn [sum [k v]] (+ 1 sum)) 0 m) sample))))
+
+(defn run-benchmarks [benchmarks empty-map data]
+  (doseq [benchmark benchmarks]
+    (map-bench benchmark empty-map data)))
+
+(comment
+  (let [benchmarks  [:assoc :dissoc :dissoc-fail :hash :equals :equals-fail :sequence :reduce]
+        empty-map (empty {})
+        data {:small-map (sized-map empty-map small-map-size)
+              :medium-map (sized-map empty-map medium-map-size)
+              :large-map (sized-map empty-map large-map-size)}]
+    (run-benchmarks benchmarks empty-map data)))


add project.clj

add project.clj

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


Add compact message signing implementation.

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

--- src/buddy/sign/compact.clj
+++ src/buddy/sign/compact.clj
@@ -0,0 +1,114 @@
+;; Copyright (c) 2014-2015 Andrey Antukh <niwi@niwi.be>
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License")
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;;     http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
+(ns buddy.sign.compact
+  "Compact high level message signing implementation.
+
+  It has high influence by django's cryptographic library
+  and json web signature/encryption but with focus on have
+  a compact representation. It's build on top of fantastic
+  ptaoussanis/nippy serialization library.
+
+  This singing implementation is not very efficient with
+  small messages, but is very space efficient with big
+  messages.
+
+  The purpose of this implementation is for secure message
+  transfer, is not really good candidate for auth token
+  because of not good space efficiency for small messages."
+  (:require [buddy.core.codecs :as codecs]
+            [buddy.core.keys :as keys]
+            [buddy.core.mac.hmac :as hmac]
+            [buddy.core.mac.poly1305 :as poly]
+            [buddy.core.nonce :as nonce]
+            [clojure.string :as str]
+            [taoensso.nippy :as nippy]
+            [taoensso.nippy.compression :as nippycompress]
+            [cats.monad.either :as either])
+  (:import clojure.lang.Keyword))
+
+(def ^{:doc "List of supported signing algorithms"
+       :dynamic true}
+  *signers-map* {:hs256 {:signer   #(hmac/hash %1 %2 :sha256)
+                         :verifier #(hmac/verify %1 %2 %3 :sha256)}
+                 :hs512 {:signer   #(hmac/hash %1 %2 :sha512)
+                         :verifier #(hmac/verify %1 %2 %3 :sha512)}})
+
+(defn timestamp-millis
+  "Get current timestamp in millis."
+  []
+  (System/currentTimeMillis))
+
+(defn- calculate-signature
+  "Given the bunch of bytes, a private key and algorithm,
+  return a calculated signature as byte array."
+  [^bytes input ^bytes key ^Keyword alg]
+  (let [signer (get-in *signers-map* [alg :signer])]
+    (signer input key)))
+
+(defn- verify-signature
+  "Given a bunch of bytes, a previously generated
+  signature, the private key and algorithm, return
+  signature matches or not."
+  [^bytes input ^bytes signature ^bytes key ^Keyword alg]
+  (let [verifier (get-in *signers-map* [alg :verifier])]
+    (verifier input signature key)))
+
+(defn- serialize
+  [data compress]
+  (cond
+    (true? compress)
+    (nippy/freeze data {:compressor nippy/snappy-compressor})
+
+    (satisfies? nippycompress/ICompressor compress)
+    (nippy/freeze data {:compressor compress})
+
+    :else
+    (nippy/freeze data)))
+
+(defn encode
+  "Sign arbitrary length string/byte array using
+  compact sigining method."
+  [data key & [{:keys [alg compress]
+                :or {alg :hs256 compress true}}]]
+  (let [input (serialize data compress)
+        salt (nonce/random-nonce 8)
+        stamp (codecs/long->bytes (timestamp-millis))
+        signature (-> (codecs/concat-byte-arrays input salt stamp)
+                      (calculate-signature key alg))
+        result (str/join "." [(codecs/bytes->safebase64 input)
+                              (codecs/bytes->safebase64 signature)
+                              (codecs/bytes->safebase64 salt)
+                              (codecs/bytes->safebase64 stamp)])]
+    (either/right result)))
+
+(defn decode
+  "Given a signed message, verify it and return
+  the decoded data.
+
+  This function returns a monadic either instance,
+  and if some error is happens in process of decoding
+  and verification, it will be reported in an
+  either/left instance."
+  [data key & [{:keys [alg compress]
+                :or {alg :hs256 compress true}}]]
+  (let [[input signature salt stamp] (str/split data #"\." 4)
+        input (codecs/safebase64->bytes input)
+        signature (codecs/safebase64->bytes signature)
+        salt (codecs/safebase64->bytes salt)
+        stamp (codecs/safebase64->bytes stamp)
+        candidate (codecs/concat-byte-arrays input salt stamp)]
+    (if (verify-signature candidate signature key alg)
+      (either/right (nippy/thaw input {:v1-compatibility? false}))
+      (either/left "Invalid signature."))))


Add deflate util functions.

Add deflate util functions.

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

--- src/buddy/util/deflate.clj
+++ src/buddy/util/deflate.clj
@@ -0,0 +1,56 @@
+;; Copyright (c) 2014-2015 Andrey Antukh <niwi@niwi.be>
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License")
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;;     http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
+;; Links to rfcs:
+;; - https://tools.ietf.org/html/rfc1951
+
+(ns buddy.util.deflate
+  "Interface to DEFLATE compression algorithm."
+  (:import java.io.ByteArrayInputStream
+           java.io.ByteArrayOutputStream
+           java.util.zip.Deflater
+           java.util.zip.DeflaterOutputStream
+           java.util.zip.InflaterInputStream
+           java.util.zip.Inflater))
+
+(defn compress
+  "Given a plain byte array, compress it and
+  return an other byte array."
+  [^bytes input]
+  (let [out (ByteArrayOutputStream.)
+        def (Deflater. Deflater/DEFLATED true)
+        dout (DeflaterOutputStream. out def)]
+    (.write dout input)
+    (.close dout)
+    (.toByteArray out)))
+
+(defn uncompress
+  "Given a compressed data as byte-array,
+  uncompress it and return as an other
+  byte array."
+  [^bytes input]
+  (let [input (ByteArrayInputStream. bytes)
+        inflater (Inflater. true)
+        infout (InflaterInputStream. input inflater)
+        output (ByteArrayOutputStream.)
+        buffer (byte-array 1024)]
+    (loop []
+      (let [readed (.read infout buffer)]
+        (when (pos? readed)
+          (.write output buffer 0 readed)
+          (recur))))
+    (.close infout)
+    (.close output)
+    (.toByteArray output)))
+


start add integration tests

start add integration tests

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

--- kafka-clj/test/kafka_clj/integration_tests.clj
+++ kafka-clj/test/kafka_clj/integration_tests.clj
@@ -0,0 +1,58 @@
+(ns kafka-clj.integration-tests
+  (:require [kafka-clj.consumer :refer [consumer read-msg shutdown-consumer]]
+            [kafka-clj.client :refer [create-connector close send-msg]]
+            [clojure.tools.logging :refer [info]]
+            [clojure.edn :as edn])
+  (:use midje.sweet))
+
+
+(def config (edn/read-string (slurp (str (System/getProperty "user.home") "/" ".integration/kafka-clj/conf.edn"))))
+
+(def brokers (:brokers config))
+(def topic (:topic config))
+(def redis (:redis config))
+
+(prn "Using brokers " brokers " with topic " topic)
+
+
+(defn create-consumer []
+  (consumer brokers [topic]
+    {:use-earliest true :max-bytes 50 :metadata-timeout 1000 :redis-conf {:redis-host redis :heart-beat 10} }))
+
+(defn lazy-ch [c]
+  (lazy-seq (cons (read-msg c) (lazy-ch c))))
+
+(defn create-consume-seq [c]
+  (flatten (lazy-ch c)))
+
+(defn create-producer []
+  (create-connector brokers {}))
+
+
+(defn send-kafka [conn msgs]
+  (doseq [msg msgs]
+    (send-msg conn topic msg)))
+
+(defn get-msgs [conn n]
+  (info "get msgs ")
+  (take n (create-consume-seq conn)))
+
+(facts "consume and produce integration tests"
+  (fact "test config"
+       (let [msgs (doall (map #(.getBytes %) (map str (range 100))))
+             producer (create-producer)
+             c (create-consumer)]
+         (future (send-kafka producer msgs))
+
+         ;; wait and consume the messages
+         (let [kafka-msgs (get-msgs c (count msgs))
+               grouped (group-by :partition kafka-msgs)]
+           (doseq [[_ p-msgs] grouped]
+             (doseq [[offset cnt] (frequencies (map :offset p-msgs))]
+               cnt => 1)))
+
+         ;(map #(-> % :bts (String.)) (get-msgs c (count msgs))) => (map #(String. %) msgs)
+         ;(close producer)
+         ;(shutdown-consumer c)
+
+    )))


String eta File sarrerak bereizi

String eta File sarrerak bereizi

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


reorg

reorg

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


sensible extra arities for top-level warp


Implemented something similar to Mathematica's reap/sow in Clojure.

error: pathspec 'Clojure/reap-sow.clj' did not match any file(s) known to git

--- Clojure/reap-sow.clj
+++ Clojure/reap-sow.clj
@@ -0,0 +1,47 @@
+; :mode=clojure:
+
+; Experiment to see if something like Mathematica's reap/sow can be done in Clojure
+; http://reference.wolfram.com/mathematica/ref/Reap.html
+
+(def reap-store)
+
+(defn sow [v]
+    "Adds the given value to the result that will be returned
+    by the enclosing reap"
+    (set! reap-store (conj reap-store v)))
+
+(defn reap
+    "Evaluates function 'f' ignoring the result.
+    Calls to 'sow' by 'f' will store the sown value into
+    the collection returned by reap."
+    [f]
+    (binding [reap-store []] (f) reap-store))
+
+; Well that was easy..  now some tests..
+
+(println
+    (reap (fn [] (do
+        (sow 1)
+        (sow 2)
+        (sow 3)))))
+
+(defn sow-lots [v]
+    (if (empty? v)
+        nil
+        (do
+            (sow (first v))
+            (recur (rest v)))))
+
+(println
+    (reap (fn [] (sow-lots [:a :b :c]))))
+
+; Nested reaps
+
+(println
+    (reap (fn [] (do
+        (sow 1)
+        (sow 2)
+        (sow (reap (fn [] (do
+            (sow :a)
+            (sow :b)))))))))
+


clarify dox

clarify dox

--- src/metabase/bootstrap.clj
+++ src/metabase/bootstrap.clj
@@ -14,7 +14,9 @@
 ;; # BOOTSTRAPPING

 (defn bootstrap
-  "Create a User for development purposes. This will load the test data and create permissions for the Test Org."
+  "Create a `User` (and, optionally, `Org`) for development purposes.
+   You may optionally load the test data and use the test `Org`.
+   Permissions will be created for `User` <-> `Org`."
   []
   (binding [*log-db-calls* false]
     (migrate :up)


add data namespace

add data namespace

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

--- src/main/clojure/dojo/data.clj
+++ src/main/clojure/dojo/data.clj
@@ -0,0 +1,2 @@
+(ns dojo.data)
+


first async test

first async 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/JetBrains/imperative-nodejs.git/'


focused mutability on map

focused mutability on map

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

--- src/sandbox/mutability/map.clj
+++ src/sandbox/mutability/map.clj
@@ -0,0 +1,34 @@
+(ns sandbox.mutability.vector)
+
+(defn make-test-purchase []
+  {:store-number (rand-int 100)
+   :customer-number (rand-int 100)
+   :item-number (rand-int 500)})
+
+(defn infinite-test-purchases []
+  (repeatedly make-test-purchase))
+
+(defn immutable-sequence-event-processing [count]
+  (let [test-purchases (take count (infinite-test-purchases))]
+    (reduce
+     (fn [map-of-purchases {:keys [store-number] :as current-purchase}]
+       (let [purchases-for-store (get map-of-purchases store-number '())]
+         (assoc map-of-purchases store-number
+                (conj purchases-for-store current-purchase))))
+     {}
+     test-purchases)))
+
+(defn mutable-sequence-event-processing [count]
+  (let [test-purchases (take count (infinite-test-purchases))]
+    (persistent! (reduce
+                  (fn [map-of-purchases {:keys [store-number] :as current-purchase}]
+                    (let [purchases-for-store (get map-of-purchases store-number '())]
+                      (assoc! map-of-purchases store-number
+                              (conj purchases-for-store current-purchase))))
+                  (transient {})
+                  test-purchases))))
+
+(defmacro time-runs [fn count]
+  `(dotimes [_# ~count]
+     (time ~fn)))
+


Add initial messages implementation.

Add initial messages implementation.

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

--- src/uxbox/ui/messages.cljs
+++ src/uxbox/ui/messages.cljs
@@ -0,0 +1,74 @@
+(ns uxbox.ui.messages
+  (:require [sablono.core :as html :refer-macros [html]]
+            [rum.core :as rum]
+            [promesa.core :as p]
+            [cuerdas.core :as str]
+            [uxbox.rstore :as rs]
+            [uxbox.ui.icons :as i]
+            [uxbox.ui.mixins :as mx]
+            [uxbox.util.data :refer (classnames)]
+            [uxbox.util.dom :as dom]))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Api
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defonce +message+ (atom nil))
+(def ^:const +animation-timeout+ 600)
+
+(defn set-timeout!
+  [ms callback]
+  (js/setTimeout callback ms))
+
+(defn abort-timeout!
+  [v]
+  (js/clearTimeout v))
+
+(defn error
+  ([message] (error message nil))
+  ([message {:keys [timeout] :or {timeout 3000}}]
+   (when-let [prev-message @+message+]
+     (abort-timeout! (:timeout-total prev-message))
+     (abort-timeout! (:timeout prev-message)))
+
+   (let [timeout-total (set-timeout! (+ timeout +animation-timeout+)
+                                     #(reset! +message+ nil))
+         timeout (set-timeout! timeout #(swap! +message+ assoc :state :hide))]
+     (reset! +message+ {:type :error
+                        :state :normal
+                        :timeout-total timeout-total
+                        :timeout timeout
+                        :content message}))))
+
+;; (set-timeout! 1000 #(error "Something wrong has happened 1"))
+;; (set-timeout! 2000 #(error "Something wrong has happened 2"))
+;; (set-timeout! 3000 #(error "Something wrong has happened 3"))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Component
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defn messages-will-update
+  [own]
+  (println "messages-will-update")
+  own)
+
+(defn messages-render
+  [own]
+  (when-let [message (rum/react +message+)]
+    (let [classes (classnames :error (= (:type message) :error)
+                              :info (= (:type message) :info)
+                              :hide-message (= (:state message) :hide)
+                              :quick true)]
+      (html
+       [:div.message {:class classes}
+        [:div.message-body
+         [:span.close i/close]
+         [:span (:content message)]]]))))
+
+(def ^:const messages
+  (mx/component
+   {:render messages-render
+    :will-update messages-will-update
+    :name "messages"
+    :mixins [mx/static rum/reactive]}))


framework: step in to take ClusterManager role

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


#7: Added :gen-class which I don't know what it does but apparently allows the application to start after I uberjared it.

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


遅延評価で苦戦した(入力順が狂ってたことに気付くのに時間かかった)

遅延評価で苦戦した(入力順が狂ってたことに気付くのに時間かかった)

result:
https://paiza.jp/poh/ando/share/3bb5b81f

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

--- POH7/Megane/Main.clj
+++ POH7/Megane/Main.clj
@@ -0,0 +1,38 @@
+; Try POH
+; author: Leonardone @ NEETSDKASU
+(def gs read-line)
+(defn gi [] (read-string (gs)))
+(defn gss [] (list* (.split (gs) " "))) ; gisのmapがlistを返すのでgssも揃える
+(defn gis [] (map read-string (gss)))
+(defn ngt [n f] (reverse (loop [c n r []] (if (= c 0) r (recur (dec c) (cons (f) r))))))  ; forやmapだと遅延評価で読み込み順が狂うう
+(defn ngs [n] (ngt n gs))
+(defn ngi [n] (ngt n gi))
+(defn ngss [n] (ngt n gss))
+(defn ngis [n] (ngt n gis))
+; ============================================
+
+(defn solve [n p m q]
+    (let [nm (+ (- n m) 1)
+          nmr (range nm)
+          cs (for [i (range nm) j (range nm)] (map #(take m (drop j %)) (take m (drop i p))))
+          ln (count (take-while #(not (= q %)) cs))
+          y (quot ln nm)
+          x (rem ln nm)
+          ]
+        [y x]
+    ))
+
+; ============================================
+(defn main []
+    (let [n (gi)
+          p (ngis n)
+          m (gi)
+          q (ngis m)
+          [y x] (solve n p m q)
+          ]
+        (println y x)
+    ))
+
+; ============================================
+(main)
+; ============================================


I think this fixes the index-links function

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


rev comments, docstring

rev comments, docstring


additional core-plan maps

additional core-plan maps


Resolve merge conflicts with feat/ptm

Resolve merge conflicts with feat/ptm

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


reset state

reset state

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


四则运算的转换

四则运算的转换

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

--- hello1.clj
+++ hello1.clj
@@ -0,0 +1,33 @@
+;; 宏的本质也是数据分析==>代码分析
+;; (fn [a,b] (+ a b)) => "lambda a,b : a + b"
+;; 确定表达式类型,可以获取第一个元素来判断 ==> (nth (expression) 0)
+;; 表达式的组成: 第一个元素的函数关键字, 参数, body ==> (fnkey [params] body)
+;; 如果是list,就要打开重组,如果是symbol就停止
+(def fnbody0 '(fn [a] a))
+(def fnbody '(fn [a,b] (+ a b)))
+(defn get-fn-body [fnbody] (nth (rest (rest fnbody)) 0))
+(defn get-fn-body-type [fnbody] (type (nth (rest (rest fnbody)) 0)))
+
+(type (nth (rest (rest fnbody)) 0)) ;;=> (+ a b) ;;=> clojure.lang.PersistentList
+(type fnbody) ;;=> clojure.lang.PersistentList
+(get-fn-body-type fnbody) ;;=> clojure.lang.PersistentList
+(get-fn-body-type fnbody0) ;;=> clojure.lang.Symbol
+
+;; lambda的body处理:
+(cond
+  (= (get-fn-body-type fnbody) clojure.lang.Symbol) (get-fn-body fnbody)
+  (= (get-fn-body-type fnbody) clojure.lang.PersistentList) (str "进入表达式处理:" (get-fn-body fnbody))
+  ) ;;=> "进入表达式处理:(+ a b)"
+
+;;(= (get-fn-body fnbody) '(+ a b)) ;;=> true
+
+;; 四则运算是前缀转中缀, 判断是否为四则运算的表达式==> first 关键子一定是+-/*
+(def fnnum '(+ a b))
+(type (first fnnum)) ;;=> clojure.lang.Symbol
+(defn +? [fnnum] (= (first fnnum) '+)) ;; (+? fnnum) ;;=> true
+(defn -? [fnnum] (= (first fnnum) '-))
+(defn *? [fnnum] (= (first fnnum) '*))
+;;(defn /? [fnnum] (= (first fnnum) '/)) ;; / 是不允许的key
+(cond
+  (+? fnnum) (str (nth fnnum 1) " " (nth fnnum 0) " " (nth fnnum 2))
+  ) ;; => "a + b"


Do my embarrassing exercises on a local file.

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/psy-q/vinylla.git/'


Added homework for Clojure day 3

Added homework for Clojure day 3

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

--- clojure/day3.clj
+++ clojure/day3.clj
@@ -0,0 +1,24 @@
+(def accounts (ref []))
+
+(defn add-account [accounts name]
+  (alter accounts conj {:name name, :balance 0.0}))
+
+(defn- adjust-amount [existing new]
+  (assoc existing :balance (+ (:balance existing) (:balance new))))
+
+(defn- adjust-if-name [existing new]
+  (if (= (:name existing) (:name new))
+    (adjust-amount existing new)
+    existing))
+
+(defn credit [accounts name amount]
+  ; I suppose this can be changed into 'alter' somehow
+  (ref-set accounts
+           (map #(adjust-if-name % {:name name, :balance amount}) @accounts)))
+
+(defn debit [accounts name amount]
+  (credit accounts name (- amount)))
+
+(println (dosync (add-account accounts "Leonidas")))
+(println (dosync (credit accounts "Leonidas" 10.0)))
+(println (dosync (debit accounts "Leonidas" 5.0)))


more specs

more specs

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


Link autocomplete

Link autocomplete

--- src/cljs/clojuredocs/main.cljs
+++ src/cljs/clojuredocs/main.cljs
@@ -39,11 +39,12 @@

 (defn $ac-result [{:keys [name ns doc]}]
   (node [:tr.ac-result
-         [:td.name
-          (str name)
-          [:div.ac-metadata
-           "1 ex, 2 sa"]]
-         [:td.docstring (ellipsis (str doc) 200)]]))
+         [:a {:href (str "/v/" ns "/" name)}
+          [:td.name
+           (str name)
+           [:div.ac-metadata
+            "1 ex, 2 sa"]]
+          [:td.docstring (ellipsis (str doc) 200)]]]))

 (defn prevent [e]
   (.preventDefault e))


cleaned up unused components

cleaned up unused components

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


Add test to ensure that publish! throws an exception if connection is down

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


small refactor

small refactor

--- plugin/src/leiningen/figwheel.clj
+++ plugin/src/leiningen/figwheel.clj
@@ -59,8 +59,8 @@
             (copy-crossovers#)
             (cljsbuild.util/once-every-bg 1000 "copying crossovers" copy-crossovers#))
           (let [crossover-macro-paths# (cljsbuild.crossover/crossover-macro-paths '~crossovers)
-                [build# compiler-env#] (first (for [opts# '~parsed-builds]
-                                                [opts# (cljs.env/default-compiler-env (:compiler opts#))]))
+                build# (first '~parsed-builds)
+                compiler-env# (cljs.env/default-compiler-env (:compiler build#))
                 change-server# (figwheel.core/start-static-server ~live-reload-options)]
             (loop [dependency-mtimes# {}]
               (let [new-dependency-mtimes#
@@ -82,7 +82,7 @@
                       (catch Throwable e#
                         (clj-stacktrace.repl/pst+ e#)
                         ;; this is a total crap hack
-                        ;; just trying to delay re-writing a
+                        ;; just trying to delay duplicating a
                         ;; portion of cljsbuild until I understand
                         ;; more about how lein figwheel should work
                         (figwheel.core/get-dependency-mtimes


Fixing bug in hex-to-array

Fixing bug in hex-to-array

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


do not log when exclusive consumer fails due to another consumer


override default bifrost timeout

override default bifrost timeout

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


Ensure that each node has at least one client

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


add type checking build script

add type checking build script

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

--- script/build.clj
+++ script/build.clj
@@ -0,0 +1,15 @@
+(require '[cljs.build.api :as b])
+
+(b/build (b/inputs "src" "test")
+  {:output-to "target/transit.test.js"
+   :output-dir "target/out-test"
+   :optimizations :simple
+   :verbose true
+   :closure-warnings
+   {:check-types :error
+    :externs-validation :off
+    :check-useless-code :off
+    :missing-properties :off
+    :undefined-names :off}})
+
+(System/exit 0)


Tests for hiccup.middleware

Tests for hiccup.middleware

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

--- test/hiccup/test/middleware.clj
+++ test/hiccup/test/middleware.clj
@@ -0,0 +1,15 @@
+(ns hiccup.test.middleware
+  (:use clojure.test
+        hiccup.middleware
+        hiccup.core
+        hiccup.element))
+
+(defn test-handler [request]
+  {:status  200
+   :headers {"Content-Type" "text/html"}
+   :body    (html [:html [:body (link-to "/bar" "bar")]])})
+
+(deftest test-wrap-base-url
+  (let [resp ((wrap-base-url test-handler "/foo") {})]
+    (is (= (:body resp)
+           "bar"))))


Fix matching nicks with dashes in karma plugin

Assume this is enough, do not have clojure installed to try things out.

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


wrap properties display in doall

wrap properties display in doall

to prevent ant from warning us about reactive derefs


Update copyright notice on validation ns.

--- src/cats/applicative/validation.cljc
+++ src/cats/applicative/validation.cljc
@@ -1,4 +1,4 @@
-;; Copyright (c) 2014-2015 Andrey Antukh <niwi@niwi.be>
+;; Copyright (c) 2014-2015 Andrey Antukh <niwi@niwi.nz>
 ;; Copyright (c) 2014-2015 Alejandro Gómez <alejandro@dialelo.com>
 ;; All rights reserved.
 ;;


:8ball: clojure RNA Transcription - enough to compile

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

--- clojure/rna-transcription/rna_transcription.clj
+++ clojure/rna-transcription/rna_transcription.clj
@@ -0,0 +1,3 @@
+(ns rna-transcription)
+
+(defn to-rna [s] s)


first prompt uses current time

first prompt uses current time

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


Fixing timeout rule

Fixing timeout rule

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


"Landing" page

"Landing" page

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

--- src/trak/ui/components/landing.cljs
+++ src/trak/ui/components/landing.cljs
@@ -0,0 +1,19 @@
+(ns trak.ui.components.landing
+  (:require [rum.core :as rum]
+            [trak.globals :as globals]
+            [trak.ui.components :as components]))
+
+(rum/defc landing [status]
+  [:.container
+   [:.columns
+    [:.column.col-9.centered
+     [:img.centered {:src "/img/trak.svg" :width "150px"}]]
+    [:.column.col-9.centered.text-center
+     (cond
+       (= :logged-out status)
+       (components/link
+         {:href (globals/spotify-authorization-link "user-read-private user-read-email") :class-name "btn btn-primary"}
+         "Log in")
+
+       (= :loading status)
+       [:.loading])]]])


Saioa hasi eta amaitu

Saioa hasi eta amaitu

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


Removing println

Removing println


best practices examples

best practices examples

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

--- doc-examples/best_practices.clj
+++ doc-examples/best_practices.clj
@@ -0,0 +1,94 @@
+;   Copyright (c) Cognitect, Inc. All rights reserved.
+;   The use and distribution terms for this software are covered by the
+;   Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
+;   which can be found in the file epl-v10.html at the root of this distribution.
+;   By using this software in any fashion, you are agreeing to be bound by
+;   the terms of this license.
+;   You must not remove this notice, or any other, from this software.
+
+(require '[datomic.client.api.alpha :as d])
+(import 'clojure.lang.ExceptionInfo)
+
+;; Define the configuration for the client:
+(def cfg (read-string (slurp "config.edn")))
+
+;; Create a client:
+(def client (d/client cfg))
+
+;; Create a database and connect to it:
+(d/create-database client {:db-name "best-practices-db"})
+(def conn (d/connect client {:db-name "best-practices-db"}))
+
+(def schema [{:db/ident :account/number
+              :db/cardinality :db.cardinality/one
+              :db/valueType :db.type/string
+              :db/unique :db.unique/identity}
+             {:db/ident :account/balance
+              :db/cardinality :db.cardinality/one
+              :db/valueType :db.type/double}])
+
+(d/transact conn {:tx-data schema})
+
+(def initial-data [{:account/number "123"
+                    :account/balance 100.00}])
+
+(d/transact conn {:tx-data initial-data})
+
+(defn make-deposit!
+  ([conn account-id deposit]
+   (make-deposit! conn account-id deposit 1))
+  ([conn account-id deposit retries]
+   (let [db (d/db conn)
+         acc-lookup [:account/number account-id]
+         balance (-> (d/pull db '[:account/balance] acc-lookup)
+                     :account/balance)]
+     (try (d/transact conn {:tx-data [[:db/cas acc-lookup
+                                       :account/balance balance
+                                       (+ balance deposit)]]})
+          (catch ExceptionInfo t
+            (if (= (:cognitect.anomalies/category (ex-data t)) :cognitect.anomalies/conflict)
+              (if (< retries 5)
+                (make-deposit! conn account-id deposit (inc retries))
+                (throw (java.lang.IllegalStateException. "Max Retries Exceeded")))
+              (throw t)))))))
+
+(make-deposit! conn "123" 20.00)
+
+(let [db (d/db conn)
+      deposit 850.00
+      acc-lookup [:account/number "123"]
+      balance-before (-> (d/pull db '[:account/balance] acc-lookup)
+                         :account/balance)
+      tx-result (d/transact conn {:tx-data [[:db/cas acc-lookup
+                                             :account/balance balance-before
+                                             (+ balance-before deposit)]]})
+      db-after (:db-after tx-result)
+      balance-after (-> (d/pull db-after '[:account/balance] acc-lookup)
+                  :account/balance)]
+  balance-after)
+
+(def conn (d/connect client {:db-name "mbrainz-1968-1973"}))
+
+(d/q '[:find (pull ?e [:artist/name])
+       :where [?e :artist/country :country/JP]]
+     (d/db conn))
+
+(d/q '[:find (pull ?e [:artist/name :artist/gender])
+       :where [?e :artist/country :country/JP]]
+     (d/db conn))
+
+(d/q '[:find ?txInstant
+       :where [?a :artist/name "The Rolling Stones" ?tx]
+       [?tx :db/txInstant ?txInstant]]
+     (d/db conn))
+
+(def tx (ffirst
+          (d/q '[:find ?tx
+                 :where [?a :artist/name "The Rolling Stones" ?tx]]
+               (d/db conn))))
+
+(-> (d/tx-range conn {:start tx :end (inc tx)})
+    first
+    :tx-data)
+
+(d/delete-database client {:db-name "best-practices-db"})


Add newline to end of metrics.clj

Add newline to end of metrics.clj

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


add nil argument test

add nil argument test

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

--- test/graphql_clj/argument_test.clj
+++ test/graphql_clj/argument_test.clj
@@ -0,0 +1,61 @@
+(ns graphql-clj.argument-test
+  (:require [clojure.test :refer :all]
+            [graphql-clj.parser :as parser]
+            [clojure.core.match :as match]
+            [clojure.string :as str]
+            [graphql-clj.executor :as executor]
+            [graphql-clj.resolver :as resolver]
+            [graphql-clj.schema-validator :as sv]
+            [graphql-clj.query-validator :as qv]))
+
+(def schema-str "type User {
+  id: String
+  name: String
+  age: Int
+}
+
+type QueryRoot {
+  user: User
+}
+
+type MutationRoot {
+  updateUser(id: String): User
+}
+
+schema {
+  query: QueryRoot,
+  mutation: MutationRoot,
+}")
+
+(defn resolver-fn [type-name field-name]
+  (get-in {"MutationRoot" {"updateUser" (fn [context parent args]
+                                        {:id (get args "id")
+                                        :name "test user name"
+                                        :age 30})}
+           "QueryRoot" {"user" (fn [context parent args]
+                                 {:id "1001"
+                                   :name "test user name"
+                                  :age 30})}}
+          [type-name field-name]))
+
+(require '[graphql-clj.executor :as executor])
+
+(def query-str "mutation { updateUser() {id}}")
+
+
+(deftest test-execute-mutation-with-nil
+  (testing "execute field scalar"
+    (let [result (executor/execute nil schema-str resolver-fn
+                              "mutation { updateUser() {id}}")]
+      (is (empty? (:errors result)))
+      (is (= result {:data {"updateUser" {"id" nil}}})))))
+
+
+(deftest test-execute-mutation-with-string
+  (testing "execute field scalar"
+    (let [result (executor/execute nil schema-str resolver-fn
+                              "mutation { updateUser(id: \"1001\") {id}}")]
+      (is (empty? (:errors result)))
+      (is (= result {:data {"updateUser" {"id" "1001"}}})))))
+
+


adding dev folder from figwheel

adding dev folder from figwheel

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

--- dev/user.clj
+++ dev/user.clj
@@ -0,0 +1,42 @@
+(ns user
+  (:require
+   [figwheel-sidecar.repl-api :as f]))
+
+;; user is a namespace that the Clojure runtime looks for and
+;; loads if its available
+
+;; You can place helper functions in here. This is great for starting
+;; and stopping your webserver and other development services
+
+;; The definitions in here will be available if you run "lein repl" or launch a
+;; Clojure repl some other way
+
+;; You have to ensure that the libraries you :require are listed in your dependencies
+
+;; Once you start down this path
+;; you will probably want to look at
+;; tools.namespace https://github.com/clojure/tools.namespace
+;; and Component https://github.com/stuartsierra/component
+
+
+(defn fig-start
+  "This starts the figwheel server and watch based auto-compiler."
+  []
+  ;; this call will only work are long as your :cljsbuild and
+  ;; :figwheel configurations are at the top level of your project.clj
+  ;; and are not spread across different lein profiles
+
+  ;; otherwise you can pass a configuration into start-figwheel! manually
+  (f/start-figwheel!))
+
+(defn fig-stop
+  "Stop the figwheel server and watch based auto-compiler."
+  []
+  (f/stop-figwheel!))
+
+;; if you are in an nREPL environment you will need to make sure you
+;; have setup piggieback for this to work
+(defn cljs-repl
+  "Launch a ClojureScript REPL that is connected to your build and host environment."
+  []
+  (f/cljs-repl))


Latest deps

Latest deps

--- planck-cljs/project.clj
+++ planck-cljs/project.clj
@@ -1,5 +1,5 @@
 (defproject planck "0.1.0"
   :dependencies [[org.clojure/clojure "1.7.0"]
-                 [org.clojure/clojurescript "1.7.10"]
+                 [org.clojure/clojurescript "1.7.28"]
                  [org.omcljs/ambly "0.6.0"]]
   :clean-targets ["out" "target"])


Yet another eval version started.

Yet another eval version started.

error: pathspec 'src/angelic/search/implicit/fah_astar_eval2.clj' did not match any file(s) known to git

--- src/angelic/search/implicit/fah_astar_eval2.clj
+++ src/angelic/search/implicit/fah_astar_eval2.clj
@@ -0,0 +1,350 @@
+(ns angelic.search.implicit.fah-astar-eval2
+  (:require [edu.berkeley.ai.util :as util]
+            [edu.berkeley.ai.util.traits :as traits]
+            [angelic.search.summary :as summary]
+            [angelic.search.summaries :as summaries])
+  (:import [java.util HashMap]))
+
+;; A version of eval subproblems where we explicitly represent the relationships
+;; between subproblems, and allow "listeners" that wait for a subproblem to be
+;; evaluated.
+;; Subproblems where the expand operation evaluates the output set, and generates
+;; the children.  Putting the focus on evaluation gives us finer granularity,
+;; allowing full utilizatino of subsumption, plus is more natural in a decomposed
+;; setting where we also have to "evaluate" existing actions in new contexts.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Summarizers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+#_ (def  ^{:private true} cache-trait summaries/uncached-summarizer-node)
+#_ (def ^{:private true} cache-trait summaries/eager-cached-summarizer-node)
+#_ (def ^{:private true} cache-trait summaries/less-eager-cached-summarizer-node)
+#_ (def ^{:private true} cache-trait summaries/lazy-cached-summarizer-node)
+ (def ^{:private true} cache-trait summaries/pseudo-cached-summarizer-node)
+
+
+(defprotocol FancyNode
+  (remove-child! [s child])
+  (remove-parent! [s parent]))
+
+(defn disconnect! [parent child]
+  (remove-child! parent child)
+  (remove-parent! child parent))
+
+
+(traits/deftrait fancy-node [] [children (atom nil) parents  (atom nil)] []
+  summaries/Node
+  (node-ordinary-children [n] (map second (remove first @children)))
+  (node-subsuming-children [n] (map second (filter first @children)))
+  (node-ordinary-parents [n] (map second (remove first @parents)))
+  (node-subsumed-parents [n] (map second (filter first @parents)))
+  (add-child!    [n child subsuming?] (swap! children conj [subsuming? child]))
+  (add-parent!   [n parent subsuming?] (swap! parents conj [subsuming? parent]))
+
+  FancyNode
+  (remove-child! [s child]
+    (let [new-children (remove #(identical? (second %) child) @children)]
+      (assert (= (count new-children) (dec (count @children))))
+      (reset! children new-children)))
+  (remove-parent! [s parent]
+    (let [new-parents (remove #(identical? (second %) parent) @parents)]
+      (assert (= (count new-parents) (dec (count @parents))))
+      (reset! parents new-parents))))
+
+(declare tree-summary)
+
+(traits/deftrait outer-or-summarizable [] [] [fancy-node cache-trait]
+  summaries/Summarizable
+  (summarize [s]
+    (swap! summaries/*summary-count* inc)
+    (summary/or-combine (map tree-summary (node-ordinary-children s)) s
+                        (summary/max-reward (apply summary/min (map tree-summary (node-subsuming-children s)))))))
+
+
+
+(traits/deftrait inner-or-summarizable [] [] [fancy-node cache-trait]
+  summaries/Summarizable
+  (summarize [s]
+    (swap! summaries/*summary-count* inc)
+    (let [inner (inner-summary s)
+          bound-only? (number? inner)
+          inner-bound (if bound-only? inner (summary/max-reward inner))
+          bound (min inner-bound (summary/max-reward (apply summary/min (map summary (node-subsuming-children s)))))
+          child-summary (summary/or-combine (map summary (node-ordinary-children s)) s bound)]
+      (if bound-only?
+        child-summary
+        (summary/max child-summary inner)))))
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Subproblem Protocol ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; A subproblem should also implement Summarizable and Refinable implementations.
+;; The non-viable (pre-refinement) subproblem is always represented as nil.
+
+;; Here, get-child and refine-input always return subproblems,
+;; but output-set can return "nil"
+;; get-child and refine-input are allow to return nil
+
+(defprotocol SubproblemWatcher
+  (notify-output! [w s output-set]       "s has direct output.  (Other args?). ")
+  (notify-child!  [w s child] "s has child output.  (Other args?). "))
+
+;; Notify on child created, or evaluated ?
+
+(defprotocol Subproblem
+  ;; External
+  (subproblem-name   [s])
+  (input-set         [s])
+  (can-evaluate?     [s] "Is this problem evaluable and not already evaluated?")
+  (add-watcher!      [s ^SubproblemWatcher w] "Add a watcher to be notified of outputs to this, and refinements thereof.
+                                   Notifies immediately if already evaluated.  Never notifies for failure.")
+  (tree-summarizer   [s] "Summarizer that includes children.")
+  (refine-input      [s maybe-refined-input-set])
+
+  ;; Internal interface
+  (add-child!        [s child]  "Add a child to this subproblem, and notify")
+  (set-output!       [s output-set] "Set the output of this subproblem, and notify.")
+  (set-sub-watched!  [s sub] "Set a subsidiary that all watchers shoudl watch as well."))
+
+(defn tree-summary [sp] (summaries/summary (tree-summarizer sp)))
+
+(defprotocol SubproblemImpl
+  ;; External
+  (evaluate!      [s] "return [output-set reward] or nil. output-pair or nil, if
+                        dead / more eval needed.  Update summary to match as needed.")
+
+  ;; Internal
+  (is-evaluable?  [s] "Is this subproblem of a type that can be evaluated?")
+  (inner-summary [s]  "Return summary or just numeric bound -- not including any children")
+  (refine-input-   [s refined-input-set] "must be a strict subset of input-set."))
+
+
+;; Output-pair is [output-set init-summarizable]
+(traits/deftrait simple-subproblem [name input-set]
+  [output-set (atom nil)
+   watchers   (atom nil)
+   tree-sum   (atom nil)
+   sub-watched (atom nil)]
+  [inner-or-summarizable]
+
+  Subproblem
+   (subproblem-name [s] name)
+   (input-set       [s] input-set)
+   (can-evaluate?   [s] (and (not @output-set) (is-evaluable? s)))
+   (add-watcher! [s w]
+     (swap! watchers conj w)
+     (when-let [sub @sub-watched]
+       (add-watcher! sub w))
+     (when-let [os @output-set]
+       (notify-output! w s os))
+     (doseq [child (summaries/node-ordinary-children (tree-summarizer s))]
+       (notify-child! w s child)))
+   (tree-summarizer [s]
+     (or @tree-sum
+         (reset! tree-sum
+           (doto (traits/reify-traits [cache-trait outer-or-summarizable])
+             (summaries/connect! s false)))))
+   (refine-input    [s maybe-refined-input-set]
+      (if (= input-set maybe-refined-input-set)
+        s
+        (when-let [refined (refine-input- s maybe-refined-input-set)]
+          (summaries/connect! s false)
+          refined)))
+
+   (add-child!      [s child]
+     (summaries/connect! (tree-summarizer s) child false)
+     (doseq [watcher @watchers] (notify-child! w s child)))
+   (set-output!     [s o-s]
+     (assert (not @output-set))
+     (swap! output-set o-s)
+     (doseq [watcher @watchers]
+       (notify-output! w s o-s)))
+   (set-sub-watched! [s sub]
+     (assert (not @sub-watched))
+     (swap! sub-watched sub)
+     (doseq [watcher @watchers]
+       (add-watcher! sub watcher))))
+
+
+(def *subproblem-cache* (HashMap.))
+
+;;(defn get-subproblem ??)
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Implicit DAH A* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; TODO: "guarding" by supers
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Atomic Subproblem ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+(declare make-simple-fs-seq-subproblem)
+
+(comment
+ (defn- refined-keys [sub-sp inp-set]
+   (when-let [sub-child-keys (and sub-sp (summaries/expanded? sub-sp) (seq (subproblem/child-keys sub-sp)))]
+     (util/for-map [k sub-child-keys]
+                   k (subproblem/refine-input (subproblem/get-child sub-sp k) inp-set)))))
+
+(defn connect-inner-child! [sp child]
+  (summaries/connect! sp child false)
+  (add-watcher! child
+                (reify SubproblemWatcher
+                       (notify-output! [s child output-set]
+                                       (disconnect! sp child)
+                                       (add-child! sp child))
+                       (notify-child! [s child grandchild] nil))))
+
+
+;; TODO: assuming consistency and evaluation s.t. no bounding is necessary. Otherwise, downwards would be better anyway?
+;; TODO: multi-step eval like earlier version?
+(defn- make-simple-atomic-subproblem [subsuming-as inp-set function-set]
+  (let [summary (atom nil)]
+   (traits/reify-traits
+    [(simple-subproblem [(fs/fs-name function-set) inp-set] inp-set)]
+
+    SubproblemImpl
+    (inner-summary [s] (or @summary (summary/make-simple-summary 0 :live s)))
+    (is-evaluable? [s] true)
+    (evaluate! [s]
+      (if-let [[out-set reward] (fs/apply-opt function-set inp-set)]
+        (let [status (fs/status function-set inp-set)]
+          (reset! summary-pair (if (= status :live) reward (summary/make-simple-summary reward status s)))
+          (set-output! s out-set)
+          (when (= status :live)
+            (doseq [child (or (refined-children sub-as inp-set)
+                              (map #(make-simple-fs-seq-subproblem inp-set %)
+                                   (fs/child-seqs function-set inp-set)))]
+              (connect-inner-child! s child))))
+        (reset! summary-pair summary/+worst-simple-summary+))
+      (summaries/summary-changed! s))
+    (refine-input- [s refined-input-set]
+      (make-simple-atomic-subproblem s refined-input-set function-set)))))
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Seq Subproblem ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(declare make-simple-pair-subproblem)
+
+(defn- make-left-pair-subproblem [sub-lps parent-lps sp1 sp2-fn]
+  (let [sp2-atom (atom nil)
+        ret
+        (traits/reify-traits
+         [(simple-subproblem (gensym) (input-set sp1))]
+
+         SubproblemImpl
+         (inner-summary [s]
+           (if-let [sp2 @sp2-atom]
+             (summary/+ (tree-summary sp1) (tree-summary sp2) s)
+             (summary/liven (tree-summary sp1) s)))
+         (can-evaluate- [s] false)
+         (evaluate-     [s] (throw UnsupportedOperationException.))
+         (refine-input- [s refined-input-set] ;; TODO: fancier version?
+           (assert @sp2-atom)
+           (make-left-pair-subproblem s nil (refine-input sp1 refined-input-set)
+                                      #(refine-input @sp2-atom %))))]
+    (add-watcher! sp1
+     (reify SubproblemWatcher
+            (notify-output! [w child output-set]
+              (let [sp2 (sp2-fn output-set)]
+                (set-sub-watched! ret sp2)
+                (summaries/add-parent! sp2 ret false) ;;TODO: connect up sp2.
+                (summaries/summary-changed! ret)
+                (reset! sp2-atom sp2)))
+            (notify-child! [w child grandchild]
+              (connect-inner-child! ret (make-left-pair-subproblem nil #_ ::TODO! ret child sp2-fn)))))
+    (summaries/add-parent! sp1 ret false)
+    ret))
+
+
+(defn- make-right-pair-subproblem [sub-lps parent-lps sp1 sp2]
+  (let [ret
+        (traits/reify-traits
+         [(simple-subproblem (gensym) (input-set sp1) ss)
+          summaries/simple-node
+          cache-trait]
+
+         SubproblemImpl
+         (inner-summary [s] (summary/+ (tree-summary sp1) (tree-summary sp2) s))
+         (can-evaluate- [s] false)
+         (evaluate-     [s] (throw UnsupportedOperationException.))
+         (refine-input- [s refined-input-set] ;; TODO: ???
+           (make-left-pair-subproblem s nil (refine-input sp1 refined-input-set)
+                                        #(refine-input (force sp2) %))))]
+    (add-watcher! sp2
+     (reify SubproblemWatcher
+            (notify-output! [w child output-set]
+              (set-output! ret output-set))
+            (notify-child! [w child grandchild]
+              (connect-inner-child! ret make-right-pair-subproblem ::TODO?? ret sp1 child))))
+
+    (summaries/add-parent! sp1 ret false)
+    (summaries/add-parent! sp2 ret false)
+    ret))
+
+(defn- make-simple-fs-seq-subproblem [inp-set [first-fs & rest-fs]]
+  (let [first-sp (make-simple-atomic-subproblem nil inp-set first-fs)]
+    (if (empty? rest-fs)
+      first-sp
+      (make-left-pair-subproblem nil nil first-sp #(make-simple-fs-seq-subproblem % rest-fs)))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Driver ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Planning ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; At least two ways we can do it -- keeping set of leaves, or following sum structure.
+;; Do the latter for now.
+
+(defn choose-leaf [verified-summary]
+  (->> (summary/extract-leaf-seq verified-summary (comp empty? summary/children))
+       (map summary/source)
+       (filter can-evaluate?)
+       rand-nth))
+
+
+(defn solve [root-subproblem]
+  (summary/solve
+   #(summaries/verified-summary root-subproblem summary/+worst-simple-summary+)
+   (comp evaluate! choose-leaf)
+   #(let [n (first (subproblem-name %))] (when-not (= (first n) :noop) n))))
+
+(defn implicit-fah-a*-eval2 [henv]
+  (->> (fs/make-init-pair henv)
+       (apply make-simple-atomic-subproblem nil)
+       solve))
+
+(comment
+  (defn pseudo-solve [root-sp]
+   (summaries/pseudo-solve root-sp summary/+worst-simple-summary+ (complement summaries/expanded?)
+                           #(if (evaluated? %) (do (assert (not (summaries/expanded? %))) (child-keys %)) (evaluate! %))))
+
+
+  (defn implicit-fah-a*-eval-pseudo [henv]
+  (->> (fs/make-init-pair henv)
+       (apply make-simple-atomic-subproblem nil)
+       subproblem/pseudo-solve)))
+
+
+
+
+;; How should Or-summarize work?  There's no clear expand.
+;; Instead, there should be two summaries -- local, and full.
+;; Children live in local until they are evaluated, then they move to full.
+;; Does this suggest two subproblems -- inner and outer ?
+
+;; Both atomics and seqs have an OutputCollector tree.
+


Add layergroups example

Add layergroups example

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

--- src/examples/layergroups.clj
+++ src/examples/layergroups.clj
@@ -0,0 +1,113 @@
+(ns examples.layergroups
+  (:require [zaffre.aterminal :as zat]
+            [zaffre.glterminal :as zgl]
+            [zaffre.font :as zfont]
+            [zaffre.util :as zutil]
+            [clojure.core.async :as async :refer [go-loop]]
+            [taoensso.timbre :as log])
+  (:import (zaffre.aterminal ATerminal)
+           (zaffre.font CompositeFont CP437Font TileSet TTFFont)))
+
+(defn hsv->rgb [h s v]
+  (let [c (* v s)
+        x (* c (- 1.0 (Math/abs (double (dec (mod (/ h 60.0) 2.0))))))]
+    (mapv (comp int (partial * 255))
+      (cond
+        (< h  60) [c x 0]
+        (< h 120) [x c 0]
+        (< h 180) [0 c x]
+        (< h 240) [0 x c]
+        (< h 300) [x 0 c]
+        (< h 360) [c 0 x]))))
+
+(def one-bit-map [[:metal      :panels      :stone        :masonry         :dark-metal :dark-panels  :grass       :tree]
+                  [:water-nw   :water-n     :water-ne     :column          :parapet    :parapet-flag :sign        :palm]
+                  [:water-w    :water       :water-e      :fence           :gate       :dead-tree    :tombstone1  :tombstone2]
+                  [:water-sw   :water-s     :water-se     :black           :pine-tree  :cave         :cave-nw     :cave-ne]
+                  [:water-f-se :water-f-sw  :masonry-top  :wall-top        :gravel     :mountain     :cave-sw     :cave-se]
+                  [:water-f-se :water-f-nw  :window       :wall            :robot      :lever-left   :lever-right :key]
+                  [:dark-water :locked-door :open-door    :masonry-parapet :window     :ladder       :stairs-up   :stairs-down]
+                  [:cactus     :skull       :boulder      :crate           :barrel     :chest-closed :chest-open  :blank]])
+
+(defn map->tile->col-row [tilemap]
+  (reduce (fn [m [t col row]]
+            (assoc m t [col row]))
+          {}
+          (mapcat concat
+            (map-indexed (fn [row line]
+                           (map-indexed (fn [col t]
+                                          [t col row])
+                                        line))
+                         tilemap))))
+
+(defn map->tile->transparent [tilemap]
+  (zipmap (flatten tilemap) (repeat false)))
+
+(def font (CompositeFont. [(CP437Font. "http://dwarffortresswiki.org/images/b/be/Pastiche_8x8.png" :green 2 true)
+                           (TileSet. "http://opengameart.org/sites/default/files/tileset_1bit.png" :green 16 16 0
+                                     (map->tile->col-row one-bit-map)
+                                     (map->tile->transparent one-bit-map))]))
+
+(defn -main [& _]
+  ;; render in background thread
+   (zgl/make-terminal
+     {:background {
+        :layers [:text]
+        :columns 16
+        :rows 16
+        :pos [0 0]}
+      :foreground {
+        :layers [:overlay]
+        :columns 16
+        :rows 16
+        :pos [0 0]}
+     }
+     {:title "Zaffre demo"
+      :screen-width (* 16 16)
+      :screen-height (* 16 16)
+      :default-fg-color [250 250 250]
+      :default-bg-color [5 5 8]
+      :windows-font font
+      :else-font font
+      :icon-paths ["images/icon-16x16.png"
+                   "images/icon-32x32.png"
+                   "images/icon-128x128.png"]}
+     (fn [terminal]
+       (let [term-pub    (zat/pub terminal)
+             key-chan    (async/chan)
+             close-chan  (async/chan)
+             last-key    (atom nil)
+             ;; Every 33ms, draw a full frame
+             render-chan (go-loop []
+                           (dosync
+                             (let [key-in (or @last-key \?)]
+                               (zat/clear! terminal)
+                               (zutil/put-string terminal :text 0 0 "Hello world")
+                               (doseq [[i c] (take 23 (map-indexed (fn [i c] [i (char c)]) (range (int \a) (int \z))))]
+                                 (zutil/put-string terminal :text 0 (inc i) (str c) [128 (* 10 i) 0] [0 0 50]))
+                               (zutil/put-string terminal :text 12 0 (str key-in))
+                               (zutil/put-string terminal :overlay 2 7 "Overlay")
+                               (zat/put-chars! terminal :text
+                                 (for [x (range 1 11)
+                                       y (range 5 10)]
+                                   {:c :metal       :fg [4 4 5] :bg [0 128 0] :x x :y y}))
+                               (zat/refresh! terminal)))
+                               ;; ~30fps
+                             (Thread/sleep 33)
+                             (recur))]
+         (async/sub term-pub :keypress key-chan)
+         (async/sub term-pub :close close-chan)
+         (go-loop []
+           (let [new-key (async/<! key-chan)]
+             (reset! last-key new-key)
+             (log/info "got key" (or (str @last-key) "nil"))
+             (case new-key
+               \q (zat/destroy! terminal)
+               nil)
+             (if (= new-key :exit)
+               (do
+               ;; change font size on s/m/l keypress
+               (recur)))))
+         (let [_ (async/<! close-chan)]
+           (async/close! render-chan)
+           (System/exit 0))))))


fix style: docstring must be after the name

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


remove clojure.me label in subject

remove clojure.me label in subject

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


add global switch for http debugging in core-utility

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


Add initial implementation of core.async channels over jnanomsg.

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

--- src/clojure/nanomsg/async.clj
+++ src/clojure/nanomsg/async.clj
@@ -0,0 +1,84 @@
+(ns nanomsg.async
+  "Core async channels on top of jnanomsg."
+  (:import (nanomsg.async IAsyncCallback))
+  (:require [nanomsg :as nn]
+            [clojure.core.async :as async]
+            [clojure.core.async.impl.protocols :as protocols]))
+
+(defn- put!-impl
+  [sock value handler]
+  (let [callback  (reify IAsyncCallback
+                    (success [_ result]
+                      (let [cb (protocols/commit handler)]
+                        (cb)))
+                    (fail [_ throwable]
+                      (let [cb (protocols/commit handler)]
+                        (cb throwable))))]
+    (.sendString sock value callback)
+    nil))
+
+(defn- take!-impl
+  [sock handler]
+  (let [callback  (reify IAsyncCallback
+                    (success [_ result]
+                      (let [cb (protocols/commit handler)]
+                        (cb result)))
+                    (fail [_ throwable]
+                      (let [cb (protocols/commit handler)]
+                        (cb throwable))))]
+    (.recvString sock callback)
+    nil))
+
+(deftype NanomsgWriteChannel [sock]
+  protocols/WritePort
+  (put! [_ value fn1-handler]
+    (put!-impl sock value fn1-handler)))
+
+(deftype NanomsgReadChannel [sock]
+  protocols/ReadPort
+  (take! [_ fn1-handler]
+    (take!-impl sock fn1-handler)))
+
+(deftype NanomsgReadWriteChanel [sock]
+  protocols/ReadPort
+  (take! [_ fn1-handler]
+    (take!-impl sock fn1-handler))
+  protocols/WritePort
+  (put! [_ value fn1-handler]
+    (put!-impl sock value fn1-handler)))
+
+(defn channel
+  "Channel constructor. Returns a core.async compatible
+  channel that works over jnanomsg async socket interface.
+
+  Example with connect:
+
+    (let [c1 (channel :socktype :pull :connect \"tcp:///tmp/sock\")]
+      (println \"Hello:\" (<!! c1)))
+
+
+  Example with bind:
+
+    (let [c1 (channel :socktype :push :bind \"tcp:///tmp/sock\")]
+      (>!! c1 \"pepe\"))
+
+  At this moment, janomsg channels only allows send strings
+  over channels (temporary) and has support of small subset
+  of socket types: `:push`, `:pull`, `:sub`, `:pub`, `:req` and `:rep`."
+  [& {:keys [bind connect socktype subscribe]}]
+  {:pre [(boolean (and socktype (or bind connect)))]}
+  (let [s   (nn/socket socktype {:async true})
+        px  (:px s)
+        ch  (case socktype
+              :push (NanomsgWriteChannel. px)
+              :pull (NanomsgReadChannel. px)
+              :pub  (NanomsgWriteChannel. px)
+              :sub  (NanomsgReadChannel. px)
+              :req  (NanomsgReadWriteChanel. px)
+              :rep  (NanomsgReadWriteChanel. px))]
+    (cond
+      bind (nn/bind! s bind)
+      connect (nn/connect! s connect))
+    (when subscribe
+      (nn/subscribe! s subscribe))
+    ch))


Standalone support for app server

Standalone support for app server

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

--- src/containium/standalone.clj
+++ src/containium/standalone.clj
@@ -0,0 +1,35 @@
+;; This Source Code Form is subject to the terms of the Mozilla Public
+;; License, v. 2.0. If a copy of the MPL was not distributed with this
+;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+(ns containium.standalone
+  (:require
+    [containium.systems                :refer (with-systems)]
+    [containium.systems.config         :refer (map-config)]
+    [containium.systems.repl           :as repl]
+    [containium.systems.elasticsearch  :as elastic]
+    [containium.systems.cassandra      :as cassandra]
+    [containium.systems.ring           :refer (test-http-kit)]
+    [ring.middleware.session.memory   :refer (memory-store)]
+    [clojure.java.io                  :as io]
+    ))
+
+(defn run [spec containium-map]
+  (prn "Ring handler: " (-> containium-map :ring :handler))
+  (with-systems systems [:config (map-config spec)
+                         :repl repl/nrepl
+                         :session-store (memory-store)
+                         :ring (test-http-kit (-> containium-map :ring :handler))
+                         :elastic elastic/embedded
+                         :cassandra cassandra/embedded12
+                         ]
+    ((:start containium-map) systems {
+      :file (io/as-file ".")
+      :profiles []
+      :active-profiles []
+      :dev? true
+      :containium containium-map
+      })
+    (read-line)
+    ((:stop containium-map) systems))
+  (shutdown-agents))


try out channels

try out channels

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

--- src/clj/clojure_web_app/try_out_channels.clj
+++ src/clj/clojure_web_app/try_out_channels.clj
@@ -0,0 +1,30 @@
+(ns clojure-web-app.try-out-channels
+  (:require [clj-http.client :as client]
+            [environ.core :refer [env]]
+            [clojure.core.async :refer [go put! <! >! chan timeout]]
+            [clojure.tools.logging :as log]
+            [clojure.data.json :as json])
+  (:import (java.io BufferedReader)))
+
+(defn async-get [url & r]
+  (let [c (chan)
+        callback (fn [v] (put! c v))
+        params (merge (or r {}) {:async? true})]
+    (client/get url params callback callback)
+    c))
+
+(defn get-stuff [ip]
+  (let [c (chan)]
+    (go
+      (let [url (format "http://freegeoip.net/json/%s" ip)
+            res (<! (async-get url))
+            parsed-val (json/read-str (:body res) :key-fn keyword)]
+        (>! c parsed-val)))
+    c))
+
+(defn -main [&]
+  (log/info "Starting")
+  (doseq [ln (line-seq (BufferedReader. *in*))]
+    (go
+      (let [res (<! (get-stuff ln))]
+        (log/info res)))))


Funtzio laguntzailea erabili

Funtzio laguntzailea erabili


www/AdminNorobotsResource.clj: created form for adding to 'norobots' docid set

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

--- src/org/altlaw/www/AdminNorobotsResource.clj
+++ src/org/altlaw/www/AdminNorobotsResource.clj
@@ -0,0 +1,49 @@
+(ns org.altlaw.www.AdminNorobotsResource
+  (:gen-class :extends org.restlet.resource.Resource)
+  (:require [org.altlaw.db.privacy :as privacy])
+  (:import (org.restlet.resource Variant StringRepresentation ResourceException)
+           (org.restlet.data Form MediaType Language CharacterSet Reference Status)))
+
+
+;;; RESOURCE METHODS
+
+(defn -allowGet [this] true)
+(defn -allowPost [this] true)
+(defn -allowPut [this] false)
+(defn -allowDelete [this] false)
+
+(defn -getVariants [this]
+  [(Variant. MediaType/TEXT_HTML)])
+
+(defn -acceptRepresentation [this entity]
+  (let [params (.getValuesMap (Form. entity))]
+    (assert (contains? params "docid"))
+    (let [docid (Integer/parseInt (get params "docid"))]
+      (privacy/add-norobots [docid])
+      (privacy/save-norobots)
+      (.. this getResponse
+          (setEntity (StringRepresentation.
+(str "<title>Docid No Robots</title>
+
+
Docid No Robots

+
Docid " docid " added to norobots.

+
Current norobots:

+
" (sort @(privacy/get-norobots)) "

+")
+                      MediaType/TEXT_HTML
+                      Language/ENGLISH_US
+                      CharacterSet/UTF_8))))))
+
+(defn -represent [this variant]
+  (StringRepresentation.
+   "<title>Docid No Robots</title>
+
+
Docid No Robots

+<form method=\"post\">
+
Docid
+<input name=\"docid\" type=\"text\" size=\"10\" />
+
<input type=\"submit\" value=\"Submit\" />

+
</form>"
+   MediaType/TEXT_HTML
+   Language/ENGLISH_US
+   CharacterSet/UTF_8))


Add test module

Add test module

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

--- src/clj/bluebell/utils/test.clj
+++ src/clj/bluebell/utils/test.clj
@@ -0,0 +1,4 @@
+(ns bluebell.utils.test)
+
+(defn near [a b tol]
+  (< (Math/abs (- a b)) tol))


Revert "Pass currency in SQS email message."

This reverts commit b3b820caaf86c78fbcce96791feed6636fee2b64.

--- src/open_company/lib/email.clj
+++ src/open_company/lib/email.clj
@@ -10,7 +10,6 @@
    :note schema/Str
    :reply-to (schema/maybe schema/Str)
    :company-slug schema/Str
-   :currency schema/Str
    :snapshot {schema/Keyword schema/Any}})

 (defn ctx->trigger [post-data {company :company user :user su :stakeholder-update}]
@@ -25,7 +24,6 @@
    :subject (:subject post-data)
    :note (:note post-data)
    :reply-to (:email user)
-   :currency (:currency company)
    :company-slug (:slug company)
    :snapshot su})


welch

welch

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


Sample animation on google maps

Sample animation on google maps

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


Trivial html invocation

Trivial html invocation

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


we want >= rather than <= on our read perms check.

--- src/metabase/models/common.clj
+++ src/metabase/models/common.clj
@@ -44,7 +44,7 @@
          public_perms    500 "Can't check user permissions: object doesn't have :public_perms.")
   (cond (:is_superuser *current-user*)   #{:read :write}    ; superusers have full access to everything
         (= creator_id *current-user-id*) #{:read :write}    ; if user created OBJ they have all permissions
-        (>= perms-read public_perms)     #{:read}           ; if the object is public then everyone gets :read
+        (<= perms-read public_perms)     #{:read}           ; if the object is public then everyone gets :read
         :else                            #{}))              ; default is user has no permissions a.k.a private

 (defn user-can?


remove accidental dependency

remove accidental dependency

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


Always destroy db before creating

Always destroy db before creating


CMR-1354 Add temporal range extractor file

error: pathspec 'search-app/src/cmr/search/services/query_walkers/temporal_range_extractor.clj' did not match any file(s) known to git

--- search-app/src/cmr/search/services/query_walkers/temporal_range_extractor.clj
+++ search-app/src/cmr/search/services/query_walkers/temporal_range_extractor.clj
@@ -0,0 +1,103 @@
+(ns cmr.search.services.query-walkers.temporal-range-extractor
+  "Defines protocols and functions to extract keywords from a query."
+  (:require [cmr.common.services.errors :as errors]
+            [cmr.common-app.services.search.query-model :as cqm]
+            [clojure.string :as str]
+            [cmr.search.models.query :as qm]))
+
+(defprotocol ExtractTemporalRanges
+  "Defines a function to extract temporal ranges"
+  (extract-temporal-ranges-seq
+    [c]
+    "Extracts keywords and keyword like values from keyword conditions and conditions which apply
+     to keywords scoring. Returns a sequence of the keywords."))
+  ; (contains-keyword-condition?
+  ;  [c]
+  ;  "Returns true if the query contains a keyword condition?"))
+
+(defn extract-temporal-ranges
+  "Extracts keywords and keyword like values from keyword conditions and conditions which apply
+   to keywords scoring. Returns a sequence of the distinct keywords or nil if there are none."
+  [c]
+  (proto-repl.saved-values/save 19)
+  (seq (extract-temporal-ranges-seq c)))
+
+(extend-protocol ExtractTemporalRanges
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  cmr.common_app.services.search.query_model.Query
+  (extract-temporal-ranges-seq
+   [query]
+   (extract-temporal-ranges-seq (:condition query)))
+  ; (contains-keyword-condition?
+  ;  [query]
+  ;  (contains-keyword-condition? (:condition query)))
+
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  cmr.common_app.services.search.query_model.ConditionGroup
+  (extract-temporal-ranges-seq
+   [{:keys [conditions]}]
+   (mapcat extract-temporal-ranges-seq conditions))
+  ; (contains-keyword-condition?
+  ;  [{:keys [conditions]}]
+  ;  (reduce (fn [_ condition]
+  ;            (when (contains-keyword-condition? condition)
+  ;              (reduced true)))
+  ;          false
+  ;          conditions))
+
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  cmr.common_app.services.search.query_model.NestedCondition
+  (extract-temporal-ranges-seq
+   [{:keys [condition]}]
+   (extract-temporal-ranges-seq condition))
+  ; (contains-keyword-condition?
+  ;  [{:keys [condition]}]
+  ;  (contains-keyword-condition? condition))
+
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  cmr.common_app.services.search.query_model.TextCondition
+  (extract-temporal-ranges-seq
+   [{:keys [field query-str]}]
+   (when (= field :keyword)
+     (extract-temporal-ranges-seq-from-value query-str)))
+  ; (contains-keyword-condition?
+  ;  [{:keys [field]}]
+  ;  (= field :keyword))
+
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  cmr.common_app.services.search.query_model.StringCondition
+  (extract-temporal-ranges-seq
+   [{:keys [field value]}]
+   (when (contains? keyword-string-fields field)
+     (extract-temporal-ranges-seq-from-value value)))
+  ; (contains-keyword-condition?
+  ;  [_]
+  ;  false)
+
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  cmr.common_app.services.search.query_model.StringsCondition
+  (extract-temporal-ranges-seq
+   [{:keys [field values]}]
+   (when (contains? keyword-string-fields field)
+     (mapcat extract-temporal-ranges-seq-from-value values)))
+  ; (contains-keyword-condition?
+  ;  [_]
+  ;  false)
+
+  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+  cmr.search.models.query.CollectionQueryCondition
+  (extract-temporal-ranges-seq
+   [_]
+   (errors/internal-error! "extract-temporal-ranges-seq does not support CollectionQueryCondition"))
+  ; (contains-keyword-condition?
+  ;  [_]
+  ;  (errors/internal-error! "contains-keyword-condition? does not support CollectionQueryCondition"))
+
+  ;; catch all extractor
+  java.lang.Object
+  (extract-temporal-ranges-seq
+   [this]
+   nil))
+  ; (contains-keyword-condition?
+  ;  [this]
+  ;  false))