bugfix

bugfix

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


Refactored thunk-timeout

Refactored thunk-timeout

--- jvm-runner/src/clojure/codewars/kill_switch.clj
+++ jvm-runner/src/clojure/codewars/kill_switch.clj
@@ -1,43 +1,28 @@
 (ns codewars.kill-switch
   (:import [java.util.concurrent TimeoutException ExecutionException TimeUnit FutureTask]))

-(def ^{:doc "Create a map of pretty keywords to ugly TimeUnits"}
-  uglify-time-unit
-  (into {} (for [[enum aliases] {TimeUnit/NANOSECONDS [:ns :nanoseconds]
-                                 TimeUnit/MICROSECONDS [:us :microseconds]
-                                 TimeUnit/MILLISECONDS [:ms :milliseconds]
-                                 TimeUnit/SECONDS [:s :sec :seconds]}
-                 alias aliases]
-             {alias enum})))
-
+;; Adapted from https://github.com/Raynes/clojail/blob/master/src/clojail/core.clj#L24
 (defn thunk-timeout
-  "Takes a function and an amount of time to wait for thse function to finish
-   executing. The sandbox can do this for you. unit is any of :ns, :us, :ms,
-   or :s which correspond to TimeUnit/NANOSECONDS, MICROSECONDS, MILLISECONDS,
-   and SECONDS respectively."
-  ([thunk ms]
-     (thunk-timeout thunk ms :ms nil)) ; Default to milliseconds, because that's pretty common.
-  ([thunk time unit]
-     (thunk-timeout thunk time unit nil))
-  ([thunk time unit tg]
-     (let [task (FutureTask. thunk)
-           thr (if tg (Thread. tg task) (Thread. task))]
-       (try
-         (.start thr)
-         (.get task time (or (uglify-time-unit unit) unit))
-         (catch TimeoutException e
-           (.cancel task true)
-           (.stop thr)
-           (throw (TimeoutException. "Execution timed out.")))
-         (catch ExecutionException e
-           (.cancel task true)
-           (.stop thr)
-           (throw (.getCause e)))
-         (catch Exception e
-           (.cancel task true)
-           (.stop thr)
-           (throw e))
-         (finally (when tg (.stop tg)))))))
+  "Takes a function and an amount of time to wait for the function to finish
+   executing."
+  [thunk ms]
+  (let [task (FutureTask. thunk)
+        thr (Thread. task)]
+    (try
+      (.start thr)
+      (.get task ms TimeUnit/MILLISECONDS)
+      (catch TimeoutException e
+        (.cancel task true)
+        (.stop thr)
+        (throw (TimeoutException. (str "Timeout: " ms " msecs"))))
+      (catch ExecutionException e
+        (.cancel task true)
+        (.stop thr)
+        (throw (.getCause e)))
+      (catch Exception e
+        (.cancel task true)
+        (.stop thr)
+        (throw e)))))

 (defmacro with-timeout


Change how the gamepad emits events.

Change how the gamepad emits events.

This simplifies how buttons are handled - now they are simple boolean
inputs which generate `:button/press`, `:button/release`, and
`:button/hold` events with no `:value`. Note that `hold` replaces
`repeat`.

Axes are now treated as a different class of input with a real number
input value. Whenever the input is not the default state, axes emit
`:axis/direction` events with `:axis` and `:value` entries.

--- src/org/playasophy/wonderdome/input/gamepad.clj
+++ src/org/playasophy/wonderdome/input/gamepad.clj
@@ -31,37 +31,42 @@
     (into {})))

-(defn- button-events
-  "Calculates button press and release events. Returns a seq of events."
+(defn- button-state-events
+  "Calculates button press and release events. Returns a sequence of button
+  press and release events."
   [buttons old-state new-state]
-  (for [[button default] buttons]
+  (for [button buttons]
     (let [old-val (get old-state button)
           new-val (get new-state button)]
       (when (not= old-val new-val)
-        (if (number? new-val)
-          (cond
-            (= default new-val)
-            {:type :button/release, :source :gamepad, :button button, :value new-val}
-            (= default old-val)
-            {:type :button/press, :source :gamepad, :button button, :value new-val})
-          (cond
-            new-val
-            {:type :button/press, :button button, :source :gamepad}
-            old-val
-            {:type :button/release, :button button, :source :gamepad}))))))
+        {:type (if new-val :button/press :button/release)
+         :source :gamepad
+         :button button}))))

-(defn- repeat-events
-  "Calculates repeated button 'hold' events, where the value differs from some
-  default value. Sends an event with the button and the elapsed ms it has been
-  pressed for."
+(defn- button-hold-events
+  "Calculates repeated button hold events. Returns a sequence of events with
+  the button and the elapsed ms it has been pressed for."
   [buttons state elapsed]
-  (for [[button default] buttons]
-    (let [value (get state button)]
-      (when (and (some? value) (not= value default))
-        {:type :button/repeat
+  (for [button buttons]
+    (if (get state button)
+      {:type :button/hold
+       :source :gamepad
+       :button button
+       :elapsed elapsed})))
+
+
+(defn- axis-direction-events
+  "Calculates repeated axis direction events. Returns a sequence of events with
+  the axis, the current value in [-1.0, 1.0], and the elapsed ms it has had
+  that value."
+  [axes state elapsed]
+  (for [[axis default] axes]
+    (let [value (get state axis)]
+      (when (not= default value)
+        {:type :axis/direction
          :source :gamepad
-         :button button
+         :axis axis
          :value value
          :elapsed elapsed}))))

@@ -86,6 +91,12 @@
 (def ^:const snes-vendor-id  0x12bd)
 (def ^:const snes-product-id 0xd015)

+(def ^:private snes-axes
+  {:x-axis 0.0
+   :y-axis 0.0})
+
+(def ^:private snes-buttons
+  #{:X :A :B :Y :L :R :select :start})

 (def ^:private snes-bits
   {:X      [3 0]
@@ -96,19 +107,6 @@
    :R      [3 5]
    :select [4 0]
    :start  [4 1]})
-
-
-(def ^:private snes-defaults
-  {:x-axis 0.0
-   :y-axis 0.0
-   :X      false
-   :A      false
-   :B      false
-   :Y      false
-   :L      false
-   :R      false
-   :select false
-   :start  false})

 (defn- snes-read-state
@@ -124,6 +122,7 @@
     (log/warn
       (str "Incomplete data read from SNES controller: "
            (apply str (map (partial format "%02X") (take len buffer)))))
+    ; TODO: virtual d-pad buttons
     (assoc
       (read-buttons snes-bits buffer)
       :x-axis (byte-axis (aget buffer 0))
@@ -134,8 +133,9 @@
   [old-state new-state elapsed]
   (remove nil?
     (concat
-      (repeat-events snes-defaults old-state elapsed)
-      (button-events snes-defaults old-state new-state))))
+      (axis-direction-events snes-axes old-state elapsed)
+      (button-hold-events snes-buttons old-state elapsed)
+      (button-state-events snes-buttons old-state new-state))))

 (defn snes


disabling nemesis to see scheduler behavior

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


remove silly comment

remove silly comment

--- src/metabase/api/meta/field.clj
+++ src/metabase/api/meta/field.clj
@@ -60,6 +60,7 @@
         :relationship relationship)
       (hydrate [:origin :table] [:destination :table])))

+
 (defn- create-field-values
   "Create `FieldValues` for a `Field`."
   [{:keys [id] :as field} human-readable-values]
@@ -67,6 +68,7 @@
     :field_id id
     :values (driver-metadata/field-distinct-values field)
     :human_readable_values human-readable-values))
+

 (defendpoint GET "/:id/values" [id]
   (let-404 [{:keys [special_type] :as field} (sel :one Field :id id)]
@@ -76,8 +78,7 @@
       (or (sel :one FieldValues :field_id id)
           (create-field-values field nil)))))

-;; TODO
-;; POST /:id/value_map_update
+
 (defendpoint POST "/:id/value_map_update" [id :as {{:keys [fieldId values_map]} :body}] ; WTF is the reasoning behind client passing fieldId in POST params?
   {values_map [Required Dict]}
   (let-404 [{:keys [special_type]  :as field} (sel :one Field :id id)]
@@ -90,4 +91,5 @@
       (create-field-values field values_map)))
   {:status :success})

+
 (define-routes)


fix up session unit test now that we are returning a 400 response instead of 404 when email doesn't map to user.

--- test/metabase/api/session_test.clj
+++ test/metabase/api/session_test.clj
@@ -64,8 +64,8 @@
   (client :post 400 "session/forgot_password" {}))

 ;; Test that email not found gives 404
-(expect "Not found."
-  (client :post 404 "session/forgot_password" {:email "not-found@metabase.com"}))
+(expect {:errors {:email "no account found for the given email"}}
+  (client :post 400 "session/forgot_password" {:email "not-found@metabase.com"}))

 ;; POST /api/session/reset_password


Stub for new test: test-products

Stub for new test: test-products

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

--- test/clouseau/test_products.clj
+++ test/clouseau/test_products.clj
@@ -0,0 +1,43 @@
+;;;
+;;;   Clouseau
+;;;
+;;;    Copyright (C) 2015 Pavel Tisnovsky <ptisnovs@redhat.com>
+;;;
+;;; Clouseau is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2, or (at your option)
+;;; any later version.
+;;;
+;;; Clouseau is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with Clouseau; see the file COPYING.  If not, write to the
+;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+;;; 02110-1301 USA.
+;;;
+;;; Linking this library statically or dynamically with other modules is
+;;; making a combined work based on this library.  Thus, the terms and
+;;; conditions of the GNU General Public License cover the whole
+;;; combination.
+;;;
+;;; As a special exception, the copyright holders of this library give you
+;;; permission to link this library with independent modules to produce an
+;;; executable, regardless of the license terms of these independent
+;;; modules, and to copy and distribute the resulting executable under
+;;; terms of your choice, provided that you also meet, for each linked
+;;; independent module, the terms and conditions of the license of that
+;;; module.  An independent module is a module which is not derived from
+;;; or based on this library.  If you modify this library, you may extend
+;;; this exception to your version of the library, but you are not
+;;; obligated to do so. If you do not wish to do so, delete this
+;;; exception statement from your version.
+;;;
+
+(ns clouseau.test-core
+  (:require [clojure.test :refer :all]
+            [clouseau.products :refer :all]))
+
+


Fix UUID serialization in teams

Fix UUID serialization in teams

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


Deletion works OK, add some logging

Deletion works OK, add some 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/expez/jada.git/'


when is better than if sometimes

when is better than if sometimes

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


Fix Cache-Control header

Fix Cache-Control header

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


Only try to close channel when it exists.

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


Make tests play well with feature flag

Make tests play well with feature flag

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


pass community selection to graphql

pass community selection to graphql


Une solution à l'exercice binary search de Exercism dans la track Clojure.

--- exercism/clojure/binary-search/src/binary_search.clj
+++ exercism/clojure/binary-search/src/binary_search.clj
@@ -1,9 +1,19 @@
 (ns binary-search)

-(defn search-for [] ;; <- arglist goes here
-  ;; your code goes here
-)
+(defn middle [sequence]
+  (quot (count sequence) 2))

-(defn middle [] ;; <- arglist goes here
-  ;; your code goes here
-)
+(defn index [sequence]
+  (map vector (iterate inc 0) sequence))
+
+(defn search-for [elem sorted-sequence]
+  (let [sequence-of-vector (index sorted-sequence)]
+    (loop [sequence sequence-of-vector]
+      (let [middle-index (middle sequence)
+            middle-vector-value (nth sequence middle-index)
+            middle-value (second middle-vector-value)]
+        (cond
+          (= elem middle-value) (first middle-vector-value)
+          (or (empty? sequence) (= 1 (count sequence))) (throw (Exception. "Value not found"))
+          (< elem middle-value) (recur (take middle-index sequence))
+          (> elem middle-value) (recur (drop middle-index sequence)))))))


added clojure tests

added clojure tests

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

--- mungbean-clojure/test/mungbean_test.clj
+++ mungbean-clojure/test/mungbean_test.clj
@@ -0,0 +1,15 @@
+(ns mungbean_test
+  (:use
+       [clojure.test]
+       [mungbean]
+  )
+)
+
+(deftest insert-item-read-back-and-delete
+	(let [mungo (get-collection (get-db "foobar") "foo")]
+		(let [id ((insert mungo {:foo "bar"}) :_id)]
+		   (find-one mungo id)
+		   (delete mungo id)
+		)
+	)
+)


lein profiles version upgrades.

lein profiles version upgrades.

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


common functoins test (init commit)

common functoins test (init commit)

error: pathspec 'saas-dsl/test/saas_dsl/common_test.clj' did not match any file(s) known to git

--- saas-dsl/test/saas_dsl/common_test.clj
+++ saas-dsl/test/saas_dsl/common_test.clj
@@ -0,0 +1 @@
+(ns sass-dsl.common-test)


dump out full stack trace when API call fails; don't try to call API for nil/blank zip

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


Make sure dot files are hidden on Windows

fatal: unable to access 'https://github.com/bsmr-clojure/Nightcode.git/': The requested URL returned error: 403


add :figwheel true

add :figwheel true

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


add code for doing triple extraction

add code for doing triple extraction

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

--- flowrweb/src/flowrweb/extractor.clj
+++ flowrweb/src/flowrweb/extractor.clj
@@ -0,0 +1,277 @@
+;;; extractor.clj
+
+;;; Commentary:
+
+;; This code implements the basic algorithm from:
+;;
+;; D. Rusu, L. Dali, B. Fortuna, M. Grobelnik, and D. Mladenic.
+;; Triplet extraction from sentences.
+;; In Proceedings of the 10th International Multiconference Information Society-IS, pages 8–12, 2007.
+
+;; The implementation uses Clojure's "zipper" functionality to
+;; traverse parse trees.
+
+;; Status: It works but could use some tuning.
+
+;;; Code:
+
+(defn sequence-to-vector
+  "This turns a treebank parse tree into a vector, which makes it easier to manipulate with zippers."
+  [treebank]
+  (read-string
+   (clojure.string/replace
+    ;; quote all words
+    (clojure.string/replace treebank  #"[^() ]+" #(str "\"" %1 "\""))
+    #"[()]" #(if (= %1 "(") "[" "]"))))
+
+;;;;;;;;;;;;;;;
+;; Some matchers
+
+(defn match-np? [loc]
+  (= "NP" (z/node loc)))
+
+(defn match-noun? [loc]
+  (some #{"NN" "NNP" "NNPS" "NNS"} (z/node loc)))
+
+(defn match-vp? [loc]
+  (= "VP" (z/node loc)))
+
+(defn match-pp? [loc]
+  (= "PP" (z/node loc)))
+
+(defn match-verb? [loc]
+  (some #{"VB" "VBD" "VBG" "VBN" "VBZ"} (z/node loc)))
+
+(defn match-adjp? [loc]
+  (= "ADJP" (z/node loc)))
+
+(defn match-adjective? [loc]
+  (some #{"JJ" "JJR"} (z/node loc)))
+
+;;;;;;;;;;;;;;;
+
+;; Basic working finder - this is actually used
+(defn tree-find
+  "Take a zipper and a function that matches a pattern in the tree.
+  Examine the tree nodes in depth-first order, determine whether the
+  matcher matches, and if so return the parent context."
+  [zipper matcher]
+  (loop [loc zipper]
+    (if (z/end? loc)
+      (z/root loc)
+      (if-let [matcher-result (matcher loc)]
+        (z/node (z/up loc))
+        (recur (z/next loc))))))
+
+;; helper function called by `tree-find-descendent', see below
+(defn tree-find-this
+  "Take a zipper and a function that matches a pattern in the tree.
+  Examine the tree nodes in depth-first order, determine whether the
+  matcher matches, and if so return it."
+  [zipper matcher]
+  (loop [loc zipper]
+    (if (z/end? loc)
+      (z/root loc)
+      (if-let [matcher-result (matcher loc)]
+        (z/node loc)
+        (recur (z/next loc))))))
+
+;; Find the first matching piece, then find its first matching descendent
+(defn tree-find-descendent
+  "Take a zipper, a function that matches a pattern in the tree, and another function that matches a descendent.
+  Examine the tree nodes in depth-first order, determine whether the
+  first matcher matches, and if so return the first descendent that matches the second predicate."
+  [zipper matcher descendent]
+  (loop [loc zipper]
+    (if (z/end? loc)
+      (z/root loc)
+      (if-let [matcher-result (matcher loc)]
+        (tree-find-this (z/up loc) descendent)
+        (recur (z/next loc))))))
+
+(defn tree-find-last
+  "Take a zipper and a function that matches a pattern in the tree.
+  Examine the tree nodes in depth-first order to amass a list of matching
+  nodes, and return the last one."
+  [loc matcher]
+  (last
+   (filter matcher ;filter only matching nodes
+           (take-while (complement z/end?) ;take until the :end
+                       (iterate z/next loc)))))
+
+(defn tree-find-last-descendent
+  "Take a zipper, a function that matches a pattern in the tree, and another function that matches a descendent.
+  Examine the tree nodes in depth-first order, determine whether the
+  first matcher matches, and if so return the first descendent that matches the second predicate."
+  [zipper matcher descendent]
+  (loop [loc zipper]
+    (if (z/end? loc)
+      (z/root loc)
+      (if-let [matcher-result (matcher loc)]
+        (z/node (tree-find-last (z/up loc) descendent))
+        (recur (z/next loc))))))
+
+;; This simply finds the siblings
+(defn tree-find-siblings
+  "Find the siblings of loc."
+  [loc]
+  ;; scroll to the right -- it seems there's no "nice" way to add
+  ;; the last element, so just tack it on at the end using a hack.
+  ;; http://stackoverflow.com/questions/5734435/put-an-element-to-the-tail-of-a-collection
+  (concat (take-while (complement #(= (z/right %) nil))
+                      (iterate z/right (z/leftmost loc)))
+          [(z/rightmost loc)]))
+
+;; This involves horizontal motion so we need to make sure to get all of the horizontal items?
+(defn tree-find-siblings-of-last-descendent
+  "Take a zipper, a function that matches a pattern in the tree, and another function that matches a descendent.
+  Examine the tree nodes in depth-first order, determine whether the
+  first matcher matches, and if so return the first descendent that matches the second predicate."
+  [zipper matcher descendent]
+  (loop [loc zipper]
+    (if (z/end? loc)
+      (z/root loc)
+      (if-let [matcher-result (matcher loc)]
+        (let [the-sibling (tree-find-last (z/up loc) descendent)]
+          (tree-find-siblings the-sibling)
+          )
+        (recur (z/next loc))))))
+
+;; This function works efficiently because `filter' is lazy.
+;; This is a cool example illustrating lazy evaluation!
+(defn find-first
+  [f coll]
+  (first (filter f coll)))
+
+;; The following functions do the basic extractions we're looking for.
+;; At the moment I'm going to leave aside the question of building up attribute lists
+
+(defn tree-find-subject [zipper]
+  (tree-find-descendent zipper match-np? match-noun?))
+
+(defn tree-find-predicate [zipper]
+  (tree-find-last-descendent zipper match-vp? match-verb?))
+
+;; This finder looks in the zipper for the verb phrase, finds its
+;; siblings, and among those, locates the nouns.  It then finds the
+;; first actual noun from the matched siblings, and returns that.
+(defn tree-find-object [zipper]
+  ;; find the siblings of the verb
+  (let [siblings (tree-find-siblings-of-last-descendent zipper match-vp? match-verb?)]
+    ;; take the first noun we find
+    (or
+     (find-first #(contains? #{"NN" "NNP" "NNPS" "NNS"} (first %))
+                 ;; among the siblings, look for either a NP or a PP containing any noun
+                 (map #(tree-find-descendent %
+                                             (fn [x] (or (match-np? x)
+                                                         (match-pp? x)))
+                                             match-noun?)
+                      siblings))
+     ;; if we don't find any noun, take the first adjective we find
+     (find-first #(contains? #{"JJ" "JJR"} (first %))
+                 ;; among the siblings, for either an ADJP containing an adjective
+                 (map #(tree-find-descendent %
+                                             match-adjp?
+                                             match-adjective?)
+                      siblings)))))
+
+
+
+;;;;;;;;;;;;;;;
+
+;; SENTENCE comes from an opennlp treebank parse
+(defn triplet-extraction [sentence]
+  (let [svector (sequence-to-vector sentence)
+        szipper (z/zipper vector? seq (fn [_ c] c) svector)
+        ;; candidate as a vector
+        candidate [(tree-find-subject szipper)
+                   (tree-find-predicate szipper)
+                   (tree-find-object szipper)]]
+    (if (some nil? candidate)
+      false
+      candidate)))
+
+;;; Example of reading from a file
+
+(defn read-frankenstein [number-of-sentences]
+  (with-open-seq [rdr (clojure.java.io/reader "/home/joe/FloWrTester/corpus/frankenstein.txt")]
+    (let [sentences (sentence-seq rdr get-sentences)
+          lsentences (take number-of-sentences sentences)
+          lparse (map #(first (treebank-parser
+                               ;; requires a vector input
+                               [(clojure.string/join " " %)]))
+                      (lazy-tokenize
+                       lsentences
+                       tokenize))]
+      ;; process your lazy seq of sentences however you desire
+      (println "first number-of-sentences sentences:")
+      (map (fn [sent]
+             (clojure.pprint/pprint sent)
+             (try (do (print "Extraction: ")
+                      (clojure.pprint/pprint (triplet-extraction sent)))
+                  (catch Exception e
+                    (println "EXCEPTION: " (.getMessage e)))))
+           lparse))))
+
+
+;; function TRIPLET-EXTRACTION(sentence)
+;; "returns a solution, or failure"
+;;     result ← EXTRACT-SUBJECT(NP_subtree) + EXTRACT-PREDICATE(VP_subtree) + EXTRACT-OBJECT(VP_siblings)
+;;     if result ≠ failure then return result
+;;     else return failure
+
+;; function EXTRACT-ATTRIBUTES(word)
+;; "returns a solution, or failure"
+;; # search among the word’s siblings
+;; if adjective(word)
+;;     result ← all RB siblings
+;; else
+;; if noun(word)
+;;     result ← all DT, PRP$, POS, JJ, CD, ADJP, QP, NP siblings
+;; else
+;; if verb(word)
+;;     result ← all ADVP siblings
+;; # search among the word’s uncles
+;; if noun(word) or adjective(word)
+;;     if uncle = PP
+;;         result ← uncle subtree
+;; else
+;;     if verb(word) and (uncle = verb)
+;;         result ← uncle subtree
+;; if result ≠ failure then return result
+;; else return failure
+
+;; function EXTRACT-SUBJECT(NP_subtree)
+;; "returns a solution, or failure"
+;; subject ← first noun found in NP_subtree
+;; subjectAttributes ← EXTRACT-ATTRIBUTES(subject)
+;; result ← subject ∪ subjectAttributes
+;; if result ≠ failure then return result
+;; else return failure
+
+;; function EXTRACT-PREDICATE(VP_subtree)
+;; "returns solution, or failure"
+;; predicate ← deepest verb found in VP_subtree
+;; predicateAttributes ← EXTRACT-ATTRIBUTES(predicate)
+;; result ← predicate ∪ predicateAttributes
+;; if result ≠ failure then return result
+;; else return failure
+
+;; function EXTRACT-OBJECT(VP_sbtree)
+;; "returns a solution, or failure"
+;; siblings ← find NP, PP and ADJP siblings of
+;; VP_subtree
+;; for each value in siblings do
+;;     if value = NP or PP
+;;         object ← first noun in value
+;;     else
+;;         object ← first adjective in value
+;;         objectAttributes ← EXTRACT-ATTRIBUTES(object)
+;; result ← object ∪ objectAttributes
+;; if result ≠ failure then return result
+;; else return failure
+
+;; Figure 1: The algorithm for extracting triplets in
+;; treebank output.
+
+;;; extractor.clj ends here


Scaffold event handlers for uploading income verification


Broadcast channel for control

Broadcast channel for control

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


Initial postwalk solution, some test cases

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

--- src/main/cljc/clojure_club/x121_universal_computation_engine/wmatson.cljc
+++ src/main/cljc/clojure_club/x121_universal_computation_engine/wmatson.cljc
@@ -0,0 +1,27 @@
+(ns main.cljc.clojure-club.x121-universal-computation-engine.wmatson)
+
+(def fix-op-quote-maddness {'+ + '/ / '- - '* *})
+
+(defn node-evaluator [var-map]
+   #(cond
+      (var-map %) (var-map %)
+      (list? %) (apply (fix-op-quote-maddness (first %)) (rest %))
+      :default %))
+
+(defn weird-eval [expr]
+   (fn [var-map]
+     (clojure.walk/postwalk
+       (node-evaluator var-map)
+       expr)))
+
+;; (= 2 ((weird-eval '(/ a b)) '{b 8 a 16}))
+;; (= 8 ((weird-eval '(+ a b 2)) '{a 2 b 4}))
+;; (= [6 0 -4]
+;;    (map (weird-eval '(* (+ 2 a)
+;;                         (- 10 b)))
+;;         '[{a 1 b 8}
+;;           {b 5 a -2}
+;;           {a 2 b 11}]))
+;; (= 1 ((weird-eval '(/ (+ x 2)
+;;                       (* 3 (+ y 1))))
+;;       '{x 4 y 1}))


change fixture back to :once, remove FIXME

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


Add offset reset test

Add offset reset test

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

--- test/onyx/plugin/input_offset_reset_test.clj
+++ test/onyx/plugin/input_offset_reset_test.clj
@@ -0,0 +1,157 @@
+(ns onyx.plugin.input-offset-reset-test
+  (:require [clojure.core.async :refer [chan >!! <!!]]
+            [onyx.plugin.core-async :refer [take-segments!]]
+            [com.stuartsierra.component :as component]
+            [taoensso.timbre :refer [info error] :as timbre]
+            [onyx.plugin.kafka]
+            [clj-kafka.producer :as kp]
+            [clj-kafka.admin :as kadmin]
+            [onyx.kafka.embedded-server :as ke]
+            [onyx.api]
+            [midje.sweet :refer :all]))
+
+(def id (java.util.UUID/randomUUID))
+
+(def zk-addr "127.0.0.1:2188")
+
+(def env-config
+  {:zookeeper/address zk-addr
+   :zookeeper/server? true
+   :zookeeper.server/port 2188
+   :onyx/id id})
+
+(def peer-config
+  {:zookeeper/address zk-addr
+   :onyx.peer/job-scheduler :onyx.job-scheduler/greedy
+   :onyx.messaging/impl :core.async
+   :onyx.messaging/peer-port-range [40200 40400]
+   :onyx.messaging/peer-ports [40199]
+   :onyx.messaging/bind-addr "localhost"
+   :onyx/id id})
+
+(def env (onyx.api/start-env env-config))
+
+(def kafka-server
+  (component/start
+    (ke/map->EmbeddedKafka {:hostname "127.0.0.1"
+                            :port 9092
+                            :broker-id 0
+                            :log-dir (str "/tmp/embedded-kafka" (java.util.UUID/randomUUID))
+                            :zookeeper-addr zk-addr})))
+
+(def peer-group (onyx.api/start-peer-group peer-config))
+
+(def topic (str "onyx-test-" (java.util.UUID/randomUUID)))
+
+(def producer
+  (kp/producer
+   {"metadata.broker.list" "127.0.0.1:9092"
+    "serializer.class" "kafka.serializer.DefaultEncoder"
+    "partitioner.class" "kafka.producer.DefaultPartitioner"}))
+
+(kp/send-message producer (kp/message topic (.getBytes (pr-str {:n 1}))))
+(kp/send-message producer (kp/message topic (.getBytes (pr-str {:n 2}))))
+(kp/send-message producer (kp/message topic (.getBytes (pr-str {:n 3}))))
+;(kp/send-message producer (kp/message topic (.getBytes (pr-str :done))))
+
+(defn deserialize-message [bytes]
+  (read-string (String. bytes "UTF-8")))
+
+(def workflow
+  [[:read-messages :identity]
+   [:identity :out]])
+
+(def catalog
+  [{:onyx/name :read-messages
+    :onyx/plugin :onyx.plugin.kafka/read-messages
+    :onyx/type :input
+    :onyx/medium :kafka
+    :kafka/topic topic
+    :kafka/group-id "onyx-consumer"
+    :kafka/fetch-size 307200
+    :kafka/chan-capacity 1000
+    :kafka/zookeeper zk-addr
+    :kafka/offset-reset :smallest
+    :kafka/force-reset? true
+    :kafka/empty-read-back-off 500
+    :kafka/commit-interval 500
+    :kafka/deserializer-fn ::deserialize-message
+    :kafka/partition "0"
+    :onyx/min-peers 1
+    :onyx/max-peers 1
+    :onyx/batch-size 100
+    :onyx/doc "Reads messages from a Kafka topic"}
+
+   {:onyx/name :identity
+    :onyx/fn :clojure.core/identity
+    :onyx/type :function
+    :onyx/batch-size 100}
+
+   {:onyx/name :out
+    :onyx/plugin :onyx.plugin.core-async/output
+    :onyx/type :output
+    :onyx/medium :core.async
+    :onyx/batch-size 100
+    :onyx/doc "Writes segments to a core.async channel"}])
+
+(def out-chan (chan 100))
+
+(defn inject-out-ch [event lifecycle]
+  {:core.async/chan out-chan})
+
+(def out-calls
+  {:lifecycle/before-task-start inject-out-ch})
+
+(def lifecycles
+  [{:lifecycle/task :read-messages
+    :lifecycle/calls :onyx.plugin.kafka/read-messages-calls}
+   {:lifecycle/task :out
+    :lifecycle/calls ::out-calls}
+   {:lifecycle/task :out
+    :lifecycle/calls :onyx.plugin.core-async/writer-calls}])
+
+(def v-peers (onyx.api/start-peers 3 peer-group))
+
+(def job-id
+  (:job-id (onyx.api/submit-job
+             peer-config
+             {:catalog catalog :workflow workflow
+              :lifecycles lifecycles
+              :task-scheduler :onyx.task-scheduler/balanced})))
+
+(def results (doall (map (fn [_] (<!! out-chan)) (range 3))))
+
+(println "First results out " results)
+
+(onyx.api/kill-job peer-config job-id)
+(onyx.api/await-job-completion peer-config job-id)
+
+(Thread/sleep 2000)
+
+(kp/send-message producer (kp/message topic (.getBytes (pr-str {:n 4}))))
+(kp/send-message producer (kp/message topic (.getBytes (pr-str {:n 5}))))
+(kp/send-message producer (kp/message topic (.getBytes (pr-str {:n 6}))))
+(kp/send-message producer (kp/message topic (.getBytes (pr-str :done))))
+
+(def job-id2
+  (:job-id (onyx.api/submit-job
+             peer-config
+             {:catalog catalog :workflow workflow
+              :lifecycles lifecycles
+              :task-scheduler :onyx.task-scheduler/balanced})))
+
+(def results2 (doall (map (fn [_] (<!! out-chan)) (range 7))))
+
+(fact (sort-by :n (butlast results2))
+      => [{:n 1} {:n 2} {:n 3} {:n 4} {:n 5} {:n 6}])
+
+(fact (last results2) => :done)
+
+(doseq [v-peer v-peers]
+  (onyx.api/shutdown-peer v-peer))
+
+(onyx.api/shutdown-peer-group peer-group)
+
+(onyx.api/shutdown-env env)
+
+(component/stop kafka-server)


consider an empty auth map non-authenticated in navigation

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


beginnings of core-allocate-inline*

beginnings of core-allocate-inline*

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


Add faker class to fake some test-selections on page

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

--- src/discuss/utils/faker.cljs
+++ src/discuss/utils/faker.cljs
@@ -0,0 +1,47 @@
+(ns discuss.utils.faker
+  (:require [cljs.spec.alpha :as s]))
+
+(def sentences-from-index
+  ["The Botanical Garden of the Heinrich-Heine-University was founded in 1973 and belongs to the Institute of Botany at HHU."
+   "There are around 6000 different plant species domiciled."
+   "Currently, the city council discusses to close the University Park, because of its high running expenses of about $100.000 per year."
+   "But apparently there is an anonymous investor ensuring to pay the running costs for at least the next five years."
+   "Thanks to this anonymous person, the city does not loose a beautiful park, but this again fires up the discussion about possible savings for the future."
+   "Here is some more blind text, which could be interactively inserted into the current discussion to show its functionality."
+   "Since we reset the database daily, it does not matter which arguments are inserted and used to test and play around with discuss."
+   "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
+   "Aenean commodo ligula eget dolor."
+   "Aenean massa."
+   "Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus."
+   "Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem."
+   "Nulla consequat massa quis enim."
+   "Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu."
+   "In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo."
+   "Nullam dictum felis eu pede mollis pretium."
+   "Integer tincidunt."
+   "Cras dapibus."
+   "Vivamus elementum semper nisi."
+   "Aenean vulputate eleifend tellus."
+   "Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim."
+   "Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus."
+   "Phasellus viverra nulla ut metus varius laoreet."
+   "Quisque rutrum."
+   "Aenean imperdiet."
+   "Etiam ultricies nisi vel augue."
+   "Curabitur ullamcorper ultricies nisi."
+   "Nam eget dui."
+   "Etiam rhoncus."
+   "Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum."
+   "Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem."
+   "Maecenas nec odio et ante tincidunt tempus."
+   "Donec vitae sapien ut libero venenatis faucibus."
+   "Nullam quis ante."
+   "Etiam sit amet orci eget eros faucibus tincidunt."
+   "Duis leo."])
+
+(defn random-sentence
+  "Return random sentence from website to fake selections."
+  []
+  (rand-nth sentences-from-index))
+(s/fdef random-sentence
+  :ret string?)


Add foldable public api in cats.core ns.

--- src/cats/core.cljc
+++ src/cats/core.cljc
@@ -515,3 +515,15 @@
   (p/extract v))

 (def <> mappend)
+
+(defn foldr
+  "Perform a right-associative fold on the data structure."
+  [f z xs]
+  (let [ctx (get-current-context xs)]
+    (p/foldr ctx f z xs)))
+
+(defn foldl
+  "Perform a right-associative fold on the data structure."
+  [f z xs]
+  (let [ctx (get-current-context xs)]
+    (p/foldl ctx f z xs)))


TODO soberan

TODO soberan

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


expand types per expanded protocols

expand types per expanded protocols


[TH] use more up-to-date schema structures

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


binding options more different than expected

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

--- chap_05.clj
+++ chap_05.clj
@@ -0,0 +1,11 @@
+; use destructuring bind instead of nil
+(defn foo [a b & [c d]]
+  (list a b c d))
+
+; use keys and or directives for optional values
+(defn foo [{:keys [a b] :or {b 10}}] (list a b))
+
+; couldn't find a way for destructure to refer to other parts
+(defn make-rectangle
+  ([width] (make-rectangle width width))
+  ([width height] {:width width :height height}))


in nio/watch-sync, use hash-map instead of array-map.

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


No animation yet

No animation yet

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/just-cloud/uxtweet-client.git/'


Create cadence.state for easy access to application state.

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

--- src/cadence/state.clj
+++ src/cadence/state.clj
@@ -0,0 +1,26 @@
+(ns cadence.state
+  "Provide easy access to application level options."
+  (:refer-clojure :exclude [get merge]))
+
+(def state
+  "A map describing the state of the application."
+  (atom {:mode :dev :port 80}))
+
+(def get
+  "Get a value for the given key from the current state."
+  (partial clojure.core/get @state))
+
+(defn merge
+  "Get a value for the given key from the current state."
+  [new-state]
+  (swap! state (fn [old-state] (clojure.core/merge old-state new-state))))
+
+(defn development?
+  "Return if the application is in development mode."
+  []
+  (= (get :mode) :development))
+
+(defn production?
+  "Return if the application is in development mode."
+  []
+  (= (get :mode) :production))


Removed extraneous white space

Removed extraneous white space


Add tests.

Add tests.

error: pathspec 'test/promesa/core_tests.cljc' did not match any file(s) known to git

--- test/promesa/core_tests.cljc
+++ test/promesa/core_tests.cljc
@@ -0,0 +1,300 @@
+(ns promesa.core-tests
+  (:require #?(:cljs [cljs.test :as t]
+               :clj [clojure.test :as t])
+            [cats.core :as m]
+            [promesa.core :as p]))
+
+(defn future-ok
+  [sleep value]
+  (p/promise (fn [resolve reject]
+               (p/schedule sleep #(resolve value)))))
+
+(defn future-fail
+  [sleep value]
+  (p/promise (fn [_ reject]
+               (p/schedule sleep #(reject value)))))
+
+(t/deftest promise-from-value
+  (let [p1 (p/promise 1)]
+    (t/is (p/done? p1))
+    (t/is (= (m/extract p1) 1))))
+
+(t/deftest promise-from-factory
+  (let [p1 (p/promise (fn [resolve _] (resolve 1)))]
+    #?(:clj (deref p1))
+    (t/is (p/done? p1))
+    (t/is (= (m/extract p1) 1))))
+
+(t/deftest promise-async-factory
+  #?(:cljs
+     (t/async done
+       (let [p1 (p/promise (fn [resolve reject]
+                             (p/schedule 100 #(resolve 1))))]
+         (t/is (p/pending? p1))
+         (p/then p1 (fn [v]
+                      (t/is (= v 1))
+                      (done)))))
+     :clj
+     (let [p1 (p/promise (fn [resolve reject]
+                           (p/schedule 100 #(resolve 1))))]
+       (t/is (p/pending? p1))
+       (t/is (= @p1 1)))))
+
+(t/deftest promise-from-exception
+  (let [e (ex-info "foo" {})
+        p1 (p/promise e)]
+    (t/is (p/rejected? p1))
+    (p/catch p1 (fn [x]
+                  (t/is (= x e))))))
+
+(t/deftest promise-rejected
+  (let [e1 (ex-info "foobar" {})
+        p1 (p/rejected e1)
+        p2 (p/catch p1 (constantly nil))]
+    (t/is (p/rejected? p1))
+    (t/is (= e1 (m/extract p1)))))
+
+(t/deftest promise-from-promise
+  (let [p1 (p/promise 1)
+        p2 (p/promise p1)]
+    (t/is (identical? p1 p2))))
+
+(t/deftest syncrhonize-two-promises
+  #?(:cljs
+     (t/async done
+       (let [p1 (p/all [(p/promise 1) (p/promise 2)])]
+         (p/then p1 (fn [[x y]]
+                      (t/is (= x 1))
+                      (t/is (= y 2))
+                      (done)))))
+     :clj
+     (let [p1 (p/all [(p/promise 1) (p/promise 2)])
+           [x y] @p1]
+       (t/is (= x 1))
+       (t/is (= y 2)))))
+
+(t/deftest arbitrary-choice-with-any
+  #?(:cljs
+     (t/async done
+       (let [p1 (p/any [(p/delay 300 1) (p/delay 200 2)])]
+         (p/then p1 (fn [v]
+                      (t/is (= v 2))
+                      (done)))))
+     :clj
+     (let [p1 (p/any [(p/delay 300 1) (p/delay 200 2)])]
+       (t/is (= @p1 2)))))
+
+(t/deftest reject-promise-in-chain
+  #?(:cljs
+     (t/async done
+       (let [p1 (p/promise 1)
+             p2 (p/then p1 (fn [v]
+                             (throw (ex-info "foobar" {:msg "foo"}))))
+             p3 (p/catch p2 (fn [e]
+                              (:msg (ex-data e))))]
+         (p/then p3 (fn [v]
+                      (t/is (= v "foo"))
+                      (done)))))
+     :clj
+     (let [p1 (p/promise 1)
+           p2 (p/then p1 (fn [v]
+                           (throw (ex-info "foobar" {:msg "foo"}))))
+           p3 (p/catch p2 (fn [e]
+                            (:msg (ex-data e))))]
+       (t/is (= @p3 "foo")))))
+
+(t/deftest chaining-using-then
+  #?(:cljs
+     (t/async done
+       (let [p1 (future-ok 200 2)
+             p2 (p/then p1 inc)
+             p3 (p/then p2 inc)]
+         (p/then p3 (fn [v]
+                      (t/is (= v 4))
+                      (done)))))
+     :clj
+     (let [p1 (future-ok 200 2)
+           p2 (p/then p1 inc)
+           p3 (p/then p2 inc)]
+       (t/is @p3 4))))
+
+(t/deftest chaining-using-chain
+  #?(:cljs
+     (t/async done
+       (let [p1 (future-ok 200 2)
+             p2 (p/chain p1 inc inc inc)]
+         (p/then p2 (fn [v]
+                      (t/is (= v 5))
+                      (done)))))
+     :clj
+     (let [p1 (future-ok 200 2)
+           p2 (p/chain p1 inc inc inc)]
+       (t/is (= @p2 5)))))
+
+(t/deftest branching-using-branch-1
+  #?(:cljs
+     (t/async done
+       (let [p1 (future-ok 200 2)
+             p2 (p/branch p1 #(inc %) (constantly nil))]
+         (p/then p2 #(do
+                       (t/is (= % 3))
+                       (done)))))
+     :clj
+     (let [p1 (future-ok 200 2)
+           p2 (p/branch p1 #(inc %) (constantly nil))]
+       (t/is (= @p2 3)))))
+
+(t/deftest branching-using-branch-2
+  #?(:cljs
+     (t/async done
+       (let [e (ex-info "foobar" {})
+             p1 (future-fail 200 e)
+             p2 (p/branch p1 (constantly nil) identity)]
+         (p/then p2 #(do
+                       (t/is (= % e))
+                       (done)))))
+     :clj
+     (let [e (ex-info "foobar" {})
+           p1 (future-fail 200 e)
+           p2 (p/branch p1 (constantly nil) (constantly 1))]
+       (t/is (= @p2 1)))))
+
+(t/deftest chaining-using-bind
+  #?(:cljs
+     (t/async done
+       (let [p1 (future-ok 200 2)
+             p2 (m/>>= p1 inc inc inc)]
+         (p/then p2 (fn [v]
+                      (t/is (= v 5))
+                      (done)))))
+     :clj
+     (let [p1 (future-ok 200 2)
+           p2 (m/>>= p1 inc inc inc)]
+       (t/is (= @p2 5)))))
+
+(t/deftest promise-as-functor
+  #?(:cljs
+     (t/async done
+       (let [rp (m/fmap inc (p/promise 2))]
+         (p/then rp (fn [v]
+                      (t/is (= v 3))
+                      (done)))))
+
+     :clj
+     (let [rp (m/fmap inc (p/promise 2))]
+       @(p/then rp (fn [v]
+                     (t/is (= v 3)))))))
+
+(t/deftest promise-as-applicative
+  #?(:cljs
+     (t/async done
+       (let [rp (m/fapply (p/resolved inc) (p/promise 2))]
+         (p/then rp (fn [v]
+                      (t/is (= v 3))
+                      (done)))))
+     :clj
+     (let [rp (m/fapply (p/resolved inc) (p/promise 2))]
+       @(p/then rp (fn [v]
+                     (t/is (= v 3)))))))
+
+(t/deftest promise-as-monad
+  #?(:cljs
+     (t/async done
+       (let [p1 (m/>>= (p/promise 2) (fn [v] (m/return (inc v))))]
+         (p/then p1 (fn [v]
+                      (t/is (= v 3))
+                      (done)))))
+     :clj
+     (let [p1 (m/>>= (p/promise 2) (fn [v] (m/return (inc v))))]
+       @(p/then p1 (fn [v]
+                     (t/is (= v 3)))))))
+
+(t/deftest first-monad-law-left-identity
+  #?(:cljs
+     (t/async done
+       (let [p1 (m/pure p/promise-context 4)
+             p2 (m/pure p/promise-context 4)
+             vl  (m/>>= p2 #(m/pure p/promise-context %))]
+         (p/then (p/all [p1 vl])
+                 (fn [[v1 v2]]
+                   (t/is (= v1 v2))
+                   (done)))))
+     :clj
+     (let [p1 (m/pure p/promise-context 4)
+           p2 (m/pure p/promise-context 4)
+           vl  (m/>>= p2 #(m/pure p/promise-context %))]
+       @(p/then (p/all [p1 vl])
+                (fn [[v1 v2]]
+                  (t/is (= v1 v2)))))))
+
+(t/deftest second-monad-law-right-identity
+  #?(:cljs
+     (t/async done
+       (let [p1 (p/promise 3)
+             rs  (m/>>= (p/promise 3) m/return)]
+         (p/then (p/all [p1 rs])
+                 (fn [[v1 v2]]
+                   (t/is (= v1 v2))
+                   (done)))))
+     :clj
+     (let [p1 (p/promise 3)
+           rs  (m/>>= (p/promise 3) m/return)]
+       @(p/then (p/all [p1 rs])
+                (fn [[v1 v2]]
+                  (t/is (= v1 v2)))))))
+
+(t/deftest third-monad-law-associativity
+  #?(:cljs
+     (t/async done
+       (let [rs1 (m/>>= (m/mlet [x (p/promise 2)
+                                 y (p/promise (inc x))]
+                          (m/return y))
+                        (fn [y] (p/promise (inc y))))
+             rs2 (m/>>= (p/promise 2)
+                        (fn [x] (m/>>= (p/promise (inc x))
+                                       (fn [y] (p/promise (inc y))))))]
+         (p/then (p/all [rs1 rs2])
+                 (fn [[v1 v2]]
+                   (t/is (= v1 v2))
+                   (done)))))
+     :clj
+     (let [rs1 (m/>>= (m/mlet [x (p/promise 2)
+                               y (p/promise (inc x))]
+                        (m/return y))
+                      (fn [y]
+                        (p/promise (inc y))))
+           rs2 (m/>>= (p/promise 2)
+                      (fn [x] (m/>>= (p/promise (inc x))
+                                     (fn [y] (p/promise (inc y))))))
+           [v1 v2] @(p/all [rs1 rs2])]
+       (t/is (= v1 v2)))))
+
+(t/deftest promisify
+  #?(:cljs
+     (t/async done
+       (let [func1 (fn [x cb] (cb (inc x)))
+             func2 (p/promisify func1)
+             p1 (func2 2)]
+         (p/then p1 (fn [x]
+                      (t/is (= x 3))
+                      (done)))))
+     :clj
+     (let [func1 (fn [x cb] (cb (inc x)))
+           func2 (p/promisify func1)
+           p1 (func2 2)]
+       @(p/then p1 (fn [x]
+                     (t/is (= x 3)))))))
+
+;; (t/deftest extract-from-rejected-promise
+;;   (let [p1 (p/rejected 42)]
+;;     (t/is (p/rejected? p1))
+;;     (t/is (= (m/extract p1) 42))))
+
+#?(:cljs (enable-console-print!))
+#?(:cljs (set! *main-cli-fn* #(t/run-tests)))
+#?(:cljs
+   (defmethod t/report [:cljs.test/default :end-run-tests]
+     [m]
+     (if (t/successful? m)
+       (set! (.-exitCode js/process) 0)
+       (set! (.-exitCode js/process) 1))))


initial commit

initial commit

error: pathspec 'src/babel/italiano/vocabcoach.cljc' did not match any file(s) known to git

--- src/babel/italiano/vocabcoach.cljc
+++ src/babel/italiano/vocabcoach.cljc
@@ -0,0 +1,34 @@
+(ns babel.italiano.vocabcoach
+  (:refer-clojure :exclude [get-in merge])
+  (:require
+   #?(:clj [clojure.tools.logging :as log])
+   [babel.cache :refer [create-index]]
+   #?(:cljs [babel.logjs :as log])
+   [babel.italiano.grammar :refer [medium]]
+   [babel.italiano.lexicon :refer [lexicon]]
+   [babel.italiano.morphology :as morph :refer [fo]]
+   [babel.italiano.workbook :refer [analyze generate lightning-bolt parse]]
+   [babel.lexiconfn :refer [filter-keys filter-vals]]
+   [babel.ug :refer [head-principle]]
+   [dag_unify.core :refer [fail? get-in merge strip-refs unifyc unify]]))
+
+(def vc-lex
+  (-> lexicon
+      (filter-keys
+       #(or
+         (= % "a")
+         (= % "a prossima")
+         (= % "casa")
+         (= % "essere")
+         (= % "io")
+         (= % "sono")))))
+
+(def vc-model
+  (merge medium
+         {:lexicon vc-lex}
+         {:index (create-index (:grammar medium)
+                               (flatten (vals vc-lex))
+                               head-principle)}))
+
+
+


Update cljs -> 0.0-3269

Update cljs -> 0.0-3269

--- project.clj
+++ project.clj
@@ -5,7 +5,7 @@
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :min-lein-version "2.0.0"
   :dependencies [[org.clojure/clojure "1.7.0-beta2"]
-                 [org.clojure/clojurescript "0.0-3211"]
+                 [org.clojure/clojurescript "0.0-3269"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [com.stuartsierra/component "0.2.3"]
                  [environ "1.0.0"]


Add test/user ns.

Add test/user ns.

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

--- test/user.clj
+++ test/user.clj
@@ -0,0 +1,38 @@
+;; This Source Code Form is subject to the terms of the Mozilla Public
+;; License, v. 2.0. If a copy of the MPL was not distributed with this
+;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
+;;
+;; This Source Code Form is "Incompatible With Secondary Licenses", as
+;; defined by the Mozilla Public License, v. 2.0.
+;;
+;; Copyright (c) 2016-2020 Andrey Antukh <niwi@niwi.nz>
+
+(ns user
+  (:require
+   [clojure.spec.alpha :as s]
+   [clojure.tools.namespace.repl :as repl]
+   [clojure.walk :refer [macroexpand-all]]
+   [clojure.pprint :refer [pprint]]
+   [clojure.test :as test]
+   [clojure.java.io :as io]
+   [clojure.repl :refer :all]
+   [criterium.core :refer [quick-bench bench with-progress-reporting]]))
+
+;; --- Benchmarking Tools
+
+(defmacro run-quick-bench
+  [& exprs]
+  `(with-progress-reporting (quick-bench (do ~@exprs) :verbose)))
+
+(defmacro run-quick-bench'
+  [& exprs]
+  `(quick-bench (do ~@exprs)))
+
+(defmacro run-bench
+  [& exprs]
+  `(with-progress-reporting (bench (do ~@exprs) :verbose)))
+
+(defmacro run-bench'
+  [& exprs]
+  `(bench (do ~@exprs)))
+


Stopped validating blank paragraphs

Stopped validating blank paragraphs

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


Allow organization in LinkInfo

Allow organization in LinkInfo

fatal: unable to access 'https://github.com/physion/ovation-webapi.git/': The requested URL returned error: 403


Fix typo

Fix typo

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


qa connect.cljs

qa connect.cljs

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


Solve Consumption in clojure

Solve Consumption in clojure

error: pathspec 'solutions/uri/1014/1014.clj' did not match any file(s) known to git

--- solutions/uri/1014/1014.clj
+++ solutions/uri/1014/1014.clj
@@ -0,0 +1,12 @@
+(ns main)
+
+(defn main []
+  (loop [x (read-line)
+         y (read-line)]
+    (when x
+      (let [x' (Double/parseDouble x)
+            y' (Double/parseDouble y)]
+        (printf "%.3f km/l%n" (/ x' y')))
+      (recur (read-line) (read-line)))))
+
+(main)


chi square

chi square

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


Version 73

Version 73

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


bump version to 3.7.3 and core version to 3.8.0

fatal: unable to access 'https://github.com/B2W-BIT/restQL-server.git/': The requested URL returned error: 403


Version 113

Version 113


bump teller version

bump teller 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/starcity-properties/odin.git/'


Version 0.3.5

Version 0.3.5

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject lein-droid/lein-droid "0.3.5-SNAPSHOT"
+(defproject lein-droid/lein-droid "0.3.5"
   :description "Plugin for easy Clojure/Android development and deployment"
   :url "https://github.com/clojure-android/lein-droid"
   :license {:name "Eclipse Public License"


Version 1.11.0

Version 1.11.0


bump version to 2.8.15

bump version to 2.8.15

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


More tests

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


Created hello world blink example

Created hello world blink example

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

--- src/clj_bots/hello_world/sim.clj
+++ src/clj_bots/hello_world/sim.clj
@@ -0,0 +1,41 @@
+(ns clj-bots.hello-world.sim
+  "# test of the simulator implementation"
+  (:require [clj-bots.pin-ctrl :as pc]
+            [clj-bots.pin-ctrl-simulator.implementation :as sim]))
+
+;; Create a simulator board, vaguely modelling a small subset of a BBB's pins.
+(def board
+  (pc/create-board :simulator
+                   {:board-class :onboard ; not too important yet
+                    :pin-modes {[:P8 14] [:gpio :ain]
+                                [:P8 15] [:ain :aout]
+                                [:P8 16] [:gpio]}
+                    :analog-bits {[:P8 14] 8
+                                  [:P8 15] 8}}))
+
+;; Now let's say we want to initialize pin 14 on header :P8 as a GPIO pin, and use it to control an LED that we'll blink.
+(def pin-n [:P8 14])
+(def pin (pc/get-pin board pin-n))
+(pc/set-mode! pin :output)
+
+
+;; Now let's set up some blinking
+(def blink-thread
+  (future
+    (loop []
+      (pc/toggle! pin)
+      (Thread/sleep 1000)
+      (recur))))
+
+;; And while our write loop is running, let's monitor the state of the pin
+(let [interval 200
+      duration 10000
+      steps    (/ duration interval)]
+  (doseq [i (range steps)]
+    (Thread/sleep 200)
+    (println "Value at" (* i interval) (pc/read-value pin))))
+
+;; Now that we're done, let's close up shop.
+(future-cancel blink-thread)
+(pc/set-mode! pin :off)
+


Problem 0124.

Problem 0124.

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

--- src/project_euler/problem_0124.clj
+++ src/project_euler/problem_0124.clj
@@ -0,0 +1,66 @@
+(ns project-euler.problem_0124
+  (:require [clojure.set :as set]))
+
+;; The radical of n, rad(n), is the product of the distinct prime factors of n.
+;; For example, 504 = 23 × 32 × 7, so rad(504) = 2 × 3 × 7 = 42.
+
+;; If we calculate rad(n) for 1 ≤ n ≤ 10, then sort them on rad(n),
+;; and sorting on n if the radical values are equal, we get:
+
+;; Unsorted     Sorted
+;; n  rad(n)    n  rad(n)  k
+;; 1  1         1  1       1
+;; 2  2         2  2       2
+;; 3  3         4  2       3
+;; 4  2         8  2       4
+;; 5  5         3  3       5
+;; 6  6         9  3       6
+;; 7  7         5  5       7
+;; 8  2         6  6       8
+;; 9  3         7  7       9
+;; 10 10        10 10      10
+
+;; Let E(k) be the kth element in the sorted n column; for example, E(4) = 8 and E(6) = 9.
+
+;; If rad(n) is sorted for 1 ≤ n ≤ 100000, find E(10000).
+
+
+(defn distinct-prime-factors-until [m]
+  (loop [n 2
+         primes []
+         prime-factors {}
+         ]
+    (if (> n m)
+      prime-factors
+      (let [[q p] (->> primes
+                       (map (fn [p] [(/ n p) p]))
+                       (take-while (fn [[q p]] (<= p q)))
+                       (filter (fn [[q p]] (integer? q)))
+                       (first)
+                       )]
+        (if p
+          (recur (inc n)
+                 primes
+                 (assoc prime-factors
+                        n
+                        (set/union (get prime-factors q) #{p})
+                        ))
+          (recur (inc n)
+                 (conj primes n)
+                 (assoc prime-factors
+                        n
+                        #{n}))
+          )))))
+
+(defn solution-for [m k]
+  (->> (assoc (distinct-prime-factors-until m) 1 #{1})
+       (map (fn [[n ps]] [(reduce * ps) n]))
+       (sort)
+       ((fn [rns] (second (nth rns (dec k)))))
+
+       ))
+
+(defn solution []
+  (solution-for 100000 10000))
+
+;;-> 21417


Problem 0125.

Problem 0125.

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

--- src/project_euler/problem_0125.clj
+++ src/project_euler/problem_0125.clj
@@ -0,0 +1,48 @@
+(ns project-euler.problem_0125)
+
+;; The palindromic number 595 is interesting because it can be written
+;; as the sum of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2.
+
+;; There are exactly eleven palindromes below one-thousand that can be written
+;; as consecutive square sums, and the sum of these palindromes is 4164.
+;; Note that 1 = 0^2 + 1^2 has not been included as this problem is
+;; concerned with the squares of positive integers.
+
+;; Find the sum of all the numbers less than 10^8 that are both palindromic
+;; and can be written as the sum of consecutive squares.
+
+(defn digits [x]
+  (loop [x x ds []]
+    (if (zero? x)
+      ds
+      (recur (quot x 10) (conj ds (rem x 10))))))
+
+(defn palindromic? [x]
+  (let [ds (digits x)]
+    (= ds (rseq ds))))
+
+(defn palindromic-cons-squares-from [a m]
+  (loop [a  a
+         s  (* a a)
+         ps []]
+    (let [a' (inc a)
+          s' (+ s (* a' a'))]
+      (if (< s' m)
+        (recur a'
+               s'
+               (if (palindromic? s') (conj ps s') ps))
+        ps)
+      )))
+
+(defn palindromic-cons-squares [m]
+  (->> (range 1 (Math/sqrt m))
+       (mapcat (fn [a] (palindromic-cons-squares-from a m)))
+       (set)
+       ))
+
+(defn solution []
+  (->> (palindromic-cons-squares 100000000)
+       (reduce +)
+       ))
+
+;;-> 2906969179


Revert "Fix commit order on tree simplification"

This reverts commit 26ee3d3b97a77631f9c74457fc551de643911c94.

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


lib.zerol/core-test: Add goal tests

lib.zerol/core-test: Add goal 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/artemyarulin/zerol.git/'


more fucking whitespace chars

more fucking whitespace chars

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


new test file

new test file

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

--- test/cljs/greffe/analyze_test.cljs
+++ test/cljs/greffe/analyze_test.cljs
@@ -0,0 +1,6 @@
+(ns greffe.analyse-test
+  (:require
+   [cljs.test :refer-macros [deftest testing is]]
+   [greffe.analyze :as az]))
+
+


add some unit tests on POST /api/session to check for input validation and password checking.

--- test/metabase/api/session_test.clj
+++ test/metabase/api/session_test.clj
@@ -15,6 +15,19 @@
   (do (del Session :user_id (user->id :rasta))                  ; delete all other sessions for the bird first
       (client :post 200 "session" (user->credentials :rasta))))

+;; Test for required params
+(expect "'email' is a required param."
+  (client :post 400 "session" {}))
+
+(expect "'password' is a required param."
+  (client :post 400 "session" {:email "anything"}))
+
+;; Test for password checking
+(expect "password mismatch"
+  (client :post 400 "session" (-> (user->credentials :rasta)
+                                (assoc :password "something else"))))
+
+
 ;; ## DELETE /api/session
 ;; Test that we can logout
 (expect-eval-actual-first nil


ENH: basic functions in clojure

ENH: basic functions in clojure

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

--- src/clj_prj03/functions.clj
+++ src/clj_prj03/functions.clj
@@ -0,0 +1,206 @@
+; 3.1 Calling Functions
+(+ 1 2 3 4)
+(* 1 2 3 4)
+(first [1 2 3 4])
+
+;; 'or' returns first truthy value
+((or + -) 1 2 3 4) ;; adds values
+
+
+;; 'and' returns first falsey value or last truthy value
+((and (= 1 1) +) 1 2 3)
+
+;; numbers and strings can't be functions
+(1 2 3 4)
+("test" 1 2 3)
+
+;; the inc function increments a number by 1
+(inc 1.1)
+
+(map inc [0 1 2 3])
+
+(def failed-movie-titles ["Gone with the Moving Air" "Swellfellas"])
+
+(def severity :mild)
+(def error-message "dun dun dun...")
+(if (= severity :mild)
+  (def error-message (str error-message "MILDLY INCONVENIENCED"))
+  (def error-message (str error-message "DOOMED")))
+error-message
+(println error-message)
+
+; 3.3 Functions
+
+;; defined with defn, a name, an optional docstring, parameters, the body
+(defn too-enthusiastic
+  "Return a cheer that might be a bit too enthusiastic"
+  [name]
+  (str "OMG! " name " YOU ARE MOST DEFINITELY LIKE THE BEST"
+     "MAN SLASH WOMAN EVER I LOVE YOU AND WE SHOULD RUN AWAY"
+     "TO SOMEWHERE"))
+
+(too-enthusiastic "Zelda")
+
+;; the docstring can be viewed with the doc function
+(doc map)
+
+;; parameters
+(defn no-params
+  []
+  "I take no parameters")
+
+(defn one-param
+  [x]
+  (str "I take one param: " x " It'd better be a string!"))
+
+(defn two-params
+  [x y]
+  (str "Two parameters! That's nothing! They will be crushed!" x y))
+
+(defn three-params
+  [x y z]
+  (str (one-param x) (two-params y z)))
+
+;; function overloading
+(defn multi-arity
+  ;; 3-arity arguments and body
+  ([first-arg second-arg third-arg]
+   (three-params first-arg second-arg third-arg))
+  ([x y]
+   (two-params x y))
+  ([x] (one-param x))
+  )
+
+(multi-arity "hi" "bob")
+(multi-arity "hi" "you" "stupid")
+
+(defn x-chop
+  "describe the kind of chop you're inflicting on someone"
+  ([name chop-type] (str "I " chop-type " chop " name "! Take that!"))
+  ([name] (x-chop name "karate")))
+
+(x-chop "Kanye West" "slap")
+(x-chop "Kanye East")
+
+;; in theory, you could do anything with overloading
+(defn weird-arity
+  ([]
+    "Destiny dressed you this morning my friend, and now Fear is
+     trying to pull off your pants. If you give up, if you give in,
+     you're gonna end up naked with Fear standing there laughing
+     at your dangling unmentionables! - the Tick")
+   ([number] (inc number)))
+
+;; rest-param (catch-all for other parameters)
+(defn codger-communication
+  [whippersnapper]
+  (str "Get off my own lawn, " whippersnapper "!!!"))
+
+(defn codger
+  [& whippersnappers] ;; ampersand indicates "rest-param"
+  (map codger-communication whippersnappers))
+
+(codger "Billy" "Anne-Marie" "The Incredible Bulk")
+
+;; Destructuring: kind of like pattern matching
+(defn my-first
+  [[first-thing]]
+  first-thing)
+
+(my-first ["oven" "bike" "waraxe"]) ;; => oven
+
+;; without destructuring...
+(defn my-other-first
+  [collection]
+  (first collection))
+
+(my-other-first ["nickel" "hair"])
+
+;; destructuring example:
+
+(defn chooser
+  [[first-choice second-choice & unimportant-choices]]
+  (println (str "Your first choice is: " first-choice))
+  (println (str "Your second choice is: " second-choice))
+  (println (str "We're ignoring the rest of your choices. "
+                "Here they are in case you need to cry over them: "
+                (clojure.string/join ", " unimportant-choices))))
+
+(chooser ["Marmalade", "Handsome Jack", "Pigpen", "Aquamen"])
+
+;; destructuring maps
+(defn announce-treasure-location
+  [{lat :lat lng :lng}]
+  (println (str "Treasure lat: " lat))
+  (println (str "Treasure lng: " lng)))
+(announce-treasure-location {:lat 28.22 :lng 81.33})
+
+(defn steer-ship! [loc] (println (str "Steering towards" loc)))
+
+(defn receive-treasure-location
+  [{:keys [lat lng] :as treasure-location}]
+  (println (str "Treasure lat: " lat))
+  (println (str "Treasure lng: " lng))
+  (steer-ship! treasure-location))
+
+;; function body: returns last form being evaluated
+(defn illustrative-function
+  []
+  (+ 1 304)
+  30
+  "joe")
+
+(illustrative-function)
+
+(defn number-comment
+  [x]
+  (if (> x 6)
+    "Oh my gosh! what a big number!"
+    "That number's OK, I guess"))
+
+(number-comment 5)
+(number-comment 7)
+
+; 3.4 Anonymous Functions
+
+
+;; Form is: (fn [param-list] function body)
+(map (fn [name] (str "Hi, " name))
+  ["Darth Vader" "Mr. Magoo"])
+
+;; Another example
+((fn [x] (* x 3)) 8)
+
+;; or define a function using a lambda
+(def my-special-multiplier (fn [x] (* x 3)))
+(my-special-multiplier 12)
+
+;; you can also use # to use an anonymous function
+;; % is the argument
+#(* % 3)
+
+;; applying it
+(#(* % 3) 8)
+
+(map #(str "Hi, " %)
+  ["Darth Vader" "Mr. Magoo"])
+
+#(* % 3)
+
+;; arguments can be distinguished with numbers: %1, %2
+(#(str %1 " and " %2) "corn bread" "butter beans")
+
+;; or a rest param as %&
+(#(identity %&) 1 "blarg" :yip)
+
+; 3.5 Returning Functions
+; functions can return other functions
+
+(defn inc-maker
+  "Create a custom incrementor"
+  [inc-by]
+  #(+ % inc-by))
+
+(def inc3 (inc-maker 3))
+(inc3 7)
+


Fix framing bug in netchan

Fix framing bug in netchan

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


Made a test for how it’s possible to test for nil

error: pathspec 'test/structural_typing/use/condensed_type_descriptions/f_nil_checks.clj' did not match any file(s) known to git

--- test/structural_typing/use/condensed_type_descriptions/f_nil_checks.clj
+++ test/structural_typing/use/condensed_type_descriptions/f_nil_checks.clj
@@ -0,0 +1,17 @@
+(ns structural-typing.use.condensed-type-descriptions.f-nil-checks
+  (:use midje.sweet
+        structural-typing.type
+        structural-typing.global-type
+        structural-typing.clojure.core
+        structural-typing.assist.testutil))
+
+(start-over!)
+
+(fact "It is possible to check for nil values (even though those are normally optional)"
+  (type! :X {:x nil?})
+  (built-like :X {:x nil}) => {:x nil}
+  (built-like :X {}) => {}
+  (check-for-explanations :X {:x 1}) => (just (err:shouldbe :x "nil?" 1)))
+
+
+(start-over!)


update fee orders when related items are cancelled

jankily.

Co-authored-by: Allen J Price <a4aed34f4966dc8688b8e67046bf8b276626e284@starcity.com>
Co-authored-by: Queenie Ho <2def309e7464a5b48e3a97e9c34536ebccaa8903@starcity.com>


added recursion

added recursion

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

--- src/recursion.clj
+++ src/recursion.clj
@@ -0,0 +1,38 @@
+(ns recursion
+  (:require [clojure.string :as str]))
+
+;; Loop binds initial values once, then binds values from each recursion call
+
+(def factorial
+  (fn [n]
+    (loop [cnt n acc 1]
+       (if (zero? cnt)
+            acc
+          (recur (dec cnt) (* acc cnt))))))
+
+(defn find-needle [needle haystack]
+  (loop [needle needle
+         maybe-here haystack
+         not-here '()]
+    (let [needle? (first maybe-here)]
+      (if (or (= (str needle?) (str needle))
+              (empty? maybe-here))
+        [needle? maybe-here not-here]
+        (recur needle
+               (rest maybe-here)
+               (concat not-here (list (first maybe-here))))))))
+
+;; (find-needle "*" "hay|stack")
+
+(defn mustache-template [tpl env]
+  (loop [tpl tpl
+         env env]
+    (cond (empty? env) tpl
+          :else        (let [[key value] (first env)]
+                         (recur
+                          (try
+                            (str/replace tpl
+                                         (re-pattern (str "\\{\\{" (name key) "\\}\\}"))
+                                         value)
+                            (catch Exception e tpl))
+                          (rest env))))))


Log a uuid summary for each line 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/cstorey/nrod.git/'


Explicitly require clojure.set to make buildkite happy

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


add cascalog example

add cascalog example

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

--- playground-example.clj
+++ playground-example.clj
@@ -0,0 +1,6 @@
+hadoop-cascading-cascalog
+=========================
+
+* http://wiki.apache.org/hadoop/WordCount
+* https://github.com/Cascading/Impatient/blob/master/part2/src/main/java/impatient/Main.java
+* https://github.com/Quantisan/Impatient/blob/cascalog/part2/src/impatient/core.clj


Solved fp-list-replication in clojure

Solved fp-list-replication in clojure

error: pathspec 'hackerrank/Functional' did not match any file(s) known to git
error: pathspec 'Programming/Introduction/fp-list-replication/clojure/solution.clj' did not match any file(s) known to git


Added java interop stuff.

Added java interop stuff.

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


Basic dataflow execution

Basic dataflow execution

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

--- src/aurora/language.cljs
+++ src/aurora/language.cljs
@@ -0,0 +1,64 @@
+(ns aurora.language
+  (:require [clojure.set :refer [union intersection difference subset?]]
+            [aurora.language.jsth :as jsth]
+            [aurora.language.match :as match])
+  (:require-macros [aurora.macros :refer [console-time set!! conj!! disj!! assoc!! apush apush*]]
+                   [aurora.language.macros :refer [rule]]))
+
+;; FLOW STATE
+
+(defrecord FlowState [node->state in-edge->out-edges edge->values edge->update!])
+
+(defn fixpoint [{:keys [node->state in-edge->out-edges edge->values edge->update!] :as flow-state}]
+  (loop [edge 0]
+    (when (< edge (alength edge->values))
+      (let [in-values (aget edge->values edge)]
+        (if (== 0 (alength in-values))
+          (recur (+ edge 1))
+          (let [out-values #js []]
+            (.call (aget edge->update! edge) nil node->state in-values out-values)
+            (aset edge->values edge #js [])
+            (when (> (alength out-values) 0)
+              (let [out-edges (aget in-edge->out-edges edge)
+                    min-out-edge (areduce out-edges i min-out-edge (+ edge 1)
+                                          (let [out-edge (aget out-edges i)]
+                                            (apush* (aget edge->values out-edge) out-values)
+                                            (min out-edge min-out-edge)))]
+                (recur min-out-edge))))))))
+  flow-state)
+
+(defn filter-flow [fun]
+  (fn [node->state in-values out-values]
+    (dotimes [i (alength in-values)]
+      (let [value (aget in-values i)]
+        (when (.call fun nil value)
+          (apush out-values value))))))
+
+(defn set-flow [node]
+  (fn [node->state in-values out-values]
+    (let [set (aget node->state node)]
+      (dotimes [i (alength in-values)]
+        (let [value (aget in-values i)]
+          (when (not (contains? set value))
+            (conj!! set value)
+            (apush out-values value))))
+      (aset node->state node set))))
+
+(comment
+  (->
+   (->FlowState #js [(transient #{})]
+                #js [#js [1] #js [0]]
+                #js [#js [:a :b "c" :d] #js []]
+                #js [(filter-flow keyword?) (keep-flow 0)])
+   fixpoint)
+
+  (->
+   (->FlowState #js [(transient #{})]
+                #js [#js [1] #js [0]]
+                #js [#js [:a :b "c" :d] #js []]
+                #js [(filter-flow keyword?) (keep-flow 0)])
+   fixpoint
+   :node->state
+   (aget 0)
+   persistent!)
+  )


Switchout out deprecated DERInteger class

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


Add macros namespace

Add macros namespace

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

--- src/clj/gtfve/macros.clj
+++ src/clj/gtfve/macros.clj
@@ -0,0 +1,7 @@
+(ns gtfve.macros)
+
+(defmacro <? [ch]
+  `(let [e (async/<! ~ch)]
+     (if (instance? js/Error e)
+       (throw e)
+       e)))


refactor syncat.ui/make-menu-item

refactor syncat.ui/make-menu-item

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


protocol

protocol

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


More refactoring

More refactoring

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


Add transitive operations

Add transitive operations

error: pathspec 'src/deepfns/transitive.cljc' did not match any file(s) known to git

--- src/deepfns/transitive.cljc
+++ src/deepfns/transitive.cljc
@@ -0,0 +1,105 @@
+(ns deepfns.transitive
+  "Functions that combine with transitives for more powerful data
+  transformations"
+  (:require [deepfns.core :as d]))
+
+(defn =>
+  "Like the threading macro, some->, this threads data through successive
+  functions as long as the result is not nil."
+  [& fs]
+  (fn [m]
+    (loop [fs fs acc m]
+      (if (empty? fs)
+        acc
+        (if-some [v ((first fs) acc)]
+          (recur (rest fs) v))))))
+
+(def p>
+  "An alias for clojure.core/partial"
+  partial)
+
+;; I know eq is usually for checking memory equality... I just like
+;; having => for threading and this seemed like a good second choice
+(defn eq>
+  "A transative form of = where both arguments are transitive
+  expressions"
+  [x-expr y-expr]
+  (let [x-t (d/<=> x-expr)
+        y-t (d/<=> y-expr)]
+    (fn [m]
+      (= (x-t m) (y-t m)))))
+
+(defn if>
+  "Like if but for transitives. Takes a predicate and returns the then
+  or else clause."
+  ([pred then]
+   (fn [m]
+     (let [pred-t (d/<=> pred)
+           then-t (d/<=> then)]
+       (if (pred-t m)
+         (then-t m)))))
+  ([pred then else]
+   (fn [m]
+     (let [pred-t (d/<=> pred)
+           then-t (d/<=> then)
+           else-t (d/<=> else)]
+       (if (pred-t m)
+         (then-t m)
+         (else-t m))))))
+
+(defn when>
+  "A transitive form of when. Takes a predicate and returns the
+  transitive clause when successful."
+  [pred then]
+  (fn [m]
+    (let [pred-t (d/<=> pred)
+          then-t (d/<=> then)]
+      (when (pred-t m)
+        (then-t m)))))
+
+(defn- to-transitive [exprs]
+  (map d/<=> exprs))
+
+(defn- to-val [exprs m]
+  (map #(% m) exprs))
+
+(defn map> [f & exprs]
+  (let [ts (to-transitive exprs)]
+    (fn [m]
+      (->> (to-val ts m)
+           (apply (partial map f))))))
+
+(defn- trans-vals [exprs m]
+  (->> (to-val exprs m)
+       (flatten)
+       (remove nil?)))
+
+(defn reduce1>
+  "A transitive form of reduce where exprs are collections of transitive
+  expressions. Here's an example:
+
+  ((reduce> + [:foo :foo :bar] [:foo]) {:foo 1})
+
+  => 3"
+  ([f & exprs]
+   (let [ts (to-transitive exprs)]
+     (fn [m]
+       (->> (trans-vals ts m)
+            (reduce f))))))
+
+(defn reduce2>
+  "A transitive form of reduce that uses an initial seed value."
+  ([f seed & exprs]
+   (let [ts (to-transitive exprs)]
+     (fn [m]
+       (->> (trans-vals ts m)
+            (reduce f seed))))))
+
+(defn filter>
+  "A transitive form of filter where exprs are collections of transitive
+  expressions."
+  [pred & exprs]
+  (let [ts (to-transitive exprs)]
+    (fn [m]
+      (->> (trans-vals ts m)
+           (filter pred)))))


Begin on initial smlx parser.

Begin on initial smlx parser.

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

--- src/smallex/parser/smlx.clj
+++ src/smallex/parser/smlx.clj
@@ -0,0 +1,103 @@
+(ns smallex.parser.smlx
+  (:require [smallex.records :as r])
+  (:import (smallex.records Grammar Expression)))
+
+(declare parse-root parse-definition parse-expr parse-operation parse-args
+         end-paren should-exist)
+
+(defn parse
+  "Parses the items from a smlx seq (maps having :type and :value) to a proper
+  Grammar. Does not perform alias expansion, nor checks that the semantic rules
+  are correct."
+  [item-seq]
+  (loop [item-seq item-seq
+         grammar (r/map->Grammar {:rules {}, :aliases {}})]
+    (if (empty? item-seq)
+      grammar
+      (let [[item-seq* updated-grammar] (parse-root item-seq grammar)]
+        (recur item-seq* updated-grammar)))))
+
+(defn- parse-root
+  "Returns a vector [item-seq grammar], where item-seq is the remaining
+  arguments and the grammar is the updated grammar after parsing the next
+  toplevel expression."
+  [[paren def-or-alias & r] grammar]
+  (should-exist paren)
+  (cond (not= (:type paren) :paren-start)
+        (throw (ex-info "Expected a start paren at root." paren))
+        (distinct? (:type def-or-alias) :def :alias)
+        (throw (ex-info "Expected either \"def\" or \"alias\"." def-or-alias))
+        :else
+        (parse-definition def-or-alias r grammar)))
+
+(defn- grammar-key
+  "Returns the key in which to assoc a definition into the grammar, given the
+  definition item."
+  [item]
+  ({:def :rules, :alias :aliases} (:type item)))
+
+(defn- parse-definition
+  "Parses a definition ('alias' or 'def'), and inserts it into the grammar.
+  Returns the vector [item-seq grammar], where the item-seq is the remaining
+  items, and grammar is the updated grammar."
+  [definition-type [name-item & item-seq] grammar]
+  (should-exist name-item)
+  (if (some #(contains? % (:value name-item)) (vals grammar))
+    (throw (ex-info "Definition already exists." name-item))
+    (let [[rem-seq expr] (end-paren parse-expr item-seq)
+          updated-grammar (assoc grammar (grammar-key definition-type)
+                                 (:value name-item) expr)]
+      [rem-seq updated-grammar])))
+
+(defn- parse-expr
+  "Parses a single expression, which could be a paren-expression, a string
+  type or a possible alias (symbol)."
+  [[head-item & item-seq]]
+  (should-exist head-item)
+  (cond (contains? #{:cat-string :or-string :symbol} (:type head-item))
+        [item-seq head-item]
+        (= (:type head-item) :paren-start)
+        (end-paren parse-operation head-item item-seq)))
+
+(defn- parse-operation
+  "Parses an operation, which is some known operator along with several
+  arguments delimited by a closing paren."
+  [op item-seq]
+  (should-exist op)
+  (if-not (= (:type op) :op)
+    (throw (ex-info "Expected an operation." op))
+    (let [[rem-seq args] (parse-args item-seq [])]
+      ;; Should we retain op item here? Sounds reasonable to at least have the
+      ;; position it was defined for better error msg later.
+      [rem-seq (r/map->Expression {:op (:value op), :args args})])))
+
+(defn- parse-args
+  "Parses legal expressions until a closing paren is found, then returning
+  [rem-seq args]."
+  [[head :as item-seq] args]
+  (should-exist head)
+  (if (= (:type head) :paren-end)
+    [(rest item-seq) args]
+    (let [[rem-seq expr] (parse-expr item-seq)]
+      (recur rem-seq (conj args expr)))))
+
+(defn- end-paren
+  "Call a function f, which returns [item-seq x]. If the first element in
+  item-seq is not a closing paren, will throw an appropriate error. Otherwise
+  returns [(rest item-seq] x]."
+  [f & args]
+  (let [[[paren & rem-seq] x] (apply f args)]
+    (should-exist paren)
+    (if (= (:type paren) :paren-end)
+      [rem-seq x]
+      (throw (ex-info "Expected a closing paren." paren)))))
+
+(defn- should-exist
+  "Checks whether the item actually exists, and if not, throws an appropriate
+  error. As the error item is never expected, it will throw an error if the item
+  is an error item."
+  [item]
+  (cond (nil? item)
+        (throw (ex-info "Unexpected end of grammar." {}))
+        (= (:type item) :error)
+        (throw (ex-info "Lexer returned an error item." item))))


Implement audio node

Implement audio node

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

--- src/squelch/audio-node.cljs
+++ src/squelch/audio-node.cljs
@@ -0,0 +1,81 @@
+(ns squelch.audio-context)
+
+; -----------
+; Properties:
+; -----------
+
+(defn get-context
+  "Read only.
+  Returns the associated AudioContext, that is the object representing the \
+  processing graph the node is participating in."
+  [node]
+  (.-context node))
+
+(defn get-number-of-inputs
+  "Read only.
+  Returns the number of inputs feeding the node. Source nodes are defined as
+  nodes having a numberOfInputs property with a value of 0."
+  [node]
+  (.-numberOfInputs node))
+
+(defn get-number-of-outputs
+  "Read only.
+  Returns the number of outputs coming out of the node. Destination nodes — like
+  AudioDestinationNode — have a value of 0 for this attribute."
+  [node]
+  (.-numberOfOutputs node))
+
+(defn get-channel-count
+  "Represents an integer used to determine how many channels are used when
+  up-mixing and down-mixing connections to any inputs to the node. Its usage and
+  precise definition depend on the value of AudioNode.channelCountMode."
+  [node]
+  (.-channelCountMode node))
+
+(defn set-channel-count
+  "Represents an integer used to determine how many channels are used when
+  up-mixing and down-mixing connections to any inputs to the node. Its usage and
+  precise definition depend on the value of AudioNode.channelCountMode."
+  [node channel-count]
+  (set! (.-channelCountMode node) channel-count))
+
+(defn get-channel-count-mode
+  "Represents an enumerated value describing the way channels must be matched
+  between the node's inputs and outputs."
+  [node]
+  (.-channelCountMode node))
+
+(defn set-channel-count-mode
+  "Represents an enumerated value describing the way channels must be matched
+  between the node's inputs and outputs."
+  [node mode]
+  (set! (.-channelCountMode node) mode))
+
+(defn get-channel-interpretation
+  "Represents an enumerated value describing the meaning of the channels. This
+  interpretation will define how audio up-mixing and down-mixing will happen.
+  The possible values are \"speakers\" or \"discrete\"."
+  [node]
+  (.-channelInterpretation node))
+
+(defn set-channel-interpretation
+  "Represents an enumerated value describing the meaning of the channels. This
+  interpretation will define how audio up-mixing and down-mixing will happen.
+  The possible values are \"speakers\" or \"discrete\"."
+  [node interpretation]
+  (set! (.-channelInterpretation node) interpretation))
+
+; --------
+; Methods:
+; --------
+
+(defn connect
+  "Allows us to connect one output of this node to one input of another node."
+  [src dest]
+  (.connect src dest))
+
+(defn disconnect
+  "Allows us to disconnect the current node from another one it is already
+  connected to."
+  [node]
+  (.disconnect node))


test fix

test fix

--- test/metabase/driver/generic_sql/query_processor_test.clj
+++ test/metabase/driver/generic_sql/query_processor_test.clj
@@ -16,7 +16,7 @@
               ;; column should look like "null.NAME" because the Field will have no associated Table name from expansion and will get
               ;; pased to korma as :null.NAME
               "Column \"null.NAME\" not found; SQL statement:\nSELECT \"CHECKINS\".\"ID\", CAST(\"DATE\" AS DATE), "
-              "\"CHECKINS\".\"VENUE_ID\", \"CHECKINS\".\"USER_ID\" FROM \"CHECKINS\" WHERE (\"CHECKINS\".\"NAME\" = ?) LIMIT "
+              "\"CHECKINS\".\"VENUE_ID\", \"CHECKINS\".\"USER_ID\" FROM \"CHECKINS\" WHERE (\"null\".\"NAME\" = ?) LIMIT "
               max-result-bare-rows)}
   ;; This will print a stacktrace. Better to reassure people that that's on purpose than to make people question whether the tests are working
   (do (log/info (color/green "NOTE: The following stacktrace is expected <3"))


test fix

test fix

--- test/metabase/driver/generic_sql/query_processor_test.clj
+++ test/metabase/driver/generic_sql/query_processor_test.clj
@@ -254,7 +254,7 @@
                                   :breakout [nil]
                                   :limit nil}}))

-;; FILTER -- "AND", "<", "!="
+;; FILTER -- "AND", "<", ">", "!="
 (expect
     {:status :completed
      :row_count 2
@@ -267,6 +267,7 @@
                     :query {:source_table (table->id :venues)
                             :filter ["AND"
                                      ["<" (field->id :venues :id) 24]
+                                     [">" (field->id :venues :id) 20]
                                      ["!=" (field->id :venues :id) 22]]
                             :aggregation ["rows"]
                             :breakout [nil]


base witter

base witter

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/just-cloud/uxtweet-client.git/'


Comment out basic auth - no need for fn here

--- src/yada/walk.clj
+++ src/yada/walk.clj
@@ -23,8 +23,11 @@
                  (fn [{:keys [handler args]}]
                    (merge handler m))))

-(defn basic-auth [realm auth-fn routes]
+#_(defn basic-auth [routes realm authn-fn authorization ]
   (merge-options
-   {:security {:type :basic :realm realm}
-    :authorization auth-fn}
+   {:access-control
+    {realm {:authentication-schemes
+            [{:scheme "Basic"
+              :verify authn-fn}]
+            :authorization {:methods {:get "secret/view"}}}}}
    routes))


Added select command

Added select command

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/skprasadu/crud-ui-framework.git/'


Clojure sample for expressions in CPS

Clojure sample for expressions in CPS

error: pathspec '2017/continuations-trampolines/clojure-samples/src/clojure_samples/expression.clj' did not match any file(s) known to git

--- 2017/continuations-trampolines/clojure-samples/src/clojure_samples/expression.clj
+++ 2017/continuations-trampolines/clojure-samples/src/clojure_samples/expression.clj
@@ -0,0 +1,45 @@
+;;; A mathematical expression with CPS.
+;;;
+;;; Eli Bendersky [http://eli.thegreenplace.net]
+;;; This code is in the public domain.
+(ns clojure-samples.expression)
+
+(defn expr
+  []
+  (* 2 (+ 3 4)))
+
+(expr)
+
+(defn end-cont [value] (println value))
+
+(defn apply-cont
+  [cont value]
+  (cont value))
+
+(defn expr-cps
+  [cont]
+  (apply-cont cont (+ 3 4)))
+
+(defn make-double-cont
+  [saved-cont]
+  (fn [value]
+    (apply-cont saved-cont (* 2 value))))
+
+;;; Composed
+(expr-cps (make-double-cont end-cont))
+
+;;; Inline, without using make-double-cont
+(expr-cps (fn [value] (apply-cont end-cont (* 2 value))))
+
+(defn make-plus100-cont
+  [saved-cont]
+  (fn [value]
+    (apply-cont saved-cont (+ value 100))))
+
+;;; Composed
+(expr-cps (make-double-cont (make-plus100-cont end-cont)))
+
+;;; Inline, without using make-double-cont and make-plus100-cont
+(expr-cps (fn [value] (apply-cont
+                        (fn [value] (apply-cont end-cont (+ value 100)))
+                        (* 2 value))))


#1 initial implementation

#1 initial implementation

error: pathspec 'lambdalf-lib/src/main/clojure/alfresco/transact.clj' did not match any file(s) known to git

--- lambdalf-lib/src/main/clojure/alfresco/transact.clj
+++ lambdalf-lib/src/main/clojure/alfresco/transact.clj
@@ -0,0 +1,31 @@
+(ns alfresco.transact
+  (:require [alfresco.core :as c])
+  (:import [org.alfresco.repo.transaction RetryingTransactionHelper$RetryingTransactionCallback]
+           [javax.transaction Status]))
+
+(defn transaction-service
+  []
+  (.getTransactionService (c/alfresco-services)))
+
+(defmacro in-tx [& body]
+  `(let [cb# (reify RetryingTransactionHelper$RetryingTransactionCallback
+               (~'execute [~'this] ~@body))]
+     (-> (transaction-service)
+         (.getRetryingTransactionHelper)
+         (.doInTransaction cb#))))
+
+(defmacro with-tx
+  [bindings & body]
+  `(let ~(subvec bindings 0 2)
+     (try
+       (.begin ~(bindings 0))
+       ~@body
+       (catch Throwable ~'e
+         (if (= Status/STATUS_ACTIVE (.getStatus ~(bindings 0)))
+           (.rollback ~(bindings 0)))
+         (throw ~'e)))))
+
+(defn create-tx
+  ([] (.getUserTransaction (transaction-service)))
+  ([ro] (.getUserTransaction (transaction-service) ro))
+  ([readOnly ignoreSystemRO] (.getUserTransaction (transaction-service) readOnly ignoreSystemRO)))


New layout

New layout

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


button hacking

button hacking

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


(= reducers awesome)

(= reducers awesome)

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


change graph/create-edge signature; passing a key is optional

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


Use timeouts from config in bifrost interceptors

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