s/nugents/generate-all/

s/nugents/generate-all/

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -60,10 +60,10 @@

 (declare bolts-with-comps)

-(defn nugents [model spec & [depth max-depth]]
+(defn generate-all [spec model & [depth max-depth]]
   (let [depth (or depth 0)
         max-depth (or max-depth max-total-depth)]
-    (log/debug (str "nugents:" depth "/" max-depth ":         " (strip-refs spec)))
+    (log/debug (str "generate-all:" depth "/" max-depth ":         " (strip-refs spec)))
     (let [bolts-and-comps (filter #(not (some empty? (vals %)))
                                   (bolts-with-comps spec model depth max-depth))
           routes (mapcat (fn [each-bolt-and-comps]
@@ -96,7 +96,7 @@
            shuffle? nil
            truncate-children? true
            take-n 1}}]
-  (first (nugents language-model spec)))
+  (first (generate-all spec language-model)))

 (declare comp-path-to-complements)

@@ -221,9 +221,9 @@
   (let [spec (get-in bolt path)
         lexemes (shufflefn (get-lexemes model spec))
         bolts-at (if (< depth max-depth)
-                   (nugents
+                   (generate-all
+                    (get-in bolt path)
                     model
-                    (get-in bolt path)
                     (+ 1 depth) max-depth))
         lexemes-before-phrases
         (lexemes-before-phrases depth max-depth)]


do not supply {:subcat '()} by default

do not supply {:subcat '()} by default

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -50,11 +50,8 @@
 (defn generate-all [spec model & [depth max-depth]]
   (let [depth (or depth 0)
         truncate truncate
-        max-depth (or max-depth max-total-depth)
-        spec (if (= ::none (get-in spec [:synsem :subcat] ::none))
-               (unify spec {:synsem {:subcat '()}}) ;; add subcat '() if not supplied
-               spec)]
-    (log/debug (str "generate-all:" depth "/" max-depth ";pred=" (get-in spec [:synsem :sem :pred])))
+        max-depth (or max-depth max-total-depth)]
+    (log/debug (str "generate-all:" depth "/" max-depth ":" (spec-info spec)))
     (->>
      (lightning-bolts model spec depth max-depth)


(defn lexemes-before-phrases): should take user-settable max-total-depth into account

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -192,7 +192,7 @@
                                                      (= true (get-in spec [:phrasal] true)))
                                               (generate-all spec language-model (+ (count path) total-depth)
                                                             :max-total-depth max-total-depth))
-                        lexemes-before-phrases (lexemes-before-phrases total-depth)]
+                        lexemes-before-phrases (lexemes-before-phrases total-depth max-total-depth)]
                     (cond (and lexemes-before-phrases
                                (empty? filtered-lexical-complements)
                                (= false (get-in spec [:phrasal] true)))
@@ -269,7 +269,7 @@
             (do
               (log/debug (str "hit max-total-depth: " max-total-depth ": will not generate phrasal head children."))
               nil))]
-      (if (lexemes-before-phrases total-depth)
+      (if (lexemes-before-phrases total-depth max-total-depth)
         (lazy-cat lexical phrasal)
         (lazy-cat phrasal lexical)))))

@@ -393,12 +393,14 @@
       {feat (path-to-map (rest path) val)}
       val)))

-(defn lexemes-before-phrases [depth]
+(defn lexemes-before-phrases [depth max-total-depth]
   "returns true or false: true means generate by adding lexemes first; otherwise, by adding phrases first. Takes depth as an argument, which makes returning true (i.e. lexemes first) increasingly likely as depth increases."
   (if (not randomize-lexemes-before-phrases)
     false
     (if (> max-total-depth 0)
-      (let [prob (- 1.0 (/ (- max-total-depth depth) max-total-depth))]
+      (let [prob (- 1.0 (/ (- max-total-depth depth)
+                           max-total-depth))]
+        (log/trace (str "P(c," depth ") = " prob " (c: probablity of choosing lexemes rather than phrases given a depth)."))
         (> (* 10 prob) (rand-int 10)))
       false)))


increase branching factor

increase branching factor

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -208,7 +208,7 @@

 (defn lexemes-before-phrases [depth]
   ;; takes depth as an argument; make phrases decreasingly likely as depth increases.
-  (let [result (> (rand-int (+ 1 depth)) 0)]
+  (let [result (> (rand-int (- 1 depth)) 0)]
     (log/trace (str "lexemes-before-phrases: depth=" depth " => " result))
     result))


s/cache/index/

s/cache/index/

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -262,9 +262,9 @@
         complement-candidate-lexemes
         (if (not (= true
                     (get-in bolt (concat path [:phrasal]))))
-          (let [cached (if cache
-                         (get-lex immediate-parent :comp cache spec))]
-            (if cached cached
+          (let [indexed (if index
+                         (get-lex immediate-parent :comp index spec))]
+            (if indexed indexed
                 (flatten (vals lexicon)))))

         complement-pre-check (fn [child parent path-to-child]
@@ -287,7 +287,7 @@
                                               "input-spec: " input-spec))
                         phrasal-complements (if (and (> max-total-depth total-depth)
                                                      (= true (get-in spec [:phrasal] true)))
-                                              (generate-all spec grammar lexicon cache morph (+ depth total-depth)))]
+                                              (generate-all spec grammar lexicon index morph (+ depth total-depth)))]
                     (if (lexemes-before-phrases total-depth)
                       (lazy-cat (lazy-shuffle filtered-lexical-complements) phrasal-complements)
                       (lazy-cat phrasal-complements (lazy-shuffle filtered-lexical-complements))))))))


small refactoring

small refactoring

--- resources/clj/new/closp/src/clj/routes/user.clj
+++ resources/clj/new/closp/src/clj/routes/user.clj
@@ -126,7 +126,8 @@
       (admin-page (merge validation-errors {:email email :displayname displayname}) req db))))

 (defn signup-user [db config
-                   {{:keys [email password displayname re-captcha-token localize] } :params :as req}]
+                   {:keys [localize]
+                    {:keys [email password displayname re-captcha-token]} :params :as req}]
   (let [validation-errors (validate-signup email password localize db
                                            (:captcha-enabled? config) re-captcha-token
                                            (:private-recaptcha-key config))]


fix cake repl --cake

fix cake repl --cake

--- src/cake/tasks/eval.clj
+++ src/cake/tasks/eval.clj
@@ -42,6 +42,6 @@
   "Start an interactive shell with history and tab completion."
   {cake? :cake}
   (if cake?
-    (repl (read))
+    (repl *readline-marker*)
     (bake (:use bake.repl) [marker *readline-marker*]
           (repl marker))))


make test depend on compile

make test depend on compile

--- src/cake/tasks/test.clj
+++ src/cake/tasks/test.clj
@@ -2,7 +2,7 @@
   (:use cake)
   (:import [java.io File]))

-(deftask test
+(deftask test #{compile}
   "Run project tests."
   (bake (:use bake.test) []
     (let [start (System/nanoTime)


Add match5

Add match5

The new predicate feature relies on `resolve`, so it works in Clojure but
not ClojureScript.

--- src/chapter3/match.cljs
+++ src/chapter3/match.cljs
@@ -32,3 +32,30 @@
         true)
     :else false))
   (if (match-helper p s) @variables false))
+(defn match5
+  "Note: ClojureScript doesn't seem to have resolve (or eval) so this code
+  won't actually work there."
+  [p s]
+  (def variables (atom {}))
+  (defn match-helper [p s]
+    (cond
+      (or (atom? p) (atom? s)) false
+      (empty? p) (empty? s)
+      (= (first p) (first s)) (match5 (rest p) (rest s))
+      (and
+       (= (count (first p)) 2)
+       (= (first (first p)) '?)
+       (match5 (rest p) (rest s)))
+      (do
+        (swap! variables (fn [vs] (assoc vs (first (rest (first p))) (first s))))
+        true)
+      (and
+       (= (count (first p)) 2)
+       (not (= (first (first p)) '?))
+       ((resolve (first (first p))) (first s))
+       (match5 (rest p) (rest s)))
+      (do
+        (swap! variables (fn [vs] (assoc vs (first (rest (first p))) (first s))))
+        true)
+    :else false))
+  (if (match-helper p s) @variables false))


made target-types better exposable

made target-types better exposable

--- main/src/dda/pallet/dda_managed_vm/domain.clj
+++ main/src/dda/pallet/dda_managed_vm/domain.clj
@@ -43,13 +43,16 @@
 (def DdaVmBookmarks
   {(s/optional-key :bookmarks) infra/Bookmarks})

+(def DdaVmTargetType
+  {:target-type (s/enum :virtualbox :remote-aws :plain)})
+
 (def DdaVmDomainConfig
   "The convention configuration for managed vms crate."
   (merge
     DdaVmUser
     DdaVmBookmarks
-    {:target-type (s/enum :virtualbox :remote-aws :plain)
-     :usage-type (s/enum :desktop-minimal :desktop-base :desktop-office)}))
+    DdaVmTargetType
+     :usage-type (s/enum :desktop-minimal :desktop-base :desktop-office)))

 (def DdaVmDomainResolvedConfig
   "The convention configuration for managed vms crate."


Switch user namespace to the game credits system

--- clstreams/dev/user.clj
+++ clstreams/dev/user.clj
@@ -15,13 +15,14 @@

             [clstreams.examples.count-words.system :refer
              [count-words-system produce-words]]
-            [clstreams.examples.game-credits.state]))
+            [clstreams.examples.game-credits.system :refer
+             [game-credits-system send-request]]))

 (def system nil)

 (defn init-system []
   (alter-var-root #'system
-                  (constantly (count-words-system))))
+                  (constantly (game-credits-system))))

 (defn start-system []
   (alter-var-root #'system component/start))


re-update schematode again for the second time

--- src/navigator/schema.clj
+++ src/navigator/schema.clj
@@ -2,74 +2,83 @@
   (:require [datomic-schematode.constraints :as constraints]))

 (def schema
-  [[:comp {:attrs [[:id-sk :string "Shared key for 3rd parties" :db.unique/identity]
-                   [:name :string :indexed] ; not null
-                   [:description :string :indexed]
-                   [:version :string]               ; not null
-                   [:status :enum [:active :archived :preactive]] ; not null
-                   [:tags :ref :many]]
-           :dbfns [(constraints/unique :comp :name :version)]}]
-   [:comp-tag {:attrs [[:name :string :indexed] ; not null
-                       [:description :string]
-                       [:version :string]     ; not null
-                       [:type :string :indexed] ; not null
-                       [:isrequestable :boolean] ; default f
-                       [:icon :uri]
-                       [:status :enum [:active :archived]] ; not null
-                       [:isfinal :boolean] ; default f
-                       [:disp-ctxs :ref :many]
-                       [:child-tags :ref :many]
-                       [:child-perf-asmts :ref :many]
-                       [:child-comps :ref :many]]
-               :dbfns [(constraints/unique :comp-tag :name :version)]}]
-   [:comp-tag-disp-ctx {:attr [[:name :string]]}]
-   [:perf-asmt {:attrs [[:id-sk :string "Shared key from 3rd parties"]
-                        [:id-sk-origin :keyword] ; e.g., :moodle, :show-evidence, etc.
-                        [:id-sk-with-origin :string "Combined id-sk and id-sk-origin" :db.unique/identity]
-                        [:name :string]
-                        [:version :string] ; not null
+  [{:namespace :comp
+    :attrs [[:id-sk :string "Shared key for 3rd parties" :db.unique/identity]
+            [:name :string :indexed] ; not null
+            [:description :string :indexed]
+            [:version :string]               ; not null
+            [:status :enum [:active :archived :preactive]] ; not null
+            [:tags :ref :many]]
+    :dbfns [(constraints/unique :comp :name :version)]}
+   {:namespace :comp-tag
+    :attrs [[:name :string :indexed] ; not null
+            [:description :string]
+            [:version :string]     ; not null
+            [:type :string :indexed] ; not null
+            [:isrequestable :boolean] ; default f
+            [:icon :uri]
+            [:status :enum [:active :archived]] ; not null
+            [:isfinal :boolean] ; default f
+            [:disp-ctxs :ref :many]
+            [:child-tags :ref :many]
+            [:child-perf-asmts :ref :many]
+            [:child-comps :ref :many]]
+    :dbfns [(constraints/unique :comp-tag :name :version)]}
+   {:namespace :comp-tag-disp-ctx
+    :attrs [[:name :string]]}
+   {:namespace :perf-asmt
+    :attrs [[:id-sk :string "Shared key from 3rd parties"]
+            [:id-sk-origin :keyword] ; e.g., :moodle, :show-evidence, etc.
+            [:id-sk-with-origin :string "Combined id-sk and id-sk-origin" :db.unique/identity]
+            [:name :string]
+            [:version :string] ; not null

-                        ;; Example types: :project :course-competency ... TODO: enum?
-                        [:type :string] ; not null
-                        [:duration-rating-days :bigint]
-                        [:comps :ref :many]
-                        [:credit-value-numerator :bigint]
-                        [:credit-value-denominator :bigint]]
-               :dbfns [(constraints/unique :perf-asmt :name :version :type)
-                       (constraints/unique :perf-asmt :id-sk :id-sk-origin)]}]
-   [:task {:attrs [[:id-sk :string]
-                   [:id-sk-origin :keyword] ; e.g., :moodle, :show-evidence, etc.
-                   [:id-sk-with-origin :string "Combined id-sk and id-sk-origin" :db.unique/identity]
-                   [:name :string]
-                   [:version :string]
-                   [:description :string]
+            ;; Example types: :project :course-competency ... TODO: enum?
+            [:type :string] ; not null
+            [:duration-rating-days :bigint]
+            [:comps :ref :many]
+            [:credit-value-numerator :bigint]
+            [:credit-value-denominator :bigint]]
+    :dbfns [(constraints/unique :perf-asmt :name :version :type)
+            (constraints/unique :perf-asmt :id-sk :id-sk-origin)]}
+   {:namespace :task
+    :attrs [[:id-sk :string]
+            [:id-sk-origin :keyword] ; e.g., :moodle, :show-evidence, etc.
+            [:id-sk-with-origin :string "Combined id-sk and id-sk-origin" :db.unique/identity]
+            [:name :string]
+            [:version :string]
+            [:description :string]

-                   ;; TODO: is this correct?
-                   [:comps :ref :many]]
-           :dbfns [(constraints/unique :perf-asmt :id-sk :id-sk-origin)]}]
-   [:user2comp {:attrs [[:sis-user-id :bigint :indexed]
-                        [:comp :ref :indexed]
-                        [:start-date :instant]
-                        [:iscomplete :boolean] ; default f
-                        [:isoverridden :boolean] ; default f
-                        [:completion-date :instant]
-                        [:proposed-completion-date :instant]
-                        [:current-score :string]
-                        [:final-score :string]
-                        [:score-denominator :bigint]
-                        [:score-type :enum [:numeric :letter :pass-fail :qualitative]] ; enum is what we want here, n'est-ce pas?
-                        [:qualitative-notes :string]]}]
+            ;; TODO: is this correct?
+            [:comps :ref :many]]
+    :dbfns [(constraints/unique :perf-asmt :id-sk :id-sk-origin)]}
+   {:namespace :user2comp
+    :attrs [[:sis-user-id :bigint :indexed]
+            [:comp :ref :indexed]
+            [:start-date :instant]
+            [:iscomplete :boolean] ; default f
+            [:isoverridden :boolean] ; default f
+            [:completion-date :instant]
+            [:proposed-completion-date :instant]
+            [:current-score :string]
+            [:final-score :string]
+            [:score-denominator :bigint]
+            [:score-type :enum [:numeric :letter :pass-fail :qualitative]] ; enum is what we want here, n'est-ce pas?
+            [:qualitative-notes :string]]}

-   [:user2perf-asmt {:attrs [[:user :ref]
-                             [:perf-asmt :ref]
-                             ;; TODO: finish this
-                             [:grade :boolean]]}]
+   {:namespace :user2perf-asmt
+    :attrs [[:user :ref]
+            [:perf-asmt :ref]
+            ;; TODO: finish this
+            [:grade :boolean]]}

-   [:user2task {:attrs [[:user :ref]
-                        [:task :ref]
-                        ;; TODO: finish this
-                        [:progress :boolean]]}]
+   {:namespace :user2task
+    :attrs [[:user :ref]
+            [:task :ref]
+            ;; TODO: finish this
+            [:progress :boolean]]}

-   [:config {:attrs [[:key :string :indexed] ; not null
-                     [:value :string :indexed]]}]
+   {:namespace :config
+    :attrs [[:key :string :indexed] ; not null
+            [:value :string :indexed]]}
    ])


Revert "Confirmation before removing environment variable [CIRCLE-302]"

--- src-cljs/frontend/components/project_settings.cljs
+++ src-cljs/frontend/components/project_settings.cljs
@@ -407,34 +407,6 @@
            [:hr]
            (clear-cache-button "source" project-data owner)]]]))))

-(defn remove-env-var-button [{:keys [env-var project-id]} owner]
-  (reify
-    om/IInitState
-    (init-state [_]
-      {:show-modal? false})
-    om/IRenderState
-    (render-state [_ {:keys [show-modal?]}]
-      (html
-       [:span
-        (table/action-button
-         "Remove"
-         (icon/delete)
-         #(om/set-state! owner :show-modal? true))
-        (when show-modal?
-          (let [close-fn #(om/set-state! owner :show-modal? false)]
-            (modal/modal-dialog {:title "Are you sure?"
-                                 :body (html
-                                        [:span
-                                         "Are you sure you want to remove the environment variable \""
-                                         (:name env-var)
-                                         "\"?"])
-                                 :actions [(button/button {:on-click close-fn} "Cancel")
-                                           (button/button {:primary? true
-                                                           :on-click #(raise! owner [:deleted-env-var {:project-id project-id
-                                                                                :env-var-name (:name env-var)}])}
-                                                          "Delete")]
-                                 :close-fn close-fn})))]))))
-
 (defn env-vars [project-data owner]
   (reify
     om/IRender
@@ -445,55 +417,58 @@
             new-env-var-value (:new-env-var-value inputs)
             project-id (project-model/id project)]
         (html
-         [:section
-          [:article
-           [:h2 "Environment Variables for " (vcs-url/project-name (:vcs_url project))]
-           [:div
-            [:p
-             "Add environment variables to the project build.  You can add sensitive data (e.g. API keys) here, rather than placing them in the repository. "
-             "The values can be any bash expression and can reference other variables, such as setting "
-             [:code "M2_MAVEN"] " to " [:code "${HOME}/.m2)"] "."]
-
-            [:p
-             " To disable string substitution you need to escape the " [:code "$"]
-             " characters by prefixing them with " [:code "\\"] "."
-             " For example, a value like " [:code "usd$"] " would be entered as " [:code "usd\\$"] "." ]
-            [:form
-             [:div.form-group
-              [:label "Name"]
-              [:input.form-control#env-var-name
-               {:required true, :type "text", :value new-env-var-name
-                :on-change #(utils/edit-input owner (conj state/inputs-path :new-env-var-name) %)}]]
-             [:div.form-group
-              [:label "Value"]
-              [:input.form-control#env-var-value
-               {:required true
-                :type "text"
-                :value new-env-var-value
-                :auto-complete "off"
-                :on-change #(utils/edit-input owner (conj state/inputs-path :new-env-var-value) %)}]]
-
-             [:div.form-group
-              (forms/managed-button
-               [:input.btn.btn-primary {:data-failed-text "Failed",
-                                        :data-success-text "Added",
-                                        :data-loading-text "Adding...",
-                                        :value "Add Variable",
-                                        :type "submit"
-                                        :on-click #(raise! owner [:created-env-var {:project-id project-id}])}])]]
-            (when-let [env-vars (seq (:envvars project-data))]
-              (om/build table/table
-                        {:rows env-vars
-                         :columns [{:header "Name"
-                                    :cell-fn :name}
-                                   {:header "Value"
-                                    :cell-fn :value}
-                                   {:header "Remove"
-                                    :type #{:shrink :right}
-                                    :cell-fn
-                                    (fn [env-var]
-                                      (om/build remove-env-var-button {:env-var env-var
-                                                                       :project-id project-id}))}]}))]]])))))
+          [:section
+           [:article
+            [:h2 "Environment Variables for " (vcs-url/project-name (:vcs_url project))]
+            [:div
+             [:p
+              "Add environment variables to the project build.  You can add sensitive data (e.g. API keys) here, rather than placing them in the repository. "
+              "The values can be any bash expression and can reference other variables, such as setting "
+              [:code "M2_MAVEN"] " to " [:code "${HOME}/.m2)"] "."]
+
+             [:p
+              " To disable string substitution you need to escape the " [:code "$"]
+              " characters by prefixing them with " [:code "\\"] "."
+              " For example, a value like " [:code "usd$"] " would be entered as " [:code "usd\\$"] "." ]
+             [:form
+              [:div.form-group
+               [:label "Name"]
+               [:input.form-control#env-var-name
+                {:required true, :type "text", :value new-env-var-name
+                 :on-change #(utils/edit-input owner (conj state/inputs-path :new-env-var-name) %)}]]
+              [:div.form-group
+               [:label "Value"]
+               [:input.form-control#env-var-value
+                {:required true
+                 :type "text"
+                 :value new-env-var-value
+                 :auto-complete "off"
+                 :on-change #(utils/edit-input owner (conj state/inputs-path :new-env-var-value) %)}]]
+
+              [:div.form-group
+               (forms/managed-button
+                 [:input.btn.btn-primary {:data-failed-text "Failed",
+                                          :data-success-text "Added",
+                                          :data-loading-text "Adding...",
+                                          :value "Add Variable",
+                                          :type "submit"
+                                          :on-click #(raise! owner [:created-env-var {:project-id project-id}])}])]]
+             (when-let [env-vars (seq (:envvars project-data))]
+               (om/build table/table
+                         {:rows env-vars
+                          :columns [{:header "Name"
+                                     :cell-fn :name}
+                                    {:header "Value"
+                                     :cell-fn :value}
+                                    {:header "Remove"
+                                     :type #{:shrink :right}
+                                     :cell-fn
+                                     (fn [env-var]
+                                       (table/action-button
+                                        "Remove"
+                                        (icon/delete)
+                                        #(raise! owner [:deleted-env-var {:project-id project-id
+                                                                          :env-var-name (:name env-var)}])))}]}))]]])))))

 (defn advance [project-data owner]
   (reify


Accomodate to printing changes in ClojureScript repo

https://github.com/clojure/clojurescript/commit/6c7aa76fc43be79e0712f30ee5e459c249afda36

--- src/devtools/format.cljs
+++ src/devtools/format.cljs
@@ -4,7 +4,7 @@
     ))

 (def max-coll-elements 5)
-(def abbreviation "…")
+(def more-marker "…")
 (def line-index-separator ":")
 (def dq "\"")
 (def surrogate-key "$$surrogate")
@@ -103,7 +103,7 @@
     (fn? value) (fn-template value)))

 (defn abbreviated? [template]
-  (some #(= abbreviation %) template))
+  (some #(= more-marker %) template))

 (deftype TemplateWriter [t]
   Object
@@ -122,31 +122,33 @@
     #js [(reference (surrogate obj (.concat (template span "") group)))]
     group))

-; fallback worker can do this in the :else case
+; default printer implementation can do this:
 ;   :else (write-all writer "#<" (str obj) ">")
 ; we want to wrap stringified obj in a reference for further inspection
 (defn detect-else-case-and-patch-it [group obj]
   (if (and (= (count group) 3) (= (aget group 0) "#<") (= (str obj) (aget group 1)) (= (aget group 2) ">"))
     (aset group 1 (reference (surrogate obj (aget group 1)))))) ; TODO change to direct reference after devtools guys fix the bug

-(defn alt-worker [obj writer opts]
+(defn alt-printer-impl [obj writer opts]
   (if-let [tmpl (atomic-template obj)]
     (-write writer tmpl)
     (let [inner-tmpl #js []
-          inner-writer (TemplateWriter. inner-tmpl)]
+          inner-writer (TemplateWriter. inner-tmpl)
+          default-impl (:fallback-impl opts)]
+      ; we want to limit print-level, at second level use maximal abbreviation e.g. [...] or {...}
       (if (= *print-level* 1)
-        ((:fallback-worker opts) obj inner-writer (assoc opts :print-length 0))
-        ((:fallback-worker opts) obj inner-writer opts))
-      (detect-else-case-and-patch-it inner-tmpl obj) ; an ugly special case
+        (default-impl obj inner-writer (assoc opts :print-length 0))
+        (default-impl obj inner-writer opts))
+      (detect-else-case-and-patch-it inner-tmpl obj)        ; an ugly special case
       (.merge writer (wrap-group-in-cljs-if-needed (wrap-group-in-reference-if-needed inner-tmpl obj) obj)))))

 (defn managed-pr-str [value]
   (let [tmpl (template span "")
         writer (TemplateWriter. tmpl)]
-    (binding [*print-level* 2]
-      (pr-seq-writer [value] writer {:alt-worker   alt-worker
+    (binding [*print-level* 2] ; when printing do at most two levels deep recursion
+      (pr-seq-writer [value] writer {:alt-impl     alt-printer-impl
                                      :print-length max-coll-elements
-                                     :more-text    abbreviation}))
+                                     :more-marker  more-marker}))
     (wrap-cljs-if-needed (cljs-value? value) tmpl)))

 (defn build-header [value]
@@ -198,7 +200,7 @@
   (cond
     (satisfies? IDevtoolsFormat value) (-has-body value)
     (surrogate? value) (.-hasBody value)
-    :else false)) ; body is emulated using surrogate references
+    :else false))                                           ; body is emulated using surrogate references

 (defn body-api-call [value]
   (cond


Handle `ProvidedNode`s on node refresh.

Handle `ProvidedNode`s on node refresh.

--- src/clj/shale/nodes.clj
+++ src/clj/shale/nodes.clj
@@ -181,22 +181,25 @@
     (logging/debug "Refreshing nodes...")
     (let [nodes (->> (:node-provider pool)
                      node-providers/get-nodes
-                     to-set)
+                     (map #(vec [(:url % %) %]))
+                     (into {}))
           registered-nodes (->> (view-models pool)
-                                (map :url)
-                                to-set)]
+                                (map #(vec [(:url %) %]))
+                                (into {}))]
       (logging/debug "Live nodes:")
       (logging/debug nodes)
       (logging/debug "Nodes in Redis:")
       (logging/debug registered-nodes)
       (doall
         (concat
-          (map #(create-node-from-provided-mode pool %)
+          (map #(create-node-from-provided-mode pool (get nodes %))
                (filter identity
-                       (difference nodes registered-nodes)))
-          (map #(destroy-node pool (:id (view-model-from-url pool %)))
+                       (difference (to-set (keys nodes))
+                                   (to-set (keys registered-nodes)))))
+          (map #(destroy-node pool (:id (get registered-nodes %)))
                (filter identity
-                       (difference registered-nodes nodes))))))
+                       (difference (to-set (keys registered-nodes))
+                                   (to-set (keys nodes))))))))
     true))

 (s/defschema NodeRequirement


* src/cljs/cljs/core.cljs: CLJS-98: fix instance? so that (instance? js/Type x) works for builtin JS types.

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -609,7 +609,7 @@
   (js* "(void 0 === ~{x})"))

 (defn instance? [t o]
-  (js* "(~{o} instanceof ~{t})"))
+  (js* "((~{o} instanceof ~{t}) || (~{o}.constructor === t))"))

 (defn seq?
   "Return true if s satisfies ISeq"


Clean up handling of print options. Refs #19

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -1230,6 +1230,9 @@
   (goog.global.print x)
   nil)

+(defn flush [] ;stub
+  nil)
+
 (defn- pr-seq [obj opts]
   (cond
     (nil? obj) (list "nil")
@@ -1255,19 +1258,29 @@
   (loop [coll (seq (pr-seq obj opts))]
     (when coll
       (string-print (first coll))
-      ; TODO: flush-on-newline should be keyword
-      (when (and (get opts "flush-on-newline") (= "\n" (first coll)))
-        #_(flush))
       (recur (next coll)))))

 (defn newline [opts]
-  (string-print "\n")) ; flush?
+  (string-print "\n")
+  (when (get opts :flush-on-newline)
+    (flush)))
+
+(def *flush-on-newline* true)
+(def *print-readably* true)
+(def *print-meta* false)
+(def *print-dup* false)
+
+(defn- pr-opts []
+  {:flush-on-newline *flush-on-newline*
+   :readably *print-readably*
+   :meta *print-meta*
+   :dup *print-dup*})

 ; These should all be variadic.  Where oh where has my apply gone?
 (defn pr-str
   "pr to a string, returning it. Fundamental entrypoint to IPrintable."
   [obj]
-  (pr-str-with-opts obj {:readably true}))
+  (pr-str-with-opts obj (pr-opts)))

 (defn pr
   "Prints the object(s) using string-print.  Prints the
@@ -1275,17 +1288,17 @@
   By default, pr and prn print in a way that objects can be
   read by the reader"
   [obj]
-  (pr-with-opts obj {:readably true}))
+  (pr-with-opts obj (pr-opts)))

 (defn println
   "Prints the object(s) using string-print.
   print and println produce output for human consumption."
   [obj]
-  (pr-with-opts obj {:readably false})
-  (newline))
+  (pr-with-opts obj (assoc (pr-opts) :readably false))
+  (newline (pr-opts)))

 (defn prn
   "Same as pr followed by (newline)."
   [obj]
-  (pr-with-opts obj {:readably true})
-  (newline))
+  (pr-with-opts obj (pr-opts))
+  (newline (pr-opts)))


Finished PersistentQueue implementation.

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -1273,53 +1273,6 @@

   ISeqable
   (-seq [coll] (seq (lazy-seq-value coll))))
-
-;;; PersistentQueue ;;;
-
-(deftype PersistentQueue [meta count front rear]
-  IWithMeta
-  (-with-meta [coll meta] (PersistentQueue. meta count front rear))
-
-  IMeta
-  (-meta [coll] meta)
-
-  ISeq
-  (-first [coll] (first front))
-  (-rest [coll] (rest (seq coll)))
-
-  IStack
-  (-peek [coll] (-first front))
-  (-pop [coll]
-    (if front
-      (if-let [f1 (next front)]
-        (PersistentQueue. meta (dec count) f1 rear)
-        (PersistentQueue. meta (dec count) (seq rear) nil))
-      coll))
-
-  ICollection
-  (-conj [coll o]
-    (if front
-      (PersistentQueue. meta (inc count) front (conj (or rear []) o))
-      (PersistentQueue. meta (inc count) (conj front o) nil)))
-
-  IEmptyableCollection
-  (-empty [coll] cljs.core.PersistentQueue/EMPTY)
-
-  ISequential
-  IEquiv
-  (-equiv [coll other] (equiv-sequential coll other))
-
-  IHash
-  (-hash [coll] (hash-coll coll))
-
-  ISeqable
-  ; This is wrong, but quick
-  (-seq [coll] (concat front rear))
-
-  ICounted
-  (-count [coll] count))
-
-(set! cljs.core.PersistentQueue/EMPTY (PersistentQueue. nil 0 nil nil))

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

@@ -2116,6 +2069,88 @@
         ([_ k] (-lookup (js* "this") k))
         ([_ k not-found] (-lookup (js* "this") k not-found))))

+;;; PersistentQueue ;;;
+
+(deftype PersistentQueueSeq [meta front rear]
+  IWithMeta
+  (-with-meta [coll meta] (PersistentQueueSeq. meta front rear))
+
+  IMeta
+  (-meta [coll] meta)
+
+  ISeq
+  (-first [coll] (-first front))
+  (-rest  [coll]
+    (if-let [f1 (next front)]
+      (PersistentQueueSeq. meta f1 rear)
+      (if (nil? rear)
+        (-empty coll)
+        (PersistentQueueSeq. meta rear nil))))
+
+  ICollection
+  (-conj [coll o] (cons o coll))
+
+  IEmptyableCollection
+  (-empty [coll] (with-meta cljs.core.List/EMPTY meta))
+
+  ISequential
+  IEquiv
+  (-equiv [coll other] (equiv-sequential coll other))
+
+  IHash
+  (-hash [coll] (hash-coll coll))
+
+  ISeqable
+  (-seq [coll] coll))
+
+(deftype PersistentQueue [meta count front rear]
+  IWithMeta
+  (-with-meta [coll meta] (PersistentQueue. meta count front rear))
+
+  IMeta
+  (-meta [coll] meta)
+
+  ISeq
+  (-first [coll] (first front))
+  (-rest [coll] (rest (seq coll)))
+
+  IStack
+  (-peek [coll] (-first front))
+  (-pop [coll]
+    (if front
+      (if-let [f1 (next front)]
+        (PersistentQueue. meta (dec count) f1 rear)
+        (PersistentQueue. meta (dec count) (seq rear) []))
+      coll))
+
+  ICollection
+  (-conj [coll o]
+    (if front
+      (PersistentQueue. meta (inc count) front (conj (or rear []) o))
+      (PersistentQueue. meta (inc count) (conj front o) [])))
+
+  IEmptyableCollection
+  (-empty [coll] cljs.core.PersistentQueue/EMPTY)
+
+  ISequential
+  IEquiv
+  (-equiv [coll other] (equiv-sequential coll other))
+
+  IHash
+  (-hash [coll] (hash-coll coll))
+
+  ISeqable
+  (-seq [coll]
+    (let [rear (seq rear)]
+      (if (or front rear)
+        (PersistentQueueSeq. nil front (seq rear))
+        cljs.core.List/EMPTY)))
+
+  ICounted
+  (-count [coll] count))
+
+(set! cljs.core.PersistentQueue/EMPTY (PersistentQueue. nil 0 nil []))
+
 (deftype NeverEquiv []
   IEquiv
   (-equiv [o other] false))
@@ -2898,6 +2933,9 @@
   (-pr-seq [coll opts] (pr-sequential pr-seq "(" " " ")" opts coll))

   IndexedSeq
+  (-pr-seq [coll opts] (pr-sequential pr-seq "(" " " ")" opts coll))
+
+  PersistentQueueSeq
   (-pr-seq [coll opts] (pr-sequential pr-seq "(" " " ")" opts coll))

   List


Renaming (new Foo) to (Foo.) now that we have (.)

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -182,7 +182,7 @@

 (deftype LazySeq [meta realized x]
   IWithMeta
-  (-with-meta [coll meta] (new LazySeq meta realized x))
+  (-with-meta [coll meta] (LazySeq. meta realized x))

   IMeta
   (-meta [coll] meta)
@@ -211,21 +211,21 @@

 (deftype List [meta first rest count]
   IWithMeta
-  (-with-meta [coll meta] (new List meta first rest count))
+  (-with-meta [coll meta] (List. meta first rest count))

   IMeta
   (-meta [coll] meta)

   ISeq
   (-first [coll] first)
-  (-rest [coll] (if (nil? rest) (new EmptyList meta) rest))
+  (-rest [coll] (if (nil? rest) (EmptyList. meta) rest))

   IStack
   (-peek [coll] first)
   (-pop [coll] (irest coll))

   ICollection
-  (-conj [coll o] (new List meta o coll (inc count)))
+  (-conj [coll o] (List. meta o coll (inc count)))

 ; IEmptyableCollection
 ; (iempty [coll] coll)
@@ -238,7 +238,7 @@

 (deftype EmptyList [meta]
   IWithMeta
-  (-with-meta [coll meta] (new EmptyList meta))
+  (-with-meta [coll meta] (EmptyList. meta))

   IMeta
   (-meta [coll] meta)
@@ -252,7 +252,7 @@
   (-pop [coll] #_(throw "Can't pop empty list"))

   ICollection
-  (-conj [coll o] (new List meta o nil 1))
+  (-conj [coll o] (List. meta o nil 1))

 ; IEmptyableCollection
 ; (iempty [coll] coll)
@@ -263,7 +263,7 @@
   ICounted
   (-count [coll] 0))

-(set! cljs.core.List.EMPTY (new EmptyList nil))
+(set! cljs.core.List.EMPTY (EmptyList. nil))

 (defn list [& items]
   ; when we have reduce: (reduce conj () (reverse items))
@@ -271,7 +271,7 @@

 (deftype Cons [meta first rest]
   IWithMeta
-  (-with-meta [coll meta] (new Cons meta first rest))
+  (-with-meta [coll meta] (Cons. meta first rest))

   IMeta
   (-meta [coll] meta)
@@ -281,7 +281,7 @@
   (-rest [coll] (if (nil? rest) () rest))

   ICollection
-  (-conj [coll o] (new Cons nil o coll))
+  (-conj [coll o] (Cons. nil o coll))

 ; IEmptyableCollection
 ; (iempty [coll] List.EMPTY)
@@ -292,7 +292,7 @@
 (defn cons
   "Returns a new seq where x is the first element and seq is the rest."
   [first rest]
-  (new Cons nil first rest))
+  (Cons. nil first rest))

 ; should use: count, nth
 (defn- vector-seq [vector i]


Fix bug in TransientHashMap's -lookup with not-found

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -3886,7 +3886,7 @@
         not-found)
       (if (nil? root)
         not-found
-        (nth (.inode-find root 0 (hash k) k not-found) 1))))
+        (nth (.inode-find root 0 (hash k) k (array nil not-found)) 1))))

   ITransientCollection
   (-conj! [tcoll val] (.conj! tcoll val))


Bugfix s/vals/tvals/

Bugfix s/vals/tvals/

--- src/cljs/ufo/state.cljs
+++ src/cljs/ufo/state.cljs
@@ -16,7 +16,7 @@
 ;; (def app-state { :keyword { id real-information }})

 (def app-state
-  {:list/vals [{:id 10001 :fname "Jeffry" :lname "Glacons"}]})
+  {:list/tvals [{:id 10001 :fname "Jeffry" :lname "Glacons"}]})

 (defonce reconciler
   (om/reconciler {:state  app-state


Revert "Scroll to bottom on update". Broke iOS.

This reverts commit c26b21bd53e7fc6145bf5f45cea44f21db9ae8f6.

--- src/cljs/virt/chat.cljs
+++ src/cljs/virt/chat.cljs
@@ -37,9 +37,6 @@
     om/IWillUnmount
     (will-unmount [_]
       (go (>! (om/get-state owner :comm) [:close])))
-    om/IDidUpdate
-    (did-update [_ _ _]
-      (.scrollTo js/window 0 (.. js/document -body -scrollHeight)))
     om/IRenderState
     (render-state [_ {:keys [comm]}]
       (dom/div #js {:className "leaf-channel"}
@@ -59,7 +56,7 @@
                                            #(conj % msg))
                                          (put! (om/get-state owner :comm) [:send-message msg])
                                          (om/set-state! owner :value "")))))}
-                  (dom/input #js {:onChange (fn [e] (om/set-state! owner :value (.. e -target -value)))
+                  (dom/input #js {:onChange (fn [e] (om/set-state! owner :value (.-value (.-target e))))
                                   :value (om/get-state owner :value)}))))))

 (defn branch-channel [app owner {:keys [channel]}]


delay loading of cider nrepl because of race condition

--- src/clojupyter/core.clj
+++ src/clojupyter/core.clj
@@ -1,6 +1,5 @@
 (ns clojupyter.core
   (:require [beckon]
-            [cider.nrepl :as cider]
             [clojupyter.middleware.mime-values]
             [clojupyter.misc.zmq-comm :as zmq-comm]
             [clojupyter.misc.nrepl-comm :as nrepl-comm]
@@ -40,16 +39,19 @@
 (def clojupyter-middleware
   '[clojupyter.middleware.mime-values/mime-values])

-(def clojupyer-nrepl-handler
+(defn clojupyer-nrepl-handler []
+  ;; dynamically load to allow cider-jack-in to work
+  ;; see https://github.com/clojure-emacs/cider-nrepl/issues/447
+  (require 'cider.nrepl)
   (apply nrepl.server/default-handler
          (map resolve
-              (concat cider/cider-middleware
+              (concat (ns-resolve 'cider.nrepl 'cider-nrepl-middleware)
                       clojupyter-middleware))))

 (defn start-nrepl-server []
   (nrepl.server/start-server
    :port (get-free-port!)
-   :handler clojupyer-nrepl-handler))
+   :handler (clojupyer-nrepl-handler)))

 (defn exception-handler [e]
   (log/error (with-out-str (st/print-stack-trace e 20))))


Move title and subtitle a bit closer together.

--- src/oc/email/content.clj
+++ src/oc/email/content.clj
@@ -265,7 +265,7 @@
   [horizontal-line
    (spacer 24)
    (h2 (:headline entry) (:url entry))
-   (spacer 12)
+   (spacer 4)
    (post-attribution entry true)
    (spacer 24)])

@@ -434,7 +434,7 @@
       horizontal-line
       (spacer 24)
       (h2 headline entry-url)
-      (spacer 12)
+      (spacer 4)
       (post-attribution entry false)
       (spacer 12)
       (left-button share-cta entry-url)


Fixed kibit error.

Fixed kibit error.

--- src/dragon/blog/core.clj
+++ src/dragon/blog/core.clj
@@ -150,7 +150,7 @@
   (let [raw-posts (get-posts system)
         processor-type (config/processor-type system)
         processor (post/new-processor-fn system)]
-    (log/trace "Posts:" (into [] raw-posts))
+    (log/trace "Posts:" (vec raw-posts))
     (log/debug "Processor type:" processor-type)
     (log/debug "Processor constructor key:"
                (config/processor-constructor system))


comment cound hiding for nobodies

comment cound hiding for nobodies

--- src/ontrail/exercise.clj
+++ src/ontrail/exercise.clj
@@ -31,7 +31,7 @@
 (defn visibility [viewing-user ex]
   (let [owner (:user ex)]
     (if (= "nobody" viewing-user)
-      (assoc ex :body "rekisteröidy nähdäksesi harjoitukset" :comments [])
+      (assoc ex :body "rekisteröidy nähdäksesi harjoitukset" :comments [] :commentCount 0 :newComments 0)
       (apply-rules viewing-user owner ex))))

 (defn as-ex-result


tdistance to ex list

tdistance to ex list

--- src/ontrail/exercise.clj
+++ src/ontrail/exercise.clj
@@ -57,6 +57,7 @@
                     :date date
                     :duration (to-human-time (:duration exercise))
                     :tduration (:duration exercise)
+                    :tdistance (:distance exercise)
                     :creationDate (to-human-date (:creationDate exercise))
                     :avghr (:avghr exercise)
                     :hrReserve heart-rate-reserve


Remove debug statement

Remove debug statement

--- src/onyx/test_helper.clj
+++ src/onyx/test_helper.clj
@@ -103,5 +103,4 @@
        (catch InterruptedException e#
          (Thread/interrupted))
        (finally
-         (println "Stopping env now")
          (component/stop ~symbol-name)))))


providing a means to mark a field rather than the entire document

--- src/ophion/aggregate.clj
+++ src/ophion/aggregate.clj
@@ -125,10 +125,20 @@
        (assoc project value (dollar value)))
      {} values)}])

+(defn mark-field
+  [label]
+  (if (map? label)
+    (let [key (first label)
+          value (last label)
+          path (str "_history." key)]
+      {path (dollar value)})
+    (let [path (str "_history." label)]
+      {path "$$ROOT"})))
+
 (defn mark
   [label]
-  (let [path (str "_history." label)]
-    [{:$addFields {path "$$ROOT"}}
+  (let [field (mark-field label)]
+    [{:$addFields field}
      {:$project
       {(str path "._history") false
        (str path "._id") false}}]))


ingesting label collections

ingesting label collections

--- src/ophion/aggregate.clj
+++ src/ophion/aggregate.clj
@@ -309,7 +309,7 @@
     (let [element (string/lower-case (kafka/path->label (.getName file)))
           lines (line-seq (io/reader file))
           parsed (map #(json/parse-string % keyword) lines)]
-      (ingest-batches! graph element parsed))))
+      (ingest-label-collections! graph element parsed))))

 (defn ingest-batches!
   [graph element all]


ensure that the Demand ugen only has dr rate inputs (unlike all other dr ugens which may have either dr or kr inputs)

--- src/overtone/sc/ugen.clj
+++ src/overtone/sc/ugen.clj
@@ -244,8 +244,10 @@
                  (and (= "A2K" (:name ugen))
                       (= :ar (:rate-name bad-input)))
                  ;; Special case demand rate ugens which may have kr ugens plugged into them
+                 ;; Unless it's a Demand ugen which only allows dr ugens to be connected
                  (and (= :dr cur-rate)
-                      (= :kr (:rate-name bad-input))))
+                      (= :kr (:rate-name bad-input))
+                      (not (= "Demand" (:name ugen)))))

         (let [ugen-name (real-ugen-name ugen)
               in-name (real-ugen-name bad-input)


Make eval fn pluggable via own dymanic var rathar than spectrace's one

--- src/pinpointer/core.cljc
+++ src/pinpointer/core.cljc
@@ -5,9 +5,13 @@
             [clojure.walk :as walk]
             [fipp.clojure :as fipp]
             [pinpointer.formatter :as formatter]
-            [pinpointer.trace :as trace]))
+            [pinpointer.trace :as trace]
+            [spectrace.core :as strace]))

-(def ^:dynamic *colorize-fn*)
+(def ^:dynamic *eval-fn*
+  strace/*eval-fn*)
+
+(def ^:dynamic ^:private *colorize-fn*)

 (defn- colorize [color s]
   (*colorize-fn* color s))
@@ -140,8 +144,10 @@
    (if ed
      (let [{:keys [::s/problems ::s/value] :as ed} (correct-paths ed)
            nproblems (count problems)]
-       (if-let [traces (try (trace/traces ed)
-                            (catch #?(:clj Throwable :cljs js/Error) _))]
+       (if-let [traces (try
+                         (binding [strace/*eval-fn* *eval-fn*]
+                           (trace/traces ed))
+                         (catch #?(:clj Throwable :cljs js/Error) _))]
          (binding [*colorize-fn* (choose-colorize-fn colorize)]
            (newline)
            (print-headline nproblems)


:lipstick: Hide strike options when strike is none

--- frontend/src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs
+++ frontend/src/uxbox/main/ui/workspace/sidebar/options/stroke.cljs
@@ -21,7 +21,9 @@

 (mf/defc stroke-menu
   [{:keys [shape] :as props}]
-  (let [on-stroke-style-change
+  (let [show-options (not= (:stroke-style shape) :none)
+
+        on-stroke-style-change
         (fn [event]
           (let [value (-> (dom/get-target event)
                           (dom/get-value)
@@ -69,30 +71,35 @@
         [:option {:value ":dashed"} (tr "workspace.options.stroke.dashed")]
         [:option {:value ":mixed"} (tr "workspace.options.stroke.mixed")]]

-       [:div.input-element.pixels
-        [:input.input-text {:type "number"
-                            :min "0"
-                            :value (-> (:stroke-width shape)
-                                       (math/precision 2)
-                                       (d/coalesce-str "1"))
-                            :on-change on-stroke-width-change}]]]
+        [:div.input-element {:class (when show-options "pixels")}
+         (when show-options
+           [:input.input-text {:type "number"
+                              :min "0"
+                              :value (-> (:stroke-width shape)
+                                         (math/precision 2)
+                                         (d/coalesce-str "1"))
+                              :on-change on-stroke-width-change}])]]

       ;; Stroke Color
-      [:span (tr "workspace.options.color")]
-      [:div.row-flex.color-data
-       [:span.color-th {:style {:background-color (:stroke-color shape)}
-                        :on-click show-color-picker}]
-       [:div.color-info
-        [:input {:read-only true
-                 :default-value (:stroke-color shape "")}]]]
+      (when show-options
+        [:*
+         [:span (tr "workspace.options.color")]

-      [:span (tr "workspace.options.opacity")]
-      [:div.row-flex
-       [:input.slidebar {:type "range"
-                         :min "0"
-                         :max "10000"
-                         :value (-> (:stroke-opacity shape 1)
-                                    (* 10000)
-                                    (d/coalesce-str "1"))
-                         :step "1"
-                         :on-change on-stroke-opacity-change}]]]]))
+         [:div.row-flex.color-data
+          [:span.color-th {:style {:background-color (:stroke-color shape)}
+                           :on-click show-color-picker}]
+          [:div.color-info
+           [:input {:read-only true
+                    :default-value (:stroke-color shape "")}]]]
+
+         [:span (tr "workspace.options.opacity")]
+
+         [:div.row-flex
+          [:input.slidebar {:type "range"
+                            :min "0"
+                            :max "10000"
+                            :value (-> (:stroke-opacity shape 1)
+                                       (* 10000)
+                                       (d/coalesce-str "1"))
+                            :step "1"
+                            :on-change on-stroke-opacity-change}]]])]]))


Small mixpanel data fix

Small mixpanel data fix

--- frontend/controllers/controls.cljs
+++ frontend/controllers/controls.cljs
@@ -703,7 +703,10 @@

 (defmethod post-control-event! :invited-github-users
   [target message {:keys [project-name org-name invitees]} previous-state current-state]
-  (let [context (if project-name {:project project-name} {:org org-name})]
+  (let [context (if project-name
+                  ;; TODO: non-hackish way to indicate the type of invite
+                  {:project project-name :first_green_build true}
+                  {:org org-name})]
     (button-ajax :post
                  (if project-name
                    (gstring/format "/api/v1/project/%s/users/invite" project-name)
@@ -714,13 +717,10 @@
                  :params invitees)
     ;; TODO: move all of the tracking stuff into frontend.analytics and let it
     ;;      keep track of which service to send things to
-    (mixpanel/track "Sent invitations" (merge {:first_green_build true
-                                               :users (map :login invitees)}
+    (mixpanel/track "Sent invitations" (merge {:users (map :login invitees)}
                                               context))
     (doseq [u invitees]
-      (mixpanel/track "Sent invitation" (merge {:first_green_build true
-                                                :project project-name
-                                                :login (:login u)
+      (mixpanel/track "Sent invitation" (merge {:login (:login u)
                                                 :id (:id u)
                                                 :email (:email u)}
                                                context)))))


Port tweak.

Port tweak.

--- src/flatland/handler.clj
+++ src/flatland/handler.clj
@@ -100,4 +100,4 @@

 (defn -main
   []
-  (jetty/run-jetty app {}))
+  (jetty/run-jetty app {:port 5000}))


Created range-mapper function.

Created range-mapper function.

--- src/clojure/uncomplicate/bayadera/visual.clj
+++ src/clojure/uncomplicate/bayadera/visual.clj
@@ -7,15 +7,21 @@
             [quil.core :as q])
   (:import [processing.core PGraphics PConstants]))

-(defn map-range ^double [^double value range-vector]
-  (let [start1 (entry range-vector 0)
-        start2 (entry range-vector 2)]
-    (+ start2
-       (* (- (entry range-vector 3) start2)
-          (/ (- value start1)
-             (- (entry range-vector 1) start1))))))
+(defrecord HSBColor [^float h ^float s ^float b])

-(defrecord HSBColor [^float h ^float s ^float b])
+(defn range-mapper
+  ([^double start1 ^double end1 ^double start2 ^double end2]
+   (fn ^double [^double value]
+     (+ start2 (* (- end2 start2) (/ (- value start1) (- end1 start1))))))
+  ([^double start1 ^double end1]
+   (fn ^double [^double value ^double start2 ^double end2]
+     (+ start2 (* (- end2 start2) (/ (- value start1) (- end1 start1)))))))
+
+(defrecord Frame2D [^long margin ^long padding
+                    ^long tick-length
+                    ^double x-lower ^double x-upper
+                    ^long x-offset ^long y-offset]
+  )

 (defn style
   ([^PGraphics g ^HSBColor color ^long weight]
@@ -82,38 +88,32 @@
         y-lower (float y-lower)
         y-upper (float y-upper)
         x-offset (float x-offset)
-        y-offset (float y-offset)]
-    (with-release [x-range (dv x-lower x-upper padding width)
-                   y-range (dv y-lower y-upper (- height) padding)]
-      (.beginDraw g)
-      (loop [x x-lower]
-        (when (<= x x-upper)
-          (do (.text g x (float (map-range x x-range)) (float (- height padding)))
-              (recur (+ x x-offset)))))
-      (.endDraw g)
-      g)))
-
-
+        y-offset (float y-offset)
+        map-x (range-mapper x-lower x-upper padding width)]
+    (.beginDraw g)
+    (loop [x x-lower]
+      (when (<= x x-upper)
+        (do (.text g x (float (map-x x)) (float (- height padding)))
+            (recur (+ x x-offset)))))
+    (.endDraw g)
+    g))

 (defn points [^PGraphics g xs ys x-lower x-upper y-lower y-upper]
-  (with-release [x-range (dv x-lower x-upper 0 (.width g))
-                 y-range (dv y-lower y-upper (.height g) 0)]
+  (let [map-x (range-mapper x-lower x-upper 0 (.width g))
+        map-y (range-mapper y-lower y-upper (.height g) 0)]
     (.beginDraw g)
     (.clear g)
     (dotimes [i (dim xs)]
-      (.point g (map-range (entry xs i) x-range) (map-range (entry ys i) y-range)))
+      (.point g (map-x (entry xs i)) (map-y (entry ys i))))
     (.endDraw g)
     g))

 (defn circles [^PGraphics g xs ys x-lower x-upper y-lower y-upper]
-  (with-release [x-range (dv x-lower x-upper 0 (.width g))
-                 y-range (dv y-lower y-upper (.height g) 0)]
+  (let [map-x (range-mapper x-lower x-upper 0 (.width g))
+        map-y (range-mapper y-lower y-upper (.height g) 0)]
     (.beginDraw g)
     (.clear g)
     (dotimes [i (dim xs)]
-      (.ellipse g
-                (map-range (entry xs i) x-range)
-                (map-range (entry ys i) y-range)
-                2 2))
+      (.ellipse g (map-range (entry xs i)) (map-range (entry ys i)) 2 2))
     (.endDraw g)
     g))


Fix json parsing for auto-deactivation of nodes during db gc

The command submission for "deactivate node" in the database
garbage collection loop was not json-serializing the node
name quite as many times as all of the other uses of that
command, so it was failing.

This commit adds in the extra JSON serialization and should
get things working again.  We might at some point want to
remove all of these seemingly redundant serializations
from all of the uses of this command, but this seemed like
the lower-impact change for the time being.

--- src/com/puppetlabs/puppetdb/cli/services.clj
+++ src/com/puppetlabs/puppetdb/cli/services.clj
@@ -54,6 +54,7 @@
             [clj-time.core :as time]
             [clojure.java.jdbc :as sql]
             [clojure.tools.logging :as log]
+            [cheshire.core :as json]
             [com.puppetlabs.puppetdb.http.server :as server])
   (:use [clojure.java.io :only [file]]
         [clojure.core.incubator :only (-?>)]
@@ -115,7 +116,7 @@
         (format "sweep of stale nodes (%s day threshold)" node-ttl-days)
         (with-transacted-connection db
           (doseq [node (scf-store/stale-nodes (time/ago (time/days node-ttl-days)))]
-            (send-command! "deactivate node" 1 node)))))
+            (send-command! "deactivate node" 1 (json/generate-string node))))))

      (sleep))))


missing template error

missing template error

--- src/proxmox/provider.clj
+++ src/proxmox/provider.clj
@@ -162,10 +162,21 @@
       (reduce (fn [r [k v]] (assoc r (ms k) v)) {} vs))
     ))

+(defn os->template
+  "Converts os key to vz template"
+  [os]
+  (let [ks [:hypervisor :proxmox :ostemplates os]]
+    (try+
+      (apply get* ks)
+      (catch [:type :celestial.common/missing-conf] e
+        (throw+ {:type :missing-template :message
+          (<< "no matching proxmox template found for ~{os}, add one to configuration under ~{ks} ")})
+        ))))

-(defn transform [res]
-  (first (map (fn [[k v]] (update-in res [k] v ))
-              {:ostemplate (fn [os] (get* :hypervisor :proxmox :ostemplates os))})))
+(defn transform
+  "manipulated the model making it proxmox ready "
+  [res]
+  (first (map (fn [[k v]] (update-in res [k] v )) {:ostemplate os->template})))

 (def selections (juxt (key-select ct-valid) (key-select extra-valid)))


bug #3300 - updated leftover sub after rebase

Signed-off-by: Andrey Shovkoplyas <b713972e59b8e606e23253c4a13e948139fea4d1@gmail.com>

--- src/status_im/ui/screens/wallet/components/views.cljs
+++ src/status_im/ui/screens/wallet/components/views.cljs
@@ -129,7 +129,7 @@
       (ethereum/normalized-address (:address contact))]]]])

 (views/defview recent-recipients []
-  (views/letsubs [contacts [:contacts-filtered :all-added-people-contacts]]
+  (views/letsubs [contacts [:all-added-people-contacts]]
     [components/simple-screen
      [components/toolbar (i18n/label :t/recipient)]
      [react/view styles/recent-recipients


CMR-1308 Removes explicit dependency on clojure.data.xml.

--- spatial-lib/project.clj
+++ spatial-lib/project.clj
@@ -32,9 +32,6 @@
                  ;; visualize spatial areas
                  [nasa-cmr/cmr-vdd-spatial-viz "0.1.0-SNAPSHOT"]

-                 ;; for encoding/decoding spatial formats
-                 [org.clojure/data.xml "0.0.8"]
-
                  ;; Added for combinations function
                  [org.clojure/math.combinatorics "0.0.8"]]


Fix action-id missing in update form.

Fix action-id missing in update form.

--- src/cljs/hatnik/web/client/form/add_action.cljs
+++ src/cljs/hatnik/web/client/form/add_action.cljs
@@ -181,6 +181,7 @@
             data-pack {:type type
                        :project-id project-id
                        :artifact-value artifact
+                       :action-id action-id
                        :gh-repo gh-repo
                        :gh-issue-title gh-issue-title
                        :gh-issue-body gh-issue-body


:subscribed-topics

:subscribed-topics

--- src/cljx/jamesmacaulay/async_tools/signals.cljx
+++ src/cljx/jamesmacaulay/async_tools/signals.cljx
@@ -42,23 +42,36 @@
   (fresh? [_] false))

 (defprotocol SignalProtocol
-  (sources [s]))
+  (sources [s])
+  (message-emitter [s]))

 (defn signal?
   [x]
   (satisfies? SignalProtocol x))

+(defn- subscribed-topics-message-emitter
+  [topics]
+  (let [topics (if (set? topics) topics (set topics))]
+    (fn [prev event]
+      (if (contains? topics (:topic event))
+        (->Fresh (:value event))
+        (->Cached (:value prev))))))
+
 (defrecord Signal
-  [init message-emitter event-emitter]
+  [init message-emitter subscribed-topics event-emitter external-event-source]
   SignalProtocol
   (sources [_]
     (into #{}
           (comp (filter identity)
                 (mapcat (comp flatten vector first))
                 (filter signal?))
-          [message-emitter event-emitter])))
-
-(defn- event-relay
+          [message-emitter event-emitter]))
+  (message-emitter [_]
+    (cond
+      message-emitter message-emitter
+      subscribed-topics [:events (subscribed-topics-message-emitter subscribed-topics)])))
+
+(defn- messages-from-events
   [topic]
   (fn [prev event]
     (if (= topic (:topic event))
@@ -69,7 +82,7 @@
   ([init] (input init (gen-topic)))
   ([init topic]
    (map->Signal {:init init
-                 :message-emitter [:events (event-relay topic)]})))
+                 :subscribed-topics #{topic}})))

 (defn constant
   [x]
@@ -127,12 +140,12 @@

 (defn async
   [source]
-  (let [topic (gen-topic)]
+  (let [topic source]
     (map->Signal {:init (:init source)
                   :event-emitter [source (fn [message]
                                            (when (fresh? message)
-                                             (->Event topic (:value message))))]
-                  :message-emitter [:events (event-relay topic)]})))
+                                             (:value message)))]
+                  :subscribed-topics #{topic}})))

 (defn mergeseq
   [sigs]
@@ -274,7 +287,7 @@

 (defn- build-message-mult
   [signal mult-map]
-  (if-let [[tmpl msg-fn] (:message-emitter signal)]
+  (if-let [[tmpl msg-fn] (message-emitter signal)]
     (let [c-in (tap-template tmpl mult-map)
           c-out (chan)]
       (spawn-message-loop! (:init signal) msg-fn c-in c-out)


Removed incorrect reference to iJava in rule30_dynamic.clj.

--- src/clojush/problems/boolean/rule30_dynamic.clj
+++ src/clojush/problems/boolean/rule30_dynamic.clj
@@ -1,7 +1,5 @@
 ;; rule30_dynamic.clj
 ;; Lee Spector, lspector@hampshire.edu
-;;
-;; Problem Source: iJava (http://ijava.cs.umass.edu/)
 ;;
 ;; Given an integer, return a boolean indicating whether the location indexed
 ;; by the integer in the output of a rule 30 cellular automation is 1.


increase benchmark iterations

increase benchmark iterations

--- scripts/benchmarks.clj
+++ scripts/benchmarks.clj
@@ -210,18 +210,18 @@
 (let [data {:x 1}
       meta-map {:my :metadata}]
   (run-benchmark "set metadata"
-    300000
+    3000000
     (with-meta data meta-map)
     (setval META meta-map data)))

 (let [data (with-meta {:x 1} {:my :metadata})]
   (run-benchmark "get metadata"
-    300000
+    30000000
     (vector (meta data))
     (select META data)))

 (let [data (with-meta {:x 1} {:my :metadata})]
   (run-benchmark "vary metadata"
-    300000
+    3000000
     (vary-meta data assoc :y 2)
     (setval [META :y] 2 data)))


tree-query/ get-tags and get-children-tags look good

--- src/com/billpiel/mem_tracer/util/tree_query.clj
+++ src/com/billpiel/mem_tracer/util/tree_query.clj
@@ -1,5 +1,6 @@
 (ns com.billpiel.mem-tracer.util.tree-query
-  (require [clojure.zip :as z]))
+  (require [clojure.zip :as z]
+           [swiss.arrows :refer [-<> -<>>]]))

 (def ^:dynamic *get-tags-mz* nil)

@@ -20,8 +21,9 @@

 (defn get-tags
   [node pred-map]
-  (for [[kw pred] pred-map :when (pred node)]
-    kw))
+  (vec (for [[kw pred] pred-map
+             :when (pred node)]
+         kw)))

 (defn get-tags'
   [node pred-map]
@@ -29,12 +31,31 @@
    node
    pred-map))

+#_ (get-tags' {:id 1} {:a #(-> % :id #{1}) :b #(-> % :id #{1})})
+
+(defn get-children-tags*
+  [zipr pred-map]
+  (let [this-tags (-> zipr
+                      z/node
+                      (get-tags' pred-map))]
+    (mapv #(into [this-tags] %)
+          (if-let [ch-zips (not-empty (children-zips zipr))]
+            (mapcat #(get-children-tags* % pred-map)
+                    ch-zips)
+            [[]]))))
+
 (defn get-children-tags
-  [zipr]
-  (let [kids (children-zips zipr)]
-    (apply concat (for [child-zip kids
-                        desc-tags (get-children-tags child-zip)]
-                    (map (fn [tag-trail] (conj tag-trail (get-tags' child-zip))))))))
+  [zipr pred-map]
+  (->> zipr
+       children-zips
+       (mapcat #(get-children-tags* % pred-map))
+       vec))
+
+#_ (ppcp (get-children-tags z1
+                            {:a #(-> % :id #{1 2 3 4}) :even #(-<> (do %)
+                                                                   :id
+                                                                   even?)}))
+

 (defn tag*
   [zipr pred-map & {:keys [parent-tags]}]
@@ -57,9 +78,35 @@

 #_ (do

+     (def tree {:id 1 :children
+                [{:id 2}
+                 {:id 3
+                  :children [{:id 5
+                              :children [{:id 6}]}]}
+                 {:id 4
+                  :children [{:id 7
+                              :children []}
+                             {:id 8
+                              :children []}
+                             ]}]})

-     (def z1 (z/zipper map? :children #(assoc % :children %2)
-                       {:a 1 :children [{:a 2} {:a 3 :children []} {:a 4}]}))
+     [[[:a :even]]
+      [[:a] [] [:even]]
+      [[:a :even] []]
+      [[:a :even] [:even]]]
+
+
+
+     (def ppcp puget.printer/cprint)
+
+     (ppcp tree)
+
+     (def z1 (z/zipper map?
+                       #(-> % :children not-empty)
+                       #(assoc % :children %2)
+                       tree))
+
+     (ppcp (z/root z1))


Fixes hook on "a" elements of description

--- src/front/ui/widgets/description_editor.cljs
+++ src/front/ui/widgets/description_editor.cljs
@@ -24,19 +24,20 @@
           (.toHTML js/markdown
                    (.-innerHTML (.get output
                                       0))))
-    (doall (for [a ($ "#description-output a")]
-             (.on ($ a)
-                  "click"
-                  (fn [e]
-                    (let [url (.attr ($ a)
-                                     "href")
-                          url (if (= -1 (.indexOf url "://"))
-                                (str "http://" url)
-                                url)]
-                      (.openExternal shell
-                                     url)
-                      (.preventDefault e)
-                      (.stopPropagation e))))))))
+    (doall (for [a ($ (str "#description-output" (:id entity) " a"))]
+             (do
+               (.on ($ a)
+                    "click"
+                    (fn [e]
+                      (let [url (.attr ($ a)
+                                       "href")
+                            url (if (= -1 (.indexOf url "://"))
+                                  (str "http://" url)
+                                  url)]
+                        (.openExternal shell
+                                       url)
+                        (.preventDefault e)
+                        (.stopPropagation e)))))))))

 (defn- add-autogrow
   [input]
@@ -57,7 +58,7 @@
                                                  (when (and (= (.-keyCode e)
                                                                9)
                                                             (.-shiftKey e))
-;;                                                    .parent().prev().find(":tabbable").first().focus()
+                                                   ;;                                                    .parent().prev().find(":tabbable").first().focus()

                                                    (-> ($ (str "#description-output" (:id entity)))
                                                        (.parent)


Not enough peers test.

Not enough peers test.

--- test/onyx/log/percentage_grouping_generative_test.clj
+++ test/onyx/log/percentage_grouping_generative_test.clj
@@ -84,6 +84,33 @@
               :onyx/doc "Writes segments to a core.async channel"}]
    :task-scheduler :onyx.task-scheduler/percentage})

+(def job-3-id #uuid "5813d2ec-c486-4428-833d-e8373910ae14")
+
+(def job-3
+  {:workflow [[:a :b] [:b :c]]
+   :catalog [{:onyx/name :a
+              :onyx/ident :core.async/read-from-chan
+              :onyx/type :input
+              :onyx/medium :core.async
+              :onyx/batch-size 20
+              :onyx/doc "Reads segments from a core.async channel"}
+
+             {:onyx/name :b
+              :onyx/fn :mock/fn
+              :onyx/type :function
+              :onyx/group-by-kw :mock-key
+              :onyx/min-peers 10
+              :onyx/flux-policy :continue
+              :onyx/batch-size 20}
+
+             {:onyx/name :c
+              :onyx/ident :core.async/write-to-chan
+              :onyx/type :output
+              :onyx/medium :core.async
+              :onyx/batch-size 20
+              :onyx/doc "Writes segments to a core.async channel"}]
+   :task-scheduler :onyx.task-scheduler/balanced})
+
 (deftest min-peers-one-job-upper-bound
   (let [rets (api/create-submit-job-entry
               job-1-id
@@ -132,3 +159,27 @@
            c3 (count (get (get (:allocations replica) job-2-id) t3))]
        (is (>= c2 4))
        (is (= 10 (+ c1 c2 c3)))))))
+
+(deftest min-peers-not-enough-peers
+  (let [rets (api/create-submit-job-entry
+              job-3-id
+              peer-config
+              job-3
+              (planning/discover-tasks (:catalog job-3) (:workflow job-3)))]
+    (checking
+     "Checking no peers are ever allocated to this job since this job needs at least
+      12 peers to run."
+     (times 50)
+     [{:keys [replica log peer-choices]}
+      (log-gen/apply-entries-gen
+       (gen/return
+        {:replica {:job-scheduler :onyx.job-scheduler/greedy
+                   :messaging {:onyx.messaging/impl :dummy-messenger}}
+         :message-id 0
+         :entries (assoc (log-gen/generate-join-queues (log-gen/generate-peer-ids 6)) :job-3 [rets])
+         :log []
+         :peer-choices []}))]
+     (let [[t1 t2 t3] (:tasks (:args rets))]
+       (is (= 0 (count (get (get (:allocations replica) job-3-id) t1))))
+       (is (= 0 (count (get (get (:allocations replica) job-3-id) t2))))
+       (is (= 0 (count (get (get (:allocations replica) job-3-id) t3))))))))


reduce difference in speed time between different piano phases

--- src/overtone/examples/compositions/piano_phase.clj
+++ src/overtone/examples/compositions/piano_phase.clj
@@ -20,4 +20,4 @@

 (do
   (player (now) 338 (take num-notes (cycle piece)))
-  (player (now) 328 (take num-notes (cycle piece))))
+  (player (now) 335 (take num-notes (cycle piece))))


make env-gen :kr by default

make env-gen :kr by default

--- src/overtone/sc/machinery/ugen/metadata/envgen.clj
+++ src/overtone/sc/machinery/ugen/metadata/envgen.clj
@@ -55,7 +55,8 @@
   Note:

 The actual minimum duration of a segment is not zero, but one sample step for audio rate and one block for control rate. This may result in asynchronicity when in two envelopes of different number of levels, the envelope times add up to the same total duration. Similarly, when modulating times, the new time is only updated at the end of the current segment - this may lead to asynchronicity of two envelopes with modulated times.
-"}
+"
+       :default-rate :kr}
                ;(let [envec (TODO turn env object into vector)]

       {:name "Linen",


fix timestamp formatting breaking on nulls

--- pedestal-app/app/src/semtag_web/partials.cljs
+++ pedestal-app/app/src/semtag_web/partials.cljs
@@ -59,7 +59,8 @@
      [:a {:href (path-to "#/type/" type)} type]])

 (defn- td-timestamp [datetime]
-  [:td.timestamp {:title (if datetime (.toISOString datetime) "")} (str (.toLocaleDateString datetime))])
+  [:td.timestamp {:title (if datetime (.toISOString datetime) "")}
+   (when datetime (str (.toLocaleDateString datetime)))])

 ;;; partials
 (defpartial default-row [row fields]


add support for containers

add support for containers

--- src/databinder/core.clj
+++ src/databinder/core.clj
@@ -47,11 +47,10 @@

 (defn uuid [] (str "urn:uuid:" (java.util.UUID/randomUUID)))

-(def db (uris "http://logangilmour.com/data-binder#" :rank :root :binds :bindo :deleter :haschild :projects :list :paragraph :text-field))
-
-
-(def functions
-  {(db :list)
+(def db (uris "http://logangilmour.com/data-binder#" :rank :root :binds :bindo  :haschild :projects))
+
+(def funcs
+  {:list
    {:resource (fn [uri binding meta vals]
                 (hic/html [:p (:title meta)]
                           [:ol.list-binding {:data-uri uri
@@ -66,9 +65,10 @@
              (hic/html [:li {:data-uri uri} val]))

     :update (fn [uri pred data]
-              {:type "create" :uri uri :predicate pred :value (uuid)})}
-
-   (db :deleter)
+              {:type "create" :uri uri :predicate pred :value (uuid)})
+    :type :relator}
+
+   :deleter
    {:resource (fn [uri binding meta vals]
                 (hic/html [:a.remove-binding
                                  {:href "#"
@@ -79,9 +79,10 @@
              val)

     :update (fn [uri pred data]
-              {:type "delete" :uri uri :predicate pred :value data})}
-
-   (db :paragraph)
+              {:type "delete" :uri uri :predicate pred :value data})
+    :type :relator}
+
+   :paragraph
    {:resource (fn [uri binding meta vals]
                 (hic/html [:p {:data-uri uri
                        :data-binding binding
@@ -89,9 +90,10 @@
                    (:title meta) ": " vals]))
     :value (fn [parent uri binding meta val]
              (hic/html val))
-    :update nil}
-
-   (db :text-field)
+    :update nil
+    :type :relator}
+
+   :text-field
    {:resource (fn [uri binding meta vals]
                 (hic/html [:label (str (:title meta) " ")
                    [:input {:type "text"
@@ -103,7 +105,16 @@
     :value (fn [parent uri binding meta val]
              (hic/html val))
     :update (fn [uri pred data]
-              {:type "update" :uri uri :predicate pred :value data})}})
+              {:type "update" :uri uri :predicate pred :value data})
+    :type :relator}
+   :h1
+   {:display (fn [meta vals]
+               (hic/html [:h1 vals]))
+    :type :container}})
+
+(def functions (apply assoc {} (flatten (map (fn [key] [(str "http://logangilmour.com/data-binder#" (name key)) (get funcs key)]) (keys funcs)))))
+
+(merge db (apply uris "http://logangilmour.com/data-binder#" (keys funcs)))

 (defn relator [statement model resource]
@@ -224,44 +235,52 @@
                                 "")))
                           (relate-right model (prop (:haschild db)) binding))

-        statement (get-bound binding model) ;; fuckery for binding
-
-        parent-func (:resource (bound-func binding model)) ;; extraneous function getting
-        child-func (:value (bound-func binding model))
-
-        relation-getter (fn [data resource] (relator statement data resource)) ;; get the function that gets the children for this node, will be used to bulid the next value of tree-builder.
+        bindable (bound-func binding model)
+
+        type (:type bindable)

         sub-calls (map (fn [child] (s-rec child model)) children) ;; make the next part of the tree
         meta-data (get-meta-data binding model)]

-    (fn [data child resource]
-
-      (let [related (if child   ;; get sub-resources (a single one if partial rendering)
-                      (seq [child])
-                      (relation-getter data resource))
-            func (if child ;; get the bound function
-                   (fn [uri bind meta vals]
-                     (let [val (first vals)]
-                       (child-func
-                        uri (:uri val) bind meta (:html val))))
-                   (fn [uri bind meta vals]
-                     (parent-func
-                      uri bind meta
-                      (map (fn [val] (child-func
-                                     uri (:uri val) bind meta (:html val))) vals))))]
-        (func (.getURI resource) ;; apply the bound function to the thing, the binding that points at the funtion, meta-data, and the finished children (should be ordered by now).
-              (.getURI binding)
-              meta-data
-              (map (fn [val] {:uri (first val) :html (second val)})
-                   (map vector
-                        (map #(.toString %) related) ;; TODO this is a little sketchy
-                        (if (empty? sub-calls)
-                          (map literalize related)
-                          (map seq (apply map vector (map (fn [sub-call]
-                                                            (map
-                                                             (partial sub-call data nil)
-                                                             related))
-                                                          sub-calls)))))))))))
+    (cond (= type :relator)
+          (let [statement (get-bound binding model) ;; fuckery for binding
+                relation-getter (fn [data resource] (relator statement data resource))
+                child-func (:value bindable)
+                parent-func (:resource bindable)] ;; extraneous function getting]
+            (fn [data child resource]
+
+              (let [related (if child   ;; get sub-resources (a single one if partial rendering)
+                              (seq [child])
+                              (relation-getter data resource))
+                    func (if child ;; get the bound function
+                           (fn [uri bind meta vals]
+                             (let [val (first vals)]
+                               (child-func
+                                uri (:uri val) bind meta (:html val))))
+                           (fn [uri bind meta vals]
+                             (parent-func
+                              uri bind meta
+                              (map (fn [val] (child-func
+                                             uri (:uri val) bind meta (:html val))) vals))))]
+                (func (.getURI resource) ;; apply the bound function to the thing, the binding that points at the funtion, meta-data, and the finished children (should be ordered by now).
+                      (.getURI binding)
+                      meta-data
+                      (map (fn [val] {:uri (first val) :html (second val)})
+                           (map vector
+                                (map #(.toString %) related) ;; TODO this is a little sketchy
+                                (if (empty? sub-calls)
+                                  (map literalize related)
+                                  (map seq (apply map vector (map (fn [sub-call]
+                                                                    (map
+                                                                     (partial sub-call data nil)
+                                                                     related))
+                                                                  sub-calls))))))))))
+          (= type :container)
+          (fn [data child resource]
+            (let [func (:display bindable)]
+              (func
+                  meta-data
+                  (map (fn [sub-call] (sub-call data nil resource)) sub-calls)))))))

 (defn select [model subject predicate object]
   (iterator-seq (.listStatements (new SimpleSelector subject predicate object))))
@@ -414,12 +433,18 @@
                dc:title \"List of People\" ;
                dc:description \"A list of people contained within the application\" .

-ex:person-list data:haschild ex:person-name , ex:person-age , ex:pets-list ,  ex:person-deleter .
+ex:person-list data:haschild ex:person-name-container , ex:person-age , ex:pets-list ,  ex:person-deleter .

 ex:person-deleter rdf:type data:deleter ;
                   data:bindo rdf:type ;
                   dc:title \"Remove\" ;
                   dc:description \"Permanently delete a person from the database\" .
+
+ex:person-name-container
+  data:haschild ex:person-name ;
+  dc:title \"thing\" ;
+  dc:description \"stuff\" ;
+  rdf:type data:h1 .

 ex:person-name rdf:type data:text-field ;
                data:rank 5 ;


A noble spirit embiggens the smallest man.

--- src/demo/scheduling.clj
+++ src/demo/scheduling.clj
@@ -78,10 +78,10 @@
   (when (util/in-container?)

     ;; singleton jobs require an id
-    (sch/schedule #(println "I run on one node")
+    (sch/schedule #(println "I run on ONE node")
       (-> every-5s
         (sch/id :a_singleton)))

-    (sch/schedule #(println "I run on every node")
+    (sch/schedule #(println "I run on EVERY node")
       (-> every-5s
         (sch/singleton false)))))


adding deps

adding deps

--- resources/leiningen/new/closp/project.clj
+++ resources/leiningen/new/closp/project.clj
@@ -18,7 +18,11 @@
                  [lib-noir "0.9.9"]
                  [ring/ring-anti-forgery "1.1.0"]
                  [compojure "1.6.0"]
+
                  [reagent "0.7.0"]
+                 [re-frame "0.10.5"]
+                 [secretary "1.2.3"]
+
                  [org.immutant/web "2.1.9"]
                  [hiccup "1.0.5"]
                  [prone "1.1.4"]


fixed parinfer

fixed parinfer

--- main/src/dda/pallet/dda_backup_crate/domain.clj
+++ main/src/dda/pallet/dda_backup_crate/domain.clj
@@ -74,15 +74,15 @@
 (def TransportManagement
   {(s/optional-key :ssh-pull) s/Any
    (s/optional-key :duplicity-push)
-                              {:public-key                 secret/Secret
-                               :private-key                secret/Secret
-                               :passphrase                 secret/Secret
-                               :root-password              (s/either {:hashed-password secret/Secret}
-                                                                     {:clear-password secret/Secret})
-                               (s/optional-key :target-s3) {:aws-access-key-id               secret/Secret
-                                                            :aws-secret-access-key           secret/Secret
-                                                            :bucket-name                     s/Str
-                                                            (s/optional-key :directory-name) s/Str}}})
+   {:public-key                 secret/Secret
+    :private-key                secret/Secret
+    :passphrase                 secret/Secret
+    :root-password              (s/either {:hashed-password secret/Secret}
+                                          {:clear-password secret/Secret})
+    (s/optional-key :target-s3) {:aws-access-key-id               secret/Secret
+                                 :aws-secret-access-key           secret/Secret
+                                 :bucket-name                     s/Str
+                                 (s/optional-key :directory-name) s/Str}}})

 (def BackupConfig
   {:backup-name                           s/Str
@@ -107,7 +107,7 @@
   (clojure.string/upper-case (pgp/hex-id (pgp/decode-public-key ascii-armored-key))))

 (s/defn ^:always-validate
-user-domain-configuration
+ user-domain-configuration
   [config :- BackupConfigResolved]
   (let [{:keys [backup-user transport-management]} config
         duplicity-push (get-in transport-management [:duplicity-push])
@@ -129,7 +129,7 @@
       {:dda-backup backup-user})))

 (s/defn ^:always-validate
-infra-backup-element :- infra-schema/BackupElement
+ infra-backup-element :- infra-schema/BackupElement
   [backup-element :- BackupElementResolved]
   (let [{:keys [name type]} backup-element]
     (-> backup-element
@@ -167,7 +167,7 @@

 (s/defn ^:always-validate
-infra-configuration :- InfraResult
+ infra-configuration :- InfraResult
   [config :- BackupConfigResolved]
   (let [{} config]
     {infra/facility (infra-config config)}))


Allow read-eval for Java interop.

Allow read-eval for Java interop.

--- src/dsbdp/DslHelper.clj
+++ src/dsbdp/DslHelper.clj
@@ -16,6 +16,6 @@

 (defn -generateProcessingFn [dsl-expression]
   (if (string? dsl-expression)
-    (create-proc-fn (binding [*read-eval* false] (read-string dsl-expression)))
+    (create-proc-fn (binding [*read-eval* true] (read-string dsl-expression)))
     (create-proc-fn dsl-expression)))


figwheel.main: helper listen to disconnect event, move everything inside app

--- figwheel-main/src/figwheel/main/helper.cljc
+++ figwheel-main/src/figwheel/main/helper.cljc
@@ -25,6 +25,9 @@

 (defn connected-signal []
   (add-class (gdom/getElement "connect-status") "connected"))
+
+(defn on-disconnect []
+  (remove-class (gdom/getElement "connect-status") "connected"))

 ;; TODO memoize this into an atom
 ;; could probably meoize all the pages into an atom
@@ -69,8 +72,11 @@
   (connected-signal))

 (defonce initialize
-  (.addEventListener js/document.body "figwheel.repl.connected"
-                     on-connect))
+  (do
+    (.addEventListener js/document.body "figwheel.repl.connected"
+                       on-connect)
+    (.addEventListener js/document.body "figwheel.repl.disconnected"
+                       on-disconnect)))

 ))
@@ -83,11 +89,11 @@
          "<!DOCTYPE html>

-    <link href=\"com/bhauman/figwheel/helper/css/style.css\" rel=\"stylesheet\" type=\"text/css\">
-    <link href=\"com/bhauman/figwheel/helper/css/coderay.css\" rel=\"stylesheet\" type=\"text/css\">

+      <link href=\"com/bhauman/figwheel/helper/css/style.css\" rel=\"stylesheet\" type=\"text/css\">
+      <link href=\"com/bhauman/figwheel/helper/css/coderay.css\" rel=\"stylesheet\" type=\"text/css\">

@@ -105,9 +111,9 @@

         %s

-

+

+    %s

-    %s

 "


Remove evalive

Remove evalive

--- link/.lein/src/user.clj
+++ link/.lein/src/user.clj
@@ -1,10 +1,7 @@
 (ns user
   (:require [clojure.pprint]
             [clojure.tools.namespace.repl]
-            [clojure.tools.trace]
-            [evalive.core]))
-
-(def pprint #'clojure.pprint/pprint)
+            [clojure.tools.trace]))

 (def refresh-all #'clojure.tools.namespace.repl/refresh-all)


Provide defaults for cli type parser where possible

- This is only really useful in combination with split optargs, because
  the optarg could possibly not contain the splitting char, so the
  second part would be nil. This provides default values for that case.

--- boot/core/src/boot/cli.clj
+++ boot/core/src/boot/cli.clj
@@ -17,14 +17,14 @@
   (case type
     int   read-string
     float read-string
-    str   identity
+    str   (fnil identity "")
     kw    keyword
     sym   symbol
     char  first
     bool  identity
-    edn   read-string
-    regex re-pattern
-    code  (comp eval read-string)))
+    edn   (fnil read-string "nil")
+    regex (fnil re-pattern "")
+    code  (fnil (comp eval read-string) "nil")))

 (defn- assert-atom [type]
   (case type


better reading flow, less confusing wording

--- src/pc/views/blog/product_hunt_wake_up_call.clj
+++ src/pc/views/blog/product_hunt_wake_up_call.clj
@@ -37,7 +37,7 @@
          If you want to show your prototypes to a teammate, just send them a link; you'll instantly be able to collaborate in real-time.
          There's no jumping through hoops just to share your idea."]
      [:p "Daniel and I have both worked with a lot of remote developers and we find it difficult to share rough ideas quickly with teammates.
-         We researched many prototyping tools but we couldn't find one that met our expectations in terms of simple, efficient collaboration.
+         We researched many prototyping tools but we couldn't find any that met our expectations in terms of simplicity and efficient collaboration.
          Everything was overly complex and made impromptu teamwork a chore.
          Rather than settling, we decided to scratch our own itch."]
      [:p "Our goal was to express our ideas fast while simultaneously making them dead simple to share.


volumes validations

volumes validations

--- src/aws/validations.clj
+++ src/aws/validations.clj
@@ -21,11 +21,19 @@
      :user #{:required :String} :os #{:required :Keyword}
   }})

+
+(validation :volume {
+    :device #{:required :String} :size #{:required :Integer}
+    :clear #{:require :Boolean}
+   })
+
+(validation :volume* (every-v #{:volume}))
+
 (def aws-entity
   {:aws {
      :instance-type #{:required :String} :key-name #{:required :String}
-     :endpoint #{:required :String}}
-   })
+     :endpoint #{:required :String} :volumes #{:volume*}
+    }})

 (defn validate-entity


s/info/debug/

s/info/debug/

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -41,8 +41,8 @@
   (let [language-model (if (future? language-model) @language-model language-model)
         lexicon (if lexicon lexicon (:lexicon language-model))
         morph (:morph language-model)]
-    (log/info (str "generate: generating from spec: "
-                   (strip-refs spec) " with max-total-depth: " max-total-depth ";truncate: " truncate-children))
+    (log/debug (str "generate: generating from spec: "
+                    (strip-refs spec) " with max-total-depth: " max-total-depth ";truncate: " truncate-children))
     (let [expression (first (take 1 (generate-all spec language-model 0
                                                   :max-total-depth max-total-depth
                                                   :truncate-children truncate-children)))]


fix server namespace imports

fix server namespace imports

--- src/greybear/server.clj
+++ src/greybear/server.clj
@@ -1,9 +1,9 @@
 (ns greybear.server
-  (:import org.mindrot.jbcrypt.BCrypt)
   (:require [compojure.route :as route]
             [compojure.handler :as handler])
   (:use [ring.middleware.session :only [wrap-session]]
-        [hiccup core element page]
+        [ring.util.response :only [redirect-after-post]]
+        [hiccup core element page form]
         [hiccup.middleware :only [wrap-base-url]]
         [compojure.core :only [defroutes GET POST]]
         [cemerick.friend.credentials :only [hash-bcrypt bcrypt-verify]]


don't tap solo if no solo

don't tap solo if no solo

--- src/bones/editable.cljs
+++ src/bones/editable.cljs
@@ -20,6 +20,12 @@

 (defn dispatch [eventv]
   (re-frame/dispatch eventv))
+
+(defn dispatch-sync [eventv]
+  (re-frame/dispatch-sync eventv))
+
+(defn subscribe [eventv]
+  (re-frame/subscribe eventv))

 (comment
 ;; start editable
@@ -85,7 +91,6 @@
                         (update-in things [id :inputs] merge args)
                         "delete"
                         (dissoc things id)))
-      ;; (go (<! (a/timeout 10)))
       (dispatch [:response/command
                  ;; args in the response means update the editable thing's inputs
                  {:args (:inputs thing)
@@ -97,6 +102,32 @@
     (let [{:keys [form-type]} args
           things (local-get-item prefix form-type)]
       (dispatch [:response/query {:results things} 200 tap]))))
+
+
+;; helpers
+(defn editable-reset [etype identifier inputs]
+  [:editable
+   [:editable etype identifier :inputs inputs]
+   [:editable etype identifier :errors {}]
+   [:editable etype identifier :state {}]])
+
+(defn editable-error [etype identifier error]
+  [:editable
+   [:editable etype identifier :errors error]
+   [:editable etype identifier :state {}]])
+
+(defn editable-response
+  ([etype identifier response]
+   (editable-response etype identifier response {}))
+  ([etype identifier response inputs]
+   (conj (editable-reset etype identifier inputs)
+         [:editable etype identifier :response response])))
+
+(defn editable-transform
+  "transforms an event vector that will update the db"
+  [evec & attrs]
+  (let [[channel form-type identifier] evec]
+    (into [:editable form-type identifier] attrs)))

 ;; forms
@@ -173,37 +204,11 @@

      :save (partial save-fn [form-type identifier])
      :delete #(dispatch [:request/command (calculate-command form-type :delete) {:id identifier}])
-     :reset  #(dispatch (e/editable-reset :todos identifier (state :reset)))
+     :reset  #(dispatch (editable-reset :todos identifier (state :reset)))
      :edit   #(dispatch [:editable
                          [:editable :todos identifier :state :reset (inputs)]
                          [:editable :todos identifier :state :editing true]])
      }))
-
-
-;; helpers
-(defn editable-reset [etype identifier inputs]
-  [:editable
-   [:editable etype identifier :inputs inputs]
-   [:editable etype identifier :errors {}]
-   [:editable etype identifier :state {}]])
-
-(defn editable-error [etype identifier error]
-  [:editable
-   [:editable etype identifier :errors error]
-   [:editable etype identifier :state {}]])
-
-(defn editable-response
-  ([etype identifier response]
-   (editable-response etype identifier response {}))
-  ([etype identifier response inputs]
-   (conj (editable-reset etype identifier inputs)
-         [:editable etype identifier :response response])))
-
-(defn editable-transform
-  "transforms an event vector that will update the db"
-  [evec & attrs]
-  (let [[channel form-type identifier] evec]
-    (into [:editable form-type identifier] attrs)))

 (defn editable-update
   "update the editable thing in the db,
@@ -309,7 +314,7 @@
           ;; update the thing in the db
           more-tap (merge tap
                           {:form-type form-type :identifier identifier}
-                          {:solo solo})
+                          (if solo {:solo solo}))
           ;; this is the specification for the editable thing:
           {:keys [spec outgoing-spec]
            :or {outgoing-spec spec}


fix:  change amount-input field type to decimal-pad + words

--- src/status_im/ui/screens/wallet/send/views.cljs
+++ src/status_im/ui/screens/wallet/send/views.cljs
@@ -104,7 +104,7 @@
          {:style               {:font-size (if small-screen? 24 38)
                                 :color (if amount-error colors/red colors/black)
                                 :flex-shrink 1}
-          :keyboard-type       :numeric
+          :keyboard-type       :decimal-pad
           :accessibility-label :amount-input
           :default-value       amount-text
           :editable            (not request?)
@@ -163,7 +163,7 @@
          {:style               {:font-size (if small-screen? 24 38)
                                 :color (when amount-error colors/red)
                                 :flex-shrink 1}
-          :keyboard-type       :numeric
+          :keyboard-type       :decimal-pad
           :accessibility-label :amount-input
           :default-value       amount-text
           :auto-focus          true


Fixed bug concerning deployment

Fixed bug concerning deployment

--- src/hummingcat/core.clj
+++ src/hummingcat/core.clj
@@ -263,10 +263,10 @@
           (run-server (wrap-app handler settings) new_options)))))

-(def-handler handle [request]
-  (get "/\\d+" (first (:url-params request)))
-  (get "/hi" "HELLO WORLD"))
-
-(defn -main [& args]
-  (run handle {:port 8000}))
-
+; (def-handler handle [request]
+;   (get "/\\d+" (first (:url-params request)))
+;   (get "/hi" "HELLO WORLD"))
+;
+; (defn -main [& args]
+;   (run handle {:port 8000}))
+;


Testing lane-pump close more.

Testing lane-pump close more.

--- src/cbfg/lane-test.cljs
+++ src/cbfg/lane-test.cljs
@@ -13,9 +13,10 @@
   (let [lane-in-ch (achan actx)]
     (ago-loop lane-echo actx
               [num-msgs 0]
-              (when-let [m (atake lane-echo lane-in-ch)]
-                (aput lane-echo lane-out-ch [lane-name num-msgs m])
-                (recur (inc num-msgs))))
+              (if-let [m (atake lane-echo lane-in-ch)]
+                (do (aput lane-echo lane-out-ch [lane-name num-msgs m])
+                    (recur (inc num-msgs)))
+                (aput lane-echo lane-out-ch :done)))
     lane-in-ch))

 (defn test-lane-pump [actx]
@@ -64,16 +65,31 @@
                          (atake tlp out-ch)
                          {:lane :a :op :close-lane :status :ok}
                          nil))
+                  (e n
+                     (atake tlp out-ch) ; For lane :a.
+                     :done
+                     nil)
                   (do (aput tlp in-ch {:lane :a :x 1000})
                       (e n
                          (atake tlp out-ch)
                          [:a 0 {:lane :a :x 1000}]
                          nil))
                   (do (aclose tlp in-ch)
-                      (aclose tlp out-ch)
-                      true))
+                      true)
+                  (e n
+                     (atake tlp out-ch) ; For lane :a.
+                     :done
+                     nil)
+                  (e n
+                     (atake tlp out-ch) ; For lane :b.
+                     :done
+                     nil)
+                  (e n
+                     (atake tlp out-ch) ; For lane nil.
+                     :done
+                     nil))
            "pass"
-           (str "FAIL: on test-grouper #" @n)))))
+           (str "FAIL: on test-lane #" @n)))))

 (defn test [actx opaque]
   (ago test actx


Don't need vis param for render-net-html.

--- src/cbfg/world/net.cljs
+++ src/cbfg/world/net.cljs
@@ -92,7 +92,7 @@
               true
               (conj out (render-msg curr-msg "msg-enter" "")))))))

-(defn render-net-html [vis net-state prev-addrs]
+(defn render-net-html [net-state prev-addrs]
   (let [addrs (atom {})
         coords (atom {})] ; Index positions.
     (doseq [[[addr port] accept-chs] (:listens net-state)]
@@ -204,7 +204,7 @@
   (let [net-state (:loop-state (second (first (filter (fn [[actx actx-info]]
                                                         (= (last actx) net-actx-id))
                                                       (:actxs vis)))))
-        [addrs h] (render-net-html vis net-state @prev-addrs)]
+        [addrs h] (render-net-html net-state @prev-addrs)]
     (when (not= @prev-addrs addrs)
       (reset! prev-addrs addrs)
       (set-el-innerHTML output-el-id (apply str (flatten h))))))


Sort :require forms

Sort :require forms

--- src/adzerk/boot_cljs.clj
+++ src/adzerk/boot_cljs.clj
@@ -1,16 +1,15 @@
 (ns adzerk.boot-cljs
   {:boot/export-tasks true}
   (:refer-clojure :exclude [compile])
-  (:require [clojure.java.io             :as io]
-            [clojure.pprint              :as pp]
-            [clojure.string              :as string]
-            [boot.pod                    :as pod]
-            [boot.core                   :as core]
-            [boot.file                   :as file]
-            [boot.util                   :refer [info dbug warn]]
-            [adzerk.boot-cljs.util       :as util]
+  (:require [adzerk.boot-cljs.js-deps :as deps]
             [adzerk.boot-cljs.middleware :as wrap]
-            [adzerk.boot-cljs.js-deps    :as deps]))
+            [adzerk.boot-cljs.util :as util]
+            [boot.core :as core]
+            [boot.pod :as pod]
+            [boot.util :refer [dbug info warn]]
+            [clojure.java.io :as io]
+            [clojure.pprint :as pp]
+            [clojure.string :as string]))

 (def ^:private QUALIFIERS
   "Order map for well-known Clojure version qualifiers."


Add (new) support for submodules

Add (new) support for submodules

--- src/cider_ci/ex/git.clj
+++ src/cider_ci/ex/git.clj
@@ -108,11 +108,19 @@
 (defn- clone-to-dir [repository-path commit-id dir]
   (system/exec-with-success-or-throw
     ["git" "clone" "--shared" repository-path dir]
-    {:watchdog (* 5 1000)})
+    {:watchdog (* 60 1000)})
   (system/exec-with-success-or-throw
     ["git" "checkout" commit-id]
     {:dir dir})
   true)
+
+(defn- clone-submodules [working-dir options]
+  (let [timeout (or (:timeout options) 200)]
+    (system/exec-with-success-or-throw
+      ["git" "submodule" "update" "--init" "--recursive"]
+      {:dir working-dir
+       :watchdog (* timeout 1000)
+       })))

 (defn prepare-and-create-working-dir [params]
   (let [working-dir-id (:trial_id params)]
@@ -123,6 +131,8 @@
                             (:git_url params) (:repository_id params) (:git_commit_id params))
           working-dir (str (:working_dir @conf) (File/separator) working-dir-id)]
       (clone-to-dir repository-path (:git_commit_id params) working-dir)
+      (when (-> params :git_options :submodules :clone)
+        (clone-submodules working-dir (or (-> params :git_options :submodules) {})))
       (when-let [user (:user (:sudo @conf))]
         (system/exec-with-success-or-throw ["chown" "-R" user working-dir]))
       working-dir)))