btset check for contains? on conj

btset check for contains? on conj

--- src/datascript/btset.cljs
+++ src/datascript/btset.cljs
@@ -119,39 +119,43 @@
 (deftype Node [keys pointers]
   Object

-  (append [_ path level key]
-    (let [idx          (path-get path level)
-          nodes        (.append (aget pointers idx) path (- level level-shift) key)
-          new-keys     (replace-keys keys     idx           (.map nodes lim-key))
-          new-pointers (splice       pointers idx (inc idx) nodes)]
-      (if (<= (alength new-pointers) max-len)
-        ;; ok as is
-        #js [(Node. new-keys new-pointers)]
-        ;; gotta split it up
-        (let [middle  (half (alength new-pointers))]
-          #js [(Node. (cut new-keys     0 middle)
-                      (cut new-pointers 0 middle))
-               (Node. (cut new-keys     middle)
-                      (cut new-pointers middle))])))))
+  (append [this path level key]
+    (let [idx   (path-get path level)
+          nodes (.append (aget pointers idx) path (- level level-shift) key)]
+      (if (identical? (aget nodes 0) (aget pointers idx))
+        #js [this]
+        (let [new-keys     (replace-keys keys     idx           (.map nodes lim-key))
+              new-pointers (splice       pointers idx (inc idx) nodes)]
+          (if (<= (alength new-pointers) max-len)
+          ;; ok as is
+          #js [(Node. new-keys new-pointers)]
+          ;; gotta split it up
+          (let [middle  (half (alength new-pointers))]
+            #js [(Node. (cut new-keys     0 middle)
+                        (cut new-pointers 0 middle))
+                 (Node. (cut new-keys     middle)
+                        (cut new-pointers middle))])))))))

 (deftype LeafNode [keys]
   Object

-  (append [_ ^number path _ key]
+  (append [this ^number path _ key]
     (let [idx    (path-get path 0)
           keys-l (alength keys)]
-      (if (== keys-l max-len)
-        ;; splitting
-        (let [middle (half (inc keys-l))]
-          (if (> idx middle)
-            ;; new key goes to the second half
-            #js [(LeafNode. (cut keys 0 middle))
-                 (LeafNode. (cut-n-splice keys middle keys-l idx idx #js [key]))]
-            ;; new key goes to the first half
-            #js [(LeafNode. (cut-n-splice keys 0 middle idx idx #js [key]))
-                 (LeafNode. (cut keys middle keys-l))]))
-        ;; ok as is
-        #js [(LeafNode. (splice keys idx idx #js [key]))]))))
+      (cond
+        (eq key (aget keys idx)) ;; element already there
+          #js [this]
+        (== keys-l max-len) ;; splitting
+          (let [middle (half (inc keys-l))]
+            (if (> idx middle)
+              ;; new key goes to the second half
+              #js [(LeafNode. (cut keys 0 middle))
+                   (LeafNode. (cut-n-splice keys middle keys-l idx idx #js [key]))]
+              ;; new key goes to the first half
+              #js [(LeafNode. (cut-n-splice keys 0 middle idx idx #js [key]))
+                   (LeafNode. (cut keys middle keys-l))]))
+        :else ;; ok as is
+          #js [(LeafNode. (splice keys idx idx #js [key]))]))))

 (defn ^array keys-for [set ^number path]
   (loop [level (.-shift set)
@@ -309,11 +313,11 @@

 (defn test-rand []
   (dotimes [i 100]
-    (let [xs (range (rand-int 10000))
-          xss (shuffle xs)
-          s  (into (btset) xss)]
+    (let [xss (repeatedly (rand-int 10000) #(rand-int 10000))
+          xs  (distinct (sort xss))
+          s   (into (btset) xss)]
       (when-not (= (vec s) xs)
-        (println xss))))
+        (throw (js/Error. xss)))))
   (println "Checked")
   :ok)

@@ -321,20 +325,23 @@

 ;; perf

-(def test-matrix [:target  { ;; "sorted-set" (sorted-set)
-                             "btset"      (btset)}
+(def test-matrix [:target    { ;; "sorted-set" (sorted-set)
+                               "btset"      (btset)}
+                  :distinct? [true false]
 ;;                   :size    [100 500 1000 2000 5000 10000 20000 50000]
-                  :size    [100 500 20000]
-                  :method  { "conj"    (fn [opts] (into (:target opts) (:range opts)))
-                             "lookup"  (fn [opts] (contains? (:set opts) (rand-int (:size opts))))
-                             "iterate" (fn [opts] (doseq [x (:set opts)] (+ 1 x)))
-                            }])
+                  :size      [100 500 20000]
+                  :method    { "conj"    (fn [opts] (into (:target opts) (:range opts)))
+;;                                "lookup"  (fn [opts] (contains? (:set opts) (rand-int (:size opts))))
+;;                                "iterate" (fn [opts] (doseq [x (:set opts)] (+ 1 x)))
+                             }])

 (defn test-setup [opts]
-  (let [range (shuffle (range (:size opts)))]
+  (let [xs (if (:disticnt? opts)
+             (shuffle (range (:size opts)))
+             (repeatedly (:size opts) #(rand-int (:size opts))))]
     (-> opts
-        (assoc :range range)
-        (assoc :set (into (:target opts) range)))))
+        (assoc :range xs)
+        (assoc :set (into (:target opts) xs)))))

 (defn ^:export perftest []
   (perf/suite (fn [opts] ((:method opts) opts))


Add build-category-id-test

Add build-category-id-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/magoyette/marcandregoyette.com.git/'


Add test for report lines generation

Add test for report lines generation

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

--- test/clj_gatling/report_test.clj
+++ test/clj_gatling/report_test.clj
@@ -0,0 +1,36 @@
+(ns clj-gatling.report-test
+  (:use clojure.test)
+  (:require [clj-gatling.report :as report]))
+
+(def scenario-result
+  [{:name "Test scenario" :id 1 :start 1391936496814 :end 1391936496814
+    :requests [{:id 1 :name "Request1" :start 1391936496853 :end 1391936497299 :result "OK"}
+               {:id 1 :name "Request2" :start 1391936497299 :end 1391936497996 :result "OK"}]}
+   {:name "Test scenario" :id 0 :start 1391936496808 :end 1391936496808
+    :requests [{:id 0 :name "Request1" :start 1391936497998 :end 1391936498426 :result "OK"}
+               {:id 0 :name "Request2" :start 1391936498430 :end 1391936498450 :result "OK"}]}])
+
+(def expected-lines
+  [["RUN" "20140209110136" "simulation" "\u0020"]
+   ["SCENARIO" "Test scenario" "1" "1391936496814" "1391936496814"]
+   ["REQUEST" "Test scenario" "1" "" "Request1" "1391936496853" "1391936496853" "1391936497299" "1391936497299" "OK" "\u0020"]
+   ["REQUEST" "Test scenario" "1" "" "Request2" "1391936497299" "1391936497299" "1391936497996" "1391936497996" "OK" "\u0020"]
+   ["SCENARIO" "Test scenario" "0" "1391936496808" "1391936496808"]
+   ["REQUEST" "Test scenario" "0" "" "Request1" "1391936497998" "1391936497998" "1391936498426" "1391936498426" "OK" "\u0020"]
+   ["REQUEST" "Test scenario" "0" "" "Request2" "1391936498430" "1391936498430" "1391936498450" "1391936498450" "OK" "\u0020"]])
+
+(defn run-line-match [expected actual]
+  (is (= (first expected) (first actual))))
+
+(defn scenario-line-match [expected actual]
+  (is (= (second expected) (second actual))))
+
+(defn request-line-match [expected actual]
+  (is (= (nth expected 2) (nth actual 2))))
+
+(deftest maps-scenario-results-to-log-lines
+  (let [result-lines (report/create-result-lines scenario-result)]
+    (run-line-match expected-lines result-lines)
+    (scenario-line-match expected-lines result-lines)
+    (request-line-match expected-lines result-lines)
+    (is (= expected-lines result-lines))))


Holy crap optical flow is doing something.

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

--- src/videotest/optical_flow_lk.clj
+++ src/videotest/optical_flow_lk.clj
@@ -0,0 +1,159 @@
+(ns videotest.optical-flow-lk
+  (:require
+   [quil.core :as q]
+   [quil.middleware :as m])
+  (:import
+   [org.opencv.highgui Highgui VideoCapture]
+   [org.opencv.core CvType Mat MatOfByte MatOfFloat MatOfPoint MatOfPoint2f]
+   [org.opencv.imgproc Imgproc]
+   [org.opencv.video Video]
+   [java.nio ByteBuffer ByteOrder]))
+
+(def WIDTH 640)
+(def HEIGHT 480)
+
+;; pixCnt1 is the number of bytes in the pixel buffer
+;; pixCnt2 is the number of integers in the PImage pixels buffer
+(def PIX-CNT1 (* WIDTH HEIGHT 4))
+(def PIX-CNT2 (* WIDTH HEIGHT))
+
+
+;; OpenCV Implementation Wrapper - Will move to separate NS.
+(defn camera [dev]
+  (VideoCapture. dev))
+
+(defn is-opened? [cam]
+  (.isOpened cam))
+
+(defn grab-frame!
+  "Updates a CV Mat with image from camera."
+  [cam frame]
+  (.read cam frame)
+  frame)
+
+;; <--End OpenCV Implementation Wrapper
+
+
+;; bArray is the temporary byte array buffer for OpenCV cv::Mat.
+;; iArray is the temporary integer array buffer for PImage pixels.
+(defn setup []
+  #_(q/frame-rate 60)
+  {:b-array (byte-array PIX-CNT1)
+   :i-array (int-array PIX-CNT2)
+   :frame-mat (Mat. WIDTH HEIGHT CvType/CV_8UC3)
+   :output-mat (Mat. WIDTH HEIGHT CvType/CV_8UC4)
+   :old-gray-mat nil
+   :old-corners nil
+   :new-gray-mat (Mat.)
+   :new-corners (MatOfPoint2f.)
+   :lk-status (MatOfByte.)
+   :lk-err (MatOfFloat.)
+   :camera (camera 0)
+   :p-image (q/create-image WIDTH HEIGHT :rgb)})
+
+(defn update-frame [state]
+  (let [{:keys [camera]} state]
+    (cond-> state
+            (is-opened? camera)
+            (update-in [:frame-mat] (partial grab-frame! camera) ))))
+
+(defn mat->p-img [in-mat out-mat b-array i-array p-img]
+  (Imgproc/cvtColor in-mat out-mat Imgproc/COLOR_RGB2RGBA 4)
+  (.get out-mat 0 0 b-array)
+  (-> (ByteBuffer/wrap b-array)
+      (.order ByteOrder/LITTLE_ENDIAN)
+      (.asIntBuffer)
+      (.get i-array))
+  (.loadPixels p-img)
+  (set! (.pixels p-img) (aclone i-array))
+  (.updatePixels p-img)
+  p-img)
+
+(defn update-p-image [state]
+  (let [{:keys [frame-mat output-mat b-array i-array]} state]
+    (update-in state [:p-image] #(mat->p-img frame-mat output-mat b-array i-array %))))
+
+(defn BGR->GrayMat! [m gray-mat]
+  (Imgproc/cvtColor m gray-mat Imgproc/COLOR_BGR2GRAY)
+  gray-mat)
+
+(defn update-corners! [gray-mat corners]
+  (let [max-corners 100
+        quality-level 0.3
+        min-dist 7
+        pts (MatOfPoint.)]
+    (Imgproc/goodFeaturesToTrack gray-mat pts max-corners quality-level min-dist)
+    (.convertTo pts corners CvType/CV_32FC2)
+    corners))
+
+(defn init-gray-mat [{:keys [frame-mat old-gray-mat] :as state}]
+  (if (nil? old-gray-mat)
+    (let [old-gray-mat (BGR->GrayMat! frame-mat (Mat.))]
+      (-> state
+          (assoc-in [:old-gray-mat] old-gray-mat)
+          (assoc-in [:old-corners] (update-corners! old-gray-mat (MatOfPoint2f.)))))
+    (let [{:keys [old-gray-mat old-corners new-gray-mat new-corners]} state]
+      (.copyTo new-gray-mat old-gray-mat)
+      (.copyTo new-corners old-corners)
+      (-> state
+          (assoc-in [:old-gray-mat] old-gray-mat)
+          (assoc-in [:old-corners] old-corners)))))
+
+(defn update-optical-flow [state]
+  (let [{:keys [frame-mat new-gray-mat new-corners old-gray-mat old-corners lk-status lk-err]} state]
+    (BGR->GrayMat! frame-mat new-gray-mat)
+    (update-corners! new-gray-mat new-corners)
+    (Video/calcOpticalFlowPyrLK old-gray-mat new-gray-mat old-corners new-corners lk-status lk-err)
+    (-> state
+        (assoc-in [:new-gray-mat] new-gray-mat)
+        (assoc-in [:new-corners] new-corners)
+        (assoc-in [:lk-status] lk-status)
+        (assoc-in [:lk-err] lk-err))))
+
+(defn update [state]
+  (-> state
+      (update-frame)
+      (update-p-image)
+      (init-gray-mat)
+      (update-optical-flow)))
+
+(defn draw-pt [pt]
+  (let [x (.x pt)
+        y (.y pt)]
+    (q/push-style)
+    (q/no-stroke)
+    (q/fill 0 255 0 150)
+    (q/ellipse x y 20 20)
+    (q/pop-style)))
+
+(defn draw-flow [{:keys [new-corners lk-status] :as state}]
+  (let [pts (.toList new-corners)]
+    (when (< 0 (count pts))
+      (let [status (.toList lk-status)
+            z (filter (fn [[_ s]] (= 1 s))
+                      (map vector pts status))]
+        (dorun
+         (map (fn [[p _]] (draw-pt p))
+              z))))))
+
+(defn draw [state]
+  (let [{:keys [p-image]} state]
+    (q/background 0)
+    (q/image p-image 0 0)
+    (draw-flow state)))
+
+(defn on-close
+  ([{:keys [camera]}]
+     (println "closing sketch and releasing camera...")
+     (when-not (nil? camera)
+       (.release camera))))
+
+(q/defsketch videotest
+  :title "Video Test"
+  :size [WIDTH HEIGHT]
+  :setup setup
+  ;; something for on-close??? (.release camera)
+  :update update
+  :draw draw
+  :on-close on-close
+  :middleware [m/fun-mode])


add nested stats support: i.e. near-cache

--- dash/src/clj/hface/stats.clj
+++ dash/src/clj/hface/stats.clj
@@ -38,13 +38,24 @@
              (warn "could not read stats from node [" host "]: " (.getMessage t)))))
       (member-statuses instance))))

+(defn merge-nested
+  "to aggregate nested maps: i.e. [{:map-stats {:near-cache ...}}
+                                   {:map-stats {:near-cache ...}}]"
+  [v1 v2]
+  (let [add (fn [x y] (if (number? x)
+                        (+' x y)
+                        x))]
+    (if-not (map? v1)
+      (add v1 v2)
+      (apply merge-with add [v1 v2]))))
+
 (defn merge-stats [kind i-stats]
   (let [ms (map #(-> % :member-state kind) i-stats)
         ms (->> ms
                 (apply interleave)
                 (group-by first))
         groupped (do-with-values ms #(map second %))]
-    {kind (do-with-values groupped #(apply merge-with +' %))}))
+    {kind (do-with-values groupped #(apply merge-with merge-nested %))}))

 (defn aggregate-across-cluster [i-stats]
   (into {}


working finding x, o in a row

working finding x, o in a row

error: pathspec 'src/4clojure/analyze-tic-tac-toe.clj' did not match any file(s) known to git

--- src/4clojure/analyze-tic-tac-toe.clj
+++ src/4clojure/analyze-tic-tac-toe.clj
@@ -0,0 +1,65 @@
+;; Analyze a Tic-Tac-Toe Board
+;; http://www.4clojure.com/problem/73
+;; Difficulty:	Hard
+;; Topics:	game
+
+;; A tic-tac-toe board is represented by a two dimensional vector. X is represented by :x, O is represented by :o, and empty is represented by :e. A player wins by placing three Xs or three Os in a horizontal, vertical, or diagonal row. Write a function which analyzes a tic-tac-toe board and returns :x if X has won, :o if O has won, and nil if neither player has won.
+
+(defn __ [board]
+  nil)
+
+
+(= nil (__ [[:e :e :e]
+            [:e :e :e]
+            [:e :e :e]]))
+
+(= :x (__ [[:x :e :o]
+           [:x :e :e]
+           [:x :e :o]]))
+
+(= :o (__ [[:e :x :e]
+           [:o :o :o]
+           [:x :e :x]]))
+
+(= nil (__ [[:x :e :o]
+            [:x :x :e]
+            [:o :x :o]]))
+
+(= :x (__ [[:x :e :e]
+           [:o :x :e]
+           [:o :e :x]]))
+
+(= :o (__ [[:x :e :o]
+           [:x :o :e]
+           [:o :e :x]]))
+
+(= nil (__ [[:x :o :x]
+            [:x :o :x]
+            [:o :x :o]]))
+
+[[:e :e :e]
+ [:e :e :e]
+ [:e :e :e]]
+
+(let [row [:x :x :x]
+      f (first row)
+      a (apply = row)]
+  (if (and a (not= f :e)) f nil))
+
+(reduce
+ #(let [f (first %)
+       a (apply = %)]
+   (if (and a (not= f :e)) f nil))
+[[:e :e :e]
+ [:e :e :e]
+ [:e :e :e]])
+
+;; find :x or :o in a row
+(->> (map
+      #(let [f (first %)
+             a (apply = %)]
+         (if (and a (not= f :e)) f nil))
+      [[:x :x :x]
+       [:e :e :e]
+       [:e :e :e]])
+     (filter #(or (= % :x) (= % :o))))


finish ch.5

finish ch.5

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


Add reload

Add reload

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

--- src/main/clojure/lazytest/reload.clj
+++ src/main/clojure/lazytest/reload.clj
@@ -0,0 +1,9 @@
+(ns lazytest.reload)
+
+(defn reload
+  "Removes all namespaces named by symbols, then reloads them all."
+  [& symbols]
+  (doseq [sym symbols]
+    (remove-ns sym))
+  (doseq [sym symbols]
+    (require sym :reload)))


define-syntax: now properly recognizeing only one 2720ellipsis and setting literals as keywords so they are properly handled during cljs evaluation

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/parenode/clojure-cup-2015.git/'


dox fix

dox fix

--- src/metabase/api/common/internal.clj
+++ src/metabase/api/common/internal.clj
@@ -123,7 +123,7 @@
            :body (.getMessage e#)})))

 (defn wrap-response-if-needed
-  "If RESPONSE isn't already a map with keys :status and :body, wrap it in one (using status 200)."
+  "If RESPONSE isn't already a map with keys `:status` and `:body`, wrap it in one (using status 200)."
   [response]
   (letfn [(is-wrapped? [resp] (and (map? resp)
                                    (contains? resp :status)


Make default RabbitMQ connection params work

...even when env vars are in config.edn but not set in the environment. resource-config makes it very difficult to have default values for env vars. This isn't great either, but at least it works.

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


Add pirate ship generator

Add pirate ship generator

error: pathspec 'src/cljc/robinson/dungeons/pirateship.cljc' did not match any file(s) known to git

--- src/cljc/robinson/dungeons/pirateship.cljc
+++ src/cljc/robinson/dungeons/pirateship.cljc
@@ -0,0 +1,123 @@
+;; Functions for randomly generating pirate ships
+(ns robinson.dungeons.pirateship
+  (:require [clojure.math.combinatorics :as combo]
+            [algotools.algos.graph :as graph]
+            [taoensso.timbre :as timbre]
+            [rockpick.core :as rpc]
+            clojure.set))
+
+(defn canvas
+  "Create a blank grid using `nil` for cell values."
+  [width height]
+  (vec (repeat height (vec (repeat width nil)))))
+
+(defn read-level-data [level]
+  {:pre [(<= 0 level 1)]}
+  (let [files (filter (fn [file] (re-matches (re-pattern (format ".*%d-\\d.xp" level)) (.getName file)))
+                      (file-seq (clojure.java.io/file "data/ship")))
+        paths (map (fn [file] (.getPath file)) files)
+        ships (map (fn [file] (rpc/read-xp (clojure.java.io/input-stream (.getPath file)))) files)]
+    {:fore (map (fn [ship] (map (fn [line] (subvec line 0 30)) (nth ship 0))) ships)
+     :mid  (map (fn [ship] (map (fn [line] (subvec line 30 46)) (nth ship 0))) ships)
+     :aft  (map (fn [ship] (map (fn [line] (subvec line 46 80)) (nth ship 0))) ships)}))
+
+(defn make-ship [level]
+  (let [level-data (read-level-data level)
+        _ (println "n-fore" (count (get level-data :fore)))
+        _ (println "n-mid" (count (get level-data :mid)))
+        _ (println "n-aft" (count (get level-data :aft)))
+        fore       (rand-nth (get level-data :fore))
+        mid        (rand-nth (get level-data :mid))
+        aft        (rand-nth (get level-data :aft))]
+    (mapv concat fore mid aft)))
+
+(def brown {:r 51 :g 41 :b 26})
+(def ^{:private true} tiles (atom {}))
+
+(defn make-tile
+  [ch decimal-codepoint cell-type]
+  (let [kw   (keyword (str ch))
+        tile {:kw                kw
+              :ch                ch
+              :decimal-codepoint decimal-codepoint
+              :unicode-codepoint (int ch)
+              :type              cell-type}]
+    (swap! tiles (fn [tiles]
+                   (assoc tiles
+                          kw tile
+                          ch  tile
+                          decimal-codepoint tile
+                          (int ch) tile
+                          cell-type tile)))
+    tile))
+
+(defn lookup-tile [k]
+  (get @tiles k))
+
+(def wooden-wall (make-tile \#  35 :wooden-wall))
+(def deck        (make-tile \.  46 :deck))
+(def close-door  (make-tile \+  43 :close-door))
+(def up-stairs   (make-tile \<  60 :up-stairs))
+(def down-stairs (make-tile \>  62 :down-stairs))
+(def tackle      (make-tile \º 167 :tackle))
+(def grate       (make-tile \╬ 206 :grate))
+(def table       (make-tile \╤ 209 :table))
+(def chair       (make-tile \╥ 210 :chair))
+(def mast        (make-tile \╨ 208 :mast))
+(def beam        (make-tile \═ 205 :beam))
+(def ships-wheel (make-tile \Φ 232 :ships-wheel))
+(def ladder      (make-tile \≡ 240 :ladder))
+(def porthole    (make-tile \° 248 :porthole))
+(def chest       (make-tile \■ 254 :chest))
+
+(defn ship->cells
+  [ship]
+  (mapv (fn [line]
+         (map (fn [{ch :ch :as tile}]
+                (if (contains? #{nil \space} ch)
+                  nil
+                  {:type (-> ch
+                           int
+                           lookup-tile
+                           :type)}))
+              line))
+        ship))
+
+(defn random-place
+  "Create a grid of random rooms with corridors connecting them and doors
+   where corridors connect to rooms."
+  [width height]
+  (let [ship (make-ship 0)
+        cells (ship->cells ship)]
+    {:place cells}))
+;        upstairs     (conj [(first room-centers)] {:type :up-stairs})
+;        downstairs   (conj [(last room-centers)] {:type :down-stairs})]
+;    {:place (apply merge-with-canvas (canvas width height)
+;                   (concat corridors rooms))
+;     :up-stairs upstairs
+;     :down-stairs downstairs}))
+
+(defn place-to-ascii
+  "Convert a grid of cells into a list of strings so that it can be rendered."
+  [place]
+  (let [contents (map (fn [line]
+                        (let [chs (mapv (fn [cell]
+                                          (if (nil? cell)
+                                              \
+                                             (or
+                                               (-> cell
+                                                 :type
+                                                 lookup-tile
+                                                 :ch)
+                                               \ )))
+                                        line)]
+                          (clojure.string/join chs)))
+                      place)]
+    contents))
+
+(defn -main
+  "Generate a random grid and print it out."
+  [& args]
+  (println "generating...")
+  (doall (map println (place-to-ascii (get (random-place 80 25) :place)))))
+


tidy docstrings

tidy docstrings

--- src/overtone/helpers/lib.clj
+++ src/overtone/helpers/lib.clj
@@ -1,5 +1,5 @@
-(ns
-    ^{:doc "Library of general purpose utility functions for Overtone internals."
+(ns ^{:doc "Library of general purpose utility functions for Overtone
+            internals."
       :author "Jeff Rose and Sam Aaron"}
   overtone.helpers.lib
   (:import [java.util ArrayList Collections]
@@ -17,7 +17,8 @@
   (if (keyword? val) (name val) val))

 (defn to-float
-  "If val is a number or bool, return its float equivalent otherwise return val"
+  "If val is a number or bool, return its float equivalent otherwise
+   return val"
   [val]
   (cond
     (number? val) (float val)
@@ -32,10 +33,10 @@
     val))

 (defn floatify-truth
-  "Convert truth values to 0 or 1 using most of the standard Clojure truth
-  semantics:  everything that's not nil or false is 1 otherwise 0. The exception
-  to this allows for the preservation of number truth values, so an input of 0
-  maps to 0, and an input of 1 maps to 1."
+  "Convert truth values to 0 or 1 using most of the standard Clojure
+   truth semantics: everything that's not nil or false is 1 otherwise
+   0. The exception to this allows for the preservation of number truth
+   values, so an input of 0 maps to 0, and an input of 1 maps to 1."
   [obj]
   (let [obj (if (number? obj) (float obj) obj)
         truthy (float 1)
@@ -61,10 +62,9 @@
   [col]
   (map to-keyword col))

-                                        ; Now available in recent Clojure versions as of Nov. 29, 2009...
-                                        ;(defn byte-array [len]
-                                        ;  (make-array (. Byte TYPE) len))
-
+;; Now available in recent Clojure versions as of Nov. 29, 2009...
+;;(defn byte-array [len]
+;;  (make-array (. Byte TYPE) len))
 (def BYTE-ARRAY (byte-array 1))

 (defn byte-array? [obj]
@@ -74,8 +74,8 @@
   (fn [obj] (and (map? obj) (= (:type obj) t))))

 (defn uuid
-  "Creates a random, immutable UUID object that is comparable using the '='
-  function."
+  "Creates a random, immutable UUID object that is comparable using the
+  '=' function."
   [] (. java.util.UUID randomUUID))

 (defn cpu-count
@@ -84,7 +84,8 @@
   (.availableProcessors (Runtime/getRuntime)))

 (defn map-vals
-  "Takes a map m and returns a new map with all of m's values mapped through f"
+  "Takes a map m and returns a new map with all of m's values mapped
+   through f"
   [f m]
   (zipmap (keys m)
           (map f (vals m))))
@@ -97,11 +98,15 @@
     (getValue [] v)))

 (defn callable-map
-  "Create a map-like datastructure which overrides it's behaviour when called as
-  a fn from lookup to an arbitrary fn you specify at creation time."
+  "Create a map-like datastructure which overrides it's behaviour when
+   called as a fn from lookup to an arbitrary fn you specify at creation
+   time."
   ([m fun] (callable-map m fun {}))
   ([m fun metadata]
-     (proxy [clojure.lang.Associative clojure.lang.IFn clojure.lang.IObj clojure.lang.IMeta]
+     (proxy [clojure.lang.Associative
+             clojure.lang.IFn
+             clojure.lang.IObj
+             clojure.lang.IMeta]
          []
        (count       [] (count m))
        (seq         [] (seq m))
@@ -123,10 +128,11 @@
        (meta       [] metadata))))

 (defmacro defrecord-ifn
-  "A helper macro for creating callable records with a var-args function.
-  It generates all arities of invoke, calling the function.  Besides generating
-  the clojure.lang.IFn implementation, you can declare any other implementations
-  as you would normally with defrecord."
+  "A helper macro for creating callable records with a var-args
+   function.  It generates all arities of invoke, calling the function.
+   Besides generating the clojure.lang.IFn implementation, you can
+   declare any other implementations as you would normally with
+   defrecord."
   [rec-name fields invoke_fn & body]
   `(defrecord ~rec-name ~fields
      ~@body
@@ -158,18 +164,19 @@
    Creates a map of arg names to args using the defaults as the starting
    point.

-   The args should be passed in the order 'ordered params', 'keyword params'
-   such as the following:  [1 2 3 :d 4 :f 5]
-   where 1 2 and 3 are ordered params and
-   4 and 5 are named params (associated with :d and :f respectively).
-
-   If the expected args is the list [:a :b :c :d :f] then the resulting map
-   will look as follows: {:a 1 :b 2 :c 3 :d 5 :f 5}. If the defaults contains
-   extra keys, these will be merged in with any clashes being overridden with
-   the result map, so if the default map is {:a 99 :h 2} the final output will
-   be {:a 1 :b 2 :c 3 :d 4 :f 5 :h 2}.
-
-   It is assumed that the values passed in as the args are *not* keywords."
+   The args should be passed in the order 'ordered params', 'keyword
+   params' such as the following: [1 2 3 :d 4 :f 5] where 1 2 and 3 are
+   ordered params and 4 and 5 are named params (associated with :d
+   and :f respectively).
+
+   If the expected args is the list [:a :b :c :d :f] then the resulting
+   map will look as follows: {:a 1 :b 2 :c 3 :d 5 :f 5}. If the defaults
+   contains extra keys, these will be merged in with any clashes being
+   overridden with the result map, so if the default map is {:a 99 :h 2}
+   the final output will be {:a 1 :b 2 :c 3 :d 4 :f 5 :h 2}.
+
+   It is assumed that the values passed in as the args are *not*
+   keywords."
   [args arg-names default-map]
   (loop [args args
          names arg-names
@@ -203,10 +210,11 @@
            ~@body)))))

 (defn invert-map
-  "Takes a map m and returns a new map that's keys are the m's vals and that's
-  vals are m's keys. Assumes that m's keys and vals are both sets (i.e. don't
-  contain any duplicates). If there are duplicate values in the map they will
-  result in key collisions and a smaller result map.
+  "Takes a map m and returns a new map that's keys are the m's vals and
+   that's vals are m's keys. Assumes that m's keys and vals are both
+   sets (i.e. don't contain any duplicates). If there are duplicate
+   values in the map they will result in key collisions and a smaller
+   result map.

    (invert-map {:a 1, :b 2, :c 3}) ;=> {1 :a, 2 :b, 3 :c}"
   [m]
@@ -215,9 +223,9 @@

 (defn update-all
   "Update a value retrieved with the key k in each element of a seq of
-  maps by applying f to the current value.
-
-  (update-all [{:a 1} {:a 2}] :a inc) ;=> ({:a 2} {:a 3})
+   maps by applying f to the current value.
+
+   (update-all [{:a 1} {:a 2}] :a inc) ;=> ({:a 2} {:a 3})
   "
   [maps k f]
   (map (fn [elem]
@@ -225,12 +233,12 @@
        maps))

 (defn update-every-n
-  "Update every nth element in a seq of maps, optionally offset from the start, by
-  applying f to the current value.
-
-  (update-every-n [{:a 1} {:a 2} {:a 3} {:a 4} {:a 5}] 2 1 :a #(* 10 %))
-
-  ;=> ({:a 1} {:a 20} {:a 3} {:a 40} {:a 5})
+  "Update every nth element in a seq of maps, optionally offset from the
+   start, by applying f to the current value.
+
+   (update-every-n [{:a 1} {:a 2} {:a 3} {:a 4} {:a 5}] 2 1 :a #(* 10 %))
+
+   ;=> ({:a 1} {:a 20} {:a 3} {:a 40} {:a 5})
   "
   ([maps n k f]
      (update-every-n maps n 0 k f))
@@ -248,8 +256,8 @@
 (def DEFAULT-PROMISE-TIMEOUT 5000)

 (defn deref!
-  "Read a future or promise waiting for timeout ms for it to be successfully
-  dereferenced. Raises an exception if a timeout occurs"
+  "Read a future or promise waiting for timeout ms for it to be
+   successfully dereferenced. Raises an exception if a timeout occurs"
   ([ref] (deref! ref DEFAULT-PROMISE-TIMEOUT))
   ([ref timeout]
      (let [timeout-indicator (gensym "deref-timeout")
@@ -291,10 +299,11 @@
 ")))

 (defn normalize-ugen-name
-  "Normalizes both SuperCollider and overtone-style names to squeezed lower-case.
-
-  This produces strings that may be used to represent unique ugen keys that can be
-  generated from both SC and Overtone names.
+  "Normalizes both SuperCollider and overtone-style names to squeezed
+   lower-case.
+
+  This produces strings that may be used to represent unique ugen keys
+  that can be generated from both SC and Overtone names.

   (normalize-ugen-name \"SinOsc\")  ;=> \"sinosc\"
   (normalize-ugen-name \"sin-osc\") ;=> \"sinosc\""
@@ -302,8 +311,8 @@
   (.replaceAll (.toLowerCase (str n)) "[-|_]" ""))

 (defn overtone-ugen-name
-  "A basic camelCase to with-dash name converter tuned to convert SuperCollider
-  names to Overtone names. Most likely needs improvement.
+  "A basic camelCase to with-dash name converter tuned to convert
+   SuperCollider names to Overtone names. Most likely needs improvement.

   (overtone-ugen-name \"SinOsc\") ;=> \"sin-osc\""
   [n]
@@ -349,9 +358,9 @@
   default-clause* => result-expr

   Evaluates the test-expression 'e' and looks for a matching
-  test-constant in the clauses. Expands to the result-expression of
-  the matching clause or nil if no match is found and no
-  default-expression is provided."
+  test-constant in the clauses. Expands to the result-expression of the
+  matching clause or nil if no match is found and no default-expression
+  is provided."
   [e & clauses]
   (let [default (when (odd? (count clauses))
                   (last clauses))


[WM JE] add CWD to allowed FTP commands because testing client lib runs it

Is this safe? Do we need to do anything to make sure clients can't change to /tmp and fill the disk (for example)?

The alternative would be to fork & fix the client lib or approach testing differently.

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


Add some pretty drafty tests

Add some pretty drafty tests

Add test.check tests for add-tags-txd. They are quite sensible, I think,
and they pass right now. However, there's a lot of duplication and ugly
code. So I'll have to fix that.

error: pathspec 'test/clj/theatralia/database/t_txd_gen.clj' did not match any file(s) known to git

--- test/clj/theatralia/database/t_txd_gen.clj
+++ test/clj/theatralia/database/t_txd_gen.clj
@@ -0,0 +1,65 @@
+(ns theatralia.database.t-txd-gen
+  (:require [midje.sweet :refer :all]
+            [clojure.test.check :as tc]
+            [clojure.test.check.generators :as gen]
+            [clojure.test.check.properties :as prop]
+            [theatralia.test.utils :refer [quick-check]]
+            [com.stuartsierra.component :as component]
+            [datomic.api :as d]
+            [theatralia.database.canned-queries :as qcan]
+            [theatralia.database.component :as db-component]
+            [theatralia.database.txd-gen :as nut])) ; namespace under test
+
+;;; Credits: http://yellerapp.com/posts/2014-05-07-testing-datomic.html
+
+(defn empty-db-conn
+  []
+  (-> (db-component/make-database "datomic:mem://theatralia-test")
+      component/start
+      :conn))
+
+(defn empty-db
+  []
+  (d/db (empty-db-conn)))
+
+(defn suppose [db txd]
+  (:db-after (d/with db txd)))
+
+(defn contains-all? [haystack needles]
+  (every? (set haystack) needles))
+
+(facts "about add-tags-txd"
+  (fact "After transacting the results, all tags should be present in DB."
+    (let [db (empty-db)
+          owner-eid (qcan/get-sandbox-eid db)]
+      (prop/for-all [tags (gen/vector gen/string)]
+        (let [db-after (suppose db ((nut/add-tags-txd db tags owner-eid) 1))
+              tags-after (d/q '[:find [?t ...]
+                                :in $ ?o
+                                :where [?e :tag/text ?t]
+                                       [?e :tag/owner ?o]]
+                              db-after owner-eid)]
+          (contains-all? tags-after tags))))
+    => (quick-check 100))
+
+  (fact "After transacting once, the result of the second run should be empty."
+    (let [db (empty-db)
+          owner-eid (qcan/get-sandbox-eid db)]
+      (prop/for-all [tags (gen/vector gen/string)]
+        (let [db-after (suppose db ((nut/add-tags-txd db tags owner-eid) 1))
+              new-txd (nut/add-tags-txd db-after tags owner-eid)]
+          (empty? (new-txd 1)))))
+    => (quick-check 100))
+
+  (fact "There should be no two tags with the same text and owner-eid."
+    (let [db (empty-db)
+          owner-eid (qcan/get-sandbox-eid db)]
+      (prop/for-all [tags (gen/vector gen/string)]
+        (let [db-after (suppose db ((nut/add-tags-txd db tags owner-eid) 1))
+              tags-after (d/q '[:find [?t ...]
+                                :in $ ?o
+                                :where [?e :tag/text ?t]
+                                [?e :tag/owner ?o]]
+                              db-after owner-eid)]
+          (apply distinct? tags-after))))
+    => (quick-check 100)))


sudoku (initial commit)

sudoku (initial commit)

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


get ready for query logging

get ready for query logging

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


New (empty) module: database interface

New (empty) module: database interface

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

--- src/emender_jenkins/db_interface.clj
+++ src/emender_jenkins/db_interface.clj
@@ -0,0 +1,19 @@
+;
+;  (C) Copyright 2017  Pavel Tisnovsky
+;
+;  All rights reserved. This program and the accompanying materials
+;  are made available under the terms of the Eclipse Public License v1.0
+;  which accompanies this distribution, and is available at
+;  http://www.eclipse.org/legal/epl-v10.html
+;
+;  Contributors:
+;      Pavel Tisnovsky
+;
+
+(ns emender-jenkins.db-interface
+    "Namespace that contains interface to the database.")
+
+(require '[clojure.java.jdbc       :as jdbc])
+
+(require '[emender-jenkins.db-spec     :as db-spec])
+


added test/example/simplemidi.clj

added test/example/simplemidi.clj

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

--- test/example/simplemidi.clj
+++ test/example/simplemidi.clj
@@ -0,0 +1,43 @@
+(ns example.midi
+  (:use overtone.live))
+
+;; Use (midi-in) with no parameters in the repl to find out the details
+;; of your midi keyboard.
+;; Try using the contents of :name or :description or a substring of either.
+
+(def kb (midi-in "nanokey"))
+
+;; Define an inst. If you want it to respond to note off messages
+;; then ensure it responds to (ctl <proc number> :gate 0)
+;; An adsr ugen will do this
+
+(definst pad2 [freq 440 vel 0.4 amt 0.3 gate 1.0]
+  (let [vel        (+ 0.5 (* 0.5 vel))
+        env        (env-gen (adsr 0.01 0.1 0.7 0.5) gate 1 0 1 :free)
+        f-env      (env-gen (perc 1 3))
+        src        (saw [freq (* freq 1.01)])
+        signal     (rlpf (* 0.3 src)
+                         (+ (* 0.6 freq) (* f-env 2 freq)) 0.2)
+        k          (/ (* 2 amt) (- 1 amt))
+        distort    (/ (* (+ 1 k) signal) (+ 1 (* k (abs signal))))
+        gate       (pulse (* 2 (+ 1 (sin-osc:kr 0.05))))
+        compressor (compander distort gate 0.01 1 0.5 0.01 0.01)
+        dampener   (+ 1 (* 0.5 (sin-osc:kr 0.5)))
+        reverb     (free-verb compressor 0.5 0.5 dampener)
+        echo       (comb-n reverb 0.4 0.3 0.5)]
+    (* vel env echo)))
+
+;; Create a map to store the note/proc-number tuples so we can
+;; switch off the correct note when a note-off is recieved
+
+(def mem (atom {}))
+
+(defn midi-responder [e t]
+  (case (:cmd e)
+        :note-on (let [id (pad2 (midi->hz (:note e)))]
+                     (swap! mem assoc (:note e) id))
+
+        :note-off (let [id (get @mem (:note e))]
+                    (ctl id :gate 0))))
+
+(midi-handle-events kb #'midi-responder)


Added test-merge-attributes-let.

Added test-merge-attributes-let.

--- test/sablono/core_test.cljs
+++ test/sablono/core_test.cljs
@@ -344,4 +344,8 @@
   (is (= "

"
          (html-str [:div.interaction-row {:style {:position "relative"}}]))))

+(deftest test-merge-attributes-let
+  (let [classes (merge {:id "a"} {:className "b"})]
+    (is (= "
content
" (html-str [:div classes "content"])))))
+
 (comment (run-tests))


rendering css

rendering css

error: pathspec 'sass-dsl/src/sass_dsl/render.clj' did not match any file(s) known to git

--- sass-dsl/src/sass_dsl/render.clj
+++ sass-dsl/src/sass_dsl/render.clj
@@ -0,0 +1,25 @@
+(ns sass-dsl.render
+  (:require [clojure.zip :as zip]
+            [sass-dsl.common :as common]))
+
+(defn output-css
+  ([loc acc]
+   (let [is-element (common/is-element loc)
+         has-parent (common/get-parent loc)
+         is-loc-last-element (common/is-last-element loc)
+         is-loc-selector (common/has-no-colon loc)
+         prefix (if (not is-loc-selector) " ")
+         suffix (if is-loc-selector
+                  " {\n"
+                  (if is-loc-last-element
+                    ";\n}\n\n"
+                    ";\n"))
+         final-line (if is-element
+                      (str prefix (zip/node loc) suffix))]
+     (if (zip/end? loc)
+       acc
+       (recur
+        (zip/next loc)
+        (str acc
+             final-line)))))
+  ([loc] (output-css loc "")))


Add stub for robot-name

Add stub for robot-name

error: pathspec 'exercises/robot-name/src/robot_name.clj' did not match any file(s) known to git

--- exercises/robot-name/src/robot_name.clj
+++ exercises/robot-name/src/robot_name.clj
@@ -0,0 +1,13 @@
+(ns robot-name)
+
+(defn robot [] ;; <- Arglist goes here
+  ;; your code goes here
+  )
+
+(defn robot-name [] ;; <- Arglist goes here
+      ;; your code goes here
+      )
+
+(defn reset-name [] ;; <- Arglist goes here
+  ;; your code goes here
+  )


Added clojurescript shism for the Objective-C shell implementation mimicking clojure.java.sh

Signed-off-by: Mike Fikes <a17fed27eaa842282862ff7c1b9c8395a26ac320@fikesfarm.com>

error: pathspec 'planck-cljs/src/planck/sh.cljs' did not match any file(s) known to git

--- planck-cljs/src/planck/sh.cljs
+++ planck-cljs/src/planck/sh.cljs
@@ -0,0 +1,38 @@
+(ns planck.sh)
+
+(def ^:dynamic *sh-dir* nil)
+(def ^:dynamic *sh-env* nil)
+
+(defn- parse-args
+  [args]
+  (let [default-encoding nil
+         default-opts {:out-enc default-encoding :in-enc default-encoding :dir *sh-dir* :env *sh-env*}
+         [cmd opts] (split-with string? args)]
+    [cmd (merge default-opts (apply hash-map opts))]))
+
+(defn sh
+  "Passes the given strings to Runtime.exec() to launch a sub-process.
+  Options are
+  :in      may be given followed by a string of one of the following formats:
+           String conforming to URL Syntax: 'file:///tmp/test.txt'
+           String pointing at an *existing* 'file: '/tmp/test.txt'
+           String with string input: 'Printing input frmo stdin with funy chars like $@ &'
+           to be fed to the sub-process's stdin.
+  :in-enc  option may be given followed by a String, used as a character
+           encoding name (for example \"UTF-8\" or \"ISO-8859-1\") to
+           convert the input string specified by the :in option to the
+           sub-process's stdin.  Defaults to UTF-8.
+  :out-enc option may be given followed by :bytes or a String. If a
+           String is given, it will be used as a character encoding
+           name (for example \"UTF-8\" or \"ISO-8859-1\") to convert
+           the sub-process's stdout to a String which is returned.
+  :env     override the process env with a map of String: String.
+  :dir     override the process dir with a String.
+  sh returns a map of
+    :exit => sub-process's exit code
+    :out  => sub-process's stdout (as String)
+    :err  => sub-process's stderr (String via platform default encoding)"
+  [& args]
+  (let [[cmd opts] (parse-args args)
+         {:keys [in in-enc out-enc env dir]} opts]
+    (js->clj (js/PLANCK_SHELL_SH (clj->js cmd) in in-enc out-enc env dir) :keywordize-keys true)))


Added the start of an example application using Trammel

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

--- examples/dream_date.clj
+++ examples/dream_date.clj
@@ -0,0 +1,91 @@
+(ns dream-date
+  (:use [fogus.me.trammel :only [provide-contracts defconstrainedrecord
+                                 all-numbers?]]))
+
+(in-ns 'fogus.me.trammel)
+
+(def *canonical-days* [31 28 31 30 31 30 31 31 30 31 30 31])
+
+(defconstrainedrecord Date [year 1970 month 1 day 1]
+  [(every? number? [year month day])
+   (< month 13) (> month 0)
+   (< day 32) (> day 0)]
+
+  Object
+  (toString [this]
+    (str (:year this) "." (:month this) "." (:day this))))
+
+
+(defn leap-year?
+  [year]
+  (and (= (mod year 4) 0)
+       (not (some #{(mod year 400)}
+                  [100 200 300]))))
+
+(provide-contracts
+ [leap-year? "Leap year calculation constraints"
+  [y] [number? pos?]])
+
+
+(defn gregorian-last-day-of-month
+  ([date] (gregorian-last-day-of-month (:month date) (:year date)))
+  ([month year]
+     (if (and (= month 2)
+              (leap-year? year))
+       29
+       (nth *canonical-days* (dec month)))))
+
+(provide-contracts
+ [gregorian-last-day-of-month "Gregorian last day calculation constraints"
+  [d]   [map? :month :year => number? pos?]
+  [m y] [all-positive? => number? pos?]])
+
+
+(defn days-in-prior-months
+  ([date] (days-in-prior-months (:month date) (:year date)))
+  ([month year]
+     (reduce +
+             (map #(gregorian-last-day-of-month % year)
+                  (range 1 (inc month))))))
+
+(provide-contracts
+ [days-in-prior-months "Prior days calculation constraints"
+  [d]   [map? :month :year => number? pos?]
+  [m y] [all-positive? => number? pos?]])
+
+
+(defn days-in-prior-years
+  [year]
+  (* 365 (dec year)))
+
+(provide-contracts
+ [days-in-prior-years "Prior days from year calculation constraints"
+  [y] [number? pos?]])
+
+
+(defn julian-leap-days-in-prior-years
+  [year]
+  (quot (dec year) 4))
+
+(defn prior-century-years
+  [year]
+  (quot (dec year) 100))
+
+
+(defn gregorian->absolute
+  ([date] (gregorian->absolute (:day date) (:month date) (:year date)))
+  ([day month year]
+     (+ day
+        (days-in-prior-months month year)
+        (days-in-prior-years year)
+        (julian-leap-days-in-prior-years year)
+        (- (prior-century-years year))
+        (quot (dec year) 400))))
+
+
+(gregorian->absolute {:day 16 :month 12 :year 1999})
+(gregorian->absolute (bean (java.util.Date.)))
+
+(-> (java.util.GregorianCalendar. (+ 1999 1899) 12 16)
+    (.getTime)
+    bean)


install java 8 in containeres

install java 8 in containeres

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


Thrashing on attempting to shut down the geo when google throttles 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/mtravers/incidents.git/'


unzip options

unzip options


require

require


Add code to interface with DAISY pipeline

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

--- src/mdr2/external.clj
+++ src/mdr2/external.clj
@@ -0,0 +1,23 @@
+(ns mdr2.pipeline1
+  (:use [clojure.java.shell :only [sh]])
+  (:require [clojure.string :as s]))
+
+(defn validate [file]
+  (sh "daisy-pipeline"
+      "/usr/lib/daisy-pipeline/scripts/verify/ConfigurableValidator.taskScript"
+      (str "--validatorInputFile=" file)
+      ;; make sure it has to be a DTBook file
+      "--validatorRequireInputType=Dtbook document"
+      ;; make sure files with a missing DOCTYPE declaration do not validate
+      "--validatorInputDelegates=org.daisy.util.fileset.validation.delegate.impl.NoDocTypeDeclarationDelegate"))
+
+(defn audio-encoder [dtb output-dir bitrate]
+  (apply sh "daisy-pipeline"
+         "/usr/lib/daisy-pipeline/scripts/modify_improve/dtb/DTBAudioEncoder.taskScript"
+         (map (fn [[k v]] (format "--%s=%s" (name k) v))
+              {:input dtb :output output-dir :bitrate bitrate})))
+
+(defn filter-output [lines]
+  (map #(s/trim (s/replace % "[ERROR, Validator]" ""))
+       (filter #(re-matches #"^\[ERROR, Validator\].*" %)
+               (s/split-lines lines))))


Adds asserting that all blocks in a generated grid are valid

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


update text to include vector count

update text to include vector count

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


add loop

add loop

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


Use a protocol for creating Avro `SeekableInput`s.

--- src/clojure/abracad/avro.clj
+++ src/clojure/abracad/avro.clj
@@ -6,12 +6,13 @@
             [cheshire.core :as json]
             [abracad.avro.util :refer [returning mangle unmangle coerce]])
   (:import [java.io
-             ByteArrayOutputStream EOFException File InputStream OutputStream]
+             ByteArrayInputStream ByteArrayOutputStream EOFException
+             File FileInputStream InputStream OutputStream]
            [clojure.lang Named]
            [org.apache.avro Schema Schema$Parser Schema$Type]
            [org.apache.avro.file
              CodecFactory DataFileWriter DataFileReader SeekableInput
-             SeekableFileInput]
+             SeekableFileInput SeekableByteArrayInput]
            [org.apache.avro.io
              DatumReader DatumWriter Decoder DecoderFactory
              Encoder EncoderFactory]
@@ -41,14 +42,22 @@
   {:tag `CodecFactory}
   [codec] (if-not (string? codec) codec (CodecFactory/fromString codec)))

-(defn ^:private source-for
-  "Return seekable input for `source`."
+(defprotocol PSeekableInput
+  "Protocol for coercing to an Avro `SeekableInput`."
+  (-seekable-input [x opts]
+    "Attempt to coerce `x` to an Avro `SeekableInput`."))
+
+(defn seekable-input
+  "Attempt to coerce `x` to an Avro `SeekableInput`."
   {:tag `SeekableInput}
-  [source]
-  (condp instance? source
-    SeekableInput source
-    File          (SeekableFileInput. ^File source)
-    String        (SeekableFileInput. (io/file source))))
+  ([x] (-seekable-input x nil))
+  ([opts x] (-seekable-input x opts)))
+
+(extend-protocol PSeekableInput
+  (Class/forName "[B") (-seekable-input [x opts] (SeekableByteArrayInput. x))
+  SeekableInput (-seekable-input [x opts] x)
+  File (-seekable-input [x opts] (SeekableFileInput. x))
+  String (-seekable-input [x opts] (seekable-input opts (io/file x))))

 (defn ^:private raw-schema?
   "True if schema `source` should be parsed as-is."
@@ -130,7 +139,8 @@
   {:tag `DataFileReader}
   ([source] (data-file-reader nil source))
   ([expected source]
-     (DataFileReader/openReader (source-for source) (datum-reader expected))))
+     (DataFileReader/openReader
+      (seekable-input source) (datum-reader expected))))

 (defmacro ^:private decoder-factory
   "Invoke static methods of default Avro Decoder factory."


reenable transition edits, disable editing move-out date

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


Working on 0111...

Working on 0111...

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

--- src/project_euler/problem_0111.clj
+++ src/project_euler/problem_0111.clj
@@ -0,0 +1,55 @@
+(ns project-euler.problem_0111
+  (:require [clojure.math.combinatorics :as combo]))
+
+;; Considering 4-digit primes containing repeated digits it is clear that they cannot all be the same:
+;; 1111 is divisible by 11, 2222 is divisible by 22, and so on.
+;; But there are nine 4-digit primes containing three ones:
+
+;; 1117, 1151, 1171, 1181, 1511, 1811, 2111, 4111, 8111
+
+;; We shall say that M(n, d) represents the maximum number of repeated digits
+;; for an n-digit prime where d is the repeated digit,
+;; N(n, d) represents the number of such primes, and S(n, d) represents the sum of these primes.
+
+;; So M(4, 1) = 3 is the maximum number of repeated digits for a 4-digit prime where one is the repeated digit,
+;; there are N(4, 1) = 9 such primes, and the sum of these primes is S(4, 1) = 22275.
+;; It turns out that for d = 0, it is only possible to have M(4, 0) = 2 repeated digits,
+;; but there are N(4, 0) = 13 such cases.
+
+;; In the same way we obtain the following results for 4-digit primes.
+
+;;  Digit, d | M(4, d) | N(4, d) | S(4, d)|
+;;  ---------|---------|---------|--------|
+;;    0      |    2    |    13   |  67061 |
+;;    1      |    3    |     9   |  22275 |
+;;    2      |    3    |     1   |   2221 |
+;;    3      |    3    |    12   |  46214 |
+;;    4      |    3    |     2   |   8888 |
+;;    5      |    3    |     1   |   5557 |
+;;    6      |    3    |     1   |   6661 |
+;;    7      |    3    |     9   |  57863 |
+;;    8      |    3    |     1   |   8887 |
+;;    9      |    3    |     7   |  48073 |
+;;  =======================================
+
+;; For d = 0 to 9, the sum of all S(4, d) is 273700.
+
+;; Find the sum of all S(10, d).
+
+(defn prime-factors [x]
+  (letfn [(next-fact [n] (if (== n 2) 3 (+ n 2)))]
+    (loop [x x, p 2, pfs []]
+      (cond (== 1 x)          pfs
+            (> (* p p) x)     (conj pfs x)
+            (zero? (rem x p)) (recur (quot x p) p (conj pfs p))
+            :else             (recur x (next-fact p) pfs)
+            ))))
+
+
+(defn primes-with-repeated-digits [n d]
+  (let [ds (vec (repeat n d))]
+    (loop [n-m 2]
+      (let [cs (apply combo/cartesian-product (repeat n-m (for [e (range 10) :when (not (== e d))] e)))]
+        (->> (combo/combinations (range n) n-m)
+             )
+        ))))


블럭 구조만 먼저 쪼개자

블럭 구조만 먼저 쪼개자

error: pathspec 'src/인스타파스/블럭.clj' did not match any file(s) known to git


handle case of advancing without choosing a date


Fix the delete board function

Fix the delete board function

Delete it if it has only published entries and delete them with it. If there are drafts leave the board and the draft alone and set the draft flag to the board.

--- src/oc/storage/resources/board.clj
+++ src/oc/storage/resources/board.clj
@@ -3,6 +3,7 @@
             [if-let.core :refer (when-let*)]
             [defun.core :refer (defun)]
             [schema.core :as schema]
+            [taoensso.timbre :as timbre]
             [oc.lib.schema :as lib-schema]
             [oc.lib.slugify :as slug]
             [oc.lib.db.common :as db-common]
@@ -168,20 +169,31 @@
   Given the uuid of the org, and slug of the board, delete the board and all its entries, and updates,
   and return `true` on success.
   "
-  ([conn :guard db-common/conn? board :guard map?]
-  (delete-board! conn (:uuid board)))
-
-  ([conn :guard db-common/conn? org-uuid :guard #(schema/validate lib-schema/UniqueID %) slug :guard slug/valid-slug?]
-  (if-let [uuid (:uuid (get-board conn org-uuid slug))]
-    (delete-board! conn uuid)))
-
-  ([conn :guard db-common/conn? uuid :guard #(schema/validate lib-schema/UniqueID %)]
+  ([conn :guard db-common/conn? board :guard map? entries :guard sequential?]
   ;; Delete interactions
-  (db-common/delete-resource conn common/interaction-table-name :board-uuid uuid)
-  ;; Delete entries
-  (db-common/delete-resource conn common/entry-table-name :board-uuid uuid)
-  ;; Delete the board itself
-  (db-common/delete-resource conn table-name uuid)))
+  (db-common/delete-resource conn common/interaction-table-name :board-uuid (:uuid board))
+  (let [published-entries (filterv #(= (keyword (:status %)) :published) entries)]
+    ;; Delete all published entries
+    (doseq [entry published-entries]
+      (timbre/info "Delete entry:" (:uuid entry))
+      (db-common/delete-resource conn common/entry-table-name :uuid (:uuid entry)))
+    (if (= (count entries) (count published-entries))
+      ;; Delete the board itself
+      (do
+        (timbre/info "Actually deleting board" (:uuid board))
+        (db-common/delete-resource conn table-name (:uuid board)))
+      ;; Set back the draft on the board
+      (do
+        (timbre/info "Updating to draft board" (:uuid board))
+        (update-board! conn (:uuid board) (assoc board :draft true))))))
+
+  ([conn :guard db-common/conn? org-uuid :guard #(schema/validate lib-schema/UniqueID %) slug :guard slug/valid-slug? entries :guard sequential?]
+  (if-let [board (get-board conn org-uuid slug)]
+    (delete-board! conn board entries)))
+
+  ([conn :guard db-common/conn? uuid :guard #(schema/validate lib-schema/UniqueID %) entries :guard sequential?]
+  (if-let [board (get-board conn uuid)]
+    (delete-board! conn board entries))))

 ;; ----- Board's set operations -----

@@ -273,7 +285,7 @@
          (schema/validate lib-schema/UniqueID org-uuid)
          (sequential? additional-keys)
          (every? #(or (string? %) (keyword? %)) additional-keys)]}
-  (->> (into [primary-key :slug :name] additional-keys)
+  (->> (into [primary-key :slug :name :draft] additional-keys)
     (db-common/read-resources conn table-name :org-uuid org-uuid)
     (sort-by :slug)
     vec)))


check version match on start

check version match on start

--- plugin/src/leiningen/figwheel.clj
+++ plugin/src/leiningen/figwheel.clj
@@ -4,11 +4,16 @@
    [clojure.pprint :as pp]
    [leiningen.core.eval :as leval]
    [leiningen.core.project :as lproj]
+   [leiningen.core.utils :as lutils]
    [clojure.java.io :as io]
    [figwheel-sidecar.config :as fc]
-   [figwheel-sidecar.config-check.ansi :refer [color-text with-color]]))
+   [figwheel-sidecar.config-check.ansi :refer [with-color]]))

 (def _figwheel-version_ "0.5.4-SNAPSHOT")
+
+(defn figwheel-sidecar-version []
+  (when-let [version-var (resolve 'figwheel-sidecar.config/_figwheel-version_)]
+     @version-var))

 (defn make-subproject [project builds]
   (with-meta
@@ -30,8 +35,8 @@
 ;; well this is private in the leiningen.cljsbuild ns
 (defn- run-local-project [project builds requires form]
   (let [project' (-> project
-                   (update-in [:dependencies] conj ['figwheel-sidecar fc/_figwheel-version_])
-                   (update-in [:dependencies] conj ['figwheel fc/_figwheel-version_])
+                   (update-in [:dependencies] conj ['figwheel-sidecar _figwheel-version_])
+                   (update-in [:dependencies] conj ['figwheel _figwheel-version_])
                    (make-subproject builds))]
     (leval/eval-in-project project'
      `(try
@@ -75,22 +80,25 @@
     (do (println "Figwheel: Configuration validation failed. Exiting ...")
         false)))

-(with-color
-  (fc/system-exit-assert
-   (= _figwheel-version_ figwheel-sidecar.config/_figwheel-version_)
-   (str "Figwheel version mismatch!!\n"
-        "You are using the lein-figwheel plugin with version: " _figwheel-version_ "\n"
-        "With a figwheel-sidecar library with version:        " fc/_figwheel-version_ "\n"
-        "\n"
-        "These versions need to be the same.\n"
-        "\n"
-        "Please look at your project.clj :dependencies to see what is causing this.\n"
-        "You may need to run \"lein clean\" \n"
-        "Running \"lein deps :tree\" can help you see your dependency tree.")))
+(defn check-version-match []
+  (with-color
+    (let [sidecar-version (figwheel-sidecar-version)]
+      (fc/system-exit-assert
+       (= _figwheel-version_ sidecar-version)
+       (str "Figwheel version mismatch!!\n"
+            "You are using the lein-figwheel plugin with version: " (pr-str _figwheel-version_) "\n"
+            "With a figwheel-sidecar library with version:        " (pr-str sidecar-version) "\n"
+            "\n"
+            "These versions need to be the same.\n"
+            "\n"
+            "Please look at your project.clj :dependencies to see what is causing this.\n"
+            "You may need to run \"lein clean\" \n"
+            "Running \"lein deps :tree\" can help you see your dependency tree.")))))

 (defn figwheel
   "Autocompile ClojureScript and serve the changes over a websocket (+ plus static file server)."
   [project & build-ids]
+  (check-version-match)
   (fc/system-asserts)
   (when-let [config-data (validate-figwheel-conf project)]
     (let [{:keys [data] :as figwheel-internal-data}


add route & interceptor to validate token...

...and unsubscribe from emails if user token is appropriately validated

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


Added Pig Latin problem

Added Pig Latin problem

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

--- src/clojush/problems/software/pig_latin.clj
+++ src/clojush/problems/software/pig_latin.clj
@@ -0,0 +1,181 @@
+;; pig_latin.clj
+;; Tom Helmuth, thelmuth@cs.umass.edu
+;;
+;; Problem Source: iJava (http://ijava.cs.umass.edu/)
+;;
+;; Given a string of length <= 50 containing lowercase words separated by single
+;; spaces, print the string with each word translated to pig Latin. More
+;; specifically, if a word starts with a vowel, it should have "ay" added to its
+;; end; otherwise, the first letter is moved to the end of the word, followed by "ay".
+;;
+;; input stack has the input string
+
+(ns clojush.problems.software.pig-latin
+  (:use clojush.pushgp.pushgp
+        [clojush pushstate interpreter random util globals]
+        clojush.instructions.tag
+        clojure.math.numeric-tower)
+    (:require [clojure.string :as string]))
+
+;; Define test cases
+(defn pig-latin-input
+  "Makes a Pig Latin input of length len."
+  [len]
+  (apply str (interpose \space
+                        (remove empty? (string/split (apply str
+                                                            (repeatedly len
+                                                                        (fn []
+                                                                          (if (< (lrand) 0.2)
+                                                                            \space
+                                                                            (lrand-nth (map char (range 97 123)))))))
+                                                     #" ")))))
+
+; Atom generators
+(def pig-latin-atom-generators
+  (concat (list
+            "ay"
+            \space
+            \a \e \i \o \u
+            "aeiou"
+            ;;; end constants
+            (fn [] (lrand-nth (concat [\newline \tab] (map char (range 32 127))))) ;Visible character ERC
+            (fn [] (pig-latin-input (lrand-int 21))) ;String ERC
+            ;;; end ERCs
+            (tag-instruction-erc [:string :char :integer :boolean :exec] 1000)
+            (tagged-instruction-erc 1000)
+            ;;; end tag ERCs
+            'in1
+            ;;; end input instructions
+            )
+          (registered-for-stacks [:string :char :integer :boolean :exec :print])))
+
+
+;; A list of data domains for the problem. Each domain is a vector containing
+;; a "set" of inputs and two integers representing how many cases from the set
+;; should be used as training and testing cases respectively. Each "set" of
+;; inputs is either a list or a function that, when called, will create a
+;; random element of the set.
+(def pig-latin-data-domains
+  [[(list "", "a", "b", "c", "d", "e", "i", "m", "o", "u", "y", "z"
+          "hello", "there", "world", "eat", "apple", "yellow", "orange", "umbrella", "ouch", "in",
+          "hello there world"
+          "out at the plate"
+          "nap time on planets"
+          "supercalifragilistic"
+          "expialidocious"
+          (apply str (repeat 50 \u))
+          (apply str (repeat 50 \s))
+          (apply str (take 49 (cycle (list \w \space))))
+          (apply str (take 49 (cycle (list \e \space))))
+          (apply str (take 50 (cycle (list \h \a \space))))
+          (apply str (take 49 (cycle (list \x \space \y \space))))) 33 0] ;; "Special" inputs covering some base cases
+   [(fn [] (pig-latin-input (+ 3 (lrand-int 48)))) 167 1000]
+   ])
+
+;;Can make Pig Latin test data like this:
+;(test-and-train-data-from-domains pig-latin-data-domains)
+
+; Helper function for error function
+(defn pig-latin-test-cases
+  "Takes a sequence of inputs and gives IO test cases of the form
+   [input output]."
+  [inputs]
+  (map (fn [in]
+         (vector in
+                 (apply str (interpose \space
+                                       (map #(if (some #{(first %)} "aeiou")
+                                               (str % "ay")
+                                               (str (apply str (rest %)) (first %) "ay"))
+                                           (remove empty? (string/split in #" ")))))))
+       inputs))
+
+; Define error function. For now, each run uses different random inputs
+(defn pig-latin-error-function
+  "Returns the error function for the Pig Latin problem. Takes as
+   input Pig Latin data domains."
+  [data-domains]
+  (let [[train-cases test-cases] (map #(sort-by (comp count first) %)
+                                      (map pig-latin-test-cases
+                                           (test-and-train-data-from-domains data-domains)))]
+    (when true ;; Change to false to not print test cases
+      (doseq [[i case] (map vector (range) train-cases)]
+        (println (format "Train Case: %3d | Input/Output: %s" i (str case))))
+      (doseq [[i case] (map vector (range) test-cases)]
+        (println (format "Test Case: %3d | Input/Output: %s" i (str case)))))
+    (fn the-actual-pig-latin-error-function
+      ([program]
+        (the-actual-pig-latin-error-function program :train))
+      ([program data-cases] ;; data-cases should be :train or :test
+        (the-actual-pig-latin-error-function program data-cases false))
+      ([program data-cases print-outputs]
+        (let [behavior (atom '())
+              errors (doall
+                       (for [[input correct-output] (case data-cases
+                                                      :train train-cases
+                                                      :test test-cases
+                                                      [])]
+                         (let [final-state (run-push program
+                                                     (->> (make-push-state)
+                                                       (push-item input :input)
+                                                       (push-item "" :output)))
+                               result (stack-ref :output 0 final-state)]
+                           (when print-outputs
+                             (println (format "\n| Correct output: %s\n| Program output: %s" (pr-str correct-output) (pr-str result))))
+                           ; Record the behavior
+                           (when @global-print-behavioral-diversity
+                             (swap! behavior conj result))
+                           ; Error is Levenshtein distance for printed string
+                           (levenshtein-distance correct-output result)
+                           )))]
+          (when @global-print-behavioral-diversity
+            (swap! population-behaviors conj @behavior))
+          errors)))))
+
+(defn pig-latin-report
+  "Custom generational report."
+  [best population generation error-function report-simplifications]
+  (let [best-program (not-lazy (:program best))
+        best-test-errors (error-function best-program :test)
+        best-total-test-error (apply +' best-test-errors)]
+    (println ";;******************************")
+    (printf ";; -*- Pig Latin problem report - generation %s\n" generation)(flush)
+    (println "Test total error for best:" best-total-test-error)
+    (println (format "Test mean error for best: %.5f" (double (/ best-total-test-error (count best-test-errors)))))
+    (when (zero? (:total-error best))
+      (doseq [[i error] (map vector
+                             (range)
+                             best-test-errors)]
+        (println (format "Test Case  %3d | Error: %s" i (str error)))))
+    (println ";;------------------------------")
+    (println "Outputs of best individual on training cases:")
+    (error-function best-program :train true)
+    (println ";;******************************")
+    )) ;; To do validation, could have this function return an altered best individual
+       ;; with total-error > 0 if it had error of zero on train but not on validation
+       ;; set. Would need a third category of data cases, or a defined split of training cases.
+
+
+; Define the argmap
+(def argmap
+  {:error-function (pig-latin-error-function pig-latin-data-domains)
+   :atom-generators pig-latin-atom-generators
+   :max-points 1000
+   :max-points-in-initial-program 500
+   :evalpush-limit 2000
+   :population-size 1000
+   :max-generations 300
+   :parent-selection :lexicase
+   :genetic-operator-probabilities {:alternation 0.2
+                                    :uniform-mutation 0.2
+                                    :uniform-close-mutation 0.1
+                                    [:alternation :uniform-mutation] 0.5
+                                    }
+   :alternation-rate 0.01
+   :alignment-deviation 10
+   :uniform-mutation-rate 0.01
+   :problem-specific-report pig-latin-report
+   :print-behavioral-diversity true
+   :report-simplifications 0
+   :final-report-simplifications 5000
+   ;:max-error 1
+   })


rcutorture: Test RCU-sched primitives in TREE_PREEMPT_RCU kernels

This commit ensures that RCU-sched primitives are tested in
TREE_PREEMPT_RCU kernels, a combination that was previously omitted.

Signed-off-by: Paul E. McKenney <1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <c028c213ed5efcf30c3f4fc7361dbde0c893c5b7@joshtriplett.org>

error: pathspec 'tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot' did not match any file(s) known to git

--- tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot
+++ tools/testing/selftests/rcutorture/configs/rcu/TREE08.boot
@@ -0,0 +1 @@
+rcutorture.torture_type=sched


generate files only when lex or cup file is newer

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/hongfei/DataBase-Course-Work.git/'


Generate initial state assignments in eval-component

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


hautazkoak direnak azaldu

hautazkoak direnak azaldu

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


dumb join

dumb join

Signed-off-by: Chris Granger <5654cde260ae99bc4d30054171b8bcd902efd19a@gmail.com>

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


Example of transients in Clojure

Example of transients in Clojure

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


Better output from upload-repo tool

Better output from upload-repo tool

- Print status every 1000 files processed
- Don't count local files, that realizes the full lazy seq, which can
  be quite a bit of memory

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


Fix key prefix for :startkey/:endkey with non-sequential key

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


added p29.clj

added p29.clj

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


Use map instead of reduce in us-states/ocd-ids

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


get rid of SSL wrapper for now.

get rid of SSL wrapper for now.

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


cleanup

cleanup

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


unit: leverage 1.7 features

unit: leverage 1.7 features

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


Account scoping fix.

Account scoping fix.

fatal: unable to access 'https://github.com/clojars/clojars-web.git/': The requested URL returned error: 403


remove unused function

remove unused function

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


Tinkering with the bracket puzzle.

Tinkering with the bracket puzzle.

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

--- Clojure/brackets.clj
+++ Clojure/brackets.clj
@@ -0,0 +1,24 @@
+; :mode=clojure:
+
+(defn bracket
+    ([n]
+        (bracket (* 2 n) 0))
+    ([r h]
+        (if (zero? r)
+            '("")
+            (concat
+                (if (> r h)
+                    (map
+                        (partial str "(")
+                        (bracket (dec r) (inc h))))
+                (if (> h 0)
+                    (map
+                        (partial str ")")
+                        (bracket (dec r) (dec h))))))))
+
+(apply println (bracket 0))
+(apply println (bracket 1))
+(apply println (bracket 2))
+(apply println (bracket 3))
+(apply println (bracket 4))
+


seq iteration

seq iteration

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

--- src/sandbox/iterator/iterator.clj
+++ src/sandbox/iterator/iterator.clj
@@ -0,0 +1,14 @@
+(ns sandbox.iterator.iterator)
+
+(def vowel? #{\a \e \i \o \u})
+(defn vowels-in-world [world]
+  (set (filter vowel? world)))
+
+
+(defn prepend-hello [names]
+  (map (fn [name] (str "Hello, " name)) names))
+
+
+(defn sum-sequence [s]
+  {:pre [(not (empty? s))]}
+  (reduce + s))


introduce onyx.validation

introduce onyx.validation

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

--- src/onyx/validation.clj
+++ src/onyx/validation.clj
@@ -0,0 +1,23 @@
+(ns onyx.validation
+  (:require [schema.core :as schema]))
+
+(def base-catalog-entry-validator
+  {:onyx/name schema/Keyword
+   :onyx/type (schema/enum :input :output :transformer :grouper :aggregator)
+   :onyx/consumption (schema/enum :sequential :concurrent)
+   :onyx/batch-size (schema/pred pos? 'pos?)
+   schema/Keyword schema/Any})
+
+(def catalog-entry-validator
+  (schema/conditional #(or (= (:onyx/type %) :input) (= (:onyx/type %) :output))
+                      (merge base-catalog-entry-validator {:onyx/medium schema/Keyword})
+                      :else
+                      (merge base-catalog-entry-validator {:onyx/fn schema/Keyword})))
+
+(defn validate-catalog
+  [catalog]
+  (schema/validate [(schema/pred map? 'map?)] catalog)
+  (doseq [entry catalog]
+    (schema/validate catalog-entry-validator entry)))
+
+


make it so we can respond based on input

this is necessary so we can actually send
back the right authority

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


Fix syntax that results in reflection warning

fatal: unable to access 'https://github.com/democracyworks/scheduled-message-works.git/': The requested URL returned error: 403


Move retries down into search-by-identifiers*

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


capture the xform in a let

capture the xform in a let

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


major changes and additions

major changes and additions

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


Fix IllegalArgumentException when achievement timestamp is Integer (closes #3).

--- src-clj/acha/db.clj
+++ src-clj/acha/db.clj
@@ -209,8 +209,8 @@
       :ach/user     (:userid a)
       :ach/achent   (-> (:type a) keyword static/table-map :id)
       :ach/sha1     (:sha1 a)
-      :ach/ts       (java.util.Date. (:timestamp a))
-      :ach/assigned (java.util.Date. (:assigned a))}
+      :ach/ts       (java.util.Date. (long (:timestamp a)))
+      :ach/assigned (java.util.Date. (long (:assigned a)))}
     (:level a)
       (assoc :ach/level (:level a))))


java/install options

java/install options

fatal: unable to access 'https://github.com/jchli/jepsen-aurora.git/': The requested URL returned error: 403


Grab 3scale config at runtime, not compile 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/democracyworks/turbovote-http-api.git/'


Fix id instructions import

Fix id instructions import


Version 1.14.2-SNAPSHOT

Version 1.14.2-SNAPSHOT


bump version to 2.8.4

bump version to 2.8.4

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


bump version

bump version

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


[CS DC] Use kehaar 0.1.0

[CS DC] Use kehaar 0.1.0

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


enable yourkit

enable yourkit


Version 158-SNAPSHOT

Version 158-SNAPSHOT

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


Update RSyntaxTextArea and AutoComplete

Update RSyntaxTextArea and AutoComplete

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/bsmr-clojure/Nightcode.git/'


Reuse 3scale api client object across requests

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


aded missing require

aded missing require

error: pathspec 'main/src/dda/pallet/dda_managed_vm/infra/git_sync.clj' did not match any file(s) known to git

--- main/src/dda/pallet/dda_managed_vm/infra/git_sync.clj
+++ main/src/dda/pallet/dda_managed_vm/infra/git_sync.clj
@@ -0,0 +1,29 @@
+; Licensed to the Apache Software Foundation (ASF) under one
+; or more contributor license agreements. See the NOTICE file
+; distributed with this work for additional information
+; regarding copyright ownership. The ASF licenses this file
+; to you 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 dda.pallet.dda-managed-vm.infra.git-sync
+  (:require
+    [pallet.actions :as actions]))
+
+(defn configure-git-sync
+  "autosync git repositories"
+  [config]
+  (actions/remote-file
+    (str "/etc/cron.d/90_" user "git-sync")
+    :literal true
+    :owner root
+    :group root
+    :mode "664"
+    :content ""))


CMR-3687: Added test for enabling/disabling search tag / tag association persistence.

fatal: unable to access 'https://github.com/mschmele/Common-Metadata-Repository.git/': The requested URL returned error: 403


Add cursive startscript

Add cursive startscript

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

--- script/repl.clj
+++ script/repl.clj
@@ -0,0 +1,3 @@
+(use 'figwheel-sidecar.repl-api)
+(start-figwheel!) ;; <-- fetches configuration
+(cljs-repl)


add resource type check for validate action

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


Passing tests

Passing tests

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


Added web font MIME types

Added web font MIME types

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


extra ns for extracted common defs for credential template

error: pathspec 'ssclj/jar/src/com/sixsq/slipstream/ssclj/resources/credential_template_cloud.clj' did not match any file(s) known to git

--- ssclj/jar/src/com/sixsq/slipstream/ssclj/resources/credential_template_cloud.clj
+++ ssclj/jar/src/com/sixsq/slipstream/ssclj/resources/credential_template_cloud.clj
@@ -0,0 +1,47 @@
+(ns com.sixsq.slipstream.ssclj.resources.credential-template-cloud
+  (:require
+    [com.sixsq.slipstream.ssclj.resources.credential-template :as ct]
+    [com.sixsq.slipstream.ssclj.util.userparamsdesc :refer [slurp-cloud-cred-desc]]
+    [com.sixsq.slipstream.ssclj.resources.credential-template :as p]))
+
+(def ^:const resource-acl-default {:owner {:principal "ADMIN"
+                                           :type      "ROLE"}
+                                   :rules [{:principal "USER"
+                                            :type      "ROLE"
+                                            :right     "VIEW"}]})
+
+(def ^:const resource-base
+  {:name        "User cloud credentials store"
+   :description "Stores user cloud credentials"
+   :connector   {:href ""}
+   :key         ""
+   :secret      ""
+   :quota       20
+   :acl         resource-acl-default})
+
+(defn cred-type
+  [cloud-service-type]
+  (str "cloud-cred-" cloud-service-type))
+
+(defn cred-method
+  [cloud-service-type]
+  (str "store-cloud-cred-" cloud-service-type))
+
+(defn gen-resource
+  [cred-instance-map cloud-service-type]
+  (merge resource-base
+         {:name        (str "User cloud credentials store for " cloud-service-type)
+          :description (str "Stores user cloud credentials for cloud " cloud-service-type)
+          :type        (cred-type cloud-service-type)
+          :method      (cred-method cloud-service-type)}
+         cred-instance-map))
+
+(defn gen-description
+  [cloud-service-type]
+  (merge ct/CredentialTemplateDescription
+         (slurp-cloud-cred-desc cloud-service-type)))
+
+(defn register
+  [cred-instance-map cloud-service-type]
+  (p/register (gen-resource cred-instance-map cloud-service-type)
+              (gen-description cloud-service-type)))


Consumer cannot be a resource level

Consumer cannot be a resource level

--- src/yada/schema.clj
+++ src/yada/schema.clj
@@ -425,7 +425,6 @@
           ResourceParameters
           Produces
           Consumes
-          Consumer
           Methods
           Responses
           SecurityHeaders


Create core.cljs

Create core.cljs

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

--- src/core.cljs
+++ src/core.cljs
@@ -0,0 +1,24 @@
+
+
+
+(register
+  :forward-events
+  (let [id->listen-fn (atom {})
+        process-one-entry (fn [{:as m :keys [unlisten listen events dispatch-to]}]
+                            (let [_  (assert (map? m) (str "re-frame: effects handler for :forward-events expected a map or a list of maps. Got: " m))
+                                  _  (assert (or (= #{:unlisten} (-> m keys set))
+                                                 (= #{:listen :events :dispatch-to} (-> m keys set))) "re-frame: effects handler for :forward-events given wrong map keys")]
+                              (if unlisten
+                                (do
+                                  (re-frame.core/remove-post-event-callback (@id->listen-fn unlisten))
+                                  (swap! id->listen-fn dissoc unlisten))
+                                (let [post-event-callback-fn  (fn [event-v _]
+                                                                (when (events (first event-v))
+                                                                  (dispatch (conj dispatch-to event-v))))]
+                                  (re-frame.core/add-post-event-callback  post-event-callback-fn)
+                                  (swap! id->listen-fn assoc listen post-event-callback-fn)))))]
+    (fn [val]
+      (cond
+        (map? val) (process-one-entry val)
+        (list? val) (doall (map process-one-entry val)))     ;; XXX add else
+      )))


bumped up cryogen-core version

bumped up cryogen-core version

--- src/leiningen/new/cryogen/project.clj
+++ src/leiningen/new/cryogen/project.clj
@@ -8,7 +8,7 @@
                            [compojure "1.3.2"]
                            [ring-server "0.4.0"]
                            [cryogen-markdown "0.1.1"]
-                           [cryogen-core "0.1.20"]]
+                           [cryogen-core "0.1.21"]]
             :plugins [[lein-ring "0.8.13"]]
             :main cryogen.core
             :ring {:init cryogen.server/init


Add Clojure test program

Add Clojure test program

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

--- test/oofile.clj
+++ test/oofile.clj
@@ -0,0 +1,155 @@
+;
+; java -cp $HOME/Downloads/clojure-1.6.0/clojure-1.6.0-slim.jar:/usr/share/java/tablelayout.jar:/usr/share/java/java_uno.jar:/usr/share/java/juh.jar:/usr/share/java/jurt.jar:/usr/share/java/ridl.jar:/usr/share/java/unoloader.jar:/usr/share/java/unoil.jar -Djava.library.path=/usr/lib/ure/lib clojure.main
+;
+
+(ns org.linkedlaw.oofile)
+
+;; process functions
+
+; XXX relies on PATH, existence of /dev/null
+(defn spawn-soffice
+  "Spawn an soffice process and return the Process object."
+  []
+  (let [pb (java.lang.ProcessBuilder.
+             ["soffice"
+              "--accept=pipe,name=officepipe;urp;StarOffice.ServiceManager"
+              "--norestore"
+              "--nologo"
+              "--headless"
+              "--nolockcheck"])]
+    (.redirectErrorStream pb true)
+    (.redirectOutput pb
+      (java.lang.ProcessBuilder$Redirect/appendTo
+        (java.io.File. "/dev/null")))
+    (.start pb)))
+
+(defn get-uno-desktop
+  "Connect to a running soffice process and return a Desktop frame."
+  []
+  (let [xLocalContext (com.sun.star.comp.helper.Bootstrap/createInitialComponentContext nil)
+        xLocalServiceManager (.getServiceManager xLocalContext)
+        oUrlResolver (.createInstanceWithContext xLocalServiceManager "com.sun.star.bridge.UnoUrlResolver" xLocalContext)
+        xUrlResolver (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.bridge.XUnoUrlResolver oUrlResolver)]
+    (if-let [oContext (first (filter some?
+          (for [i (range 3)]
+            (try
+              (.resolve xUrlResolver "uno:pipe,name=officepipe;urp;StarOffice.ComponentContext")
+              (catch java.lang.Exception e (java.lang.Thread/sleep 5000))))))]
+      (let [xContext (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.uno.XComponentContext oContext)
+            oMCF (.getServiceManager xContext)
+            xMCF (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.lang.XMultiComponentFactory oMCF)]
+        (.createInstanceWithContext xMCF "com.sun.star.frame.Desktop" xContext)))))
+
+(defn terminate-uno-desktop
+  "Terminate the Desktop."
+  [oDesktop]
+  (let [xDesktop (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.frame.XDesktop oDesktop)]
+    (.terminate xDesktop)))
+
+(defn get-uno-doc
+  "Given a Desktop frame and filename, open a file and return a XTextDocument object."
+  [oDesktop file]
+  (let [xCLoader (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.frame.XComponentLoader oDesktop)
+        oDocument (.loadComponentFromURL xCLoader file "_blank" 0 (into-array com.sun.star.beans.PropertyValue []))]
+    (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.text.XTextDocument oDocument)))
+
+;; helper functions
+
+(defn uno-enumeration-seq
+  "Wrap a XEnumeration object as a seq."
+  [^com.sun.star.container.XEnumeration xEnum]
+  (enumeration-seq
+    (reify java.util.Enumeration
+      (^boolean hasMoreElements [this] (.hasMoreElements xEnum))
+      (nextElement [this] (.nextElement xEnum)))))
+
+(defn supports-service?
+  "Given a service name, determine if a XComponent object supports the such service."
+  [service xComponent]
+  (let [xServiceInfo (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.lang.XServiceInfo xComponent)]
+    (.supportsService xServiceInfo service)))
+
+(defn get-property
+  "Given a property name and a XComponent object supporting the XPropertySet service, return that property."
+  [prop xComp]
+  (let [xPropertySet (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.beans.XPropertySet xComp)]
+    (.getPropertyValue xPropertySet prop)))
+
+(defn is-text-portion?
+  "Given a XComponent object supporting the TextPortion service, determine if its TextPortionType is Text."
+  [xTextPortion]
+;  (if (supports-service? "com.sun.star.text.TextPortion" xTextPortion) ; XXX only blank lines are meeting both tests
+  (let [xTextPortionType (get-property "TextPortionType" xTextPortion)]
+    (= xTextPortionType "Text")))
+
+;; text functions
+
+(defstruct signal-struct :line :adjust :margin :weight)
+
+(defn make-portion-map
+  "Given a signal struct and a XComponent object collection with each supporting the TextPortion and CharacterProperties services,
+  return a signal struct with a concatenated string and the last object's CharWeight property."
+  [signal coll]
+  (loop [sb (java.lang.StringBuilder.)
+         weight nil
+         more coll]
+    (if more
+      (let [xComp (first more)]
+        (recur (.append sb (.getString xComp))
+               (get-property "CharWeight" xComp)
+               (next more)))
+      (assoc signal :line (str sb) :weight weight))))
+
+(defn get-content-map
+  "Given a XTextContent object, return a string that is a concatenation of the sequence of XTextPortion objects that have 'Text' TextPortionType values."
+  [signal]
+  (let [xTextElement (:xtext signal)
+        sig (dissoc signal :xtext)]
+    (make-portion-map sig
+      (filter is-text-portion?
+        (map #(com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.text.XTextRange %)
+          (uno-enumeration-seq
+            (.createEnumeration
+              (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.container.XEnumerationAccess xTextElement))))))))
+
+; XXX doesnt do properties at the moment
+(defn make-content-map
+  "Given a XTextContent object, return a signal struct with the XTextContent object and their associated properties ParaLeftMargin and ParaAdjust."
+  [xTextElement]
+  (let [signal (struct signal-struct nil nil nil nil)]
+    (assoc signal :xtext xTextElement))) ; NOTE rm or memory leak!
+
+(defn get-doc-content
+  "Given a XTextDocument object, return a sequence of signal structs containing XTextContent objects that support the Paragraph service,
+   as well as their associated ParaLeftMargin and ParaAdjust."
+  [xDoc]
+  (map make-content-map
+    (filter #(supports-service? "com.sun.star.text.Paragraph" %)
+;    (map #(com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.text.XTextContent %) ; not needed for some reason
+      (uno-enumeration-seq
+        (.createEnumeration
+          (com.sun.star.uno.UnoRuntime/queryInterface com.sun.star.container.XEnumerationAccess (.getText xDoc)))))))
+
+(defn get-doc-maps
+  "Given a XTextDocument object, return a sequence of maps representing paragraphs and their properties."
+  [xDoc]
+  (map get-content-map (get-doc-content xDoc)))
+
+;; test functions
+
+(defn t-get-uno-doc
+  ""
+  []
+  (let [p (spawn-soffice)
+        desktop (get-uno-desktop)
+        doc-one (get-uno-doc desktop "file:///home/msr/src/openlaw-test/us-co-law/crs2013/CRS%20Title%2024%20(2013).rtf")]
+    (if (some? doc-one)
+      (do
+        (doseq [m (get-doc-maps doc-one)]
+          (prn m))
+        (.dispose doc-one)
+        (terminate-uno-desktop desktop)
+        (println "Terminated soffice.")
+        (.waitFor p))
+      (println "No document."))))
+