Fix date handling bug introduced in 810f6ca81e19b49d61c5d5c98c24c7d5e669181d

--- src/ruuvi_server/database/event_dao.clj
+++ src/ruuvi_server/database/event_dao.clj
@@ -9,20 +9,15 @@
                                                        event-extension-value event-location
                                                        event-annotation)]
         [clj-time.core :only (date-time now)]
-        [clj-time.coerce :only (to-sql-date)]
+        [clj-time.coerce :only (to-timestamp)]
         [clojure.tools.logging :only (debug info warn error)]
         )
   (:import [org.joda.time DateTime])
   )

 ;; private functions
-(defn- to-sql-timestamp [^DateTime date]
-  (if date
-    (to-sql-date date)
-    nil))
-
 (defn- current-sql-timestamp []
-  (to-sql-timestamp (now)))
+  (to-timestamp (now)))

 ;; public functions
 (defn get-trackers [ids]
@@ -133,10 +128,10 @@
 "
   [criteria]

-  (let [event-start (to-sql-timestamp (:eventTimeStart criteria))
-        event-end (to-sql-timestamp (:eventTimeEnd criteria))
-        store-start (to-sql-timestamp (:storeTimeStart criteria))
-        store-end (to-sql-timestamp (:storeTimeEnd criteria))
+  (let [event-start (to-timestamp (:eventTimeStart criteria))
+        event-end (to-timestamp (:eventTimeEnd criteria))
+        store-start (to-timestamp (:storeTimeStart criteria))
+        store-end (to-timestamp (:storeTimeEnd criteria))
         tracker-ids (:trackerIds criteria)
         session-ids (:sessionIds criteria)
         max-result-count (:max-search-results (:client-api (conf/get-config)))
@@ -186,7 +181,7 @@

 (defn create-event [data]
   (transaction
-   (let [event-time (or (to-sql-timestamp (:event_time data))
+   (let [event-time (or (to-timestamp (:event_time data))
                         (current-sql-timestamp))
          tracker (get-tracker-by-code! (:tracker_code data))
          ;; TODO trim session_code to length of db field


fixed update

fixed update

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


Experimental work on DOM package.

Experimental work on DOM package.

error: pathspec 'src/clojure/freactive/experimental/dom.cljs' did not match any file(s) known to git

--- src/clojure/freactive/experimental/dom.cljs
+++ src/clojure/freactive/experimental/dom.cljs
@@ -0,0 +1,121 @@
+(ns freactive.experimental.dom)
+
+(defn request-animation-frame [f]
+  (.requestAnimationFrame js/window f))
+
+(defn- set-style-prop! [elem prop-name prop-value]
+  (let [prop-name (name prop-name)]
+    (aset (.-style prop) prop-name (str prop-value))))
+
+(defn- set-attr! [elem attr-name attr-value]
+  (let [attr-name (name attr-name)]
+    (.setAttribute elem attr-name attr-value)))
+
+(defn- on-value-ref-invalidated* [set-fn]
+  (fn on-value-ref-invalidated [ref [element attr-name :as key]]
+    (r/remove-invalidation-watch attr-value-ref key)
+    (request-animation-frame
+      (fn [_]
+        (when (.-parentNode element)
+          (r/add-invalidation-watch attr-value-ref key on-value-ref-invalidated)
+          (set-fn elem attr-name attr-value))))))
+
+(defn- bind-syle-prop! [element attr-name attr-value]
+  (if (satisfies? cljs.core/IDeref attr-value)
+    ((on-attr-value-ref-invalidated set-style-prop!) attr-value [element attr-name])
+    (set-style-prop! element attr-name attr-value)))
+
+(defn- listen! [element evt-name handler]
+  )
+
+(defn- bind-attr! [element attr-name attr-value]
+  (let [attr-name (name attr-name)]
+    (cond
+      (= "style" attr-name)
+      (do
+        (assert (map? attr-value))
+        (doseq [[p v] attr-value]
+          (bind-style-prop! element p v)))
+
+      (= [\o \n \-] (take 3 attr-name))
+      (listen! element attr-name (.substring attr-value 3))
+
+      :default
+      (if (satisfies? cljs.core/IDeref attr-value)
+        ((on-attr-value-ref-invalidated set-attr!) attr-value [element attr-name])
+        (set-attr! element attr-name attr-value)))))
+
+(defn- parse-elem-kw [kw]
+  [kw])
+
+(defn- create-elem [tag]
+  (.createElement js/document (name tag)))
+
+(declare build)
+
+(defn- convert-child [child]
+  (cond
+    (string? child)
+    (.createTextNode js/document child)
+
+    :default
+    child))
+
+(defn- append-child!* [parent child]
+  (let [child (convert-child child)]
+    (.appendChild parent child)
+    chuld))
+
+(defn- replace-child!* [parent new-child old-child]
+  (let [new-child (convert-child new-child)]
+    (.replaceChild parent new-child old-child)
+    new-child))
+
+(defn on-child-ref-invalidated* [parent]
+  (fn on-child-ref-invalidated
+    [attr-value-ref cur-elem]
+    (r/remove-invalidation-watch attr-value-ref wrapper)
+    (request-animation-frame
+      (fn [_]
+        (r/add-invalidation-watch attr-value-ref cur-elem on-child-ref-invalidated)
+        (let [new-elem @child
+              cur @cur-elem]
+          (reset! cur-elem
+            (if cur
+              (replace-child!* parent new-elem cur)
+              (append-child!* parent new-elem))))))))
+
+(defn- append-child! [parent child]
+  (if
+    (satisfies? cljs.core/IDeref child)
+    ((on-child-ref-invalidated* parent) child (atom nil))
+
+    (append-child!* parent child)))
+
+(defn- append-children! [elem children]
+  (doseq [ch children]
+    (if (sequential? ch)
+      (if (keyword? (first ch))
+        (append-child! elem (build ch))
+        (append-children! elem ch))
+      (append-child! elem ch))))
+
+(defn build [elem-def]
+  (let [[tag id class-name] (parse-elem-kw (first elem-def))
+        elem (create-elem tag)
+        attrs? (second elem-def)
+        attrs (when (map? attrs?) attrs?)
+        children (if attrs (nnext elem-def) (next elem-def))]
+    (when id (set-attr! tag "id" id))
+    (when id (set-attr! tag "class" class-name))
+    (doseq [[k v] attrs]
+      (bind-attr! elem k v))
+    (when children
+      (append-children! elem children))
+    elem))
+
+(defn mount! [dom-element child]
+  (append-child! dom-element child))
+
+(defn- get-body []
+  (aget (.getElementsByTagName js/document "body") 0))


Remove commented-out, redundant code

Remove commented-out, redundant code

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


remove old comp impls

remove old comp impls

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


revise ns refer-clojure

revise ns refer-clojure


remove unnecessary uses of `dissoc`

remove unnecessary uses of `dissoc`

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


+babel.reader.lab

+babel.reader.lab

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

--- src/babel/reader/lab.cljc
+++ src/babel/reader/lab.cljc
@@ -0,0 +1,57 @@
+(ns babel.reader.lab
+  (:require
+   [babel.directory :refer [models]] ;; this is needed even though there are no references to directory in here.
+   [babel.generate :as g :refer [frontier generate get-lexemes]]
+   [babel.reader :refer [generate-question-and-correct-set]]
+   [clojure.core.async :refer [>! alts!! timeout chan go]]
+   #?(:cljs [babel.logjs :as log])
+   #?(:clj [clojure.tools.logging :as log])
+   #?(:clj [clojure.repl :refer [doc]])
+   [dag_unify.core :as u :refer [pprint strip-refs unify]]))
+
+
+(defn basecamp []
+  (repeatedly
+   #(time
+     (println (generate-question-and-correct-set
+               {:root {:italiano {:italiano "chiamarsi"}
+                       :synsem {:subcat {:1 {:top :top}
+                                         :2 {:top :top} :3 {:top :top}}
+                                :cat :verb :sem {:tense :present :aspect :simple}}}
+                :synsem {:subcat []}
+                :comp {:phrasal false :synsem {:agr {:number :sing
+                                                     :person :1st}}}
+                "en"
+                "US"
+                "it"
+                "IT"})))))
+
+(def wtf (generate-question-and-correct-set
+          {:root {:italiano {:italiano "chiamarsi"}
+                  :synsem {:subcat {:1 {:top :top}
+                                    :2 {:top :top} :3 {:top :top}}
+                           :cat :verb :sem {:tense :present :aspect :simple}}}
+           :synsem {:subcat []}
+           :comp {:phrasal false :synsem {:agr {:number :sing
+                                                :person :1st}}}}
+          "en"
+          "US"
+          "it"
+          "IT"))
+
+(defn wtf2 []
+  (generate-question-and-correct-set
+   {:root {:italiano {:italiano "chiamarsi"}
+           :synsem {:subcat {:1 {:top :top}
+                             :2 {:top :top} :3 {:top :top}}
+                    :cat :verb :sem {:tense :present :aspect :simple}}}
+    :synsem {:subcat []}
+    :comp {:phrasal false :synsem {:agr {:number :sing
+                                         :person :1st}}}}
+   "en"
+   "US"
+   "it"
+   "IT"))
+
+
+


Reorganized handler imports

Reorganized handler imports


Test for missing documentation on defaults

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

--- test/onyx/doc_test.clj
+++ test/onyx/doc_test.clj
@@ -0,0 +1,9 @@
+(ns onyx.doc-test
+  (:require [taoensso.timbre :refer [info] :as timbre]
+            [clojure.test :refer [deftest is testing]]
+            [onyx.static.default-vals :refer [defaults]]
+            [onyx.information-model :refer [model]]))
+
+(deftest missing-documentation-test
+  (is (empty? (remove (apply merge (map :model (vals model)))
+                      (keys defaults)))))


minor changes

minor changes

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


Improved typesetting to eliminate spaces before terminating punctuation

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


Added testing infrastructure.

Added testing infrastructure.

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

--- src/appengine_magic/testing.clj
+++ src/appengine_magic/testing.clj
@@ -0,0 +1,56 @@
+(ns appengine-magic.testing
+  (:import [com.google.appengine.tools.development.testing LocalServiceTestHelper
+            LocalMemcacheServiceTestConfig LocalMemcacheServiceTestConfig$SizeUnit]))
+
+
+(def *memcache-size-units*
+     {:bytes LocalMemcacheServiceTestConfig$SizeUnit/BYTES
+      :kb LocalMemcacheServiceTestConfig$SizeUnit/KB
+      :mb LocalMemcacheServiceTestConfig$SizeUnit/MB})
+
+
+(defn memcache [& {:keys [max-size size-units]}]
+  (let [lmstc (LocalMemcacheServiceTestConfig.)]
+    (cond
+     ;; this means adjust the cache size
+     (and max-size size-units)
+     (.setMaxSize lmstc (long max-size) (*memcache-size-units* size-units))
+     ;; nothing provided; do nothing
+     (and (nil? max-size) (nil? size-units))
+     true
+     ;; one or the other provided: too error-prone, disallow
+     :else
+     (throw (RuntimeException. "provide both :max-size and :size-units")))
+    lmstc))
+
+
+(defn- make-local-services-fixture-fn [services]
+  (fn [test-fn]
+    (let [helper (LocalServiceTestHelper. (into-array services))]
+      (.setUp helper)
+      (test-fn)
+      (.tearDown helper))))
+
+
+(defn- local-services-helper
+  ([]
+     [(memcache)])
+  ([services override]
+     (let [services (if (= :all services) (local-services-helper) services)]
+       (if (nil? override)
+           services
+           (let [given-services (zipmap (map class services) services)
+                 override-services (zipmap (map class override) override)]
+             (merge given-services override-services))))))
+
+
+(defn local-services
+  ([]
+     "Uses all services with their default settings."
+     (make-local-services-fixture-fn (local-services-helper)))
+  ([services & {:keys [override]}]
+     "- If services is :all, uses all services with their default settings.
+      - If services is a vector of services, uses those as given.
+      - To use all defaults, but override some specific services, use :all
+        and an :override vector."
+     (make-local-services-fixture-fn (local-services-helper services override))))


Added variable substitution for Markdown files


Pretty printed JSON

Pretty printed JSON

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


Add more stylish font-family

Add more stylish font-family


Static charset reference

Static charset reference

Thanks to @imrekoszo

--- src/yada/multipart.clj
+++ src/yada/multipart.clj
@@ -11,7 +11,7 @@
    [yada.util :refer [OWS CRLF]])
   (:import
    [java.io ByteArrayInputStream BufferedReader InputStreamReader]
-   [java.nio.charset Charset]))
+   [java.nio.charset Charset StandardCharsets]))

 ;; Ring's multipart-params middleware wraps Apache's commons file-upload
 ;; library which expects a single input-stream for multipart/* content.
@@ -446,6 +446,8 @@

 ;; Assembly of multipart/form-data

+()
+
 (defn xf-add-header-info []
   (map
    (fn [piece]
@@ -462,7 +464,7 @@
                              n
                              (recur (inc n))))))]
             (let [hin (as-> (ByteArrayInputStream. bytes 0 n) %
-                        (InputStreamReader. % (Charset/forName "US-ASCII"))
+                        (InputStreamReader. % StandardCharsets/US_ASCII)
                         (BufferedReader. %)
                         (line-seq %)
                         (map #(str/split % #":") %)


Handle fail codes properly

Handle fail codes properly

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/MitchellJThomas/medir.git/'


Removed unused import

Removed unused import


fix CVE-2018-1271. CVE-2018-1270 has no fix even in release candidate 2.1.0.RC1

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


Kehaar 0.7.0 with bounded thread pools

Kehaar 0.7.0 with bounded thread pools

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


fixed ClassNotFoundException on issue #5

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


Version 1.10.1

Version 1.10.1


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


[WM] Update datomic-toolbox to 2.0.1

[WM] Update datomic-toolbox to 2.0.1

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


version bumps

version bumps

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


Fix source-paths in project.clj for release

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/delitescere/yada.git/'


bump version

bump version

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


Version 1.7.4-SNAPSHOT

Version 1.7.4-SNAPSHOT


Version 0.3.0-SNAPSHOT

Version 0.3.0-SNAPSHOT

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


cider-nrepl gehitu

cider-nrepl gehitu

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


Version 62-SNAPSHOT

Version 62-SNAPSHOT

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


Update lein-cljsbuild

Update lein-cljsbuild

--- project.clj
+++ project.clj
@@ -59,7 +59,7 @@
                                   [figwheel-sidecar "0.5.0-6"]
                                   [hickory "0.6.0"]
                                   [reagent "0.6.0-alpha"]]
-                   :plugins [[lein-cljsbuild "1.1.1"]
+                   :plugins [[lein-cljsbuild "1.1.2"]
                              [lein-doo "0.1.6"]
                              [lein-figwheel "0.5.0-6"]]
                    :resource-paths ["test-resources" "target"]}


Update deps

Update deps

All of these versions are in use in other similar components and seem fine.

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


forgot to add project.clj

forgot to add project.clj

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

--- project.clj
+++ project.clj
@@ -0,0 +1,9 @@
+(defproject clj-http "0.0.1-SNAPSHOT"
+  :description "travelconnect"
+  :dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
+                 [org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]
+		 [org.apache.httpcomponents/httpclient "4.0.1"]
+		 [hiccup "0.2.6"]
+		 [org.danlarkin/clojure-json "1.1-SNAPSHOT"]]
+  :dev-dependencies [[swank-clojure "1.2.0"]
+                     [lein-clojars "0.5.0"]])


Bump client version of datomic

Bump client version of datomic


[WM] update deps

[WM] update deps

We've updated to these in enough other projects it doesn't seem worth a PR.

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


try setting key alias

try setting key alias

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


fix whitespaces

fix whitespaces

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/tobiasbayer/lambdacd.git/'


add sexp_test

add sexp_test

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

--- test/clojure/sexp_test.clj
+++ test/clojure/sexp_test.clj
@@ -0,0 +1,130 @@
+(ns sexp_test
+  (:import [org.antlr.v4.runtime DefaultErrorStrategy])
+  (:require [clojure.test :refer :all]
+            [org.mobileink.antlr :refer :all]
+            [org.mobileink.antlr.clj :refer :all :as clj]))
+
+;; TODO: drive verbose switch from param
+(def verbose nil)
+
+(def ers ;; error recovery strategy
+  (proxy [DefaultErrorStrategy] []
+    (recover [parser err] ;; recognizer and error
+      )
+    (recoverInline [parser]
+      )
+    (sync [parser]
+      )))
+
+;; (def lxrext
+;;   (proxy [symLexer] []
+;;     (recover [excpt]
+;;       ;(throw RuntimeException. excpt)
+;;     )))
+
+(defn setup []
+  (clj/make-parser "cljLexer" "cljParser"))
+
+(defn teardown []
+  )
+
+(defn test-setup
+  [f]
+  (setup)
+  (f)
+  (teardown))
+
+(use-fixtures :once test-setup)
+
+(deftest sexp-1
+  (testing "sexp list"
+    (is (= (clj/lex-string "(a)")
+           '(LPAREN SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(a b)")
+           '(LPAREN SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(a b c)")
+           '(LPAREN SYM_NM WS SYM_NM WS SYM_NM RPAREN EOF)))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(deftest sexp-specials-1
+  (testing "sexp list"
+    (is (= (clj/lex-string "defn defmacro def do fn if let loop quote or recur var")
+           '(SPECIAL WS SPECIAL WS SPECIAL WS SPECIAL WS SPECIAL WS SPECIAL WS SPECIAL WS SPECIAL WS SPECIAL WS SPECIAL WS SPECIAL WS SPECIAL EOF)))))
+
+(deftest sexp-specials-2
+  (testing "sexp list"
+    (is (= (clj/lex-string "(def b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(defn b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(defmacro b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(do b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(fn b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(let b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(loop b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(quote b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(or b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(recur b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(var b c)")
+           '(LPAREN SPECIAL WS SYM_NM WS SYM_NM RPAREN EOF)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(deftest sexp-specials-3
+  (testing "sexp list with namespaces"
+    (is (= (clj/lex-string "(def a/b c)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(defn a/b c)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(defmacro a/b c)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(do a/b c/d)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS SYM_NS SLASH SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(fn a/b [] c)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS LBRACK RBRACK WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(let [a/b c] d)")
+           '(LPAREN SPECIAL WS LBRACK SYM_NS SLASH SYM_NM
+                    WS SYM_NM RBRACK WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(loop a/b a/c)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS SYM_NS SLASH SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(quote a/b c)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(or a/b c/d)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS SYM_NS SLASH SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(recur a/b a/c)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS SYM_NS SLASH SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(var a/b c/d)")
+           '(LPAREN SPECIAL WS SYM_NS SLASH SYM_NM
+                    WS SYM_NS SLASH SYM_NM RPAREN EOF)))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(deftest sexp-embed
+  (testing "sexp with embedded sexp"
+    (is (= (clj/lex-string "(let [a b] c)")
+           '(LPAREN SPECIAL WS LBRACK SYM_NM WS SYM_NM
+                    RBRACK WS SYM_NM RPAREN EOF)))
+    (is (= (clj/lex-string "(do (foo b) (bar c))")
+           '(LPAREN SPECIAL WS LPAREN SYM_NM WS SYM_NM RPAREN
+                    WS LPAREN SYM_NM WS SYM_NM RPAREN RPAREN EOF)))
+    (is (= (clj/lex-string "(do (foo (bar b)))")
+           '(LPAREN SPECIAL WS
+                    LPAREN SYM_NM WS
+                    LPAREN SYM_NM WS SYM_NM RPAREN RPAREN RPAREN EOF)))))


create and transact fees with orders when appropriate

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


(refactor)

(refactor)

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


Put all of log error on one line

Put all of log error on one line

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


[WM] add import support for authority levels

":state", ":county", or ":municipal" will go into new
"voter-reg-authority-level" and "election-authority-level" columns.


Seven Languages in Seven Weeks: Clojure day 2.

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

--- SevenLanguages/Clojure/day2.clj
+++ SevenLanguages/Clojure/day2.clj
@@ -0,0 +1,9 @@
+(defmacro unless [test body else]
+    (list 'if (list 'not test) body else))
+
+(defprotocol MyProtocol
+    (shiz [_ c]))
+
+(defrecord MyRecord [some-key] MyProtocol
+    (shiz [_ c] {some-key c}))
+


Use :system-running in figwheel-running?

This change updates `figwheel-running?` in the sidecar repl-api
namespace to use the `{:figwheel-system {:system-running Bool}}` value
instead of the truthy value of the *repl-api-system*.

This is required because when `stop-figwheel!` stops the component it
updates the var with the stopped version (truthy) instead of setting it
back to a nil (falsy). This leads to the case where `figwheel-running?`
will return true after a figwheel component has been started and
stopped.

--- sidecar/src/figwheel_sidecar/repl_api.clj
+++ sidecar/src/figwheel_sidecar/repl_api.clj
@@ -29,7 +29,7 @@
     (alter-var-root #'*repl-api-system* component/stop)))

 (defn figwheel-running? []
-  (or *repl-api-system*
+  (or (get-in *repl-api-system* [:figwheel-system :system-running] false)
       (do
         (println "Figwheel System not itnitialized.\nPlease start it with figwheel-sidecar.repl-api/start-figwheel!")
         nil)))
@@ -126,4 +126,4 @@
     (if (false? (:repl figwheel-options))
       (loop [] (Thread/sleep 30000) (recur))
       ;; really should get the given initial build id here
-      (fs/cljs-repl (:figwheel-system system)))))
+      (fs/cljs-repl (:figwheel-system system)))))


Added print-method for JSValue.

Added print-method for JSValue.

--- src/sablono/compiler.clj
+++ src/sablono/compiler.clj
@@ -141,3 +141,9 @@
     (if (> (count forms) 1)
       `(~'into-array ~(vec (compile-seq content)))
       (first forms))))
+
+;; TODO: Remove when landed in ClojureScript.
+(defmethod print-method JSValue
+  [^JSValue v, ^java.io.Writer w]
+  (.write w "#js ")
+  (.write w (pr-str (.val v))))


New module: config

New module: config

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

--- src/cloverage_jenkins_reporter/config.clj
+++ src/cloverage_jenkins_reporter/config.clj
@@ -0,0 +1,23 @@
+(ns cloverage-jenkins-reporter.config)
+
+(require '[cloverage-jenkins-reporter.config-loader :as config-loader])
+
+(def jenkins-url
+    "URL for Jenkins page."
+    (atom nil))
+
+(def jenkins-job-prefix-url
+    "URL for Jenkins page with job settings."
+    (atom nil))
+
+(def jenkins-job-list-url
+    "URL for Jenkins page with job list."
+    (atom nil))
+
+(defn load-configuration
+    [config-file-name]
+    (let [configuration (config-loader/load-configuration-file config-file-name)]
+        (reset! jenkins-url            (:jenkins-url configuration))
+        (reset! jenkins-job-prefix-url (:jenkins-job-prefix-url-url configuration))
+        (reset! jenkins-job-list-url   (:jenkins-job-list-url configuration))))
+


[WM] fix election id in vote-tomorrow handler

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


rename to avoid conflict with clojure.core


Use _api for views

Use _api for views

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


experimental module added

experimental module added

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

--- src/webdriver/new.clj
+++ src/webdriver/new.clj
@@ -0,0 +1,202 @@
+(ns webdriver.new
+  "
+  The API below was written regarding to the source code
+  of different Webdriver implementations.
+
+  Sometimes, a feature you found out in W3C official standard
+  really differs from the corresponding implementation in Chrome or Firefox, etc.
+
+  Chrome:
+  https://github.com/bayandin/chromedriver/blob/e9a1f55b166ea62ef0f6e78da899d9abf117e88f/client/command_executor.py
+
+  Firefox (Geckodriver):
+  https://github.com/mozilla/webdriver-rust/blob/7ec65451c99b638655c72e7b9718a374ff60de87/src/httpapi.rs
+
+  Phantom.js (Ghostdriver)
+  https://github.com/detro/ghostdriver/blob/873c9d660a80a3faa743e4f352571ce4559fe691/src/request_handlers/session_request_handler.js
+  https://github.com/detro/ghostdriver/blob/873c9d660a80a3faa743e4f352571ce4559fe691/src/request_handlers/webelement_request_handler.js
+  "
+  (:require [clojure.string :as str]
+            [webdriver.proc :as proc]
+            [webdriver.client :as client]
+            [webdriver.keys :as keys]
+            [clojure.data.codec.base64 :as b64]
+            [clojure.java.io :as io]
+            [cheshire.core :refer [parse-string]]
+            [slingshot.slingshot :refer [try+ throw+]])
+  (:import java.net.ConnectException))
+
+;;
+;; defaults
+;;
+
+(def default-paths {:firefox "geckodriver"
+                    :chrome "chromedriver"
+                    :phantom "phantomjs"
+                    :safari "safaridriver"})
+
+(def default-ports {:firefox 4444
+                    :chrome 5555
+                    :phantom 8910})
+
+;;
+;; utils
+;;
+
+(defmacro defmethods
+  "Declares multimethods in batch."
+  [multifn dispatch-vals & fn-tail]
+  `(doseq [dispatch-val# ~dispatch-vals]
+     (defmethod ~multifn dispatch-val# ~@fn-tail)))
+
+(defn dispatch-driver [driver & _]
+  (:type @driver))
+
+(defn random-port
+  "Returns a random port skiping first 1024 ones."
+  []
+  (let [max-port 65536
+        offset 1024]
+    (+ (rand-int (- max-port offset))
+       offset)))
+
+;;
+;; api
+;;
+
+(defmacro with-api [driver method path data result & body]
+  `(let [~result (client/call
+                  (-> ~driver deref :host)
+                  (-> ~driver deref :port)
+                  ~method
+                  ~path
+                  ~data)]
+     ~@body))
+
+(defn create-session [driver]
+  (with-api driver
+    :post
+    [:session]
+    {:desiredCapabilities {}}
+    result
+    (:sessionId result)))
+
+(defn delete-session [driver]
+  (with-api driver
+    :delete
+    [:session (:session @driver)]
+    nil
+    _))
+
+;; click
+
+
+(defmulti click-el dispatch-driver)
+
+(defmethod click-el :firefox [driver el]
+  (with-api driver :post
+    [:session (:session @driver) :element el :click]
+    nil _))
+
+(defn click [driver q]
+  (click-el driver (find-el driver q)))
+
+;; find element(s)
+
+(defn by [driver locator]
+  (swap! driver assoc :locator locator))
+
+(defn find-el [driver q]
+  (with-api driver :get
+    [:session (:session @driver) :element]
+    {:locator (:locator @driver) :value q}
+    response
+    (:value response)))
+
+;;
+;; wait functions
+;;
+
+(defn wait [sec]
+  (Thread/sleep (* sec 1000)))
+
+;;
+;; driver management
+;;
+
+(defn make-url [host port]
+  (format "http://%s:%s" host port))
+
+(defmulti port-args dispatch-driver)
+
+(defmethods port-args [:firefox :safari] [driver]
+  ["--port" (:port @driver)])
+
+(defmethod port-args :chrome [driver]
+  [(str "--port=" (:port @driver))])
+
+(defmethod port-args :phantom [driver]
+  ["--webdriver" (:port @driver)])
+
+(defn create-driver [type & [opt]]
+  (let [driver (atom {})
+        host (or (:host opt) "127.0.0.1")
+        port (or (:port opt)
+                 (type default-ports)
+                 (random-port))
+        url (make-url host port)
+        locator (or (:locator opt) "xpath")]
+    (swap! driver assoc
+           :type type
+           :host host
+           :port port
+           :url url
+           :locator locator)
+    driver))
+
+(defn run-driver [driver & [opt]]
+  (let [type (:type @driver)
+        path (or (:path opt)
+                 (type default-paths))
+        args (or (:args opt)
+                 [])
+        env (or (:env opt) {})
+        port-args (port-args driver)
+        full-args (vec (concat [path] port-args args))
+        process (proc/run full-args env)]
+    (swap! driver assoc
+           :env env
+           :args full-args
+           :process process)
+    driver))
+
+(defn connect-driver [driver & [opt]]
+  (wait 2)
+  (let [session (create-session driver)]
+    (swap! driver assoc :session session)
+    driver))
+
+(defn disconnect-driver [driver]
+  (delete-session driver)
+  (swap! driver dissoc :session)
+  driver)
+
+(defn stop-driver [driver]
+  (proc/kill (:process @driver))
+  (swap! driver dissoc :process :args :env)
+  driver)
+
+(defn boot-driver [type & [opt]]
+  (-> type
+      (create-driver opt)
+      (run-driver opt)
+      (connect-driver opt)))
+
+(def firefox (partial boot-driver :firefox))
+(def chrome (partial boot-driver :chrome))
+(def phantom (partial boot-driver :phantom))
+(def safari (partial boot-driver :safari))
+
+;;
+;;
+;;


[TH] fix doc string quoting

[TH] fix doc string quoting


add error checking back in.

add error checking back in.


Started working on functions to evaluate predictions.

error: pathspec 'project/analyze-data/src/analyze_data/evaluate_test_data.clj' did not match any file(s) known to git

--- project/analyze-data/src/analyze_data/evaluate_test_data.clj
+++ project/analyze-data/src/analyze_data/evaluate_test_data.clj
@@ -0,0 +1,23 @@
+(ns analyze-data.evaluate-test-data
+  (:require [clojure.java.io :as io]
+            [analyze-data.csv-to-map :refer [csv-to-map]]
+            [analyze-data.find-knn :refer [find-knn]]))
+
+(defn evaluate-test-data
+  "test-data: sequence of maps with 'document-name' and 'document-text' keys"
+  [tf-idf-data test-data]
+  (let [test-corpus (map #(get % "document-text") test-data)
+        test-labels (map #(get % "document-name") test-data)
+        predictions (map (partial find-knn tf-idf-data) test-corpus)
+        prediction-labels (map #(first (first %)) predictions)
+        correct-predictions (->> prediction-labels
+                                 (map #(vector %1 %2) test-labels)
+                                 (filter (partial apply =)))]
+    (float (/ (count correct-predictions) (count test-labels)))))
+
+(defn evaluate-test-file
+  ""
+  [tf-idf-data test-file]
+  (with-open [in (io/reader test-file)]
+    (let [test-data (csv-to-map in)]
+      (evaluate-test-data tf-idf-data test-data))))


Add a few more fields to pom-to-map.

Add a few more fields to pom-to-map.

--- src/clojars/maven.clj
+++ src/clojars/maven.clj
@@ -8,6 +8,9 @@
    :version (.getVersion model)
    :description (.getDescription model)
    :homepage (.getUrl model)
+   :url (.getUrl model)
+   :licenses (.getLicenses model)
+   :scm (.getScm model)
    :authors (vec (map #(.getName %) (.getContributors model)))
    ;; TODO: doesn't appear to be used anywhere?
    :dependencies (vec (mapcat (fn [d] [(symbol (.getGroupId d)
@@ -21,5 +24,4 @@
   (with-open [reader (io/reader file)]
     (.read (MavenXpp3Reader.) reader)))

-
 (def pom-to-map (comp model-to-map read-pom))


auth file for handlers

auth file for handlers

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

--- src/freecoin/auth.clj
+++ src/freecoin/auth.clj
@@ -0,0 +1,46 @@
+;; Freecoin - digital social currency toolkit
+
+;; part of Decentralized Citizen Engagement Technologies (D-CENT)
+;; R&D funded by the European Commission (FP7/CAPS 610349)
+
+;; Copyright (C) 2015 Dyne.org foundation
+;; Copyright (C) 2015 Thoughtworks, Inc.
+
+;; Sourcecode designed, written and maintained by
+;; Denis Roio <jaromil@dyne.org>
+
+;; With contributions by
+;; Duncan Mortimer <dmortime@thoughtworks.com>
+
+;; This program is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU Affero General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program 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 Affero General Public License for more details.
+
+;; You should have received a copy of the GNU Affero General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+(ns freecoin.auth
+  (:require [freecoin.context-helpers :as ch]
+            [freecoin.db.wallet :as wallet]))
+
+(defn is-signed-in [ctx]
+  (when-let [uid (ch/context->signed-in-uid ctx)]
+    {:uid uid})
+  )
+
+(defn has-wallet [ctx wallet-store]
+  (if-let [wallet (wallet/fetch wallet-store (:uid ctx))]
+    {:wallet wallet}
+    [ false
+     {:status :fatal
+      ::reason "wallet not found" }
+     ]
+  ))
+
+(defn has-api-key [ctx] true)


getting somewhere

getting somewhere

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

--- sidecar/src/figwheel_sidecar/type_check.clj
+++ sidecar/src/figwheel_sidecar/type_check.clj
@@ -0,0 +1,658 @@
+(ns figwheel-sidecar.type-check
+  (:require
+   [clj-fuzzy.metrics :as metrics]
+   [clojure.walk :as walk]
+   [alandipert.intension :refer [make-db]]
+   [datascript.core      :refer [q]]
+   [clojure.core.logic :as l]))
+
+(defn db-rel [db q]
+  (fn [a]
+    (l/to-stream
+      (map #(l/unify a % q) db))))
+
+(def schema {:blah {:borh 5}
+             :root {:cljsbuild
+                    {:other-crap string?
+                     :builds integer?}}})
+
+(def seqify (partial walk/postwalk #(cond
+                                      (map-entry? %) %
+                                      (map? %) (or (seq %) {})
+                                      (vector? %) (map vector (range) %)
+                                      (list? %) (map vector (range) %)
+                                      :else %)))
+
+(walk/postwalk-demo {:figwheel {:server-port 5}
+                     :cljsbuild [{:server-ip "asdf"}]})
+
+(seqify {:figwheel {}
+         :cljsbuild '({:server-ip "asdf"})})
+
+(defn decompose [type-gen-fn node' s']
+  (letfn [(map?? [x] (and (seq? x)
+                          (every? map-entry? x)))
+          (list?? [x] (and (seq x)
+                           (every? #(and (= (count %) 2)
+                                    (integer? (first %)))
+                              s')))
+          (pred [x] (cond
+                      (map?? x) map??
+                      (list?? x) list??))
+          (decomp [node s]
+            (if (nil? s)
+              nil
+              (let [[[k v] & r] s
+                    t (type-gen-fn node k)]
+                (if (seq? v)
+                  (concat [[t := (pred v)]
+                           [k :- [node :> t]]]
+                          (decomp t v)
+                          (decomp node r))
+                  (concat (if (fn? v)
+                            [[t := v]
+                             [k :- [node :> t]]]
+                            [[k :- [node :> v]]])
+                          (decomp node r))))))]
+    (cons
+     [node' := (pred s')]
+     (decomp node' s'))))
+
+(def parse-rules    (comp (partial decompose #(gensym 'type) :RootMap) seqify))
+(def analyze-config (comp (partial decompose (fn [_] (l/lvar)) :RootMap) seqify))
+
+(defn spec [type body]
+  (decompose (fn [node k] (symbol (str (name node) k))) type (seqify body)))
+
+   (spec 'RootMap
+         {:cljsbuild 'CljsBuildOptions
+          :welwel [integer?]
+          :figwheel  'FigwheelOptions})
+
+(defn analyze [type body]
+  (decompose (fn [_ _] (l/lvar)) type (seqify body)))
+
+(def grammer
+  (concat
+   (spec 'RootMap
+         {:cljsbuild 'CljsBuildOptions
+          :figwheel  'FigwheelOptions})
+   (spec 'CljsBuildOptions
+         {:repl-listen-port integer?
+          :crossovers       integer?})
+   (spec 'FigwheelOptions
+         {:server-port integer?
+          :server-ip   string?})))
+
+(analyze 'RootMap
+         {:figwheel {:server-port 5}
+          :cljsbuild {:server-ip "asdf"}})
+
+;; type inference
+; type infer a tree
+;; type check a tree
+
+(defn mapper
+  "mapps a goal fn over two seqs"
+  [f rule var]
+  (l/conda
+   [(l/emptyo rule)
+    (l/== var rule)]
+   [(l/fresh [x xs v vs]
+      (l/conso x xs rule)
+      (l/conso v vs var)
+      (f x v)
+      (mapper f xs vs))]))
+
+(l/run* [q]
+  (mapper (fn [a b]
+            (l/conde
+             [(l/== a 3)
+              (l/== b a)]
+             [(l/== a 2)
+              (l/== b 20)]
+             [(l/== a 1)
+              (l/== b 10)])) [1 2 3]  q))
+
+(l/defna paths [term result]
+  ([[] []])
+  ([[[k v] . r] s]
+   (l/fresh [resr resv resk b to-map]
+     (paths r resr)
+     (l/matcha [v]
+               ([ [[ff . _] . _] ]
+                (paths v to-map)
+                (mapper (l/fne [x1 x2] ([[xxx ':- vvv] [[k . xxx] ':- vvv]])) to-map resv)
+                (l/appendo resv resr s))
+               ([v]
+                (l/appendo [[ [k] ':- v]] resr s))))))
+
+(l/defna type-path [root-type path typed]
+  ([_ [] []])
+  ([rt [k . xs] [[k :- [rt :> o]] . res]]
+   (l/membero [k :- [rt :> o]] grammer)
+   (type-path o xs res)))
+
+(l/defna type-path2 [root-type path typed]
+  ([_ [] []])
+  ([rt [k] [rt o]]
+   (l/membero [k :- [rt :> o]] grammer))
+  ([rt [k . xs] [rt . res]]
+   (l/fresh [o]
+     (type-path2 o xs res)
+     (l/membero [k :- [rt :> o]] grammer)))
+  ([rt [k . xs] [k . res]] ;; error path
+   (l/fresh [o]
+     (type-path2 o xs res))))
+
+(l/defna listo [arg]
+  ([[]])
+  ([[x . _]]))
+
+;; mising key error
+;; vector types
+
+(l/defne type-check [parent' type-sig path config err]
+  #_([_ [] [] [] []] l/fail)
+  ([_ [] [] c []]
+   ;; this gets rid of partial matches
+   (l/conda
+    [(listo c) l/fail]
+    [l/succeed]))
+  ([parent [typ . rt] [k . rk] conf errors]
+   (l/fresh [pred? body errv]
+     (l/membero [k body] conf)
+     (l/membero [k :- [parent :> typ]] grammer)
+
+     (type-check typ rt rk body errv)
+     (l/membero [typ := pred?] grammer)
+     (l/conda
+      [(l/project [pred?]
+                  (l/pred body pred?))
+       (l/== errv errors)]
+      [(l/conso [:Error body :not pred?]
+                errv errors)]))))
+
+(l/run* [q]
+  (l/membero [:figwheel q] (seqify {:figwheel {:server-port 5}})))
+
+(l/run* [q]
+  (l/fresh [a t b err]
+    (type-check t #_'RootMap
+                a #_'(FigwheelOptions FigwheelOptions:server-port)
+                b
+                #_(seqify {:server-port 5})
+                (seqify {:figwheel {:server-port 5}
+                         :cljsbuild {:repl-listen-port "asdf"}
+                         })
+                err)
+    (l/== q [t a b err])))
+
+grammer
+
+(l/run* [q]
+  (l/fresh [pths firsts a b single-path path-type]
+    (paths (seqify {:figwheel {:server-port 5}
+                    ; :cljsbuild {:repl-listen-port "asdf"}
+                    }) pths)
+    (mapper l/firsto pths firsts)
+    (l/membero single-path firsts)
+    (type-path2 'RootMap single-path path-type)
+    (l/== q path-type)
+    ))
+
+
+
+(l/defne lvar-em [xs out]
+  ([[] []])
+  ([[[x] . y] [[z] . o]]
+   (lvar-em y o)
+   (l/pred x fn?)
+   (l/project [x]
+              (l/pred z x)))
+  ([[[x] . y] [[x] . o]]
+   (lvar-em y o)))
+
+
+(l/run* [q]
+  (l/fresh [a b]
+    (l/== q [[1] ["asdf"]])
+    (lvar-em [[integer?] [string?]] q)
+
+    ))
+
+
+(let [rules   grammer
+      #_configs #_(analyze 'RootMap
+                       {:figwheel {:server-port 5
+                                   :server-port2 2}
+                        :cljsbuild {:server-ip "asdf"}})]
+  (l/run* [q]
+    (l/fresh [parent child configs]
+      (l/== configs (analyze 'RootMap
+                       {:figwheel {:server-port 5
+                                   :server-port2 2}
+                        :cljsbuild {:server-ip "asdf"}}))
+      (l/membero parent configs)
+      (l/membero child configs)
+      (l/matche
+       [parent child]
+       ([[_ :- [_ :> a]] [_ :- [a :> _]]]
+
+        (l/project [a]
+          (l/project [b]
+                     (l/== (= a b) true)))))
+      #_(l/membero parent rules)
+      #_(l/membero child rules)
+
+
+      (l/== q [parent child])
+      )))
+
+
+
+
+(parse-rules {:blah {:borh 5}
+              :root {:cljsbuild 5}})
+
+(parse-rules {:blah {:borh 5}
+              :root {:cljsbuild 5}})
+
+
+
+
+;;
+
+(analyze-config {:blah {:borh 5}
+                 :root {:cljsbuild 5}})
+
+(def ^:dynamic *rules* nil)
+(def ^:dynamic *configs* nil)
+
+(l/defna not-membero [in gg]
+  ([i []])
+  ([i [x . r]]
+   (l/!= i x)
+   (not-membero i r)))
+
+;; types that haven't matched finding
+(l/defna find-type-rules [rules rule out]
+  ([[] _ []])
+  ;; find other keys with this type ?? that are spelled similarly
+  ([[[k :- pt] . rs] [_ :- pt] [[k :- pt] . res]]
+   (find-type-rules rs rule res))
+  ([[x . rs] _ o]
+   (find-type-rules rs rule o)))
+
+(let [rules  (parse-rules {:blah {:borh 5}
+                           :root {:cljsbuild 5
+                                  :other-key 6
+                                  :other-keyer 6}})
+      configs (parse-rules {:blah {:borh 5}
+                            :root {:cljsbuild 6}})]
+  (binding [*rules* rules]
+    (l/run* [q]
+      (l/fresh [res-set out ll tt]
+        (l/membero res-set configs)
+        (not-membero res-set rules)
+        (find-type-rules rules res-set out)
+        (l/== q out)))))
+
+
+
+(l/defne parent-child [a b]
+  ([[_ ':> _ ':> c] [c ':> _ ':> _]])
+  ([[_ ':> _ ':> c] [c ':> _]]))
+
+(defn ancestor [x y]
+  (l/conde
+   [(parent-child x y)]
+   [(l/fresh [res]
+      (parent-child x res)
+      (ancestor res y))]))
+
+(defn valid-child [rp cp pc out]
+  ([[] []])
+
+  )
+
+
+(defn rooted-parent [parent child]
+  (l/fresh [a b]
+    (ancestor ['RootMap ':> a ':> b] parent)
+    (parent-child parent child)))
+
+
+(let [rules  (parse-rules {:blah {:borh 5}
+                           :root {:cljsbuild 5}})
+      configs (parse-rules {:blah {:borh 5}
+                            :root {:cljsbuild 5
+                                   :forest {:fire 3}}})]
+  (binding [*rules* rules]
+    (l/run* [q]
+      (l/fresh [p c child]
+         (l/onceo
+          (l/all
+   ))
+        (db-rel configs p)
+
+        (rooted-parent p (last configs))
+        (db-rel configs child)
+        (parent-child p child)
+         (l/== q child)
+         #_(l/== q [a :- b :- c])
+         #_(l/lvaro a))
+)))
+
+
+(let [rules  (parse-rules {:blah {:borh 5}
+                           :root {:cljsbuild 5}})
+      configs (last (analyze-config {:blah {:borh 5}
+                               :root {:cljsbuild 5}}))]
+  (binding [*rules* rules]
+    (l/run* [q]
+      (l/fresh [rule config a b c]
+        (l/membero q configs)
+        (not-membero q rules)
+        #_(l/== q [a :- b :- c])
+        #_(l/lvaro a)))))
+
+
+(l/defne parent-child [p ch]
+  ([[_ ':> _ ':> b] [b ':> _ ':> _]]))
+
+(defn config-parents [ch parents]
+  (db-rel *configs* ch)
+  (parent-child parents ch))
+
+(defn config-children [parent children]
+  (db-rel *configs* children)
+  (parent-child parent children))
+
+(defn valid-tree [node configs rules]
+  ()
+
+  )
+
+
+(l/defna match-rule [rule config out]
+  ([x x x])
+  ([[a ':> k ':> c] [a ':> k ':> d] [:Error k c :not d]])
+  ([[a ':> k ':> c] _ _ ]
+
+   );; leaf not =
+)
+
+(let [rules  (parse-rules {:blah {:borh 5}
+                           :root {:cljsbuild 5}})
+      configs (analyze-config {:blah {:borh 5}
+                               :root {:cljsbuild 5}})]
+  (binding [*rules* rules]
+    (l/run* [q]
+      (l/fresh [rule config out]
+        (db-rel rules rule)
+        (db-rel configs config)
+        (l/== rule config)
+        #_(match-rule rule config out)
+        (l/== q config)))
+    ))
+
+
+
+
+(l/defna decomp [term result]
+  ([[] []])
+  ([[[k v] . r] s]
+   (l/fresh [resv resr resk f ff z]
+     (l/conda
+      [(l/firsto v f)
+       (decomp v resv)
+       (decomp r resr)
+       (l/firsto f ff)
+       (l/appendo [[k ':-- ff]] resv resk)
+       (l/appendo resk resr s)]
+      [(decomp r resr)
+       (l/appendo [[k ':- v]] resr s)]))))
+
+(l/defna decomp [a term result]
+  ([_ [] []])
+  ([_ [[k v] . r] s]
+   (l/fresh [resr resv resk b]
+     (decomp a r resr)
+     (l/matcha [v]
+               ([ [[ff . _] . _] ]
+                (decomp b v resv)
+                (l/appendo [[a ':-- k ':-- b]] resv resk)
+                (l/appendo resk resr s))
+               ([v]
+                (l/appendo [[a ':-- k ':- v]] resr s))))))
+
+(l/defna findo [x l o]
+  ([x' [x' . r ] x'])
+  ([x' [i' . r ] _]
+   (findo x' r o)))
+
+(defn validate []
+
+  )
+
+
+
+(l/run* [q]
+  (findo 1 [2 1 4] q))
+
+
+(l/run* [q]
+  (l/appendo [:a] [:b :c] q))
+
+(l/run* [q]
+  (l/fresh [a]
+    (decomp a (seqify schema)
+            q)
+    )
+
+  )
+
+(def rules (list
+            [:a :-- :blah :-- :b]
+            [:b :-- :borh :-- 5]
+            [:a :-- :root :-- :c]
+            [:c :-- :cljsbuild :-- :d]
+            [:d :-- :other-crap :-- :string?]
+            [:d :-- :builds :-- :integer?]))
+
+
+
+(defn parent-key [rules keya keyb]
+  (l/fresh [a b c dba dbb]
+    (db-rel rules [a :-- keya :-- b])
+    (db-rel rules [b :-- keyb :-- c])))
+
+(defn parent-key [ka kb]
+  (l/fresh [a b d r]
+    (db-rel rules [a :-- ka :-- b])
+    (db-rel rules [b :-- kb :-- d])))
+
+(l/run* [q]
+  (l/fresh [a b]
+    (parent-key a b)
+    (l/== [a b] q)
+    ))
+
+(defn valid-path [ka kb out]
+  (l/conde
+   [(l/fresh [x res]
+      (parent-key ka x)
+      (l/conso ka res out)
+      (valid-path x kb res))]
+   [(parent-key ka kb)
+    (l/== [ka kb] out)]
+
+   #_[(parent-key ka kb)
+      #_(l/lvaro ka)
+      (l/== [[:error ka]] out)]
+   #_[(parent-key ka kb)
+      (l/lvaro kb)
+      (l/== [[:error kb]] out)]
+
+   ))
+
+
+(l/run* [q]
+  (l/fresh [a b]
+    (valid-path :root :builds q  )))
+
+
+;;; this is the most promising
+(defn match-child [vp pc child]
+  (l/conda
+   [(parent-key vp pc)
+    (l/== child pc)]
+   [(l/== child [:error pc])]))
+
+(l/defne valid-pather [root path out]
+  ([_ [] []])
+  ([_ [x . xs] o]
+   (l/fresh [check-res y rrr]
+     (match-child root x check-res)
+     (l/conda
+      [(l/== [:error y] check-res) (l/== o [check-res])]
+      [(l/conso x rrr o)
+       (valid-pather x xs rrr)]))))
+
+(l/run* [q]
+  (l/fresh [a]
+      (valid-pather :root [a :other-craper] q))
+  )
+
+
+;;; not lets make our specification
+
+
+
+
+
+
+
+
+
+(l/defna pcomp [p1 p2 out]
+  ([[] [] []])
+  ([[] _ []])
+  ([_ [] []])
+  ([[x] [y] [x]]
+   (l/== x y))
+  ([[x] [y] [[:error y]]])
+  ([[x x1 . xs] [y y1 . ys] [z . os]]
+   (l/conda
+    [(l/== x y)
+     (l/== z x)
+     (parent-key x x1)
+     (parent-key y y1)
+     (l/fresh [r r2]
+       (l/conso x1 xs r)
+       (l/conso y1 ys r2)
+       (pcomp r r2 os))]
+    [(l/!= x y)
+     (l/== z [[:error x]])
+     (l/== os [])]
+    )))
+
+(l/run* [q]
+  (l/fresh [a b]
+    (pcomp [:root :cljsbuild :builds]
+           [:root :cljsbuild :builds] q)))
+
+
+
+
+
+
+(defn path [n n2]
+
+
+  )
+
+
+
+
+#_(schema->db schema)
+
+(def ddd
+  {:cljsbuild
+   {:other-crap 5
+    :builds
+    {:dev {:source-paths ["yep" "there" 3]
+           :compiler
+           { :main 'example.core
+            :asset-path "js/out"
+            :output-to "resources/public/js/example.js"
+            :output-dir "resources/public/js/out"
+            :source-map-timestamp true
+            :libs ["libs_src" "libs_sscr/tweaky.js"]
+            ;; :externs ["foreign/wowza-externs.js"]
+            :foreign-libs [{:file "foreign/wowza.js"
+                            :provides ["wowzacore"]}]
+            ;; :recompile-dependents true
+            :optimizations :noner}}}}})
+
+
+
+
+
+(defn mapper
+  "mapps a goal fn over two seqs"
+  [f rule var]
+  (l/conde
+   [(l/emptyo rule)
+    (l/== var rule)]
+   [(l/fresh [x xs v vs]
+      (l/conso x xs rule)
+      (l/conso v vs var)
+      (f x v)
+      (mapper f xs vs))]))
+
+(defn rule-match [x v]
+  (l/conde
+   [(l/pred x fn?)
+    (l/project [x]
+               (l/pred v x))]
+   [(l/== x v)]))
+
+(def crule (partial mapper rule-match))
+
+(defn db-rel [db q]
+  (fn [a]
+    (l/to-stream
+      (map #(l/unify a % q) db))))
+
+(defn matching-paths* [db q]
+  (l/fresh [db-rule rule-path rule-pred
+            db-config config-path config-val]
+    (db-rel db db-rule)
+    (db-rel db db-config)
+    (l/== [rule-path :schema rule-pred] db-rule)
+    (l/== [config-path :config config-val] db-config)
+    (crule rule-path config-path)
+    (l/== q [config-path config-val])))
+
+(defn matching-paths [db]
+  (l/run* [q] (matching-paths* db q)))
+
+(matching-paths (total-db))
+
+(let [db (total-db)
+      matched-config-paths (map first (matching-paths (total-db)))]
+  (l/run* [q]
+    (l/fresh [db-config config-path config-val mconfig-paths
+              cf cr
+              mf mr]
+      (db-rel db db-config)
+      (db-rel matched-config-paths mconfig-paths)
+      (l/== [config-path :config config-val] db-config)
+      (l/conso cf cr config-path)
+      (l/conso mf mr mconfig-paths)
+      (l/== cr mr)
+      (l/!= mf cf)
+      (l/== q config-path))))
+


Remove space before punctuation

Remove space before punctuation

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


add facebook analytics file

add facebook analytics file

error: pathspec 'frontend/analytics/facebook.cljs' did not match any file(s) known to git

--- frontend/analytics/facebook.cljs
+++ frontend/analytics/facebook.cljs
@@ -0,0 +1,18 @@
+(ns frontend.analytics.facebook
+  (:require [frontend.utils :as utils :include-macros true]
+            [goog.net.jsloader]))
+
+
+(defn track-signup
+   (if (aget js/window "_fbq")
+         (track-pid pid)
+         (-> (goog.net.jsloader.load "//connect.facebook.net/en_US/fbds.js")
+                     (.addCallback #(track-pid pid)))))
+
+
+
+
+
+
+
+


Azala momentuan erakutsi

Azala momentuan erakutsi

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


Iruzkina bidaltzeko aukera saioa hasitakoan


Adds some logging to pubs

Adds some logging to pubs


Add space-theremin synth example

Add space-theremin synth example

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

--- src/overtone/examples/instruments/space.clj
+++ src/overtone/examples/instruments/space.clj
@@ -0,0 +1,20 @@
+(ns overtone.examples.instruments.space
+  (:use overtone.live))
+
+(defsynth space-theremin
+  [out-bus 0
+   freq 440
+   amp 0.1
+   gate 1
+   lfo-rate 6
+   lfo-width 0.5
+   cutoff 4000
+   rq 0.25
+   lag-time 0.1
+   pan 0]
+  (let [lfo    (lf-tri:kr (+ lfo-rate (mul-add (lf-noise1:kr 5) 0.3 0.3)) (rand 2))
+        osc    (* 0.5 (saw (midicps (+ (cpsmidi (lag freq lag-time))
+                                       (* lfo lfo-width)))))
+        filter (b-low-pass4 osc (lag cutoff (* lag-time 4)) rq)
+        env    (env-gen:ar (adsr 0.6 0 1 0.05) gate FREE)]
+    (out out-bus (pan2 (* filter env (lag amp (* 4 lag-time))) pan))))


Add stub implementation transform

Add stub implementation transform

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

--- src/clojure/wintergreen/implementation.clj
+++ src/clojure/wintergreen/implementation.clj
@@ -0,0 +1,24 @@
+; Implementation tree-transforms
+; This bridges the gap between ProcessJ semantics and JS semantics. The
+; result is a program tree that can be directly turned into JS code by
+; the codegen stage.
+
+; https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript
+; http://www.ibm.com/developerworks/library/j-treevisit/
+
+(ns wintergreen.implementation)
+
+; The main body of work that must go on here is the transformation of a process
+; into a javascript object with a series of methods to implement the sections of the
+; process and keep track of the suspend state
+
+
+(defn make-dummy-process
+  "Create a dummy process just so we can test the runtime"
+  []
+  '(function (local "DummyProcess") ()
+             (assign (field "this" "cc") (field "this" "fn1"))
+             (function (field "this" "fn1") ()
+                       (assign (field "this" "cc") (field "this" "fn2")))
+             (function (field "this" "fn2") ()
+                       (assign (field "this" "cc")) (field "this" "fn1"))))


out of memory fix

out of memory fix

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


moved selects to event_dao.clj

moved selects to event_dao.clj

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

--- src/ruuvi_server/database/event_dao.clj
+++ src/ruuvi_server/database/event_dao.clj
@@ -0,0 +1,171 @@
+(ns ruuvi-server.database.event-dao
+  (:use korma.db)
+  (:use korma.core)
+  (:use ruuvi-server.database.entities)
+  (:use [clojure.tools.logging :only (debug info warn error)])
+  (:require [ruuvi-server.util :as util])
+  (:import org.joda.time.DateTime)
+  )
+
+;; private functions
+(defn- to-sql-timestamp [date]
+  (if date
+    (java.sql.Timestamp. (.getMillis date))
+    nil))
+
+(defn- current-sql-timestamp []
+  (to-sql-timestamp (org.joda.time.DateTime)))
+
+;; public functions
+(defn get-trackers [ids]
+  (select tracker
+          (where (in :id ids))))
+
+(defn get-tracker-by-code [tracker-code]
+  (first (select tracker
+                 (where {:tracker_code tracker-code}))))
+
+(defn get-tracker-by-code! [tracker-code & tracker-name]
+  (let [existing-tracker (get-tracker-by-code tracker-code)]
+    (if existing-tracker
+      existing-tracker
+      (insert tracker (values {:tracker_code tracker-code
+                               :name (or tracker-name tracker-code)}))
+      )))
+
+(defn get-extension-type-by-id [id]
+  (first (select event-extension-type
+                 (where {:name id}))))
+
+
+(defn get-extension-type-by-name [type-name]
+  (first (select event-extension-type
+                 (where {:name (str (name type-name))}))))
+
+(defn get-extension-type-by-name! [type-name]
+  (let [existing-extension-type (get-extension-type-by-name type-name)]
+    (if existing-extension-type
+      existing-extension-type
+      (insert event-extension-type (values {:name (str (name type-name))
+                                            :description "Autogenerated"}))
+      )))
+
+(defn get-event [event_id]
+  (first (select event
+                 (with tracker)
+                 (with event-location)
+                 (with event-extension-value)
+                 (where {:id event_id})))
+  )
+
+(defn search-events
+  "Search events: criteria is a map that can contain following keys.
+- :storeTimeStart <DateTime>, find events that are created (stored) to database later than given time (inclusive).
+- :storeTimeDnd <DateTime>, find events that are created (stored) to database earlier than given time (inclusive).
+- :eventTimeStart <DateTime>, find events that are created in tracker later than given time (inclusive).
+- :eventTimeEnd <DateTime>, find events that are created in tracker earlier than given time (inclusive).
+- :maxResults <Integer>, maximum number of events. Default and maximum is 50.
+TODO calculates milliseconds wrong (12:30:01.000 is rounded to 12:30:01 but 12:30:01.001 is rounded to 12:30:02)
+TODO make maxResults default configurable.
+"
+  [criteria]
+
+  (let [event-start (to-sql-timestamp (:eventTimeStart criteria))
+        event-end (to-sql-timestamp (:eventTimeEnd criteria))
+        store-start (to-sql-timestamp (:storeTimeStart criteria))
+        store-end (to-sql-timestamp (:storeTimeEnd criteria))
+        tracker-ids (:trackerIds criteria)
+        max-result-count 50
+        max-results (:maxResults criteria max-result-count)
+        result-limit (min max-result-count max-results)
+
+        tracker-ids-crit (when tracker-ids {:tracker_id ['in tracker-ids]})
+        event-start-crit (when event-start {:event_time ['>= event-start]})
+        event-end-crit (when event-end {:event_time ['<= event-end]})
+        store-start-crit (when store-start {:created_on ['>= store-start]})
+        store-end-crit (when store-end {:created_on ['<= store-end]})
+        conditions (filter identity (list event-start-crit event-end-crit tracker-ids-crit))
+        ]
+    (if (not (empty? conditions))
+      (let [results (select event
+                            (with event-location)
+                            (with event-extension-value (fields :value)
+                                  (with event-extension-type (fields :name)))
+                            (where (apply and conditions))
+                            (limit result-limit)) ]
+        results
+        )
+      '() )))
+
+(defn get-events [ids]
+  (select event
+          (with event-location)
+          (with event-extension-value
+                (with event-extension-type (fields :name)))
+          (where (in :id ids))))
+
+(defn get-all-events []
+  (select event
+          (with event-location)
+          (with event-extension-value)
+          ))
+
+(defn get-all-trackers []
+  (select tracker)
+  )
+
+(defn get-tracker [id]
+  ;; TODO support also fetching with tracker_indentifier?
+  (first (select tracker
+                 (where {:id id}))))
+
+(defn- update-tracker-latest-activity [id]
+  (update tracker
+          (set-fields {:latest_activity (java.sql.Timestamp. (System/currentTimeMillis)) })
+          (where {:id id})))
+
+(defn create-tracker [code name shared-secret]
+  (info "Create new tracker" name "(" code ")")
+  (insert tracker (values
+                   {:tracker_code code
+                    :shared_secret shared-secret
+                    :name name})))
+
+(defn create-event [data]
+  (let [tracker (get-tracker-by-code! (:tracker_code data))]
+    (transaction
+     (update-tracker-latest-activity (tracker :id))
+     (let [extension-keys (filter (fn [key]
+                                    (.startsWith (str (name key)) "X-"))
+                                  (keys data))
+           latitude (:latitude data)
+           longitude (:longitude data)
+
+           event-entity (insert event (values
+                                       {:tracker_id (tracker :id)
+                                        :event_time (or (to-sql-timestamp (:event_time data))
+                                                        (current-sql-timestamp) )
+                                        }))]
+
+       (if (and latitude longitude)
+         (insert event-location (values
+                                 {:event_id (:id event-entity)
+                                  :latitude latitude
+                                  :longitude longitude
+                                  :accuracy (:accuracy data)
+                                  :satellite_count (:satellite_count data)
+                                  :altitude (:altitude data)}))
+         )
+
+       (doseq [key extension-keys]
+         (insert event-extension-value
+                 (values
+                  {:event_id (:id event-entity)
+                   :value (data key)
+                   :event_extension_type_id (:id (get-extension-type-by-name! key))
+                   }
+                  )))
+       event-entity
+       )))
+  )
+


add docstr

add docstr

--- src/metabase/db.clj
+++ src/metabase/db.clj
@@ -55,7 +55,10 @@
                          :password (config/config-str :mb-db-pass)
                          :host (config/config-str :mb-db-host)})))

-(defn metabase-db-conn-str []
+(defn metabase-db-conn-str
+  "A connection string that can be used when pretending the Metabase DB is itself a `Database`
+   (e.g., to use the Generic SQL driver functions on the Metabase DB itself)."
+  []
   (case (config/config-kw :mb-db-type)
     :h2 (db-file)
     :postgres (format "host=%s port=%d dbname=%s user=%s password=%s"


Update to ClojureScript 0.0-3030

Update to ClojureScript 0.0-3030

--- Clojure/project.clj
+++ Clojure/project.clj
@@ -4,7 +4,7 @@
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.6.0"]
-                 [org.clojure/clojurescript "0.0-2913"]
+                 [org.clojure/clojurescript "0.0-3030"]
                  [com.github.rickyclarkson/jmdns "3.4.2-r353-1"]]
   :source-paths ["src"]
   :compiler {


add order creation notifications

add order creation notifications

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


Now tracking components/employee.cljs

Now tracking components/employee.cljs

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

--- src/cljs/metime/components/employee.cljs
+++ src/cljs/metime/components/employee.cljs
@@ -0,0 +1,176 @@
+(ns metime.employee.components
+  (:require-macros [cljs.core.async.macros :refer [go alt!]])
+  (:require [goog.events :as events]
+            [goog.history.EventType :as EventType]
+            [cljs.core.async :refer [put! <! >! chan timeout]]
+            [om.core :as om :include-macros true]
+            [om-tools.dom :as dom :include-macros true]
+            [om-tools.core :refer-macros [defcomponent]]
+            [cljs-http.client :as http]
+            [sablono.core :as html :refer-macros [html]]
+            [cljs-hash.md5 :as hashgen]
+            [cljs-hash.goog :as gh]
+            [secretary.core :as secretary :refer-macros [defroute]])
+  (:import goog.History
+           goog.History.EventType)
+  )
+
+
+(declare app-state)
+
+(def history (History.))
+
+(defn toggle-active-status [item]
+  (let [token (str "#" (.getToken history))]
+    (if (= (:path item) token) (assoc item :active true) (assoc item :active false))))
+
+(defcomponent top-nav-bar [{:keys [top-nav-bar]}]
+  (display-name [_]
+                "top-nav-bar")
+
+  (render [_]
+          (html
+           [:ul.nav.navbar-nav
+            (for [item top-nav-bar]
+                [:li {:class (if (= (:active item) true) "active" "")} [:a {:href (:path item)} (:text item)]])])))
+
+
+(defn update-top-nav-bar [app-state-map]
+  (update-in app-state-map [:top-nav-bar] #(map toggle-active-status %)))
+
+
+(defn fetch-departments
+  [url]
+  (let [c (chan)]
+    (go (let [deps (((<! (http/get url)) :body) :departments)]
+          (>! c deps)))
+    c))
+
+(defn fetch-employee [url-with-id]
+  (let [c (chan)]
+    (println "Url with id: " url-with-id)
+    (go (let [emp (<! (http/get url-with-id) :body)]
+          (>! c emp)))
+    c))
+
+(defn employee-name [firstname lastname]
+  (let [disp-name (str firstname " " lastname)
+        name-length (count disp-name)]
+    (if (> name-length 20) (str (subs disp-name 0 17) "...") disp-name)))
+
+(defcomponent gravatar [email-address owner {:keys [size] :as opts}]
+  (display-name [_]
+                "gravatar")
+
+  (render [_]
+          (html
+           [:img.gravatar.img-circle
+            {:src (str "http://www.gravatar.com/avatar/" (hashgen/md5 email-address) "?s=" size "&r=PG&d=mm")}])))
+
+(defcomponent employee-info [{:keys [lastname firstname email id]}]
+  (display-name [_]
+                "employee-info")
+
+  (render [_]
+          (let [edit (fn [e]
+                       (secretary/dispatch! (str "/employees/" id))
+                       (println "You clicked the button"))]
+            (html
+             [:div {:class "col-sm-3 col-lg-3"}
+              [:div {:class "dash-unit"}
+               [:div {:class "thumbnail" :style {:margin-top "20px"}}
+                [:a {:href (str "/#/employees/" id)}
+                 [:h1 (employee-name firstname lastname)]
+                 [:div {:style {:margin-top "20px"}} (->gravatar email {:opts {:size 100}})]
+                 ]
+                [:div {:class "info-user"}
+                 [:span {:aria-hidden "true" :class "li_user fs1"}]
+                 [:span {:aria-hidden "true" :class "li_calendar fs1"}]
+                 [:span {:aria-hidden "true" :class "li_mail fs1"}]
+                 [:span {:aria-hidden "true" :class "glyphicon glyphicon-trash fs1"}]
+                ]
+
+                ;; For now, just simulate the number of days remaining
+                [:h2 {:class "text-center" :style {:color "red"}} (rand-int 25)]
+                ]]]))))
+
+
+(defcomponent department-employees [{:keys [department managerid manager-firstname manager-lastname manager-email employees]} owner opts]
+  (display-name [_]
+                "department-name")
+
+  (render [_]
+          (let [department-employees (filter #(not= (:id %) managerid) employees)
+                rows-of-employees (partition 4 4 nil department-employees)]
+            (html
+             [:div#accordian.panel.panel-default.row
+
+              [:div.panel-heading.clearfix.panel-heading
+               [:div.col-md-2.col-xs-2
+                [:div.col-md-4.col-xs-4 (om/build gravatar manager-email {:opts {:size 50}})]
+                [:div.col-md-8.col-xs-8
+                 [:h5 (str manager-firstname " " manager-lastname)]
+                 ]
+                ]
+               [:div.col-md-10.col-xs-10
+                [:div.col-md-11.col-xs-11
+                 [:h2 department]
+                 ]
+                [:div.col-md-1.col-xs-1
+                 [:button {:class "btn btn-default glyphicon glyphicon-sort"
+                           :data-toggle "collapse"
+                           :data-parent "accordian"
+                           :data-target (str "#" (clojure.string/replace department #"[\s]" "-"))}]
+                 ]
+                ]
+               ]
+
+              [:div.panel-body.panel-collapse.collapse {:id (clojure.string/replace department #"[\s]" "-") :style {:height "auto"}}
+               (if (not (zero? (count rows-of-employees)))
+                 (for [employee-row rows-of-employees]
+                   [:div.row.accordian-inner
+                    (for [employee-info-component (om/build-all employee-info employee-row)]
+                      employee-info-component)])
+                 [:div.row.accordian-inner
+                  [:h5.text-center "Currently, this department does not contain any employees"]])]]))))
+
+
+(defcomponent department-list [{:keys [departments]}]
+  (display-name [_]
+                "department-list")
+
+  (render [_]
+          (html
+           [:div.clearfix.accordian
+            (dom/ul (om/build-all department-employees departments))])))
+
+
+(defcomponent departments-container [app owner opts]
+  (display-name [_]
+                "departments-box")
+
+  (will-mount [_]
+              (go
+               (let [deps (<! (fetch-departments (:url opts)))]
+                 (om/transact! app #(assoc % :departments deps))
+                 )))
+
+  (render-state [_ {:keys [departments]}]
+                (html
+                 [:div.row
+                  (->department-list app)])))
+
+(defcomponent employee [app owner opts]
+  (display-name [_]
+                "employee")
+
+  (will-mount [_]
+              (let [url-with-id (str (:url opts) (:id app))]
+                (go
+                 (let [emp (<! (fetch-employee url-with-id))]
+                   (om/transact! app #(assoc % :employee emp))))))
+
+  (render-state [_ {:keys [employee]}]
+                (html
+                 [:h1 "Stuff about the employee goes here"
+                 [:div (str "Email: " (:email employee))]])))


give me a namespace for interactive development

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

--- src/brainbot/nozzle/dev.clj
+++ src/brainbot/nozzle/dev.clj
@@ -0,0 +1,7 @@
+(ns brainbot.nozzle.dev
+  "namespace used for interactive development with the repl"
+  (:require [brainbot.nozzle.inihelper :as inihelper]))
+
+(def iniconfig
+  (inihelper/read-ini-with-defaults
+   (format "%s/doc/nozzle.ini" (System/getProperty "user.dir"))))


config reader

config reader

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

--- src/cljs/server/config.cljs
+++ src/cljs/server/config.cljs
@@ -0,0 +1,5 @@
+(ns server.config
+  (:require [cljs.nodejs :as nodejs]))
+
+;; keep config in javascript since we are mostly passing values to other JS libs
+(def config (nodejs/require "../../application.json"))


removing vestigial code

removing vestigial code


another example

another example

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

--- one/src/one/b.clj
+++ one/src/one/b.clj
@@ -0,0 +1,137 @@
+(ns one.b)
+
+;; expt a m => a^m
+;; re-implement several clojure's functions
+;; take drop zipmap map take-while drop-while...
+
+"product (x & xs)
+-> (x & xs) empty? -> 1
+-> x * product xs"
+
+(defn product
+  [[x & xs]]
+  (if x
+    (* x (product xs))
+    1))
+
+"prime? -> 1 & n" "2,3,4,5,6,n-1"
+
+(defn iter-prime
+  [n i]
+  (cond
+    (= n i) true
+    (zero? (rem n i)) false
+    :else (iter-prime n (inc i))))
+
+(defn prime?
+  [n]
+  (cond (<= n 1) false
+    (= n 2) true
+    :else (iter-prime n 2)))
+
+(defn prime?2
+  [n]
+  (let [iter (fn iter [i]
+               (cond (= n i) true
+                 (zero? (rem n i)) false
+                 :else (iter (inc i))))]
+    (cond (<= n 1) false
+      (= n 2) true
+      :else (iter 2))))
+
+(defn prime?3
+  [n]
+  (let [iter (fn iter [i]
+               (cond (= n i) true
+                 (zero? (rem n i)) false
+                 :else (iter (+ i 2))))]
+    (cond (<= n 1) false
+      (= n 2) true
+      (even? n) false
+      :else (iter 3))))
+
+(defn prime?4
+  [n]
+  (let [akar-n (Math/sqrt n)
+        iter (fn iter [i]
+               (cond (> i akar-n) true
+                 (zero? (rem n i)) false
+                 :else (iter (+ i 2))))]
+    (cond (<= n 1) false
+      (= n 2) true
+      (even? n) false
+      :else (iter 3))))
+
+(defn fak
+  [i]
+  (if (<= i 1)
+    1
+    (*' i (fak (dec i)))))
+
+"fak 10000 -> 1000 * fak 9999"
+"fak "
+
+(defn sum
+  [[x & xs]]
+  (if x (+' x (sum xs)) 0))
+
+(defn sum'
+  [lst]
+  (loop [[x & xs] lst res 0]
+    (if x
+      (recur xs (+ res x))
+      res)))
+
+(defn jumlah-dari-0-sampe-n
+  [n]
+  (loop [i 0 res 0]
+    (if (> i n)
+      res
+      (recur (+ i 1) (+ res i)))))
+
+"5"
+"loop 0 0"
+"loop 1 0"
+"loop 2 0+1"
+"loop 3 3"
+"loop 4 6"
+"loop 5 10"
+"loop 6 -> 10"
+
+
+
+
+
+
+
+
+
+
+
+"48"
+
+"2 3 4 6 8 12 16 24"
+
+"a*a = 48, "
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


Pass rabbitmq config to queue/initialize

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


started work on scrabble game

started work on scrabble game

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/benzap/baconbot.git/'


implementing memory db

implementing memory db

error: pathspec 'src/clj/ow/factum/db/memory.clj' did not match any file(s) known to git

--- src/clj/ow/factum/db/memory.clj
+++ src/clj/ow/factum/db/memory.clj
@@ -0,0 +1,25 @@
+(ns ow.factum.db.memory
+  (:require [ow.factum.db :as d]))
+
+(defrecord Eventstore [facts cureid curtxid]
+
+  d/Eventstore
+
+  (get-all [this]
+    @facts)
+
+  (new-eid [this]
+    (swap! cureid inc))
+
+  (new-txid [this]
+    (swap! curtxid inc))
+
+  (save [this [e a v t action :as fact]]
+    (let [ifact [(or e (d/new-eid this))
+                 a v
+                 (or t (d/new-txid this))]]
+      (swap! facts #(conj % (conj ifact (or action :add))))
+      ifact)))
+
+(defn new-eventstore [facts]
+  (->Eventstore (atom facts) (atom -1) (atom -1)))


Adding validation

Adding validation

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


"meta-type" helpers should return metadata

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


Pruebas

Pruebas

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


Flip mirror image.

Flip mirror image.

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

--- src/videotest/flow_only.clj
+++ src/videotest/flow_only.clj
@@ -0,0 +1,217 @@
+(ns videotest.flow-only
+  (:require
+   [quil.core :as q]
+   [quil.middleware :as m]
+   [clojure.set :as cset])
+  (:import
+   [org.opencv.highgui Highgui VideoCapture]
+   [org.opencv.core CvType Mat MatOfByte MatOfFloat MatOfPoint MatOfPoint2f Size TermCriteria]
+   [org.opencv.imgproc Imgproc]
+   [org.opencv.video Video]
+   [java.nio ByteBuffer ByteOrder]))
+
+(def MAX-CORNERS 800)
+(def BLANK-MASK (Mat.))
+(def WIN-SIZE-W 10)
+(def WIN-SIZE (Size. WIN-SIZE-W WIN-SIZE-W))
+(def NEG-ONE-SIZE (Size. -1 -1))
+(def TERM-CRITERIA (TermCriteria. (+ TermCriteria/EPS TermCriteria/COUNT) 20 0.03))
+
+(def RESET-FRAMES 4)
+(def PT-D 10)
+
+
+;; OpenCV Implementation Wrapper - Will move to separate NS.
+(defn camera [dev]
+  (VideoCapture. dev))
+
+(defn is-opened? [cam]
+  (.isOpened cam))
+
+(defn grab-frame!
+  "Updates a CV Mat with image from camera."
+  [cam frame]
+  (.read cam frame)
+  frame)
+
+;; <--End OpenCV Implementation Wrapper
+
+
+(defn camera-frame-size []
+  (let [cam (camera 0)
+        s (-> (grab-frame! cam (Mat.))
+              (.size))]
+    (.release cam)
+    {:width (.width s) :height (.height s)}))
+
+(def CAM-SIZE (camera-frame-size))
+(def WIDTH  (int (:width  CAM-SIZE)))
+(def HEIGHT (int (:height CAM-SIZE)))
+
+;; pixCnt1 is the number of bytes in the pixel buffer
+;; pixCnt2 is the number of integers in the PImage pixels buffer
+(def PIX-CNT1 (* WIDTH HEIGHT 4))
+(def PIX-CNT2 (* WIDTH HEIGHT))
+
+
+;; bArray is the temporary byte array buffer for OpenCV cv::Mat.
+;; iArray is the temporary integer array buffer for PImage pixels.
+(defn setup []
+  (q/frame-rate 60)
+  {:b-array (byte-array PIX-CNT1)
+   :i-array (int-array PIX-CNT2)
+   :frame-mat (Mat. WIDTH HEIGHT CvType/CV_8UC3)
+   :output-mat (Mat. WIDTH HEIGHT CvType/CV_8UC4)
+   :old-gray-mat nil
+   :old-corners nil
+   :new-gray-mat (Mat.)
+   :new-corners (MatOfPoint2f.)
+   :lk-status (MatOfByte.)
+   :lk-err (MatOfFloat.)
+   :camera (camera 0)
+   :p-image (q/create-image WIDTH HEIGHT :rgb)})
+
+(defn update-frame [state]
+  (let [{:keys [camera]} state]
+    (cond-> state
+            (is-opened? camera)
+            (update-in [:frame-mat] (partial grab-frame! camera) ))))
+
+(defn mat->p-img [in-mat out-mat b-array i-array p-img]
+  (Imgproc/cvtColor in-mat out-mat Imgproc/COLOR_RGB2RGBA 4)
+  (.get out-mat 0 0 b-array)
+  (-> (ByteBuffer/wrap b-array)
+      (.order ByteOrder/LITTLE_ENDIAN)
+      (.asIntBuffer)
+      (.get i-array))
+  (.loadPixels p-img)
+  (set! (.pixels p-img) (aclone i-array))
+  (.updatePixels p-img)
+  p-img)
+
+(defn update-p-image [state]
+  (let [{:keys [frame-mat output-mat b-array i-array]} state]
+    (update-in state [:p-image] #(mat->p-img frame-mat output-mat b-array i-array %))))
+
+(defn BGR->GrayMat! [m gray-mat]
+  (Imgproc/cvtColor m gray-mat Imgproc/COLOR_BGR2GRAY)
+  gray-mat)
+
+(defn update-corners!
+  ([gray-mat]
+     (let [corners (MatOfPoint2f.)]
+       (update-corners! gray-mat corners)))
+  ([gray-mat corners]
+     (let [max-corners MAX-CORNERS
+           quality-level 0.01
+           min-dist 5.0
+           mask BLANK-MASK
+           block-size 3
+           use-harris-detector false
+           k 0.04
+           pts (MatOfPoint.)]
+       (Imgproc/goodFeaturesToTrack gray-mat pts max-corners quality-level min-dist mask block-size use-harris-detector k)
+       (.convertTo pts corners CvType/CV_32FC2)
+       #_(Imgproc/cornerSubPix gray-mat corners WIN-SIZE NEG-ONE-SIZE TERM-CRITERIA)
+       corners)))
+
+(defn valid-pts [pts pt-status]
+  (let [p-s (filter (fn [[_ s]] (= 1 s))
+                    (map vector pts pt-status))]
+    (doall
+     (map (fn [[p _]] p) p-s))))
+
+(defn refresh-corners! [gray-mat lk-status remaining-corners old-corners]
+  (let [valid-remaining (valid-pts (.toList remaining-corners)
+                                   (.toList lk-status))
+        new-corners (.toList (update-corners! gray-mat))
+        union (vec
+               (cset/union (set valid-remaining) (set new-corners)))]
+    (.fromList old-corners (take MAX-CORNERS union))))
+
+(defn init-gray-mat [{:keys [frame-mat old-gray-mat] :as state}]
+  (if (nil? old-gray-mat)
+    (let [old-gray-mat (BGR->GrayMat! frame-mat (Mat.))]
+      (-> state
+          (assoc-in [:old-gray-mat] old-gray-mat)
+          (assoc-in [:old-corners] (update-corners! old-gray-mat (MatOfPoint2f.)))))
+    (let [{:keys [old-gray-mat old-corners new-gray-mat new-corners lk-status]} state]
+      (.copyTo new-gray-mat old-gray-mat)
+      (if (= 0 (mod (q/frame-count) RESET-FRAMES))
+        (do
+          ;; Reuse existing valid corners (still detected):
+          (refresh-corners! new-gray-mat lk-status new-corners old-corners)
+
+          ;; Brute-Force reset of corners:
+          #_(update-corners! new-gray-mat old-corners))
+        (do
+          (.copyTo new-corners old-corners)))
+      state)))
+
+(defn update-optical-flow [state]
+  (let [{:keys [frame-mat new-gray-mat new-corners old-gray-mat old-corners lk-status lk-err]} state]
+    (BGR->GrayMat! frame-mat new-gray-mat)
+    (update-corners! new-gray-mat new-corners)
+    (let [max-level 5
+          flags 0
+          min-eig-threshold 0.001]
+      (Video/calcOpticalFlowPyrLK old-gray-mat new-gray-mat old-corners new-corners lk-status lk-err
+                                  WIN-SIZE max-level TERM-CRITERIA flags min-eig-threshold))
+    (-> state
+        (assoc-in [:lk-status] lk-status)
+        (assoc-in [:lk-err] lk-err))))
+
+(defn update [state]
+  (-> state
+      (update-frame)
+      #_(update-p-image)
+      (init-gray-mat)
+      (update-optical-flow)))
+
+(defn draw-pt
+  ([pt rgba]
+    (let [x (.x pt)
+          y (.y pt)]
+       (q/push-style)
+       (q/no-stroke)
+       (apply q/fill rgba)
+       (q/ellipse x y PT-D PT-D)
+       (q/pop-style)) )
+  ([pt]
+     (draw-pt pt [0 255 0 80])))
+
+(defn draw-flow [{:keys [new-corners old-corners lk-status] :as state}]
+  (let [pts (.toList new-corners)
+        old-pts (.toList old-corners)]
+    (when (< 0 (count old-pts))
+      (dorun
+       (map #(draw-pt % [0 0 255 60]) old-pts)))
+    (when (< 0 (count pts))
+      (let [v-pts (valid-pts pts (.toList lk-status))]
+        (dorun
+         (map draw-pt v-pts))))))
+
+(defn draw [state]
+  (let [{:keys [p-image]} state]
+    (q/background 0)
+    (q/push-matrix)
+    (q/translate WIDTH 0)
+    (q/scale -1 1)
+    #_(q/image p-image 0 0)
+    (draw-flow state)
+    (q/pop-matrix)))
+
+(defn on-close
+  ([{:keys [camera]}]
+     (println "closing sketch and releasing camera...")
+     (when-not (nil? camera)
+       (.release camera))))
+
+(q/defsketch videotest
+  :title "Video Test"
+  :size [WIDTH HEIGHT]
+  :setup setup
+  :update update
+  :draw draw
+  :on-close on-close
+  :middleware [m/fun-mode])


Sorting values returned by mongo aggregation

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/stlk/home-automation.git/'