Reformatted jenkins_api_test.clj by zprint

--- test/clj_jenkins_api/jenkins_api_test.clj
+++ test/clj_jenkins_api/jenkins_api_test.clj
@@ -20,9 +20,9 @@
 ;

 (defn callable?
-    "Test if given function-name is bound to the real function."
-    [function-name]
-    (clojure.test/function? function-name))
+  "Test if given function-name is bound to the real function."
+  [function-name]
+  (clojure.test/function? function-name))

@@ -31,154 +31,164 @@
 ;

 (deftest test-log-existence
-    "Check that the clj-jenkins-api.jenkins-api/log definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/log definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/log))))
+  "Check that the clj-jenkins-api.jenkins-api/log definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/log definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/log))))

 (deftest test-encode-spaces-existence
-    "Check that the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/encode-spaces))))
+  "Check that the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/encode-spaces definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/encode-spaces))))

 (deftest test-get-command-existence
-    "Check that the clj-jenkins-api.jenkins-api/get-command definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/get-command definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/get-command))))
+  "Check that the clj-jenkins-api.jenkins-api/get-command definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/get-command definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/get-command))))

 (deftest test-post-command-existence
-    "Check that the clj-jenkins-api.jenkins-api/post-command definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/post-command definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/post-command))))
+  "Check that the clj-jenkins-api.jenkins-api/post-command definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/post-command definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/post-command))))

 (deftest test-job-name->url-existence
-    "Check that the clj-jenkins-api.jenkins-api/job-name->url definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/job-name->url definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/job-name->url))))
+  "Check that the clj-jenkins-api.jenkins-api/job-name->url definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/job-name->url definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/job-name->url))))

 (deftest test-update-jenkins-url-existence
-    "Check that the clj-jenkins-api.jenkins-api/update-jenkins-url definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/update-jenkins-url definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/update-jenkins-url))))
+  "Check that the clj-jenkins-api.jenkins-api/update-jenkins-url definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/update-jenkins-url definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/update-jenkins-url))))

 (deftest test-read-list-of-all-jobs-existence
-    "Check that the clj-jenkins-api.jenkins-api/read-list-of-all-jobs definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/read-list-of-all-jobs definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/read-list-of-all-jobs))))
+  "Check that the clj-jenkins-api.jenkins-api/read-list-of-all-jobs definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/read-list-of-all-jobs definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/read-list-of-all-jobs))))

 (deftest test-read-job-results-existence
-    "Check that the clj-jenkins-api.jenkins-api/read-job-results definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/read-job-results definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/read-job-results))))
+  "Check that the clj-jenkins-api.jenkins-api/read-job-results definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/read-job-results definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/read-job-results))))

 (deftest test-read-file-from-artifact-existence
-    "Check that the clj-jenkins-api.jenkins-api/read-file-from-artifact definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/read-file-from-artifact definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/read-file-from-artifact))))
+  "Check that the clj-jenkins-api.jenkins-api/read-file-from-artifact definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/read-file-from-artifact definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/read-file-from-artifact))))

 (deftest test-ok-response-structure-existence
-    "Check that the clj-jenkins-api.jenkins-api/ok-response-structure definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/ok-response-structure definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/ok-response-structure))))
+  "Check that the clj-jenkins-api.jenkins-api/ok-response-structure definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/ok-response-structure definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/ok-response-structure))))

 (deftest test-error-response-structure-existence
-    "Check that the clj-jenkins-api.jenkins-api/error-response-structure definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/error-response-structure definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/error-response-structure))))
+  "Check that the clj-jenkins-api.jenkins-api/error-response-structure definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/error-response-structure definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/error-response-structure))))

 (deftest test-job-related-command-existence
-    "Check that the clj-jenkins-api.jenkins-api/job-related-command definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/job-related-command definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/job-related-command))))
+  "Check that the clj-jenkins-api.jenkins-api/job-related-command definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/job-related-command definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/job-related-command))))

 (deftest test-enable-job-existence
-    "Check that the clj-jenkins-api.jenkins-api/enable-job definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/enable-job definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/enable-job))))
+  "Check that the clj-jenkins-api.jenkins-api/enable-job definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/enable-job definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/enable-job))))

 (deftest test-disable-job-existence
-    "Check that the clj-jenkins-api.jenkins-api/disable-job definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/disable-job definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/job-related-command))))
+  "Check that the clj-jenkins-api.jenkins-api/disable-job definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/disable-job definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/job-related-command))))

 (deftest test-delete-job-existence
-    "Check that the clj-jenkins-api.jenkins-api/delete-job definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/delete-job definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/delete-job))))
+  "Check that the clj-jenkins-api.jenkins-api/delete-job definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/delete-job definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/delete-job))))

 (deftest test-create-job-existence
-    "Check that the clj-jenkins-api.jenkins-api/create-job definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/create-job definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/create-job))))
+  "Check that the clj-jenkins-api.jenkins-api/create-job definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/create-job definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/create-job))))

 (deftest test-update-job-existence
-    "Check that the clj-jenkins-api.jenkins-api/update-job definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/update-job definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/delete-job))))
+  "Check that the clj-jenkins-api.jenkins-api/update-job definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/update-job definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/delete-job))))

 (deftest test-replace-placeholder-existence
-    "Check that the clj-jenkins-api.jenkins-api/replace-placeholder definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/replace-placeholder definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/replace-placeholder))))
+  "Check that the clj-jenkins-api.jenkins-api/replace-placeholder definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/replace-placeholder definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/replace-placeholder))))

 (deftest test-update-template-existence
-    "Check that the clj-jenkins-api.jenkins-api/update-template definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/update-template definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/update-template))))
+  "Check that the clj-jenkins-api.jenkins-api/update-template definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/update-template definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/update-template))))

 (deftest test-log-operation-existence
-    "Check that the clj-jenkins-api.jenkins-api/log-operation definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/log-operation definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/update-template))))
+  "Check that the clj-jenkins-api.jenkins-api/log-operation definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/log-operation definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/update-template))))

 (deftest test-send-configuration-xml-to-jenkins-existence
-    "Check that the clj-jenkins-api.jenkins-api/send-configuration-xml-to-jenkins definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/send-configuration-xml-to-jenkins definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/update-template))))
+  "Check that the clj-jenkins-api.jenkins-api/send-configuration-xml-to-jenkins definition exists."
+  (testing
+    "if the clj-jenkins-api.jenkins-api/send-configuration-xml-to-jenkins definition exists."
+    (is (callable? 'clj-jenkins-api.jenkins-api/update-template))))

 (deftest test-get-template-existence
-    "Check that the clj-jenkins-api.jenkins-api/get-template definition exists."
-    (testing "if the clj-jenkins-api.jenkins-api/get-template definition exists."
-        (is (callable? 'clj-jenkins-api.jenkins-api/update-template))))
+  "Check that the clj-jenkins-api.jenkins-api/get-template definition exists."
+  (testing "if the clj-jenkins-api.jenkins-api/get-template definition exists."
+           (is (callable? 'clj-jenkins-api.jenkins-api/update-template))))

@@ -187,157 +197,165 @@
 ;

 (deftest test-log
-    "Check the clj-jenkins-api.jenkins-api/log function"
-    (testing "the clj-jenkins-api.jenkins-api/log function"
-        (log)
-        (log "first")
-        (log "first" "second")
-        (log "first" "second" "third")
-        (log 1)
-        (log 1 2)
-        (log 1 2 3)))
+  "Check the clj-jenkins-api.jenkins-api/log function"
+  (testing "the clj-jenkins-api.jenkins-api/log function"
+           (log)
+           (log "first")
+           (log "first" "second")
+           (log "first" "second" "third")
+           (log 1)
+           (log 1 2)
+           (log 1 2 3)))

 (deftest test-log-not-NPE
-    "Check the clj-jenkins-api.jenkins-api/log function"
-    (testing "the clj-jenkins-api.jenkins-api/log function"
-        (log nil)
-        (log nil nil)
-        (log "first" nil)
-        (log nil "second")
-        (log nil "second" nil)))
+  "Check the clj-jenkins-api.jenkins-api/log function"
+  (testing "the clj-jenkins-api.jenkins-api/log function"
+           (log nil)
+           (log nil nil)
+           (log "first" nil)
+           (log nil "second")
+           (log nil "second" nil)))

 (deftest test-encode-spaces
-    "Check the clj-jenkins-api.jenkins-api/encode-spaces function"
-    (testing "the clj-jenkins-api.jenkins-api/encode-spaces function"
+  "Check the clj-jenkins-api.jenkins-api/encode-spaces function"
+  (testing "the clj-jenkins-api.jenkins-api/encode-spaces function"
+           (are [x y] (= x y)
+                ""            (encode-spaces "")
+                "%20"         (encode-spaces " ")
+                "%20%20"      (encode-spaces "  ")
+                "%20%20%20"   (encode-spaces "   ")
+                "x%20"        (encode-spaces "x ")
+                "x%20%20"     (encode-spaces "x  ")
+                "%20y"        (encode-spaces " y")
+                "%20%20y"     (encode-spaces "  y")
+                "x%20y"       (encode-spaces "x y")
+                "x%20y%20z"   (encode-spaces "x y z")
+                "x%20%20%20z" (encode-spaces "x   z"))))
+
+(deftest test-encode-spaces-NPE
+  "Check the function the clj-jenkins-api.jenkins-api/encode-spaces"
+  (testing "the function clj-jenkins-api.jenkins-api/encode-spaces"
+           (is (thrown? NullPointerException (encode-spaces nil)))))
+
+(deftest test-job-name->url-1
+  "Check the clj-jenkins-api.jenkins-api/job-name->url"
+  (testing
+    "the clj-jenkins-api.jenkins-api/job-name->url"
+    (are [x y] (= x y)
+         "job/"                  (job-name->url "" "")
+         " job/"                 (job-name->url " " "")
+         "jenkins-url/job/"      (job-name->url "jenkins-url/" "")
+         "jenkins-url:8080/job/" (job-name->url "jenkins-url:8080/" ""))))
+
+(deftest test-job-name->url-2
+  "Check the clj-jenkins-api.jenkins-api/job-name->url"
+  (testing "the clj-jenkins-api.jenkins-api/job-name->url"
         (are [x y] (= x y)
-            ""            (encode-spaces "")
-            "%20"         (encode-spaces " ")
-            "%20%20"      (encode-spaces "  ")
-            "%20%20%20"   (encode-spaces "   ")
-            "x%20"        (encode-spaces "x ")
-            "x%20%20"     (encode-spaces "x  ")
-            "%20y"        (encode-spaces " y")
-            "%20%20y"     (encode-spaces "  y")
-            "x%20y"       (encode-spaces "x y")
-            "x%20y%20z"   (encode-spaces "x y z")
-            "x%20%20%20z" (encode-spaces "x   z"))))
-
-(deftest test-encode-spaces-NPE
-    "Check the function the clj-jenkins-api.jenkins-api/encode-spaces"
-    (testing "the function clj-jenkins-api.jenkins-api/encode-spaces"
-        (is (thrown? NullPointerException (encode-spaces nil)))))
-
-(deftest test-job-name->url-1
-    "Check the clj-jenkins-api.jenkins-api/job-name->url"
-    (testing "the clj-jenkins-api.jenkins-api/job-name->url"
-        (are [x y] (= x y)
-            "job/"                  (job-name->url "" "")
-            " job/"                 (job-name->url " " "")
-            "jenkins-url/job/"      (job-name->url "jenkins-url/" "")
-            "jenkins-url:8080/job/" (job-name->url "jenkins-url:8080/" ""))))
-
-(deftest test-job-name->url-2
-    "Check the clj-jenkins-api.jenkins-api/job-name->url"
-    (testing "the clj-jenkins-api.jenkins-api/job-name->url"
-        (are [x y] (= x y)
-            "jenkins-url:8080/job/"                  (job-name->url "jenkins-url:8080/" "")
-            "jenkins-url:8080/job/job-name"          (job-name->url "jenkins-url:8080/" "job-name")
-            "jenkins-url:8080/job/job%20name"        (job-name->url "jenkins-url:8080/" "job name")
-            "jenkins-url:8080/job/long%20job%20name" (job-name->url "jenkins-url:8080/" "long job name"))))
+             "jenkins-url:8080/job/"                  (job-name->url "jenkins-url:8080/" "")
+             "jenkins-url:8080/job/job-name"          (job-name->url "jenkins-url:8080/" "job-name")
+             "jenkins-url:8080/job/job%20name"        (job-name->url "jenkins-url:8080/" "job name")
+             "jenkins-url:8080/job/long%20job%20name" (job-name->url "jenkins-url:8080/" "long job name"))))

 (deftest test-job-name->url-not-NPE
-    "Check the clj-jenkins-api.jenkins-api/job-name->url"
-    (testing "the clj-jenkins-api.jenkins-api/job-name->url"
-        (are [x y] (= x y)
-            "job/"  (job-name->url ""  "")
-            "job/"  (job-name->url nil ""))))
+  "Check the clj-jenkins-api.jenkins-api/job-name->url"
+  (testing "the clj-jenkins-api.jenkins-api/job-name->url"
+           (are [x y] (= x y)
+                "job/"  (job-name->url ""  "")
+                "job/"  (job-name->url nil ""))))

 (deftest test-job-name->url-NPE
-    "Check the clj-jenkins-api.jenkins-api/job-name->url"
-    (testing "the clj-jenkins-api.jenkins-api/job-name->url"
-        (is (thrown? NullPointerException (job-name->url ""  nil)))
-        (is (thrown? NullPointerException (job-name->url nil nil)))))
+  "Check the clj-jenkins-api.jenkins-api/job-name->url"
+  (testing "the clj-jenkins-api.jenkins-api/job-name->url"
+           (is (thrown? NullPointerException (job-name->url ""  nil)))
+           (is (thrown? NullPointerException (job-name->url nil nil)))))

 (deftest test-update-jenkins-url-1
-    "Check the clj-jenkins-api.jenkins-api/update-jenkins-url"
-    (testing "the clj-jenkins-api.jenkins-api/update-jenkins-url"
-        (are [x y] (= x y)
-            ""                        (update-jenkins-url "" nil)
-            "http://example.com/job"  (update-jenkins-url "http://example.com/job" nil)
-            "https://example.com/job" (update-jenkins-url "https://example.com/job" nil)
-            "other://example.com/job" (update-jenkins-url "other://example.com/job" nil)
-            ""                        (update-jenkins-url "" "")
-            "http://example.com/job"  (update-jenkins-url "http://example.com/job" "")
-            "https://example.com/job" (update-jenkins-url "https://example.com/job" "")
-            "other://example.com/job" (update-jenkins-url "other://example.com/job" "")
-            ""                        (update-jenkins-url "" {})
-            "http://example.com/job"  (update-jenkins-url "http://example.com/job" {})
-            "https://example.com/job" (update-jenkins-url "https://example.com/job" {})
-            "other://example.com/job" (update-jenkins-url "other://example.com/job" {}))))
+  "Check the clj-jenkins-api.jenkins-api/update-jenkins-url"
+  (testing
+    "the clj-jenkins-api.jenkins-api/update-jenkins-url"
+    (are [x y] (= x y)
+          ""                        (update-jenkins-url "" nil)
+          "http://example.com/job"  (update-jenkins-url "http://example.com/job" nil)
+          "https://example.com/job" (update-jenkins-url "https://example.com/job" nil)
+          "other://example.com/job" (update-jenkins-url "other://example.com/job" nil)
+          ""                        (update-jenkins-url "" "")
+          "http://example.com/job"  (update-jenkins-url "http://example.com/job" "")
+          "https://example.com/job" (update-jenkins-url "https://example.com/job" "")
+          "other://example.com/job" (update-jenkins-url "other://example.com/job" "")
+          ""                        (update-jenkins-url "" {})
+          "http://example.com/job"  (update-jenkins-url "http://example.com/job" {})
+          "https://example.com/job" (update-jenkins-url "https://example.com/job" {})
+          "other://example.com/job" (update-jenkins-url "other://example.com/job" {}))))

 (deftest test-update-jenkins-url-2
-    "Check the clj-jenkins-api.jenkins-api/update-jenkins-url"
-    (testing "the clj-jenkins-api.jenkins-api/update-jenkins-url"
-        (are [x y] (= x y)
-            ""                                      (update-jenkins-url "" "name:password")
-            "http://name:password@example.com/job"  (update-jenkins-url "http://example.com/job" "name:password")
-            "https://name:password@example.com/job" (update-jenkins-url "https://example.com/job" "name:password")
-            "other://example.com/job"               (update-jenkins-url "other://example.com/job" "name:password"))))
+  "Check the clj-jenkins-api.jenkins-api/update-jenkins-url"
+  (testing
+    "the clj-jenkins-api.jenkins-api/update-jenkins-url"
+    (are [x y] (= x y)
+         ""                                      (update-jenkins-url "" "name:password")
+         "http://name:password@example.com/job"  (update-jenkins-url "http://example.com/job" "name:password")
+         "https://name:password@example.com/job" (update-jenkins-url "https://example.com/job" "name:password")
+         "other://example.com/job"               (update-jenkins-url "other://example.com/job" "name:password"))))

 (deftest test-update-jenkins-url-NPE
-    "Check the clj-jenkins-api.jenkins-api/update-jenkins-url"
-    (testing "the clj-jenkins-api.jenkins-api/update-jenkins-url"
-        (is (thrown? NullPointerException (update-jenkins-url nil "name:password")))))
+  "Check the clj-jenkins-api.jenkins-api/update-jenkins-url"
+  (testing "the clj-jenkins-api.jenkins-api/update-jenkins-url"
+           (is (thrown? NullPointerException
+                        (update-jenkins-url nil "name:password")))))

 (deftest test-update-jenkins-url-not-NPE
-    "Check the clj-jenkins-api.jenkins-api/update-jenkins-url"
-    (testing "the clj-jenkins-api.jenkins-api/update-jenkins-url"
-        (update-jenkins-url nil nil)
-        (is true "Exception not thrown")
-        (update-jenkins-url nil "")
-        (is true "Exception not thrown")))
+  "Check the clj-jenkins-api.jenkins-api/update-jenkins-url"
+  (testing "the clj-jenkins-api.jenkins-api/update-jenkins-url"
+           (update-jenkins-url nil nil)
+           (is true "Exception not thrown")
+           (update-jenkins-url nil "")
+           (is true "Exception not thrown")))

 (deftest test-get-command
-    "Check the clj-jenkins-api.jenkins-api/get-command"
-    (testing "the clj-jenkins-api.jenkins-api/get-command"
-        (with-redefs [http-client/get (fn [url mapa] {:body url})]
-            (are [x y] (= x y)
-                ""                       (get-command "")
-                "url"                    (get-command "url")
-                "http://jenkins.url.org" (get-command "http://jenkins.url.org")))))
+  "Check the clj-jenkins-api.jenkins-api/get-command"
+  (testing
+    "the clj-jenkins-api.jenkins-api/get-command"
+    (with-redefs [http-client/get (fn [url mapa] {:body url})]
+      (are [x y] (= x y)
+           ""                       (get-command "")
+           "url"                    (get-command "url")
+           "http://jenkins.url.org" (get-command "http://jenkins.url.org")))))

 (deftest test-post-command
-    "Check the clj-jenkins-api.jenkins-api/post-command"
-    (testing "the clj-jenkins-api.jenkins-api/post-command"
-        (with-redefs [http-client/post (fn [url mapa] {:body url})]
-            (are [x y] (= x y)
-                {:body "job//"}    (post-command "" "" "" "")
-                {:body "jenkins-url/job/job-name/"} (post-command "jenkins-url/" "" "job-name" "")
-                {:body "http://jenkins.url.org/job/job-name/"} (post-command "http://jenkins.url.org/" "" "job-name" "")))))
+  "Check the clj-jenkins-api.jenkins-api/post-command"
+  (testing "the clj-jenkins-api.jenkins-api/post-command"
+           (with-redefs [http-client/post (fn [url mapa] {:body url})]
+             (are [x y] (= x y)
+                  {:body "job//"}    (post-command "" "" "" "")
+                  {:body "jenkins-url/job/job-name/"} (post-command "jenkins-url/" "" "job-name" "")
+                  {:body "http://jenkins.url.org/job/job-name/"} (post-command "http://jenkins.url.org/" "" "job-name" "")))))

 (deftest test-post-command-auth
-    "Check the clj-jenkins-api.jenkins-api/post-command"
-    (testing "the clj-jenkins-api.jenkins-api/post-command"
-        (with-redefs [http-client/post (fn [url mapa] {:body url})]
-            (are [x y] (= x y)
-                {:body "job//"}
-                (post-command "" "user:password" "" "")
-                {:body "jenkins-url/job/job-name/"}
-                (post-command "jenkins-url/" "user:password" "job-name" "")
-                {:body "http://user:password@jenkins.url.org/job/job-name/"}
-                (post-command "http://jenkins.url.org/" "user:password" "job-name" "")))))
+  "Check the clj-jenkins-api.jenkins-api/post-command"
+  (testing "the clj-jenkins-api.jenkins-api/post-command"
+           (with-redefs [http-client/post (fn [url mapa] {:body url})]
+             (are [x y] (= x y)
+                  {:body "job//"}
+                  (post-command "" "user:password" "" "")
+                  {:body "jenkins-url/job/job-name/"}
+                  (post-command "jenkins-url/" "user:password" "job-name" "")
+                  {:body "http://user:password@jenkins.url.org/job/job-name/"}
+                  (post-command "http://jenkins.url.org/" "user:password"
+                                "job-name" "")))))

 (deftest test-list-of-all-jobs
-    "Check the clj-jenkins-api.jenkins-api/list-of-all-jobs"
-    (testing "the clj-jenkins-api.jenkins-api/list-of-all-jobs"
-        (with-redefs [http-client/get (fn [url mapa] {:body "{\"jobs\": [\"first\", \"second\", \"third\"]}"})]
+  "Check the clj-jenkins-api.jenkins-api/list-of-all-jobs"
+  (testing
+    "the clj-jenkins-api.jenkins-api/list-of-all-jobs"
+    (with-redefs [http-client/get (fn [url mapa] {:body "{\"jobs\": [\"first\", \"second\", \"third\"]}"})]
             (are [x y] (= x y)
                 ["first" "second" "third"] (read-list-of-all-jobs "" "")))))

 (deftest test-list-of-all-jobs-no-data
-    "Check the clj-jenkins-api.jenkins-api/list-of-all-jobs"
-    (testing "the clj-jenkins-api.jenkins-api/list-of-all-jobs"
-        (with-redefs [http-client/get (fn [url mapa] {:body "{\"something\": [\"first\", \"second\", \"third\"]}"})]
+  "Check the clj-jenkins-api.jenkins-api/list-of-all-jobs"
+  (testing
+    "the clj-jenkins-api.jenkins-api/list-of-all-jobs"
+    (with-redefs [http-client/get (fn [url mapa] {:body "{\"something\": [\"first\", \"second\", \"third\"]}"})]
             (are [x y] (= x y)
                 nil (read-list-of-all-jobs "" "")
                 nil (read-list-of-all-jobs "jenkins-url" "")
@@ -345,12 +363,12 @@
                 nil (read-list-of-all-jobs "jenkins-url" "job-name")))))

 (deftest test-list-of-all-jobs-null
-    "Check the clj-jenkins-api.jenkins-api/list-of-all-jobs"
-    (testing "the clj-jenkins-api.jenkins-api/list-of-all-jobs"
-        (with-redefs [http-client/get (fn [url mapa] {:body "null"})]
-            (are [x y] (= x y)
-                nil (read-list-of-all-jobs "" "")
-                nil (read-list-of-all-jobs "jenkins-url" "")
-                nil (read-list-of-all-jobs "" "job-name")
-                nil (read-list-of-all-jobs "jenkins-url" "job-name")))))
-
+  "Check the clj-jenkins-api.jenkins-api/list-of-all-jobs"
+  (testing "the clj-jenkins-api.jenkins-api/list-of-all-jobs"
+           (with-redefs [http-client/get (fn [url mapa] {:body "null"})]
+             (are [x y] (= x y)
+                  nil (read-list-of-all-jobs "" "")
+                  nil (read-list-of-all-jobs "jenkins-url" "")
+                  nil (read-list-of-all-jobs "" "job-name")
+                  nil (read-list-of-all-jobs "jenkins-url" "job-name")))))
+


Fix connect test

Fix connect test

--- test/com/wsscode/pathom/connect_test.cljc
+++ test/com/wsscode/pathom/connect_test.cljc
@@ -3315,7 +3315,7 @@
                   [:c :d]}]))))

      (testing "global resolver times out"
-       (is (= {:com.wsscode.pathom.core/errors {nil "class clojure.lang.ExceptionInfo: Parallel read timeout - {:timeout 200}"}}
+       (is (= {:com.wsscode.pathom.core/errors {[] "class clojure.lang.ExceptionInfo: Parallel read timeout - {:timeout 200}"}}
               (quick-parser {::p/env       {::pp/key-process-timeout 200}
                              ::pc/register [(pc/resolver 'a
                                                          {::pc/input  #{}


remove debug

remove debug

--- kafka-clj/src/kafka_clj/produce.clj
+++ kafka-clj/src/kafka_clj/produce.clj
@@ -230,7 +230,6 @@
 (defn send-metadata-request
   "Writes out a metadata request to the producer's client"
   [{:keys [client]} conf]
-  (prn ">>>>>>>>>>>> METADATA_REQUEST: " client)
   (let [buff (Unpooled/buffer)
         _ (do (with-size buff write-metadata-request conf))]
     (tcp/write! client buff :flush true)))


(PDB-3723) Remove fact-path-update-race test

[rlb@puppet.com: adjust message]

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -1038,156 +1038,6 @@

             (is (true? @first-message?))
             (is (true? @second-message?))))))))
-
-(defn thread-id []
-  (.getId (Thread/currentThread)))
-
-(deftest fact-path-update-race
-  ;; Simulates two update commands being processed for two different
-  ;; machines at the same time.  Before we lifted fact paths into
-  ;; facts, the race tested here could result in a constraint
-  ;; violation when the two updates left behind an orphaned row.
-  (let [certname-1 "some_certname1"
-        certname-2 "some_certname2"
-        producer-1 "some_producer1"
-        producer-2 "some_producer2"
-        ;; facts for server 1, has the same "mytimestamp" value as the
-        ;; facts for server 2
-        facts-1a {:certname certname-1
-                  :environment nil
-                  :values {"domain" "mydomain1.com"
-                           "operatingsystem" "Debian"
-                           "mytimestamp" "1"}
-                  :producer_timestamp (-> 2 days ago)
-                  :producer producer-1}
-        facts-2a {:certname certname-2
-                  :environment nil
-                  :values {"domain" "mydomain2.com"
-                           "operatingsystem" "Debian"
-                           "mytimestamp" "1"}
-                  :producer_timestamp (-> 2 days ago)
-                  :producer producer-2}
-
-        ;; same facts as before, but now certname-1 has a different
-        ;; fact value for mytimestamp (this will force a new fact_value
-        ;; that is only used for certname-1
-        facts-1b {:certname certname-1
-                  :environment nil
-                  :values {"domain" "mydomain1.com"
-                           "operatingsystem" "Debian"
-                           "mytimestamp" "1b"}
-                  :producer_timestamp (-> 1 days ago)
-                  :producer producer-1}
-
-        ;; with this, certname-1 and certname-2 now have their own
-        ;; fact_value for mytimestamp that is different from the
-        ;; original mytimestamp that they originally shared
-        facts-2b {:certname certname-2
-                  :environment nil
-                  :values {"domain" "mydomain2.com"
-                           "operatingsystem" "Debian"
-                           "mytimestamp" "2b"}
-                  :producer_timestamp (-> 1 days ago)
-                  :producer producer-2}
-
-        ;; this fact set will disassociate mytimestamp from the facts
-        ;; associated to certname-1, it will do the same thing for
-        ;; certname-2
-        facts-1c {:certname certname-1
-                  :environment nil
-                  :values {"domain" "mydomain1.com"
-                           "operatingsystem" "Debian"}
-                  :producer_timestamp (now)
-                  :producer producer-1}
-        facts-2c {:certname certname-2
-                  :environment nil
-                  :values {"domain" "mydomain2.com"
-                           "operatingsystem" "Debian"}
-                  :producer_timestamp (now)
-                  :producer producer-2}
-
-        ;; Wait for two threads to countdown before proceeding
-        latch (java.util.concurrent.CountDownLatch. 2)
-
-        ;; I'm modifying delete-pending-path-id-orphans! so that I can
-        ;; coordinate access between the two threads, I'm storing the
-        ;; reference to the original delete-pending-path-id-orphans!
-        ;; here, so that I can delegate to it once I'm done
-        ;; coordinating
-        storage-delete-pending-path-id-orphans!
-        scf-store/delete-pending-path-id-orphans!]
-
-    (with-message-handler {:keys [handle-message dlo delay-pool q]}
-      (jdbc/with-db-transaction []
-        (scf-store/add-certname! certname-1)
-        (scf-store/add-certname! certname-2)
-        (scf-store/add-facts! {:certname certname-1
-                               :values (:values facts-1a)
-                               :timestamp (now)
-                               :environment nil
-                               :producer_timestamp (:producer_timestamp facts-1a)
-                               :producer producer-1})
-        (scf-store/add-facts! {:certname certname-2
-                               :values (:values facts-2a)
-                               :timestamp (now)
-                               :environment nil
-                               :producer_timestamp (:producer_timestamp facts-2a)
-                               :producer producer-2}))
-      ;; At this point, there will be 4 fact_value rows, 1 for
-      ;; mytimestamp, 1 for the operatingsystem, 2 for domain
-      (with-redefs [scf-store/delete-pending-path-id-orphans!
-                    (fn [& args]
-                      ;; Once this has been called, it will countdown
-                      ;; the latch and block
-                      (.countDown latch)
-                      ;; After the second command has been executed and
-                      ;; it has decremented the latch, the await will no
-                      ;; longer block and both threads will begin
-                      ;; running again
-                      (.await latch)
-                      ;; Execute the normal delete-pending-path-id-orphans!
-                      ;; function (unchanged)
-                      (apply storage-delete-pending-path-id-orphans! args))]
-        (let [first-message? (atom false)
-              second-message? (atom false)
-              fut-1 (future
-                      (handle-message (queue/store-command q (facts->command-req 4 facts-1b)))
-                      (reset! first-message? true))
-              fut-2 (future
-                      (handle-message (queue/store-command q (facts->command-req 4 facts-2b)))
-                      (reset! second-message? true))]
-          ;; The two commands are being submitted in future, ensure they
-          ;; have both completed before proceeding
-          @fut-2
-          @fut-1
-          ;; At this point there are 6 fact values, the original
-          ;; mytimestamp, the two new mytimestamps, operating system and
-          ;; the two domains
-          (is (true? @first-message?))
-          (is (true? @second-message?))
-          ;; Submit another factset that does NOT include mytimestamp,
-          ;; this disassociates certname-1's fact_value (which is 1b)
-          (handle-message (queue/store-command q (facts->command-req 4 facts-1c)))
-          (reset! first-message? true)
-
-          ;; Do the same thing with certname-2. Since the reference to 1b
-          ;; and 2b has been removed, mytimestamp's path is no longer
-          ;; connected to any fact values. The original mytimestamp value
-          ;; of 1 is still in the table. It's now attempting to delete
-          ;; that fact path, when the mytimestamp 1 value is still in
-          ;; there.
-          (handle-message (queue/store-command q (facts->command-req 4 facts-2c)))
-          (is (= 0 (task-count delay-pool)))
-
-          ;; Can we see the orphaned value '1', and does the global gc remove it.
-          (is (= 1 (count
-                    (query-to-vec
-                     "select id from fact_values where value_string = '1'"))))
-          (scf-store/garbage-collect! *db*)
-          (is (zero?
-               (count
-                (query-to-vec
-                 "select id from fact_values where value_string = '1'")))))))))

 (deftest concurrent-catalog-updates
   (testing "Should allow only one replace catalogs update for a given cert at a time"


(maint) fix command test race

(maint) fix command test race

this fixes a race with the commands test. Under some circumstances the same
timestamp would be used on both sides of a comparison.

--- test/puppetlabs/puppetdb/command_test.clj
+++ test/puppetlabs/puppetdb/command_test.clj
@@ -17,7 +17,7 @@
             [puppetlabs.puppetdb.testutils.reports :refer [munge-example-report-for-storage]]
             [puppetlabs.puppetdb.command.constants :refer [command-names]]
             [clj-time.coerce :refer [to-timestamp to-date-time to-string]]
-            [clj-time.core :as t :refer [days ago now]]
+            [clj-time.core :as t :refer [days ago now seconds]]
             [clojure.test :refer :all]
             [clojure.tools.logging :refer [*logger-factory*]]
             [slingshot.slingshot :refer [throw+]]
@@ -360,8 +360,7 @@
                    :version 5
                    :payload (get-in wire-catalogs [5 :empty])}
           certname (get-in command [:payload :name])
-          cmd-producer-timestamp (get-in command [:payload :producer-timestamp])
-          current-time (now)]
+          cmd-producer-timestamp (get-in command [:payload :producer-timestamp])]
       (with-fixtures
         (test-msg-handler command publish discard-dir

@@ -384,7 +383,7 @@
                  :payload (get-in wire-catalogs [4 :empty])}
         certname (get-in command [:payload :name])
         cmd-producer-timestamp (get-in command [:payload :producer-timestamp])
-        current-time (now)]
+        recent-time (-> 1 seconds ago)]
     (with-fixtures
       (test-msg-handler command publish discard-dir
         (is (false? (contains? (:payload command) :producer-timestamp)))
@@ -394,10 +393,11 @@
         (is (empty? (fs/list-dir discard-dir)))
         ;;v4 does not include a producer_timestmap, the backend
         ;;should use the time the command was received instead
-        (is (t/before? current-time (-> (query-to-vec "SELECT producer_timestamp FROM catalogs")
-                                        first
-                                        :producer_timestamp
-                                        to-date-time)))))))
+        (is (t/before? recent-time
+                       (-> (query-to-vec "SELECT producer_timestamp FROM catalogs")
+                           first
+                           :producer_timestamp
+                           to-date-time)))))))

 (defn update-resource
   "Updated the resource in `catalog` with the given `type` and `title`.
@@ -1199,7 +1199,7 @@
                      munge-example-report-for-storage
                      (dissoc :producer_timestamp :metrics :logs :noop)
                      utils/underscore->dash-keys)
-      current-time (now)]
+      recent-time (-> 1 seconds ago)]
   (deftest store-v4-report
     (let [command {:command (command-names :store-report)
                    :version 4
@@ -1215,7 +1215,7 @@
                                :status)))

         ;;No producer_timestamp is included in v4, message received time (now) is used intead
-        (is (t/before? current-time (-> (query-to-vec "SELECT producer_timestamp FROM reports")
+        (is (t/before? recent-time (-> (query-to-vec "SELECT producer_timestamp FROM reports")
                                         first
                                         :producer_timestamp
                                         to-date-time)))
@@ -1223,17 +1223,18 @@
         (is (empty? (fs/list-dir discard-dir))))))

   (deftest store-v3-report
-    (let [current-time (now)
+    (let [recent-time (-> 1 seconds ago)
           command {:command (command-names :store-report)
                    :version 3
                    :payload (dissoc old-report :status)}]
+      (Thread/sleep 100)
       (test-msg-handler command publish discard-dir
         (is (= (query-to-vec "SELECT certname,configuration_version,environment_id FROM reports")
                [(with-env {:certname (:certname old-report)
                            :configuration_version (:configuration-version old-report)})]))

         ;;No producer_timestamp is included in v4, message received time (now) is used intead
-        (is (t/before? current-time (-> (query-to-vec "SELECT producer_timestamp FROM reports")
+        (is (t/before? recent-time (-> (query-to-vec "SELECT producer_timestamp FROM reports")
                                         first
                                         :producer_timestamp
                                         to-date-time)))


Rename `run!` to `state->state` - Not a great name; should fix later - `run!` had a namespace collision with cljs core

--- src/robot_overlord/core.cljs
+++ src/robot_overlord/core.cljs
@@ -38,7 +38,7 @@
   (js/setTimeout #(om/update! cursor key true)
                  delay))

-(defn run!
+(defn state->state!
   "Run the state"
   [cursor printable current target init-delay duration] ;; NOTE: can access these properties with the cursor alone
   (cond
@@ -98,7 +98,7 @@

        om/IDidUpdate
        (did-update [_ _ _]
-         (run! logotype printable text remain 1500 1500))
+         (state->state! logotype printable text remain 1500 1500))

        om/IRender
        (render [_]
@@ -120,7 +120,7 @@

        om/IDidUpdate
        (did-update [_ _ _]
-         (run! what-we-do printable text remain 2000 1500))
+         (state->state! what-we-do printable text remain 2000 1500))

        om/IRender
        (render [_] (scan-title (:text what-we-do))))))
@@ -136,7 +136,7 @@

        om/IDidUpdate
        (did-update [_ _ _]
-         (run! who-we-are printable text remain 2000 1500))
+         (state->state! who-we-are printable text remain 2000 1500))

        om/IRender
        (render [_] (dom/h1 nil (oldschool (:text who-we-are)))))))
@@ -152,7 +152,7 @@

        om/IDidUpdate
        (did-update [_ _ _]
-         (run! contact printable text remain 2000 1000))
+         (state->state! contact printable text remain 2000 1000))

        om/IRender
        (render [_] (scan-title (:text contact))))))


typo in joplin.lein

typo in joplin.lein

--- joplin.lein/src/leiningen/joplin.clj
+++ joplin.lein/src/leiningen/joplin.clj
@@ -35,7 +35,7 @@
         (add-dep :cass types)
         (add-dep :jdbc types)
         (add-dep :sql types)
-        (add-dev :hive types)
+        (add-dep :hive types)
         (add-dep :es types)
         (add-dep :zk types))))


filling in validation TODOs for quad? triple?, rewriting statement? statements?

--- src/org/libraryweasel/ligature/core.clj
+++ src/org/libraryweasel/ligature/core.clj
@@ -102,32 +102,55 @@
     (nil? graph)
     (identifier? graph)))

+(defn subject
+  "Accepts a Statement tuple and returns the Subject."
+  [statement]
+  (get statement 0))
+
+(defn predicate
+  "Accepts a Statement tuple and returns the Predicate."
+  [statement]
+  (get statement 1))
+
+(defn object
+  "Accepts a Statement tuple and returns the Object."
+  [statement]
+  (get statement 2))
+
+(defn graph
+  "Accepts a Statement tuple and returns the Graph."
+  [statement]
+  (get statement 3))
+
 (defn triple?
   [triple]
-  (comment TODO))
+  (and (vector? triple)
+       (= (count triple) 3)
+       (subject? (subject triple))
+       (predicate? (predicate triple))
+       (object? (object triple))))

 (defn quad?
   [quad]
-  (comment TODO))
+  (and (vector? quad)
+       (= (count quad) 4)
+       (subject? (subject triple))
+       (predicate? (predicate triple))
+       (object? (object triple))
+       (graph? (graph triple))))

 (defn statement?
   "Accepts a Map and returns true or false depending on if it is a valid Statement.
   A valid Statement contains a :subject, :predicate, :object, and optionally a :graph key with valid values."
   [statement]
-  (and
-    (map? statement)
-    (or
-      (= (set (keys statement)) #{:subject :predicate :object})
-      (= (set (keys statement)) #{:subject :predicate :object :graph}))
-    (subject? (:subject statement))
-    (predicate? (:predicate statement))
-    (object? (:object statement))
-    (graph? (:graph statement))))
+  (or (triple? statement)
+      (quad? statement)))

 (defn statements?
   "Check that a vector contains valid Statements."
   [statements]
-  (comment TODO))
+  (and (or (set? statements) (vector? statements) (list? statements))
+       (every? statement? statements)))

 (defn- expand-predicate
   [predicate]
@@ -162,23 +185,3 @@
 (s/def ::statement (s/or ::triple ::quad))

 (s/def ::statements (s/coll-of ::statement))
-
-(defn subject
-  "Accepts a Statement tuple and returns the Subject."
-  [statement]
-  (get statement 0))
-
-(defn predicate
-  "Accepts a Statement tuple and returns the Predicate."
-  [statement]
-  (get statement 1))
-
-(defn object
-  "Accepts a Statement tuple and returns the Object."
-  [statement]
-  (get statement 2))
-
-(defn graph
-  "Accepts a Statement tuple and returns the Graph."
-  [statement]
-  (get statement 3))


reverse interleave continure

reverse interleave continure

--- src/4clojure/reverse_interleave.clj
+++ src/4clojure/reverse_interleave.clj
@@ -7,11 +7,21 @@

 (defn __ [coll n]
-;;   (partition-by #(mod % (inc n)) coll))
+  (partition-by #(mod % (inc n)) coll))

 ;; (mod 5 3)

-(map-indexed #(mod %1
+;; (nth [] 0)
+
+;; (map-indexed (fn [i a] (mod i 2)) [1 2 3 4 5 6])
+
+;; (reduce-kv
+
+;; (repeat 2 [])
+
+(conj (nth %1
+
+(reduce #(conj (nth %1 (mod ) (repeat 2 []) [1 2 3 4 5 6])

 (= (__ [1 2 3 4 5 6] 2) '((1 3 5) (2 4 6)))


(PDB-3611) Improve facts dedupe migration

- Use regular equality for join when populating facts_transform
- Batch value_hash updates

--- src/puppetlabs/puppetdb/scf/migrate.clj
+++ src/puppetlabs/puppetdb/scf/migrate.clj
@@ -60,7 +60,8 @@
             [puppetlabs.puppetdb.jdbc :as jdbc :refer [query-to-vec]]
             [puppetlabs.puppetdb.config :as conf]
             [puppetlabs.i18n.core :refer [trs]]
-            [puppetlabs.puppetdb.scf.hash :as hash]))
+            [puppetlabs.puppetdb.scf.hash :as hash])
+  (:import [org.postgresql.util PGobject]))

 (defn init-through-2-3-8
   []
@@ -1282,6 +1283,7 @@
      (str "ALTER TABLE ONLY edges"
           "  ADD CONSTRAINT edges_certname_source_target_type_unique_key"
           "  UNIQUE (certname, source, target, type)"))))
+
 (defn add-latest-report-timestamp-to-certnames []
   (jdbc/do-commands
     "DROP INDEX IF EXISTS idx_certnames_latest_report_timestamp"
@@ -1316,7 +1318,7 @@
       value_float double precision,
       value_string text,
       value_boolean boolean,
-      value jsonb
+      value jsonb not null
     );"

    "CREATE TABLE facts_transform (
@@ -1325,8 +1327,9 @@
        fact_value_id bigint NOT NULL
     );"

-   "INSERT INTO fact_values (value_type_id, value_integer, value_float, value_string, value_boolean, value)
-       SELECT distinct value_type_id, value_integer, value_float, value_string, value_boolean, value FROM facts"
+   "INSERT INTO fact_values (value, value_integer, value_float, value_string, value_boolean, value_type_id)
+       SELECT distinct value, value_integer, value_float, value_string, value_boolean, value_type_id FROM facts"
+

    "INSERT INTO facts_transform (factset_id, fact_path_id, fact_value_id)
        SELECT f.factset_id, f.fact_path_id, fv.id
@@ -1337,19 +1340,25 @@
                AND fv.value_float   IS NOT DISTINCT FROM f.value_float
                AND fv.value_string  IS NOT DISTINCT FROM f.value_string
                AND fv.value_boolean IS NOT DISTINCT FROM f.value_boolean
-               AND fv.value         IS NOT DISTINCT FROM f.value")
+               AND fv.value         = f.value")

   ;; populate fact_values.value_hash
   (jdbc/call-with-query-rows
    ["select id, value::text from fact_values"]
    (fn [rows]
-     (doseq [{:keys [id value] :as row} rows]
-       (jdbc/update! "fact_values"
-                     {:value_hash (-> value
-                                      json/parse
-                                      hash/generic-identity-hash
-                                      sutils/munge-hash-for-storage)}
-                     ["id=?" id]))))
+     (doseq [batch (partition-all 5000 rows)]
+       (let [ids (map :id rows)
+             hashes (map #(-> (:value %)
+                              json/parse
+                              hash/generic-identity-hash
+                              sutils/munge-hash-for-storage)
+                         rows)]
+         (jdbc/do-prepared
+          "update fact_values set value_hash = in_data.hash
+            from (select unnest(?) as id, unnest(?) as hash) in_data
+            where fact_values.id = in_data.id"
+          [(sutils/array-to-param "bigint" Long ids)
+           (sutils/array-to-param "bytea" PGobject hashes)])))))

   (jdbc/do-commands
    "DROP TABLE facts"


(PDB-4908) prune-daily-partitions: don't nest do-commands

Accidentally introduced by the refactoring related to lock-statuses
cf. f240694492b0bf783190cfdb5630ad1218400afa

Causes the normal periodic garbage collections to fail like this:

  ERROR puppetlabs.puppetdb.cli.services - Error while sweeping reports and resource events
  java.sql.BatchUpdateException: Batch entry 0 0 was aborted: ERROR: syntax error at or near "0"
    Position: 1  Call getNextException to see other errors in the batch.

The garbage collections at startup and those triggered by the admin
endpoint should be unaffected.

--- src/puppetlabs/puppetdb/scf/storage.clj
+++ src/puppetlabs/puppetdb/scf/storage.clj
@@ -1470,7 +1470,7 @@
                       (update-lock-status status-key dec))))
         drop #(if incremental?
                 (when (seq candidates)
-                  (jdbc/do-commands (drop-one (last candidates)))
+                  (drop-one (last candidates))
                   (when (> (bounded-count 3 candidates) 2)
                     (log/warn (trs "More than 2 partitions to prune: {0}"
                                    (pr-str (butlast candidates))))))


remove CORS for testing

remove CORS for testing

--- src/clj/swarmpit/handler_events.clj
+++ src/clj/swarmpit/handler_events.clj
@@ -14,7 +14,6 @@
     (with-channel request channel
                   (send! channel {:status  200
                                   :headers {"Content-Type"                "text/event-stream"
-                                            "Access-Control-Allow-Origin" "*"
                                             "Cache-Control"               "no-cache"
                                             "Connection"                  "keep-alive"}
                                   :body    ":ok\n\n"} false)
@@ -23,9 +22,9 @@
                                       (swap! channel-hub dissoc channel))))))

 (defmethod dispatch :event-push [_]
-  (fn [{:keys [params]}]
+  (fn [{:keys [params]} ]
     (if (some? params)
       (do
         (broadcast (str "data: " (generate-string params) "\n\n"))
         (resp-accepted (str "Broadcasted to " (count @channel-hub) " clients")))
-      (resp-error 400 "No data send"))))
+      (resp-error 400 "No data send"))))


We'll implement "control object" soon

We'll implement "control object" soon

--- src/cljs/asciinema_player/core.cljs
+++ src/cljs/asciinema_player/core.cljs
@@ -396,7 +396,7 @@
   [state dom-node]
   (let [dispatch (start-event-loop! state)]
     (reagent/render-component [view/player state dispatch] dom-node)
-    (clj->js {:toggle (fn [] true)})))
+    nil)) ; TODO: return JS object with control functions (play/pause) here

 (defn create-player
   "Creates the player with the state built from given options by starting event


Make phase text a link.

Make phase text a link.

--- src/cljs/onyx_cheat_sheet/core.cljs
+++ src/cljs/onyx_cheat_sheet/core.cljs
@@ -262,8 +262,7 @@
             :id (str (keyword-sanitize-? k))}
            (dom/pre #js {:className "key-header"}
                     (dom/a #js {:href (str "#" (name section) "/" (keyword-sanitize-? k))}
-                           (dom/i #js {:className "fa fa-link"}))
-                    (str "Phase: " (name k)))
+                           (str "Phase: " (name k))))
            (mapv (fn [task-state]
                    (dom/p #js {}
                           (g/grid {}


removed reflection

removed reflection

--- src/clojure/flambo/scalaInterop.clj
+++ src/clojure/flambo/scalaInterop.clj
@@ -84,7 +84,7 @@

 (defn some-or-nil [option]
   (when (instance? Some option)
-    (.get option)))
+    (.get ^Some option)))


Revert "Fix paredit on OS X"

Revert "Fix paredit on OS X"

This reverts commit 497ade8872c9ce64aac0e17c58fc5d33ca6862f7.

--- src/clojure/paredit_widget/core.clj
+++ src/clojure/paredit_widget/core.clj
@@ -24,7 +24,7 @@
                            :length (- (.getSelectionEnd widget)
                                       (.getSelectionStart widget))})))

-(defn insert-result!
+(defn insert-result
   [w pe]
   (dorun
     (map #(if (= 0 (:length %))
@@ -60,8 +60,8 @@
    [nil "{"] :paredit-open-curly
    [nil "}"] :paredit-close-curly
    [nil "\b"] :paredit-backward-delete
+   [nil "\""] :paredit-doublequote
    [nil "DEL"] :paredit-forward-delete
-   [nil "\""] :paredit-doublequote ;; \"
    ; ["C" "K"] :paredit-kill
    ["M" "("] :paredit-wrap-round
    ; ["M" ")"] :paredit-close-round-and-newline
@@ -69,20 +69,12 @@
    ["M" "r"] :paredit-raise-sexp
    ["C" "0"] :paredit-forward-slurp-sexp
    ["C" "9"] :paredit-backward-slurp-sexp
+   ["C" "Close Bracket"] :paredit-forward-barf-sexp
    ["C" "Open Bracket"] :paredit-backward-barf-sexp
-   ["C" "Close Bracket"] :paredit-forward-barf-sexp
    ["M" "S"] :paredit-split-sexp
    ["M" "J"] :paredit-join-sexps
-   ["M" "Left"] :paredit-expand-left
-   ["M" "Right"] :paredit-expand-right})
-
-(def ^:const advanced-alternate-keymap
-  {[nil "⌫"] :paredit-backward-delete
-   [nil "⌦"] :paredit-forward-delete
-   ["C" "["] :paredit-backward-barf-sexp
-   ["C" "]"] :paredit-forward-barf-sexp
-   ["M" "←"] :paredit-expand-left
-   ["M" "→"] :paredit-expand-right})
+   ["M" "Right"] :paredit-expand-right
+   ["M" "Left"] :paredit-expand-left})

 (def ^:const foreign-keymap
   {["M" "["] :paredit-open-square
@@ -90,29 +82,20 @@
    ["M" "{"] :paredit-open-curly
    ["M" "}"] :paredit-close-curly})

-(def ^:const special-codes
-  #{KeyEvent/VK_LEFT_PARENTHESIS
-    KeyEvent/VK_RIGHT_PARENTHESIS
-    KeyEvent/VK_OPEN_BRACKET
-    KeyEvent/VK_CLOSE_BRACKET
-    KeyEvent/VK_BRACELEFT
-    KeyEvent/VK_BRACERIGHT
-    KeyEvent/VK_BACK_SPACE
-    KeyEvent/VK_DELETE
-    KeyEvent/VK_QUOTEDBL
-    KeyEvent/VK_LEFT
-    KeyEvent/VK_RIGHT})
-
-(defn exec-paredit!
+(defn exec-paredit
   [k w buffer enable-default? enable-advanced?]
   (when-let [cmd (or (and enable-default?
                           (default-keymap k))
                      (and @enable-advanced?
                           (or (advanced-keymap k)
-                              (advanced-alternate-keymap k)
                               (foreign-keymap k))))]
-    (insert-result! w (exec-command cmd w buffer))
+    (let [result (exec-command cmd w buffer)]
+      (insert-result w result))
     cmd))
+
+(defn convert-input-method-event
+  [event]
+  ["M" (os-x-charmap (str (.first (.getText event))))])

 (defn convert-key-event
   [event]
@@ -123,7 +106,7 @@
        (.isAltDown event) "M"
        (.isControlDown event) "C"
        :else nil)
-     (if (special-codes key-code)
+     (if (= KeyEvent/CHAR_UNDEFINED key-char)
        (KeyEvent/getKeyText key-code)
        (str key-char))]))

@@ -132,24 +115,22 @@
   (reify KeyListener
     (keyReleased [this e] nil)
     (keyTyped [this e]
-      (when (and @enable-advanced? (special-codes (.getKeyCode e)))
+      (when (and @enable-advanced?
+                 (get #{"(" ")" "[" "]" "{" "}" "\""}
+                      (str (.getKeyChar e))))
         (.consume e)))
     (keyPressed [this e]
       (when-not (.isConsumed e)
         (let [k (convert-key-event e)
-              p (exec-paredit! k w buffer enable-default? enable-advanced?)]
+              p (exec-paredit k w buffer enable-default? enable-advanced?)]
           (when p (.consume e)))))))
-
-(defn convert-input-method-event
-  [event]
-  ["M" (os-x-charmap (str (.first (.getText event))))])

 (defn input-method-event-handler
   [w buffer enable-default? enable-advanced?]
   (reify InputMethodListener
     (inputMethodTextChanged [this e]
       (let [k (convert-input-method-event e)
-            p (exec-paredit! k w buffer enable-default? enable-advanced?)]
+            p (exec-paredit k w buffer enable-default? enable-advanced?)]
         (when p (.consume e))))))

 (defn init-paredit!


Add random-bytes to compute nonce

Add random-bytes to compute nonce

--- src/clojure_fabric/crypto_suite.clj
+++ src/clojure_fabric/crypto_suite.clj
@@ -37,6 +37,15 @@

 ;; Add provider!
 (Security/addProvider (BouncyCastleProvider.))
+
+;;;
+;;; Utility functions
+;;;
+(defn random-bytes
+  [numbytes]
+  (let [rbytes (byte-array numbytes)]
+    (.nextBytes (SecureRandom.) rbytes)
+    rbytes))

 ;;;
 ;;; Interface


using apply-

using apply-

--- src/com/narkisr/celestial/tasks.clj
+++ src/com/narkisr/celestial/tasks.clj
@@ -22,7 +22,7 @@
     (assert (= (.status ct) "running"))))

 (defn puppetize [{:keys [server module]}]
-  (.apply (Standalone. server module)))
+  (.apply- (Standalone. server module)))

 (defn -main [t spec & args]
   (let [{:keys [system provision]} (slurp-edn spec)]


tests are working as expected

tests are working as expected

--- test/metabase_init/core_test.clj
+++ test/metabase_init/core_test.clj
@@ -4,5 +4,3 @@

 ;; Basic sanity check
 (expect 2 (+ 1 1))
-
-(expect false)


Use Compiler/munge in `protocol-forwarder`.

--- systems/core/src/containium/systems.clj
+++ systems/core/src/containium/systems.clj
@@ -3,7 +3,8 @@
 ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.

 (ns containium.systems
-  "Logic for starting and stopping systems.")
+  "Logic for starting and stopping systems."
+  (:import [clojure.lang Compiler]))

 (defprotocol Startable
@@ -99,5 +100,5 @@
                  :let [{:keys [name arglists]} (val sig)]
                  arglist arglists]
              `(~name ~arglist (. ~impl
-                                 ~(symbol (.replaceAll (str name) "-" "_"))
+                                 ~(symbol (Compiler/munge (str name)))
                                  ~@(rest arglist))))))))


bring in tests

bring in tests

--- test/infinitelives/test.cljs
+++ test/infinitelives/test.cljs
@@ -1,7 +1,8 @@
 (ns infinitelives.test
   (:require [cljs.test :refer-macros [run-all-tests]]
             [infinitelives.utils.vec2-test]
-            [infinitelives.utils.events-test]))
+            [infinitelives.utils.events-test]
+            [infinitelives.utils.string-test]))

 (enable-console-print!)


Add filter on MAPQ

Add filter on MAPQ

--- services/make-maps.clj
+++ services/make-maps.clj
@@ -36,10 +36,14 @@
                         (-> (rec 3) Integer/parseInt dec)
                         (count (rec 9))]
                        rl (r :len)]
+                   ;; Some magic numbers in following BUG!
                    (cond
                      (empty? r)
                      (vswap!
                       rv (fn[r] (assoc r :cnt cnt :std std :pos pos :len len)))
+
+                     (< (Integer/parseInt (rec 4)) 8)
+                     :nop ; MAPQ doesn't pass muster, throw this one away

                      (and (not= r {})(< (Math/abs (- pos (r :pos))) 3)
                           (= (r :std) std))
@@ -49,8 +53,8 @@
                                   :cnt (+ (r :cnt) cnt)
                                   :len (if (> len rl) len rl))))
                      :else
-                     (let [l (str/join #"\t" [(r :cnt) (r :std)
-                                              (r :pos) (r :len)])]
+                     (let [l (str/join "\t" [(r :cnt) (r :std)
+                                             (r :pos) (r :len)])]
                        (vswap!
                         rv (fn[r] (assoc r :cnt cnt :std std :pos pos :len len)))
                        (.write ot l)


Test to see if all client routes are handled

--- test-cljs/book_sorter/routing_test.cljs
+++ test-cljs/book_sorter/routing_test.cljs
@@ -1,6 +1,7 @@
 (ns book-sorter.routing-test
   (:require [book-sorter.routing :as r]
-            [cljs.test :refer-macros [deftest is testing run-tests]]))
+            [cljs.test :refer-macros [deftest is testing run-tests]]
+            [book-sorter.urls :as u]))

 (deftest test-urls
   (let [test-urls
@@ -40,3 +41,7 @@
                                    [(str i) "foo"]))}]
       (is (= (r/split-url url) split))
       (is (= (r/split-url (r/combine-url split)) split)))))
+
+(deftest test-routes
+  (is (= (disj (set (keys (methods r/handle-route))) :default)
+         (set (map :handler (b/route-seq u/client-routes))))))


Cleanup in elements

Cleanup in elements

--- src/main/untangled/ui/elements.cljc
+++ src/main/untangled/ui/elements.cljc
@@ -206,7 +206,7 @@
                         (contains? legal-sizes size) (str " c-icon--" (name size)))
          props        (-> props
                         (assoc :className classes)
-                        (dissoc :size :color))]
+                        (dissoc :size :color :glyph))]
      (dom/span (clj->js props) (if glyph
                                  (icon glyph)
                                  child)))))
@@ -324,7 +324,8 @@

 (defn ui-card
   "Card component
-   usage
+
+   Usage
    (c/ui-card {:title          \"Some Title\"
                :color          :primary | :accent
                :type           :bordered | :transparent | :square
@@ -380,17 +381,23 @@
       (when actions
         (dom/div #js {:className "c-card__actions"} actions))
       ;; TODO
-      #_(when menu-icon
+      #_(when menu-items
         (dom/div #js {:className "c-card__menu"}
-          (menu/menu :a (icon menu-icon) menu-items))))))
+          (menu/menu :a
+            (icon (if menu-icon menu-icon :more_vert))
+            menu-items))))))

 (defn ui-icon-bar
-  "Render an icon bar giving using a vector of icons (each a map of attributes).
-   Can optionally be render vertically ond/or shifting.
+  "Render an icon bar using a vector of icons (each a map of attributes).
+   Can optionally render vertically and/or shifting.
    Normal HTML/React attributes can be included, and should be a cljs map (not a js object).

-  orientation (optional): :vertical or :horizontal (default)
-  shifting (optional): :true"
+   Usage
+   (c/ui-icon-bar {:orientation  :vertical or :horizontal (default)
+                   :shifting     :true
+   ...)
+   all parameters are optional
+   "
   [{:keys [className orientation shifting] :as props :or {className ""}} & children]
   (let [user-classes    (get props :className "")
         top-level-class (cond-> (str user-classes " o-iconbar")
@@ -398,3 +405,4 @@
                           (= shifting :true) (str " o-iconbar--shifting"))]
     (dom/div #js {}
       (apply dom/nav #js {:className top-level-class} children))))
+


Send 'Accept-Charset: utf-8' with pepa.api/xhr-request!.

--- src-cljs/pepa/api.cljs
+++ src-cljs/pepa/api.cljs
@@ -34,7 +34,7 @@
      :successful? (.isSuccess xhr)})))

-;;; HACK: Because the current release of Google Closure doens't
+;;; HACK: Because the current release of Google Closure doesn't
 ;;; include support for the 'progress' event of Xhr, we have to attach
 ;;; events to the underlying native object. But we have to do this
 ;;; *before* Closure calls .open() on the object or else we won't
@@ -81,7 +81,8 @@
                   (transit/write writer data)
                   data)
                 (clj->js
-                 (merge {"Accept" "application/transit+json"}
+                 (merge {"Accept" "application/transit+json"
+                         "Accept-Charset" "utf-8"}
                         (when data {"Content-Type" (when data content-type)}))) )))
      ch))
   ([uri method content-type data]


Fix file name.

Fix file name.

--- test/onyx/scheduler/colocation_test.clj
+++ test/onyx/scheduler/colocation_test.clj
@@ -1,4 +1,4 @@
-(ns onyx.scheduler.colocation-task
+(ns onyx.scheduler.colocation-test
   (:require [clojure.test :refer :all]
             [onyx.scheduling.common-job-scheduler :refer [reconfigure-cluster-workload]]
             [onyx.api]))


added build-list for lists

added build-list for lists

--- src/untangled/component.cljs
+++ src/untangled/component.cljs
@@ -3,7 +3,8 @@
   (:require
     [untangled.state]
     [quiescent.dom :as d]
-    [quiescent.core :include-macros true]))
+    [quiescent.core :include-macros true]
+    [untangled.state :as state]))

 ; You can use quiescent.dom directly, but these helpers make IntelliJ work better (otherwise they show up as undefined
 ; because a macro makes them
@@ -127,3 +128,34 @@
 (defn svg [attrs & children] (apply d/svg attrs children))
 (defn text [attrs & children] (apply d/text attrs children))

+(defn build-list
+  "Build out a rendered list.
+
+  Named Parameters
+  `state`: The state of your component (typically the one you are in now)
+  `renderer`: The Render function generated by defscomponent
+  `list-key`: The key (within component-with-list) of the vector of object state
+  `item-key`: The key within each object that holds that object's unique key
+  `event-listeners`: A map, keyed by events whose values are functions which take a list item's data and returns a function that will be called when that event is triggered by that item's UI.
+  `filter`: A function that takes an item, and returns true to include it, false to not include it
+  TODO: `sort-by` : A function that takes two items and otherwise works just like Clojure compare (-1 < 0 < 1)
+
+  "
+  [& {:keys [state renderer list-key item-key filter-fn event-listeners]}]
+  (assert state "component data is required.")
+  (assert renderer "renderer is required.")
+  (assert list-key "list-key is required.")
+  (assert item-key "item-key is required.")
+  (let [items (get state list-key)
+        events (keys event-listeners)
+        listener-ctor (fn [evt item] ((get event-listeners evt) item))
+        item-listeners (fn [item] (into {} (cljs.core/map (fn [e] (vector e (listener-ctor e item))) events)))]
+    (keep-indexed (fn [idx item]
+                    (if (and filter-fn (filter-fn item))
+                      (let [args (cond-> [(state/list-element-id state list-key item-key idx) state]
+                                         event-listeners (concat [:event-listeners (item-listeners item)]))]
+                        (apply renderer args))
+                      nil
+                      ))
+                  items)
+    ))


Read AWS credentials from environment variables.

If the credentials are not set in the configuration file, bifrost will
look for credentials in the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
environment variables.

These are the same environment variables used by the AWS SDKs as of July 2014.
(http://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs)

--- src/uswitch/bifrost/main.clj
+++ src/uswitch/bifrost/main.clj
@@ -17,15 +17,24 @@
     :validate [string?]]
    ["-h" "--help"]])

+(defn credentials
+  [config]
+  (let [{{:keys [access-key secret-key]
+          :or {access-key (System/getenv "AWS_ACCESS_KEY_ID")
+               secret-key (System/getenv "AWS_SECRET_ACCESS_KEY")}} :credentials} config]
+    (update-in config [:credentials]
+               assoc :access-key access-key :secret-key secret-key)))
+
 (defn -main [& args]
   (let [{:keys [options summary]} (parse-opts args cli-options)]
     (when (:help options)
       (println summary)
       (System/exit 0))
-    (let [{:keys [config]} options]
+    (let [{:keys [config]} options
+          config (-> config slurp read-string credentials)]
       (info "Bifrost" (current-version))
       (when (current-build-number)
         (gauge "build-number" (current-build-number)))
       (info "Starting Bifrost with config" config)
-      (start (make-system (read-string (slurp config))))
+      (start (make-system config))
       (wait!))))


Update easy.cljs

Update easy.cljs

--- modules/reitit-frontend/src/reitit/frontend/easy.cljs
+++ modules/reitit-frontend/src/reitit/frontend/easy.cljs
@@ -6,13 +6,15 @@

 (defonce history (atom nil))

-;; Doc-strings from reitit.frontend.history
-;; remember to update both!
+;; Doc-strings from reitit.frontend.history remember to update both!
+;; Differences:
+;; This one automatically removes previous event listeners.

 (defn start!
   "This registers event listeners on HTML5 history and hashchange events.
-  When using with development workflow like Figwheel, rememeber to
-  remove listeners using stop! call before calling start! again.
+
+  Automatically removes previous event listeners so it is safe to call this repeatedly, for example when using
+  Figwheel or similar development workflow.

   Parameters:
   - router         The Reitit router.


wishlist-title cljs

wishlist-title cljs

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -25,3 +25,6 @@
       (wish-li wish))
     (wish-li-last)])

+(defpartial wishlist-title [title]
+  [:input {:type "text" :class "title"}])
+


Store uid is session

Store uid is session

--- src/word_keeper/frontend.clj
+++ src/word_keeper/frontend.clj
@@ -29,7 +29,8 @@
           (create-twitter-user! (Integer/parseInt user_id)  screen_name))
         {:status 200
          :headers {"Content-Type" "text/plain"}
-         :body (str "Signed in as " screen_name)})
+         :body (str "Signed in as " screen_name)
+         :session (assoc (:session req) :uid (:uid (find-twitter-user (Integer/parseInt user_id))))})
       {:status 200
        :headers {"Content-Type" "text/plain"}
        :body ("Something went wrong")})))


Hotfix. user-data

Hotfix. user-data

--- src/word_keeper/frontend.clj
+++ src/word_keeper/frontend.clj
@@ -18,15 +18,15 @@
      :headers {"location" dest-uri}}))

 (defn action-signin [req]
-  (let [{:keys [user_id screen_name]} (authorize (-> req :session :request-token)
+  (let [user-data (authorize (-> req :session :request-token)
                                                  (-> req :params :oauth_verifier))]
     (if (contains? user-data :user_id)
       (do
-        (if (nil? (find-twitter-user user_id))
-          (create-twitter-user user_id screen_name))
+        (if (nil? (find-twitter-user (:user_id user-data)))
+          (create-twitter-user (:user_id user-data) (:screen_name user-data)))
         {:status 200
          :headers {"Content-Type" "text/plain"}
-         :body (str "Signed in as " screen_name)})
+         :body (str "Signed in as " (:screen_name user-data))})
       {:status 200
        :headers {"Content-Type" "text/plain"}
        :body ("Something went wrong")})))


Add utils fns for constructing the ast

Add utils fns for constructing the ast

--- src/aurora/interpreter.cljs
+++ src/aurora/interpreter.cljs
@@ -1,4 +1,6 @@
 (ns aurora.interpreter)
+
+;; interpreter

 (defn run-pipe [program node inputs actions]
   (let [vars #js {}]
@@ -23,7 +25,7 @@
 (defn run-ref [program node inputs actions]
   (case (:kind node)
     :cljs (apply (:fn node) inputs)
-    :aurora (run-node program (get program (:id node)) inputs actions)))
+    :pipe (run-node program (get program (:id node)) inputs actions)))

 (defrecord MatchFailure [])

@@ -61,66 +63,65 @@
                      (run-match-pattern program val (get input key) actions vars)))
    :otherwise (assert false)))

+;; ast
+
+(defn pipe [inputs & nodes]
+  {:type :pipe
+   :inputs inputs
+   :nodes (for [[id inputs node] (partition 3 nodes)]
+            {:id id :inputs inputs :node node})})
+
+(defn value [x]
+  {:type :value :value x})
+
+(defn cljs-ref [fn]
+  {:type :ref :kind :cljs :fn fn})
+
+(defn pipe-ref [id]
+  {:type :ref :kind :pipe :id id})
+
+(defn match [& branches]
+  {:type :match
+   :branches (for [[pattern inputs node] (partition 3 branches)]
+               {:pattern pattern :inputs inputs :node node})})
+
 (defn bind [var pattern]
   {:type :match/bind
    :var var
    :pattern pattern})

+;; examples
+
 (def example-a
-  {"root" {:type :pipe
-           :inputs ["a" "b" "c"]
-           :nodes [{:id "b-squared" :inputs ["b" "b"] :node {:type :ref :kind :cljs :name *}}
-                   {:id "four" :inputs [] :node {:type :value :value 4}}
-                   {:id "four-a-c" :inputs ["four" "a" "c"] :node {:type :ref :kind :cljs :fn *}}
-                   {:id "result" :inputs ["b-squared" "four-a-c"] :node {:type :ref :kind :cljs :fn -}}]}})
+  {"root" (pipe ["a" "b" "c"]
+                "b-squared" ["b" "b"] (cljs-ref *)
+                "four" [] (value 4)
+                "four-a-c" ["four" "a" "c"] (cljs-ref *)
+                "result" ["b-squared" "four-a-c"] (cljs-ref -))})

 (def example-b
-  {"root" {:type :pipe
-           :inputs ["x"]
-           :nodes [{:id "result"
-                    :inputs ["x"]
-                    :node {:type :match
-                           :branches [{:pattern {"a" (bind "a" {:type :ref :kind :cljs :fn number?}) "b" (bind "b" {:type :ref :kind :cljs :fn number?})}
-                                       :inputs ["a" "b"]
-                                       :node {:type :ref :kind :cljs :fn -}}
-                                      {:pattern [(bind "x" {:type :value :value true}) "foo"]
-                                       :inputs ["x" "y"]
-                                       :node {:type :ref :kind :cljs :fn identity}}]}}]}})
+  {"root" (pipe ["x"]
+                "result" ["x"] (match {"a" (bind "a" (cljs-ref number?)) "b" (bind "b" (cljs-ref number?))} ["a" "b"] (cljs-ref -)
+                                      [(bind "x" (value true)) "foo"] ["x"] (cljs-ref identity)))})

 (def example-c
-  {"root" {:type :ref :kind :aurora :id "even?"}
-   "even?" {:type :pipe
-            :inputs ["x"]
-            :nodes [{:id "result"
-                     :inputs ["x"]
-                     :node {:type :match
-                            :branches [{:pattern 0
-                                        :inputs []
-                                        :node {:type :value :value true}}
-                                       {:pattern (bind "x" {:type :value :value true})
-                                        :inputs ["x"]
-                                        :node {:type :ref :kind :aurora :id "even?not-0"}}]}}]}
-   "even?not-0" {:type :pipe
-                 :inputs ["x"]
-                 :nodes [{:id "one" :inputs [] :node {:type :value :value 1}}
-                         {:id "x-1" :inputs ["x" "one"] :node {:type :ref :kind :cljs :fn -}}
-                         {:id "result" :inputs ["x-1"] :node {:type :ref :kind :aurora :id "odd?"}}]}
-   "odd?" {:type :pipe
-           :inputs ["x"]
-           :nodes [{:id "result"
-                    :inputs ["x"]
-                    :node {:type :match
-                           :branches [{:pattern 0
-                                       :inputs []
-                                       :node {:type :value :value false}}
-                                      {:pattern (bind "x" {:type :value :value true})
-                                       :inputs ["x"]
-                                       :node {:type :ref :kind :aurora :id "odd?not-0"}}]}}]}
-   "odd?not-0" {:type :pipe
-                :inputs ["x"]
-                :nodes [{:id "one" :inputs [] :node {:type :value :value 1}}
-                        {:id "x-1" :inputs ["x" "one"] :node {:type :ref :kind :cljs :fn -}}
-                        {:id "result" :inputs ["x-1"] :node {:type :ref :kind :aurora :id "even?"}}]}})
+  {"root" (pipe-ref "even?")
+   "even?" (pipe ["x"]
+                 "result" ["x"] (match 0 [] (value true)
+                                       (bind "x" (value true)) ["x"] (pipe-ref "even?not-0")))
+   "even?not-0" (pipe ["x"]
+                      "one" [] (value 1)
+                      "x-1" ["x" "one"] (cljs-ref -)
+                      "odd?" ["x-1"] (pipe-ref "odd?")
+                      "result" ["odd?"] (cljs-ref not))
+   "odd?" (pipe ["x"]
+                "result" ["x"] (match 0 [] (value true)
+                                      (bind "x" (value true)) ["x"] (pipe-ref "odd?not-0")))
+   "odd?not-0" (pipe ["x"]
+                     "one" [] (value 1)
+                     "x-1" ["x" "one"] (cljs-ref -)
+                     "even?" ["x-1"] (pipe-ref "even?")
+                     "result" ["even?"] (cljs-ref not))})

 (defn run-example [example inputs]
   (try


get-married=>human; sit-down=>animate; worry=>human

--- src/babel/encyclopedia.cljc
+++ src/babel/encyclopedia.cljc
@@ -410,6 +410,9 @@
         {:pred :get-dressed
          :subj {:human true}}

+        {:pred :get-married
+         :subj {:human true}}
+
         {:pred :get-off
          :subj {:animate true}}

@@ -484,6 +487,9 @@

         {:pred :sigh
          :subj {:human true}}
+
+        {:pred :sit-down
+         :subj {:animate true}}

         {:pred :sleep
          :subj {:animate true}}
@@ -579,6 +585,9 @@
         {:pred :work-nonhuman
          :subj {:human false}}

+        {:pred :worry
+         :subj {:human true}}
+
         {:pred :yell
          :subj {:human true}}]))


Use private namespace keywords for state key and subs

--- src/braid/notices/core.cljc
+++ src/braid/notices/core.cljc
@@ -31,27 +31,27 @@
                "NOTICE"]]))

        (core/register-state!
-         {:errors {}}
-         {:errors {keyword? ErrorSpec}})
+         {::state {}}
+         {::state {keyword? ErrorSpec}})

        (core/register-subs!
-         {:errors
+         {::sub
           (fn [state _]
-            (vals (state :errors)))})
+            (vals (state ::state)))})

        (core/register-events!
          {:braid.notices/remove-message-errors!
           (fn [{db :db} [_ msg-ids]]
-            {:db (update db :errors (fn [errors]
+            {:db (update db ::state (fn [errors]
                                       (apply dissoc errors msg-ids)))})

           :clear-error
           (fn [{db :db} [_ err-key]]
-            {:db (update db :errors dissoc err-key)})
+            {:db (update db ::state dissoc err-key)})

           :display-error
           (fn [{db :db} [_ [err-key message error-class]]]
-            {:db (update db :errors assoc err-key {:key err-key
+            {:db (update db ::state assoc err-key {:key err-key
                                                    :message message
                                                    :class error-class})})})

@@ -59,7 +59,7 @@
          (fn []
            [:div.error-banners
             (doall
-              (for [{:keys [key message class]} @(subscribe [:errors])]
+              (for [{:keys [key message class]} @(subscribe [::sub])]
                 ^{:key key}
                 [:div.error-banner
                  {:class class}


Add bot user to the group its in on creation

--- src/braid/server/db/bot.clj
+++ src/braid/server/db/bot.clj
@@ -62,6 +62,18 @@
             (db/db) bot-pull-pattern group-id)
        (into #{} (map db->bot))))

+(defn bots-for-message
+  "Get all bots in the given group that are subscribed to all messages"
+  [group-id]
+  (->> (d/q '[:find [(pull ?b pull-pattern) ...]
+              :in $ pull-pattern ?group-id
+              :where
+              [?b :bot/notify-all-messages true]
+              [?g :group/id ?group-id]
+              [?b :bot/group ?g]]
+            (db/db) bot-pull-pattern group-id)
+       (into #{} (map db->bot))))
+
 ;; Transactions

 (defn create-bot-txn
@@ -73,7 +85,8 @@
         bot-id (d/tempid :entities)]
     [{:db/id fake-user-id
       :user/id (d/squuid)
-      :user/is-bot? true}
+      :user/is-bot? true
+      :group/_user [:group/id group-id]}
      (with-meta
        (merge
          {:db/id bot-id


Parsing GitLab data

Parsing GitLab data

--- src/branch_handler/core.clj
+++ src/branch_handler/core.clj
@@ -36,6 +36,54 @@
     (-> (http-response/response response-text)
         (http-response/content-type "text/html")))

+(defn parse-gitlab-info
+    [request]
+    (let [body (read-request-body request)]
+        (if body
+            (json/read-str body :key-fn clojure.core/keyword))))
+
+(def empty-SHA "0000000000000000000000000000000000000000")
+
+(defn get-operation
+    [before after]
+    (if (= before empty-SHA)
+        (if (= after empty-SHA)
+            :unknown
+            :branch-created)
+        (if (= after empty-SHA)
+            :branch-deleted
+            :branch-updated)))
+
+(defn get-branch
+    [git-ref]
+    (try
+        (subs git-ref (inc (.lastIndexOf git-ref "/")))
+        (catch Exception e
+            nil)))
+
+(defn api-call-handler
+    [request]
+    (let [gitlab-info (parse-gitlab-info request)
+          repository-url   (-> gitlab-info :repository :url)
+          repository-name  (-> gitlab-info :repository :name)
+          repository-group (-> gitlab-info :project :namespace)
+          branch           (get-branch (-> gitlab-info :ref))
+          before           (-> gitlab-info :before)
+          after            (-> gitlab-info :after)
+          operation        (get-operation before after)]
+        (if verbose
+            (clojure.pprint/pprint gitlab-info))
+        (log/info "repository" repository-name)
+        (log/info "URL"        repository-url)
+        (log/info "group"      repository-group)
+        (log/info "branch"     branch)
+        (log/info "before"     before)
+        (log/info "after"      after)
+        (log/info "operation"  operation)
+        ))
+
+
+
 (defn http-request-handler
     "Handler that is called by Ring for all requests received from user(s)."
     [request]


Version update

Version update

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp.clj
+++ src/conexp.clj
@@ -16,7 +16,7 @@

 (def *conexp-version* {:major 0,
 		       :minor 1,
-		       :timestamp 1260608018834,
+		       :timestamp 1260608414460,
 		       :qualifier "pre-alpha"})

 (defn conexp-version


indexes, more indexes

indexes, more indexes

--- src/clj/ceres/collector.clj
+++ src/clj/ceres/collector.clj
@@ -45,6 +45,7 @@
     (mc/ensure-index @db "origins" (array-map :ts 1))
     (mc/ensure-index @db "origins" (array-map :source 1))
     (mc/ensure-index @db "origins" (array-map :tweet 1))
+    (mc/ensure-index @db "origins" (array-map :article 1 :source 1))
     (mc/ensure-index @db "publications" (array-map :tweet 1))
     (mc/ensure-index @db "publications" (array-map :user 1))
     (mc/ensure-index @db "publications" (array-map :ts 1))
@@ -505,29 +506,21 @@

   ;; store mentions
   (time
-   (doall
-    (pmap
-     (fn [{:keys [_id tweet]}]
-       (let [{{:keys [user_mentions]} :entities} (mc/find-map-by-id @db "tweets" tweet)]
-         (pmap
-          (fn [{:keys [id]}]
-            (let [uid (:_id (mc/find-one-as-map @db "users" {:id id}))]
-              (if uid
-                (store-mention uid _id)
-                nil)))
-          user_mentions)))
-     (mc/find-maps @db "publications"))))
-
-
-  (->> (mc/find-maps @db "publications")
-       (map :hashtags)
-       flatten
-       (into #{})
-       second
-       (mc/find-map-by-id @db "hashtags")
-       aprint)
-
-
+   (do
+     (say/say "Computation started")
+     (doall
+      (pmap
+       (fn [{:keys [_id tweet]}]
+         (let [{{:keys [user_mentions]} :entities} (mc/find-map-by-id @db "tweets" tweet)]
+           (pmap
+            (fn [{:keys [id]}]
+              (let [uid (:_id (mc/find-one-as-map @db "users" {:id id}))]
+                (if uid
+                  (store-mention uid _id)
+                  nil)))
+            user_mentions)))
+       (mc/find-maps @db "publications")))
+     (say/say "Computation completed")))

 )


fix missed Rhino REPL regression, the surrounding REPL infrastructure creates cljs.user for us

--- src/clj/cljs/repl/rhino.clj
+++ src/clj/cljs/repl/rhino.clj
@@ -121,8 +121,6 @@
     (ScriptableObject/putProperty scope "__repl_opts"
       (Context/javaToJS opts scope))
     (repl/load-file repl-env "cljs/core.cljs" opts)
-    (repl/evaluate-form repl-env env "<cljs repl>"
-      '(ns cljs.user))
     (ScriptableObject/putProperty scope
       "out" (Context/javaToJS *out* scope))
     (binding [ana/*cljs-ns* 'cljs.core]


remove reference to deprecated uuid

remove reference to deprecated uuid

--- src/cljs/dato/lib/core.cljs
+++ src/cljs/dato/lib/core.cljs
@@ -101,9 +101,8 @@
                                                      (cb reply)
                                                      (when (:event reply)
                                                        (put! dato-ch reply)))))
-                                 (if (chan? cb-or-ch)
-                                   cb-or-ch
-                                   uuid))))]
+                                 (when (chan? cb-or-ch)
+                                   cb-or-ch))))]
     {:comms    comms
      ;; Just for debugging to simulate messages coming in from the
      ;; server


Fix to call create-or-update-channel-from-nodes

--- src/clojure_fabric/user.clj
+++ src/clojure_fabric/user.clj
@@ -353,8 +353,7 @@
                             (:private-key user)
                             {:algorithm (:key-algorithm (:crypto-suite user))})
          (proto/make-config-signature :signature-header signature-header
-                                      :signature)
-         (proto/clj->proto))))
+                                      :signature))))

 (defn create-or-update-channel-from-nodes
   [orderer peers config-update]
@@ -362,34 +361,28 @@
   (create-or-update-channel orderer
                             config-update
                             (mapv (fn [node]
-                                    (make-config-signature node config-update))
+                                    (make-config-signature node config-update {}))
                                   (conj peers orderer))))
-
-;; (create-or-update-channel-using-tx-file u1 "" 1 1 "/home/jc/Work/clojure-fabric/resources/fixture/balance-transfer/artifacts/channel/mychannel.tx")
-(comment
-  ;; Test
-  (defn create-or-update-channel-using-envelope
-    [user channel-name orderer participating-peers proto-envelope]
-    (let [clj-envelope (proto/proto->clj proto-envelope
-                                         {:payload {:data {:fn #(Configtx$ConfigUpdateEnvelope/parseFrom ^ByteString %)
-                                                           :config-update {:fn #(Configtx$ConfigUpdate/parseFrom ^ByteString %)}}}})
-          clj-config-update (get-in clj-envelope [:payload :data :config-update])
-          proto-config-update (proto/clj->proto clj-config-update)]
-
-      clj-envelope
-      ))
-  (defonce max-tx-file-size 1024)
-  (defn create-or-update-channel-using-tx-file
-    [user channel-name orderer participating-peers tx-filename]
+(defonce max-tx-file-size 1024)
+(defn tx-file->config-update
+    [tx-filename]
     (let [tx-file (io/as-file tx-filename)]
       (assert (<= (.length tx-file) max-tx-file-size))
-      (->> (with-open [in (io/input-stream tx-file)
-                       out (java.io.ByteArrayOutputStream.)]
-             (io/copy in out)
-             (Common$Envelope/parseFrom (.toByteArray out)))
-           (create-or-update-channel-using-envelope user channel-name orderer participating-peers)))))
-
-;;(create-or-update-channel-using-file 1 1 1 "/home/jc/Work/clojure-fabric/resources/fixture/balance-transfer/artifacts/channel/mychannel.tx")
+      (let [envelope (->> (with-open [in (io/input-stream tx-file)
+                                      out (java.io.ByteArrayOutputStream.)]
+                            (io/copy in out)
+                            (Common$Envelope/parseFrom (.toByteArray out))))]
+        (-> (proto/proto->clj envelope
+                              {:payload {:data {:fn #(Configtx$ConfigUpdateEnvelope/parseFrom ^ByteString %)
+                                                :config-update {:fn #(Configtx$ConfigUpdate/parseFrom ^ByteString %)}}}})
+            (get-in [:payload :data :config-update])
+            (proto/clj->proto)
+            (.toByteArray)))))
+
+;;(tx-file->config-update "/home/jc/Work/clojure-fabric/resources/fixture/balance-transfer/artifacts/channel/mychannel.tx")
+;; (create-or-update-channel-from-nodes (get @core/users  ["Orderer" "admin"])
+;;       [(get @core/users  ["Org1MSP" "admin"]) (get @core/users  ["Org2MSP" "admin"])]
+;;      cu)

 (defn create-channel
   ([channel-name orderer opts]


fixed naming conflicts

fixed naming conflicts

--- src/commie_qotw/actions.clj
+++ src/commie_qotw/actions.clj
@@ -158,7 +158,7 @@
         (select :quote)
         (where [:= :week_id cur-week-id]))))

-(defn submissions []
+(defn get-submissions []
   (-> (get-submissions-map)
       db/query
       :result
@@ -168,7 +168,7 @@
   (-> (select :email)
       (from :users)))

-(defn admins []
+(defn get-admins []
   (-> (get-admins-map)
       db/query
       :result
@@ -180,6 +180,6 @@
       (where [:= :users.email email])))

 (defn rm-user [email]
-  (-> (rm-user-map email)
+  (-> (rm-sessions-map email)
       db/query
       response))


Review comment: use datomish.api where possible.

--- src/common/datomish/js.cljs
+++ src/common/datomish/js.cljs
@@ -12,6 +12,7 @@
      [cljs.reader]
      [cljs-promises.core :refer [promise]]
      [datomish.cljify :refer [cljify]]
+     [datomish.api :as d]
      [datomish.db :as db]
      [datomish.db-factory :as db-factory]
      [datomish.pair-chan]
@@ -24,14 +25,13 @@

 ;; Public API.

-(defn ^:export db [conn]
-  (transact/db conn))
+(def ^:export db d/db)

 (defn ^:export q [db find options]
   (let [find (cljs.reader/read-string find)
         opts (cljify options)]
     (take-pair-as-promise!
-      (db/<?q db find opts)
+      (d/<q db find opts)
       clj->js)))

 (defn ^:export ensure-schema [conn simple-schema]
@@ -39,7 +39,7 @@
         datoms (simple-schema/simple-schema->schema simple-schema)]
     (println "Transacting schema datoms" (pr-str datoms))
     (take-pair-as-promise!
-      (transact/<transact!
+      (d/<transact!
         conn
         datoms)
       clj->js)))
@@ -52,9 +52,8 @@
   ;; Expects a JS array as input.
   (try
     (let [tx-data (js->tx-data tx-data)]
-      (println "Transacting:" (pr-str tx-data))
       (go-promise clj->js
-        (let [tx-result (<? (transact/<transact! conn tx-data))]
+        (let [tx-result (<? (d/<transact! conn tx-data))]
           (select-keys tx-result
                        [:tempids
                         :added-idents
@@ -73,13 +72,13 @@
         ;; We pickle the connection as a thunk here so it roundtrips through JS
         ;; without incident.
         {:conn (fn [] c)
-         :db (fn [] (transact/db c))
+         :db (fn [] (d/db c))
          :path path

          ;; Primary API.
          :ensureSchema (fn [simple-schema] (ensure-schema c simple-schema))
          :transact (fn [tx-data] (transact c tx-data))
-         :q (fn [find opts] (q (transact/db c) find opts))
+         :q (fn [find opts] (q (d/db c) find opts))
          :close (fn [] (db/close-db db))

          ;; Some helpers for testing the bridge.


Trying to refactor layout code

Trying to refactor layout code

First proposition of a new datattype for layouts.

Signed-off-by: Daniel Borchmann <25857343a15bf1edafebc2912e82ecf775c585c1@mailbox.tu-dresden.de>

--- src/conexp/layouts/base.clj
+++ src/conexp/layouts/base.clj
@@ -15,7 +15,16 @@

 ;;;

-(deftype Layout [positions connections information]
+(deftype Layout [lattice                ;the underlying lattice
+                 positions              ;fn mapping nodes to $\RR^2$
+                 annotation-label       ;fn mapping nodes and #{'lower,'upper}
+                                        ;to their labels
+                 annotation-position    ;fn mapping nodes and #{'lower,'upper}
+                                        ;to the position of the corresponding
+                                        ;label
+                 information]           ;ref for technicals
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; HERE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   Object
   (equals [this other]
     (generic-equals [this other] Layout [positions connections]))


Set endpoint path correctly for in-container websockets

--- web/src/immutant/web/internal/servlet.clj
+++ web/src/immutant/web/internal/servlet.clj
@@ -151,4 +151,8 @@
              (throw (NullPointerException. "Ring handler returned nil")))))
        (init [^ServletConfig config]
          (proxy-super init config)
-         (if endpoint (add-endpoint endpoint (.getServletContext config)))))))
+         (if endpoint
+           (let [context (.getServletContext config)
+                 mapping (-> context (.getServletRegistration (.getServletName this)) .getMappings first)
+                 path (apply str (take (- (count mapping) 2) mapping))]
+             (add-endpoint endpoint context {:path (if (empty? path) "/" path)})))))))


Add key to silence React warning

Add key to silence React warning

--- src/braid/client/register/user_auth/views.cljs
+++ src/braid/client/register/user_auth/views.cljs
@@ -6,6 +6,7 @@
 (defn auth-providers-view []
   [:span.auth-providers
    (for [provider [:github :google :facebook]]
+     ^{:key provider}
      [:button
       {:class (name provider)
        :on-click (fn [e]


Fix for codemirror fix that caused (serious) regression (#1030)

--- src/cljs/main/broadfcui/common/codemirror.cljs
+++ src/cljs/main/broadfcui/common/codemirror.cljs
@@ -6,7 +6,7 @@
    [broadfcui.utils :as utils]
    ))

-(defonce ^:private codemirror-instance (atom false))
+(defonce ^:private codemirror-constructor (atom false))

 (defn- regex-escape [s]
   (clojure.string/replace s #"[\\\*\+\|\^]" #(str "\\" %)))
@@ -22,7 +22,7 @@

 (defn- define-wdl []
   (js-invoke
-   @codemirror-instance "defineMode" "wdl"
+   @codemirror-constructor "defineMode" "wdl"
    (fn []
      #js{:token (fn [stream]
                   (.eatSpace stream)
@@ -57,7 +57,7 @@
      (this :call-method "off" event-type listener))
    :call-method
    (fn [{:keys [locals]} method & args]
-     (apply js-invoke (aget @codemirror-instance "doc") method args))
+     (apply js-invoke (aget (:codemirror-instance @locals) "doc") method args))
    :get-default-props
    (fn []
      {:line-numbers? true
@@ -76,8 +76,8 @@
           (not loaded?) [ScriptLoader
                          {:on-error #(swap! state assoc :error? true)
                           :on-load (fn []
-                                     (when-not @codemirror-instance
-                                       (reset! codemirror-instance (aget js/window "webpackDeps" "CodeMirror"))
+                                     (when-not @codemirror-constructor
+                                       (reset! codemirror-constructor (aget js/window "webpackDeps" "CodeMirror"))
                                        (define-wdl))
                                      (this :-display-code)
                                      (when-let [init (:initialize props)]
@@ -90,8 +90,8 @@
    :-display-code
    (fn [{:keys [refs props locals]}]
      (let [{:keys [mode line-numbers? read-only? text]} props]
-       (swap! locals assoc :code-mirror-instance
-              (@codemirror-instance (react/find-dom-node (@refs "container"))
+       (swap! locals assoc :codemirror-instance
+              (@codemirror-constructor (react/find-dom-node (@refs "container"))
                (clj->js
                 (merge
                  (when text {:value text})
@@ -100,6 +100,6 @@
    :component-will-receive-props
    (fn [{:keys [props next-props locals]}]
      (when (:read-only? props)
-       (-> (@locals :code-mirror-instance)
+       (-> (@locals :codemirror-instance)
            (js-invoke "getDoc")
            (js-invoke "setValue" (:text next-props)))))})


Remove garbage

Remove garbage

--- src/clojure/clojurewerkz/cassaforte/client.clj
+++ src/clojure/clojurewerkz/cassaforte/client.clj
@@ -238,9 +238,6 @@
               "Query is meant to be executed as prepared, but no values were supplied.")))
     (build-statement query)))

-(defn ^:dynamic success-cb [_])
-(defn ^:dynamic failure-cb [_])
-
 (defn ^ResultSetFuture execute-async
   "Executes a pre-built query and returns a future.

@@ -251,19 +248,7 @@
      (execute-async session query {}))
   ([^Session session query {:keys [prepared]}]
      (let [^Statement statement (statement-for session query prepared)
-           ^ResultSetFuture fut (.executeAsync session statement)
-           success success-cb
-           failure failure-cb]
-       (Futures/addCallback
-        fut
-        (reify FutureCallback
-          (onSuccess [_ result]
-            (when-not (nil? result)
-              (Thread/sleep 1)
-              (success (conv/to-clj result))))
-          (onFailure [_ result]
-            (when-not (nil? result)
-              (failure (conv/to-clj result))))))
+           ^ResultSetFuture fut (.executeAsync session statement)]
        (future (conv/to-clj (.getUninterruptibly fut))))))

 (defn execute


rm test code

rm test code

--- src/clojure/com/datayumyum/helloDroid/main.clj
+++ src/clojure/com/datayumyum/helloDroid/main.clj
@@ -9,14 +9,9 @@
   (fn [this bundle]
     (on-ui
      (set-content-view! a
-      (make-ui main-layout) )) ))
+      (make-ui [:linear-layout {:orientation :vertical}
+                  [:edit-text {:hint "Event name2"}]
+                  [:edit-text {:hint "Event location"}]]) )) ))

-(def main-layout [:linear-layout {:orientation :vertical}
-                  [:edit-text {:hint "Event name2"}]
-                  [:edit-text {:hint "Event location"}]])

-    (on-ui
-     (set-content-view! a
-      (make-ui main-layout) ))
-