add switch for enabling parsing private vars

--- src/cljs_api_gen/parse.clj
+++ src/cljs_api_gen/parse.clj
@@ -87,9 +87,17 @@
 ;; Parse defs
 ;;--------------------------------------------------------------------------------

+(def ^:dynamic *parse-private-defs?*
+  "Determines if private defs should be parsed."
+  false)
+
 (defn parse-defn-or-macro
   [form]
-  (let [type- ({'defn "function" 'defmacro "macro"} (first form))
+  (let [type- ({'defn "function"
+                'defn- "function"
+                'defmacro "macro"} (first form))
+        name- (second form)
+        meta- (meta name-)
         args (drop 2 form)
         docstring (let [ds (first args)]
                     (when (string? ds)
@@ -98,7 +106,9 @@
         attr-map (let [m (first args)]
                    (when (map? m) m))
         args (if attr-map (rest args) args)
-        private? (:private attr-map)
+        private? (or (= 'defn- (first form))
+                     (:private meta-)
+                     (:private attr-map))
         doc-forms (cond-> []
                     docstring (conj docstring)
                     attr-map (conj attr-map))
@@ -110,7 +120,8 @@
                          :head (take 2 form)
                          :doc doc-forms
                          :sig-body args})]
-    (when-not private?
+    (when (or *parse-private-defs?*
+              (not private?))
       {:expected-docs expected-docs
        :docstring (fix-docstring docstring)
        :signature signatures
@@ -120,31 +131,40 @@
   [form]
   (let [name- (second form)
         m (meta name-)
+        private? (:private m)
         docstring (fix-docstring (:doc m))
         signatures (when-let [arglists (:arglists m)]
                      (when (= 'quote (first arglists))
                        (second arglists)))]
-    {:docstring docstring
-     :signature signatures
-     :type "function"}))
+    (when (or *parse-private-defs?*
+              (not private?))
+      {:docstring docstring
+       :signature signatures
+       :type "function"})))

 (defn parse-var
   [form]
   (let [name- (second form)
         m (meta name-)
+        private? (:private m)
         docstring (fix-docstring (:doc m))
         dynamic? (:dynamic m)]
-    {:docstring docstring
-     :type (if dynamic? "dynamic var" "var")}))
+    (when (or *parse-private-defs?*
+              (not private?))
+      {:docstring docstring
+       :type (if dynamic? "dynamic var" "var")})))

 (defn parse-defcurried
   [form]
   (let [[_ name- docstring attr-map args] form
+        private? (:private attr-map)
         cargs (vec (butlast args))
         signatures [cargs args]]
-    {:docstring docstring
-     :signature signatures
-     :type "function"}))
+    (when (or *parse-private-defs?*
+              (not private?))
+      {:docstring docstring
+       :signature signatures
+       :type "function"})))

 (defn parse-protocol-method
   [form]
@@ -161,94 +181,58 @@
 (defn parse-defprotocol
   [form]
   (let [name- (second form)
+        meta- (meta name-)
+        private? (:private meta-)
         form (drop 2 form)
         docstring (let [d (first form)]
                     (when (string? d) d))
         form (if docstring (drop 1 form) form)
         method-lists form
         pmethods (mapv parse-protocol-method method-lists)]
-    {:docstring docstring
-     :signature nil
-     :methods pmethods
-     :type "protocol"}))
+    (when (or *parse-private-defs?*
+              (not private?))
+      {:docstring docstring
+       :signature nil
+       :methods pmethods
+       :type "protocol"})))

 (defn parse-deftype
   [form]
   (when (not= *cur-ns* "cljs.pprint") ;; ignore custom deftypes here
     (let [name- (second form)
+          meta- (meta name-)
+          private? (:private meta-)
           form (drop 2 form)
           signature (first form)]
-      {:signature (when signature
-                    [signature])
-       :type "type"})))
+      (when (or *parse-private-defs?*
+                (not private?))
+        {:signature (when signature [signature])
+         :type "type"}))))

 (defmulti parse-form*
   (fn [form]
-    (cond
-      (and (= 'defn (first form))
-           (not (:private (meta (second form)))))
-      "defn"
-
-      (and (= 'defmacro (first form))
-           (not (:private (meta (second form)))))
-      "defmacro"
-
-      (and (#{'def 'defonce} (first form))
-           (list? (nth form 2 nil))
-           (= 'fn (first (nth form 2 nil)))
-           (not (:private (meta (second form))))
-           (not (:dynamic (meta (second form)))))
-      "def fn"
-
-      (and (#{'def 'defonce} (first form))
-           (not (:private (meta (second form)))))
-      "var"
-
-      (and (= 'defcurried (first form))
-           (not (:private (nth form 3 nil))))
-      "defcurried"
-
-      (and (= 'defprotocol (first form))
-           (not (:private (meta (second form)))))
-      "defprotocol"
-
-      (and (= 'deftype (first form))
-           (not (:private (meta (second form)))))
-      "deftype"
-
-      :else nil)))
-
-(defmethod parse-form* "var"
-  [form]
-  (parse-var form))
-
-(defmethod parse-form* "def fn"
-  [form]
-  (parse-def-fn form))
-
-(defmethod parse-form* "defn"
-  [form]
-  (parse-defn-or-macro form))
-
-(defmethod parse-form* "defmacro"
-  [form]
-  (parse-defn-or-macro form))
-
-(defmethod parse-form* "defcurried"
-  [form]
-  (parse-defcurried form))
-
-(defmethod parse-form* "defprotocol"
-  [form]
-  (parse-defprotocol form))
-
-(defmethod parse-form* "deftype"
-  [form]
-  (parse-deftype form))
-
-(defmethod parse-form* nil
-  [form]
-  nil)
+    (case (first form)
+      defn          "defn"
+      defn-         "defn"
+      defmacro      "defmacro"
+      defcurried    "defcurried"
+      defprotocol   "defprotocol"
+      deftype       "deftype"
+      (def defonce) (if (and (list? (nth form 2 nil))
+                               (= 'fn (first (nth form 2 nil)))
+                               (not (:dynamic (meta (second form)))))
+                        "def fn"
+                        "var")
+      nil)))
+
+(defmethod parse-form* "var"         [form] (parse-var form))
+(defmethod parse-form* "def fn"      [form] (parse-def-fn form))
+(defmethod parse-form* "defn"        [form] (parse-defn-or-macro form))
+(defmethod parse-form* "defmacro"    [form] (parse-defn-or-macro form))
+(defmethod parse-form* "defcurried"  [form] (parse-defcurried form))
+(defmethod parse-form* "defprotocol" [form] (parse-defprotocol form))
+(defmethod parse-form* "deftype"     [form] (parse-deftype form))
+(defmethod parse-form* nil           [form] nil)

 ;;--------------------------------------------------------------------------------
 ;; Parse common meta for defs


mac and broadcast not required by default

--- src/physical/validations.clj
+++ src/physical/validations.clj
@@ -24,7 +24,7 @@

 (def physical-entity
   {:physical {
-    :mac #{:required :mac} :broadcast #{:required :ip}
+    :mac #{:mac} :broadcast #{:ip}
    }})

 (defmethod check-validity [:physical :entity] [physical]


Improved the evolution function.

Improved the evolution function.

--- src/clojure_robby/core.clj
+++ src/clojure_robby/core.clj
@@ -13,7 +13,7 @@
 (def actions [\u \d \l \r \x \p]) ; Actions the robot can take: up, down, left, right, pick up.
 (def dir-vects ['(0 -1) '(0 1) '(-1 0) '(1 0) '(0 0)]) ; Direction vectors, corresponding to the actions.

-(def mutation-prob 10) ; Probability in 100 that a gene will mutate.
+(def mutation-prob 5) ; Probability in 100 that a gene will mutate.
 (def action-penalty 5) ; How many points robot loses when hitting the wall or picking up when it shouldn't.
 (def gold-value 10) ; How many points picking up gold is worth.

@@ -113,12 +113,11 @@
 (defn evolve [individuals]
   "Takes a bunch of individuals (DNAs) and cross-breeds by fitness."
   (def the-map (rand-map))
-  (def ordered (sort-by (fn[dna] (simulate dna the-map)) individuals))
+  (def to-drop (/ (count individuals) 2))
+  (def ordered (drop to-drop (sort-by (fn[dna] (simulate dna the-map)) individuals)))
   (println (simulate (last ordered) the-map))
-  (def crossed
-    (map (fn [pair] (let [[a b] (vec pair)] (cross a b)))
-         (partition 2 ordered)))
-  (concat (mutate crossed) ()))
+  (let [breed (fn [dna] (cross dna (rand-nth ordered)))]
+    (map mutate (concat (map breed ordered) (map breed ordered)))))

 (defn -main
   "I don't do a whole lot ... yet."


Fix standalone input functions

Fix standalone input functions

--- src/play_clj/core_global.clj
+++ src/play_clj/core_global.clj
@@ -77,7 +77,7 @@

 (defmacro input
   [& args]
-  `(input* ~args (fn [func# options#] (func# options#))))
+  `(input* ~args (fn [func# & options#] (func# options#))))

 (defn gesture*
   [{:keys [fling long-press pan pan-stop pinch tap zoom]
@@ -115,7 +115,7 @@

 (defmacro gesture
   [& args]
-  `(gesture* ~args (fn [func# options#] (func# options#))))
+  `(gesture* ~args (fn [func# & options#] (func# options#))))

 (defn add-input!
   [^InputProcessor p]


Removed anonymous function

Removed anonymous function

--- src/foreclojure/data_set.clj
+++ src/foreclojure/data_set.clj
@@ -895,7 +895,7 @@
             :approved true
             :tags ["medium" "core-functions"]
             :tests ["(= (letfn [(triple [x] #(sub-two (* 3 x)))\n          (sub-two [x] #(stop?(- x 2)))\n          (stop? [x] (if (> x 50) x #(triple x)))]\n    (__ triple 2))\n  82)"
-                    "(= (letfn [(my-even? [x] (if (zero? x) true #(my-odd? (dec x))))\n          (my-odd? [x] (if (zero? x) false #(my-even? (dec x))))]\n    (map #(__ my-even? %) (range 6)))\n  [true false true false true false])"]})
+                    "(= (letfn [(my-even? [x] (if (zero? x) true #(my-odd? (dec x))))\n          (my-odd? [x] (if (zero? x) false #(my-even? (dec x))))]\n    (map (partial __ my-even?) (range 6)))\n  [true false true false true false])"]})

       (insert! :problems
            {:_id 79


Fix transit

Fix transit

--- src/clj/org/openforis/ceo/views.clj
+++ src/clj/org/openforis/ceo/views.clj
@@ -77,7 +77,8 @@
 (defn body->transit [body]
   (let [out    (ByteArrayOutputStream. 4096)
         writer (transit/writer out :json)]
-    (.toString (transit/write writer body))))
+    (transit/write writer body)
+    (.toString out)))

 (defn data-response
   "Create a response object.


action titles cleanup

action titles cleanup

--- src/cljs/swarmpit/view_actions.cljs
+++ src/cljs/swarmpit/view_actions.cljs
@@ -79,19 +79,19 @@

 (defmethod render :stack-create
   [_]
-  {:title "Stacks / Create"})
+  {:title "Stacks"})

 (defmethod render :stack-last
   [_]
-  {:title "Stacks / Edit"})
+  {:title "Stacks"})

 (defmethod render :stack-previous
   [_]
-  {:title "Stacks / Edit"})
+  {:title "Stacks"})

 (defmethod render :stack-compose
   [_]
-  {:title "Stacks / Edit"})
+  {:title "Stacks"})

 ;;; Service view

@@ -108,19 +108,19 @@

 (defmethod render :service-log
   [_]
-  {:title "Services / Log"})
+  {:title "Services"})

 (defmethod render :service-create-image
   [_]
-  {:title "Services / Wizard"})
+  {:title "Services"})

 (defmethod render :service-create-config
   [_]
-  {:title "Services / Wizard"})
+  {:title "Services"})

 (defmethod render :service-edit
   [_]
-  {:title "Services / Edit"})
+  {:title "Services"})

 ;;; Network view

@@ -137,7 +137,7 @@

 (defmethod render :network-create
   [_]
-  {:title "Networks / Create"})
+  {:title "Networks"})

 ;;; Node view

@@ -152,7 +152,7 @@

 (defmethod render :node-edit
   [_]
-  {:title "Nodes / Edit"})
+  {:title "Nodes"})

 ;;; Volume view

@@ -169,7 +169,7 @@

 (defmethod render :volume-create
   [_]
-  {:title "Volumes / Create"})
+  {:title "Volumes"})

 ;;; Secret view

@@ -186,7 +186,7 @@

 (defmethod render :secret-create
   [_]
-  {:title "Secrets / Create"})
+  {:title "Secrets"})

 ;;; Config view

@@ -203,7 +203,7 @@

 (defmethod render :config-create
   [_]
-  {:title "Configs / Create"})
+  {:title "Configs"})

 ;;; Task view

@@ -231,11 +231,11 @@

 (defmethod render :user-create
   [_]
-  {:title "Users / Create"})
+  {:title "Users"})

 (defmethod render :user-edit
   [_]
-  {:title "Users / Edit"})
+  {:title "Users"})

 ;;; Registry view

@@ -252,11 +252,11 @@

 (defmethod render :registry-create
   [_]
-  {:title "Registries / Create"})
+  {:title "Registries"})

 (defmethod render :registry-edit
   [_]
-  {:title "Registries / Edit"})
+  {:title "Registries"})

 ;;; Dockerhub user view

@@ -273,8 +273,8 @@

 (defmethod render :dockerhub-user-create
   [_]
-  {:title "Dockerhub / Create"})
+  {:title "Dockerhub"})

 (defmethod render :dockerhub-user-edit
   [_]
-  {:title "Dockerhub / Edit"})+  {:title "Dockerhub"})


Add all-readers to Connect

Add all-readers to Connect

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -137,6 +137,8 @@
   (if-let [ent (indexed-ident env)]
     (p/join (atom ent) env)
     ::p/continue))
+
+(def all-readers [#?(:clj reader) ident-reader index-reader])

 ;;;;;;;;;;;;;;;;;;;


Logging must be thread safe

Logging must be thread safe

--- src/emender_jenkins/jenkins_api.clj
+++ src/emender_jenkins/jenkins_api.clj
@@ -20,6 +20,10 @@

 (require '[clojure.data.json :as json])
 (require '[clj-http.client   :as http-client])
+
+(defn log
+    [& args]
+    (.println System/out (apply str (interpose \space args))))

 (defn get-command
     [url]
@@ -44,7 +48,7 @@
 (defn post-command
     [jenkins-url jenkins-auth job-name command]
     (let [url (str (job-name->url (update-jenkins-url jenkins-url jenkins-auth) job-name) "/" command)]
-        (println "URL to use: " url)
+        (log "URL to use: " url)
         (http-client/post url {
                     :keystore "keystore"
                     :keystore-pass "changeit"
@@ -54,7 +58,7 @@
 (defn read-list-of-all-jobs
     [jenkins-url job-list-part]
     (let [all-jobs-url (str jenkins-url job-list-part)]
-        (println "Using the following URL to retrieve all Jenkins jobs: " all-jobs-url)
+        (log "Using the following URL to retrieve all Jenkins jobs: " all-jobs-url)
         (let [data (json/read-str (get-command all-jobs-url))]
             (if data
                 (get data "jobs")
@@ -75,7 +79,7 @@
 (defn read-job-results
     [jenkins-url job-name]
     (let [url (str (job-name->url jenkins-url job-name) "/lastSuccessfulBuild/artifact/results.json/")]
-        (println "Using the following URL to retrieve job results: " url)
+        (log "Using the following URL to retrieve job results: " url)
         (try
             (slurp url)
             (catch Exception e
@@ -83,13 +87,14 @@
                  nil))))

 (defn read-file-from-artifact
-    [jenkins-url job-name file-name]
+    [jenkins-url job-name file-name print-stack-trace?]
     (let [url (str (job-name->url jenkins-url job-name) "/lastSuccessfulBuild/artifact/" file-name)]
-        (println "Using the following URL to retrieve file from artifact: " url)
+        (log "*Using the following URL to retrieve file from artifact: " url)
         (try
             (slurp url)
             (catch Exception e
-                 (.printStackTrace e)
+                 (if print-stack-trace?
+                     (.printStackTrace e))
                  nil))))

 (defn ok-response-structure
@@ -129,11 +134,11 @@

 (defn log-operation
     [job-name git-repo branch operation metadata]
-    (println "***" operation "***")
-    (println "job-name" job-name)
-    (println "git-repo" git-repo)
-    (println "branch"   branch)
-    (println "metadata" metadata))
+    (log "***" operation "***")
+    (log "job-name" job-name)
+    (log "git-repo" git-repo)
+    (log "branch"   branch)
+    (log "metadata" metadata))

 (defn send-configuration-xml-to-jenkins
     [url config]
@@ -155,7 +160,7 @@
     (let [template (get-template metadata)
           config   (update-template template git-repo branch metadata)
           url      (str (update-jenkins-url jenkins-url jenkins-auth) "createItem?name=" (.replaceAll job-name " " "%20"))]
-          (println "URL to use: " url)
+          (log "URL to use: " url)
           (try
               (->> (send-configuration-xml-to-jenkins url config)
                    (ok-response-structure job-name "create" include-jenkins-reply?))
@@ -169,7 +174,7 @@
     (let [template (get-template metadata)
           config   (update-template template git-repo branch metadata)
           url      (str (job-name->url (update-jenkins-url jenkins-url jenkins-auth) job-name) "/config.xml")]
-          (println "URL to use: " url)
+          (log "URL to use: " url)
           (try
               (->> (send-configuration-xml-to-jenkins url config)
                    (ok-response-structure job-name "update" include-jenkins-reply?))


remove duplicate entry-is-directory? function

--- src/fscrawler_tika_convert/core.clj
+++ src/fscrawler_tika_convert/core.clj
@@ -44,10 +44,6 @@

 (def entry-is-directory? (partial entry-is-type? "directory"))
 (def entry-is-file? (partial entry-is-type? "file"))
-
-(defn entry-is-directory?
-  [entry]
-  (= (get-in entry [:stat :type]) "directory"))

 (defn handle-msg-get_permissions


optimize munge

optimize munge

--- src/main/clojure/cljs/compiler.cljc
+++ src/main/clojure/cljs/compiler.cljc
@@ -67,33 +67,43 @@
       (munge
         (str (string/replace (str ns) "." "$") "$" scoped-name)))))

+(defn munge-reserved [reserved]
+  (fn [s]
+    (if-not (nil? (get reserved s))
+      (str s "$")
+      s)))
+
 (defn munge
   ([s] (munge s js-reserved))
   ([s reserved]
-   (if (map? s)
-     (let [{:keys [name field info] :as name-var} s]
-       (if (:fn-self-name info)
+   (if #?(:clj  (map? s)
+          :cljs (ana/cljs-map? s))
+     (let [name-var s
+           name     (:name name-var)
+           field    (:field name-var)
+           info     (:info name-var)]
+       (if-not (nil? (:fn-self-name info))
          (fn-self-name s)
          ;; Unshadowing
-         (let [depth (shadow-depth s)
-               renamed (*lexical-renames*
-                         #?(:clj (System/identityHashCode s)
-                            :cljs (hash s)))
-               munged-name (munge
-                             (cond field (str "self__." name)
-                                   renamed renamed
-                                   :else name)
-                             reserved)]
-           (if (or field (zero? depth))
+         (let [depth       (shadow-depth s)
+               code        #?(:clj  (System/identityHashCode s)
+                              :cljs (hash s))
+               renamed     (get *lexical-renames* code)
+               name        (cond
+                             (true? field) (str "self__." name)
+                             (not (nil? renamed)) renamed
+                             :else name)
+               munged-name (munge name reserved)]
+           (if (or (true? field) (zero? depth))
              munged-name
              (symbol (str munged-name "__$" depth))))))
      ;; String munging
      (let [ss (string/replace (str s) ".." "_DOT__DOT_")
            ss (string/replace ss
                 #?(:clj #"\/(.)" :cljs (js/RegExp. "\\/(.)")) ".$1") ; Division is special
-           ss (string/join "."
-                (map #(if (reserved %) (str % "$") %)
-                  (string/split ss #"\.")))
+           rf (munge-reserved reserved)
+           ss (map rf (string/split ss #"\."))
+           ss (string/join "." ss)
            ms #?(:clj (clojure.lang.Compiler/munge ss)
                  :cljs (cljs.core/munge ss))]
        (if (symbol? s)


no need for args

no need for args

--- src/docker/remote.clj
+++ src/docker/remote.clj
@@ -22,10 +22,10 @@
 (import-logging)

 (defn root [node]
-  (<< "http://~(hypervisor :docker :nodes node :host):~(hypervisor :docker :nodes node :port)/"))
+  (<< "https://~(hypervisor :docker :nodes node :host):~(hypervisor :docker :nodes node :port)/"))

-(defn call [verb api args node]
-  (parse-string (:body (verb (<< "~(root node)~{api}") args)) true))
+(defn call [verb api node]
+  (parse-string (:body (verb (<< "~(root node)~{api}") {:insecure? true})) true))

 (defn docker-post
   "A post against a docker instance with provided params"
@@ -35,11 +35,11 @@
      (call client/post api {} node)
      (call client/post api {:form-params params} node))))

-(defn docker-delete [node api] (call client/delete api {} node))
+(defn docker-delete [node api] (call client/delete api node))

-(defn docker-get [node api] (call client/get api {} node))
+(defn docker-get [node api] (call client/get api node))

 (celestial.model/set-env :dev
- (docker-get :local-docker "/images/json?all=0"))
+ (docker-get :local "/images/json?all=0"))


Added Redis configuration values.

Added Redis configuration values.


Added ring.util.request/path-info function

--- ring-core/src/ring/util/request.clj
+++ ring-core/src/ring/util/request.clj
@@ -28,3 +28,9 @@

 (defmethod body-string java.io.InputStream [request]
   (slurp (:body request)))
+
+(defn path-info
+  "Returns the relative path of the request."
+  [request]
+  (or (:path-info request)
+      (:uri request)))


Review fixes.

Review fixes.

--- src/clj/org/openforis/ceo/handler.clj
+++ src/clj/org/openforis/ceo/handler.clj
@@ -1,7 +1,7 @@
 (ns org.openforis.ceo.handler
   (:require [clojure.data.json :as json]
-            [clojure.edn :as edn]
-            [clojure.string :as str]
+            [clojure.edn       :as edn]
+            [clojure.string    :as str]
             [ring.middleware.absolute-redirects :refer [wrap-absolute-redirects]]
             [ring.middleware.content-type       :refer [wrap-content-type]]
             [ring.middleware.default-charset    :refer [wrap-default-charset]]
@@ -16,10 +16,10 @@
             [ring.middleware.ssl                :refer [wrap-ssl-redirect]]
             [ring.middleware.x-headers          :refer [wrap-frame-options wrap-content-type-options wrap-xss-protection]]
             [ring.util.codec                    :refer [url-decode]]
-            [org.openforis.ceo.database   :refer [sql-handler]]
-            [org.openforis.ceo.logging    :refer [log-str]]
-            [org.openforis.ceo.remote-api :refer [clj-handler]]
-            [org.openforis.ceo.views      :refer [render-page not-found-page data-response]]))
+            [org.openforis.ceo.database         :refer [sql-handler]]
+            [org.openforis.ceo.logging          :refer [log-str]]
+            [org.openforis.ceo.remote-api       :refer [clj-handler]]
+            [org.openforis.ceo.views            :refer [render-page not-found-page data-response]]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Routing Handler
@@ -140,8 +140,6 @@
                         wrap-ssl-redirect
                         wrap-common))

-;; TODO figwheel adds a good bit of its own middleware.
-;;      The current middleware in wrap-common are mostly over written by figwheel.
 (def development-app (-> routing-handler
                          wrap-common
-                         wrap-reload))+                         wrap-reload))


move dom setup to end

move dom setup to end

--- src/cljs/infinitelives/pixi/font.cljs
+++ src/cljs/infinitelives/pixi/font.cljs
@@ -168,11 +168,6 @@
      el
      js/document.body)))

-;(install-force-loading-font-div! "Abel")
-
-(install-google-webfont-script!)
-(install-google-font-stylesheet! "http://fonts.googleapis.com/css?family=Open+Sans:400")
-
 (defn render-row [metrics texture row y]
   (for [[i c] (partition 2 (interleave (range) row))]
     (let [tex (render-texture-char!
@@ -257,6 +252,7 @@
      :font font
     }))

+
 (defn font-text-width [font text]
   (text-width (:metrics font) text))

@@ -284,3 +280,7 @@
         (if (not (empty? r))
           (recur r (+ xp w))
           [(+ xp w x) y])))))
+
+
+;; install the installer??
+(install-google-webfont-script!)


Description in one line

Description in one line

--- web-app/project.clj
+++ web-app/project.clj
@@ -95,9 +95,8 @@
                            :pretty-print  false}}]}

   :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]
-                 :welcome (println "Welcome to Potato
-                                  dev server Clojure REPL.")
-                 :init-ns potato.dev}
+                 :welcome (println "Welcome to Potato dev server Clojure REPL.")
+                 :init-ns potato.dev}
   :figwheel {:server-port      10555
              :http-server-root "public"
              :nrepl-port       7888})


Pass media-type to delete links in stakeholder update too.

--- src/open_company/representations/stakeholder_update.clj
+++ src/open_company/representations/stakeholder_update.clj
@@ -37,7 +37,7 @@
       :created-at (:created-at update)
       :medium (:medium update)
       :author (:author update)
-      :links (if authorized [su-link (common/delete-link (stakeholder-update-url company-url slug))] [su-link])
+      :links (if authorized [su-link (common/delete-link (stakeholder-update-url company-url slug) media-type)] [su-link])
     }))

 (defn- stakeholder-update-links
@@ -48,7 +48,7 @@
                    (conj su-links (common/link-map "company" common/GET company-url common/company-media-type))
                    su-links)
         with-write (if write-access
-                     (conj with-read (common/delete-link (stakeholder-update-url company-url (:slug update))))
+                     (conj with-read (common/delete-link (stakeholder-update-url company-url (:slug update)) media-type))
                      with-read)]
     (assoc update :links with-write)))


Fixes whitespace/alignment in schema.clj (#294)

--- scheduler/src/cook/mesos/schema.clj
+++ scheduler/src/cook/mesos/schema.clj
@@ -19,69 +19,69 @@

 (def schema-attributes
   [;; Job attributes
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/command
-     :db/valueType :db.type/string
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/commit-latch
-     :db/valueType :db.type/ref
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/user
-     :db/valueType :db.type/string
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/name
-     :db/valueType :db.type/string
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/uuid
-     :db/valueType :db.type/uuid
-     :db/cardinality :db.cardinality/one
-     :db/unique :db.unique/identity
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/max-retries
-     :db/valueType :db.type/long
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/max-runtime
-     :db/valueType :db.type/long
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/environment
-     :db/valueType :db.type/ref
-     :db/cardinality :db.cardinality/many
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/label
-     :db/valueType :db.type/ref
-     :db/cardinality :db.cardinality/many
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/state
-     :db/valueType :db.type/ref
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/instance
-     :db/valueType :db.type/ref
-     :db/isComponent true
-     :db/cardinality :db.cardinality/many
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :job/resource
-     :db/valueType :db.type/ref
-     :db/isComponent true
-     :db/cardinality :db.cardinality/many
-     :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/command
+    :db/valueType :db.type/string
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/commit-latch
+    :db/valueType :db.type/ref
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/user
+    :db/valueType :db.type/string
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/name
+    :db/valueType :db.type/string
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/uuid
+    :db/valueType :db.type/uuid
+    :db/cardinality :db.cardinality/one
+    :db/unique :db.unique/identity
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/max-retries
+    :db/valueType :db.type/long
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/max-runtime
+    :db/valueType :db.type/long
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/environment
+    :db/valueType :db.type/ref
+    :db/cardinality :db.cardinality/many
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/label
+    :db/valueType :db.type/ref
+    :db/cardinality :db.cardinality/many
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/state
+    :db/valueType :db.type/ref
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/instance
+    :db/valueType :db.type/ref
+    :db/isComponent true
+    :db/cardinality :db.cardinality/many
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :job/resource
+    :db/valueType :db.type/ref
+    :db/isComponent true
+    :db/cardinality :db.cardinality/many
+    :db.install/_attribute :db.part/db}
    {:db/id (d/tempid :db.part/db)
     :db/ident :job/submit-time
     :db/index true
@@ -342,16 +342,16 @@
     :db/cardinality :db.cardinality/one
     :db.install/_attribute :db.part/db}
    ;; Environment Variable attributes
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :environment/name
-     :db/valueType :db.type/string
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :environment/value
-     :db/valueType :db.type/string
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :environment/name
+    :db/valueType :db.type/string
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :environment/value
+    :db/valueType :db.type/string
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
    ;; Label attributes
    {:db/id (d/tempid :db.part/db)
     :db/ident :label/key
@@ -409,59 +409,59 @@
     :db/valueType :db.type/boolean
     :db/cardinality :db.cardinality/one
     :db.install/_attribute :db.part/db}
-    ;; Instance attributes
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :instance/task-id
-     :db/valueType :db.type/string
-     :db/unique :db.unique/identity
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :instance/progress
-     :db/doc "represents the progress of the instance, from 0 to 100"
-     :db/valueType :db.type/long
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :instance/backfilled?
-;;;   In a future version, datomic adds these schema values, leaving the info here when that occurs
-;;     :schema/deprecated true
-;;     :schema/deprecated-because "The concept of backfill was meant to allow Cook to schedule jobs out of order
-;;                                 temporarily but treat the jobs as opportunistic and upgrade the jobs out of
-;;                                 backfill later once the scheduling order had been corrected. Unfortunately,
-;;                                 this causes a lot of unexpected behavior (jobs being preempted out of priority
-;;                                 order) and lots of bugs (it is hard to correctly update jobs). The concept of
-;;                                 backfill is not worth the added problems and so it is being removed."
-     :db/doc "DEPRECATED: If this is true, then this instance should be preempted first regardless of priority. It's okay to upgrade an instance to be non-backfilled after a while."
-     :db/valueType :db.type/boolean
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :instance/hostname
-     :db/valueType :db.type/string
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :instance/ports
-     :db/valueType :db.type/long
-     :db/cardinality :db.cardinality/many
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :instance/executor-id
-     :db/valueType :db.type/string
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :instance/slave-id
-     :db/valueType :db.type/string
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :instance/status
-     :db/index true
-     :db/valueType :db.type/ref
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
+   ;; Instance attributes
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :instance/task-id
+    :db/valueType :db.type/string
+    :db/unique :db.unique/identity
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :instance/progress
+    :db/doc "represents the progress of the instance, from 0 to 100"
+    :db/valueType :db.type/long
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :instance/backfilled?
+    ;;;   In a future version, datomic adds these schema values, leaving the info here when that occurs
+    ;;     :schema/deprecated true
+    ;;     :schema/deprecated-because "The concept of backfill was meant to allow Cook to schedule jobs out of order
+    ;;                                 temporarily but treat the jobs as opportunistic and upgrade the jobs out of
+    ;;                                 backfill later once the scheduling order had been corrected. Unfortunately,
+    ;;                                 this causes a lot of unexpected behavior (jobs being preempted out of priority
+    ;;                                 order) and lots of bugs (it is hard to correctly update jobs). The concept of
+    ;;                                 backfill is not worth the added problems and so it is being removed."
+    :db/doc "DEPRECATED: If this is true, then this instance should be preempted first regardless of priority. It's okay to upgrade an instance to be non-backfilled after a while."
+    :db/valueType :db.type/boolean
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :instance/hostname
+    :db/valueType :db.type/string
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :instance/ports
+    :db/valueType :db.type/long
+    :db/cardinality :db.cardinality/many
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :instance/executor-id
+    :db/valueType :db.type/string
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :instance/slave-id
+    :db/valueType :db.type/string
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :instance/status
+    :db/index true
+    :db/valueType :db.type/ref
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}
    {:db/id (d/tempid :db.part/db)
     :db/ident :instance/start-time
     :db/valueType :db.type/instant
@@ -498,19 +498,19 @@
     :db/cardinality :db.cardinality/one
     :db.install/_attribute :db.part/db}

-    ;; Share attributes
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :share/resource
-     :db/valueType :db.type/ref
-     :db/isComponent true
-     :db/cardinality :db.cardinality/many
-     :db.install/_attribute :db.part/db}
-    {:db/id (d/tempid :db.part/db)
-     :db/ident :share/user
-     :db/valueType :db.type/string
-     :db/unique :db.unique/identity
-     :db/cardinality :db.cardinality/one
-     :db.install/_attribute :db.part/db}
+   ;; Share attributes
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :share/resource
+    :db/valueType :db.type/ref
+    :db/isComponent true
+    :db/cardinality :db.cardinality/many
+    :db.install/_attribute :db.part/db}
+   {:db/id (d/tempid :db.part/db)
+    :db/ident :share/user
+    :db/valueType :db.type/string
+    :db/unique :db.unique/identity
+    :db/cardinality :db.cardinality/one
+    :db.install/_attribute :db.part/db}

    ;; Quota attributes
    {:db/id (d/tempid :db.part/db)
@@ -531,7 +531,7 @@
     :db/cardinality :db.cardinality/one
     :db.install/_attribute :db.part/db}

-    ;; Resource mapping attributes
+   ;; Resource mapping attributes
    {:db/id (d/tempid :db.part/db)
     :db/ident :resource.type/mesos-name
     :db/valueType :db.type/keyword
@@ -726,7 +726,7 @@
                          mea-culpa-limit (or (when (:job/disable-mea-culpa-retries job-ent)
                                                0)
                                              (:scheduler.config/mea-culpa-failure-limit
-                                              (d/entity db :scheduler/config))
+                                               (d/entity db :scheduler/config))
                                              5)]
                      (->> job-ent
                           :job/instance
@@ -812,40 +812,40 @@
                      ;; Checking the validity of the target state transition
                      (when (get-in state-transitions [old-state new-state])
                        (into [[:db/add instance :instance/status new-state]]
-                         (let [instance-ent (d/entity db instance)
-                               job-ent (:job/_instance instance-ent)
-                               job (:db/id job-ent)
-                               other-instances (->> (:job/instance job-ent)
-                                                    (remove #(= (:db/id %) (:db/id instance-ent))))
-                               instance-states (->> other-instances
-                                                    (map :instance/status)
-                                                    (cons new-state))
-                               any-success? (some #{:instance.status/success} instance-states)
-                               any-running? (some #{:instance.status/running} instance-states)
-                               any-unknown? (some #{:instance.status/unknown} instance-states)
-                               all-failed? (every? #{:instance.status/failed} instance-states)
-                               prior-state (:job/state job-ent)
-                               reason (d/entity db reason)
-                               all-attempts-consumed?
-                               (d/invoke db :job/all-attempts-consumed? db
-                                         (update-in (into {} job-ent) [:job/instance]
-                                                    conj {:instance/status new-state
-                                                          :instance/reason reason}))]
-                           (cond
-                             (= prior-state :job.state/completed)
-                             []
-
-                             (or (and all-failed?
-                                      all-attempts-consumed?)
-                                 any-success?)
-                             [[:db/add job :job/state :job.state/completed]]
-
-                             (or any-running?
-                                 any-unknown?)
-                             [[:db/add job :job/state :job.state/running]]
-
-                             :else
-                             [[:db/add job :job/state :job.state/waiting]])))))}}
+                             (let [instance-ent (d/entity db instance)
+                                   job-ent (:job/_instance instance-ent)
+                                   job (:db/id job-ent)
+                                   other-instances (->> (:job/instance job-ent)
+                                                        (remove #(= (:db/id %) (:db/id instance-ent))))
+                                   instance-states (->> other-instances
+                                                        (map :instance/status)
+                                                        (cons new-state))
+                                   any-success? (some #{:instance.status/success} instance-states)
+                                   any-running? (some #{:instance.status/running} instance-states)
+                                   any-unknown? (some #{:instance.status/unknown} instance-states)
+                                   all-failed? (every? #{:instance.status/failed} instance-states)
+                                   prior-state (:job/state job-ent)
+                                   reason (d/entity db reason)
+                                   all-attempts-consumed?
+                                   (d/invoke db :job/all-attempts-consumed? db
+                                             (update-in (into {} job-ent) [:job/instance]
+                                                        conj {:instance/status new-state
+                                                              :instance/reason reason}))]
+                               (cond
+                                 (= prior-state :job.state/completed)
+                                 []
+
+                                 (or (and all-failed?
+                                          all-attempts-consumed?)
+                                     any-success?)
+                                 [[:db/add job :job/state :job.state/completed]]
+
+                                 (or any-running?
+                                     any-unknown?)
+                                 [[:db/add job :job/state :job.state/running]]
+
+                                 :else
+                                 [[:db/add job :job/state :job.state/waiting]])))))}}

    {:db/id (d/tempid :db.part/user)
     :db/ident :job/allowed-to-start?
@@ -883,10 +883,10 @@

 (def reason-entities
   [{:db/id (d/tempid :db.part/user)
-     :reason/code 1002
-     :reason/string "Preempted by rebalancer"
-     :reason/mea-culpa? true
-     :reason/name :preempted-by-rebalancer}
+    :reason/code 1002
+    :reason/string "Preempted by rebalancer"
+    :reason/mea-culpa? true
+    :reason/name :preempted-by-rebalancer}
    {:db/id (d/tempid :db.part/user)
     :reason/code 1003
     :reason/string "Container preempted by Mesos"


processing tree

processing tree

--- sass-dsl/src/sass_dsl/transform.clj
+++ sass-dsl/src/sass_dsl/transform.clj
@@ -96,3 +96,22 @@
     (zip/node (zip/right loc)))
    new-node-name))

+(defn sass-de-nest
+  "Flatten out selectors and attributes, prefixing the parent names."
+  [loc]
+  {:pre [(not (nil? loc))]}
+  (let [is-element (common/is-element loc)
+        is-selector (if is-element (common/is-selector loc))
+        has-parent (common/get-parent loc)
+        parent-is-selector (is-parent-selector loc)
+        parent-name (parent-name loc)
+        is-selector-and-parent-is-selector (is-selecor-and-parent-is-selector loc)
+        node-name (if is-element (zip/node loc))
+        new-node-name (if (and is-element has-parent)
+                        (if is-selector-and-parent-is-selecor (str parent-name " " node-name)))]
+    (if (zip/end? loc)
+      (zip/root loc)
+      (if is-selecor-and-parent-is-selecor
+        (recur
+         (pull-selecor-and-child-up-one loc new-node-name))
+        (recur (zip/next loc))))))


Modify one login URL

Modify one login URL

--- src/ktra_indexer/handler.clj
+++ src/ktra_indexer/handler.clj
@@ -67,7 +67,7 @@
     ;; is authenticated but permission denied is raised.
     (assoc (resp/response "403 Forbidden") :status 403)
     ;; In other cases, redirect it user to login
-    (resp/redirect "/login")))
+    (resp/redirect (str (get-conf-value :url-path) "/login"))))

 (def auth-backend (session-backend
                    {:unauthorized-handler unauthorized-handler}))


Added trim to indent function for maps

Added trim to indent function for maps

  - This was done to prevent trailing whitespaces and newlines in
    generated templates

--- src/leiningen/new/common.clj
+++ src/leiningen/new/common.clj
@@ -45,7 +45,9 @@
 (defn indent [n form]
   (let [indents (apply str (repeat n " "))]
     (if (map? form)
-      (indented-code n form)
+      (-> (indented-code n form)
+          clojure.string/trim
+          clojure.string/trim-newline)
       (->> form
            (map str)
            (clojure.string/join (str "\n" indents))))))


Fix goog.js not found

Fix goog.js not found

--- src/leiningen/new/nwcljs.clj
+++ src/leiningen/new/nwcljs.clj
@@ -20,6 +20,6 @@
              ["build/index.html" (render "build/index.html" data)]
              ["build/package.json" (render "build/package.json" data)]
              ["build/test/index.js" (render "build/test/index.js" data)]
-             ["build/goog.js" (render "build/goog.js" data)]
+             ["build/goog" (render "build/goog" data)]
              "build/node_modules"
              "bin")))


Factor out make-build function.

Factor out make-build function.

--- src/leiningen/util/maven.clj
+++ src/leiningen/util/maven.clj
@@ -198,10 +198,15 @@
   [project path-key]
   (.replace (path-key project) (str (:root project) File/separator) ""))

-(defmacro ^{:private true} add-a-resource [build method resource-path]
-  `(let [resource# (Resource.)]
-     (.setDirectory resource# ~resource-path)
-     (~(symbol (name method)) ~build [resource#])))
+(defn make-resource [project resource-path]
+  (doto (Resource.) (.setDirectory (relative-path project resource-path))))
+
+(defn make-build [project]
+  (doto (Build.)
+    (.setResources [(make-resource project :resources-path)])
+    (.setTestResources [(make-resource project :dev-resources-path)])
+    (.setSourceDirectory (relative-path project :source-path))
+    (.setTestSourceDirectory (relative-path project :test-path))))

 (defn make-model [project]
   (let [model (doto (Model.)
@@ -211,15 +216,8 @@
                 (.setVersion (:version project))
                 (.setGroupId (:group project))
                 (.setDescription (:description project))
-                (.setUrl (:url project)))
-        build (doto (Build.)
-                (add-a-resource :.setResources
-                                (relative-path project :resources-path))
-                (add-a-resource :.setTestResources
-                                (relative-path project :dev-resources-path))
-                (.setSourceDirectory (relative-path project :source-path))
-                (.setTestSourceDirectory (relative-path project :test-path)))]
-    (.setBuild model build)
+                (.setUrl (:url project))
+                (.setBuild (make-build project)))]
     (doseq [dep (:dependencies project)]
       (.addDependency model (make-dependency dep)))
     (doseq [repo (repositories-for project)]


Don't use keep.

Don't use keep.

--- src/leiningen/util/maven.clj
+++ src/leiningen/util/maven.clj
@@ -20,9 +20,9 @@
   (.lookup container ArtifactRepositoryLayout/ROLE "default"))

 (def policy
-     (ArtifactRepositoryPolicy. true
-                                ArtifactRepositoryPolicy/UPDATE_POLICY_DAILY
-                                ArtifactRepositoryPolicy/CHECKSUM_POLICY_FAIL))
+  (ArtifactRepositoryPolicy. true
+                             ArtifactRepositoryPolicy/UPDATE_POLICY_DAILY
+                             ArtifactRepositoryPolicy/CHECKSUM_POLICY_FAIL))

 (defn make-settings []
   (.buildSettings (.lookup container MavenSettingsBuilder/ROLE)))
@@ -221,8 +221,7 @@
       (.setScm model scm))
     (when-let [parent (:parent project)]
       (.setParent model (apply make-parent parent)))
-    (doseq [license (concat (keep #(% project)
-                                  [:licence :license])
+    (doseq [license (concat (filter project [:licence :license])
                             (:licences project)
                             (:licenses project))]
       (.addLicense model (make-license license)))


Fix docstring

Fix docstring

--- src/metabase/driver/generic_sql.clj
+++ src/metabase/driver/generic_sql.clj
@@ -173,7 +173,7 @@
       Return a korma form appropriate for converting a Unix timestamp integer field or value to an proper SQL `Timestamp`.
       SECONDS-OR-MILLISECONDS refers to the resolution of the int in question and with be either `:seconds` or `:milliseconds`.

-   *  `(timezone->set-timezone-sql [timezone])`
+   *  `(timezone->set-timezone-sql [timezone])` *(OPTIONAL)*

       Return a string that represents the SQL statement that should be used to set the timezone
       for the current transaction.


Little styling here and there

Little styling here and there

--- src/greenyet/view.clj
+++ src/greenyet/view.clj
@@ -30,9 +30,15 @@
          [:meta {:http-equiv "refresh" :content "5"}]
          [:style (str/join "\n" [".host.green { background-color: green; }"
                                  ".host.yellow { background-color: yellow; }"
-                                 ".host { background-color: red; }"
-                                 ".host:empty { background: gray; }"])]]
+                                 ".host { background-color: red; height: 50px; }"
+                                 ".host:empty { background: lightgray; }"
+                                 "body { font-family: sans-serif; }"
+                                 "table { border-collapse: separate; border-spacing: 0; width: 100%; }"
+                                 "td { text-align: center; padding: 5px; border: solid white 0; border-width: 2px 4px 2px 0; }"
+                                 "td:first-child { text-align: left; padding: 5px 5px 5px 0; width: 200px; }"
+                                 ".project-link { font-size: 0.8rem; text-decoration: none; color: gray; letter-spacing: 0.2rem; }"])]]
         [:body
+         [:a.project-link {:href "https://github.com/cburgmer/greenyet"} "Green yet?"]
          [:table
           [:thead
            [:tr


Augment name munging to encode "." as "%2E"

"." and ".." don't do so well in filesystems or in URLs since browsers
and other tools tend to take a directory view of things. As a result,
the "." character needs to be treated somewhat specially. "%2E" will
url-decode appropriately to "." when it needs to so we'll go with that.

--- src/grimoire/util.clj
+++ src/grimoire/util.clj
@@ -10,7 +10,10 @@
   the characters #\"[.?/]\" and nothing more. Should only be applied to
   symbols. Namespaces, packages, groups and soforth need not be name munged."
   [s]
-  (url-encode s))
+  (-> s
+      (url-encode)
+      (str/replace #"\." "%2E") ;; most applications don't eat the . character happily
+      ))

 (defn update-munge
   "This function attempts to transform the legacy (Grimoire 0.2.X, 0.1.X)


Directly write a number to a Long

Directly write a number to a Long

Instead of using Long's fromNumber get the bits directly

--- src/longshi/fressian/js.cljs
+++ src/longshi/fressian/js.cljs
@@ -152,7 +152,12 @@
               (bsp/write-bytes! bos b offset length)))))
       bos))
   (write-int! [bos i]
-    (p/write-long! bos (Long.fromNumber i)))
+    (p/write-long!
+     bos
+     (let [high (bit-or (/ i (.-TWO_PWR_32_DBL_ Long)) 0)
+        high (if (neg? i) (dec high) high)
+        low (bit-or (js-mod i (.-TWO_PWR_32_DBL_ Long)) 0)]
+      (Long. low high))))
   (write-long! [bos l]
     (do
       (let [lb (.getLowBits l)


RR: add current index to rank if index exists

--- src/hatti/shared.cljs
+++ src/hatti/shared.cljs
@@ -63,12 +63,15 @@
 (defn update-app-data!
   "Given `data` received from the server, update the app-state.
    Sorts by submission time, and adds rank to the data, for table + map views."
-  [app-state data & {:keys [rerank? completed? sort-field]}]
+  [app-state data & {:keys [rerank? completed? sort-field current-start-index]
+                     :or {current-start-index 0}}]
   (let [data (if (and rerank? (seq data))
                (->> data
                     (sort-by #(get % (or sort-field _submission_time)))
-                    (map-indexed (fn [i v] (assoc v _rank (inc i))))
-                    vec)
+                    (map-indexed (fn [i v]
+                                   (assoc v _rank
+                                            (+ current-start-index
+                                               (inc i))))) vec)
                data)
         total-records (count data)]
     (transact-app-data! app-state (fn [_] data))


test post-receive hook

test post-receive hook

--- src/main/cawala/api/read.clj
+++ src/main/cawala/api/read.clj
@@ -6,7 +6,7 @@
                      :person/relation :friend}
                  2  {:db/id 2 :person/name "Sally" :person/age 22
                      :person/relation :friend}
-                 3  {:db/id 3 :person/name "Allie" :person/age 74
+                 3  {:db/id 3 :person/name "Allie" :person/age 73
                      :person/relation :enemy}
                  4  {:db/id 4 :person/name "Zoe" :person/age 32
                      :person/relation :friend}


added debug switch for painting test-area

--- src/mastersign/wordcloud.clj
+++ src/mastersign/wordcloud.clj
@@ -26,6 +26,7 @@
    :max-test-radius 350
    :order-priority 0.7
    :padding 4
+   :debug false
    :shape-mode :glyph-box ; :word-box, :glyph-box
    :allow-rotation true
    :final-refine true
@@ -243,11 +244,12 @@
         bg (translate-area test-area c)]
     (doto g
       setup
-      (fill-rect (rectangle 0 0 w h) :color (:background-color args))
-      ;(draw-rect (rectangle 0 0 (dec w) (dec h)))
-      ;(fill-shape bg)
-      ;(draw-shape bg)
-      )
+      (fill-rect (rectangle 0 0 w h) :color (:background-color args)))
+    (when (:debug args)
+      (doto g
+        (draw-rect (rectangle 0 0 (dec w) (dec h)))
+        (fill-shape bg)
+        (draw-shape bg)))
     (doseq [{:keys [text font color position rotation]} (filter #(not (nil? %)) word-infos)]
       (draw-string-centered g text (translate-point c position) :font font :color color :rotation rotation))))


Button doesn't reload repos, it reloads orgs

Also, we use Title Case for buttons.

--- src-cljs/frontend/components/add_projects.cljs
+++ src-cljs/frontend/components/add_projects.cljs
@@ -53,10 +53,9 @@
     om/IRender
     (render [_]
       (html
-       [:div.refresh-repos
-       [:button.btn.btn-primary.set-user
+       [:button.btn.btn-primary
         {:on-click #(raise! owner [:refreshed-user-orgs {}])} ;; TODO: spinner while working?
-        "Reload repositories"]]))))
+        "Reload Organizations"]))))

 (defn repo-item [data owner]
   (reify


path -> _

path -> _

--- src/whisper2cyanite/core.clj
+++ src/whisper2cyanite/core.clj
@@ -222,7 +222,7 @@
         (prog/set-progress-bar! "[:bar] :done")
         (prog/config-progress-bar! :width pbar-width)
         (prog/init 0)
-        (doseq [path paths]
+        (doseq [_ paths]
           (prog/tick))
         (prog/done)))
     (wlog/info (format "Found %s paths" (count paths)))


Added bits to the board view implementation.

- think I will need to borrow a bit more from the Erlang version for a
  functional version

--- Clojure/src/snake/board_view.clj
+++ Clojure/src/snake/board_view.clj
@@ -24,35 +24,31 @@
   (put "/"))

-;public void add(Apple apple) {
-;	term.setCursor(apple.getX() + 1, apple.getY() + 1);
-;	term.put("o");
-;}
-;
-;public void add(SnakeElement elem) {
-;	term.setCursor(elem.getX() + 1, elem.getY() + 1);
-;	term.put("#");
-;}
-;
-;public void remove(GameElement elem) {
-;	term.setCursor(elem.getX() + 1, elem.getY() + 1);
-;	term.put(" ");
-;}
-;
-;public void setBoardData(Object[][] board) {
-;	this.board = board;
-;}
-;
-;public void showContent() {
-;	for (Object[] row : board) {
-;		for (Object elem : row) {
-;			if (elem instanceof Apple) {
-;				add((Apple)elem);
-;			}
-;			else if (elem instanceof SnakeElement) {
-;				add((SnakeElement)elem);
-;			}
-;		}
-;	}
-;}
-;+(defn add-apple
+  [{x :x y :y}]
+
+  (set-cursor (+ x 1) (+ y 1))
+  (put "o"))
+
+(defn add-snake
+  [{x :x y :y}]
+
+  (set-cursor (+ x 1) (+ y 1))
+  (put "#"))
+
+(defn remove
+  [{x :x y :y}]
+
+  (set-cursor (+ x 1) (+ y 1))
+  (put " "))
+
+(defn show-board
+  [{width  :width
+    height :height
+    board  :board}]
+
+  (doseq [[row] board]
+    (doseq [[elem] row]
+      (add elem))))
+
+; REM: add the add function which will call add-apple or add-snake


Missed a line

Missed a line

--- src/wishlistd/cljs/main.cljs
+++ src/wishlistd/cljs/main.cljs
@@ -2,7 +2,6 @@
   (:require [crate.core :as crate]
             [fetch.remotes :as remotes])
   (:use [jayq.core :only [$ append empty delegate data]])
-  (:use-macros [crate.macros :only [defpartial]]))
   (:use-macros [crate.macros :only [defpartial]]
                [fetch.macros :only [letrem]]))


fix bug with group aware consensus

fix bug with group aware consensus

--- src/polismath/math/conversation.clj
+++ src/polismath/math/conversation.clj
@@ -567,7 +567,7 @@
                  (group-votes subgroup-clusters' base-clusters votes-base)))))

-      ; {gid {tid consensus}}
+      ; {tid consensus}
       :group-aware-consensus
            (plmb/fnk [group-votes]
              (let [tid-gid-probs
@@ -575,8 +575,8 @@
                      (fn [result [gid gid-stats]]
                        (reduce
                          (fn [result [tid {:keys [A S] :or {A 0 S 0}}]]
-                           (let [consensus (/ A (+ S 1.0))]
-                             (assoc-in result [tid gid] consensus)))
+                           (let [prob (/ A (+ S 1.0))]
+                             (assoc-in result [tid gid] prob)))
                          result
                          (:votes gid-stats)))
                        ;; +1 acts as a dumb prior
@@ -589,7 +589,7 @@
                             (map second)
                             (reduce *)))
                      tid-gid-probs)]
-               tid-gid-probs))
+               tid-consensus))

       :repness


Some little changes

Some little changes

--- src/fp_contest_solution_tree/core.clj
+++ src/fp_contest_solution_tree/core.clj
@@ -1,7 +1,7 @@
 (ns fp-contest-solution-tree.core
   (:gen-class)
   (:import [jline.console ConsoleReader])
-  (:require [mc.util :refer :all]
+  (:require [mc.util :refer [reduce-indexed]]
             [clojure.pprint :refer [pprint print-table]]))

 (def undefined "—")
@@ -68,7 +68,7 @@
     (println "What is the value of feature:" feature "?")
     (let [indexed-answers (print-answers answers)]
       (println "0. Nothing of the kind" )
-      (print "Answer (number of the option):")
+      (print "Answer (Enter number of the option): ")
       (flush)
       (let [cr (ConsoleReader.)
             user-choise (.readLine cr)]


feminine nouns and adjectives ending in 'e' pluralize with suffix 'i' (like masculine nouns)

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -231,10 +231,18 @@
      (and
       (= (get-in word '(:agr :gender)) :fem)
       (= (get-in word '(:agr :number)) :plur)
-      (= (get-in word '(:cat)) :adjective))
+      (= (get-in word '(:cat)) :adjective)
+      (re-find #"o$" (get-in word [:italiano])))
      (string/replace (get-in word '(:italiano))
-                     #"[eo]$" "e") ;; nero => nere
-
+                     #"[o]$" "e") ;; nero => nere
+     (and
+      (= (get-in word '(:agr :gender)) :fem)
+      (= (get-in word '(:agr :number)) :plur)
+      (= (get-in word '(:cat)) :adjective)
+      (re-find #"e$" (get-in word [:italiano])))
+     (string/replace (get-in word '(:italiano))
+                     #"[e]$" "i") ;; difficile => difficili
+
      ;; handle lexical exceptions (plural nouns):
      (and
       (= (get-in word '(:agr :number)) :plur)
@@ -253,7 +261,18 @@
      (string/replace (get-in word '(:italiano))
                      #"[eo]$" "i") ;; dottore => dottori; medico => medici

-     ;; regular feminine nouns
+     ;; regular feminine nouns ending in 'e':
+     (and
+      (string? (get-in word [:italiano]))
+      (= (get-in word '(:agr :gender)) :fem)
+      (= (get-in word '(:agr :number)) :plur)
+      (= (get-in word '(:cat)) :noun)
+      (get-in word '(:italiano))
+      (re-find #"e$" (get-in word [:italiano])))
+     (string/replace (get-in word '(:italiano))
+                     #"[e]$" "i") ;; madre => madri
+
+     ;; regular feminine nouns not ending in 'e'
      (and
       (string? (get-in word [:italiano]))
       (= (get-in word '(:agr :gender)) :fem)


cleanup dead code

cleanup dead code

--- src/babel/italiano/morphology.cljc
+++ src/babel/italiano/morphology.cljc
@@ -1777,45 +1777,3 @@
   (let [gender (atom :top)]
     {:synsem {:sem {:gender gender}
               :agr {:gender gender}}}))
-
-;; TODO: remove this; dead code
-(defn agreement [lexical-entry]
-  (cond
-   (= (get-in lexical-entry [:synsem :cat]) :verb)
-   (let [agr (atom :top)
-         cat (atom :top)
-         infl (atom :top)]
-     (unify lexical-entry
-             {:italiano {:agr agr
-                         :cat cat
-                         :infl infl}
-              :synsem {:agr agr
-                       :cat cat
-                       :infl infl}}))
-
-   (and (= (get-in lexical-entry [:synsem :cat]) :noun)
-        (= (get-in lexical-entry [:synsem :pronoun]) true))
-   (unify lexical-entry
-           pronoun-semantic-gender-agreement)
-
-   (and (= (get-in lexical-entry [:synsem :cat]) :noun)
-        (= (get-in lexical-entry [:synsem :subcat :1]) :top))
-   ;; nouns which select articles that match in gender and number.
-   (unify lexical-entry
-           (let [number (atom :top)
-                 gender (atom :top)
-                 person (atom :top)
-                 agr (atom {:number number
-                           :gender gender
-                           :person person})
-                 cat (atom :top)]
-             {:synsem {:cat cat
-                       :case :top
-                       :subcat {:1 {:number number
-                                    :person person
-                                    :gender gender}}
-                       :agr agr}}))
-   true
-   lexical-entry))
-
-


fixed reloading of other on registry change

--- src/cljs/swarmpit/component/service/create_image_other.cljs
+++ src/cljs/swarmpit/component/service/create_image_other.cljs
@@ -39,7 +39,8 @@
       {:value    registry
        :onChange (fn [_ _ v]
                    (state/update-value [:data] [] cursor)
-                   (state/update-value [:registry] v cursor))}
+                   (state/update-value [:registry] v cursor)
+                   (repository-handler registry))}
       (->> registries
            (map #(comp/menu-item
                    {:key         %


Fixed issue where round should have already started.

--- src/cljs/wombats_web_client/components/countdown_timer.cljs
+++ src/cljs/wombats_web_client/components/countdown_timer.cljs
@@ -1,21 +1,31 @@
 (ns wombats-web-client.components.countdown-timer
   (:require [cljs-time.core :as t]
-            [cljs-time.format :as f]
             [reagent.core :as reagent]))

 (defn- seconds-until
   [time]
-  (t/in-seconds (t/interval (t/now) time)))
+  (if (t/after? (t/now) time)
+    0
+    (t/in-seconds (t/interval (t/now) time))))
+
+(defn- millis-until
+  [time]
+  (if (t/after? (t/now) time)
+    0
+    (mod (t/in-millis (t/interval (t/now) time))
+         1000)))

 (defn- format-time
   [time]
-  (let [total-seconds (seconds-until time)
-        seconds (mod total-seconds 60)
-        minutes (/ (- total-seconds seconds) 60)
-        seconds-formatted (if (< seconds 10) (str "0" seconds) seconds)]
-    (if (< seconds 0)
+  (let [seconds-left (seconds-until time)]
+    (if (< seconds-left 0)
       "0:00"
-      (str minutes ":" seconds-formatted))))
+      (let [seconds (mod seconds-left 60)
+            seconds-formatted (if (< seconds 10)
+                                (str "0" seconds)
+                                seconds)
+            minutes (/ (- seconds-left seconds) 60)]
+        (str minutes ":" seconds-formatted)))))

 (defn countdown-timer
   [start-time]
@@ -24,13 +34,15 @@
     (reagent/create-class
      {:component-will-mount
       (fn []
-        ;; Force timer to redraw every second
+        ;; Force timer to redraw every second, start interval when the countdown timer should switch
         (swap! cmpnt-state
                assoc
                :interval-fn
                (.setInterval js/window
                              #(reagent/force-update-all)
-                             1000)))
+                             1000))
+
+        #_(millis-until start-time))

       :component-will-unmount
       (fn []


Make =to work on old old old versions of clojure

--- src/flatland/useful/fn.clj
+++ src/flatland/useful/fn.clj
@@ -177,18 +177,22 @@

 (def ap "A shorthand version of applied" applied)

-(defn =to
-  "Produces an equality predicate from a single object. ((=to x) y) is
+(let [impl (delay (try (eval `(fn [x#]
+                                (if (keyword? x) ;; a case myssteriously not covered in equivPred
+                                  (fn [y#]
+                                    (identical? x# y#))
+                                  (let [p# (clojure.lang.Util/equivPred x#)]
+                                    (fn [y#]
+                                      (.equiv p# x# y#))))))
+                       (catch Exception e ;; running some version prior to equivPred
+                         (fn [x] (fn [y] (= x y))))))]
+  (defn =to
+    "Produces an equality predicate from a single object. ((=to x) y) is
 the same as (= x y), but if the returned function will be called many
 times it may be more efficient than repeated calls to =, because =to
 can short-circuit many irrelevant code paths based on knowing the type
 of x.

 Just a wrapper for clojure.lang.Util/equivPred."
-  [x]
-  (if (keyword? x) ;; a case myssteriously not covered in equivPred
-    (fn [y]
-      (identical? x y))
-    (let [p (clojure.lang.Util/equivPred x)]
-      (fn [y]
-        (.equiv p x y)))))
+    [x]
+    (@impl x)))


[scamp] Add 'maybe-conj to protect against self-pointers

--- modules/scamp/src/scamp/core.clj
+++ modules/scamp/src/scamp/core.clj
@@ -197,6 +197,17 @@
    msg-type
    msg-body
    (*get-envelope-id*)])
+
+(s/defn maybe-conj
+  "'conj 'new-node-contact-address into 'coll as long as
+  'this-node-contact-address and 'new-node-contact-address are
+  different."
+  [coll :- #{NodeContactAddressSchema}
+   this-node-contact-address :- NodeContactAddressSchema
+   new-node-contact-address :- NodeContactAddressSchema]
+  (if (= this-node-contact-address new-node-contact-address)
+    coll
+    (conj coll new-node-contact-address)))

 (s/defn receive-msg-new-subscription :- CommUpdateSchema
   "Forward the 'subscription to every :downstream node, duplicating
@@ -211,27 +222,30 @@
                :node node
                :subscription subscription
                :connection-redundancy connection-redundancy)
-  (let [node (update node :upstream conj subscription)
-        new-messages (if (empty? downstream)
-                       ;; There is no 'downstream. No messages are needed, because the
-                       ;; 'subscription node will already have 'node in its
-                       ;; :downstream.
-                       []
-
-                       ;; Forward subscription to :downstream.
-                       (let [downstream (seq downstream)
-                             downstream+ (reduce (fn [x _] (conj x (rand-nth* downstream)))
-                                                 downstream
-                                                 (range connection-redundancy))]
-                         (mapv
-                          (fn [node-id]
-                            [:message-envelope
-                             node-id
-                             :forwarded-subscription
-                             subscription
-                             (*get-envelope-id*)])
-                          downstream+)))]
-    [node new-messages]))
+
+  (let [self-id (get-in node [:self :id])]
+    (when (= self-id subscription)
+      (throw (ex-info (str "Got own new subscription: " subscription) {:node node})))
+
+    (let [node (update node :upstream maybe-conj self-id subscription)
+          new-messages (if (empty? downstream)
+                         ;; There is no 'downstream. No messages are needed, because the
+                         ;; 'subscription node will already have 'node in its
+                         ;; :downstream.
+                         []
+
+                         ;; Forward subscription to :downstream.
+                         (let [downstream (seq downstream)
+                               downstream+ (reduce (fn [x _] (conj x (rand-nth* downstream)))
+                                                   downstream
+                                                   (range connection-redundancy))]
+                           (mapv
+                            (fn [node-id]
+                              (msg->envelope node-id
+                                             :forwarded-subscription
+                                             subscription))
+                            downstream+)))]
+      [node new-messages])))

 (s/defn do-probability :- s/Bool
   "'rand is inclusive of 0 and exclusive of 1, so our test should not have '=."
@@ -269,7 +283,7 @@
                :receive-msg-new-upstream-node
                :node node
                :upstream-node-contact-address upstream-node-contact-address)
-  [(update node :upstream conj upstream-node-contact-address)
+  [(update node :upstream maybe-conj (get-in node [:self :id]) upstream-node-contact-address)
    []])

 (s/defn send-msg-new-upstream-node :- MessageEnvelopeSchema
@@ -300,22 +314,23 @@
                :receive-msg-forwarded-subscription
                :node node
                :subscriber-contact-address subscriber-contact-address)
-  (if (and (not= (get-in node [:self :id]) subscriber-contact-address)
-           (not (downstream subscriber-contact-address))
-           ;; The subscription id is not for this node itself, and
-           ;; the subscription id is not already in node's downstream,
-           ;; so check the probability that we add it to this node.
-           (do-probability (subscription-acceptance-probability downstream)))
-    [(update-in node [:downstream] conj subscriber-contact-address)
-     [(send-msg-new-upstream-node subscriber-contact-address node)]]
-
-    (let [forwarded-subscription-messages (forward-subscription downstream
-                                                                subscriber-contact-address
-                                                                envelope-id)]
-      (when (empty? forwarded-subscription-messages)
-        (throw (ex-info "Failed either to accept or forward subscription"
-                        {:node node :subscriber-contact-address subscriber-contact-address})))
-      [node forwarded-subscription-messages])))
+  (let [self-id (get-in node [:self :id])]
+    (if (and (not= self-id subscriber-contact-address)
+             (not (downstream subscriber-contact-address))
+             ;; The subscription id is not for this node itself, and
+             ;; the subscription id is not already in node's downstream,
+             ;; so check the probability that we add it to this node.
+             (do-probability (subscription-acceptance-probability downstream)))
+      [(update-in node [:downstream] maybe-conj self-id subscriber-contact-address)
+       [(send-msg-new-upstream-node subscriber-contact-address node)]]
+
+      (let [forwarded-subscription-messages (forward-subscription downstream
+                                                                  subscriber-contact-address
+                                                                  envelope-id)]
+        (when (empty? forwarded-subscription-messages)
+          (throw (ex-info "Failed either to accept or forward subscription"
+                          {:node node :subscriber-contact-address subscriber-contact-address})))
+        [node forwarded-subscription-messages]))))

 (def new-world
   "Return a new, pristine world."


fix typo

fix typo

--- src/babel/italiano/morphology/determiners.cljc
+++ src/babel/italiano/morphology/determiners.cljc
@@ -7,7 +7,7 @@
    #?(:cljs [babel.logjs :as log])
    [dag_unify.core :refer (copy dissoc-paths fail? get-in ref? strip-refs unifyc)]))

-;; TODO: add :g as with babel.italiano.morphlogy.verbs/patterns.
+;; TODO: add :g as with babel.italiano.morphology.verbs/patterns.
 (def patterns
   [


(maint) Linting (remove trailing spaces, aligning forms)

--- src/clj/puppetlabs/puppetserver/certificate_authority.clj
+++ src/clj/puppetlabs/puppetserver/certificate_authority.clj
@@ -535,7 +535,7 @@
     (line-seq (io/reader infra-file)))

 (schema/defn generate-infra-serials
-  "Given a list of infra nodes it will create a file containing
+  "Given a list of infra nodes it will create a file containing
    serial numbers of their certificates (listed on separate lines).
    It is expected have at least one entry (MoM)"
    [{:keys [infra-nodes-path infra-node-serials-path signeddir]} :- CaSettings]
@@ -549,13 +549,13 @@
                                  (utils/get-serial))]
                (.write wtr (str infra-serial))
                (.newLine wtr))
-            (catch java.io.FileNotFoundException ex
+            (catch java.io.FileNotFoundException ex
                (log/warn
                  (i18n/trs
                    (str
                      "Failed to find/load certificate for Puppet Infrastructure Node:"
                      infra-node)))))))
-       (catch java.io.FileNotFoundException ex
+       (catch java.io.FileNotFoundException ex
          (log/warn (i18n/trs (str infra-nodes-path " does not exist")))))))

 (schema/defn generate-ssl-files!
@@ -618,7 +618,7 @@
    provided then defaults will be used."
   [host-name :- schema/Str
    alt-names :- schema/Str]
-  (let [split-alt-names (split-hostnames alt-names)
+  (let [split-alt-names   (split-hostnames alt-names)
         default-alt-names ["puppet"]
         alt-names-list (reduce (fn [acc alt-name]
                                  (if (str/starts-with? alt-name "IP:")
@@ -640,22 +640,22 @@
   (when-not (= hostname subject)
     (sling/throw+
       {:kind :hostname-mismatch
-       :msg (i18n/tru "Instance name \"{0}\" does not match requested key \"{1}\"" subject hostname)}))
+       :msg  (i18n/tru "Instance name \"{0}\" does not match requested key \"{1}\"" subject hostname)}))

   (when (contains-uppercase? hostname)
     (sling/throw+
       {:kind :invalid-subject-name
-       :msg (i18n/tru "Certificate names must be lower case.")}))
+       :msg  (i18n/tru "Certificate names must be lower case.")}))

   (when-not (re-matches #"\A[ -.0-~]+\Z" subject)
     (sling/throw+
       {:kind :invalid-subject-name
-       :msg (i18n/tru "Subject contains unprintable or non-ASCII characters")}))
+       :msg  (i18n/tru "Subject contains unprintable or non-ASCII characters")}))

   (when (.contains subject "*")
     (sling/throw+
       {:kind :invalid-subject-name
-       :msg (i18n/tru "Subject contains a wildcard, which is not allowed: {0}" subject)})))
+       :msg  (i18n/tru "Subject contains a wildcard, which is not allowed: {0}" subject)})))

 (schema/defn allowed-extension?
   "A predicate that answers if an extension is allowed or not.
@@ -1383,7 +1383,7 @@

     ;; Publish infra-crl if an infra node is getting revoked.
     (when (and enable-infra-crl
-               (fs/exists? infra-node-serials-path)
+               (fs/exists? infra-node-serials-path)
                (seq-contains? (read-infra-nodes infra-node-serials-path) (str serial)))
        (let [[our-infra-crl & rest-of-infra-chain] (utils/pem->crls infra-crl-path)
              new-infra-crl (utils/revoke our-infra-crl


(SERVER-2478) Do not require `infra_serials` file on startup

This commit updates the list of required CA files to no longer include
the infra_serials file. This file is always updated (or created) when
puppetserver starts and the infra CRL feature is enabled, so it is
unnecessary to require it to be present beforehand. This requirement was
unnecessarily causing issues with upgrade workflows.

--- src/clj/puppetlabs/puppetserver/certificate_authority.clj
+++ src/clj/puppetlabs/puppetserver/certificate_authority.clj
@@ -224,7 +224,7 @@
   "The set of SSL related files that are required on the CA."
   [enable-infra-crl]
   (union #{:cacert :cacrl :cakey :cert-inventory :serial}
-     (if enable-infra-crl #{:infra-node-serials-path :infra-nodes-path :infra-crl-path} #{})))
+     (if enable-infra-crl #{:infra-nodes-path :infra-crl-path} #{})))

 (def max-ca-ttl
   "The longest valid duration for CA certs, in seconds. 50 standard years."


A better way to fix the empty signal problem

--- src/clj/algorithms_clj/huffman.clj
+++ src/clj/algorithms_clj/huffman.clj
@@ -86,10 +86,7 @@

 (defn- next-node
   [node input]
-  (cond
-    (is-leaf? node) node ;; TODO - Case of the tree with only one leaf - should be discarded before
-    (zero? input) (lhs-node node)
-    :else (rhs-node node)))
+  (if (zero? input) (lhs-node node) (rhs-node node)))

 (defn- huffman-xf
   "Transducer step function to decode a huffman stream of values"
@@ -114,7 +111,11 @@
 (defn decode
   "Decode a stream of inputs, provided the huffman tree as first parameter"
   [huffman-tree inputs]
-  (into [] (huffman-xf huffman-tree) inputs))
+  (into []
+    (if (is-leaf? huffman-tree)
+      (repeat (count inputs) (leaf-val huffman-tree))
+      (eduction (huffman-xf huffman-tree) inputs))
+    ))

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


update the bfs vettices map atom once for each message

--- src/clj/morpheus/traversal/bfs.clj
+++ src/clj/morpheus/traversal/bfs.clj
@@ -56,24 +56,26 @@
   (let [[superstep-id vertices-stack] data
         deepth (get-in @tasks-vertices [task-id :current-level])]
     (a/go
-      (cp/pdoseq
-        compute/compution-threadpool
-        [[vertex-res edges-res] vertices-stack]
-        (let [vertex-id (:*id* vertex-res)]
-          (swap! tasks-vertices update-in [task-id vertex-id]
-                 #(merge % vertex-res
-                         {:*visited* true
-                          :*edges* edges-res}))
-          (cp/pdoseq
-            compute/compution-threadpool
-            [edge edges-res]
-            (let [opp-id (:*opp* edge)]
-              (swap! tasks-vertices update-in [task-id opp-id]
-                     #(if % (if-not (:*visited* %)
-                              (update % :*parents* conj vertex-id) %)
-                            {:*visited* false
-                             :*level* deepth
-                             :*parents* [vertex-id]}))))))
+      (swap! tasks-vertices update task-id
+             (fn [vertices-map_]
+               (let [vertices-map (atom (transient vertices-map_))]
+                 (doseq [[vertex-res edges-res] vertices-stack]
+                   (let [vertex-id (:*id* vertex-res)]
+                     (swap! vertices-map assoc! vertex-id
+                            (merge (get @vertices-map vertex-id)
+                                   vertex-res
+                                   {:*visited* true
+                                    :*edges* edges-res}))
+                     (doseq [edge edges-res]
+                       (let [opp-id (:*opp* edge)]
+                         (swap! vertices-map assoc! opp-id
+                                (let [oppv (get @vertices-map opp-id)]
+                                  (if oppv (if-not (:*visited* oppv)
+                                             (update oppv :*parents* conj vertex-id) oppv)
+                                           {:*visited* false
+                                            :*level* deepth
+                                            :*parents* [vertex-id]})))))))
+                 (persistent! @vertices-map))))
       (a/>! (get @superstep-tasks superstep-id) true))))

 (defn proc-stack [task-id stack]


Put completion in a separate nrepl session

closes #24

--- src/clj/reply/eval_modes/nrepl.clj
+++ src/clj/reply/eval_modes/nrepl.clj
@@ -21,7 +21,8 @@

 (defn execute-with-client [client options form]
   (let [command-id (nrepl.misc/uuid)
-        response-seq (nrepl/message client {:op "eval" :code form :id command-id :session @current-session})]
+        session (or (:session options) @current-session)
+        response-seq (nrepl/message client {:op "eval" :code form :id command-id :session session})]
     (reset! current-command-id command-id)
     (doall (for [{:keys [ns value out err] :as res}
                    (take-while #(not (some #{"done" "interrupted" "error"} (:status %)))
@@ -32,7 +33,7 @@
           (let [input-result (.readLine *in*)]
             (nrepl/message client
               {:op "stdin" :stdin (str input-result "\n")
-               :id (nrepl.misc/uuid) :session @current-session})))
+               :id (nrepl.misc/uuid) :session session})))
         (when value ((:value options print) value))
         (when out ((:out options print) out))
         (when err ((:err options print) err))
@@ -76,13 +77,14 @@
                  (:host options "localhost"))]
     (nrepl/connect :host host :port port)))

-(defn adhoc-eval [client form]
+(defn adhoc-eval [client session form]
   (let [results (atom "nil")]
     (execute-with-client
       client
       {:value (partial reset! results)
        :out print
-       :err print}
+       :err print
+       :session session}
       (pr-str form))
     (read-string @results)))

@@ -91,12 +93,13 @@
   [options]
   (let [connection (get-connection options)
         client (nrepl/client connection 10000)
-        session (nrepl/new-session client)]
+        session (nrepl/new-session client)
+        completion-session (nrepl/new-session client) ]
     (reset! current-session session)
     (let [options (assoc options :prompt
                     (fn [ns]
                       (reader.jline/prepare-for-read
-                        (partial adhoc-eval client)
+                        (partial adhoc-eval client completion-session)
                         ns)))
           options (if (:color options)
                     (merge options nrepl.cmdline/colored-output)


Added ns doc string for blink

Added ns doc string for blink

--- src/clj_bots/hello_world/blink.clj
+++ src/clj_bots/hello_world/blink.clj
@@ -1,4 +1,5 @@
 (ns clj-bots.hello-world.blink
+  "# The hello world of hardware programming: a blinking LED"
   (:require [clj-bots.pin-ctrl :as pc]
             [clj-bots.pin-ctrl-bbb :as bbb]))


Use new geschichte value-based hash.

Use new geschichte value-based hash.

--- src/cljs/link_collective/core.cljs
+++ src/cljs/link_collective/core.cljs
@@ -128,13 +128,11 @@
 (read/register-tag-parser! 'datascript.DB datascript/map->DB)
 (read/register-tag-parser! 'datascript.Datom datascript/map->Datom)

-
 (go
   (def store
     (<! (new-mem-store
          ;; empty db
-         (atom (read-string
-                "{#uuid \"11a1c86b-935c-5a80-9c48-e0095321f738\" #datascript.DB{:schema {:up-votes {:db/cardinality :db.cardinality/many}, :down-votes {:db/cardinality :db.cardinality/many}, :posts {:db/cardinality :db.cardinality/many}, :comments {:db/cardinality :db.cardinality/many}, :hashtags {:db/cardinality :db.cardinality/many}}, :ea {}, :av {}, :max-eid 0, :max-tx 536870912}, #uuid \"123ed64b-1e25-59fc-8c5b-038636ae6c3d\" (fn replace [old params] params), #uuid \"2425a9dc-7ce8-56a6-9f52-f7c431afcd91\" {:transactions [[#uuid \"11a1c86b-935c-5a80-9c48-e0095321f738\" #uuid \"123ed64b-1e25-59fc-8c5b-038636ae6c3d\"]], :parents [], :ts #inst \"2014-05-30T21:20:05.808-00:00\", :author \"eve@polyc0l0r.net\"}, \"eve@polyc0l0r.net\" {#uuid \"b09d8708-352b-4a71-a845-5f838af04116\" {:branches {\"master\" #{#uuid \"2425a9dc-7ce8-56a6-9f52-f7c431afcd91\"}}, :id #uuid \"b09d8708-352b-4a71-a845-5f838af04116\", :description \"link-collective discourse.\", :head \"master\", :last-update #inst \"2014-05-30T21:20:05.808-00:00\", :schema {:type \"http://github.com/ghubber/geschichte\", :version 1}, :causal-order {#uuid \"2425a9dc-7ce8-56a6-9f52-f7c431afcd91\" []}, :public false, :pull-requests {}}}}"))
+         (atom (read-string "{#uuid \"2abe63d8-2629-5b05-ba42-65d5a33dc77d\" {:transactions [[#uuid \"11a1c86b-935c-5a80-9c48-e0095321f738\" #uuid \"123ed64b-1e25-59fc-8c5b-038636ae6c3d\"]], :parents [], :ts #inst \"2014-06-26T17:28:39.766-00:00\", :author \"eve@polyc0l0r.net\"}, #uuid \"123ed64b-1e25-59fc-8c5b-038636ae6c3d\" (fn replace [old params] params), \"eve@polyc0l0r.net\" {#uuid \"b09d8708-352b-4a71-a845-5f838af04116\" {:branches {\"master\" #{#uuid \"2abe63d8-2629-5b05-ba42-65d5a33dc77d\"}}, :id #uuid \"b09d8708-352b-4a71-a845-5f838af04116\", :description \"link-collective discourse.\", :head \"master\", :last-update #inst \"2014-06-26T17:28:39.766-00:00\", :schema {:type \"http://github.com/ghubber/geschichte\", :version 1}, :causal-order {#uuid \"2abe63d8-2629-5b05-ba42-65d5a33dc77d\" []}, :public false, :pull-requests {}}}, #uuid \"11a1c86b-935c-5a80-9c48-e0095321f738\" #datascript.DB{:schema {:up-votes {:db/cardinality :db.cardinality/many}, :down-votes {:db/cardinality :db.cardinality/many}, :posts {:db/cardinality :db.cardinality/many}, :comments {:db/cardinality :db.cardinality/many}, :hashtags {:db/cardinality :db.cardinality/many}}, :ea {}, :av {}, :max-eid 0, :max-tx 536870912}}"))
          (atom  {'datascript.DB datascript/map->DB
                  'datascript.Datom datascript/map->Datom}))))

@@ -169,11 +167,18 @@
          :add-comment (partial add-comment stage)})
       om/IRenderState
       (render-state [this {:keys [selected-entries add-comment add-post] :as state}]
-        (if (= (type (om/value (get-in app ["eve@polyc0l0r.net"
-                                            #uuid "b09d8708-352b-4a71-a845-5f838af04116"
-                                            "master"])))
-               geschichte.stage/Conflict)
-          (omdom/div nil (str "Conflict: " (om/value app)))
+        (let [val (om/value (get-in app ["eve@polyc0l0r.net"
+                                         #uuid "b09d8708-352b-4a71-a845-5f838af04116"
+                                         "master"]))])
+        (if (= (type val) geschichte.stage/Conflict)
+          (do
+            (s/merge! (om/value app)
+                      ["eve@polyc0l0r.net"
+                       #uuid "b09d8708-352b-4a71-a845-5f838af04116"
+                       "master"]
+                      (concat (map :id (:commits-a val))
+                              (map :id (:commits-b val))))
+            (omdom/div nil (str "Resolving conflicts... please wait. " val)))
           (om/build posts app {:init-state state})))))

@@ -201,11 +206,18 @@
   (om/root
    posts-view
    (get-in @stage [:volatile :val-atom])
-   {:target (. js/document (getElementById "main-container"))})
-
-
-  )
-
+   {:target (. js/document (getElementById "main-container"))}))
+
+;; top.iq
+;; 160 chars, links, hashtags
+;; free form comments (markdown), flat thread
+;; plugins to add data and structure to comments / social apps
+;; individual up to collective help to summarize for new topic
+;; organized in a discourse/conversation (branch?)
+;; e.g. private conversation "discourse" for each friend as "messaging"
+
+;; no ts in commits
+;; eventual consistent partial updates

 (comment
   (def eve-data (get-in @stage [:volatile :val-atom]))


Improve hashtag pattern.

Improve hashtag pattern.

--- src/cljs/link_collective/core.cljs
+++ src/cljs/link_collective/core.cljs
@@ -52,6 +52,8 @@

 (def url-regexp #"(https?|ftp)://[a-z0-9\u00a1-\uffff-]+(\.[a-z0-9\u00a1-\uffff-]+)+(:\d{2,5})?(/\S+)?")

+(def hashtag-regexp #"(^|\s|\.|;|,|!|-)(#[\w\d\u00a1-\uffff_-]+)")
+

 (defn add-post
   "Transacts a new topiq to the stage"
@@ -59,7 +61,7 @@
   (let [post-id (uuid)
         ts (js/Date.)
         text (dom/value (dom/by-id "general-input-form"))
-        hash-tags (re-seq #"#[\w\d-_]+" text)
+        hash-tags (map #(nth % 2) (re-seq hashtag-regexp text))
         urls (->> text
                   (re-seq url-regexp)
                   (map first))]


Fix broken Google Plus share button

Fix broken Google Plus share button

--- src/cljs/salava/core/ui/share.cljs
+++ src/cljs/salava/core/ui/share.cljs
@@ -1,6 +1,12 @@
 (ns salava.core.ui.share
   (:require [reagent.core :refer [create-class]]
             [salava.core.i18n :refer [t]]))
+
+(defn google-plus [url]
+  (create-class
+    {:reagent-render (fn [url]
+                       [:div.g-plus {:data-action "share" :data-href url :data-annotation "none" :data-height "20px"}])
+     :should-component-update (fn [] false)}))

 (defn share-buttons-element [url title public? is-badge? link-or-embed-atom]
   [:div {:id "share"}
@@ -18,7 +24,7 @@
     [:div.share-button
      [:script {:type "IN/Share" :data-url url}]]
     [:div.share-button
-     [:div.g-plus {:data-action "share" :data-href url :data-annotation "none" :data-height "20px"}]]
+     [google-plus url]]
     [:div.share-button
      [:a {:href (str "https://www.facebook.com/sharer/sharer.php?u=" url) :target "_blank"} [:img.fb-share {:src "/img/fb_share.png"}]]]
     [:div.share-button


Fixed latest scheduling mismatch

Fixed latest scheduling mismatch

The main difference was a > test that should have been >=

--- src/clojure/frereth_cp/message.clj
+++ src/clojure/frereth_cp/message.clj
@@ -511,8 +511,8 @@
              (< 0 un-sent-count))) (min min-resend-time)
       ;; Lines 293-296
       (and (not= 0 un-ackd-count)
-           (>= rtt-resend-time
-               min-resend-time)) (min rtt-resend-time)
+           (> rtt-resend-time
+              min-resend-time)) (min rtt-resend-time)
       ;; There's one last caveat, from 298-300:
       ;; It all swirls around watchtochild, which gets set up
       ;; between lines 276-279.
@@ -530,6 +530,13 @@
       ;; Still might be worth tracking for the sake of security.
       (and (not= 0 (+ (count gap-buffer)
                       (count ->child-buffer)))
+           ;; This looks backward. It isn't.
+           ;; If there are bytes to forward to the
+           ;; child, and the pipe is still open, then
+           ;; try to send them.
+           ;; However, the logic *is* broken:
+           ;; The check for gap-buffer really needs
+           ;; to be based around closed gaps
            (not (realized? to-child-done?))) 0
       ;; Lines 302-305
       true (max recent))))
@@ -692,7 +699,7 @@
                                 (long next-based-on-earliest-block-time)))
         log-message (str log-message
                          (cl-format nil
-                                    "\nAfter [pretending to] adjusting for closed/ignored child watcher: ~:d"
+                                    "\nAfter adjusting for closed/ignored child watcher: ~:d"
                                     (long based-on-closed-child)))
         mid2-time (System/nanoTime)
         alt (condensed-choose-next-scheduled-time state to-child-done?)


Simplify button toggling

Simplify button toggling

--- src/clojure/nightcode/builders.clj
+++ src/clojure/nightcode/builders.clj
@@ -57,11 +57,6 @@
          (binding [*read-eval* false])))
   (s/request-focus! (-> console .getViewport .getView)))

-(defn toggle-reload!
-  [target enable?]
-  (-> (s/select target [:#reload-button])
-      (s/config! :enabled? enable?)))
-
 ; create and show/hide builders for each project

 (defn create-builder
@@ -79,13 +74,10 @@
                       :center (s/config! console :id :build-console))
         ; create the actions for each button
         run! (fn [_]
-               (lein/run-project! process in out path)
-               (toggle-reload! build-group (lein/is-java-project? path)))
+               (lein/run-project! process in out path))
         run-repl! (fn [_]
                     (lein/run-repl-project! process in out path)
                     (s/request-focus! (-> console .getViewport .getView))
-                    (toggle-reload! build-group
-                                    (not (lein/is-java-project? path)))
                     (reset! last-reload (System/currentTimeMillis)))
         reload! (fn [_]
                   (if (lein/is-java-project? path)
@@ -155,11 +147,14 @@
                                        :text (utils/get-string :auto_build)
                                        :listen [:action auto-build!]
                                        :focusable? false)])]
-    ; disable the reload button when the process ends
+    ; enable/disable buttons appropriately
     (add-watch process
-               :toggle-reload
+               :toggle-buttons
                (fn [_ _ _ new-state]
-                 (when-not new-state (toggle-reload! build-group false))))
+                 (-> (s/select build-group [:#reload-button])
+                     (s/config! :enabled? (not (nil? new-state))))
+                 (-> (s/select build-group [:#run-repl-button])
+                     (s/config! :enabled? (nil? new-state)))))
     ; add the buttons to the main panel and create shortcuts
     (doto build-group
       (s/config! :north btn-group)


selectbox experiments #tabsmustdie

selectbox experiments #tabsmustdie

--- src/cljs/swarmpit/component/stack/compose.cljs
+++ src/cljs/swarmpit/component/stack/compose.cljs
@@ -9,6 +9,7 @@
             [swarmpit.component.message :as message]
             [swarmpit.component.progress :as progress]
             [swarmpit.component.service.create-image :as images]
+            [swarmpit.component.stack.info :as info]
             [swarmpit.ajax :as ajax]
             [swarmpit.routes :as routes]
             [swarmpit.url :refer [dispatch!]]
@@ -95,6 +96,7 @@
   (state/set-value {:valid?      false
                     :last?       false
                     :previous?   false
+                    :menu?       false
                     :loading?    true
                     :processing? false} state/form-state-cursor))

@@ -144,13 +146,45 @@
           :disabled (not previous?)
           :value    2})))])

+(defn select-stackfile [stack-name stackfile opened?]
+  (comp/mui
+    (comp/icon-menu
+      {:iconButtonElement (comp/icon-button nil nil)
+       :open              opened?
+       :style             {:position   "relative"
+                           :marginTop  "13px"
+                           :marginRight "70px"}
+       :onRequestChange   (fn [state] (state/update-value [:menu?] state state/form-state-cursor))}
+      (comp/menu-item
+        {:key           "last"
+         :innerDivStyle info/action-menu-item-style
+         :leftIcon      (comp/svg nil icon/redeploy)
+         :disabled      false
+         :primaryText   "Last deployed"})
+      (comp/menu-item
+        {:key           "previous"
+         :innerDivStyle info/action-menu-item-style
+         :leftIcon      (comp/svg nil icon/rollback)
+         :disabled      true
+         :primaryText   "Previously deployed"}))))
+
 (rum/defc form-edit [{:keys [name spec]}
-                     {:keys [processing? valid? last? previous?]}]
+                     {:keys [processing? valid? last? previous? menu?]}]
   [:div
    [:div.form-panel
     [:div.form-panel-left
      (panel/info icon/stacks name)]
     [:div.form-panel-right
+     [:div
+     ;; (comp/mui
+     ;;   (comp/raised-button
+     ;;     {:onClick       (fn [_] (state/update-value [:menu?] true state/form-state-cursor))
+     ;;      :icon          (comp/button-icon icon/expand-18)
+     ;;      :labelPosition "before"
+     ;;      :label         "Current state"}))
+      (select-stackfile "asdf" nil menu?)]
+
+     [:span.form-panel-delimiter]
      (comp/progress-button
        {:label      "Deploy"
         :disabled   (not valid?)
@@ -160,7 +194,29 @@
      {:onValid   #(state/update-value [:valid?] true state/form-state-cursor)
       :onInvalid #(state/update-value [:valid?] false state/form-state-cursor)}
      (form-name name)
-     (html (tabs name 0 last? previous?))
+     (form/comp
+       "COMPOSE FILE SOURCE"
+       (comp/select-field
+         {:name     "cfs"
+          :key      "cfs"
+          :required true
+          :disabled false
+          :value    0}
+         (comp/menu-item
+           {:key           "current"
+            :innerDivStyle info/action-menu-item-style
+            :disabled      false
+            :primaryText   "Current state"})
+         (comp/menu-item
+           {:key           "last"
+            :innerDivStyle info/action-menu-item-style
+            :disabled      false
+            :primaryText   "Last deployed"})
+         (comp/menu-item
+           {:key           "previous"
+            :innerDivStyle info/action-menu-item-style
+            :disabled      true
+            :primaryText   "Previously deployed"})))
      (editor (:compose spec)))])

 (rum/defc form < rum/reactive


parser: add support for variable in query

--- src/graphql_clj/parser.clj
+++ src/graphql_clj/parser.clj
@@ -229,6 +229,9 @@
                   [:enum-type type-name])
    :EnumValue (fn enum-value [value]
                 [:enum-value value])
+
+   :Variable (fn variable [& args]
+               [:variable (into {} arg)])
    })

 (defn- transform
@@ -257,4 +260,5 @@
   picture: Url
 }
 "))
-  (parse "mutation {createUser (email: \"user@test.com\") { id }}"))
+  (parse "mutation {createUser (email: \"user@test.com\") { id }}")
+  (parse "{user (email: $email)}"))