Loosen tests to accomodate CLJS-2888 (#797)

--- planck-cljs/test/planck/shell_test.cljs
+++ planck-cljs/test/planck/shell_test.cljs
@@ -51,11 +51,11 @@

 (deftest with-sh-env-throws-on-nil-env-vars-test
   (is (thrown-with-msg? js/Error
-                        #"fails spec"
+                        #"planck.shell/string-string-map\?"
                         (planck.shell/with-sh-env {nil "value-for-a-nil-key"}
                           (planck.shell/sh "env"))))
   (is (thrown-with-msg? js/Error
-                        #"fails spec"
+                        #"planck.shell/string-string-map\?"
                         (planck.shell/with-sh-env {"key-with-a-nil-value" nil}
                           (planck.shell/sh "env")))))


Add error handler for 'delete-by-query'

Add error handler for 'delete-by-query'

--- src/cyanite_remover/path_store.clj
+++ src/cyanite_remover/path_store.clj
@@ -25,7 +25,8 @@
 (defn- log-error
   "Log a error."
   [error path stats-errors]
-  (clog/error (format "Path store error: %s, path: %s" error path) error))
+  (clog/error (format "Path store error: path: %s, error: %s" path error) error)
+  (swap! stats-errors inc))

 (defn- wildcards-to-regexp
   "Convert Graphite wildcards to a regular expression."
@@ -82,6 +83,35 @@
     (log/trace (str "ES search respond: " resp))
     (map #(:_source %) (scroll-fn resp))))

+(defn- log-shards-errors
+  "Log shards' errors."
+  [failed failures path stats-errors]
+  (let [shards-errors (str/join "\n" (map #(format "shard: %s, error: %s"
+                                                   (:shard %) (:reason %))
+                                          failures))]
+    (log-error
+     (format "there were %s errors during the removal of the path:\n%s"
+             failed shards-errors) path stats-errors)))
+
+(defn- process-response-delete
+  "Process response of delete-by-query."
+  [response index path stats-errors]
+  (log/trace (str "ES delete respond: " response))
+  (let [error-fn #(do (log-error (format "Can't get \"%s\" value from response" %)
+                                 path stats-errors) false)]
+    (if-let [shards (:_shards (get (:_indices response) (keyword index)))]
+      (let [total (:total shards)
+            successful (:successful shards)
+            failed (:failed shards)]
+        (cond
+         (not total) (error-fn "total")
+         (not successful) (error-fn "successful")
+         (not failed) (error-fn "failed")
+         (> failed 0) (do (log-shards-errors failed (:failures shards) path
+                                             stats-errors) false))
+        true)
+      (error-fn "shards"))))
+
 (defn elasticsearch-path-store
   "Create an Elasticsearch path store."
   [url options]
@@ -113,8 +143,8 @@
                                                  limit-depth path))]
             (log/trace (str "ES delete query: " query))
             (if run
-              (let [resp (delete-fn query)]
-                (log/trace (str "ES delete respond: " resp)))))
+              (let [response (delete-fn query)]
+                (process-response-delete response index path stats-errors))))
           (catch Exception e
             (log-error e path stats-errors))))
       (get-stats [this]


CDNify the video-placeholder.svg path.

CDNify the video-placeholder.svg path.

--- src-cljs/frontend/components/integrations.cljs
+++ src-cljs/frontend/components/integrations.cljs
@@ -141,7 +141,7 @@
                                "with staging and prod environments."]}
                        {:type :video
                         :title "Continuous deployment with CircleCI and Heroku"
-                        :thumbnail "/img/outer/integrations/video-placeholder.svg"
+                        :thumbnail (utils/cdn-path "/img/outer/integrations/video-placeholder.svg")
                         :video-id "Hfs_1yuWDf4"}]
             :bottom-header "Ready for world-class continuous delivery?"
             :secondary-cta [:span


Pass argument map instead 2 args

Pass argument map instead 2 args

--- joplin.cassandra/src/joplin/cassandra/database.clj
+++ joplin.cassandra/src/joplin/cassandra/database.clj
@@ -37,7 +37,7 @@
     (ensure-migration-schema (get-connection hosts keyspace))
     (cql/delete (get-connection hosts keyspace)
                 "migrations"
-                (cq/where :id id)))
+                (cq/where {:id id})))

   (applied-migration-ids [db]
     (ensure-migration-schema (get-connection hosts keyspace))


Version 0.1.3-34iow1

Version 0.1.3-34iow1


lein-release plugin: preparing 0.1.7 release


Update dependencies.

Update dependencies.


Fix license URL in project.clj

Fix license URL in project.clj


Version 0.1.13

Version 0.1.13


Comment

Comment


Version 0.4.1-SNAPSHOT

Version 0.4.1-SNAPSHOT


Version 3.4.1-SNAPSHOT

Version 3.4.1-SNAPSHOT


Update to project.clj

Update to project.clj


Release 1.0.1

Release 1.0.1


Next dev version.

Next dev version.


Testing civs.logic.basic

Testing civs.logic.basic

--- test/civs/logic/basic_test.clj
+++ test/civs/logic/basic_test.clj
@@ -61,4 +61,19 @@
   ; Result should lower when the factor is higher
   (with-redefs [crand-float (constantly 0.4)]
     (> (perturbate-low 0.6) (perturbate-med 0.6))
-    (> (perturbate-med 0.6) (perturbate-high 0.6))))+    (> (perturbate-med 0.6) (perturbate-high 0.6))))
+
+(deftest test-mean
+  (= 0.7 (mean 0.5 0.9))
+  (= 0.0 (mean 0.0 0.0))
+  (= 0.0 (mean -0.5 0.5)))
+
+(deftest test-saturate
+  (= 0.6 (saturate 0.6 1.0))
+  (= 1.0 (saturate 1.6 1.0)))
+
+(deftest test-rand-range
+  (with-redefs [crand-int (constantly 2)]
+    (= 5 (rand-range 3 10)))
+  (with-redefs [crand-int (constantly 0)]
+    (= 3 (rand-range 3 10))))


extra rename

extra rename

--- test/clj/scrabble/api_test.clj
+++ test/clj/scrabble/api_test.clj
@@ -1,26 +1,26 @@
 (ns scrabble.api-test
-  (:require [scrabble.api :as api]
+  (:require [scrabble.api :as sut]
             [ring.mock.request :as mock]
             [clojure.data.json :as json :refer [read-str]]
-            [clojure.test :as t]))
+            [clojure.test :refer [deftest is testing]]))

-(t/deftest test-anagrams
-  (t/testing "getting all the anagrams"
+(deftest test-anagrams
+  (testing "getting all the anagrams"
     (let [request (mock/request :get "/api/anagrams" {:word "hello"})
           ;; looks like it's not working during tests but it works fine otherwise
-          response (api/app request)]
+          response (sut/app request)]

-      (t/is (= (:status response) 200))
-      (t/is (= (-> response :body read-str) [])))))
+      (is (= (:status response) 200))
+      (is (= (-> response :body read-str) [])))))

-#_(t/deftest test-best-words
-    (t/testing "get top best words availle"
+#_(deftest test-best-words
+    (testing "get top best words availle"
     ;; not actually correct still here
       (let [request (mock/request :get "/api/best-words" {:tiles "111" :letters "abc"})
-            response (api/app request)]
-        (t/is (= (:status response) 200))
-        (t/is (= (-> response :body read-str) {})))))
+            response (sut/app request)]
+        (is (= (:status response) 200))
+        (is (= (-> response :body read-str) {})))))

 ;; for some reason the
 #_(let [request (mock/request :get "/api/best-words" {:tiles "111" :letters "abc"})]
-    (api/app request))
+    (sut/app request))


We are currently tracking time on file:// URLs

https://app.asana.com/0/50978096561390/65596230299816

--- test/relevance/test/utils.cljs
+++ test/relevance/test/utils.cljs
@@ -38,6 +38,7 @@
                -327774960 "http://numergent.com/tags/khroma/"
                -526558523 "http://numergent.com/opensource/"
                93819220 "about:blank"
+               -847465478 "file:///Users/ricardo/Sources/user.html"
                ))

 (deftest test-host-key
@@ -85,6 +86,7 @@
                   "about:blank" ""
                   "chrome://extensions/?id=okhigbflgnbihoiokilagelkalkcigfp" "extensions"
                   "chrome-extension://okhigbflgnbihoiokilagelkalkcigfp/index.html" "okhigbflgnbihoiokilagelkalkcigfp"
+                  "file:///Users/ricardo/Sources/user.html" ""
                   "" ""
                   nil nil
                   ))


add tests for vecs

add tests for vecs

--- test/transom/indexed_test.cljx
+++ test/transom/indexed_test.cljx
@@ -1,7 +1,58 @@
 (ns transom.indexed-test
   (:require [transom.core :as transom]
+            [transom.sequential :as ts]
             [clojure.test :refer :all]
             [clojure.test.check.clojure-test :refer [defspec]]
             [clojure.test.check :as check]
             [clojure.test.check.generators :as gen]
             [clojure.test.check.properties :as prop]))
+
+(def simple-vector-gen (gen/vector gen/int))
+
+(defspec patching-diffs
+  100
+  (prop/for-all [m1 simple-vector-gen
+                 m2 simple-vector-gen]
+    (and (= m2 (ts/patch m1 (ts/diff m1 m2)))
+         (= m1 (ts/patch m2 (ts/diff m2 m1))))))
+
+(defspec composing-edits
+  100
+  (prop/for-all [m1 simple-vector-gen
+                 m2 simple-vector-gen
+                 m3 simple-vector-gen]
+    (let [edit1 (ts/diff m1 m2)
+          edit2 (ts/diff m2 m3)]
+      (= m3
+         (ts/patch m1 edit1 edit2)
+         (ts/patch m1 (ts/compose edit1 edit2))))))
+
+(defspec transforming-edits
+  100
+  (prop/for-all [m1 simple-vector-gen
+                 m2 simple-vector-gen
+                 m3 simple-vector-gen]
+    (let [edit1 (ts/diff m1 m2)
+          edit2 (ts/diff m1 m3)
+          [edit1' edit2'] (ts/transform edit1 edit2)]
+      (= (ts/patch m1 edit1 edit2')
+         (ts/patch m1 edit2 edit1')))))
+
+#_(defspec composing-transforms
+  100
+  (prop/for-all [m1 simple-vector-gen
+                 m2 simple-vector-gen
+                 m3 simple-vector-gen]
+    (let [old (ts/diff m1 m2)
+          new (ts/diff m1 m3)
+          [old' new'] (ts/transform old new)]
+      (= (ts/compose old new') (ts/compose new old')))))
+
+;; TODO(brian): invert not implemented
+#_(defspec inverting-edits
+  100
+  (prop/for-all [m1 simple-vector-gen
+                 m2 simple-vector-gen]
+    (let [edit (ts/diff m1 m2)
+          inverted (ts/invert edit)]
+      (= m1 (ts/patch m1 edit inverted)))))


always show self-org quickly in /add-projects

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -73,9 +73,7 @@
             [:ul.organizations
              (map (fn [org] (organization org settings owner))
                   (:organizations user))
-             (map (fn [org] (organization org settings owner))
-                  (filter (fn [org] (= (:login user) (:login org)))
-                          (:collaborators user)))]
+             (organization user settings owner)]
             (missing-org-info owner)]
            [:div.organizations
             [:h4
@@ -338,4 +336,3 @@
                          :repos repos
                          :selected-org selected-org
                          :settings settings})]]]])))
-


removed unused import from the add_projects component

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -13,7 +13,6 @@
             [frontend.utils :as utils :refer-macros [inspect]]
             [frontend.utils.github :as gh-utils]
             [frontend.utils.vcs-url :as vcs-url]
-            [goog.object :as object]
             [goog.string :as gstring]
             [goog.string.format]
             [om.core :as om :include-macros true]


Fix a few typos and cruft

Fix a few typos and cruft

--- src-cljs/frontend/components/org_settings.cljs
+++ src-cljs/frontend/components/org_settings.cljs
@@ -514,14 +514,13 @@
                [:div
                 (om/build linux-oss-alert app)])]]

-             [:div#plan-anchor-linux
+             [:div
               [:form
               (when-not (config/enterprise?)
                 [:div.container-picker
                  (if (pm/linux? plan)
                    [:legend.update-plan "Update Linux plan"]
-                   [:legend.update-plan "Choose Linux plan"]
-                   )
+                   [:legend.update-plan "Choose Linux plan"])
                  [:h1.container-input
                   [:span "Use "]
                   [:input.form-control
@@ -586,7 +585,7 @@
                      "Pay Now")))
                (when-not (config/enterprise?)
                  ;; TODO: Clean up conditional here - super nested and many interactions
-                 ;; FIXME 1833: ON CURRENT PLAN, ADD MESSAGE 'CHANGE CONTAINERS TO UPDATE PLAN'
+                 ;; FIXME CIRCLE-1833 ON CURRENT PLAN, ADD MESSAGE 'CHANGE CONTAINERS TO UPDATE PLAN'
                  (if (or (pm/linux? plan) (and (pm/freemium? plan) (not (pm/in-trial? plan))))
                    [:div
                     [:p.hint


Devcard for the table component

Devcard for the table component

--- src-cljs/frontend/components/pieces/table.cljs
+++ src-cljs/frontend/components/pieces/table.cljs
@@ -1,5 +1,6 @@
 (ns frontend.components.pieces.table
-  (:require [om.core :as om :include-macros true])
+  (:require [devcards.core :as dc :refer-macros [defcard-om]]
+            [om.core :as om :include-macros true])
   (:require-macros [frontend.utils :refer [html]]))

 (defn- cell-classes
@@ -53,3 +54,30 @@
    [:button {:data-component `action-button
              :on-click on-click}
     icon]))
+
+(dc/do
+  (defn format-date [date]
+    (.toDateString date))
+
+  (defn table-parent [data owner]
+    (om/component
+        (om/build table {:rows [{:name "John"
+                                 :birthday (js/Date. "1940-10-09")}
+                                {:name "Paul"
+                                 :birthday (js/Date. "1942-06-18")}
+                                {:name "George"
+                                 :birthday (js/Date. "1943-02-25")}
+                                {:name "Ringo"
+                                 :birthday (js/Date. "1940-07-07")}]
+                         :columns [{:header "Name"
+                                    :cell-fn :name}
+                                   {:header "Birthday"
+                                    :cell-fn (comp format-date :birthday)}
+                                   {:type :shrink
+                                    :cell-fn (fn [beatle]
+                                               (action-button
+                                                #(js/alert (str "You may not remove " (:name beatle) " from the band."))
+                                                "X"))}]})))
+
+  (defcard-om table
+    table-parent))


fix whitespace

fix whitespace

--- src/wombats/interceptors/error_handler.clj
+++ src/wombats/interceptors/error_handler.clj
@@ -1,6 +1,5 @@
 (ns wombats.interceptors.error-handler
   (:require [io.pedestal.interceptor.error :refer [error-dispatch]]))
-

 (defn- get-exception-data
   [exception]


add support for truncation with generate2

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -124,9 +124,12 @@
 (defn add-comps
   "given a bolt, return the lazy sequence of all bolts derived from this bolt after adding,
    at each supplied path in comp-paths, the bolts for that path."
-  [bolt model comp-paths bolts-at-paths depth max-depth & [top-bolt path-from-top]]
+  [bolt model comp-paths bolts-at-paths depth max-depth & [top-bolt path-from-top truncate?]]
   (lazy-seq
-   (let [top-bolt (or top-bolt bolt)]
+   (let [top-bolt (or top-bolt bolt)
+         truncate? (if (= truncate? false)
+                     false
+                     true)]
      (if (empty? comp-paths)
        [bolt] ;; done: we've added all the comps to the bolt, so just return the bolt as a singleton vector.
        ;; else, more comp-paths to go.
@@ -137,15 +140,17 @@
                            depth max-depth top-bolt path-from-top)
                (let [path (first comp-paths)
                      bolts-at (first bolts-at-paths)]
-                 (lazy-seq
-                  (flatten
-                   (mapfn #(let [bolt (assoc-in bolt path %)]
-                             (if (= false (get-in % [:phrasal]))
-                               [bolt]
-                               (add-bolt-at top-bolt bolt path % model depth max-depth)))
-                          bolts-at))))))))))
-
-(defn add-bolt-at [top-bolt bolt path bolt-at model depth max-depth]
+                 (flatten
+                  (mapfn #(let [bolt (assoc-in bolt path %)]
+                            (if (= false (get-in % [:phrasal]))
+                              [bolt]
+                              (-> (add-bolt-at top-bolt bolt path % model depth max-depth truncate?)
+                                  ((fn [with-added-complement]
+                                     (if truncate? (truncate with-added-complement [path] model)
+                                         with-added-complement))))))
+                         bolts-at)))))))))
+
+(defn add-bolt-at [top-bolt bolt path bolt-at model depth max-depth truncate?]
   (lazy-seq
    (mapfn #(do-defaults % model)
           (let [comp-paths (find-comp-paths bolt-at)
@@ -160,7 +165,8 @@
                                  comp-bolts
                                  (+ 1 depth)
                                  max-depth
-                                 top-bolt))))))))
+                                 top-bolt
+                                 truncate?))))))))
 (defn generate2
   "Return all expressions matching spec _spec_ given the model _model_."
   [spec model
@@ -172,7 +178,7 @@
   (let [depth 0
         max-depth max-total-depth]
     (flatten
-     (mapfn #(add-bolt-at % % [] % model depth max-depth)
+     (mapfn #(add-bolt-at % % [] % model depth max-depth truncate-children)
             (lightning-bolts model spec 0 max-total-depth)))))

 (defn generate-n


+(parse [input])

+(parse [input])

--- src/babel/italiano.cljc
+++ src/babel/italiano.cljc
@@ -119,6 +119,9 @@

 (defn parse
   "parse a string in Italian into zero or more (hopefully more) phrase structure trees"
+  ([input]
+   (let [model @@(get babel.directory/models :it)]
+     (parse input model)))
   ([input model]
    (let [input (preprocess input)]
      (cond (string? input)


verb must be reflexive for rule to apply

--- src/babel/lexiconfn.clj
+++ src/babel/lexiconfn.clj
@@ -793,6 +793,10 @@
                           (not (nil? (get-in val
                                              [:synsem :sem :obj]
                                              nil)))
+
+                          ;; don't try to transform into intransitive if verb is reflexive.
+                          (not (= true (get-in val [:synsem :sem :reflexive])))
+
                           (not (= :intensifier (get-in val [:synsem :subcat :2 :cat])))
                           (not (= '() (get-in val [:synsem :subcat :2]))))


Update views.clj

Update views.clj

--- src/briefcase/views.clj
+++ src/briefcase/views.clj
@@ -79,7 +79,7 @@
                [:h1 "Contribution Chart"]
                [:script { :src "/javascripts/d3.v3.min.js" }]
                [:p "A chronological graph showing my activity on this site (articles, talks, open source).
-The darker the colour for a certain day the more activity there was."]
+The darker the colour for a certain day the more activity there was. Probably not mobile friendly because it's a YOLOAMIRITE architecture derived from REKT principles, hire me if you need to know more."]
                [:div { :id "chart" }]
                [:style "
 #chart {


Prefix with "-" the protocol methods on http namespace.


Fix email on copyright notice on util ns.

--- src/buddy/sign/util.clj
+++ src/buddy/sign/util.clj
@@ -1,4 +1,4 @@
-;; Copyright (c) 2015 Andrey Antukh <niwi@niwi.be>
+;; Copyright (c) 2015 Andrey Antukh <niwi@niwi.nz>
 ;;
 ;; Licensed under the Apache License, Version 2.0 (the "License")
 ;; you may not use this file except in compliance with the License.


make `defui` support custom protocols

make `defui` support custom protocols

--- src/cellophane/next.clj
+++ src/cellophane/next.clj
@@ -374,6 +374,7 @@
 ;; define a function?
 (defn defui* [name forms]
   (let [{:keys [dt statics]} (collect-statics forms)
+        [other-protocols obj-dt] (split-with (complement '#{Object}) dt)
         define-class-methods (when-not (empty? (:protocols statics))
                                `(do
                                   ~@(->> (partition 2 (:protocols statics))
@@ -389,7 +390,9 @@
        (defrecord ~name [~'state ~'refs props# children#]
          ;; TODO: non-lifecycle methods defined in the JS prototype
          cellophane.protocols/IReactLifecycle
-         ~@(rest (reshape dt reshape-map))
+         ~@(rest (reshape obj-dt reshape-map))
+
+         ~@other-protocols

          ~@(:protocols statics)


Fix screen-scale calculations in util.quil dev ns.

--- dev/org/playasophy/wonderdome/util/quil.clj
+++ dev/org/playasophy/wonderdome/util/quil.clj
@@ -6,31 +6,40 @@
     [quil.core :as quil]))

+(defn screen-scale
+  "Determines how much to scale distances by based on how big the processing
+  display is."
+  ([]
+   (/ (min (quil/width) (quil/height)) 10.0))
+  ([v]
+   (* v (screen-scale))))
+
+
 (defn scale-point
   "Scales up a point vector to screen space."
   [p]
-  (let [s (/ (min (quil/width) (quil/height)) 10.0)]
-    (cartesian/scale p s)))
+  (cartesian/scale p (screen-scale)))

 (defn draw-axes
   [length]
   (quil/stroke-weight 1)
-  ; x-axis red
-  (quil/stroke (quil/color 255 0 0))
-  (quil/line [0 0 0] (scale-point [length 0 0]))
-  ; y-axis green
-  (quil/stroke (quil/color 0 255 0))
-  (quil/line [0 0 0] (scale-point [0 length 0]))
-  ; z-axis blue
-  (quil/stroke (quil/color 0 0 255))
-  (quil/line [0 0 0] (scale-point [0 0 length])))
+  (let [l (screen-scale length)]
+    ; x-axis red
+    (quil/stroke (quil/color 255 0 0))
+    (quil/line [0 0 0] [l 0 0])
+    ; y-axis green
+    (quil/stroke (quil/color 0 255 0))
+    (quil/line [0 0 0] [0 l 0])
+    ; z-axis blue
+    (quil/stroke (quil/color 0 0 255))
+    (quil/line [0 0 0] [0 0 l])))

 (defn draw-ground
   [radius]
   (let [c (quil/color 210 200 175)
-        r (* scale radius)]
+        r (screen-scale radius)]
     (quil/fill c)
     (quil/stroke c)
     (quil/ellipse 0 0 r r)))


Splits (optional-)path-matches-with-binding.

--- src/active/clojure/match.clj
+++ src/active/clojure/match.clj
@@ -369,8 +369,10 @@
   (s/or :required (s/cat :path ::path :match-value ::match-value)))

 (s/def ::path-matches-with-binding
-  (s/or :required (s/cat :path ::path :match-value ::match-value :binding-key ::binding-key :binding ::binding)
-        :optional (s/cat :qmark ::qmark :path ::path :default-value ::default-value :binding-key ::binding-key :binding ::binding)))
+  (s/or :required (s/cat :path ::path :match-value ::match-value :binding-key ::binding-key :binding ::binding)))
+
+(s/def ::optional-path-matches-with-binding
+  (s/or :required (s/cat :qmark ::qmark :path ::path :default-value ::default-value :binding-key ::binding-key :binding ::binding)))

 (s/def ::clause
   (s/or :key-exists-without-binding ::key-exists-without-binding
@@ -383,7 +385,8 @@
         :path-matches-with-binding ::path-matches-with-binding
         :optional-key-exists-with-binding ::optional-key-exists-with-binding
         :optional-path-exists-with-binding ::optional-path-exists-with-binding
-        :optional-key-matches-with-binding ::optional-key-matches-with-binding))
+        :optional-key-matches-with-binding ::optional-key-matches-with-binding
+        :optional-path-matches-with-binding ::optional-path-matches-with-binding))

 (defn match-value->matcher
   [[kind match-value]]
@@ -478,9 +481,12 @@
           :path-matches-with-binding
           (let [path (mapv make-key (:path body))
                 b    (make-binding (:binding body))]
-            (if (optional? mode)
-              `(optional-path-with-default-binding-clause ~path ~(:default-value body) ~b)
-              `(path-matches-with-binding-clause ~path (match-value->matcher ~(:match-value body)) ~b))))))))
+            `(path-matches-with-binding-clause ~path (match-value->matcher ~(:match-value body)) ~b))
+
+          :optional-path-matches-with-binding
+          (let [path (mapv make-key (:path body))
+                b    (make-binding (:binding body))]
+              `(optional-path-with-default-binding-clause ~path ~(:default-value body) ~b)))))))

 (defmacro parse-clauses
   [cs]
@@ -597,15 +603,17 @@
                 match-value (second match)
                 path-map    (assoc-in {} path match-value)]
             (cond
-              (optional? mode)
-              [{}
-               `[~(symbol b) (get-in ~message ~path ~(:default-value body))]]
               predicate?
               [`(~(fold-path path '_) :guard [(constantly (~(:fn match-value) (get-in ~message ~path)))])
                `[~(symbol b) (get-in ~message ~path)]]
               :else
               [`~path-map
-               `[~(symbol b) (get-in ~message ~path)]])))))))
+               `[~(symbol b) (get-in ~message ~path)]]))
+
+          :optional-path-matches-with-binding
+          (let [path        (mapv make-key (:path body))
+                b           (make-binding (:binding body))]
+            [{} `[~(symbol b) (get-in ~message ~path ~(:default-value body))]]))))))

 (defn deep-merge [v & vs]
   (letfn [(rec-merge [v1 v2]


Take account of trailing commas in NCBI xref section

--- src/aerobio/htseq/common.clj
+++ src/aerobio/htseq/common.clj
@@ -35,13 +35,15 @@
            (fn[v] (#{"tnseq", "rnaseq", "trmseq" "wgseq"} (first v)))
            recs)
         recs (if (seq x) x (cons ["rnaseq" "noexp" "noexp"] recs))
-        exp-rec [(first recs)]]
+        exp-rec [(coll/takev 3 (first recs))]] ; ensure 3 fields
     (loop [S (rest recs)
            I [exp-rec]]
       (if (not (seq S))
         (apply concat I)
         (let [s (coll/drop-until (fn[v] (str/digits? (first v))) S)
-              i (coll/take-until (fn[v] (not (str/digits? (first v)))) s)]
+              i (coll/take-until (fn[v] (not (str/digits? (first v)))) s)
+              ;; ensure 3 fields for NCBI xref
+              i (if (= 1 (count I)) (map #(coll/takev 3 %) i) i)]
           (recur (coll/drop-until (fn[v] (not (str/digits? (first v)))) s)
                  (conj I i)))))))


Respect `status` if it's provided at entry create time.

--- src/oc/storage/resources/entry.clj
+++ src/oc/storage/resources/entry.clj
@@ -23,7 +23,7 @@

 (def ignored-properties
   "Properties of a resource that are ignored during an update."
-  (disj reserved-properties :board-uuid))
+  (disj reserved-properties :board-uuid :status))

 ;; ----- Utility functions -----

@@ -36,6 +36,15 @@
   "Remove any ignored properties from the entry."
   [entry]
   (apply dissoc entry ignored-properties))
+
+(defn- publish-props
+  "Provide properties for an initially published entry."
+  [entry timestamp author]
+  (if (= (:status entry) "published")
+    (-> entry
+      (assoc :published-at timestamp)
+      (assoc :publisher author))
+    entry))

 ;; ----- Entry CRUD -----

@@ -59,7 +68,7 @@
           clean
           (assoc :uuid (db-common/unique-id))
           (assoc :secure-uuid (db-common/unique-id))
-          (assoc :status "draft")
+          (update :status #(or % "draft"))
           (assoc :topic-slug topic-slug)
           (update :topic-name #(or % nil))
           (update :headline #(or % ""))
@@ -68,7 +77,8 @@
           (assoc :board-uuid board-uuid)
           (assoc :author [(assoc author :updated-at ts)])
           (assoc :created-at ts)
-          (assoc :updated-at ts)))
+          (assoc :updated-at ts)
+          (publish-props ts author)))
     (throw (ex-info "Invalid board uuid." {:board-uuid board-uuid})))) ; no board

 (schema/defn ^:always-validate create-entry! :- (schema/maybe common/Entry)


Finish off test.

Finish off test.

--- test/onyx/coordinator/single_peer_test.clj
+++ test/onyx/coordinator/single_peer_test.clj
@@ -106,40 +106,27 @@
                   (fact (count task-nodes) => 3)
                   (fact (into #{} (map :task/name tasks)) => #{:in :inc :out})

-                  (facts ":in has an ingress queue")
-                  (let [task (first (filter #(= (:task/name %) :in) tasks))
-                        in-queues (:task/ingress-queues task)]
-                    (fact in-queues =not=> nil?))
-
-                  (facts ":inc's ingress queue is one of :in's egress queues"
+                  (facts ":in has an ingress queue"
+                         (let [task (first (filter #(= (:task/name %) :in) tasks))
+                               in-queues (:task/ingress-queues task)]
+                           (fact in-queues =not=> nil?)))
+
+                  (facts ":inc's ingress queue is :in's egress queues"
                          (let [in (first (filter #(= (:task/name %) :in) tasks))
                                inc (first (filter #(= (:task/name %) :inc) tasks))]
                            (fact (:task/ingress-queues inc) =>
-                                 (first (:task/egress-queues in)))))))
-
-         #_(facts
-                (let [in-query '[:find ?qs :where
-                                 [?t :task/name :in]
-                                 [?t :task/egress-queues ?qs]]
-                      inc-query '[:find ?qs :where
-                                  [?t :task/name :inc]
-                                  [?t :task/ingress-queues ?qs]]]
-                  (fact (d/q in-query db) => (d/q inc-query db))))
-
-         #_(facts ":out's ingess queue is :inc's egress queue"
-                (let [inc-query '[:find ?qs :where
-                                  [?t :task/name :inc]
-                                  [?t :task/egress-queues ?qs]]
-                      out-query '[:find ?qs :where
-                                  [?t :task/name :out]
-                                  [?t :task/ingress-queues ?qs]]]
-                  (fact (d/q inc-query db) => (d/q out-query db))))
-
-         #_(facts ":out's egress queue is generated"
-                (let [query '[:find ?qs :where
-                              [?t :task/name :out]
-                              [?t :task/egress-queues ?qs]]]
-                  (fact (d/q query db) =not=> empty?))))))))
+                                 (first (:task/egress-queues in)))))
+
+                  (facts ":out's ingess queue is :inc's egress queue"
+                         (let [inc (first (filter #(= (:task/name %) :inc) tasks))
+                               out (first (filter #(= (:task/name %) :out) tasks))]
+                           (fact (:task/ingress-queues out) =>
+                                 (first (:task/egress-queues inc)))))
+
+                  (facts ":out's egress queue is generated"
+                         (let [task (first (filter #(= (:task/name %) :out) tasks))
+                               out-queues (:task/egress-queues task)]
+                           (fact out-queues =not=> empty?))))))))))

 (defn test-task-life-cycle
   [{:keys [log sync sync-spy ack-ch-spy seal-ch-spy completion-ch-spy offer-ch-spy


(defn expression): make 'spec' argument optional

--- src/babel/espanol/writer.clj
+++ src/babel/espanol/writer.clj
@@ -3,6 +3,7 @@

 (require '[babel.cache :refer (build-lex-sch-cache create-index spec-to-phrases)])
 (require '[babel.forest :as forest])
+(require '[babel.engine :refer [generate]])
 (require '[babel.enrich :refer [enrich]])
 (require '[babel.espanol.grammar :refer [small]])
 (require '[babel.espanol.lexicon :refer [lexicon]])
@@ -20,11 +21,12 @@
 ;; for debugging:
 (require '[babel.espanol.morphology.verbs :as verbs])

-(defn expression [spec]
-  (writer/expression small spec))
+(defn expression [& [spec]]
+  (let [spec (if spec spec :top)]
+    (writer/expression small spec)))

-(defn fo [spec]
-  (morph/fo spec))
+(defn fo [expression]
+  (morph/fo expression))

 (defn todos [ & [count]]
   (let [count (if count (Integer. count) 10)
@@ -110,6 +112,3 @@
                                                        :tense :past}}}
                                        )))))
                  root-verb-array))))
-
-
-


exclude reader-conditional and tagged-literal from tools.reader.impl.util

--- src/main/clojure/clojure/tools/reader/impl/utils.clj
+++ src/main/clojure/clojure/tools/reader/impl/utils.clj
@@ -7,7 +7,7 @@
 ;;   You must not remove this notice, or any other, from this software.

 (ns ^:skip-wiki clojure.tools.reader.impl.utils
-  (:refer-clojure :exclude [char]))
+  (:refer-clojure :exclude [char reader-conditional tagged-literal]))

 (defn char [x]
   (when x


Add docs string

Add docs string

--- src/bogo_clojure/bg_word.clj
+++ src/bogo_clojure/bg_word.clj
@@ -37,6 +37,8 @@
   )

 (defn split-word
+  "Similar to fuzzy-split-word but this function is more appropriate when
+ processing qu and gi"
   [word]
   (let [comps (fuzzy-split-word word)
         last-comp0 (str (last (nth comps 0)))


[NS] add ns name

[NS] add ns name

--- src/clj/aliyuncs/ess/scaling_configuration.clj
+++ src/clj/aliyuncs/ess/scaling_configuration.clj
@@ -0,0 +1 @@
+(ns aliyuncs.ess.scaling-configuration)


Remove unused var in status route

Remove unused var in status route

Signed-off-by: Deepak Giridharagopal <d11186354d1ef01ca06ae37d7e23e827da13e85f@puppetlabs.com>

--- src/com/puppetlabs/puppetdb/http/v2/status.clj
+++ src/com/puppetlabs/puppetdb/http/v2/status.clj
@@ -21,7 +21,7 @@
 (def routes
   (app
     [node]
-    {:get (fn [{:keys [uri globals]}]
+    {:get (fn [{:keys [globals]}]
             (produce-node-status node (:scf-db globals)))}))

 (def status-app


namespace fix

namespace fix

--- resources/leiningen/new/closp/clj/service/user.clj
+++ resources/leiningen/new/closp/clj/service/user.clj
@@ -3,7 +3,7 @@
             [taoensso.timbre :as timbre]
             [noir.session :as sess]
             [clojure.core.typed :as t]
-            [de.sveri.mct.types :as ty]))
+            [{{ns}}.types :as ty]))

 (defmulti send-mail-by-type (fn [m _] (get m :prot)))


Delete kruft

Delete kruft

--- src/cia/stores/sql/store.clj
+++ src/cia/stores/sql/store.clj
@@ -14,16 +14,3 @@
     (judgement/select-judgements filter-map))
   (calculate-verdict [_ observable]
     (first (judgement/calculate-verdict observable))))
-
-;; (defrecord IndicatorStore [state]
-;;   IIndicatorStore
-;;   (create-indicator [_ new-indicator]
-;;     (handle-create-indicator state new-indicator))
-;;   (read-indicator [_ id]
-;;     (handle-read-indicator state id))g
-;;   (delete-indicator [_ id]
-;;     (handle-delete-indicator state id))
-;;   (list-indicators [_ filter-map]
-;;     (handle-list-indicators state filter-map))
-;;   (list-indicator-sightings [_ filter-map]
-;;     (handle-list-indicators-sightings state filter-map)))


fix missing wrap-dynamic-nav in cljs

fix missing wrap-dynamic-nav in cljs

--- src/clj/com/rpl/specter.cljc
+++ src/clj/com/rpl/specter.cljc
@@ -23,6 +23,19 @@
             #?(:clj [com.rpl.specter.macros :as macros])
             [clojure.set :as set]))

+(defn- static-path? [path]
+  (if (sequential? path)
+   (every? static-path? path)
+   (-> path i/dynamic-param? not)
+   ))
+
+(defn wrap-dynamic-nav [f]
+  (fn [& args]
+    (let [ret (apply f args)]
+      (if (and (sequential? ret) (static-path? ret))
+        (i/comp-paths* ret)
+        ret
+        ))))

 #?(:clj
    (do
@@ -113,20 +126,6 @@
                                           (conj (meta name) attr)
                                           attr)]
          [(with-meta name attr) macro-args]))
-
-     (defn- static-path? [path]
-       (if (sequential? path)
-        (every? static-path? path)
-        (-> path i/dynamic-param? not)
-        ))
-
-     (defn wrap-dynamic-nav [f]
-       (fn [& args]
-         (let [ret (apply f args)]
-           (if (and (sequential? ret) (static-path? ret))
-             (i/comp-paths* ret)
-             ret
-             ))))

      (defmacro dynamicnav [& args]
        `(vary-meta (wrap-dynamic-nav (fn ~@args)) assoc :dynamicnav true))


better doc for filterer

better doc for filterer

--- src/clj/com/rpl/specter.cljc
+++ src/clj/com/rpl/specter.cljc
@@ -960,8 +960,9 @@
   match the given path. An element matches the selector path if calling select
   on that element with the path yields anything other than an empty sequence.

-  If transformed sequence is smaller than input sequence, the corresponding entries
-  will be removed from original sequence."
+  For transformation: `NONE` entries in the result sequence cause corresponding entries in
+  input to be removed. A result sequence smaller than the input sequence is equivalent to
+  padding the result sequence with `NONE` at the end until the same size as the input."
   [& path]
   (subselect ALL (selected? path)))


colours

colours

--- src/clj/just_married/css.clj
+++ src/clj/just_married/css.clj
@@ -92,6 +92,8 @@
 (def main-page
   [[:.container (:desktop grid-config)]

+   [:h3 {:color "white"
+         :background-color (:dark-red COLOR-PALLETTE)}]
    [:.countdown {:grid-column "span 2"
                  :grid-row 1
                  :color (:marsala COLOR-PALLETTE)


write unknown failure data to log instead of standard out

--- src/clj_money/validation.clj
+++ src/clj_money/validation.clj
@@ -3,6 +3,7 @@
   (:require [clojure.pprint :refer [pprint]]
             [clojure.spec :as s]
             [clojure.string :as string]
+            [clojure.tools.logging :as log]
             [clj-time.core :as t]
             [clj-time.coerce :as tc]
             [clj-money.inflection :refer [singular
@@ -76,8 +77,9 @@

 (defn- interpret-unknown-failure
   [{:keys [pred path] :as problem}]
-  (pprint {:interpret-unknown-failure problem
-           :class (class pred)})
+
+  (log/debug "interpret-unknown-failure " problem)
+
   [path (format "The attribute at %s is not valid" path)])

 (defn- interpret-type-failure


Migrated data to xtest server

Migrated data to xtest server

--- src/cljs/db_quiz/config.cljs
+++ src/cljs/db_quiz/config.cljs
@@ -19,8 +19,8 @@
              :missed "#333333"
              :player-1 "#fc4349"
              :player-2 "#354d65"}
-   :data {:sparql {:endpoint-urls {:cs "http://cs.dbpedia.org/sparql"
-                                   :en "http://lod2.vse.cz:8890/sparql"}
+   :data {:sparql {:endpoint-urls {:cs "http://xtest.lmcloud.vse.cz/virtuoso-dbquiz/sparql"
+                                   :en "http://xtest.lmcloud.vse.cz/virtuoso-dbquiz/sparql"}
                    :query-files {:cs {:alphabetic "sparql/cs_dbpedia_az.mustache"
                                       :numeric "sparql/cs_dbpedia.mustache"}
                                  :en {:alphabetic ""


button fix

button fix

--- src/cljs/sjlibrary/core.cljs
+++ src/cljs/sjlibrary/core.cljs
@@ -29,7 +29,7 @@
     [:div {:class "col-md-12"}
      [:ul {:class "nav nav-tabs nav-justified"}
       [:li [:a {:href "#"} "Collections"]]
-      [:li [:a {:href "#"} "Using the Library"]]
+      [:li [:a {:href "#"} "Library Use"]]
       [:li [:a {:href "#"} "Learn"]]
       [:li {:class "active"} [:a {:href "#"} "Events"]]
       [:li [:a {:href "#"} "Teens"]]


Re-implementing the filter argument under the new cli system

--- src/com/okl/tokenmgr/cli.clj
+++ src/com/okl/tokenmgr/cli.clj
@@ -3,7 +3,7 @@
             [clojure.tools.logging :as log]
             [clojure.string :as string]
             [com.okl.tokenmgr.tokens :refer :all]
-            [clojure.tools.cli :refer [cli]]))
+            [clojure.tools.cli :refer [parse-opts]]))

 (defn- process-line [line tokens]
   (log/trace (str "Attempting to process line " line))
@@ -68,28 +68,57 @@
         value (second (string/split arg #"="))]
     {var value}))

-(defn- usage [usage]
-  (println usage)
+(def help-str
+  (str "Arguments: filter app evnt dir -- filters .tmpl files replacing tokens "
+       "with values\n\n"
+       "           load path_to_csv app -- loads in a new csv into a specified "
+       "application\n\n"
+       "           export path_to_csv -- exports the entire repository into a "
+       "csv file\n\n"
+       "           import path_to_csv -- loads the entire repository from a "
+       "csv file"))
+
+(defn- usage [info]
+  (println (str help-str "\n\nAdditonal parameters\n" info))
   (System/exit 1))

-(def help-str
-  (str "This program will take .tmpl filters, and replace the __TOKENS__ with "
-       "values from our token store.\n\nThere are 3 requrired arguments: "
-       "app-name, environment, and dir"))
+(def cli-opts
+  [["-t" "--token" "Token definitions, TOKEN=VAL"
+    :parse-fn arg->map
+    :assoc-fn (fn [previous key val]
+                (merge previous val))]
+   ["-d" "--delimiter" "Character for delimiter in csv-related operations"
+    :default \tab
+    :valiate [#(= 1 (count %))]]])
+
+(defn- do-filter [parsed-opts]
+  (let [args (:arguments parsed-opts)]
+    (log/info (str "found " (count args) " args: " args))
+    (if (not (= (count args) 4))
+      (usage (:summary parsed-opts)))
+    (let [[app envt dir] (rest args) ; skipping the filter argument
+          cli-tokens (:token (:options parsed-opts))
+          tokens (get-token-values app envt cli-tokens)
+          tokens (process-token-values tokens)]
+      (process-dir dir tokens))))
+
+(defn- do-import [parsed-opts]
+  nil)
+
+(defn- do-export [parsed-opts]
+  nil)
+
+(defn- do-load [parsed-opts]
+  nil)

 (defn -main  [& args]
-  (let [[cli-tokens args help]
-        (cli args
-             help-str
-             ["--token" "Token definitions, TOKEN=VAL"
-              :parse-fn arg->map
-              :assoc-fn (fn [previous key val]
-                          (merge previous val))])]
-    (if-not (= 3 (count args))
-      (usage help)
-      (let [app (first args)
-            envt (second args)
-            dir (second (rest args)) ;; aka third
-            tokens (get-token-values app envt cli-tokens)
-            tokens (process-token-values tokens)]
-        (process-dir dir tokens)))))
+  (let [parsed-opts (parse-opts args cli-opts)
+        parsed-args (:arguments parsed-opts)]
+    (if (:errors parsed-opts)
+      (usage (:summary parsed-opts)))
+    (cond
+     (= (first parsed-args) "filter") (do-filter parsed-opts)
+     (= (first parsed-args) "load") (do-load parsed-opts)
+     (= (first parsed-args) "export") (do-export parsed-opts)
+     (= (first parsed-args) "import") (do-import parsed-opts)
+     :else (usage (:summary parsed-opts)))))


Doubled max points

Doubled max points

--- src/clojush/problems/software/vectors_summed.clj
+++ src/clojush/problems/software/vectors_summed.clj
@@ -150,7 +150,7 @@
 (def argmap
   {:error-function (vectors-summed-error-function vectors-summed-data-domains)
    :atom-generators vectors-summed-atom-generators
-   :max-points 1000
+   :max-points 2000
    :max-genome-size-in-initial-program 250
    :evalpush-limit 1500
    :population-size 1000


Fix wrong greater than sign on mailserver connection

Signed-off-by: Andrea Maria Piana <39e16ece3c2d27e1889178b15ddb376e524032f8@gmail.com>

--- src/status_im/mailserver/core.cljs
+++ src/status_im/mailserver/core.cljs
@@ -614,7 +614,7 @@
                  ;; We either never tried to connect to this peer
                  (or (nil? last-connection-attempt)
                      ;; Or 30 seconds have passed and no luck
-                     (<= (- now last-connection-attempt) (* constants/connection-timeout 3))))
+                     (>= (- now last-connection-attempt) (* constants/connection-timeout 3))))
         ;; Then we change mailserver
         (change-mailserver cofx)))))


Allow password authentication by accepting :credentials option in client/build-cluster

--- src/clojure/clojurewerkz/cassaforte/client.clj
+++ src/clojure/clojurewerkz/cassaforte/client.clj
@@ -182,6 +182,7 @@
      * contact-points - cluster hosts to connect to
      * port - port, listening to incoming binary CQL connections (make sure you have `start_native_transport` set
        to true).
+     * credentials - connection credentials in the form {:username username :password password}
      * connections-per-host - specifies core number of connections per host.
      * max-connections-per-host - maximum number of connections per host.
      * retry-policy - configures the retry policy to use for the new cluster.
@@ -191,6 +192,7 @@
        use `with-consistency-level` to specify consistency level on a per-query basis"
   [{:keys [contact-points
            port
+           credentials
            connections-per-host
            max-connections-per-host

@@ -209,6 +211,9 @@
         ^PoolingOptions pooling-options (.poolingOptions builder)]
     (when port
       (.withPort builder port))
+
+    (when credentials
+      (.withCredentials builder (:username credentials) (:password credentials)))

     (when connections-per-host
       (.setCoreConnectionsPerHost pooling-options HostDistance/LOCAL


Use new rotation support to aim Blades correctly.

--- src/afterglow/examples.clj
+++ src/afterglow/examples.clj
@@ -43,76 +43,81 @@
   height to which it has been adjusted allows us to figure out where
   all the lights are on it.

-  The origin of the rig is the center of the lower bar on the
-  horizontal truss, and the default orientation is, as usual, facing
-  towards the audience.
-
-We try to hang blades 1-4 at an angle of 72.5 degrees leaning towards
+  For the moment the orientation of the rig defines the orientation of
+  the show, and the origins of the show axes are the spot on the floor
+  underneath the center of the horizontal truss. The _z_ axis
+  increases towards the audience from that point.
+
+  Because the height of the rig can be adjusted, you can pass in a
+  value with `:y` to set the height of the center of the lower bar on
+  the horizontal truss. If omitted a default height of 62 inches is
+  used, which is approximately the height of the bar when the
+  extension poles are collapsed for load-in and strike.
+
+  We try to hang blades 1-4 at an angle of 72.5 degrees leaning towards
   the audience, and blade 5 sags to about 101 degrees but if any angle
   ends up being off and difficult to correct, it can be passed in with
   `:blade-1-angle` through `:blade-5-angle` The actual mounting height
   of blade 5, if it differs from 4 inches can be passed with
-  `:blade-5-height`."
-  [& {:keys [universe x y z x-rotation y-rotation z-rotation
-             blade-1-angle blade-2-angle blade-3-angle blade-4-angle blade-5-angle blade-5-height]
-      :or {universe 1 x 0 y (tf/inches 62.5) z 0
-           x-rotation 0 y-rotation 0 z-rotation 0
+  `:blade-5-height`.
+
+  It would be possible to extend this function to support positioning
+  and rotating the truss within show space, now that `patch-fixture`
+  allows you to pass in a transformation matrix. But until that
+  complexity is needed, this simpler approach seems practical. The
+  truss is the main component of our show, so having it be at the
+  origin makes sense."
+  [& {:keys [universe y blade-1-angle blade-2-angle blade-3-angle blade-4-angle blade-5-angle blade-5-height]
+      :or {universe 1 y (tf/inches 62.5)
            blade-1-angle (tf/degrees 72.5) blade-2-angle (tf/degrees 72.5)
            blade-3-angle (tf/degrees 72.5) blade-4-angle (tf/degrees 72.5)
            blade-5-angle (tf/degrees 101) blade-5-height (tf/inches 4)}}]

   ;; Torrent F3 moving head effect spots
   (show/patch-fixture! :torrent-1 (blizzard/torrent-f3) universe 1
-                       :x (+ x (tf/inches 50)) :y (+ y (tf/inches -14)) :z z
-                       :x-rotation (+ x-rotation (tf/degrees 180))
-                       :y-rotation (+ y-rotation (tf/degrees 90))
-                       :z-rotation z-rotation)
+                       :x (tf/inches 50) :y (+ y (tf/inches -14))
+                       :x-rotation (tf/degrees 180)
+                       :y-rotation (tf/degrees -90))
   (show/patch-fixture! :torrent-2 (blizzard/torrent-f3) universe 17
-                       :x (+ x (tf/inches -50)) :y (+ y (tf/inches -14)) :z z
-                       :x-rotation (+ x-rotation (tf/degrees 180))
-                       :y-rotation (+ y-rotation (tf/degrees 90))
-                       :z-rotation z-rotation)
+                       :x (tf/inches -50) :y (+ y (tf/inches -14))
+                       :x-rotation (tf/degrees 180)
+                       :y-rotation (tf/degrees -90))

   ;; Hex IRC mini RGBAW+UV pars
   (show/patch-fixture! :hex-1 (chauvet/slimpar-hex3-irc) universe 129
-                       :x (+ x (tf/inches 51.5)) :y (+ y (tf/inches 15)) :z z)
+                       :x (tf/inches 51.5) :y (+ y (tf/inches 15)))
   (show/patch-fixture! :hex-2 (chauvet/slimpar-hex3-irc) universe 145
-                       :x (tf/inches -51.5) :y (tf/inches 15) :z z)
+                       :x (tf/inches -51.5) :y (+ y (tf/inches 15)))

   ;; Blade moving-head RGBA pinspots
   (show/patch-fixture! :blade-1 (blizzard/blade-rgbw) universe 225
-                       :x (+ x (tf/inches -21)) :y (+ y (tf/inches 9)) :z z
-                       :x-rotation (+ x-rotation blade-1-angle)
-                       :y-rotation (+ y-rotation (tf/degrees 90))
-                       :z-rotation z-rotation)
+                       :x (tf/inches -21) :y (+ y (tf/inches 9))
+                       :relative-rotations [[:y-rotation (tf/degrees 90)]
+                                            [:z-rotation blade-1-angle]])
   (show/patch-fixture! :blade-2 (blizzard/blade-rgbw) universe 240
-                       :x (+ x (tf/inches 20.5)) :y (+ y (tf/inches 9)) :z z
-                       :x-rotation (+ x-rotation blade-2-angle)
-                       :y-rotation (+ y-rotation (tf/degrees 90))
-                       :z-rotation z-rotation)
+                       :x (tf/inches 20.5) :y (+ y (tf/inches 9))
+                       :relative-rotations [[:y-rotation (tf/degrees 90)]
+                                            [:z-rotation blade-2-angle]])
   (show/patch-fixture! :blade-3 (blizzard/blade-rgbw) universe 255
-                       :x (+ x (tf/inches -37)) :y y :z z
-                       :x-rotation (+ x-rotation blade-3-angle)
-                       :y-rotation (+ y-rotation (tf/degrees 90))
-                       :z-rotation z-rotation)
+                       :x (tf/inches -37) :y y
+                       :relative-rotations [[:y-rotation (tf/degrees 90)]
+                                            [:z-rotation blade-3-angle]])
   (show/patch-fixture! :blade-4 (blizzard/blade-rgbw) universe 270
-                       :x (+ x (tf/inches 37)) :y y :z z
-                       :x-rotation (+ x-rotation blade-4-angle)
-                       :y-rotation (+ y-rotation (tf/degrees 90))
-                       :z-rotation z-rotation)
+                       :x (tf/inches 37) :y y
+                       :relative-rotations [[:y-rotation (tf/degrees 90)]
+                                            [:z-rotation blade-4-angle]])
   (show/patch-fixture! :blade-5 (blizzard/blade-rgbw :15-channel :tilt-center 25 :tilt-half-circle -230) universe 285
-                       :x x :y (+ y blade-5-height) :z z
-                       :x-rotation (+ x-rotation blade-5-angle)
-                       :y-rotation (+ y-rotation (tf/degrees 90))
-                       :z-rotation z-rotation)
+                       :y (+ y blade-5-height)
+                       :relative-rotations [[:y-rotation (tf/degrees 90)]
+                                            [:z-rotation blade-5-angle]])

   ;; Snowball RGBA moonflower effect
   (show/patch-fixture! :snowball (blizzard/snowball) universe 33
-                       :x (+ x (tf/inches 6.5)) :y (+ y (tf/inches 15)) :z z)
+                       :x (tf/inches 6.5) :y (+ y (tf/inches 15)))

   ;; Hypnotic RGB web effect diffraction pattern laser
   (show/patch-fixture! :hyp-rgb (adj/hypnotic-rgb) universe 45
-                       :x x :y (+ y (tf/inches -5)) :z z)
+                       :y (+ y (tf/inches -5)))

   ;; These last two can be patched as generic switches instead if you don't want them to respond to dimmer cues:


Version 141-SNAPSHOT

Version 141-SNAPSHOT

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject clojars-web "140"
+(defproject clojars-web "141-SNAPSHOT"
   :min-lein-version "2.0.0"
   :dependencies [[org.clojure/clojure "1.10.1"]
                  [org.clojure/core.memoize "0.8.2"]


Update AMI. There's a building the AMI, and with the new version of rvm-pallet.

- Add java
- add lein
- add node-js
- add npm
- add more rubys (1.9.3, jruby 1.6.5, ree-1.8.7-2010.02)
- move to rvm stable
- make postgres trust everything by default
- add Redis
- add libcurl, libaspell
- add clojure

--- project.clj
+++ project.clj
@@ -92,9 +92,10 @@
                  [org.cloudhoist/postgres "0.6.1"]
                  [org.cloudhoist/rubygems "0.6.0"]
                  [org.cloudhoist/java "0.5.1"]
+                 [org.cloudhoist/node-js "0.5.0"]
                  [org.cloudhoist/nginx "f48febc9e5e43148719a11c3aeca4e6b668993e"]
                  [lein-crate "0.1.0"]
-                 [pallet-rvm "0.2.1"]
+                 [pallet-rvm "0.1-186bdde006ec2e22d5c96e1e0cd33f9e65848b01"]
                  [midje "1.2.0"]
                  [cdt "1.2.6.1-SNAPSHOT"]
                  [org.jruby.ext.posix/jnr-posix "1.1.8"]]


Update dependency.

Update dependency.

--- project.clj
+++ project.clj
@@ -29,7 +29,7 @@
     [cheshire "5.3.1"] ; JSON de/encoding https://github.com/dakrone/cheshire
     [org.clojure/data.xml "0.0.8"] ; XML parser/encoder https://github.com/clojure/data.xml
     ;; Web Client-side
-    [org.clojure/clojurescript "0.0-2371"] ; ClojureScript compiler https://github.com/clojure/clojurescript
+    [org.clojure/clojurescript "0.0-2411"] ; ClojureScript compiler https://github.com/clojure/clojurescript
     [jayq "2.5.2"] ; ClojureScript wrapper for jQuery https://github.com/ibdknox/jayq
     [hiccups "0.3.0"] ; ClojureScript implementation of Hiccup https://github.com/teropa/hiccups
   ]


update to lein-protobuf 0.3.1

update to lein-protobuf 0.3.1

--- project.clj
+++ project.clj
@@ -1,4 +1,4 @@
-(defproject org.flatland/protobuf "0.7.0"
+(defproject org.flatland/protobuf "0.7.1"
   :description "Clojure-protobuf provides a clojure interface to Google's protocol buffers."
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
@@ -7,7 +7,7 @@
                  [org.flatland/useful "0.9.0"]
                  [org.flatland/schematic "0.1.0"]
                  [ordered-collections "0.4.0"]]
-  :plugins [[lein-protobuf "0.3.0"]]
+  :plugins [[lein-protobuf "0.3.1"]]
   :javac-options ["-target" "5" "-source" "5"]
   :aliases {"testall" ["with-profile" "dev,default:dev,1.3,default:dev,1.5,default" "test"]}
   :profiles {:1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}


Changed to cljsbuild 1.0.0-SNAPSHOT.

Changed to cljsbuild 1.0.0-SNAPSHOT.

--- project.clj
+++ project.clj
@@ -3,7 +3,7 @@
   :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
-  :plugins [[lein-cljsbuild "0.3.4"]]
+  :plugins [[lein-cljsbuild "1.0.0-SNAPSHOT"]]
   :dependencies [[org.clojure/clojurescript "0.0-1978"]]
   :cljsbuild {
     :builds [{


Might as well use the latest version of enlive.

--- project.clj
+++ project.clj
@@ -4,7 +4,7 @@
                  [org.clojure/data.codec "0.1.0"]
                  [org.clojure/data.json "0.2.2"]
                  [compojure "1.1.5"]
-                 [enlive "1.1.1"]
+                 [enlive "1.1.4"]
                  [ring/ring-core "1.2.0"]
                  [ring/ring-jetty-adapter "1.2.0"]
                  [bouncycastle/bcprov-jdk16 "140"]


Add criterium as a dependency for performance testing


Update dependencies.

Update dependencies.


Fix dependency confusion

Fix dependency confusion


Pushing latest project forward.

Pushing latest project forward.


Show benchmark time

Show benchmark time

--- src/cyanite_fetcher/core.clj
+++ src/cyanite_fetcher/core.clj
@@ -318,16 +318,14 @@
 ;; Benchmark
 ;;------------------------------------------------------------------------------

-(defn run-bench
-  "Run benchmark."
+(defn bench-itself
+  "Benchmark itself."
   [chost eshost path tenant from to]
-  (println "Start time:" (tl/format-local-time (tl/local-now) :rfc822))
   (let [{:keys [rollup period]}
         (find-best-rollup (str from) (convert-shorthand-rollups rollups))
         tenant (or tenant "NONE")
         to (if to (Long/parseLong (str to)) (now))
         from (Long/parseLong (str from))]
-    (newline)
     (println "Cassandra host:    " chost)
     (println "ElasticSearch host:" eshost)
     (newline)
@@ -352,7 +350,15 @@
         (norm fcdata rollup to pmap (get-fill-in map) "pmap/map")
         ;;(norm fcdata rollup to map (get-fill-in pmap) "map/pmap")
         ;;(norm fcdata rollup to pmap (get-fill-in pmap) "pmap/pmap")
-        )))
+        ))))
+
+(defn run-bench
+  "Run benchmark."
+  [chost eshost path tenant from to]
+  (println "Start time:" (tl/format-local-time (tl/local-now) :rfc822))
+  (newline)
+  (time (bench-itself chost eshost path tenant from to))
+  (newline)
   (println "Finish time:" (tl/format-local-time (tl/local-now) :rfc822)))

 ;;------------------------------------------------------------------------------


Fix docstring

Fix docstring

--- src/cyanite_fetcher/core.clj
+++ src/cyanite_fetcher/core.clj
@@ -92,8 +92,9 @@
     "path = ? AND tenant = ? AND rollup = ? AND period = ? "
     "AND time >= ? AND time <= ? ORDER BY time ASC;")))

-(defn par-fetch [session fetch! paths tenant rollup period from to]
+(defn par-fetch
   "Fetch data in parallel fashion."
+  [session fetch! paths tenant rollup period from to]
   (let [futures
         (doall (map #(future
                        (->> (alia/execute


Update tools.reader dep

Update tools.reader dep

--- planck-cljs/project.clj
+++ planck-cljs/project.clj
@@ -14,7 +14,7 @@
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [org.clojure/clojurescript ~clojurescript-version]
                  [org.clojure/test.check "0.10.0-alpha2"]
-                 [org.clojure/tools.reader "1.0.0"]
+                 [org.clojure/tools.reader "1.0.5"]
                  [com.cognitect/transit-clj "0.8.300"]
                  [com.cognitect/transit-cljs "0.8.239"]
                  [fipp "0.6.8"]


Improve documentation in `quil.applet`.

Improve documentation in `quil.applet`.

--- src/clj/quil/applet.clj
+++ src/clj/quil/applet.clj
@@ -26,9 +26,10 @@
 (def ^:private  executor (java.util.concurrent.Executors/newSingleThreadScheduledExecutor))

 (defn- destroy-window
-  "Cleanup native window object once sketch was closed. Processing doesn't perform cleanups
-  because its probably assumes that when sketch is closed - JVM is closed as well which is
-  not the case for clojure. So here we're performing renderer-specific cleanups. "
+  "Clean up native window object once sketch is closed. Processing doesn't
+  perform cleanups because it probably assumes that when the sketch is closed
+  the JVM is closed as well which is not the case for clojure. So here we're
+  performing renderer-specific cleanups."
   [applet]
   (let [native (-> applet .getSurface .getNative)]
     (condp = (.getClass native)
@@ -46,9 +47,9 @@
       :nothing)))

 (defn applet-disposed
-  "This function is called when PApplet executes 'dispose' method.
-  It means we can dispose frame, call on-close function and perform other
-  clean ups."
+  "This function is called when `PApplet` executes `dispose` method. It means we
+  can dispose the frame, call the `on-close` function and perform other
+  cleanups."
   [applet]
   (with-applet applet
     ((:on-close (meta applet))))
@@ -56,7 +57,7 @@
   (destroy-window applet))

 (defn applet-state
-  "Fetch an element of state from within the applet"
+  "Fetch an element of state from within the `applet`."
   [applet k]
   (get @(:state (meta applet)) k))

@@ -103,17 +104,17 @@
                   :fx2d   PApplet/FX2D})

 (defn resolve-renderer
-  "Converts keyword to Processing renderer string constant.
-  This string can be passed to native Processing methods.
-  If renderer passed as String - do nothing and simply return it"
+  "Converts `renderer` keyword to `Processing` renderer `String` constant.
+  This `String` can be passed to native `Processing` methods.
+  If `renderer` is passed as `String` do nothing and simply return it."
   [renderer]
   (cond (keyword? renderer) (u/resolve-constant-key renderer renderer-modes)
         (string? renderer) renderer
         :default (throw (RuntimeException. ":renderer should be keyword or string"))))

 (defn- validate-size
-  "Checks that the size vector is exactly two elements. If not, throws
-  an exception, otherwise returns the size vector unmodified."
+  "Checks that the `size` vector is exactly two elements. If not, throws
+  an exception, otherwise returns the `size` vector unmodified."
   [size]
   (if (or (= size :fullscreen)
           (and (coll? size) (= 2 (count size))))
@@ -123,8 +124,10 @@
                  ". Was expecting :fullscreen or 2 elements vector: "
                  "[width height].")))))

-(defn- to-method-name [keyword]
-  "Converts keyword to java-style method symbol. :on-key-pressed => onKeyPressed"
+(defn- to-method-name
+  "Converts keyword to java-style method symbol.
+  `:on-key-pressed` => `onKeyPressed`"
+  [keyword]
   (-> keyword
       name
       (string/replace
@@ -132,8 +135,9 @@
        #(-> % string/upper-case (subs 1)))
       symbol))

-(defn- parent-method [method]
-  "Appends string 'Parent' to given symbol"
+(defn- parent-method
+  "Appends string 'Parent' to given symbol."
+  [method]
   (symbol (str method "Parent")))

 (def listeners [:key-pressed
@@ -172,8 +176,8 @@
                    sketchFullScreen sketchFullScreenParent})

 (defn -exitActual
-  "Overriding PApplet.exitActual because we don't want it to call
-   System.exit()."
+  "Overriding `PApplet.exitActual` because we don't want it to call
+  `System.exit()`."
   [this])

 (defn -sketchFullScreen [this] (:present (meta this)))
@@ -185,7 +189,7 @@
   (.state this))

 (defn -settings
-  "Overriding PApplet.settings() to set size."
+  "Overriding `PApplet.settings()` to set size."
   [this]
   (let [{:keys [renderer size output-file settings-fn]} (meta this)
         renderer (resolve-renderer renderer)
@@ -225,7 +229,7 @@
     (resolve-renderer initial-renderer)))

 (defmacro generate-listeners
-  "Generates all listeners like onKeyPress, onMouseClick and others."
+  "Generates all listeners like `onKeyPress`, `onMouseClick` and others."
   []
   (letfn [(prefix [v method]
             (symbol (str v method)))
@@ -265,7 +269,7 @@

 (defn applet
   "Create and start a new visualisation applet. All options used
-  here should be documented in 'defsketch' docstring."
+  here should be documented in the [[quil.sketch/defsketch]] docstring."
   [& opts]
   (let [options (apply hash-map opts)

@@ -327,11 +331,12 @@
       (attach-applet-listeners))))

 (defmacro defapplet
-  "Define and start an applet and bind it to a var with the symbol
-  app-name. If any of the options to the various callbacks are
-  symbols, it wraps them in a call to var to ensure they aren't
-  inlined and that redefinitions to the original fns are reflected in
-  the visualisation. See applet for the available options."
+  "Define and start an applet and bind it to
+  a [var](https://clojure.org/reference/vars) with the symbol `app-name`. If any
+  of the options to the various callbacks are symbols, it wraps them in a call
+  to `var` to ensure they aren't inlined and that redefinitions to the original
+  functions are reflected in the visualisation. See [[applet]] for the available
+  options."
   [app-name & opts]
   (letfn [(wrap [v]
             (if (symbol? v)


* src/cljs/cljs/core.cljs: extend nil to IPrintable, makes forms like (atom nil) valid at REPL

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -195,6 +195,9 @@

   ICollection
   (-conj [_ o] (list o))
+
+  IPrintable
+  (-pr-seq [o] (list "nil"))

   IIndexed
   (-nth


Added propper print of date

Added propper print of date

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -6199,15 +6199,16 @@
                         (if (< (count ns) len)
                           (recur (str "0" ns))
                           ns)))]
-      (str "#inst \""
-           (.getUTCFullYear d)                   "-"
-           (normalize (inc (.getUTCMonth d)) 2)  "-"
-           (normalize (.getUTCDate d) 2)         "T"
-           (normalize (.getUTCHours d) 2)        ":"
-           (normalize (.getUTCMinutes d) 2)      ":"
-           (normalize (.getUTCSeconds d) 2)      "."
-           (normalize (.getUTCMilliseconds d) 3) "-"
-           "00:00\"")))
+      (list
+       (str "#inst \""
+            (.getUTCFullYear d)                   "-"
+            (normalize (inc (.getUTCMonth d)) 2)  "-"
+            (normalize (.getUTCDate d) 2)         "T"
+            (normalize (.getUTCHours d) 2)        ":"
+            (normalize (.getUTCMinutes d) 2)      ":"
+            (normalize (.getUTCSeconds d) 2)      "."
+            (normalize (.getUTCMilliseconds d) 3) "-"
+            "00:00\""))))

   LazySeq
   (-pr-seq [coll opts] (pr-sequential pr-seq "(" " " ")" opts coll))


remove flip effect tricks

remove flip effect tricks

--- src/cljs/paren/app.cljs
+++ src/cljs/paren/app.cljs
@@ -118,8 +118,7 @@
           (-> @app-state :subtitle)]
         (if (-> @app-state :history first)
           [eval-note app-state])
-        (if-not @flipped?
-          [paren-box focus?])
+        [paren-box focus?]
         [:p "- OR -"]
         [:a {:href "#"
              :style {:font-family "'Amatic SC', cursive"


Move keyword values to `keyword-mapping`, introduce `layout-weight` attribute

--- src/clojure/neko/ui.clj
+++ src/clojure/neko/ui.clj
@@ -2,35 +2,23 @@
   "Tools for defining and manipulating Android UI elements."
   (:use [neko.activity :only [*activity*]]
         [neko.context :only [*context*]])
+  (:require [clojure.string :as string])
   (:import [android.widget Toast LinearLayout Button]
            [android.view View ViewGroup$LayoutParams]
+           android.widget.LinearLayout$LayoutParams
            android.content.Context))

-;; A map that contains the mapping of auxiliary keywords to the most
-;; used constants.
-;;
-(def ^{:private true}
-  attribute-values {;; LinearLayout orientation
-                    :horizontal LinearLayout/HORIZONTAL
-                    :vertical LinearLayout/VERTICAL
-
-                    ;; LayoutParams constants
-                    :fill-parent ViewGroup$LayoutParams/FILL_PARENT
-                    :fill ViewGroup$LayoutParams/FILL_PARENT
-                    :wrap-content ViewGroup$LayoutParams/WRAP_CONTENT
-                    :wrap ViewGroup$LayoutParams/WRAP_CONTENT})
-
 ;; ### Element relations

 ;; This section provides utilities to connect the keywords to the
-;; actual UI classes and define the hierarchy relations between the
-;; elements.
+;; actual UI classes, define the hierarchy relations between the
+;; elements and the values for the keywords representing values.

 ;; This atom keeps all the relations inside the map.
 (def ^{:private true} keyword-mapping
   (atom {}))

-(defn add-keyword-classname-relation
+(defn keyword-add-classname-relation
   "Connects the given keyword to the classname."
   [kw classname]
   (swap! keyword-mapping #(assoc-in % [kw :classname] classname)))
@@ -44,7 +32,7 @@
     (-> @keyword-mapping classname-or-kw :classname)
     classname-or-kw))

-(defn add-parent
+(defn keyword-add-parent
   "Defines the `parent-kw` to be the parent of `kw`."
   [kw parent-kw]
   (swap! keyword-mapping #(update-in % [kw :parents] conj parent-kw)))
@@ -58,16 +46,38 @@
       (mapcat all-parents)
       (concat first-level-parents)
       distinct)))
-
+
+(defn keyword-add-value
+  "Associate the value keyword with the provided value for the given keyword representing the UI element."
+  [element-kw value-kw value]
+  (swap! keyword-mapping #(assoc-in % [element-kw :values value-kw] value)))
+
+(defn kw-to-static-field
+  "Takes a keyword, capitalizes its name and replaces all dashes with underscores."
+  [kw]
+  (.toUpperCase (string/replace (name kw) \- \_)))
+
+(defn attribute-value
+  "If the value is a keyword then returns the value for it from the keyword-mapping.
+If the value-keyword isn't present in the keyword-mapping, form the value as `classname-for-element-kw/CAPITALIZED-VALUE-KW`."
+  [element-kw value]
+  (if-not (keyword? value)
+    value
+    (or (-> @keyword-mapping element-kw :values value)
+        (symbol (str (.getName (classname element-kw)) \/ (kw-to-static-field value))))))
+
 ;; These would be moved somewhere at some point.
 ;;
 (do
-  (add-keyword-classname-relation :button android.widget.Button)
-  (add-keyword-classname-relation :linear-layout android.widget.LinearLayout)
-  (add-parent :button :layout-params)
-  (add-parent :linear-layout :layout-params)
-  (add-parent :button :id)
-  (add-parent :linear-layout :id))
+  (keyword-add-classname-relation :button android.widget.Button)
+  (keyword-add-classname-relation :linear-layout android.widget.LinearLayout)
+  (keyword-add-classname-relation :layout-params android.view.ViewGroup$LayoutParams)
+  (keyword-add-parent :button :layout-params)
+  (keyword-add-parent :linear-layout :layout-params)
+  (keyword-add-parent :button :id)
+  (keyword-add-parent :linear-layout :id)
+  (keyword-add-value :layout-params :fill ViewGroup$LayoutParams/FILL_PARENT)
+  (keyword-add-value :layout-params :wrap ViewGroup$LayoutParams/WRAP_CONTENT))

 ;; ## Attributes

@@ -125,24 +135,20 @@
 could be either actual values or keywords `:fill` and `:wrap`.

 Taken from clj-android by remvee."
-  ([both]
-    `(let [both# ~(or (attribute-values both)
-                                ViewGroup$LayoutParams/WRAP_CONTENT)]
-       (new ViewGroup$LayoutParams both# both#)))
-  ([width height]
-    `(let [width# ~(or (attribute-values width)
-                                 ViewGroup$LayoutParams/WRAP_CONTENT)
-           height# ~(or (attribute-values height)
-                                  ViewGroup$LayoutParams/WRAP_CONTENT)]
-       (new ViewGroup$LayoutParams width# height#))))
+  ([width height weight]
+    (let [real-width (attribute-value :layout-params (or width :wrap))
+          real-height (attribute-value :layout-params (or height :wrap))
+          real-weight (or weight 0)]
+      `(new LinearLayout$LayoutParams ~real-width ~real-height ~real-weight))))

 (defmethod transform-attributes :layout-params [el-type obj attributes
                                                 generated-code]
-  [(dissoc attributes :layout-width :layout-height)
+  [(dissoc attributes :layout-width :layout-height :layout-weight)
    (conj generated-code
          `(.setLayoutParams ~obj
                             ~(layout-params (:layout-width attributes)
-                                            (:layout-height attributes))))])
+                                            (:layout-height attributes)
+                                            (:layout-weight attributes))))])

 ;; ### Default attributes

@@ -158,16 +164,14 @@
   (str (.toUpperCase (.substring s 0 1)) (.substring s 1)))

 (defn default-setters-from-attributes
-  "Takes an object symbol and the attributes map after all
-  `transform-attributes` methods have been called on it. Transforms
+  "Takes an element type keyword, an object symbol and the attributes map after all `transform-attributes` methods have been called on it. Transforms
   each attribute into a call to (.set_CapitalizedKey_ obj value). If
-  value is a keyword then it is looked up in the attribute-values map.
-  Returns a list of setter calls. "
-  [obj attributes]
+  value is a keyword then it is looked up in the keyword-mapping or if it is not there, it is perceived as a static field of the class.
+  Returns a list of setter calls."
+  [el-type obj attributes]
   (map (fn [[attr value]]
-         (let [real-value (if (and (keyword? value)
-                                   (contains? attribute-values value))
-                            (attribute-values value)
+         (let [real-value (if (keyword? value)
+                            (attribute-value el-type value)
                             value)]
            `(~(symbol (str ".set" (capitalize (name attr)))) ~obj ~real-value)))
          attributes))
@@ -185,16 +189,9 @@
                 [attributes ()]
                 (conj (all-parents el-type) el-type))]
     (concat generated-code
-            (default-setters-from-attributes obj rest-attributes))))
+            (default-setters-from-attributes el-type obj rest-attributes))))

 ;; ## Top-level code-generation facilities
-
-(defn- gen-meaningful-sym
-  "Generates a symbol with a prefix taken from the `class-name` without
-  the package path."
-  [class-name]
-  (let [[_ last-name] (re-find #".+\.(.+)" (str class-name))]
-    (gensym last-name)))

 (defn make-ui-element
   "Takes a tree of elements and generates the code to create a new
@@ -203,7 +200,7 @@
   internal element. Presumes the `*context*` var to be bound."
   [[el-type attributes & inside-elements]]
   (let [klass (classname el-type)
-        obj (gen-meaningful-sym klass)]
+        obj (gensym (.getSimpleName klass))]
     `(let [~obj (new ~klass *context*)]
        ~@(process-attributes el-type obj attributes)
        ~@(map (fn [el]


Add padding to right and fit=true

Add padding to right and fit=true

--- src-cljs/frontend/components/insights/project.cljs
+++ src-cljs/frontend/components/insights/project.cljs
@@ -58,14 +58,16 @@
       (let [el (om/get-node owner)
             build-times (daily-median-build-time builds)]
         (js/c3.generate (clj->js {:bindto el
-                                  :padding {:top 10}
+                                  :padding {:top 10
+                                            :right 20}
                                   :data {:x "date"
                                          :columns [(concat ["date"] (map first build-times))
                                                    (concat ["Median Build Time"] (map last build-times))]}
                                   :legend {:hide true}
                                   :grid {:y {:show true}}
                                   :axis {:x {:type "timeseries"
-                                             :tick {:format "%m/%d"}}
+                                             :tick {:format "%m/%d"}
+                                                    :fit "true"}
                                          :y {:min 0
                                              :tick {:format #(str (quot % 60000) "m")}}}}))))
     om/IRender


find out if the user is an org admin somewhere else (#1975)

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -2463,9 +2463,10 @@
             projects (get-in data state/org-projects-path)
             user (:current-user data)
             subpage (-> data :navigation-data :subpage)
-            error-message (get-in data state/error-message-path)]
-        (html
-         (if-not (get-in project-data [:project :vcs_url]) ; wait for project-settings to load
+            error-message (get-in data state/error-message-path)
+            proj-vcs-url (get-in project-data [:project :vcs_url])]
+        (html
+         (if-not proj-vcs-url ; wait for project-settings to load
            [:div.empty-placeholder (spinner)]
            [:div#project-settings
             ; Temporarly disable top level error messsage for the set of subpages while we
@@ -2478,7 +2479,13 @@
                :parallel-builds (om/build parallel-builds data)
                :env-vars (om/build env-vars {:project-data project-data
                                              :projects projects
-                                             :org-admin? (get-in data (conj state/org-data-path :admin?))})
+                                             :org-admin? (->> user
+                                                              :organizations
+                                                              (filter (fn [org]
+                                                                        (= (:login org)
+                                                                           (vcs-url/org-name proj-vcs-url))))
+                                                              first
+                                                              :admin)})
                :advanced-settings (om/build advance project-data)
                :clear-caches (if (or (feature/enabled? :project-cache-clear-buttons)
                                      (config/enterprise?))


Fix for clojure < 1.7

Fix for clojure < 1.7

remove usage of cond-> and as->

--- src/main/clojure/clojure/data/xml/jvm/emit.clj
+++ src/main/clojure/clojure/data/xml/jvm/emit.clj
@@ -90,15 +90,15 @@
         global (str/blank? uri)
         xmlns-attrs (xmlns-attribute-set
                      writer
-                     (cond-> nss
-                       global (as-> nss
-                                  (let [default (get nss :xmlns)]
-                                    (when (and
-                                           (not (str/blank? default))
-                                           (.isLoggable logger Level/FINE))
-                                      (.log logger Level/FINE
-                                            (format "Default `xmlns=\"%s\"` had to be replaced with a `xmlns=\"\"` because of global element `%s`" default local)))
-                                    (assoc nss :xmlns ""))))
+                     (if global
+                       (let [default (get nss :xmlns)]
+                         (when (and
+                                (not (str/blank? default))
+                                (.isLoggable logger Level/FINE))
+                           (.log logger Level/FINE
+                                 (format "Default `xmlns=\"%s\"` had to be replaced with a `xmlns=\"\"` because of global element `%s`" default local)))
+                         (assoc nss :xmlns ""))
+                       nss)
                      (cons uri (map qname-uri (keys attrs))))]
     (if global
       (.writeStartElement writer local)


update ctx

update ctx

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -62,7 +62,7 @@
 (defn empty-env
   "Returns an empty env map"
   []
-  {:context    :statement
+  {:context    :ctx/statement
    :locals     {}
    :ns         *ns*})

@@ -247,7 +247,7 @@
                     (conj segs s)
                     (recur (conj segs (subs s 0 idx))
                            (subs s (inc (.indexOf s "}" idx)))))))
-        exprs (mapv (analyze-in-env (ctx env :expr)) args)]
+        exprs (mapv (analyze-in-env (ctx env :ctx/expr)) args)]
     (merge
      {:op       :js
       :env      env


Highlight discard

Highlight discard

--- src/leiningen/highlight/rendering_rules/html.clj
+++ src/leiningen/highlight/rendering_rules/html.clj
@@ -58,6 +58,7 @@
    :keyword {:content #(wrap-span "keyword" %2)}
    :string {:content string-rule}
    :comment {:content #(wrap-span "comment" %2)}
+   :discard {:discard #(wrap-span "comment" %2)}
    :list (collection-rule "list")
    :vector (collection-rule "vector")
    :map (collection-rule "map")


Added cors-handling into the core module

--- src/emender_jenkins/core.clj
+++ src/emender_jenkins/core.clj
@@ -1,7 +1,14 @@
 (ns emender-jenkins.core)

+(require '[ring.adapter.jetty      :as jetty])
+(require '[ring.middleware.params  :as http-params])
+(require '[ring.middleware.cookies :as cookies])
 (require '[clojure.tools.cli       :as cli])

+(require '[emender-jenkins.config       :as config])
+(require '[emender-jenkins.server       :as server])
+(require '[emender-jenkins.process-info :as process-info])
+
 (def cli-options
     ;; an option with a required argument
     [["-h"   "--help"                       "show help"                                                    :id :help]
@@ -10,6 +17,57 @@
      ["-t"   "--test-jobs-suffix suffix"    "test jobs suffix, for example 'test'"                         :id :test-jobs-suffix]
      ["-f"   "--fetch-only"                 "just start job fetcher once, then stop processing"            :id :fetch-only]
      ["-c"   "--config"                     "just show the actual configuration"                           :id :show-config]])
+
+(def access-control-allow-origins
+    "Only following domains will be properly handled by HTTP access control."
+    [
+     #".*localhost"
+     #".*localhost:[0-9]+"])
+
+; we don't use this handler and the whole cors library due to error in it
+;(defn cors-handler
+;    "Handler for the HTTP access control (CORS)"
+;    [handler]
+;    ;(cors/wrap-cors handler
+;    (cors/wrap-cors handler
+;        :access-control-allow-origin access-control-allow-origins
+;        :access-control-allow-methods [:get :put :post]))
+;        ;:access-control-allow-methods [:get :put :post :delete :options :head]))
+
+(defn get-cors-headers
+    [origin]
+    {"Access-Control-Allow-Origin"      origin
+     "Access-Control-Allow-Headers"     "Origin, Content-Type, Accept, Authorization"
+     "Access-Control-Allow-Credentials" "true"
+     "Access-Control-Allow-Methods"     "GET,POST,OPTIONS" })
+
+(defn origin-allowed?
+    "Returns truth value (not nil) when the origin matches at least one
+     regexp declared in access-control-allow-origins sequence."
+    [allowed-origins origin]
+    (if origin
+        (some #(re-matches %1 origin) access-control-allow-origins)))
+
+(defn all-cors
+    "Allow requests from all origins, not as good as cors-handler, but it does not work properly"
+    [handler]
+    (fn [request]
+        (let [headers (get request :headers)
+              origin  (get headers "origin")
+              response (handler request)]
+              (println "Origin: " origin)
+              (if (origin-allowed? access-control-allow-origins origin)
+                  (update-in response [:headers]
+                   merge (get-cors-headers origin))
+                   response))))
+
+(def app
+    "Ring application."
+    (-> server/handler
+        cookies/wrap-cookies
+        http-params/wrap-params
+        all-cors))
+        ;cors-handler))

 (defn start-server-on-regular-machine
     [port]
@@ -65,6 +123,36 @@
             (println (key property) (val property)))
         (println)))

+(defn fetch-jobs-only
+    [options]
+    ;(config/load-all-configuration-options-if-necessary)
+    (println "Generating data2.edn")
+    ;(job-data-fetcher/try-to-fetch-and-export-data)
+    (println "Done"))
+
+(defn show-config
+    [options]
+    (let [port                (options :port)
+          jenkins-url         (options :jenkins-url)
+          test-jobs-suffix    (options :test-jobs-suffix)
+          openshift-ip        (System/getenv "OPENSHIFT_CLOJURE_HTTP_IP")
+          openshift-port      (System/getenv "OPENSHIFT_CLOJURE_HTTP_PORT")]
+        (println "Finished")))
+
+(defn run-app
+    [options]
+    (let [port                (options :port)
+          jenkins-url         (options :jenkins-url)
+          test-jobs-suffix    (options :test-jobs-suffix)
+          openshift-ip        (System/getenv "OPENSHIFT_CLOJURE_HTTP_IP")
+          openshift-port      (System/getenv "OPENSHIFT_CLOJURE_HTTP_PORT")]
+       ;(config/load-all-configuration-options-if-necessary)
+       ;(config/override-options-by-cli jenkins-url preview-jobs-suffix stage-jobs-suffix portal-jobs-suffix)
+       ;(product-list/read-product-list-if-necessary config/load-product-list-from-database)
+       ;(job-data-fetcher/read-books-info)
+       ;(.start (Thread. job-data-fetcher/run-fetcher))
+        (start-server (get-port port) openshift-port openshift-ip)))
+
 (defn -main
     "Entry point to the titan server."
     [& args]


Use a simple dropdown menu instead of a button bar

for navigation between different issues

--- src/catalog/web/layout.clj
+++ src/catalog/web/layout.clj
@@ -67,21 +67,13 @@
                                    [(format "/%s/%s/editorial/braille" year issue) "Braille"]
                                    [(format "/%s/%s/editorial/hörbuch" year issue) "Hörbuch"]])
       (menu-item (format "/%s/%s/full-catalogs" year issue) "Full Catalogs")
-      (menu-item (format "/custom") "Custom Catalogs")]
-
-     [:ul.nav.navbar-nav.navbar-right
-      [:li
-       [:div.btn-group {:role "group"}
-        (let [[year issue] (issue/prev-issue year issue)]
-          [:a.btn.btn-default.navbar-btn
-           {:href (format "/%s/%s" year issue) :role "button"}
-           (glyphicon "step-backward" "Older")])
-        [:a.btn.btn-default.navbar-btn
-         {:href "/" :role "button"} (glyphicon "refresh" "Current")]
-        (let [[year issue] (issue/next-issue year issue)]
-          [:a.btn.btn-default.navbar-btn
-           {:href (format "/%s/%s" year issue) :role "button"}
-           (glyphicon "step-forward" "Newer")])]]]]]])
+      (menu-item (format "/custom") "Custom Catalogs")
+      (dropdown-menu "Older Catalogs"
+                     [(let [[year issue] (issue/prev-issue year issue)]
+                        [(format "/%s/%s" year issue) "Previous"])
+                      ["/" "Current"]
+                      (let [[year issue] (issue/next-issue year issue)]
+                        [(format "/%s/%s" year issue) "Next"])])]]]])

 (defn common
   "Display a page using the bootstrap css"


check if value to be parsed to int is "", if so: nil (#21)

--- src/gml_to_featured/code.clj
+++ src/gml_to_featured/code.clj
@@ -1,5 +1,6 @@
 (ns gml-to-featured.code
   (:require [gml-to-featured.xml :refer :all]
+            [clojure.string :as str]
             [clojure.zip :as zip]))

 (defn hyphenated->camel [^String method-name]
@@ -18,7 +19,7 @@
               :s/fid-attr `[fid-attr]
               :s/inner-gml `[inner-gml]
               :s/boolean `[text boolean (function "boolean")]
-              :s/int `[text #(. Integer parseInt %) (function "int")]
+              :s/int `[text #(if (str/blank? %) nil (. Integer parseInt %)) (function "int")]
               :s/geometry `[geometry]})

 (defn parse-selector-vector [key selector]


Pre component for example HTML code

Pre component for example HTML code

Also setTimeout on _altmetric_embed_init so the DOM is updated first.

--- src/golden_kestrel/core.cljs
+++ src/golden_kestrel/core.cljs
@@ -1,5 +1,7 @@
 (ns golden-kestrel.core
   (:require
+    [clojure.string :as string]
+    [clojure.set :as set]
     [om.core :as om :include-macros true]
     [om.dom :as dom :include-macros true]))

@@ -30,16 +32,41 @@
     (om/update! data (fn [state]
                        (apply assoc state all-vals)))))

-(defn embed [data]
-  (dom/div #js {:className "altmetric-embed"
-                :data-badge-popover (:popover data)
-                :data-badge-details (:badge-details data)
-                :data-badge-type (:badge-type data)
-                :data-doi (:doi data)
-                :data-hide-no-mentions (:hide-no-mentions data)}
-           nil))
+(defn attributes-for-embed
+  [data]
+  (into
+    {}
+    (remove
+      (comp string/blank? second)
+      {:className "altmetric-embed"
+       :data-badge-popover (:popover data)
+       :data-badge-details (:badge-details data)
+       :data-badge-type (:badge-type data)
+       :data-doi (:doi data)
+       :data-hide-no-mentions (:hide-no-mentions data)})))

-(defn embed-form [data owner]
+(defn pair-as-attribute
+  [[k v]]
+  (str (name k) "=\"" v "\""))
+
+(defn attributes-for-pre
+  [data]
+  (->> (set/rename-keys (attributes-for-embed data)
+                        {:className :class})
+       (map pair-as-attribute)
+       (string/join " ")))
+
+(defn embed-code
+  [data]
+  (dom/pre #js {:className "prettyprint"}
+           (str "<div " (attributes-for-pre data) "></div>")))
+
+(defn embed
+  [data]
+  (dom/div (clj->js (attributes-for-embed data)) nil))
+
+(defn embed-form
+  [data owner]
   (let [change-data (partial update-app data)]
     (dom/form
       nil
@@ -116,7 +143,8 @@
   []
   (when-let [rootdom (. js/document (getElementById "golden-kestrel"))]
     (let [form-element (find-or-create-element rootdom "embed-form")
-          embed-element (find-or-create-element rootdom "embed-example")]
+          embed-element (find-or-create-element rootdom "embed-example")
+          code-element (find-or-create-element rootdom "embed-code")]
       (om/root
         app-state
         (fn [app owner]
@@ -125,8 +153,13 @@
       (om/root
         app-state
         (fn [app owner]
-          (run-altmetric-embeds)
+          (js/setTimeout run-altmetric-embeds 100)
           (om/component (embed app)))
-        embed-element))))
+        embed-element)
+      (om/root
+        app-state
+        (fn [app owner]
+          (om/component (embed-code app)))
+        code-element))))

 (init)


Basics of getting new tweets on channel

Basics of getting new tweets on channel

--- src/clj/skytwit/server.clj
+++ src/clj/skytwit/server.clj
@@ -41,33 +41,6 @@
      frequencies)
 )

-(comment
-  (def collected (atom []))
-
-  (def ctx (tapi/make-api-context "https" "stream.twitter.com" "1.1"))
-
-  (let [w (java.io.PipedWriter.)
-        r (java.io.PipedReader. w)]
-    (ts/statuses-filter :params {:track "InternetRadio"}
-                        :api-context ctx
-                        :oauth-creds credentials
-                        :callbacks (AsyncStreamingCallback.
-                                     (fn [_ body]
-                                       (io/copy (.toByteArray body) w))
-                                     (comp println twh/response-return-everything)
-                                     twh/exception-print))
-    (future
-      (->> (json/parsed-seq r true)
-           (map (fn [j]
-                  (swap! collected conj j)))
-           doall)))
-
-  (->> collected deref
-       (map (comp :hashtags :entities))
-       (mapcat #(map :text %))
-       frequencies)
-  )
-
 ;; Taken from Sente README
 (let [{:keys [ch-recv
               send-fn
@@ -95,6 +68,7 @@
                                   :params {:screen-name "InternetRadio"})
                    :body)]
       {:name (:screen_name user)
+       :id (:id user)
        :number-of-tweets (:statuses_count user)
        :last-tweet-id (-> user :status :id)})
     (catch Exception _ nil)))
@@ -117,7 +91,7 @@
                            (.. System out
                                (println (pr-str [:failure resp])))
                            (if (twh/rate-limit-error? @(:status resp))
-                             (do (Thread/sleep (20 * 1000))
+                             (do (Thread/sleep (60 * 1000))
                                  (rec))
                              (twh/response-throw-error resp)))
                          twh/exception-rethrow)))
@@ -139,12 +113,37 @@
                  (>! chan next-batch)
                  (recur (:id (last next-batch))))))))

+(defn put-new-tweets-on-channel
+  [creds screen-name chan]
+  (let [w (java.io.PipedWriter.)
+        r (java.io.PipedReader. w)
+        end? (atom false)
+        id (:id (get-user-profile creds screen-name))
+        s (ts/statuses-filter :params {:follow id}
+                              :oauth-creds creds
+                              :callbacks (AsyncStreamingCallback.
+                                           (fn [_ body]
+                                             (io/copy (.toByteArray body) w))
+                                           twh/response-throw-error
+                                           twh/exception-rethrow))
+        f (go-loop [s (json/parsed-seq r true)]
+                   (when-not @end?
+                     (>! chan (first s))
+                     (recur (rest s))))]
+    ;; TODO: There may be a small memory leak here: if statuses-filter
+    ;;       is stopped in the middle of a JSON string, the lazy seq may
+    ;;       be blocked and the go-block may not get GC'd.
+    (fn []
+      ((:cancel s))
+      (reset! end? true))))
+
 (comment
   (def creds (get-credentials-from-env))
   (def a (atom []))

   (let [ch (async/chan)]
-    (put-all-tweets-on-channel creds "_toch" ch)
+    #_(put-all-tweets-on-channel creds "_toch" ch)
+    (put-new-tweets-on-channel creds "InternetRadio" ch)
     (go-loop []
              (when-let [v (<! ch)]
                (swap! a concat v)