update version

update version

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject pjson "0.3.2"
+(defproject pjson "0.3.5-SNAPSHOT"
             :description "Fast clojure json library"
             :url "https://github.com/gerritjvv/pjson"
             :license {:name "Eclipse Public License"


Release v1.3.0-beta10

Release v1.3.0-beta10

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojurewerkz/cassaforte "1.3.0-beta10-SNAPSHOT"
+(defproject clojurewerkz/cassaforte "1.3.0-beta10"
   :min-lein-version "2.0.0"
   :description "A Clojure client for Apache Cassandra"
   :url "http://clojurecassandra.info"


Version 0.8.10-SNAPSHOT

Version 0.8.10-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject grafter/grafter "0.8.9"
+(defproject grafter/grafter "0.8.10-SNAPSHOT"
   :description "Tools for the hard graft of data processing"
   :url "http://grafter.org/"
   :license {:name "Eclipse Public License - v1.0"


v0.9.5

--- project.clj
+++ project.clj
@@ -4,7 +4,7 @@
                     (System/getenv "TRAVIS_COMMIT")))
 (def app-url (or (System/getenv "APP_URL") ""))

-(defproject qu "0.9.4"
+(defproject qu "0.9.5"
   :description "qu is an **in-progress** data platform created by the CFPB to
 serve their public data sets."
   :build-number ~build-number


adding user definition

adding user definition

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject closp/lein-template "0.1.16"
+(defproject closp/lein-template "0.1.17-Snapshot"
   :description "A webframework combining several technologies based on luminus and chestnut."
   :url "https://github.com/sveri/closp"
   :license {:name "Eclipse Public License"


Added missing core async dep.

Added missing core async dep.

--- project.clj
+++ project.clj
@@ -16,7 +16,8 @@
                  [com.google.firebase/firebase-server-sdk "3.0.0"]
                  [clojure.java-time "0.2.1"]
                  [danlentz/clj-uuid "0.1.6"]
-                 [org.clojure/math.numeric-tower "0.0.4"]]
+                 [org.clojure/math.numeric-tower "0.0.4"]
+                 [org.clojure/core.async "0.2.385"]]
   :plugins [[lein-ring "0.9.7"]
             [lein-environ "1.0.3"]]
   :ring {:handler forces-assemble.handler/dev-app}


lein-release plugin: preparing 0.1.0 release

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.clojars.mhuebert/re-view-routing "0.1.0-SNAPSHOT"
+(defproject org.clojars.mhuebert/re-view-routing "0.1.0"

   :description "ClojureScript routing tools"


upgrade dependencies.

upgrade dependencies.

--- project.clj
+++ project.clj
@@ -1,7 +1,7 @@
 (defproject lein-ancient "0.6.9-SNAPSHOT"
   :description "Check your Projects for outdated Dependencies."
   :url "https://github.com/xsc/lein-ancient"
-  :dependencies [[ancient-clj "0.3.11"
+  :dependencies [[ancient-clj "0.3.12"
                   :exclusions [com.amazonaws/aws-java-sdk-s3]]
                  [rewrite-clj "0.4.12"]
                  [com.amazonaws/aws-java-sdk-s3 "1.9.0"
@@ -10,12 +10,12 @@
                  [version-clj "0.1.2"]
                  [jansi-clj "0.1.0"]
                  [org.clojure/tools.reader "0.10.0"]
-                 [potemkin "0.4.1"]]
+                 [potemkin "0.4.3"]]
   :license {:name "MIT License"
             :url "http://opensource.org/licenses/MIT"
             :year 2013
             :key "mit"}
-  :profiles {:dev {:dependencies [[midje "1.7.0"]
+  :profiles {:dev {:dependencies [[midje "1.8.3"]
                                   [slingshot "0.12.2"]]
                    :plugins [[lein-midje "3.1.1"]]
                    :test-paths ["test"]}}


add url to project.clj description

add url to project.clj description

--- project.clj
+++ project.clj
@@ -40,7 +40,7 @@
                          (get JVMOPTS os))))))

 (defproject overtone "0.8.0-SNAPSHOT"
-  :description "Collaborative Programmable Music."
+  :description "Collaborative Programmable Music. (http://github.com/overtone/overtone)"
   :url "http://project-overtone.org"
   :dependencies [[org.clojure/clojure "1.3.0"]
                  [org.clojure/core.incubator "0.1.0"]


Back to snapshot

Back to snapshot

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojurewerkz/cassaforte "1.3.0-beta4"
+(defproject clojurewerkz/cassaforte "1.3.0-beta5-SNAPSHOT"
   :min-lein-version "2.0.0"
   :description "A Clojure client for Apache Cassandra"
   :url "http://clojurecassandra.info"


(PDB-5484) nodes-test/node-subqueries: fix test msg construction

kondo noticed that the format call had an unused arg, and some
investigation suggests that the at one point the code was probably
attempting to check for a version, which no longer exists.

Fix the format issue and simplify the surrounding code.

cf.
  c334ef4a6f7648060ac0a5df60e9f8f2515e26bd
  85d50b9764072e2efb7a5336efcf40ee24d5a698

--- test/puppetlabs/puppetdb/http/nodes_test.clj
+++ test/puppetlabs/puppetdb/http/nodes_test.clj
@@ -419,17 +419,15 @@
       [web1]))

   (testing "subqueries: invalid"
-    (doseq [[query msg] {
-                         ;; Ensure the v2 version of sourcefile/sourceline returns
-                         ;; a proper error.
-                         ["in" "certname"
-                          ["extract" "certname"
-                           ["select_resources"
-                            ["and"
-                             ["=" "sourcefile" "/etc/puppet/modules/settings/manifests/init.pp"]
-                             ["=" "sourceline" 1]]]]]
-
-                         (re-pattern (format "'sourcefile' is not a queryable object.*" (last (name version))))}]
+    ;; Ensure the v2 version of sourcefile/sourceline returns
+    ;; a proper error.
+    (let [query ["in" "certname"
+                 ["extract" "certname"
+                  ["select_resources"
+                   ["and"
+                    ["=" "sourcefile" "/etc/puppet/modules/settings/manifests/init.pp"]
+                    ["=" "sourceline" 1]]]]]
+          msg #"'sourcefile' is not a queryable object"]
       (testing (str endpoint " query: " query " should fail with msg: " msg)
         (let [{:keys [status body headers]} (query-response method endpoint query)]
           (is (= HttpURLConnection/HTTP_BAD_REQUEST status))


(PE-34384) Update URL decoding error string output

The error message in Java 17 now includes the radix. Allow any suffix
for cross Java compatibility.

--- test/unit/puppetlabs/services/request_handler/request_handler_core_test.clj
+++ test/unit/puppetlabs/services/request_handler/request_handler_core_test.clj
@@ -264,9 +264,11 @@
   "A cert provided in the x-client-cert header that cannot be decoded into
   an X509Certificate object throws the expected failure"
   (testing "Improperly URL encoded content"
-    (is (thrown+? [:kind :bad-request
-                   :msg (str "Unable to URL decode the x-client-cert header: "
-                             "For input string: \"1Q\"")]
+    (is (thrown+? #(and
+                     (= (:kind %) :bad-request)
+                     (re-matches
+                       #"Unable to URL decode the x-client-cert header: For input string: \"1Q\".*"
+                       (:msg %)))
                   (jruby-request-with-client-cert-header "%1Q%2"))))
   (testing "Bad certificate content"
     (is (thrown+? [:kind :bad-request


rendered page depends on url

rendered page depends on url

--- pedestal-app/app/src/semtag_web/start.cljs
+++ pedestal-app/app/src/semtag_web/start.cljs
@@ -9,12 +9,21 @@
             [semtag-web.rendering :as rendering]
             [goog.Uri]))

+(defn page-from-url []
+  ;; For now we use hash. If I put a server to route all urls to this js app,
+  ;; this could change to full urls.
+  (case (.-hash window.location)
+    "#/types" "types"
+    "home"))
+
 (defn create-app [render-config]
   (let [app (app/build behavior/example-app)
         render-fn (push-render/renderer "content" render-config render/log-fn)
         app-model (render/consume-app-model app render-fn)]
     (app/begin app)
-    (p/put-message (:input app) {msg/type :set-value msg/topic [:page] :value "types"})
+    (p/put-message (:input app) {msg/type :set-value
+                                 msg/topic [:page]
+                                 :value (page-from-url)})
     {:app app :app-model app-model}))

 (defn setup-effects [app services-fn]


Removed obsolete test

Removed obsolete test

--- test/cia/handler_test.clj
+++ test/cia/handler_test.clj
@@ -17,8 +17,4 @@
   (testing "cia/version"
     (let [response (get "cia/version")]
       (is (= 200 (:status response)))
-      (is (= "0.1" (get-in response [:parsed-body :version])))))
-
-  (testing "cia/judgements"
-    (let [response (get "cia/judgements")]
-      (is (= 200 (:status response))))))
+      (is (= "0.1" (get-in response [:parsed-body :version]))))))


Correct names

Correct names

--- test/doctopus/db_test.clj
+++ test/doctopus/db_test.clj
@@ -75,11 +75,11 @@
           "We should get one and only one tentacle")
       (is (= 1 (count (get-document-by-uri "index.html")))
           "Also, one tentacle.")
-      (is (= 1 (count (get-document-for-tentacle (first mock-tentacles))))
+      (is (= 1 (count (get-all-documents-for-tentacle (first mock-tentacles))))
           "One again.")
       (is (= (get-document-by-name "doctopus_test")
              (get-document-by-uri "index.html")
-             (get-document-for-tentacle (first mock-tentacles)))
+             (get-all-documents-for-tentacle (first mock-tentacles)))
           "We should get the same tentacle, regardless of retrieval"))

     ;; For these next two tests, we'll want to be able to reference the first
@@ -105,4 +105,4 @@
     (testing "Did the mappings table get updated correct?"
       (is (= 0 (count (get-all-mappings)))))
     (testing "Did the mock document get deleted when it's tentacle was nuked?"
-      (is (= 0 (count (get-document-for-tentacle (first mock-tentacles))))))))
+      (is (= 0 (count (get-all-documents-for-tentacle (first mock-tentacles))))))))


update remote-http-test to test malformed handler

--- test/gangway/web_test.clj
+++ test/gangway/web_test.clj
@@ -10,5 +10,7 @@
 (deftest remote-http-test
   (let [result (http/post
                 (format "%s/gangway/in/showevidence" (immutant.util/app-uri))
-                {:body (json/json-str {:a "b"})})]
-    (is (= 201 (:status result)))))
+                {:body (json/json-str {:a "b"})
+                 :throw-exceptions false})]
+    (testing "malformed handler"
+      (is (= 400 (:status result))))))


revert test to try to unbreak tests

revert test to try to unbreak tests

--- test-cljs/frontend/models/test_feature.cljs
+++ test-cljs/frontend/models/test_feature.cljs
@@ -1,6 +1,5 @@
 (ns frontend.models.test-feature
-  (:require [frontend.models.feature :as feature]
-            [frontend.utils.launchdarkly :as ld])
+  (:require [frontend.models.feature :as feature])
   (:require-macros [cemerick.cljs.test :refer [is deftest with-test run-tests testing test-var]]))

 (deftest enabled?-works
@@ -19,14 +18,4 @@
     (with-redefs [feature/enabled-in-query-string? (constantly false)]
       ;; cookie set to true, query set to false
       (is (not (feature/enabled? :foo)))))
-
-  ;; test launch darkly overrides
-  (with-redefs [ld/feature-on? (constantly true)
-                ld/exists? (constantly true)]
-    ;; cookie set to false, ld set to true
-    (is (feature/enabled? :foo))
-    (feature/disable-in-cookie :foo)
-    (with-redefs [ld/exists? (constantly false)]
-      ;; cookie set to true, ld not set
-      (is (not (feature/enabled? :foo)))))
   (feature/disable-in-cookie :foo))


Correct silliness

Correct silliness

--- src/exploud/asgard.clj
+++ src/exploud/asgard.clj
@@ -243,7 +243,7 @@
     (set/rename-keys params {"selectedLoadBalancers" (str "selectedLoadBalancersForVpcId" vpc-id)})
     params))

-(defn- is-security-group-name? [security-group]
+(defn- is-security-group-id? [security-group]
   (re-find #"^sg-" security-group))

 (defn- get-security-group-id [security-group region]
@@ -252,12 +252,16 @@
       (:groupId found-group)
       (throw (Throwable. (str "Unknown security group with name " security-group))))))

+(defn- replace-security-group-name [region security-group]
+  (if (is-security-group-id? security-group)
+    security-group
+    (get-security-group-id security-group region)))
+
 (defn- replace-security-group-names [region params]
   (if-let [security-group-names (get params "selectedSecurityGroups")]
-    (map (fn [sg] (if (is-security-group-name? sg)
-                   (get-security-group-id sg region)
-                   sg))
-         security-group-names)
+    (let [security-group-ids (map (fn [sg] (replace-security-group-name region sg))
+                                  security-group-names)]
+      (assoc params "selectedSecurityGroups" security-group-ids))
     params))

 (defn- amend-params [region params]
@@ -277,7 +281,7 @@
                            "revision" ""
                            "stack" ""
                            "region" region}
-        required-params (amend-params region (select-keys params required-keys))]
+        required-params (select-keys params required-keys)]
     (merge additional-params required-params)))

 (defn- application-params [application-name]
@@ -290,8 +294,8 @@
   us to copy we use a manual creation of that ASG to get going."
   [region application-name params]
   (let [all-params (merge default-deploy-params (application-params application-name) params)]
-    (log/info "Application" application-name "is being manually deployed in" region "with params" all-params)
-    (let [merged-params (create-manual-deploy-params all-params region application-name)]
+    (let [merged-params (amend-params region (create-manual-deploy-params all-params region application-name))]
+      (log/info "Application" application-name "is being manually deployed in" region "with params" merged-params)
       (when-let [application (application region application-name)]
         (let [{:keys [headers status]} (http/simple-post (auto-scaling-save-url region) {:form-params (create-asgard-params merged-params) :follow-redirects false :socket-timeout 30000})]
           (when (= 302 status)
@@ -303,7 +307,7 @@
   returns a map containing the task information which can be used to
   retrieve the task and track the deployment."
   [region application-name params]
-  (let [all-params (merge default-deploy-params (application-params application-name) params)]
+  (let [all-params (amend-params region (merge default-deploy-params (application-params application-name) params))]
     (log/info "Application" application-name "is being automatically deployed in" region "with params" all-params)
     (when-let [application (application region application-name)]
       (let [{:keys [headers status]} (http/simple-post (region-deploy-url region) {:form-params (create-asgard-params all-params) :follow-redirects false :socket-timeout 30000})]
@@ -326,7 +330,8 @@
 ;(application-list)
 ;(application "eu-west-1" "skeleton")
 ;(auto-scaling-group-exists? "eu-west-1" "skeleton")
-;(create-asgard-params (create-manual-deploy-params (merge (get (exploud.tyranitar/deployment-params "dev" "skeleton" "HEAD") "data") {"imageId" "woooooo" "selectedZones" ["eu-west-1a" "eu-west-1b"] "ticket" "something" "_action_save" ""}) "eu-west-1" "skeleton"))
+;(create-manual-deploy-params (merge (get (exploud.tyranitar/deployment-params "dev" "recommendations" "HEAD") "data") {}) "eu-west-1" "recommendations")
+;(create-asgard-params (create-manual-deploy-params (merge (get (exploud.tyranitar/deployment-params "dev" "recommendations" "HEAD") "data") {}) "eu-west-1" "recommendations"))
 ;(auto-scaling-save-url "eu-west-1")
 ;(set/rename-keys {"selectedLoadBalancers" ["beef" "steak"]} {"selectedLoadBalancers" "selectedLoadBalancersForVpcIdvpc-e23232"})
 ;(replace-security-group-names "eu-west-1" {"selectedSecurityGroups" ["woo" "sg-1234"]})


Extracts out code to print relevant specs

--- src/expound/alpha.cljc
+++ src/expound/alpha.cljc
@@ -248,13 +248,10 @@

 %s

-%s
-
 %s"
    (header-label "Spec failed")
    (show-spec-name spec-name (printer/indent (*value-str-fn* spec-name val path (problems/value-in val path))))
-   (explain-missing-keys problems)
-   (if (:print-specs? opts) (relevant-specs problems) "")))
+   (explain-missing-keys problems)))

 (defmethod problem-group-str :problem/not-in-set [_type spec-name val path problems opts]
   (assert (apply = (map :val problems)) (str "All values should be the same, but they are " problems))
@@ -264,27 +261,21 @@

 %s

-should be%s: %s
-
-%s"
+should be%s: %s"
      (header-label "Spec failed")
      (show-spec-name spec-name (printer/indent (*value-str-fn* spec-name val path (problems/value-in val path))))
      (if (= 1 (count combined-set)) "" " one of")
-     (string/join "," (map #(str "`" % "`") combined-set))
-     (if (:print-specs? opts) (relevant-specs problems) ""))))
+     (string/join "," (map #(str "`" % "`") combined-set)))))

 (defmethod problem-group-str :problem/missing-spec [_type spec-name val path problems opts]
   (printer/format
    "%s

-%s
-
 %s"
    (header-label "Missing spec")
    (->> problems
         (map #(no-method spec-name val path %))
-        (string/join "\n"))
-   (if (:print-specs? opts) (relevant-specs problems) "")))
+        (string/join "\n"))))

 (defmethod problem-group-str :problem/regex-failure [_type spec-name val path problems opts]
   (s/assert ::singleton problems)
@@ -292,14 +283,11 @@
     (printer/format
      "%s

-%s
-
 %s"
      (header-label "Syntax error")
      (case (:reason problem)
        "Insufficient input" (insufficient-input spec-name val path problem)
-       "Extra input" (extra-input spec-name val path))
-     (if (:print-specs? opts) (relevant-specs problems) ""))))
+       "Extra input" (extra-input spec-name val path)))))

 (defmethod problem-group-str :problem/fspec-exception-failure [_type spec-name val path problems opts]
   (s/assert ::singleton problems)
@@ -315,14 +303,11 @@

 with args:

-%s
-
 %s"
      (header-label "Exception")
      (printer/indent (*value-str-fn* spec-name val path (problems/value-in val path)))
      (printer/indent (pr-str (:reason problem)))
-     (printer/indent (string/join ", " (:val problem)))
-     (if (:print-specs? opts) (relevant-specs problems) ""))))
+     (printer/indent (string/join ", " (:val problem))))))

 (defmethod problem-group-str :problem/fspec-ret-failure [_type spec-name val path problems opts]
   (s/assert ::singleton problems)
@@ -338,14 +323,11 @@

 should satisfy

-%s
-
 %s"
      (header-label "Function spec failed")
      (printer/indent (*value-str-fn* spec-name val path (problems/value-in val path)))
      (printer/indent (pr-str (:val problem)))
-     (printer/indent (pr-pred (:pred problem) (:spec problem)))
-     (if (:print-specs? opts) (relevant-specs problems) ""))))
+     (printer/indent (pr-pred (:pred problem) (:spec problem))))))

 (defmethod problem-group-str :problem/fspec-fn-failure [_type spec-name val path problems opts]
   (s/assert ::singleton problems)
@@ -361,14 +343,11 @@

 should satisfy

-%s
-
 %s"
      (header-label "Function spec failed")
      (printer/indent (*value-str-fn* spec-name val path (problems/value-in val path)))
      (printer/indent (pr-str (:val problem)))
-     (printer/indent (pr-pred (:pred problem) (:spec problem)))
-     (if (:print-specs? opts) (relevant-specs problems) ""))))
+     (printer/indent (pr-pred (:pred problem) (:spec problem))))))

 (defmethod problem-group-str :problem/unknown [_type spec-name val path problems opts]
   (assert (apply = (map :val problems)) (str "All values should be the same, but they are " problems))
@@ -379,12 +358,15 @@

 should satisfy

-%s
-
 %s"
    (header-label "Spec failed")
    (show-spec-name spec-name (printer/indent (*value-str-fn* spec-name val path (problems/value-in val path))))
-   (preds problems)
+   (preds problems)))
+
+(defn problem-group-str1 [type spec-name val path problems opts]
+  (str
+   (problem-group-str type spec-name val path problems opts)
+   "\n\n"
    (if (:print-specs? opts) (relevant-specs problems) "")))

 (defn problem-type [failure problem]
@@ -469,7 +451,7 @@
 %s
 Detected %s %s\n"
              (string/join "\n\n" (for [[[in type] problems] problems]
-                                   (problem-group-str type (spec-name explain-data) form in problems opts')))
+                                   (problem-group-str1 type (spec-name explain-data) form in problems opts')))
              (section-label)
              (count problems)
              (if (= 1 (count problems)) "error" "errors")))))))))


multiple music files

multiple music files

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -62,7 +62,9 @@
             (fn []
               (.attr (js/$ "#current-track") "src" (.-result reader))
               (.load (.getElementById js/document "audio-tag"))
-              (.play (.getElementById js/document "audio-tag")))))))))
+              (.play (.getElementById js/document "audio-tag"))
+              (println (str "Number of music files downloaded/downloading: "
+                            (count (:music-files @app-state)))))))))))

 (.change (js/$ "#file_upload_input")
   (fn [e]


Revert sorting change. Messes up some tests.

--- test/onyx/test_helper.clj
+++ test/onyx/test_helper.clj
@@ -41,7 +41,7 @@
     []))

 (defn get-counts [replica job-infos]
-  (sort (mapv (partial job-allocation-counts replica) job-infos)))
+  (mapv (partial job-allocation-counts replica) job-infos))

 (defn load-config
   ([]


Remove partial constructors

Remove partial constructors

--- src/gol/client/bl.cljs
+++ src/gol/client/bl.cljs
@@ -35,28 +35,9 @@
   [width height]
   (cons [(rand-int width) (rand-int height)] (lazy-seq (rand-2d width height))))

-(defn create-evolution-state
-  [period status]
-  {:period period
-   :status status})
-
-(defn create-generator-state
-  [count]
-  {:count count})
-
-(defn create-population-state
+(defn rand-population
   [count width height]
   (set (take count (distinct (rand-2d width height)))))
-
-(defn create-universe-state
-  [count width height type]
-  {:population (create-population-state count width height)
-   :type       type})
-
-(defn create-viewport-state
-  [width height]
-  {:width  width
-   :height height})

 (defn create-channels
   []
@@ -70,10 +51,13 @@
              period 500
              status :progress
              type   :unlimited}}]
-  (atom {:universe  (create-universe-state count width height type)
-         :evolution (create-evolution-state period status)
-         :generator (create-generator-state count)
-         :viewport  (create-viewport-state width height)}))
+  (atom {:universe  {:population (rand-population count width height)
+                     :type       type}
+         :evolution {:period period
+                     :status status}
+         :generator {:count count}
+         :viewport  {:width  width
+                     :height height}}))

 (defn start
   [state channels]
@@ -82,7 +66,7 @@
           (case v
             :status (swap! state update-in [:evolution :status] #(:status msg))
             :random (swap! state update-in [:universe :population] (fn [_] (let [s @state]
-                                                                             (create-population-state
+                                                                             (rand-population
                                                                                (get-in s [:generator :count])
                                                                                (get-in s [:viewport :width])
                                                                                (get-in s [:viewport :height])))))


Update clojure bot

Update clojure bot

--- clojure.clj
+++ clojure.clj
@@ -1,13 +1,11 @@
 (fn [state time-left]
-  (let [command-options [[{:cmd \"SMOKESCREEN\"}]
-                         [{:cmd  \"SHOOT\"
-                           :metadata  {:direction (rand-nth  [0 1 2 3 4 5 6 7])}}]
-                         [{:cmd  \"MOVE\"
-                           :metadata  {:direction (rand-nth  [0 1 2 3 4 5 6 7])}}]
-                         [{:cmd  \"MOVE\"
-                           :metadata  {:direction (rand-nth  [0 1 2 3 4 5 6 7])}}]
-                         [{:cmd  \"MOVE\"
-                           :metadata  {:direction (rand-nth  [0 1 2 3 4 5 6 7])}}]
-                         [{:cmd  \"MOVE\"
-                           :metadata  {:direction (rand-nth  [0 1 2 3 4 5 6 7])}}]]]
-    {:commands (rand-nth command-options)}))
+  (def turn-directions [:right :left :about-face])
+
+  (let [command-options [{:command {:action :move
+                                    :metadata {}}}
+                         {:command {:action :turn
+                                    :metadata (rand-nth turn-directions)}}
+                         {:command {:action :shoot
+                                    :metadata {}}}]]
+    {:command (rand-nth command-options)
+     :state {:test true}}))


Fix ring.middleware.file-info doc.

Fix ring.middleware.file-info doc.

--- ring-core/src/ring/middleware/file_info.clj
+++ ring-core/src/ring/middleware/file_info.clj
@@ -72,10 +72,10 @@

 (defn wrap-file-info
   "Wrap an app such that responses with a file a body will have
-  corresponding Content-Type and Content-Length headers added if they are not
-  allready present and can be determined from the file. If two arguments are
-  given, the second is taken to be a map of file extensions to content types
-  that will supplement the default, built-in map."
+  corresponding Content-Type and Content-Length headers added if they can be
+  determined from the file.
+  If two arguments are given, the second is taken to be a map of file extensions
+  to content types that will supplement the default, built-in map."
   [app & [custom-mime-types]]
   (let [mime-types (merge base-mime-types custom-mime-types)]
     (fn [req]


New handlers colors

New handlers colors

--- frontend/src/uxbox/main/ui/workspace/selection.cljs
+++ frontend/src/uxbox/main/ui/workspace/selection.cljs
@@ -2,8 +2,8 @@
 ;; License, v. 2.0. If a copy of the MPL was not distributed with this
 ;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
 ;;
-;; Copyright (c) 2015-2017 Juan de la Cruz <delacruzgarciajuan@gmail.com>
-;; Copyright (c) 2015-2019 Andrey Antukh <niwi@niwi.nz>
+;; Copyright (c) 2015-2020 Juan de la Cruz <delacruzgarciajuan@gmail.com>
+;; Copyright (c) 2015-2020 Andrey Antukh <niwi@niwi.nz>

 (ns uxbox.main.ui.workspace.selection
   "Selection handlers component."
@@ -119,8 +119,8 @@
     :style {:fillOpacity "1"
             :strokeWidth "2px"
             :vectorEffect "non-scaling-stroke"}
-    :fill "rgba(49,239,184,.7)"
-    :stroke "#31EFB8"
+    :fill "#ffffff"
+    :stroke "#1FDEA7"
     :cx cx
     :cy cy}])

@@ -166,7 +166,7 @@
                   :width width
                   :height height
                   :stroke-dasharray (str (/ 8.0 zoom) "," (/ 5 zoom))
-                  :style {:stroke "#31EFB8"
+                  :style {:stroke "#1FDEA7"
                           :fill "transparent"
                           :stroke-opacity "1"}}]

@@ -220,8 +220,8 @@
                    :r (/ 6.0 zoom)
                    :key index
                    :on-mouse-down #(on-mouse-down % index)
-                   :fill "rgba(49,239,184,.7)"
-                   :stroke "#31EFB8"
+                   :fill "#ffffff"
+                   :stroke "#1FDEA7"
                    :style {:cursor "pointer"}}])])))

 ;; TODO: add specs for clarity
@@ -234,7 +234,7 @@
                   :width width
                   :height height
                   ;; :stroke-dasharray (str (/ 5.0 zoom) "," (/ 5 zoom))
-                  :style {:stroke "#31EFB8"
+                  :style {:stroke "#1FDEA7"
                           :stroke-width "0.5"
                           :stroke-opacity "1"
                           :fill "transparent"}}]]))


add some comments to build and run tasks

--- resources/leiningen/new/tenzing/build.boot
+++ resources/leiningen/new/tenzing/build.boot
@@ -16,13 +16,21 @@
  '[adzerk.boot-reload    :refer [reload]]
  '[pandeiro.boot-http    :refer [serve]]{{{requires}}})

-(deftask build []
+(deftask build
+  "This task contains all the necessary steps to produce a build
+   You can use 'profile-tasks' like `production` and `development`
+   to change parameters (like optimizations level of the cljs compiler)"
+  []
   (comp (speak)
         {{{pre-build-steps}}}
         (cljs)
         {{{build-steps}}}))

-(deftask run []
+(deftask run
+  "The `run` task wraps the building of your application in some
+   useful tools for local development: an http server, a file watcher
+   a ClojureScript REPL and a hot reloading mechanism"
+  []
   (comp (serve)
         (watch)
         (cljs-repl)


Implement ämter

Implement ämter

--- adressverzeichnis/clj-migrate/migrate.clj
+++ adressverzeichnis/clj-migrate/migrate.clj
@@ -150,9 +150,34 @@

 ;;;; SQL-Map generation functions

-(defn amttypen-sql [_persons]
+(defn valid-amttyp [amt]
+  (when amt
+    (cond
+      (or (str/includes? amt "führer")
+          (str/includes? amt "vogt")
+          (str/includes? amt "vögtin")) "Führer:in/Vögtin/Vogt"
+      (re-matches #"(?i).*kanzler.*" amt) "Kanzler:in"
+      (re-matches #"(?i).*kämmer.*" amt) "Kämmerin/Kämerer"
+      :else amt)))
+
+(defn amttypen-sql [persons]
   (-> (insert-into :public.adressverzeichnis_amttyp)
-      (values [{:name "Mitglied"}])))
+      (values (cons {:name "Mitglied"}
+                    (for [amt (set (keep (comp valid-amttyp :Amt) persons))]
+                      {:name amt})))))
+
+(defn ämter [persons]
+  (-> (insert-into :public.adressverzeichnis_amt)
+      (values (for [{:keys [Amt Gruppe alte_id]} persons
+                    :let [norm-amt (valid-amttyp Amt)]
+                    :when norm-amt]
+                {:bestaetigt true
+                 :gruppierung_id
+                 (-> (select :id) (from :public.adressverzeichnis_gruppierung) (where [:= :name Gruppe]))
+                 :typ_id
+                 (-> (select :id) (from :public.adressverzeichnis_amttyp) (where [:= :name norm-amt]))
+                 :person_id
+                 (-> (select :id) (from :public.adressverzeichnis_person) (where [:= :alte_id alte_id]))}))))

 (defn ordensmitgliedschaften-sql [persons]
   (-> (insert-into :public.adressverzeichnis_amt)
@@ -169,12 +194,13 @@

 (defn addresses-sql [persons]
   (-> (insert-into :public.adressverzeichnis_adresse)
-      (values (for [{:keys [address alte_id]} persons]
+      (values (for [{:keys [address alte_id]} persons
+                    :when address]
                 (assoc address
                        :person_id
                        (-> (select :id)
                            (from :public.adressverzeichnis_person)
-                           (where [:= :alte_id alte_id])))))))
+                            (where [:= :alte_id alte_id])))))))

 (defn phones-sql [persons]
   (-> (insert-into :public.adressverzeichnis_telefon)
@@ -350,5 +376,6 @@
             (phones-sql persons)]
            (pemissions-sql persons)
            [(amttypen-sql persons)
+            (ämter persons)
             (ordensmitgliedschaften-sql persons)]))))))


atomic in-place updates allows e.g. mongo clustering, when updating, commenting and deleting comments

--- src/ontrail/mutate.clj
+++ src/ontrail/mutate.clj
@@ -104,43 +104,41 @@

 (defn update-ex [user params]
   (.trace logger (str (:user params) " updating ex " params))
-  (if (= user (:user (mc/find-one-as-map EXERCISE {:_id (ObjectId. (:id params))})))
-    (do (let [write-result (mc/update-by-id EXERCISE (ObjectId. (:id params))
-                                            {"$set" (dissoc (from-user-ex user params)
-                                                            :comments
-                                                            :lastModifiedDate)})]
-          (sportsummary/reset-memo-for user)
-          (.trace logger (str "Updated " (:id params) " with status "  write-result)))
-        (let [res (mc/find-one-as-map EXERCISE {:_id (ObjectId. (:id params))})]
-          (.info logger (str "Updated " (:id params) user res))
-          (as-ex-result res)))
-    (.error logger (str user " does not own exercise, which is under mofidication."))))
-
+  (let [ex (mc/find-and-modify EXERCISE
+                               {:_id (ObjectId. (:id params)) :user user}
+                               {"$set" (dissoc (from-user-ex user params)
+                                               :comments
+                                               :lastModifiedDate)}
+                               :return-new true)]
+    (sportsummary/reset-memo-for user)
+    (.info logger (str user " updated " (:id params)))
+    (as-ex-result ex)))

 (defn comment-ex [user params]
   (.trace logger (str user " creating comment " params))
-  (mc/update-by-id EXERCISE
-                   (ObjectId. (:id params))
-                   {"$set" {:lastModifiedDate (time/now)}
-                    "$push" {:comments {:_id (ObjectId.)
-                                        :avatar (get-avatar-url user)
-                                        :date (to-human-comment-date (local/local-now))
-                                        :user user
-                                        :body (:body params)}}})
-  (.trace logger (str user " created comment " params))
-  (newcount-comment-ex user (:id params))
-  (let [ex (get-ex "zxcv" (:id params))]
+  (let [ex (mc/find-and-modify EXERCISE
+                               {:_id (ObjectId. (:id params))}
+                               {"$set" {:lastModifiedDate (time/now)}
+                                "$push" {:comments {:_id (ObjectId.)
+                                                    :avatar (get-avatar-url user)
+                                                    :date (to-human-comment-date (local/local-now))
+                                                    :user user
+                                                    :body (:body params)}}}
+                               :return-new true)]
+    (.info logger (str user " created comment " params))
+    (newcount-comment-ex user (:id params))
     (insert-exercise-inmem-index! ex)
     (websocket/submit :comment-ex user ex)
-    ex))
+    (as-ex-result ex)))

 (defn delete-comment[ex-id rule]
   (newcount-uncomment-ex ex-id)
-  (mc/update-by-id EXERCISE
-    (ObjectId. ex-id)
-    { "$set" {:lastModifiedDate (time/now)}
-      "$pull" rule})
-  (get-ex "zxcv" ex-id))
+  (let [ex (mc/find-and-modify EXERCISE
+                               {:_id (ObjectId. ex-id)}
+                               { "$set" {:lastModifiedDate (time/now)}
+                                 "$pull" rule}
+                               :return-new true)]
+    (as-ex-result ex)))

 (defn delete-own-comment [user ex-id comment-id]
   (.trace logger (str user " deleting own comment " comment-id " from ex " ex-id ))


clear dedent boundary after indentation point met, since it only applies to next line

--- src/parinfer/prep.cljs
+++ src/parinfer/prep.cljs
@@ -66,7 +66,8 @@
         (assoc-in [:lines line-no] indent-str)
         (assoc :indent-delta new-delta
                :x-pos new-x
-               :track-indent? false))))
+               :track-indent? false
+               :dedent-x nil))))

 (defn process-indent
   "Update the state by handling a possible indentation trigger."


stop sending chat/cust-name through the api

--- src/pc/models/chat.clj
+++ src/pc/models/chat.clj
@@ -16,20 +16,12 @@
                db cust-uuid)))

 (defn find-by-document [db document]
-  (let [memo-find-name (memoize find-chat-name)]
-    (map
-     (fn [[chat-id]]
-       (let [e (pcd/touch+ (d/entity db chat-id))]
-         ;; TODO: teach the frontend how to lookup cust/name
-         (let [name (when-let [uuid (:cust/uuid e)]
-                      (memo-find-name db uuid))]
-           (if name
-             (assoc e :chat/cust-name name)
-             e))))
-     (d/q '{:find [?t] :in [$ ?document-id]
-            :where [[?t :document/id ?document-id]
-                    [?t :chat/body]]}
-          db (:db/id document)))))
+  (map (partial d/entity db)
+       (d/q '{:find [[?t ...]]
+              :in [$ ?document-id]
+              :where [[?t :document/id ?document-id]
+                      [?t :chat/body]]}
+            db (:db/id document))))

 ;; TODO: move cust-name lookup into here
 (defn read-api [chat]
@@ -37,11 +29,8 @@
     (select-keys [:document/id
                   :server/timestamp
                   :client/timestamp
-                  ;; TODO: teach frontend to lookup cust/name
                   :session/uuid
-                  :cust/cust-name
                   :chat/body
                   :chat/color
-                  :chat/cust-name
                   :cust/uuid])
     (assoc :db/id (web-peer/client-id chat))))


show trial end for team plan

show trial end for team plan

--- src/pc/views/admin.clj
+++ src/pc/views/admin.clj
@@ -268,6 +268,7 @@
            [:th "subdomain"]
            [:th "doc-count"]
            [:th "status"]
+           [:th "trial-end"]
            [:th "coupon"]
            [:th "creator"]
            [:th "active"]
@@ -280,6 +281,7 @@
              [:td (cond (:plan/paid? plan) "paid"
                         (not (plan-model/trial-over? plan)) "trial"
                         :else "trial expired")]
+             [:td (:plan/trial-end plan)]
              [:td (:discount/coupon (:team/plan team))]
              [:td (cust-link (:team/creator team))]
              [:td (let [active (:plan/active-custs plan)]


show tags also when coming from location hash

--- iwaswhere-web/src/cljs/iwaswhere_web/ui/search.cljs
+++ iwaswhere-web/src/cljs/iwaswhere_web/ui/search.cljs
@@ -4,27 +4,30 @@

 (defn search-view
   "Renders search component."
-  [{:keys [local observed put-fn]}]
+  [{:keys [observed put-fn]}]
   (let [store-snapshot @observed
-        on-change-fn #(let [query (h/parse-search (.. % -target -value))]
-                       (swap! local assoc-in [:entry] query)
-                       (put-fn [:state/get query]))]
+        on-change-fn #(put-fn [:state/get (h/parse-search (.. % -target -value))])]
     [:div.l-box-lrg.pure-g
      [:div.pure-u-1
-      (let [tags (:tags (:entry @local))]
+      (let [tags (:tags (:current-query store-snapshot))]
         [:div.hashtags (when (seq tags)
                          (for [hashtag tags]
                            ^{:key (str "tag-" hashtag)}
                            [:span.hashtag.float-left hashtag]))])
-      (let [tags (:not-tags (:entry @local))]
+      (let [tags (:not-tags (:current-query store-snapshot))]
         [:div.hashtags (when (seq tags)
                          (for [hashtag tags]
                            ^{:key (str "tag-" hashtag)}
                            [:span.hashtag.float-left.not-tag hashtag]))])
+      (let [mentions (:mentions (:current-query store-snapshot))]
+        [:div.hashtags (when (seq mentions)
+                         (for [mention mentions]
+                           ^{:key (str "tag-" mention)}
+                           [:span.mention.float-left mention]))])
       [:div.textentry
-       [:textarea {:type "text"
+       [:textarea {:type      "text"
                    :on-change on-change-fn
-                   :value (:search-text (:current-query store-snapshot))}]]]]))
+                   :value     (:search-text (:current-query store-snapshot))}]]]]))

 (defn cmp-map
   [cmp-id]


CMR-2420 Added a test to make sure that ongoing was parsed properly.

--- umm-lib/test/cmr/umm/test/dif/collection.clj
+++ umm-lib/test/cmr/umm/test/dif/collection.clj
@@ -242,6 +242,7 @@
       <Start_Date>1998-02-24T22:20:41-05:00</Start_Date>
       <Stop_Date>1999-03-24T22:20:41-05:00</Stop_Date>
     </Temporal_Coverage>
+    <Data_Set_Progress>ONGOING</Data_Set_Progress>
     <Spatial_Coverage>
       <Southernmost_Latitude>-90.0</Southernmost_Latitude>
       <Northernmost_Latitude>-60.5033</Northernmost_Latitude>
@@ -531,6 +532,7 @@
                     :long-name "Systeme Probatoire Pour l'Observation de la Terre-4"
                     :type "Not Specified"})]
      :temporal expected-temporal
+     :collection-progress :in-work
      :science-keywords
      [(umm-c/map->ScienceKeyword
         {:category "EARTH SCIENCE"
@@ -673,4 +675,3 @@
   ;; UMM-C is now making the version field a required field. It is optional in DIF-9 so we provide
   ;; a default of "Not provided" when it is missing from the DIF-9 metadata.
   (is (= "Not provided" (get-in (c/parse-collection valid-collection-xml) [:product :version-id]))))
-


Updated source URI in the docs.

Updated source URI in the docs.

--- lambda-blog/project.clj
+++ lambda-blog/project.clj
@@ -19,4 +19,4 @@
             [lein-codox "0.9.1"]]
   :codox {:doc-paths ["doc/docs"]
           :metadata {:doc/format :markdown}
-          :source-uri "https://github.com/Idorobots/lambda-blog/blob/{version}/{filepath}#L{line}"})
+          :source-uri "https://github.com/Idorobots/lambda-blog/lambda-blog/blob/{version}/{filepath}#L{line}"})


Fail gracefully when no Push can be found.

--- src/afterglow/controllers/ableton_push.clj
+++ src/afterglow/controllers/ableton_push.clj
@@ -1600,60 +1600,64 @@
            :or {device-name "User Port"
                 refresh-interval (/ 1000 15)
                 display-name "Ableton Push"}}]
-  (let [controller
-        {:id (swap! controller-counter inc)
-         :display-name display-name
-         :show show
-         :origin (atom [0 0])
-         :effect-offset (atom 0)
-         :refresh-interval refresh-interval
-         :port-in (midi/midi-find-device (amidi/open-inputs-if-needed!) device-name)
-         :port-out (midi/midi-find-device (amidi/open-outputs-if-needed!) device-name)
-         :task (atom nil)
-         :last-display (vec (for [_ (range 4)] (byte-array (take 68 (repeat 32)))))
-         :next-display (vec (for [_ (range 4)] (byte-array (take 68 (repeat 32)))))
-         :last-text-buttons (atom {})
-         :next-text-buttons (atom {})
-         :last-top-pads (int-array 8)
-         :next-top-pads (int-array 8)
-         :last-grid-pads (make-array clojure.lang.IPersistentMap 64)
-         :next-grid-pads (make-array clojure.lang.IPersistentMap 64)
-         :metronome-mode (atom {})
-         :last-marker (atom nil)
-         :shift-mode (atom false)
-         :stop-mode (atom false)
-         :midi-handler (atom nil)
-         :tap-tempo-handler (amidi/create-tempo-tap-handler (:metronome show))
-         :overlays (atom (sorted-map-by >))
-         :next-overlay (atom 0)
-         :move-listeners (atom #{})
-         :grid-controller-impl (atom nil)}]
-    (reset! (:midi-handler controller) (partial midi-received controller))
-    (reset! (:grid-controller-impl controller)
-            (reify controllers/IGridController
-              (display-name [this] (:display-name controller))
-              (physical-height [this] 8)
-              (physical-width [this] 8)
-              (current-bottom [this] (@(:origin controller) 1))
-              (current-bottom [this y] (move-origin controller (assoc @(:origin controller) 1 y)))
-              (current-left [this] (@(:origin controller) 0))
-              (current-left [this x] (move-origin controller (assoc @(:origin controller) 0 x)))
-              (add-move-listener [this f] (swap! (:move-listeners controller) conj f))
-              (remove-move-listener [this f] (swap! (:move-listeners controller) disj f))))
-    ;; Set controller in User mode
-    (midi/midi-sysex (:port-out controller) [240 71 127 21 98 0 1 1 247])
-    ;; Put pads in aftertouch (poly) pressure mode
-    (midi/midi-sysex (:port-out controller) [240 71 127 21 92 0 1 0 247])
-    ;; Set pad sensitivity level to 1 to avoid stuck pads
-    (midi/midi-sysex (:port-out controller)
-                     [0xF0 0x47 0x7F 0x15 0x5D 0x00 0x20 0x00 0x00 0x0C 0x07 0x00 0x00 0x0D 0x0C 0x00
-                      0x00 0x00 0x01 0x04 0x0C 0x00 0x08 0x00 0x00 0x00 0x01 0x0D 0x04 0x0C 0x00 0x00
-                      0x00 0x00 0x00 0x0E 0x0A 0x06 0x00 0xF7])
-    (clear-interface controller)
-    (welcome-animation controller)
-    (swap! active-bindings assoc (:id controller) controller)
-    (show/register-grid-controller @(:grid-controller-impl controller))
-    controller))
+  (let [port-in (midi/midi-find-device (amidi/open-inputs-if-needed!) device-name)
+        port-out (midi/midi-find-device (amidi/open-outputs-if-needed!) device-name)]
+    (if (every? some? [port-in port-out])
+      (let [controller
+            {:id (swap! controller-counter inc)
+             :display-name display-name
+             :show show
+             :origin (atom [0 0])
+             :effect-offset (atom 0)
+             :refresh-interval refresh-interval
+             :port-in port-in
+             :port-out port-out
+             :task (atom nil)
+             :last-display (vec (for [_ (range 4)] (byte-array (take 68 (repeat 32)))))
+             :next-display (vec (for [_ (range 4)] (byte-array (take 68 (repeat 32)))))
+             :last-text-buttons (atom {})
+             :next-text-buttons (atom {})
+             :last-top-pads (int-array 8)
+             :next-top-pads (int-array 8)
+             :last-grid-pads (make-array clojure.lang.IPersistentMap 64)
+             :next-grid-pads (make-array clojure.lang.IPersistentMap 64)
+             :metronome-mode (atom {})
+             :last-marker (atom nil)
+             :shift-mode (atom false)
+             :stop-mode (atom false)
+             :midi-handler (atom nil)
+             :tap-tempo-handler (amidi/create-tempo-tap-handler (:metronome show))
+             :overlays (atom (sorted-map-by >))
+             :next-overlay (atom 0)
+             :move-listeners (atom #{})
+             :grid-controller-impl (atom nil)}]
+        (reset! (:midi-handler controller) (partial midi-received controller))
+        (reset! (:grid-controller-impl controller)
+                (reify controllers/IGridController
+                  (display-name [this] (:display-name controller))
+                  (physical-height [this] 8)
+                  (physical-width [this] 8)
+                  (current-bottom [this] (@(:origin controller) 1))
+                  (current-bottom [this y] (move-origin controller (assoc @(:origin controller) 1 y)))
+                  (current-left [this] (@(:origin controller) 0))
+                  (current-left [this x] (move-origin controller (assoc @(:origin controller) 0 x)))
+                  (add-move-listener [this f] (swap! (:move-listeners controller) conj f))
+                  (remove-move-listener [this f] (swap! (:move-listeners controller) disj f))))
+        ;; Set controller in User mode
+        (midi/midi-sysex (:port-out controller) [240 71 127 21 98 0 1 1 247])
+        ;; Put pads in aftertouch (poly) pressure mode
+        (midi/midi-sysex (:port-out controller) [240 71 127 21 92 0 1 0 247])
+        ;; Set pad sensitivity level to 1 to avoid stuck pads
+        (midi/midi-sysex (:port-out controller)
+                         [0xF0 0x47 0x7F 0x15 0x5D 0x00 0x20 0x00 0x00 0x0C 0x07 0x00 0x00 0x0D 0x0C 0x00
+                          0x00 0x00 0x01 0x04 0x0C 0x00 0x08 0x00 0x00 0x00 0x01 0x0D 0x04 0x0C 0x00 0x00
+                          0x00 0x00 0x00 0x0E 0x0A 0x06 0x00 0xF7])
+        (clear-interface controller)
+        (welcome-animation controller)
+        (swap! active-bindings assoc (:id controller) controller)
+        (show/register-grid-controller @(:grid-controller-impl controller))
+        controller)
+      (timbre/error "Unable to find Ableton Push with MIDI device name:" device-name))))

 (defn deactivate
   "Deactivates a controller interface, killing its update thread


Making progress on the curry macro.

Making progress on the curry macro.

--- books/onlisp/ch7.clj
+++ books/onlisp/ch7.clj
@@ -1,10 +1,12 @@
 ;; Implementing some of the macros from Chapter 7 of On Lisp.
 (require '[clojure.string :as string])
+(use 'clojure.pprint)
+(use 'clojure.walk)

 (defn intersperse [sep list]
      (interpose sep list))

-(defn psent [ & vals ]
+(defn printsnt [ & vals ]
   (println (str (string/capitalize (apply str vals))
                 ".")))

@@ -14,15 +16,32 @@
   `(defmacro ~short [ & args# ]
      `(~'~long ~@args#)))

+(abbrev dmp defmacroprint)

-(defmacro defmacroprint [ name args & body ]
+(defmacro macdbg [ expr ]
+  `(pprint (macroexpand-all '~expr)))
+
+(defmacro defmacroprint [ mname args & body ]
   `(do
-     (psent "expanding macro " '~name " with args " '~args)
-     (defmacro ~name ~args
-        (do
-          (psent "evaluating macro " '~name " with arg values: "
-                 ~@(intersperse ", " (filter (fn [symb] (not= '& symb)) args)))
-          ~@body))))
+     (printsnt "expanding macro " '~mname " with args " '~args)
+     (let [macro# '(defmacro ~mname ~args
+       (do (printsnt "evaluating macro " '~mname " with arg values: "
+            ~@(intersperse ", " (filter (fn [symb] (not= '& symb)) args)))
+           ~@body))]
+       (eval macro#)
+       ;(printsnt "This macro, " '~mname " will expand to the lisp code below")
+       ;(pprint (macroexpand-all macro#))
+       )))
+
+;; easy currying macro + helper function.
+(defn curry-up [fname params body]
+  (if (empty? params)
+      body
+      (list 'fn [(first params)] (curry-up fname (rest params) body))))
+
+(dmp defnc [ fname params body ]
+  `(defn ~fname [~(first params)]
+     ~(curry-up fname (rest params) body)))

 (abbrev dmp defmacroprint)

@@ -42,22 +61,93 @@
 (our-when true
        (println "When was true!"))

+;; Without currying.
+(defn tag-n [start finish]
+  (fn [tname]
+    (str start tname finish)))

-(defn start-tag [name]
-  (str "<" name ">"))
+(defn start-tag-n [tname]
+  (tag-n "<" ">"))

-(defn end-tag [name]
-  (str "</" name ">"))
+(defn end-tag-n [tname]
+  (tag-n "</" ">"))

-(dmp deftag [tag]
+;; With currying.
+(defnc tag [start finish tname]
+       (str start tname finish))
+
+(def start-tag ((tag "<") ">"))
+
+(def end-tag ((tag "</") ">"))
+
+(defn adder-c [n]
+  (fn [a] (+ a n)))
+
+
+
+(defnc adder [a n]
+       (+ a n))
+
+(defnc sumWith [summand others]
+       (+ summand (reduce + others)))
+
+(defnc abc [a b c d e f g]
+  (+ a b c d e f g))
+(macdbg (defnc abc [a b c d e f g]
+  (+ a b c d e f g)))
+
+;; need to add support for comments, kwargs, and multi-arity override!
+(comment
+  (defnc +
+    "Returns the sum of nums. (+) returns 0. Does not auto-promote
+      longs, will throw on overflow. See also: +'"
+    {:inline (nary-inline 'add 'unchecked_add)
+        :inline-arities >1?
+        :added "1.2"}
+    ([] 0)
+    ([x] (cast Number x))
+    ([x y] (. clojure.lang.Numbers (add x y)))))
+
+(comment
+(macdbg
+(defnc +m
+    "Returns the sum of nums. (+) returns 0. Does not auto-promote
+      longs, will throw on overflow. See also: +'"
+    {:inline (nary-inline 'add 'unchecked_add)
+        :inline-arities >1?
+        :added "1.2"}
+    ([] 0)
+    ([x] (cast Number x))
+    ([x y] (. clojure.lang.Numbers (add x y))))))
+
+;;(println (str "We need 10 +m 15 = " ((+m 10) 15)))
+
+(macdbg (defnc sumWith [summand others]
+       (+ summand (reduce + others))))
+
+((comp println str) "sumWith 10 (range 1 101) should be equal to 5050 + 10 = 5060. In our case it equals: " ((sumWith 10) (range 1 101)))
+
+(defnc idd [x]
+       x)
+
+(def add2 (idd (adder 2)))
+
+(macdbg (defnc adder [a n] (+ a n)))
+
+(println (str "Adder: " add2 " add2 + 10 = " (add2 10)))
+
+(defmacro deftag [tag]
   `(defn ~tag [ & res#]
      (apply str
-        (cons (start-tag '~tag) res#))))
+       (concat (list (start-tag '~tag))
+               res#
+               (list (end-tag '~tag))))))

 (deftag html)
 (deftag head)
 (deftag title)
 (deftag body)
+(deftag div)
 (deftag h1)
 (deftag h2)
 (deftag p)
@@ -67,10 +157,33 @@
               (title "Hello"))
             (body
               (h1 "Hello World!")
+              (div (div (p "HI")
+                        (h2 "OK")))
               (p "This is a test of our html system")
               (h2 "This is a Header 2")
               (p "This is the last paragraph")))
       doc2 (p "HI")]
   (println doc))

-(println (macroexpand '(deftag html)))
+(macdbg (deftag html))
+
+(comment
+
+(defn abc [a]
+  (->> a
+       (for [i forms] id)
+       (fn [x] x)))
+
+(defn abc [a b c d e f g]
+  (+ a b c d e f g))
+
+(def abc-c
+ (fn [a]
+  (fn [b]
+   (fn [c]
+    (fn [d]
+     (fn [e]
+      (fn [f]
+       (fn [g]
+        (+ a b c d e f g)))))))))
+    )


Improve logging as we filter jobs from being considered. (#1275)

--- scheduler/src/cook/scheduler/scheduler.clj
+++ scheduler/src/cook/scheduler/scheduler.clj
@@ -582,18 +582,24 @@
             (when is-rate-limited?
               (swap! user->rate-limit-count update user #(inc (or % 0))))
             (not (and is-rate-limited? enforcing-job-launch-rate-limit?))))
-        considerable-jobs
-        (->> pending-jobs
-             (util/filter-based-on-quota user->quota user->usage)
-             (filter (fn [job] (util/job-allowed-to-start? db job)))
-             (filter user-within-launch-rate-limit?-fn)
-             (filter launch-plugin/filter-job-launches)
-             (take num-considerable)
-             ; Force this to be taken eagerly so that the log line is accurate.
-             (doall))]
+        quota-filter-jobs (util/filter-based-on-quota user->quota user->usage pending-jobs)
+        allowed-to-start-jobs (filter (fn [job] (util/job-allowed-to-start? db job)) quota-filter-jobs)
+        within-launch-rate-jobs (filter user-within-launch-rate-limit?-fn allowed-to-start-jobs)
+        launch-plugin-jobs (filter launch-plugin/filter-job-launches within-launch-rate-jobs)
+        considerable-jobs (take num-considerable launch-plugin-jobs)
+        ; Force this to be taken eagerly so that the log line is accurate.
+        considerable-jobs* (doall considerable-jobs)]
     (swap! pool->user->number-jobs update pool-name (constantly @user->number-jobs))
     (log/info "Users whose job launches are rate-limited " @user->rate-limit-count "( enforcing =" enforcing-job-launch-rate-limit? ")")
-    considerable-jobs))
+    (log/info "In" pool-name "pool, there are"
+              (count pending-jobs) "pending ->"
+              (count quota-filter-jobs) "quota-filtered ->"
+              (count allowed-to-start-jobs) "allowed-to-start ->"
+              (count within-launch-rate-jobs) "within-launch-rate ->"
+              (count launch-plugin-jobs) "allowed by launch-plugin ->"
+              "and"
+              (count considerable-jobs*) "considerable jobs")
+    considerable-jobs*))

 (defn matches->job-uuids


Make cursor use Reaction all the way

Make cursor use Reaction all the way

--- src/reagent/ratom.cljs
+++ src/reagent/ratom.cljs
@@ -108,48 +108,48 @@
   Object
   (_reaction [this]
     (if (nil? reaction)
-      (set! reaction (make-reaction #(get-in @ratom path)))
+      (set! reaction (make-reaction
+                      #(get-in @ratom path)
+                      :on-set (if setf
+                                #(setf %2)
+                                #(swap! ratom assoc-in path %2))))
       reaction))
+
+  (_peek [this]
+    (binding [*ratom-context* nil]
+      (deref (._reaction this))))

   IDeref
   (-deref [this]
     (deref (._reaction this)))

   IReset
-  (-reset! [a new-value]
-    (if (nil? setf)
-      (swap! ratom assoc-in path new-value)
-      (setf new-value)))
+  (-reset! [this new-value]
+    (reset! (._reaction this) new-value))

   ISwap
   (-swap! [a f]
-    (-reset! a (f (peek-at ratom path))))
+    (-reset! a (f (._peek a))))
   (-swap! [a f x]
-    (-reset! a (f (peek-at ratom path) x)))
+    (-reset! a (f (._peek a) x)))
   (-swap! [a f x y]
-    (-reset! a (f (peek-at ratom path) x y)))
+    (-reset! a (f (._peek a) x y)))
   (-swap! [a f x y more]
-    (-reset! a (apply f (peek-at ratom path) x y more)))
+    (-reset! a (apply f (._peek a) x y more)))

   IPrintWithWriter
   (-pr-writer [a writer opts]
-    ;; not sure about how this should be implemented?
-    ;; should it print as an atom focused on the appropriate part of
-    ;; the ratom - (pr-writer (get-in @ratom path)) - or should it be
-    ;; a completely separate type? and do we need a reader for it?
     (-write writer "#<Cursor: ")
-    (pr-writer path writer opts)
-    (-write writer " ")
-    (pr-writer ratom writer opts)
+    (pr-writer (._peek a) writer opts)
     (-write writer ">"))

   IWatchable
   (-notify-watches [this oldval newval]
-    (-notify-watches ratom oldval newval))
+    (-notify-watches (._reaction this) oldval newval))
   (-add-watch [this key f]
-    (-add-watch ratom key f))
+    (-add-watch (._reaction this) key f))
   (-remove-watch [this key]
-    (-remove-watch ratom key))
+    (-remove-watch (._reaction this) key))

   IHash
   (-hash [this] (hash [ratom path setf])))


Add vimclojure.util/cheat-sheet

Add vimclojure.util/cheat-sheet

--- server/src/main/clojure/vimclojure/util.clj
+++ server/src/main/clojure/vimclojure/util.clj
@@ -23,7 +23,8 @@
 (ns vimclojure.util
   (:require
     [clojure.pprint :as pprint]
-    [clojure.stacktrace :as stacktrace]))
+    [clojure.stacktrace :as stacktrace]
+    [clojure.string :as string]))

 ; Common helpers
 (defn str-cut
@@ -430,3 +431,33 @@
   (catch Exception exc
     (when-not (re-find #"Could not locate clj_stacktrace/repl__init.class or clj_stacktrace/repl.clj on classpath" (str exc))
       (throw exc))))
+
+;;;
+;;; Clojure cheat-sheet
+;;;
+
+(defn cheat-sheet
+  "Return a formatted summary of public vars in given namespaces."
+  [& namespaces]
+  (string/join
+    "\n\n"
+    (map (fn [n]
+           (let [mdata (mapv #((juxt :ns :name :arglists) (meta %))
+                             (vals (ns-publics n)))
+                 {defs  true
+                  funcs false} (group-by (comp nil? peek) mdata)
+                 len   (inc (apply max 0 (map (comp count str second) funcs)))
+                 defs  (map #(apply format "%s/%s" %) defs)
+                 funcs (map #(apply format (str "%s/%-" len "s%s") %) funcs)]
+             (str ";;; " n " {{{1\n\n"
+                  (string/join "\n" (sort defs))
+                  (when (seq defs) "\n")
+                  (string/join "\n" (sort funcs)))))
+         (sort-by ns-name namespaces))))
+
+(defn print-cheat-sheet!
+  "Print cheat sheets for extant namespaces filtered by optional regex."
+  ([] (print-cheat-sheet! #"."))
+  ([re] (let [xs (filter #(re-seq re (str %)) (all-ns))]
+          (when (seq xs)
+            (println (apply cheat-sheet xs))))))


use callbacks for lwwr js streaming

use callbacks for lwwr js streaming

--- src/replikativ/js.cljs
+++ src/replikativ/js.cljs
@@ -91,8 +91,11 @@
 (defn ^:export streamORMapIntoIdentity [stage user crdt-id stream-eval-fns target]
   (ormap-realize/stream-into-identity! stage [user crdt-id] (eval-fns->js stream-eval-fns) target))

-(defn ^:export streamLWWRIntoIdentity [stage user crdt-id target]
-  (lwwr-realize/stream-into-atom! stage [user crdt-id] target))
+(defn ^:export streamLWWR [stage user crdt-id cb]
+  (let [val-atom (atom nil)
+        _ (add-watch val-atom :watcher (fn [_ _ _ new-state]
+                                         (cb (clj->js new-state))))]
+    (lwwr-realize/stream-into-atom! stage [user crdt-id] val-atom)))

 (defn ^:export createUUID [s]
   (cljs.core/uuid s))
@@ -109,9 +112,9 @@
                                  :onNode        on-node?
                                  :createStage   createStage
                                  :newMemStore   newMemStore
-                                 :LWWR #js {:createLWWR createLWWR
-                                            :streamIntoIdentity streamLWWRIntoIdentity
-                                            :setRegister setRegister}
+                                 :LWWR #js {:create createLWWR
+                                            :stream streamLWWR
+                                            :set setRegister}
                                  :ORMap         #js {:createORMap        createORMap
                                                      :streamIntoIdentity streamORMapIntoIdentity
                                                      :associate          associate}


Bitbucket behind feature flag

Bitbucket behind feature flag

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -7,6 +7,7 @@
             [frontend.components.forms :refer [managed-button]]
             [frontend.config :as config]
             [frontend.datetime :as datetime]
+            [frontend.models.feature :as feature]
             [frontend.models.organization :as organization]
             [frontend.models.repo :as repo-model]
             [frontend.models.user :as user-model]
@@ -25,6 +26,9 @@

 (def view "add-projects")

+(defn vcs-github? [item] (contains? #{"github" nil} (:vcs_type item)))
+(defn vcs-bitbucket? [item] (= "bitbucket" (:vcs_type item)))
+
 (defn missing-scopes-notice [current-scopes missing-scopes]
   [:div
    [:div.alert.alert-error
@@ -46,12 +50,12 @@
      [:div.orgname login]
      (cond
        ;; TODO remove the nil check after a migration adds vcs-type to all entities
-       (contains? #{"github" nil} vcs-type)
+       (vcs-github? org)
        [:a.visit-org {:href (str (gh-utils/http-endpoint) "/" login)
                       :target "_blank"}
         [:i.octicon.octicon-mark-github]]

-       (= "bitbucket" vcs-type)
+       (vcs-bitbucket? org)
        [:a.visit-org
         [:i.fa.fa-bitbucket]])]))

@@ -69,6 +73,45 @@
    "."])

 (defn organization-listing [data owner]
+  (reify
+    om/IDisplayName (display-name [_] "Organization Listing")
+    om/IDidMount
+    (did-mount [_]
+      (utils/tooltip "#collaborators-tooltip-hack" {:placement "right"}))
+    om/IRender
+    (render [_]
+      (let [{:keys [user settings repos]} data]
+        (html
+         [:div
+          [:div.overview
+           [:span.big-number "1"]
+           [:div.instruction "Choose a GitHub account that you are a member of or have access to."]]
+          [:div.organizations
+           [:h4 "Your accounts"]
+           [:ul.organizations
+            (map (fn [org] (organization org settings owner))
+                 ;; here we display you, then all of your organizations, then all of the owners of
+                 ;; repos that aren't organizations and aren't you. We do it this way because the
+                 ;; organizations route is much faster than the repos route. We show them
+                 ;; in this order (rather than e.g. putting the whole thing into a set)
+                 ;; so that new ones don't jump up in the middle as they're loaded.
+                 (filter vcs-github?
+                  (concat [user]
+                          (:organizations user)
+                          (let [org-names (->> user :organizations (cons user) (map :login) set)
+                                in-orgs? (comp org-names :login)]
+                            (->> repos (map :owner) (remove in-orgs?) (set))))))]
+           (when (:repos-loading user)
+             [:div.orgs-loading
+              [:div.loading-spinner common/spinner]])
+           (missing-org-info owner)]])))))
+
+(defn select-vcs-type [vcs-type item]
+  (case vcs-type
+    "bitbucket" (vcs-bitbucket? item)
+    "github"    (vcs-github?    item)))
+
+(defn organization-listing-with-bitbucket [data owner]
   (reify
     om/IDisplayName (display-name [_] "Organization Listing")
     om/IDidMount
@@ -108,17 +151,18 @@
                  ;; organizations route is much faster than the repos route. We show them
                  ;; in this order (rather than e.g. putting the whole thing into a set)
                  ;; so that new ones don't jump up in the middle as they're loaded.
-                 (filter #(= (:vcs_type %) vcs-type) (concat [user]
-                                     (:organizations user)
-                                     (let [org-names (->> user
-                                                          :organizations
-                                                          (cons user)
-                                                          (map :login)
-                                                          set)
-                                           in-orgs? (comp org-names :login)]
-                                       (->> repos (map :owner)
-                                            (remove in-orgs?)
-                                            (set))))))]
+                 (filter (partial select-vcs-type vcs-type)
+                         (concat [user]
+                                 (:organizations user)
+                                 (let [org-names (->> user
+                                                      :organizations
+                                                      (cons user)
+                                                      (map :login)
+                                                      set)
+                                       in-orgs? (comp org-names :login)]
+                                   (->> repos (map :owner)
+                                        (remove in-orgs?)
+                                        (set))))))]
            (when (:repos-loading user)
              [:div.orgs-loading
               [:div.loading-spinner common/spinner]])]])))))
@@ -427,9 +471,12 @@
          [:p "CircleCI helps you ship better code, faster. To kick things off, you'll need to pick some projects to build:"]
          [:hr]
          [:div.org-listing
-          (om/build organization-listing {:user user
-                                          :settings settings
-                                          :repos repos})]
+          (om/build (if (feature/enabled? :bitbucket)
+                      organization-listing-with-bitbucket
+                      organization-listing)
+                    {:user user
+                     :settings settings
+                     :repos repos})]
          [:hr]
          [:div#project-listing.project-listing
           [:div.overview


Show it in the org settings page too.

Show it in the org settings page too.

Conflicts:
	src-cljs/frontend/components/org_settings.cljs

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -13,6 +13,7 @@
             [frontend.components.inputs :as inputs]
             [frontend.components.plans :as plans-component]
             [frontend.components.shared :as shared]
+            [frontend.components.project.common :as project-common]
             [frontend.state :as state]
             [frontend.stripe :as stripe]
             [frontend.utils :as utils :include-macros true]
@@ -931,12 +932,15 @@
     om/IRender
     (render [_]
       (let [org-data (get-in app state/org-data-path)
-            subpage (or (get app :org-settings-subpage) :overview)]
+            subpage (or (get app :org-settings-subpage) :overview)
+            plan (get-in app state/org-plan-path)]
         (html [:div.container-fluid.org-page
                (if-not (:loaded org-data)
                  [:div.loading-spinner common/spinner]
                  [:div.row-fluid
                   [:div.span9
+                   (when (pm/suspended? plan)
+                     (om/build project-common/suspended-notice plan))
                    (om/build common/flashes (get-in app state/error-message-path))
                    [:div#subpage
                     [:div


add id

add id

--- src/s7p/slave/core.clj
+++ src/s7p/slave/core.clj
@@ -113,14 +113,16 @@
             :price win-price
             :isClick (click? result response)}})

-(defn log-winnotice-option [test data]
+(defn log-winnotice-option [test request-id data]
   (if data
     (let [{dsp :dsp notice :notice} data]
       (winnotice/log (assoc notice :status "auction" :dspId (:id dsp) :test test)))
-    (winnotice/log {:status "no auction" :test test})))
+    (winnotice/log {:status "no auction" :id request-id :test test}))
+  data)

 (defn winnotice [{dsp :dsp notice :notice}]
-  (http/post (:winnotice dsp) (json-request-option notice)))
+  (http/post (:winnotice dsp) (json-request-option notice))
+  )

 (defn work [test req result]
   (->> @dsps
@@ -133,7 +135,7 @@
                   (map (fn [{dsp :dsp res :response}] {:dsp dsp :response res}))))
        (auction (:floorPrice req))
        (non-nil #(to-winnotice result %))
-       (log-winnotice-option test)
+       (log-winnotice-option test (:id req))
        (non-nil winnotice)))

 (defn worker [c]


Use a more reasonable refresh delay.

Use a more reasonable refresh delay.

--- src/shale/periodic.clj
+++ src/shale/periodic.clj
@@ -5,7 +5,7 @@
 (def thread-pool (mk-pool))

 (defn schedule! []
-  (every 10 #(sessions/refresh-sessions nil) thread-pool :fixed-delay true))
+  (every 200 #(sessions/refresh-sessions nil) thread-pool :fixed-delay true))

 (defn stop! []
   (stop-and-reset-pool! thread-pool))


[#164] OOM due to running some queries in a future

Close PersistentManager on the future threads also.

--- api/src/clojure/org/akvo/flow_api/boundary/survey.clj
+++ api/src/clojure/org/akvo/flow_api/boundary/survey.clj
@@ -5,6 +5,7 @@
             org.akvo.flow-api.component.remote-api
             [org.akvo.flow-api.datastore :as ds]
             [org.akvo.flow-api.datastore.survey :as survey]
+            [org.akvo.flow-api.middleware.jdo-persistent-manager :as jdo-persistent-manager]
             [org.akvo.flow-api.boundary.user :as user]))

 (defn get-survey-definition [{:keys [cache]} instance-id user-id survey-id]
@@ -39,8 +40,9 @@
         mapping-fn (if (> (count instances) 1) pmap map)]
     (survey/keep-allowed-to-see
       surveys
-      (mapping-fn (fn [instance]
-                    (when-let [user-id (user/id-by-email remote-api instance user-email)]
-                      {:instance-id instance
-                       :survey-ids (survey/cached-list-ids remote-api instance user-id)}))
+      (mapping-fn (jdo-persistent-manager/wrap-close-persistent-manager
+                    (fn [instance]
+                      (when-let [user-id (user/id-by-email remote-api instance user-email)]
+                        {:instance-id instance
+                         :survey-ids (survey/cached-list-ids remote-api instance user-id)})))
         instances))))


Cleaning up printlns

Cleaning up printlns

--- modules/graclj-tools/src/main/clojure/org/graclj/tools/test/clojure_test.clj
+++ modules/graclj-tools/src/main/clojure/org/graclj/tools/test/clojure_test.clj
@@ -1,10 +1,8 @@
 (ns org.graclj.tools.test.clojure-test
-  (:require [clojure.test :as test]
-            [clojure.stacktrace :as stack])
+  (:require [clojure.test :as test])
   (:import (java.lang.annotation Annotation)
            (org.junit.runner Description)
-           (org.junit.runner.notification Failure)
-           (junit.framework TestFailure)))
+           (org.junit.runner.notification Failure)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; JUnit helpers
@@ -110,20 +108,16 @@
   :state tests)

 (defn -init [_]
-  (println (seq (.getURLs (ClassLoader/getSystemClassLoader))))
-  (println "In init method...")
   [[] (atom (scan-tests))])

 (defn -getDescription [this]
-  (println "In getDescription method...")
-  (let [suite (describe-suite "GracljFakeSuite")]
+  (let [suite (describe-suite "GracljParentSuite")]
     (doseq [test @(.tests this)]
       (.addChild (:description test)))
     (println suite)
     suite))

 (defn -run [this notifier]
-  (println "In run method....")
   (println @(.tests this))
   (let [test-vars (map :var @(.tests this))]
     (println test-vars)
@@ -131,7 +125,6 @@
        (test/test-vars test-vars))))

 (defn -filter [this desc-filter]
-  (println "In filter method...")
   (letfn [(run? [test] (->> test :description (.shouldRun desc-filter)))
           (trim [tests] (filter run? tests))]
     (swap! (.tests this) trim)))


date and link are now part of a conference | sg | #0

--- src/cljs/conference_rating/conference.cljs
+++ src/cljs/conference_rating/conference.cljs
@@ -116,6 +116,8 @@
 (def conference-form-template
   [:div
    (form-input "Name" [:input {:field :text :id :name :class "form-control" :placeholder "Name of the conference"}])
+   (form-input "Date" [:input {:field :text :id :date :class "form-control" :placeholder "Date of the conference"}])
+   (form-input "Link" [:input {:field :text :id :link :class "form-control" :placeholder "Link to the conference page"}])
    (form-input "Description" [:textarea {:field :textarea :rows 5 :id :description :class "form-control" :placeholder "More information about the conference"}])])

 (defn create-conference [form-data]


Badgbl terms and conditions, updated footer

--- src/cljs/salava/extra/badgbl/ui/block.cljs
+++ src/cljs/salava/extra/badgbl/ui/block.cljs
@@ -1,2 +1,99 @@
 (ns salava.extra.badgbl.ui.block
   (:require [salava.core.i18n :refer [t]]))
+
+(defn ^:export footer []
+  [:footer.footer
+   [:div.footer-container
+    [:p.text-muted
+     "Auteursrecht © 2019 Open Badge Fabriek | "
+     [:a {:class "bottom-link" :href "mailto:info@badgbl.nl"}
+      "info@badgbl.nl"]]
+    [:p.text-muted
+     "Powered by Open Badge Factory ®. Open Badge Factory ® is a registered trademark"]]])
+
+(defn ^:export terms []
+  [:div {:style {:padding "15px"}}
+   [:h1 {:style {:text-align "center"}} "Privacybeleid"]
+   [:div
+    [:p {:style {:text-align "center"}} "Bijgewerkt 05.09.2019"]
+    [:p ""]
+    [:ol {:style {:list-style-type "none"}}
+     [:li [:h3 "Controller"]
+      [:div
+       [:p "Open Badge Fabriek"]
+       [:p ""]
+       [:p "Nelson Mandelaboulevard 22 34, 5342 CZ Oss"]
+       [:p "Nederland"]
+       [:p [:a {:href "mailto:info@openbadgefabriek.nl"} "info@openbadgefabriek.nl"]]
+       [:p "(hierna ”wij” of ”Open Badge Fabriek”)"]]]
+
+     [:li [:h3 "Contactpersoon voor registratiezaken "]
+      [:div
+       [:p "Martijn Bos"]
+       [:p "Nelson Mandelaboulevard 22 34, 5342 CZ Oss"]
+       [:p "Nederland"]
+       [:p "Telefoonnummer: 06 20301222"]
+       [:p [:a {:href "mailto:info@openbadgefabriek.nl"} "info@openbadgefabriek.nl"]]]]
+
+     [:li  [:h3 "Naam van het register"]
+      [:div
+       [:p "KLANTEN- EN MARKETINGREGISTER VOOR OPEN BADGE PASPOORT SERVICE"]]]
+     [:li [:h3 "Wat is de wettelijke basis voor en het doel van de verwerking van persoonsgegevens?"]
+      [:div
+       [:p "De basis voor de verwerking van persoonsgegevens is het gerechtvaardigde belang van Open Badge Factory op basis van een klantrelatie of de uitvoering van een overeenkomst met de betrokkene, alsmede de toestemming voor direct marketing."]
+       [:p "De basis voor de verwerking van persoonlijke gegevens is:"]
+       [:ul
+        [:li "de levering en ontwikkeling van onze Open Badge Passport Service (”Service”),"]
+        [:li "het nakomen van onze contractuele en andere beloften en verplichtingen, "]
+        [:li "het verzorgen van de klantrelatie, "]
+        [:li "het analyseren en profileren van het gedrag van de betrokkene, "]
+        [:li "elektronische en direct marketing, "]
+        [:li "gericht op reclame in onze en andermans online diensten"]]]]
+     [:li [:h3 "Welke gegevens verwerken we?"]
+      [:div
+       [:p "Wij verwerken de volgende persoonlijke gegevens van u: "]
+       [:ul
+        [:li "Basisgegevens van de betrokkene zoals naam*, land*, taal*, taal*, gebruikersnaam*, wachtwoord*"]
+        [:li "Contactgegevens van het e-mailadres van de betrokkene*, telefoonnummer, adres, woonplaats, stad, staat"]
+        [:li "Informatie over de servicerelatie en het contract, zoals details van de open badge(s) die aan de betrokkene zijn toegekend, details van het gebruikersprofiel, correspondentie met de betrokkene en andere referenties, cookies en gegevens met betrekking tot het gebruik ervan; "]
+        [:li "Andere vrijwillige informatie die door de betrokkene in de Dienst wordt verstrekt, zoals persoonlijke introductie in de Dienst, links naar sociale media-accounts (zoals Facebook, Linkedin, Twitter, Pinterest, Instagram, blogs etc.)."]]
+
+       [:p "Het vastleggen van persoonlijke gegevens gemarkeerd met een sterretje en het toestaan van het gebruik van cookies in de browser van de gebruiker van de dienst, is een vereiste voor onze contractuele relatie met de betrokkene. Zonder deze noodzakelijke informatie zijn wij niet in staat om de Dienst te leveren."]]]
+
+     [:li [:h3 "Waarvan ontvangen wij de gegevens?"]
+      [:div
+       [:p " Wij ontvangen de bovengenoemde persoonlijke gegevens voornamelijk van de betrokkene zelf, omdat de gegevens door de betrokkene in de Dienst worden ingevoerd."]
+       [:p "Wij ontvangen het e-mailadres van de betrokkene waarnaar wij de toegekende Open Badge van onze klant (als verantwoordelijke voor de verwerking van de gegevens) sturen. In deze relatie treden wij op als verantwoordelijke voor de verwerking van de gegevens."]
+       [:p "Voor de in deze privacyverklaring beschreven doeleinden kunnen persoonlijke gegevens ook uit openbare bronnen en op basis van informatie van overheden of andere derden binnen de grenzen van de geldende wet- en regelgeving worden verzameld en geactualiseerd. Het bijwerken van deze gegevens wordt handmatig of automatisch uitgevoerd."]]]
+
+
+     [:li [:h3 "Aan wie geven we gegevens vrij en dragen we gegevens over buiten de EU of de EER?"]
+      [:div
+       [:p "Alleen de gebruikersnaam van de betrokkene, die elke gebruiker zelf kan definiëren, wordt aan andere gebruikers in de Dienst getoond "]
+       [:p "Wij verwerken de informatie zelf en maken gebruik van onderaannemers die voor en namens ons persoonsgegevens verwerken. Wij hebben het IT-beheer uitbesteed aan een externe dienstverlener, aan wiens server de gegevens worden opgeslagen. De server wordt beschermd en beheerd door de externe dienstverlener."]
+       [:p "Gegevens kunnen onder dwingende bepalingen aan autoriteiten worden verstrekt. Wij geven geen informatie van het register door aan externe partijen."]
+       [:p "Wij kunnen geaggregeerde, anonieme informatie over u vrijgeven voor marketing, reclame, onderzoek, naleving of andere doeleinden."]
+       [:p "Wij dragen geen persoonlijke gegevens over buiten de EU/EER."]]]
+
+     [:li [:h3 "Hoe beschermen we de gegevens en hoe lang bewaren we ze? "]
+      [:div
+       [:p "De persoonlijke gegevens worden verzameld in databases die beschermd worden door firewalls, wachtwoorden en andere technische maatregelen. De databanken en de back-up kopieën ervan bevinden zich in een afgesloten ruimte en zijn alleen toegankelijk voor bepaalde vooraf aangewezen personen, d.w.z. alleen die van onze medewerkers, die ten behoeve van hun werk het recht hebben om klantgegevens te verwerken. Tot deze personen behoren het personeel van de klantenservice van de Service Provider en de technische beheerders van de Service. Elke gebruiker heeft een persoonlijke gebruikersnaam en wachtwoord voor het systeem."]
+       [:p "De betrokkene kan te allen tijde al zijn/haar gegevens toevoegen, wijzigen en verwijderen uit de Service, alsmede zijn/haar account volledig verwijderen. Het verwijderen van de account wist alle gegevens van de betrokkene uit de Dienst."]
+       [:p "Wij bewaren de gegevens zolang als nodig is voor de verwerking van de gegevens. Wij schatten regelmatig de behoefte aan gegevensopslag in, rekening houdend met de geldende wetgeving. Bovendien zorgen wij ervoor dat er geen incompatibele, verouderde of onnauwkeurige persoonlijke gegevens in het register worden opgeslagen, rekening houdend met het doel van de verwerking."]]]
+
+     [:li [:h3 "Wat zijn uw rechten als betrokkene?"]
+      [:div
+       [:p "Als betrokkene heeft u recht op inzage in de persoonsgegevens die op u betrekking hebben en die in het register zijn opgeslagen, en het recht om correctie of verwijdering van de gegevens te eisen. Dit kan worden gedaan door uw persoonlijke gegevens die zijn opgeslagen in de Dienst te openen, te wijzigen en/of te verwijderen door in te loggen op de Dienst. Als u hulp nodig hebt, neem dan contact op met de persoon die in punt 2 hierboven wordt genoemd. "]
+       [:p "U heeft ook het recht om uw toestemming voor direct marketing in te trekken of te wijzigen."]
+       [:p "Als betrokkene heeft u het recht om bezwaar te maken tegen de verwerking of om een beperking van de verwerking te verzoeken en een klacht in te dienen bij een toezichthoudende instantie die verantwoordelijk is voor de verwerking van persoonsgegevens."]
+       [:p "Om specifieke persoonlijke redenen heeft u ook het recht om bezwaar te maken tegen het opstellen van profielen en andere verwerkingen die op u betrekking hebben, wanneer de verwerking van de gegevens gebaseerd is op de klantenrelatie. In verband met uw claim dient u de specifieke situatie te identificeren waarin u bezwaar maakt tegen de verwerking. Wij kunnen een dergelijk verzoek op grond van de wet weigeren."]
+       [:p "Als betrokkene heeft u te allen tijde het recht om kosteloos bezwaar te maken tegen de verwerking, inclusief het opstellen van profielen, voor zover deze betrekking hebben op direct marketing."]]]
+
+
+     [:li [:h3 "Met wie kunt u in contact komen?"]
+      [:div
+       [:p "Alle contacten en verzoeken met betrekking tot deze privacyverklaring dienen schriftelijk of persoonlijk te worden ingediend bij de in lid 2 (2) genoemde persoon."]]]
+
+     [:li [:h3 "Wijzigingen in de Privacy Verklaring"]
+      [:div
+       [:p "Mochten wij wijzigingen aanbrengen in deze privacyverklaring, dan zullen wij de gewijzigde verklaring op onze website plaatsen, met vermelding van de wijzigingsdatum. Als de wijzigingen belangrijk zijn, kunnen wij u hier ook op andere manieren over informeren, bijvoorbeeld door het sturen van een e-mail of het plaatsen van een bulletin op onze homepage. Wij raden u aan deze principes voor de bescherming van de privacy van tijd tot tijd door te nemen om er zeker van te zijn dat u op de hoogte bent van eventuele wijzigingen."]]]]]])


More variants of login dialog DSL

More variants of login dialog DSL

It seems like a very silly thing to write myself. It's just that most of
the variations that other people have written seem to be a very poor
fit.

Hopefully sablono will be Just Right.

--- src/com/frereth/server/comms/registrar.clj
+++ src/com/frereth/server/comms/registrar.clj
@@ -51,6 +51,79 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Internal

+(defn define-world-om
+  []
+  (let [br {:tag :br, :attrs nil, :content nil}]
+    {:type :om
+     :version [0 9 0]
+     ;; TODO: At the very least, use something like enlive/kioo instead
+     ;; Note that this nesting seems pretty awfully incorrect
+     :body '(form {:attr {:id "authenticate"}
+                   :content ["User name:"
+                             (br)
+                             (input {:attr {:name "principal-name",
+                                            :type "text"}
+                                     :content [(br)
+                                               "Password:"
+                                               (input {:attr {:name "auth-token"
+                                                              :type "password"}
+                                                       :content [(br)]})
+                                               (input {:attr {:name "submit"
+                                                              :type "submit"
+                                                              :value "Log In"}})]})]})}))
+
+(defn define-world-in-sablono
+  []
+  {:type :sablono
+   :version [0 3 6]
+   :body [:div {:id "authenticate"}
+          "User name:"
+          :br
+          :input {:name "principal-name"
+                  :type "text"}
+          :br
+          "Password:"
+          :br
+          :input {:name "auth-token"
+                  :type "password"}
+          :br
+          :input {:name "submit"
+                  :type "submit"
+                  :value "Log In"}]})
+
+(defn define-initial-auth-world
+  "Because I'm having issues sending data in a format that makes sense to render.
+Raw HTML was/is a giant FAIL.
+Creating my own DSL to describe Om seems like a horrible idea.
+Enlive/kioo is super attractive...but the model of specifying URLs to get the template to render fails abjectly.
+So give salono a shot."
+  []
+  (let [body (define-world-in-sablono)]
+    '{data (assoc body
+                  :name "Initial Local Login"
+                  ;; This basic script was taken from
+                  ;; http://swannodette.github.io/2013/11/07/clojurescript-101/
+                  ;; Vital assumptions here:
+                  ;; 1. Basic clojurescript environment
+                  ;; 2. use'ing the core.async ns
+                  ;; 3. require'd goog.dom as dom and goog.events as events
+                  ;; Or, at least, that we're in an interpreter
+                  ;; environment/namespace
+                  ;; that acts as if those assumptions are true
+                  :script [(defn listen [element event-type]
+                             (let [out (chan)]
+                               (events/listen element event-type
+                                              (fn [e]
+                                                (put! out e)))
+                               out))
+                           (let [clicks (listen (dom/getElement "submit") "click")]
+                             (go (while true
+                                   (raise :start-here)
+                                   (let [clicked (<! clicks)
+                                         ]))))]
+                  ;; TODO: Definitely use garden to build something here
+                  :css [])}))
+
 (s/defn authcz :- auth-socket/router-message
   "This needs to do much, much more.
 Check the database for rbac. Set up a real session
@@ -84,53 +157,14 @@
                   pretty-msg))
   (log/warn "Set up a web server and switch back to serving data that way")
   ;; TODO: Set up a web server and go back to doing it this way
-  (let [br {:tag :br, :attrs nil, :content nil}]
-    (assoc msg
-           :action-url {:port 7841  ; FIXME: Magic Number
-                        ;; TODO: Pull this from a config file/env var instead
-                        :address (util/my-ip)
-                        :protocol :tcp}
-           :expires (date/to-java-date (date/plus (date/date-time) (date/days 1)))
-           :session-token (util/random-uuid)
-           :world '{:data {:type :om
-                           :version [0 9 0]
-                           ;; TODO: At the very least, use something like enlive/kioo instead
-                           :body '(form {:attr {:id "authenticate"}
-                                         :content ["User name:"
-                                                   (br)
-                                                   (input {:attr {:name "principal-name",
-                                                                  :type "text"}
-                                                           :content [(br)
-                                                                     "Password:"
-                                                                     (input {:attr {:name "auth-token"
-                                                                                :type "password"}
-                                                                             :content [(br)]})
-                                                                     (input {:attr {:name "submit"
-                                                                                :type "submit"
-                                                                                :value "Log In"}})]})]})
-
-                           ;; This basic script was taken from
-                           ;; http://swannodette.github.io/2013/11/07/clojurescript-101/
-                           ;; Vital assumptions here:
-                           ;; 1. Basic clojurescript environment
-                           ;; 2. use'ing the core.async ns
-                           ;; 3. require'd goog.dom as dom and goog.events as events
-                           ;; Or, at least, that we're in an interpreter
-                           ;; environment/namespace
-                           ;; that acts as if those assumptions are true
-                           :script [(defn listen [element event-type]
-                                      (let [out (chan)]
-                                        (events/listen element event-type
-                                                       (fn [e]
-                                                         (put! out e)))
-                                        out))
-                                    (let [clicks (listen (dom/getElement "submit") "click")]
-                                      (go (while true
-                                            (raise :start-here)
-                                            (let [clicked (<! clicks)
-                                                  ]))))]
-                           ;; TODO: Definitely use garden to build something here
-                           :css []}})))
+  (assoc msg
+         :action-url {:port 7841  ; FIXME: Magic Number
+                      ;; TODO: Pull this from a config file/env var instead
+                      :address (util/my-ip)
+                      :protocol :tcp}
+         :expires (date/to-java-date (date/plus (date/date-time) (date/days 1)))
+         :session-token (util/random-uuid)
+         :world (define-initial-auth-world)))

 (comment
   (require '[clojure.xml :as xml])


set my-connection on first get-client call

--- src/com/okl/tokenmgr/zookeeper_storage.clj
+++ src/com/okl/tokenmgr/zookeeper_storage.clj
@@ -10,11 +10,12 @@
         string (join ":" [(:host config) (:port config)])]
     string))

-(def my-connection (atom (zk/connect (zk-string))))
+(def my-connection (atom nil))

 ;; obtain a client; will reconnect if the client has closed
 (defn- get-client []
-  (if (= :CLOSED (zk/state @my-connection))
+  (if (or (nil? @my-connection)
+          (= :CLOSED (zk/state @my-connection)))
     (swap! my-connection (fn[x] (zk/connect (zk-string)))))
   @my-connection)


Exit non-zero if `deactivate node` submission fails

This command will now exit with the number of submissions which failed.

--- src/com/puppetlabs/cmdb/cli/deactivate.clj
+++ src/com/puppetlabs/cmdb/cli/deactivate.clj
@@ -7,7 +7,8 @@

 (defn deactivate
   "Submits a 'deactivate node' request for `node` to the Grayskull instance
-  specified by `host` and `port`."
+  specified by `host` and `port`. Returns a true value if submission succeeded,
+  and a false value otherwise."
   [node host port]
   (let [msg    (-> {:command "deactivate node"
                     :version 1
@@ -22,7 +23,8 @@
                                  :content-type       :x-www-form-urlencoded
                                  :character-encoding "UTF-8"
                                  :accept             :json})]
-    (if (not= 200 (:status result))
+    (if (= 200 (:status result))
+      true
       (log/error result))))

 (defn -main
@@ -31,7 +33,11 @@
                               ["-c" "--config" "Path to config.ini"])
         config      (ini-to-map (:config options))
         host        (get-in config [:jetty :host] "localhost")
-        port        (get-in config [:jetty :port] 8080)]
-    (doseq [node nodes]
-      (log/info (str "Deactivating node " node))
-      (deactivate node host port))))
+        port        (get-in config [:jetty :port] 8080)
+        failures    (->> nodes
+                      (map (fn [node]
+                             (log/info (str "Submitting deactivation command for " node))
+                             (deactivate node host port)))
+                      (filter (complement identity))
+                      (count))]
+    (System/exit failures)))


Introduce new names in EL-gfp lcs computation

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

--- src/conexp/contrib/dl/languages/EL_gfp.clj
+++ src/conexp/contrib/dl/languages/EL_gfp.clj
@@ -91,14 +91,13 @@
             G_T_B      (tbox->description-graph tbox-B),
             G-x-G      (graph-product G_T_A G_T_B [A,B]),
             _ (println "LCS CHECK 2")
-            T_2        (description-graph->tbox G-x-G),
+            [T target] (uniquify-ttp [(description-graph->tbox G-x-G) [A,B]]),
             _ (println "LCS CHECK 3")]
         (if (= #{}
                (set ((vertex-labels G-x-G) [A,B]))
                (set ((neighbours G-x-G) [A,B])))
-          [T_2 [A,B]]
-          (recur T_2
-                 (conj (nthnext concepts 2) [A,B])))))))
+          [T target]
+          (recur T (conj (nthnext concepts 2) target)))))))

 (defn EL-gfp-msc
   "Returns the model based most specific concept of objects in model."


Simplify generate-name function for robot-name

This commit updates the generate-name function in robot-name to use
clojure's rand-int function instead of java interop. It also updates the
rand-int call to include all of the range 0-999 and refactors the string
assembly somewhat.

--- exercises/robot-name/src/example.clj
+++ exercises/robot-name/src/example.clj
@@ -1,10 +1,9 @@
 (ns robot-name)

-(def ^:private random (java.util.Random.))
 (def ^:private letters (map char (range 65 91)))
 (defn- generate-name []
-  (str (apply str (take 2 (shuffle letters)))
-       (+ 100 (.nextInt random 899))))
+  (format "%s%03d" (apply str (repeatedly 2 #(first (shuffle letters))))
+          (rand-int 1000)))

 (defn robot []
   (atom {:name (generate-name)}))


GAWB-1405 pt. 2 (#715)

GAWB-1405 pt. 2 (#715)

--- src/cljs/main/broadfcui/common/components.cljs
+++ src/cljs/main/broadfcui/common/components.cljs
@@ -658,11 +658,15 @@
                                                                           res))
                                                                  (js->clj data))}))}
                 :templateResult (fn [res]
-                                  (.-tag res))
-                :templateSelection (fn [res]
-                                     (if (.-tag res)
-                                       (.-tag res)
-                                       (.-text res)))
+                                  (if (.-loading res)
+                                    "Loading..."
+                                    (let [count-bubble (react/create-element (style/render-count (.-count res)))
+                                          tag-text (.createTextNode js/document (.-tag res))
+                                          element (.createElement js/document "div")]
+                                      (react/render count-bubble element)
+                                      (.appendChild element tag-text)
+                                      element)))
+                :templateSelection (some-fn #(aget % "tag") #(aget % "text"))
                 :tags true})))
    :component-will-unmount
    (fn [{:keys [refs]}]


Add missing query options

Add missing query options

--- src/clojure/clojurewerkz/cassaforte/client.clj
+++ src/clojure/clojurewerkz/cassaforte/client.clj
@@ -284,8 +284,18 @@
            (AsyncResult. (.executeAsync session built-statement))
            (-> (.execute session built-statement)
                (conv/to-clj))))))
-  ([^Session session query & {:keys [retry-policy consistency-level]}]
+  ([^Session session query & {:keys [retry-policy
+                                     consistency-level
+                                     fetch-size
+                                     enable-tracing
+                                     default-timestamp]}]
      (let [^Statement built-statement (build-statement query)]
+       (when default-timestamp
+         (.setDefaultTimestamp built-statement))
+       (when enable-tracing
+         (.enableTracing built-statement))
+       (when fetch-size
+         (.setFetchSize built-statement (int fetch-size)))
        (when retry-policy
          (.setRetryPolicy built-statement retry-policy))
        (when consistency-level


Remove lock icon on web notifications

Remove lock icon on web notifications

--- src-cljs/frontend/components/account.cljs
+++ src-cljs/frontend/components/account.cljs
@@ -362,7 +362,7 @@
               :checked web-notifications-enabled?
               :on-change #(raise! owner [:set-web-notifications-permissions {:enabled? true}])
               :disabled disabled?}]
-            (when disabled? [:span [:i.material-icons.lock "lock" ] " "])
+            (when disabled? [:span " "])
             [:span.label-contents " Show me notifications when a build finishes"]]]
           [:div.radio
            [:label
@@ -372,7 +372,7 @@
               :checked (not web-notifications-enabled?)
               :on-change #(raise! owner [:set-web-notifications-permissions {:enabled? false}])
               :disabled disabled?}]
-            (when disabled? [:span [:i.material-icons.lock "lock" ] " "])
+            (when disabled? [:span " "])
             [:span.label-contents " Don't show me notifications when a build finishes"]]]]]]
        ;; -- If browser doesn't support the Web Notifications API:
        [:div.body