:sparkles: Changes to selection

:sparkles: Changes to selection

--- frontend/src/uxbox/main/ui/workspace/selection.cljs
+++ frontend/src/uxbox/main/ui/workspace/selection.cljs
@@ -38,7 +38,7 @@
     :on-mouse-down on-click
     :r r
     :style {:fillOpacity "1"
-            :strokeWidth "2px"
+            :strokeWidth "1px"
             :vectorEffect "non-scaling-stroke"}
     :fill "#ffffff"
     :stroke "#1FDEA7"
@@ -71,7 +71,7 @@
 (mf/defc controls
   [{:keys [shape zoom on-resize on-rotate] :as props}]
   (let [{:keys [x y width height rotation] :as shape} (geom/shape->rect-shape shape)
-        radius (if (> (max width height) handler-size-threshold) 6.0 4.0)
+        radius (if (> (max width height) handler-size-threshold) 4.0 4.0)
         transform (geom/transform-matrix shape)

         resize-handlers {:top          [(+ x (/ width 2 )) y]
@@ -88,7 +88,7 @@
                   :x x :y y
                   :width width
                   :height height
-                  :stroke-dasharray (str (/ 8.0 zoom) "," (/ 5 zoom))
+                  ;;:stroke-dasharray (str (/ 8.0 zoom) "," (/ 5 zoom))
                   :vector-effect "non-scaling-stroke"
                   :style {:stroke "#1FDEA7"
                           :fill "transparent"


Some updates for react 11.1

Some updates for react 11.1

--- src/show/core.cljs
+++ src/show/core.cljs
@@ -119,10 +119,12 @@
   (js/React.renderComponent component dom))

 (defn- local-method [component name]
-  (name (.. component -props -lifecycle_methods)))
+  (when-let [props (.. component -__show_base)]
+    (name (.-lifecycle_methods props))))

 (defn- local-mixins [component name]
-  (map name (filter name (.. component -props -mixins))))
+  (when-let [props (.. component -__show_base)]
+    (map name (filter name (.-mixins props)))))

 (defn- execute-mixin-methods [component name & props]
   (let [mixins (local-mixins component name)]
@@ -150,13 +152,14 @@

    :getDefaultProps
    (fn [] (this-as this
-     (let [props         (execute-local-method  this :default-props)
-           mixin-props   (into {} (apply merge (execute-mixin-methods this :default-props)))
+     (let [this-proto    (.-prototype this) ; Must use prototype since component is not loaded yet
+           props         (execute-local-method this-proto :default-props)
+           mixin-props   (into {} (apply merge (execute-mixin-methods this-proto :default-props)))
            default-props (merge mixin-props props)]
        ;; React will only merge prop data on the root level, and since there is
        ;; already a __show property, it does not merge new props. This is why
        ;; we dont rely on React for this merge
-       (set! (.. this -__show_default_props) default-props))
+       (set! (.. this-proto -__show_default_props) default-props))
      nil))

    :componentWillMount
@@ -216,16 +219,16 @@
      (execute-local-method  this :will-unmount)))})

 (defn ^:private build-component [name lifecycle mixins]
-  (let [lifecycle-methods (assoc base-lifecycle-methods :displayName name)
+  (let [mixins            (map #(.. % -lifecycle_methods) mixins)
+        lifecycle-methods (assoc base-lifecycle-methods
+                                 :displayName name
+                                 :__show_base #js {:lifecycle_methods lifecycle
+                                                   :mixins mixins})
+
         component-class   (js/React.createClass (clj->js lifecycle-methods))
-        mixins            (map #(.. (%) -props -lifecycle_methods) mixins)]
-    (let [ret-fn (fn [props]
-                   (component-class #js {:key    (get props :key)
-                                         :__show (dissoc props :key)
-                                         :lifecycle_methods lifecycle
-                                         :mixins mixins}))]
-      ;; React rejects nested children components if they return with
-      ;; a different type than the default createClass type
-      ;; https://github.com/facebook/react/blob/master/src/core/shouldUpdateReactComponent.js#L36
-      (set! (.-constructor ret-fn) (goog/getUid component-class))
-      ret-fn)))
+        ret-fn            #(component-class #js {:key    (get % :key)
+                                                 :__show (dissoc % :key)})]
+
+    ;; Inject lifecycle methods into the fn just for mixin loading
+    (set! (.-lifecycle_methods ret-fn) lifecycle)
+    ret-fn))


Update the autotest option documentation

--- src/speclj/cli.clj
+++ src/speclj/cli.clj
@@ -14,7 +14,7 @@
 (def arg-spec (Arguments.))
 (doto arg-spec
   (.addMultiParameter "specs" "directories/files specifying which specs to run.")
-  (.addSwitchOption "a" "autotest" "Alias to use the 'vigilant' runner and 'specdoc' reporter.")
+  (.addSwitchOption "a" "autotest" "Alias to use the 'vigilant' runner and 'documentation' reporter.")
   (.addSwitchOption "b" "stacktrace" "Output full stacktrace")
   (.addSwitchOption "c" "color" "Show colored (red/green) output.")
   (.addSwitchOption "C" "no-color" "Disable colored output (helpful for writing to file).")


Remplacé idiome (is ...) par (are ...) dans tests

--- into-clojure/session-3/test/session_3/core_test.clj
+++ into-clojure/session-3/test/session_3/core_test.clj
@@ -4,13 +4,13 @@

 (deftest fibo-test
   (testing "the first numbers of the Fibonnacci suite"
-    (is (= 0 (fibo 0)))
-    (is (= 1 (fibo 1)))
-    (is (= 1 (fibo 2)))
-    (is (= 2 (fibo 3)))
-    (is (= 3 (fibo 4)))
-    (is (= 5 (fibo 5)))
-    (is (= 8 (fibo 6)))))
+    (are [exp val] (= exp (fibo val))
+        1 1
+        1 2
+        2 3
+        3 4
+        5 5
+        8 6)))

 (deftest fibo-suite-test
   (testing "the first 11 numbers of the Fibonnacci suite"


fix elephantdb-cascalog project.clj

fix elephantdb-cascalog project.clj

--- elephantdb-cascalog/project.clj
+++ elephantdb-cascalog/project.clj
@@ -12,10 +12,10 @@
   :jvm-opts ["-server" "-Xmx768m"]
   :exclusions [org.clojure/clojure]
   :dependencies [[elephantdb/elephantdb-cascading ~VERSION]]
-  :profiles {:provided {:dependencies [[cascalog/cascalog-core "1.10.2"]]}
+  :profiles {:provided {:dependencies [[org.clojure/clojure "1.5.1"]
+                                       [cascalog/cascalog-core "1.10.2"]]}
              :dev {:dependencies
-                   [[org.clojure/clojure "1.5.1"]
-                    [midje "1.5.1"]
+                   [[midje "1.5.1"]
                     [elephantdb/elephantdb-bdb ~VERSION]
                     [org.apache.hadoop/hadoop-core "0.20.2"]
                     [cascalog/midje-cascalog "1.10.2"]]


No longer store Bookie server data by tenancy-id

--- src/onyx/state/bookkeeper.clj
+++ src/onyx/state/bookkeeper.clj
@@ -32,8 +32,7 @@
   component/Lifecycle
   (start [component]
     (try
-      (let [onyx-id (:onyx/tenancy-id env-config)
-            ledgers-root-path (arg-or-default :onyx.bookkeeper/zk-ledgers-root-path env-config)
+      (let [ledgers-root-path (arg-or-default :onyx.bookkeeper/zk-ledgers-root-path env-config)
             ledgers-available-path (str ledgers-root-path "/available")
             _ (zk/create (:conn log) ledgers-root-path :persistent? true)
             _ (zk/create (:conn log) ledgers-available-path :persistent? true)
@@ -43,7 +42,7 @@
             allow-loopback? (boolean (arg-or-default :onyx.bookkeeper/local-quorum? env-config))
             disk-usage-threshold (arg-or-default :onyx.bookkeeper/disk-usage-threshold env-config)
             disk-usage-warn-threshold (arg-or-default :onyx.bookkeeper/disk-usage-warn-threshold env-config)
-            server-id (str onyx-id "_" port)
+            server-id (str port)
             journal-dir (str base-journal-dir "/" server-id)
             ledger-dir (str base-ledger-dir "/" server-id)
             server-conf (doto (ServerConfiguration.)


update docstring to reflect new param names

--- src/overtone/helpers/file.clj
+++ src/overtone/helpers/file.clj
@@ -185,14 +185,14 @@
       (.toString out))))

 (defn download-file
-  "Downloads the file pointed to by URI to local path target-path. If no timeout
+  "Downloads the file pointed to by url to local path. If no timeout
   is specified will use blocking io to transfer data. If timeout is specified,
   transfer will block for at most timeout ms before throwing a
   java.net.SocketTimeoutException if data transfer has stalled.

-  It's also possible to specify num-retries to determine how many attempts to
-  make to download the file and also the time-between-retries in ms (defaults to
-  5000 ms)"
+  It's also possible to specify n-retries to determine how many attempts to
+  make to download the file and also the wait-t between attempts in ms (defaults
+  to 5000 ms)"
   ([url path]                          (download-file-without-timeout url path))
   ([url path timeout]                  (download-file-with-timeout url path timeout))
   ([url path timeout n-retries]        (download-file url path timeout n-retries 5000))


TwitterClient: latest version of systems-toolbox

--- Clojure-Websockets/TwitterClient/project.clj
+++ Clojure-Websockets/TwitterClient/project.clj
@@ -9,7 +9,7 @@
                  [clojurewerkz/elastisch "2.2.0-beta2"]
                  [org.clojure/tools.logging "0.3.1"]
                  [com.matthiasnehlsen/inspect "0.1.12"]
-                 [matthiasn/systems-toolbox "0.1.21-SNAPSHOT"]
+                 [matthiasn/systems-toolbox "0.1.23-SNAPSHOT"]
                  [ch.qos.logback/logback-classic "1.1.2"]
                  [org.clojure/core.match "0.3.0-alpha4"]
                  [clj-time "0.9.0"]


Add filename

Add filename

--- bb.clj
+++ bb.clj
@@ -7,7 +7,7 @@
 ;; /some/chrome-binary --remote-debugging-port=9222 --headless &
 ;;
 ;; Run with:
-;; $ bb --classpath $(cat .classpath)
+;; $ bb --classpath $(cat .classpath) bb.clj

 (require '[clj-chrome-devtools.core :as core]
          '[clj-chrome-devtools.automation :as auto])


Changed status code for recognizing. 202 means 'Accepted'.

--- web/src/sound_effector/controllers/auth/facebook_with_friend.clj
+++ web/src/sound_effector/controllers/auth/facebook_with_friend.clj
@@ -136,7 +136,7 @@
               (friend/merge-authentication authentication)))
           (->
             (response (json/write-str {:message "Will you join us?" :creating-user (assoc facebook-user-info :provider-id provider-id)}))
-            (status 200)
+            (status 202)
             (content-type "application/json")
             (header "Pragma" "no-cache")
             (header "X-CSRF-Token" *anti-forgery-token*)


reduces test-s3-logs flakiness by allowing more time for second instance to become healthy (#1134)

An unrelated test flaked in Travis. Merging anyway.

--- waiter/integration/waiter/kubernetes_scheduler_integration_test.clj
+++ waiter/integration/waiter/kubernetes_scheduler_integration_test.clj
@@ -122,15 +122,17 @@

             ;; Get a service with at least one killed instance.
             (log/info "starting parallel requests")
-            (let [async-create-headers (merge headers {:x-kitchen-delay-ms 120000
-                                                       :x-waiter-async-request-timeout 125000})
+            ;; expect that second instance should be healthy inside 10 minutes
+            (let [async-create-headers (merge headers {:x-kitchen-delay-ms 600000
+                                                       :x-waiter-async-request-timeout 615000})
                   async-request-fn (fn [] (->> #(make-kitchen-request waiter-url % :method :get :path "/async/request")
                                                (make-request-with-debug-info async-create-headers)))
                   async-responses (->> async-request-fn (repeatedly 2) vec)
                   instance-ids (->> async-responses (map :instance-id) set)]
               (assert-response-status (first async-responses) http-202-accepted)
               (assert-response-status (second async-responses) http-202-accepted)
-              (is (> (count instance-ids) 1) (str instance-ids))
+              (is (> (count instance-ids) 1)
+                  (str "async requests not handled by separate instances, instance id: " instance-ids))
               ;; Canceling both of the async requests should scale down to 1 by killing 1 instance.
               (doseq [async-response async-responses]
                 (let [status-endpoint (response->location async-response)


refactored find-prices

refactored find-prices

--- src-cljs/complico/prices.cljs
+++ src-cljs/complico/prices.cljs
@@ -14,7 +14,7 @@
     (str (* num 2) " / 2")))

 (defn find-prices [text]
-  (re-seq #"£(\d+\.?\d*)" text))
+  (re-seq #"£(.*)$" text))

 (defn convert-price [price]
   "£XXX")


Revert "Revert "Fix inaccurate default-template-properties.""

This reverts commit f371e005383fa19e6326bf9f6897afbc42b6c7a8.

--- frontend/models/plan.cljs
+++ frontend/models/plan.cljs
@@ -5,11 +5,9 @@
             [cljs-time.format :as time-format]))

 ;; The template tells how to price the plan
-;; TODO: fix this to work from the backend db; how? Failing that, must
-;; update this code when we change the definition of p18
-(def default-template-properties {:price 19 :container_cost 50 :id
-                                  "p18" :max_containers 1000 :free_containers 1})
-;(def default-template-properties {:price 0 :container_cost 50 :id "p18" :max_containers 1000 :free_containers 0})
+;; TODO: fix this to work from the backend db; how?
+(def default-template-properties {:price 0 :container_cost 50 :id
+                                  "p18" :max_containers 1000 :free_containers 0})

 (defn max-parallelism
   "Maximum parallelism that the plan allows (usually 16x)"


Remove whitespace.

Remove whitespace.

--- src/isla/cli.clj
+++ src/isla/cli.clj
@@ -64,4 +64,3 @@
 ;;   ;; (run-story first-story)

 ;;   (flush)) ;; empty return to stop last thing executed from being printed to console
-


Spec out git-branch ns.

Spec out git-branch ns.

--- spec/incise/deploy/workflows/git_branch_spec.clj
+++ spec/incise/deploy/workflows/git_branch_spec.clj
@@ -2,8 +2,9 @@
   (:require [stefon.util :refer [temp-dir]]
             [speclj.core :refer :all]
             (clojure.java [io :refer [file]]
-                         [shell :refer [with-sh-dir]])
-            [clj-jgit [porcelain :refer :all :exclude [with-repo]]]
+                          [shell :refer [with-sh-dir sh]])
+            [clj-jgit [porcelain :refer :all :exclude [with-repo git-push]]]
+            [incise.config :as conf]
             [incise.deploy.workflows.git-branch :refer :all])
   (:import [org.eclipse.jgit.api Git]))

@@ -63,4 +64,77 @@
   (it "adds files"
     (should-not-throw (add-files @files))))

+(defn- file-exists? [file-like]
+  (.exists (file *work-dir* file-like)))
+
+(describe "branch-exists?"
+  (with-all branch-name "a-branch-name")
+  (with repo-dir (create-dummy-repo))
+  (around [it] (with-repo @repo-dir (it)))
+  (it "should not exist with an inital repo"
+    (should-not (branch-exists? @branch-name)))
+  (it "should exist after creating the branch"
+    (checkout-orphaned-branch @branch-name)
+    (git-commit *repo* "Blarg blarg")
+    (should (branch-exists? @branch-name))))
+
+(describe "checkout-orphaned-branch"
+  (with-all branch-name "testest")
+  (with repo-dir (create-dummy-repo))
+  (around [it] (with-repo @repo-dir (it)))
+  (it "changes the checked out branch"
+    (should= "master" (git-branch-current *repo*))
+    (checkout-orphaned-branch @branch-name)
+    (should= @branch-name (git-branch-current *repo*)))
+  (it "removes all version controlled files leaving ignored ones"
+    (should (file-exists? ".gitignore"))
+    (should (file-exists? "x"))
+    (should (file-exists? "y"))
+    (checkout-orphaned-branch @branch-name)
+    (should-not (file-exists? ".gitignore"))
+    (should (file-exists? "x"))
+    (should-not (file-exists? "y"))))
+
+(describe "setup-branch"
+  (with-all branch-name "stuffs")
+  (with repo-dir (create-dummy-repo))
+  (around [it] (with-repo @repo-dir (it)))
+  (it "creates a new orphaned branch if it does not exist"
+    (setup-branch @branch-name)
+    (should= @branch-name (git-branch-current *repo*)))
+  (it "checks the branch out if it does exist"
+    (should-not (branch-exists? @branch-name))
+    (checkout-orphaned-branch @branch-name)
+    (git-checkout *repo* "master")
+    (setup-branch @branch-name)
+    (should= @branch-name (git-branch-current *repo*))))
+
+(describe "deploy"
+  (with repo-dir (create-dummy-repo))
+  (with repo-dir-path (.getCanonicalPath @repo-dir))
+  (before (conf/merge {:precompiles []
+                       :in-dir @repo-dir-path}))
+  (after (reset! conf/config {}))
+  (around [it] (with-repo @repo-dir (it)))
+  (it "deploys without commit or push"
+    (should-not-throw (deploy {:path @repo-dir
+                               :commit false
+                               :push false})))
+  (it "deploys with commit only"
+    (should-not-throw (deploy {:path @repo-dir
+                               :commit true
+                               :push false})))
+  (context "with a bare clone"
+    (with remote-dir-path (.getCanonicalPath (spec-temp-dir)))
+    (before (git-clone @repo-dir-path @remote-dir-path "origin" "master" true))
+    (before (doto (-> *repo*
+                      (.getRepository)
+                      (.getConfig))
+              (.setString "remote" "origin" "url" @remote-dir-path)
+              (.save)))
+    (it "deploys with commit and push"
+      (should-not-throw (deploy {:path @repo-dir
+                                 :commit true
+                                 :push true})))))
+
 (run-specs)


fix broken add-projects link

fix broken add-projects link

on non-org-centric it was going to /add-projects/gh/:org, which will now
404 since it is not a correct link

--- src-cljs/frontend/components/pages/projects.cljs
+++ src-cljs/frontend/components/pages/projects.cljs
@@ -99,7 +99,10 @@
   (render [this]
     (let [{:keys [empty-state? org]} (om-next/props this)]
       (button/link
-       {:href (routes/v1-add-projects-path {:org (:organization/name org) :vcs_type (:organization/vcs-type org)})
+        {:href (if (feature/enabled? "top-bar-ui-v-1")
+                 (routes/v1-add-projects-path {:org (:organization/name org)
+                                               :vcs_type (:organization/vcs-type org)})
+                 (routes/v1-add-projects))
         :kind :primary
         :size :small
         :on-click #(analytics/track! this {:event-type :add-project-clicked


Made code_rand safe for sizes < 1.

Made code_rand safe for sizes < 1.

--- src/clojush/instructions/random_instructions.clj
+++ src/clojush/instructions/random_instructions.clj
@@ -33,14 +33,15 @@
   (fn [state]
     (if (not (empty? (:integer state)))
       (if (empty? @global-atom-generators)
-	(binding [*out* *err*]
-	  (println "code_rand: global-atom-generators is empty.")
-	  state)
-	(push-item (random-code (math/abs (mod (stack-ref :integer 0 state)
-					       max-points-in-random-expressions))
-				@global-atom-generators)
-		   :code
-		   (pop-item :integer state)))
+        (binding [*out* *err*]
+	         (println "code_rand: global-atom-generators is empty.")
+	         state)
+        (push-item (random-code (max 1
+                                     (math/abs (mod (stack-ref :integer 0 state)
+                                                    max-points-in-random-expressions)))
+                                @global-atom-generators)
+                   :code
+                   (pop-item :integer state)))
       state)))

 (define-registered


Doubled max points

Doubled max points

--- src/clojush/problems/software/small_or_large.clj
+++ src/clojush/problems/software/small_or_large.clj
@@ -127,7 +127,7 @@
 (def argmap
   {:error-function (small-or-large-error-function small-or-large-data-domains)
    :atom-generators small-or-large-atom-generators
-   :max-points 400
+   :max-points 800
    :max-genome-size-in-initial-program 100
    :evalpush-limit 300
    :population-size 1000


[n.u.mapping] Minor kw-value fixes

[n.u.mapping] Minor kw-value fixes


added Dashboard link (by @offlinehoster)

--- src/statuses/views/common.clj
+++ src/statuses/views/common.clj
@@ -29,6 +29,8 @@
                   [:a.brand "innoQ"]
                    [:div.nav-collapse
                     [:ul.nav
+                     [:li
+                      [:a  {"href" "/dashboard/"} "Dashboard"]]
                      [:li.active
                       [:a {"href" "/statuses/updates"} "Statuses"]]
                      [:li


remove print

remove print

--- src/name_bazaar/ui/components/share_buttons.cljs
+++ src/name_bazaar/ui/components/share_buttons.cljs
@@ -7,8 +7,8 @@
    [:div.title "Share On:"]
    [:a {:on-click (fn []
                     (js/FB.ui (clj->js {:method "feed"
-                                        :link (print.foo/look url)
-                                        :caption (print.foo/look title)})))}
+                                        :link url
+                                        :caption title})))}
     [:i.icon.fb]]
    [:a {:target "_blank"
         :href (str "https://twitter.com/intent/tweet?text=" title "&url=" url)}


Fix call to wrong spec conform function.

--- src/uxbox/frontend/images.clj
+++ src/uxbox/frontend/images.clj
@@ -127,7 +127,7 @@

 (defn update-image
   [{user :identity params :route-params data :data}]
-  (let [data (s/conform ::update-image data)
+  (let [data (us/conform ::update-image data)
         message (assoc data
                        :id (uuid/from-string (:id params))
                        :type :update-image


Add source-type-test for pileup file format

--- test/cljam/io/pileup_test.clj
+++ test/cljam/io/pileup_test.clj
@@ -2,6 +2,7 @@
   (:require [clojure.test :refer :all]
             [clojure.java.io :as cio]
             [clojure.string :as cstr]
+            [clojure.walk :as walk]
             [cljam.test-common :refer :all]
             [cljam.io.pileup :as plpio]
             [cljam.io.sequence :as cseq]
@@ -10,6 +11,31 @@
   (:import [java.io File StringWriter StringReader]
            [cljam.io.pileup PileupReader PileupWriter]))

+(defn- rec->map [coll]
+  (walk/postwalk
+   (fn [x]
+     (if (record? x)
+       (into {} x)
+       x))
+   coll))
+
+(def ^:private ^:const the-last-pile
+  ;; ref2	36	N	1	A$	?
+  {:rname "ref2",
+   :pos 36,
+   :ref \N,
+   :count 1,
+   :pile
+   [{:start? false,
+     :mapq nil,
+     :base \A,
+     :qual 30,
+     :reverse? false,
+     :end? true,
+     :insertion nil,
+     :deletion nil,
+     :alignment nil}]})
+
 ;; Reader
 ;; ------

@@ -17,7 +43,7 @@
   (testing "without-ref"
     (are [?in ?out]
         (= (mapv #(into {:alignment nil} %) ?out)
-           (mapv #(into {} %) (#'plpio/parse-bases-col nil ?in)))
+           (mapv rec->map (#'plpio/parse-bases-col nil ?in)))
       "" []
       "A" [{:start? false, :mapq nil, :base \A, :qual -1, :reverse? false, :end? false, :insertion nil, :deletion nil}]
       "a" [{:start? false, :mapq nil, :base \A, :qual -1, :reverse? true, :end? false, :insertion nil, :deletion nil}]
@@ -45,7 +71,7 @@
   (testing "with-ref"
     (are [?in ?out]
         (= (mapv #(into {:alignment nil} %) ?out)
-           (mapv #(into {} %) (#'plpio/parse-bases-col \T ?in)))
+           (mapv rec->map (#'plpio/parse-bases-col \T ?in)))
       "" []
       "A" [{:start? false, :mapq nil, :base \A, :qual -1, :reverse? false, :end? false, :insertion nil, :deletion nil}]
       "a$" [{:start? false, :mapq nil, :base \A, :qual -1, :reverse? true, :end? true, :insertion nil, :deletion nil}]
@@ -79,7 +105,7 @@
 (deftest parse-pileup-line
   (testing "without-ref"
     (are [?in ?out]
-        (= ?out (into {} (update (#'plpio/parse-pileup-line ?in) :pile (fn [xs] (mapv #(into {} %) xs)))))
+        (= ?out (rec->map (#'plpio/parse-pileup-line ?in)))
       "chr1\t10\tN\t0\t\t" {:rname "chr1", :pos 10, :ref \N, :count 0,
                             :pile []}
       "chr1\t10\tN\t1\tA\tI" {:rname "chr1", :pos 10, :ref \N, :count 1,
@@ -92,7 +118,7 @@
                                             {:start? false, :mapq nil, :base \A, :qual 33, :reverse? false, :end? true, :insertion nil, :deletion 2, :alignment nil}]}))
   (testing "with-ref"
     (are [?in ?out]
-        (= ?out (into {} (update (#'plpio/parse-pileup-line ?in) :pile (fn [xs] (mapv #(into {} %) xs)))))
+        (= ?out (rec->map (#'plpio/parse-pileup-line ?in)))
       "chr1\t10\tA\t0\t\t" {:rname "chr1", :pos 10, :ref \A, :count 0,
                             :pile []}
       "chr1\t10\ta\t1\t.\tI" {:rname "chr1", :pos 10, :ref \a, :count 1,
@@ -110,24 +136,8 @@

 (deftest read-piles
   (with-open [r (plpio/reader test-pileup-file)]
-    (is (= {:rname "ref2",
-            :pos 36,
-            :ref \N,
-            :count 1,
-            :pile [{:start? false,
-                    :mapq nil,
-                    :base \A,
-                    :qual 30,
-                    :reverse? false,
-                    :end? true,
-                    :insertion nil,
-                    :deletion nil
-                    :alignment nil}]}
-           (->> xs
-                (map #(into {} %))
-                (fn [xs])
-                (update (last (plpio/read-piles r)) :pile)
-                (into {}))))))
+    (is (= the-last-pile
+           (rec->map (last (plpio/read-piles r)))))))

 ;; Writer
 ;; ------
@@ -263,3 +273,24 @@
       "chr1\t10\tA\t1\t.\tI\n"
       "chr1\t10\tA\t4\t.,Tt\tIABC\n"
       "chr1\t10\tA\t4\t^].+3TTT,-2tg$Tt\tIABC\n")))
+
+(deftest source-type-test
+  (testing "reader"
+    (with-open [server (http-server)]
+      (are [x] (= the-last-pile
+                  (with-open [r (plpio/reader x)]
+                    (rec->map (last (plpio/read-piles r)))))
+        test-pileup-file
+        (cio/file test-pileup-file)
+        (cio/as-url (cio/file test-pileup-file))
+        (cio/as-url (str (:uri server) "/pileup/test.pileup")))))
+
+  (testing "writer"
+    (let [tmp-pileup-file (cio/file temp-dir "pileup-source-type-writer.mpileup")]
+      (are [x] (with-before-after {:before (prepare-cache!)
+                                   :after (clean-cache!)}
+                 (with-open [w (plpio/writer x)]
+                   (not-throw? (plpio/write-piles w [the-last-pile]))))
+        (.getCanonicalPath tmp-pileup-file)
+        tmp-pileup-file
+        (cio/as-url tmp-pileup-file)))))


Updated for November

Updated for November

--- scrape-n-mail/src/scrape_n_mail/core.cljs
+++ scrape-n-mail/src/scrape_n_mail/core.cljs
@@ -185,7 +185,7 @@
       [:br]
       [:p "Dear " (::submitter-name (first name-records)) ","]

-      [:p "Our call for names for Wellbeing for October 2018 is out: "
+      [:p "Our call for names for Wellbeing for November 2018 is out: "
           "http://newdharma.transformativechange.org/2018/09/wellbeing-october-2018/"]

       [:p "Currently, the community is holding the following names on the altar "


Added try-catch with error message and instructions

--- sidecar/src/figwheel_sidecar/core.clj
+++ sidecar/src/figwheel_sidecar/core.clj
@@ -125,19 +125,23 @@
   "This is the server. It is complected and its OK. Its trying to be a basic devel server and
    also provides the figwheel websocket connection."
   [{:keys [ring-handler server-port http-server-root ring-handler] :as server-state}]
-  (-> (routes
-       (GET "/figwheel-ws/:desired-build-id" {params :params} (reload-handler server-state))
-       (GET "/figwheel-ws" {params :params} (reload-handler server-state))
-       (route/resources "/" {:root http-server-root})
-       (or ring-handler (fn [r] false))
-       (GET "/" [] (resource-response "index.html" {:root http-server-root}))
-       (route/not-found "
Page not found
"))
-      ;; adding cors to support @font-face which has a strange cors error
-      ;; super promiscuous please don't uses figwheel as a production server :)
-      (cors/wrap-cors
-       :access-control-allow-origin #".*"
-       :access-control-allow-methods [:head :options :get :put :post :delete])
-      (run-server {:port server-port})))
+  (try
+    (-> (routes
+         (GET "/figwheel-ws/:desired-build-id" {params :params} (reload-handler server-state))
+         (GET "/figwheel-ws" {params :params} (reload-handler server-state))
+         (route/resources "/" {:root http-server-root})
+         (or ring-handler (fn [r] false))
+         (GET "/" [] (resource-response "index.html" {:root http-server-root}))
+         (route/not-found "
Page not found
"))
+        ;; adding cors to support @font-face which has a strange cors error
+        ;; super promiscuous please don't uses figwheel as a production server :)
+        (cors/wrap-cors
+         :access-control-allow-origin #".*"
+         :access-control-allow-methods [:head :options :get :put :post :delete])
+        (run-server {:port server-port}))
+    (catch java.net.BindException e
+      (println "Port" server-port "is already being used. Are you running another Figwheel instace? If you want to run two Figwheel instances add a new :server-port (i.e. :server-port 3450) to Figwheel's config options in your project.clj")
+      (System/exit 0))))

 (defn append-msg [q msg] (conj (take 30 q) msg))


refactored and cleaned up

refactored and cleaned up

--- sidecar/src/figwheel_sidecar/repl.clj
+++ sidecar/src/figwheel_sidecar/repl.clj
@@ -345,26 +345,6 @@
     Exit: Control+C or :cljs/quit
  Results: Stored in vars *1, *2, *3, *e holds last exception object")

-(defn cljs-repl
-  ([] (cljs-repl nil))
-  ([id]
-   (let [{:keys [state-atom figwheel-server all-builds]} *autobuild-env*
-         opt-none-builds (set (keep :id (filter config/optimizations-none? all-builds)))
-         build-id (first (not-empty (get-ids (if id [(name id)] [])
-                                             (:focus-ids @state-atom)
-                                             all-builds)))
-         build (first (filter #(and
-                                (opt-none-builds (:id %))
-                                (= build-id (:id %)))
-                             all-builds))]
-     (if build
-       (do
-         (println "Starting Figwheel CLJS repl for build:" (:id build))
-         (println (repl-function-docs))
-         (println "Prompt will show when figwheel connects to your application")
-         (repl build figwheel-server {:special-fns figwheel-special-fns}))
-       (println "No such build found:" (name id))))))
-
 (defn get-build-choice [choices]
   (let [choices (set (map name choices))]
     (loop []
@@ -377,56 +357,82 @@
             (println (str "Error: " res " is not a valid choice"))
             (recur)))))))

-;; this is still confused, conflated, complected
-(defn autobuild-repl
-  ([autobuild-options]
-   (autobuild-repl autobuild-options repl))
-  ([{:keys [all-builds build-ids figwheel-server] :as opts} repl-fn]
-   (let [all-builds'  (mapv auto/prep-build all-builds)
-         ;; choose default build for repl
-         repl-build   (first (config/narrow-builds* all-builds' build-ids))
-         build-ids    (or (not-empty build-ids) [(:id repl-build)]) ;; give a default build-id
-         ]
-     ;; this is what currently starts the autobuild
-     ((get repl-control-fns 'start-autobuild) build-ids)
-     (loop [build repl-build]
-       (newline)
-       (print "Launching ClojureScript REPL")
-       (when-let [id (:id build)] (println " for build:" id))
-       (println (repl-function-docs))
-       (println "Prompt will show when figwheel connects to your application")
-
-       (repl-fn build figwheel-server {:special-fns figwheel-special-fns})
-       (println "\nStart CLJS repl on another build? (Ctrl+D to exit)")
+(defn initial-repl-build [all-builds build-ids]
+  (first (config/narrow-builds* all-builds build-ids)))
+
+(defn initial-build-ids [all-builds build-ids]
+  (let [repl-build (initial-repl-build all-builds build-ids)]
+    (or (not-empty build-ids) [(:id repl-build)])))
+
+(defn start-repl [build]
+  (let [{:keys [figwheel-server build-ids]} *autobuild-env*]
+    (start-autobuild build-ids)
+    (newline)
+    (print "Launching ClojureScript REPL")
+    (when-let [id (:id build)] (println " for build:" id))
+    (println (repl-function-docs))
+    (println "Prompt will show when figwheel connects to your application")
+    (repl build figwheel-server {:special-fns figwheel-special-fns})))
+
+(defn cljs-repl
+  ([] (cljs-repl nil))
+  ([id]
+   (let [{:keys [state-atom figwheel-server all-builds build-ids]} *autobuild-env*
+         opt-none-builds (set (keep :id (filter config/optimizations-none? all-builds)))
+         build-id (first (not-empty (get-ids (if id [(name id)] [])
+                                             (:focus-ids @state-atom)
+                                             all-builds)))
+         build-id (or build-id (first build-ids))
+         build (first (filter #(and
+                                (opt-none-builds (:id %))
+                                (= build-id (:id %)))
+                             all-builds))]
+     (if build
+       (start-repl build)
+       (if id
+         (println "No such build found:" (name id))
+         (println "No build found to start CLJS REPL for."))))))
+
+;;; This will not work in an nrepl env!!!
+(defn repl-switching-loop
+  ([] (repl-switching-loop nil))
+  ([start-build]
+   (let [{:keys [all-builds]} *autobuild-env*]
+     (loop [build start-build]
+       (cljs-repl (:id build))
        (let [chosen-build-id (get-build-choice
-                              (keep :id (filter config/optimizations-none? all-builds')))
-             chosen-build (first (filter #(= (name (:id %)) chosen-build-id) all-builds'))]
+                              (keep :id (filter config/optimizations-none? all-builds)))
+             chosen-build (first (filter #(= (name (:id %)) chosen-build-id) all-builds))]
          (recur chosen-build))))))

-(defn start-nrepl [figwheel-options autobuild-options]
+(defn start-nrepl-server [figwheel-options autobuild-options]
   (when (:nrepl-port figwheel-options)
     (nrepl-serv/start-server
      :port (:nrepl-port figwheel-options)
      :handler (apply nrepl-serv/default-handler
                      (conj (map resolve cider/cider-middleware) #'pback/wrap-cljs-repl)))))

-(defn run-autobuilder [{:keys [figwheel-options all-builds build-ids]}]
+(defn create-autobuild-env [{:keys [figwheel-options all-builds build-ids]}]
   (let [logfile-path (or (:server-logfile figwheel-options) "figwheel_server.log")
         _ (config/mkdirs logfile-path)
         log-writer        (io/writer logfile-path :append true)
         state-atom        (atom {:autobuilder nil
                                  :focus-ids  build-ids})
         all-builds        (mapv auto/prep-build all-builds)
+        build-ids         (initial-build-ids all-builds build-ids)
         figwheel-server   (figwheel-sidecar.core/start-server figwheel-options)]
-    (binding [*autobuild-env* {:all-builds all-builds
-                               :build-ids build-ids
-                               :figwheel-server figwheel-server
-                               :state-atom state-atom
-                               :output-writer log-writer
-                               :error-writer log-writer}]
-      (start-nrepl figwheel-options *autobuild-env*)
-      (if (or (= (:repl figwheel-options) false)
-              (nil? (:nrepl-port figwheel-options)))
-        (when (figwheel-sidecar.auto-builder/autobuild-ids *autobuild-env*)
-          (loop [] (Thread/sleep 30000) (recur)))
-        (autobuild-repl *autobuild-env*)))))
+    {:all-builds all-builds
+     :build-ids build-ids
+     :figwheel-server figwheel-server
+     :state-atom state-atom
+     :output-writer log-writer
+     :error-writer log-writer}))
+
+(defn run-autobuilder [{:keys [figwheel-options all-builds build-ids] :as options}]
+  (binding [*autobuild-env* (create-autobuild-env options)]
+    (start-nrepl-server figwheel-options *autobuild-env*)
+    (if (or (= (:repl figwheel-options) false)
+            (nil? (:nrepl-port figwheel-options)))
+      (when (figwheel-sidecar.auto-builder/autobuild-ids *autobuild-env*)
+        (loop [] (Thread/sleep 30000) (recur)))
+      (repl-switching-loop))))


Refactor and adapt create-images event to backend changes.

--- src/uxbox/main/data/images.cljs
+++ src/uxbox/main/data/images.cljs
@@ -8,9 +8,12 @@
 (ns uxbox.main.data.images
   (:require [cuerdas.core :as str]
             [beicon.core :as rx]
+            [promesa.core :as p]
+            [uxbox.util.data :refer (jscoll->vec)]
             [uxbox.util.uuid :as uuid]
             [uxbox.util.rstore :as rs]
             [uxbox.util.router :as r]
+            [uxbox.util.dom.files :as files]
             [uxbox.main.state :as st]
             [uxbox.main.repo :as rp]))

@@ -191,15 +194,18 @@
 (defrecord CreateImages [coll-id files]
   rs/WatchEvent
   (-apply-watch [_ state s]
-    (let [files-to-array (fn [js-col]
-                           (-> (clj->js [])
-                               (.-slice)
-                               (.call js-col)
-                               (js->clj)))
-          images-data (map (fn [file] {:coll coll-id
-                                       :id (uuid/random)
-                                       :file file}) (files-to-array files))]
-      (->> (rx/from-coll images-data)
+    (letfn [(image-size [file]
+              (->> (files/get-image-size file)
+                   (rx/map (partial vector file))))
+            (prepare [[file [width height]]]
+              {:coll coll-id
+               :id (uuid/random)
+               :file file
+               :width width
+               :height height})]
+      (->> (rx/from-coll (jscoll->vec files))
+           (rx/flat-map image-size)
+           (rx/map prepare)
            (rx/flat-map #(rp/req :create/image %))
            (rx/map :payload)
            (rx/map image-created)))))


more flexible all-matches, wow, empty string matches

--- test/kmp_search/test/core.clj
+++ test/kmp_search/test/core.clj
@@ -10,8 +10,8 @@
       [index matcher])))

 (defn all-matches
-  [matcher byte-arrays]
-  (loop [matcher matcher
+  [pattern byte-arrays]
+  (loop [matcher (matcher pattern)
          byte-arrays byte-arrays
          matches []]
     (if byte-arrays
@@ -53,12 +53,11 @@
            "ababc" 2
            ["ab" ""  "bd" "ab" "c"] 4)))
   (testing "all-matches"
-    (let [m (matcher (the-bytes "abc"))]
-      (are [x y] (= (all-matches m (map the-bytes x)) y)
-           ["abc"] [0]
-           ["abcabcabc"] [0 3 6]
-           ["ab" "ca" "bc" "ab" "ca"] [0 3 6]
-           ["ab" "ca" "bc" "ab" "cabraca" "abacab" "collate"] [0 3 6 19])))
+    (are [p x y] (= (all-matches (the-bytes p) (map the-bytes x)) y)
+         "abc" ["abc"] [0]
+         "abc" ["abcabcabc"] [0 3 6]
+         "abc" ["ab" "ca" "bc" "ab" "ca"] [0 3 6]
+         "abc" ["ab" "ca" "bc" "ab" "cabraca" "abacab" "collate"] [0 3 6 19]))
   (testing "matching empty"
     (let [m (matcher (the-bytes ""))]
       (are [x y] (= (test-index m x) y)
@@ -69,6 +68,7 @@
            "ababc" 0
            ["ab" ""  "bd" "ab" "c"] 0)))
   (testing "matching empty"
-    (let [m (matcher (the-bytes "aa"))]
-      (are [x y] (= (all-matches m (map the-bytes x)) y)
-           ["aaaaaaaaaaaaa"] [0 1 2 3 4 5 6 7 8 9 10 11]))))
+    (are [p x y] (= (all-matches (the-bytes p) (map the-bytes x)) y)
+         "aa" ["aaaaaaaaaaaaa"] [0 1 2 3 4 5 6 7 8 9 10 11]
+         "" ["abc"] [0 1 2 3]
+         "" ["ab" "cdef"] [0 1 2 3 4 5 6])))


Updated & reordered docs config.

Updated & reordered docs config.

--- test/lambda_blog/fixtures.clj
+++ test/lambda_blog/fixtures.clj
@@ -41,27 +41,27 @@
 (defn- footer [_]
   (text-centered "Some footer contents"))

-(def blog {:author "me"
-           :banner-template banner
-           :brand "Test Blog"
+(def blog {:author "Idorobots"
+           :brand "λ-blog"
+           :title "λ-blog documentation"
+           :url "https://idorobots.github.io/lambda-blog/"
+           :output-dir "/target/out/"
            :brand-logo "media/logo.svg"
            :favicon "media/logo.svg"
+           :banner-template banner
+           :navigation-template navigation
            :footer-template footer
-           :footer-scripts ["js/lambda-blog.js"]
-           :navigation-template navigation
-           :output-dir "/target/out/"
-           :url "localhost:8000"
            :scripts ["http://code.jquery.com/jquery-2.2.0.min.js"
                      "https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.25.1/js/jquery.tablesorter.min.js"
                      "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
                      "https://cdn.jsdelivr.net/highlight.js/9.1.0/highlight.min.js"]
+           :footer-scripts ["js/lambda-blog.js"]
            :stylesheets ["https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
                          "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"
                          "https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"
                          "https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.25.1/css/theme.bootstrap.min.css"
                          "https://cdn.jsdelivr.net/highlight.js/9.1.0/styles/default.min.css"
-                         "style/lambda-blog.css"]
-           :title "Test Blog"})
+                         "style/lambda-blog.css"]})

 (defn generate-blog []
   (-> blog


tests for set-state, update-state

tests for set-state, update-state

--- test/rex/ext/cursor_test.cljs
+++ test/rex/ext/cursor_test.cljs
@@ -73,20 +73,35 @@
     (is (= ["field1" "field2"]
            (sut/cursor-key (sut/zoom-in n "feature123"))))))

-(deftest update-nested-state-test
+(deftest set-nested-state-test
   (let [c (sut/make-cursor)
         n (-> c
               (sut/nest "a")
               (sut/nest "b"))
         m {"a" {"b" 1}}]
     (is (= {"a" {"b" 2}}
-           (sut/update-state n m 2)))))
+           (sut/set-state n m 2)))))

-(deftest update-whole-state-test
+(deftest set-whole-state-test
   (let [c (sut/make-cursor)
         m {"a" {"b" 1}}]
     (is (= {"c" 123}
-           (sut/update-state c m {"c" 123})))))
+           (sut/set-state c m {"c" 123})))))
+
+(deftest update-local-state-test
+  (let [c (sut/make-cursor)
+        nested (-> c
+                   (sut/nest "a")
+                   (sut/nest "b"))
+        m {"a" {"b" 123}}]
+    (is (= {"a" {"b" 124}}
+           (sut/update-state nested m inc)))))
+
+(deftest update-global-state-test
+  (let [c (sut/make-cursor)
+        m {"a" {"b" 123}}]
+    (is (= {"a" {"b" 124}}
+           (sut/update-state c m (fn [s] (assoc-in s ["a" "b"] 124)))))))

 (deftest get-state-with-empty-cursor-test
   (let [c (sut/make-cursor)


comment out synth design saving fns (Again)

--- etc/synthdefs/synth-designs.clj
+++ etc/synthdefs/synth-designs.clj
@@ -339,10 +339,9 @@
           snd           (* env snd)]
       (out out-bus snd)))

-   (save-to-pi mono-player)
-   (save-to-pi stereo-player)
+   ;; (save-to-pi mono-player)
+   ;; (save-to-pi stereo-player)
    )
-

 ;; Experimental
 (comment


Whitespace tidy.

Whitespace tidy.

--- src-cljs/kixi/hecuba/tabs/programmes.cljs
+++ src-cljs/kixi/hecuba/tabs/programmes.cljs
@@ -189,7 +189,7 @@

       (when sensors
         (om/update! data [:sensors :selected] sensors))
-
+
       ;; Update the new active components
       (om/update! data :active-components history-status))
     (recur)))
@@ -206,7 +206,7 @@
    (dom/div nil cursor)))

 (defmulti url-str (fn [start end entity_id device_id type measurements-type] measurements-type))
-(defmethod url-str :raw [start end entity_id device_id type _]
+(defmethod url-str :raw [start end entity_id device_id type _]
   (str "/4/entities/" entity_id "/devices/" device_id "/measurements/"
        type "?startDate=" start "&endDate=" end))
 (defmethod url-str :hourly_rollups [start end entity_id device_id type _]


remove some dead code

remove some dead code

--- src-cljs/cljsbuild_ui/pages/main.cljs
+++ src-cljs/cljsbuild_ui/pages/main.cljs
@@ -28,97 +28,6 @@
   [project-map]
   (let [proj-keys (-> project-map :order)]
     (mapv #(get project-map %) proj-keys)))
-
-(def test-app-state
-  "A test app-state for quick-testing page rendering."
-  {
-  :projects {
-    "/home/oakmac/t3tr0s/project.clj" {
-      :compile-menu-showing? false
-      :auto-compile? true
-      :name "t3tr0s"
-      :state :idle
-      :builds [
-        { :id :client
-          :active? true
-          :compile-time 0.6
-          :last-compile-time nil
-          :error nil
-          :state :done
-          :warnings []
-
-          ;; copied directly from project.clj
-          :source-paths ["src/client"]
-          :compiler {
-            :output-to "public/js/client.js"
-            :output-dir "public/out"
-            :optimizations :whitespace }}
-
-        { :id :client-adv
-          :active? true
-          :compile-time 4.7
-          :last-compile-time nil
-          :error nil
-          :state :done
-          :warnings []
-
-          ;; copied directly from project.clj
-          :source-paths ["src/client"]
-          :compiler {
-            :externs ["externs/jquery-1.9.js" "externs/socket.io.js"]
-            :output-to "public/js/client.min.js"
-            :optimizations :advanced
-            :pretty-print false }}
-
-        { :id :server
-          :active? true
-          :compile-time nil
-          :last-compile-time nil
-          :error nil
-          :state :missing
-          :warnings []
-
-          ;; copied directly from project.clj
-          :source-paths ["src/server"]
-          :compiler {
-            :language-in :ecmascript5
-            :language-out :ecmascript5
-            :target :nodejs
-            :output-to "server.js"
-            :optimizations :simple }}]}
-
-    "/home/oakmac/project2/project.clj" {
-      :auto-compile? false
-      :compile-menu-showing? false
-      :name "project2"
-      :state :auto
-      :builds [
-        { :id :main
-          :active? true
-          :error nil
-          :last-compile-time 1413048033
-          :state :done-with-warnings
-          :warnings [
-            "Use of undeclared Var project2.core/foo at line 79 src-cljs/project2/core.cljs"
-            "Use of undeclared Var project2.core/bar at line 80 src-cljs/project2/core.cljs"
-          ]
-
-          :source-paths ["src-cljs"]
-          :compiler {
-            :optimizations :whitespace
-            :output-to "public/js/main.js"}}
-
-        { :id :main-min
-          :active? true
-          :error ["EOF while reading, starting at line 7"]
-          :last-compile-time nil
-          :state :done-with-error
-          :warnings []
-
-          :source-paths ["src-cljs"]
-          :compiler {
-            :optimizations :advanced
-            :output-to "public/js/main.min.js"}}]}}})

 ;;------------------------------------------------------------------------------
 ;; Project State
@@ -483,9 +392,6 @@

   ;; start the compile
   (compile-now! prj-key))
-
-(defn- click-build-row [prj-key build-key]
-  (swap! state update-in [:projects prj-key :builds build-key :checked?] not))

 (defn- click-compile-options [js-evt prj-key]
   (.stopPropagation js-evt)


Sketch outline of blast effect.

Sketch outline of blast effect.

Setting aside for now to integrate Luminus and start on the
web UI, because: WebGL visualizations!!!

--- src/afterglow/effects/fun.clj
+++ src/afterglow/effects/fun.clj
@@ -138,3 +138,13 @@
               (fn [show snapshot]
                 ;; Arrange to shut down once all existing sparkles fade out.
                 (reset! running false))))))
+
+(defn blast
+  "An effect which creates a sphere of light which expands from a
+  point, then hollows out as it continues to grow and fade."
+  [fixtures & {:keys [color x y grow-time max-solid-diameter]
+               :or {color default-sparkle-color x (:center-x @(:dimensions *show*))
+                    y (:center-y @(:dimensions *show*)) grow-time 1000
+                    max-solid-diameter 0.2}}]
+  ;; Some kind of gradient slope for edges too?
+  )


use :org consistently and fix typo

use :org consistently and fix typo

--- frontend/controllers/navigation.cljs
+++ frontend/controllers/navigation.cljs
@@ -210,50 +210,50 @@

 (defmethod navigated-to :org-settings
-  [history-imp navigation-point {:keys [subpage org-name] :as args} state]
+  [history-imp navigation-point {:keys [subpage org] :as args} state]
   (mlog "Navigated to subpage:" subpage)
   (-> state
       (assoc :navigation-point navigation-point)
-      (assoc :nagivation-data args)
+      (assoc :navigation-data args)
       (assoc :org-settings-subpage subpage)
-      (assoc :org-settings-org-name org-name)
-      (#(if (state-utils/stale-current-org? % org-name)
+      (assoc :org-settings-org-name org)
+      (#(if (state-utils/stale-current-org? % org)
           (state-utils/reset-current-org %)
           %))))

 (defmethod post-navigated-to! :org-settings
-  [history-imp navigation-point {:keys [org-name subpage]} previous-state current-state]
+  [history-imp navigation-point {:keys [org subpage]} previous-state current-state]
   (let [api-ch (get-in current-state [:comms :api])]
     (when-not (seq (get-in current-state state/projects-path))
       (api/get-projects api-ch))
     (if (get-in current-state state/org-plan-path)
-      (mlog "plan details already loaded for" org-name)
-      (ajax/ajax :get
-                 (gstring/format "/api/v1/organization/%s/plan" org-name)
+      (mlog "plan details already loaded for" org)
+      (ajax/ajax :get
+                 (gstring/format "/api/v1/organization/%s/plan" org)
                  :org-plan
                  api-ch
-                 :context {:org-name org-name}))
-    (if (= org-name (get-in current-state state/org-name-path))
-      (mlog "organization details already loaded for" org-name)
-      (ajax/ajax :get
-                 (gstring/format "/api/v1/organization/%s/settings" org-name)
+                 :context {:org-name org}))
+    (if (= org (get-in current-state state/org-name-path))
+      (mlog "organization details already loaded for" org)
+      (ajax/ajax :get
+                 (gstring/format "/api/v1/organization/%s/settings" org)
                  :org-settings
                  api-ch
-                 :context {:org-name org-name}))
+                 :context {:org-name org}))
     (condp = subpage
       :organizations (ajax/ajax :get "/api/v1/user/organizations" :organizations api-ch)
       :billing (do
                  (ajax/ajax :get
-                            (gstring/format "/api/v1/organization/%s/card" org-name)
+                            (gstring/format "/api/v1/organization/%s/card" org)
                             :plan-card
                             api-ch
-                            :context {:org-name org-name})
+                            :context {:org-name org})
                  (ajax/ajax :get
-                            (gstring/format "/api/v1/organization/%s/invoices" org-name)
+                            (gstring/format "/api/v1/organization/%s/invoices" org)
                             :plan-invoices
                             api-ch
-                            :context {:org-name org-name}))))
-  (set-page-title! (str "Org settings - " org-name)))
+                            :context {:org-name org}))))
+  (set-page-title! (str "Org settings - " org)))

 (defmethod post-navigated-to! :logout


don't let the navigate! message do the default thing

--- frontend/controllers/navigation.cljs
+++ frontend/controllers/navigation.cljs
@@ -81,6 +81,10 @@
   [history-imp navigation-point args previous-state current-state]
   (post-default navigation-point args))

+(defmethod navigated-to :navigate!
+  [history-imp navigation-point args state]
+  state)
+
 (defmethod post-navigated-to! :navigate!
   [history-imp navigation-point {:keys [path replace-token?]} previous-state current-state]
   (let [path (if (= \/ (first path))


added querer

added querer

--- src/babel/espanol/lexicon.clj
+++ src/babel/espanol/lexicon.clj
@@ -669,6 +669,16 @@
                                        :pronoun true
                                        :reflexive true
                                        :sem subject-semantics}}}})
+
+   "querer" (let [shared-part-of-querer
+            {:espanol {:boot-stem "quier"
+                       :preterito-stem "quis"
+                       :futuro-stem "querr"}}
+            [(merge shared-part-of-querer
+             {:synsem {:pred :want}})
+      (merge shared-part-of-poder
+             {:synsem {:pred :love}})])
+
    "se"
    [;; 3rd singular or plural: 'él,ellas,..etc'
     {:synsem {:cat :noun


Continues filling in content.

Continues filling in content.

--- src/cadence/views/landing.clj
+++ src/cadence/views/landing.clj
@@ -9,12 +9,14 @@
     [:div.page-header [:h1 "Welcome to Cadence!"]]
     [:container-fluid
      [:div.row-fluid
-      [:div.span3
+      [:div#faqs.span2
+       [:h3 "Questions"]
        [:ul.nav.nav-stacked.nav-tabs
-        [:li (link-to "#intro" "A Quick Introduction")]
-        [:li (link-to "#usage" "What to do?")]
-        [:li (link-to "#more" "More Info")]]]
-      [:div.span9
+        [:li (link-to "#intro" "What is all this?")]
+        [:li (link-to "#usage" "What should I do?")]
+        [:li (link-to "#privacy" "Can I trust you?")]
+        [:li (link-to "#secutiry" "Am I safe?")]]]
+      [:div.span10
        [:h2#intro "A Quick Introduction"]
        [:p "Cadence is really two things, a web app and "
         (link-to "https://github.com/RyanMcG/Cadence-js" "Cadence.js")
@@ -22,6 +24,25 @@
         style on a single input field. For more information on "
         (link-to "https://github.com/RyanMcG/Cadence-js" "Cadence.js")
         " check out the links in the navbar."]
-       [:p "This web app is a demo/example usage of Cadence.js. There are several
-           things you need to do to test it out.  First off, you need to "
-        (link-to "/signup" "signup") " and " (link-to "/login" "login") "."]]]]))
+       [:p "This web app is a demo/example usage of Cadence.js. There are
+           several things you need to do to test it out.  First off, you need "
+        "to " (link-to "/signup" "signup") " and "
+        (link-to "/login" "login") "."]
+       [:h2#usage "Using this site"]
+       [:p "There are a few things you things you can do with cadence, but they
+           all require making an account first. To signup for an account "
+        (link-to "/signup" "click here")
+        " or use the links in user-dropdown on the right side of the navbar. "
+        "Once you've signup up and logged in you should be able to start
+        training." ]
+       [:div.well
+        [:p#training [:strong "What is training? "]
+         "Training is an essential part of using supervised learners.  This
+         application takes the output from Cadence.js during training and uses
+         it to create a model for Support Vector Machine classification."]
+        [:div#authentication "During " [:strong "authentication"]
+         " that classifier is called up and used on a new output from Cadence.js
+         and determines whether that output is \"authenic\". Hopefully, for the
+         classifier to consider the given cadence authentic it will have to be
+         generated by whomever did the training in the first place."]]
+       ]]]))


add main class

add main class

--- src/ceres_geschichte/core.clj
+++ src/ceres_geschichte/core.clj
@@ -1,4 +1,5 @@
 (ns ceres-geschichte.core
+  (:gen-class :main true)
   (:require [hasch.core :refer [uuid]]
             [konserve.store :refer [new-mem-store]]
             [konserve.filestore :refer [new-fs-store]]
@@ -139,6 +140,11 @@
   (let [{{:keys [follow track credentials]} :app} @state]
       (start-filter-stream follow track (fn [status] (transact-status state status)) credentials))

+  (def user "kordano@topiq.es")
+
+  (def repo #uuid "70464f6c-46d7-41a0-b6a4-1f4cc0fd4ec2")
+
+
   ;; client 1
   (def store (<!? (new-mem-store)))

@@ -146,12 +152,7 @@

   (def stage (<!? (s/create-stage! "kordano@topiq.es" peer eval)))

-  (<!? (s/connect! stage "ws://172.17.0.12:31744"))
-
-
-  (def user "kordano@topiq.es")
-
-  (def repo #uuid "c85db965-9adc-4256-a383-cb12f212b8b1")
+  (<!? (s/connect! stage "ws://archimedes:31744"))

   (<!? (s/subscribe-repos! stage {user {repo #{"master"}}}))
@@ -176,8 +177,6 @@

   (let [durations (map :duration (<!? (-get-in b-store [:commit-delays])))]
-    [(count durations)
-     ((comp float /) (reduce + durations)
-      (count durations))])
+    [(count durations)])

   )


Reformatted Indicator for readability

Reformatted Indicator for readability

--- src/cia/schemas/indicator.clj
+++ src/cia/schemas/indicator.clj
@@ -56,23 +56,72 @@
   (merge
    c/GenericStixIdentifiers
    {:valid_time c/ValidTime
-    (s/optional-key :alternate_ids) (describe [s/Str] "alternative identifier (or alias)")
-    (s/optional-key :version) (describe s/Num "schema version for this content")
-    (s/optional-key :negate) (describe s/Bool "specifies the absence of the pattern")
-    (s/optional-key :type) (describe [v/IndicatorType] "Specifies the type or types for this Indicator")
-    (s/optional-key :observable) (describe c/Observable "a relevant cyber observable for this Indicator")
-    (s/optional-key :judgements) (describe rel/RelatedJudgements "related Judgements for this Indicator")
-    (s/optional-key :composite_indicator_expression) CompositeIndicatorExpression
-    (s/optional-key :indicated_TTP) (describe rel/RelatedTTPs "the relevant TTP indicated by this Indicator")
-    (s/optional-key :likely_impact) (describe s/Str "likely potential impact within the relevant context if this Indicator were to occur")
-    (s/optional-key :suggested_COAs) (describe rel/RelatedCOAs "suggested Courses of Action")
-    (s/optional-key :confidence) (describe v/HighMedLow "level of confidence held in the accuracy of this Indicator")
-    (s/optional-key :sightings) (describe [Sighting] "a set of sighting reports")
-    (s/optional-key :related_indicators) (describe rel/RelatedIndicators "relationship between the enclosing indicator and a disparate indicator")
-    (s/optional-key :related_campaigns) (describe rel/RelatedCampaigns "references to related campaigns")
-    (s/optional-key :related_COAs) (describe rel/RelatedCOAs "related Courses of Actions for this cyber threat Indicator")
-    (s/optional-key :kill_chain_phases) (describe [s/Str] "relevant kill chain phases indicated by this Indicator") ;; simplified
-    (s/optional-key :test_mechanisms) (describe [s/Str] "Test Mechanisms effective at identifying the cyber Observables specified in this cyber threat Indicator") ;; simplified
+    (s/optional-key :alternate_ids)
+    (describe [s/Str]
+              "alternative identifier (or alias)")
+
+    (s/optional-key :version)
+    (describe s/Num
+              "schema version for this content")
+
+    (s/optional-key :negate)
+    (describe s/Bool
+              "specifies the absence of the pattern")
+
+    (s/optional-key :type)
+    (describe [v/IndicatorType]
+              "Specifies the type or types for this Indicator")
+
+    (s/optional-key :observable)
+    (describe c/Observable
+              "a relevant cyber observable for this Indicator")
+
+    (s/optional-key :judgements)
+    (describe rel/RelatedJudgements
+              "related Judgements for this Indicator")
+
+    (s/optional-key :composite_indicator_expression)
+    CompositeIndicatorExpression
+
+    (s/optional-key :indicated_TTP)
+    (describe rel/RelatedTTPs
+              "the relevant TTP indicated by this Indicator")
+
+    (s/optional-key :likely_impact)
+    (describe s/Str
+              "likely potential impact within the relevant context if this Indicator were to occur")
+
+    (s/optional-key :suggested_COAs)
+    (describe rel/RelatedCOAs
+              "suggested Courses of Action")
+
+    (s/optional-key :confidence)
+    (describe v/HighMedLow
+              "level of confidence held in the accuracy of this Indicator")
+
+    (s/optional-key :sightings)
+    (describe [Sighting]
+              "a set of sighting reports")
+
+    (s/optional-key :related_indicators)
+    (describe rel/RelatedIndicators
+              "relationship between the enclosing indicator and a disparate indicator")
+
+    (s/optional-key :related_campaigns)
+    (describe rel/RelatedCampaigns
+              "references to related campaigns")
+
+    (s/optional-key :related_COAs)
+    (describe rel/RelatedCOAs
+              "related Courses of Actions for this cyber threat Indicator")
+
+    (s/optional-key :kill_chain_phases) ;; simplified
+    (describe [s/Str]
+              "relevant kill chain phases indicated by this Indicator")
+
+    (s/optional-key :test_mechanisms) ;; simplified
+    (describe [s/Str]
+              "Test Mechanisms effective at identifying the cyber Observables specified in this cyber threat Indicator")

     ;; Extension fields:
     :producer s/Str


WIP

WIP

- Encodes /rez/<name>.txt as a data URI

--- src/clj/my_project/server.clj
+++ src/clj/my_project/server.clj
@@ -16,37 +16,31 @@
 (deftemplate page (io/resource "index.html") []
   [:body] (if is-dev? inject-devmode-html identity))

-(defn read-file [file-path]
-  (with-open [reader (input-stream file-path)]
-    (let [length (.length (clojure.java.io/file file-path))
-          buffer (byte-array length)]
-      (.read reader buffer 0 length)
-      buffer)))
+(defn get-enc-64-as-str [file]
+  (->>
+    file
+    (read-file)
+    (base64/encode-bytes)
+    (map char)
+    (apply str)))

-(do
-  (defn get-enc-64-as-str [file]
-    (->>
-      file
-      (read-file)
-      (base64/encode-bytes)
-      (map char)
-      (apply str)
-      ))

-  (defn get-png-enc [name]
-    (->>
-      (io/resource (str  "public/data/" name ".png"))
-      (get-enc-64-as-str ))
-    )

-  (println (get-png-enc "tiles")))
+(defn get-file-as-mime-type [rez-name mime-type]
+  (->>
+    (io/resource rez-name)
+    (get-enc-64-as-str)
+    (str "data:" mime-type ";base64,")))

+(defn get-png-enc [name]
+  (get-file-as-mime-type (str  "public/data/" name ".png"), "image/png")
+  )

 (defroutes routes
   (resources "/")
   (resources "/react" {:root "react"})
-  (GET ["/rez/:name.txt" :name #".*"] [name]
-       (str "File:" name ))
+  (GET ["/rez/:name.txt" :name #".*"] [name] (get-png-enc name))
+
   (GET "/*" req (page)))

 (def http-handler
@@ -71,6 +65,7 @@
 (defn -main [& [port]]
   (run port))

+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


combine data sources output (one data source may contain only part of dataset)

--- src/cljs_workcalendar/app.clj
+++ src/cljs_workcalendar/app.clj
@@ -1,6 +1,7 @@
 (ns cljs-workcalendar.app
   (:require [cljs-workcalendar.datasource.workcalendarsource :as source])
-  (:require [cljs-workcalendar.datasource.consultantru :as consultant])
+  (:require [cljs-workcalendar.datasource.consultantru :as cns])
+  (:require [cljs-workcalendar.datasource.superjobru :as sj])
   (:require [cljs-workcalendar.format.formatinterface :as fmt])
   (:require [cljs-workcalendar.format.plaintextformatter])
   (:require [cljs-workcalendar.format.cljsformatter])
@@ -21,7 +22,9 @@
                                     (:year item)
                                     (:month item)
                                     (:day item)))
-                          (source/get-work-calendar (consultant/create-source)))]
+                          (distinct
+                           (concat (source/get-work-calendar (cns/create-source))
+                                   (source/get-work-calendar (sj/create-source)))))]
     (do
       (serialize-calendar calendar
                           (PlainTextWorkCalendarFormatter.)


Move expression out of GL thread

Move expression out of GL thread

--- src/clojure/nightmod/game.clj
+++ src/clojure/nightmod/game.clj
@@ -15,9 +15,10 @@

     (set-game-screen! main-screen text-screen)"
   [& game-screens]
-  (on-gl ; clear existing assets
-         (doseq [gs game-screens]
-           (-> gs :screen (swap! #(dissoc % :renderer :layers))))
+  ; remove renderers and layers so map assets can be cleared
+  (doseq [gs game-screens]
+    (-> gs :screen (swap! #(dissoc % :renderer :layers))))
+  (on-gl ; clear all assets
          (asset-manager! manager/manager :clear)
          ; set the supplied screen(s) with the overlay screen added at the end
          (apply set-screen!


Add Logging In Upsert

Add Logging In Upsert

--- src/lens/api.clj
+++ src/lens/api.clj
@@ -27,11 +27,18 @@
   [rep changes]
   (let [edited (merge rep {:data (dissoc changes :type)})]
     (if (not= rep edited)
-      (hap/update (:self (:links rep)) edited)
+      (do (log/debug "Update changed" (:self (:links rep)))
+          (hap/update (:self (:links rep)) edited))
       (go rep))))

-(defn upsert! [find-query create-form {:keys [id] :as data}]
-  {:pre [find-query id]}
+(s/defn upsert!
+  "Upserts (creates or updates) data with an id using the find query to decide
+  whether it exists already.
+
+  Returns a channel conveying the created or updated representation or any
+  errors."
+  [find-query :- hap/Query create-form :- hap/Form {:keys [id] :as data}]
+  (assert id)
   (go-try
     (let [result (<! (hap/query find-query {:id id}))]
       (if (instance? Throwable result)


Added test case for all-bonds

Added test case for all-bonds

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

--- src/conexp/tests/fca/more.clj
+++ src/conexp/tests/fca/more.clj
@@ -13,7 +13,7 @@
         conexp.tests.fca.contexts)
   (:use clojure.test))

-;;;
+;;; Subcontexts

 (deftest test-subcontext?
   (test-for-every-test-ctx
@@ -37,6 +37,20 @@
   (is (let [some-context (make-context #{1 2 3} '#{c d e} '#{[1 c] [2 c] [2 e] [3 e]})]
 	(some #(= some-context %) (compatible-subcontexts *test-ctx-08*)))))

+;;; Bonds
+
+(deftest test-all-bonds
+  (is (= 2216 (count (all-bonds (make-context-from-matrix 5 5 [0 1 0 1 0
+                                                               1 0 1 1 0
+                                                               1 0 0 0 0
+                                                               1 0 1 1 1
+                                                               0 0 0 1 1])
+                                (make-context-from-matrix 5 5 [1 1 1 0 1
+                                                               1 0 1 1 1
+                                                               1 1 1 0 0
+                                                               1 1 0 0 0
+                                                               0 1 1 0 0]))))))
+
 ;;;

 nil


cleanup

cleanup

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@9462 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- plugins/SlideExplorer2/src/slide_explorer/cache.clj
+++ plugins/SlideExplorer2/src/slide_explorer/cache.clj
@@ -52,8 +52,8 @@
 (defn add-item
   "Add an item to the LRU persistent map. Like assoc."
   ([lru-map key val overwrite?]
-  (if (or (not (lru-map key))
-          overwrite?)
+  (if (or overwrite?
+          (not (lru-map key)))
     (-> lru-map
         (assoc key val)
         (hit-item key)


First pass at full JSON output

First pass at full JSON output

--- src/nml/core.clj
+++ src/nml/core.clj
@@ -2,6 +2,7 @@
   (:require [clojure.data.json :as json  ])
   (:require [clojure.string    :as string])
   (:require [clojure.tools.cli :as cli   ])
+  (:require [clojure.walk      :as walk  ])
   (:require [instaparse.core   :as insta ])
   (:gen-class))

@@ -13,9 +14,19 @@
   (fmt-sh m))

 (defn- fmt-json [m]
-  (println m)
-  "")
-;;   (with-out-str (json/pprint m)))
+  (let [f (fn [e]
+            (let [re #"[+-]?(\d*\.)?\d+(d[+-]?\d+)?"
+                  e (if (and (string? e) (re-matches re e)) (string/replace e #"d" "e") e)
+                  x (try (read-string e) (catch Exception e nil))]
+              (cond
+                (number? x) x
+                (= "t" e) true
+                (= "f" e) false
+                (and (seq? e) (= 1 (count e))) (first e)
+                (string? e) (let [m (re-matches #"^[\'\"](.*)[\'\"]$" e)]
+                              (if m (second m) e))
+                :else e)))]
+        (with-out-str (json/pprint (walk/postwalk f m)))))

 (defn- fmt-ksh [m]
   (fmt-sh m))


Fix to permit :input items to be code literals (pushed to :exec).

--- src/clojush/instructions/input_output.clj
+++ src/clojush/instructions/input_output.clj
@@ -51,7 +51,7 @@
 (defn handle-input-instruction
   "Allows Push to handle inN instructions, e.g. in2, using things from the input
    stack. We can tell whether a particular inN instruction is valid if N-1
-   values are on the input stack."
+   values are on the input stack. Recognizes vectors, simple literals and quoted code."
   [instr state]
   (let [n (Integer/parseInt (second (first (re-seq #"in(\d+)" (name instr)))))]
     (if (or (> n (count (:input state)))
@@ -59,6 +59,7 @@
       (throw (Exception. (str "Undefined instruction: " (pr-str instr) "\nNOTE: Likely not same number of items on input stack as input instructions.")))
       (let [item (stack-ref :input (dec n) state)
             literal-type (recognize-literal item)]
-        (if (and (vector? item) (= [] item))
-          (push-item [] :vector_integer (push-item [] :vector_float (push-item [] :vector_string (push-item [] :vector_boolean state))))
-          (push-item item literal-type state))))))
+        (cond
+          (and (vector? item) (= [] item)) (push-item [] :vector_integer (push-item [] :vector_float (push-item [] :vector_string (push-item [] :vector_boolean state))))
+          (seq? item) (push-item item :exec state)
+          :else (push-item item literal-type state))))))


Remove next-view after it has been shown; tidy up

--- src/discuss/utils/common.cljs
+++ src/discuss/utils/common.cljs
@@ -211,9 +211,8 @@
 (defn change-view!
   "Change view to the provided one."
   [view]
-  (om/transact! parser/reconciler `[(layout/next-template {:value nil})
-                                    (layout/view {:value ~view})
-                                    (layout/add? {:value false})]))
+  (store-multiple-values-to-app-state!
+   [['layout/view view] ['layout/add? false]]))

 (defn next-view!
   "Set the next view, which should be loaded after the ajax call has finished."
@@ -222,16 +221,22 @@
   (hide-add-form!)
   (store-to-app-state! 'layout/view-next view))

+(defn next-view?
+  "Check whether a defined next-view exists."
+  []
+  (not (nil? (load-from-app-state :layout/view-next))))
+
 (defn change-to-next-view!
   "Set next view to current view. Falls back to default if there is no different
   next view."
   []
   (let [current-view (current-view)
-        next-view (load-from-app-state :layout/next-template)]
+        next-view (load-from-app-state :layout/view-next)]
     (if (and (not (nil? next-view!))
              (= current-view next-view))
       (change-view! :default)
-      (change-view! next-view))))
+      (do (change-view! next-view)
+          (next-view! nil)))))

 (defn save-current-and-change-view!
   "Saves the current view and changes to the next specified view. Used for the


refactored friendui-datomic into it's own project.clj

--- src/clj/de/sveri/friendui/globals.clj
+++ src/clj/de/sveri/friendui/globals.clj
@@ -1,7 +1,5 @@
 (ns de.sveri.friendui.globals
-  (:require [clojure.java.io :as io]
-            [clojure.edn :as edn]
-            [de.sveri.clojure.commons.files.edn :as commons]))
+  (:require [de.sveri.clojure.commons.files.edn :as commons]))

 (def template-path "templates/de/sveri/friendui/user/")


plot tick to 2 decimal points #359

plot tick to 2 decimal points
#359

--- src/cljs/swarmpit/component/plot.cljs
+++ src/cljs/swarmpit/component/plot.cljs
@@ -31,5 +31,6 @@
                 :b   50
                 :pad 0}
        :xaxis  {:range [now-4-hours now]}
-       :yaxis  {:title     y-title
-                :rangemode "tozero"}})))
+       :yaxis  {:title      y-title
+                :tickformat ".2f"
+                :rangemode  "tozero"}})))


Behaving sanely for now

Behaving sanely for now

--- src/cljs_bjj_tournament/handlers.cljs
+++ src/cljs_bjj_tournament/handlers.cljs
@@ -28,10 +28,9 @@
         (->/let [players (->> @app-db
                               :competitors
                               vals
-                              (map map->Competitor)
+                              ; (map map->Competitor)
                               (filter #(.in-division? division %))
-                              (partition 2)
-                              )
+                              (partition 2))
                  matches (->> players
                               (map (fn [[p1 p2]]
                                      (when (some? p2)


deep-deref takes atom or non-ref value

deep-deref takes atom or non-ref value

--- src/com/billpiel/mem_tracer/workspace.clj
+++ src/com/billpiel/mem_tracer/workspace.clj
@@ -79,10 +79,11 @@

 (defn deep-deref!
   [tree]
-  (let [dr-kids (-> tree :children util/atom?->)
-        forced-arg-map (-> tree :arg-map force)
+  (let [tree' (util/atom?-> tree)
+        dr-kids (-> tree' :children util/atom?->)
+        forced-arg-map (-> tree' :arg-map force)
         kids (mapv deep-deref! dr-kids)]
-    (assoc tree
+    (assoc tree'
            :children kids
            :arg-map forced-arg-map)))


No need to remove entity before prevent-move

--- minicraft/desktop/src-common/minicraft/core.clj
+++ minicraft/desktop/src-common/minicraft/core.clj
@@ -83,7 +83,7 @@
                       (e/animate screen)
                       (e/animate-attack screen entities)
                       (e/animate-hit entities)
-                      (e/prevent-move (remove #(= % entity) entities))
+                      (e/prevent-move entities)
                       (e/adjust-times screen))))
          e/attack-player
          u/order-by-latitude


Update doc strings.

Update doc strings.

--- src/fcms/resources/common.clj
+++ src/fcms/resources/common.clj
@@ -10,14 +10,12 @@
 ;; ----- Properties common to all FCMS resources -----

 (def
-  ^{:no-doc true}
   reserved-properties
-  "Properties that can't be specified during a create and are ignored during an update."
+  "Properties of a resource that can't be specified during a create and are ignored during an update."
   #{:id :created-at :updated-at :type :version :links})
 (def
-  ^{:no-doc true}
   retained-properties
-  "Properties that are retained during an update even if they aren't in the updated property set."
+  "Properties of a resource that are retained during an update even if they aren't in the updated property set."
   #{:name :slug :created-at :type})

 ;; ----- ISO 8601 timestamp -----
@@ -32,7 +30,9 @@
 ;; ----- Validation functions -----

 (defn valid-name?
-  "Return true if the provided name is a valid name, false if not"
+  "Returns `true` if the provided name is a valid name, `false` if not.
+
+  Any non-blank string (including Unicode) is a valid name."
   [n]
   ;; any non-blank string is a valid name
   (and (string? n) (not (s/blank? n))))
@@ -82,7 +82,7 @@
 ;; ----- Slug functions -----

 (defn valid-slug?
-  "Return true if the provided-slug is a valid slug and false if not"
+  "Returns `true` if the provided slug is a valid, and `false` if not."
   [provided-slug]
   ;; if the slug is the same one we'd provide for a resource with that name, then it's valid
   (and (string? provided-slug) (= provided-slug (slugify provided-slug)) (not (s/blank? provided-slug))))


Add finagle-clojure/scala.PartialFunction

sugar for creating a scala.PartialFunction
PartialFunctions are unary functions where
the domain and range are not of the same type constraint

--- src/finagle_clojure/scala.clj
+++ src/finagle_clojure/scala.clj
@@ -9,6 +9,8 @@
   [scala-seq]
   (JavaConversions/seqAsJavaList scala-seq))

+;; TODO use Twitter Util Function instead?
+;; https://twitter.github.io/util/util-core/target/doc/main/api/com/twitter/util/Function.html
 (defmacro Function1
   "Create a new scala.Function1.
   args-binding should be a vector containing one element,
@@ -23,3 +25,14 @@
   "Wrap a clojure IFn as a Function1"
   [f]
   (Function1 [arg] (f arg)))
+
+(defmacro PartialFunction
+  "Creates a new scala.PartialFunction.
+  args-binding should be a vector containing one element,
+  the name to bind the parameter to the PartialFunction to."
+  [[arg-class arg-name] & body]
+  `(reify scala.PartialFunction
+     (apply [~'this ~arg-name]
+       ~@body)
+     (isDefinedAt [~'this ~'v]
+       (instance? ~arg-class ~'v))))


Use the lazy version instead

Use the lazy version instead

--- src/github_changelog/util.clj
+++ src/github_changelog/util.clj
@@ -11,5 +11,5 @@
   ([s] (strip-trailing s "/"))
   ([s end]
    (if (ends-with? s end)
-     (recur (join (butlast s)) end)
+     (recur (join (drop-last s)) end)
      s)))


substitutivity and congruence for equality

--- src/latte/equal.clj
+++ src/latte/equal.clj
@@ -57,6 +57,38 @@
     (have d _ :discharge [P (c)])
     (qed d)))

+(defthm eq-subst
+  "Substitutivity property of equality."
+  [[T :type] [P (==> T :type)] [x T] [y T]]
+  (==> (equal T x y)
+       (P x)
+       (P y)))

+(proof eq-subst :script
+  (assume [H1 (equal T x y)
+           H2 (P x)]
+    (have a (<=> (P x) (P y)) :by (H1 P))
+    (have b (P y) :by ((p/iff-elim-if (P x) (P y)) (a) H2))
+    (qed (b))))

-
+(defthm eq-cong
+  "Congruence property of equality."
+  [[T :type] [U :type] [f (==> T U)] [x T] [y T]]
+  (==> (equal T x y)
+       (equal U (f x) (f y))))
+
+(proof eq-cong :script
+  (assume [H1 (equal T x y)
+           Q (==> U :type)]
+    (assume [H2 (Q (f x))]
+      (have a1 _ :by (eq-subst T (lambda [z T] (Q (f z))) x y))
+      (have a2 (Q (f y)) :by ((a1) H1 H2))
+      (have a (==> (Q (f x)) (Q (f y))) :discharge [H2 (a2)]))
+    (have b (equal T y x) :by ((eq-sym T x y) H1))
+    (assume [H3 (Q (f y))]
+      (have c1 _ :by (eq-subst T (lambda [z T] (Q (f z))) y x))
+      (have c2 (Q (f x)) :by ((c1) (b) H3))
+      (have c (==> (Q (f y)) (Q (f x))) :discharge [H3 (c2)]))
+    (have d (<=> (Q (f x)) (Q (f y))) :by ((p/iff-intro (Q (f x)) (Q (f y))) (a) (c)))
+    (have e (equal U (f x) (f y)) :discharge [Q (d)])
+    (qed (e))))


Started 6.2 (committing so I can move on at home)

--- src/fpinscala/purely_functional_state.clj
+++ src/fpinscala/purely_functional_state.clj
@@ -41,3 +41,10 @@
     (if (< n 0)
       (make-result (- (inc n)) nxt-rng)
       (make-result n nxt-rng))))
+
+;6.2
+;mine
+(defn random-double
+  "Generates random double [0, 1)"
+  [rng]
+  (let [n (non-negative-int rng)]))


allow for `{~@foo} and `#{~(gensym) ~(gensym)}

--- src/main/clojure/clojure/tools/reader.clj
+++ src/main/clojure/clojure/tools/reader.clj
@@ -28,6 +28,7 @@
          ^:dynamic *read-eval*
          ^:dynamic *data-readers*
          ^:dynamic *default-data-reader-fn*
+         ^:dynamic ^:private gensym-env
          default-data-readers)

 (defn- macro-terminating? [ch]
@@ -199,6 +200,7 @@
           :end-line end-line
           :end-column end-column})))))

+(defrecord SyntaxQuotedMap [val])
 (defn- read-map
   [rdr _]
   (let [[start-line start-column] (when (indexing-reader? rdr)
@@ -207,12 +209,17 @@
         map-count (count the-map)
         [end-line end-column] (when (indexing-reader? rdr)
                                 [(get-line-number rdr) (int (get-column-number rdr))])]
-    (when (odd? map-count)
+    (when (and (odd? map-count)
+               (or (not gensym-env)
+                   (not-any? #(= 'clojure.core/unquote-splicing (first %))
+                           (filter seq? the-map))))
       (reader-error rdr "Map literal must contain an even number of forms"))
     (with-meta
       (if (zero? map-count)
         {}
-        (RT/map (to-array the-map)))
+        (if gensym-env
+          (SyntaxQuotedMap. the-map)
+          (RT/map (to-array the-map))))
       (when start-line
         (merge
          (when-let [file (get-file-name rdr)]
@@ -352,11 +359,14 @@
               (reset-meta! o m)))
           (reader-error rdr "Metadata can only be applied to IMetas"))))))

+(defrecord SyntaxQuotedSet [val])
 (defn- read-set
   [rdr _]
   (let [[start-line start-column] (when (indexing-reader? rdr)
                                     [(get-line-number rdr) (int (dec (get-column-number rdr)))])
-        the-set (PersistentHashSet/createWithCheck (read-delimited \} rdr true))
+        the-set (if gensym-env
+                  (SyntaxQuotedSet. (read-delimited \} rdr true))
+                  (PersistentHashSet/createWithCheck (read-delimited \} rdr true)))
         [end-line end-column] (when (indexing-reader? rdr)
                                 [(get-line-number rdr) (int (get-column-number rdr))])]
     (with-meta the-set
@@ -467,10 +477,11 @@

 (defn- read-unquote
   [rdr comma]
-  (if-let [ch (peek-char rdr)]
-    (if (identical? \@ ch)
-      ((wrapping-reader 'clojure.core/unquote-splicing) (doto rdr read-char) \@)
-      ((wrapping-reader 'clojure.core/unquote) rdr \~))))
+  (binding [gensym-env nil]
+    (if-let [ch (peek-char rdr)]
+      (if (identical? \@ ch)
+        ((wrapping-reader 'clojure.core/unquote-splicing) (doto rdr read-char) \@)
+        ((wrapping-reader 'clojure.core/unquote) rdr \~)))))

 (declare syntax-quote*)
 (defn- unquote-splicing? [form]
@@ -573,10 +584,14 @@

     (coll? form)
     (cond
+     (instance? SyntaxQuotedMap form) (syntax-quote-coll 'clojure.core/hash-map (:val form))
+     (instance? SyntaxQuotedSet form) (syntax-quote-coll 'clojure.core/hash-set (:val form))
+
      (instance? IRecord form) form
      (map? form) (syntax-quote-coll 'clojure.core/hash-map (flatten-map form))
      (vector? form) (syntax-quote-coll 'clojure.core/vector form)
      (set? form) (syntax-quote-coll 'clojure.core/hash-set form)
+
      (or (seq? form) (list? form))
      (let [seq (seq form)]
        (if seq


Make guitaresque neater.

Make guitaresque neater.

--- src/kolmogorov_music/song.clj
+++ src/kolmogorov_music/song.clj
@@ -17,7 +17,7 @@
       (+ (* 1/3 (sin-osc (* 1/2 freq))))
       (rlpf (line:kr 5000 0 1.0) 1/50)
       (clip2 0.5)
-      (* (env-gen (adsr 0.05 (* dur 1/3) 0.2) (line:kr 1 0 dur) :action FREE))
+      (* (env-gen (adsr 0.05 (* dur 1/3) 0.3 0) (line:kr 1 0 dur) :action FREE))
       (* vol)))

 ; Arrangement
@@ -102,6 +102,7 @@
    ; Loop the track, allowing live editing.
   (live/stop)
   (live/play (track row))
+
   (fx-reverb)
   (fx-chorus)
   (fx-distortion)


remove manual hud injection from browser target as it is now always used

--- src/main/shadow/build/targets/browser.clj
+++ src/main/shadow/build/targets/browser.clj
@@ -142,17 +142,14 @@

 (defn inject-repl-client
   [{:keys [entries] :as module-config} state build-config]
-  (let [{:keys [enabled hud]}
+  (let [{:keys [enabled]}
         (:devtools build-config)
+
         entries
         (-> []
             (cond->
               (not (false? enabled))
-              (into '[cljs.user shadow.cljs.devtools.client.browser])
-
-              (and (not (false? enabled))
-                   (not (false? hud)))
-              (conj 'shadow.cljs.devtools.client.hud))
+              (into '[cljs.user shadow.cljs.devtools.client.browser]))

             (into entries))]


Import and display education component

Import and display education component

--- app/src/cljs/app/app.cljs
+++ app/src/cljs/app/app.cljs
@@ -2,7 +2,7 @@
   (:require [cljsjs.material]
             [reagent.core :as reagent]
             [app.components :as comps]
-            [app.res :refer [resume]]))
+            [app.res :refer [sample-resume]]))

 (defn fixed-header-and-drawer-component [content]
   [:div.mdl-layout.mdl-js-layout.mdl-layout--fixed-drawer.mdl-layout--fixed-header
@@ -25,15 +25,17 @@
   [:div
    [fixed-header-and-drawer-component
     [:div
-     [comps/contact-component (:name (:contact resume))
-      (:email (:contact resume))
-      (:phone (:contact resume))]
+     [comps/contact-component (:name (:contact sample-resume))
+      (:email (:contact sample-resume))
+      (:phone (:contact sample-resume))]
      [comps/about-component
-      [:p (:profile resume)]]
+      [:p (:profile sample-resume)]]
      [comps/projects-component
-      (:projects resume)]
+      (:projects sample-resume)]
      [comps/employment-component
-      (:employment resume)]]]])
+      (:employment sample-resume)]
+     [comps/education-component
+      (:education sample-resume)]]]])


small refactoring

small refactoring

--- resources/clj/new/closp/src/clj/routes/user.clj
+++ resources/clj/new/closp/src/clj/routes/user.clj
@@ -125,9 +125,7 @@
               (assoc :flash {:toast {:text (localize [:user/user_added]) :classes "green lighten1"}})))
       (admin-page (merge validation-errors {:email email :displayname displayname}) req db))))

-(defn signup-user [email password displayname re-captcha-token db
-                   {:keys [private-recaptcha-key] :as config}
-                   {:keys [localize] :as req}]
+(defn signup-user [db config {:keys [email password displayname re-captcha-token localize] :as req}]
   (let [validation-errors (validate-signup email password localize db
                                            (:captcha-enabled? config) re-captcha-token
                                            private-recaptcha-key)]
@@ -147,13 +145,12 @@
     (GET "/user/changepassword" req (vh/changepassword-page {} req))
     (POST "/user/changepassword" [oldpassword password confirm :as req]
       (changepassword oldpassword password confirm req db))
-    (POST "/user/signup" [email password re-captcha-token displayname :as req]
-      (signup-user email password displayname re-captcha-token db config req))
+    (POST "/user/signup" req (signup-user db config req))
     (GET "/user/signup" req (signup-page config {} req))
     (POST "/admin/user/update" [user-email role active update_delete :as req]
       (update-user update_delete user-email role active req db))
     (POST "/admin/user/delete" [user-email delete_cancel :as req]
       (really-delete user-email delete_cancel req db))
-    (POST "/admin/user/add" [email password confirm displayname :as req]
+    (POST "/admin/user/add" [email password displayname :as req]
       (admin-add-user email password req displayname db))
     (GET "/admin/users" [filter :as req] (admin-page {:filter filter} req db))))


Revert "small improvement"

Revert "small improvement"

This reverts commit 490e42745565366b5a3e9ae4378f94c680083b41.

--- src/mandel/core.clj
+++ src/mandel/core.clj
@@ -8,17 +8,15 @@

 (defn mandelbrot
   [^double cx ^double cy ^long max-iterations]
-  (let [log2 (Math/log 2)
-        log4 (Math/log 4)]
-    (loop [x 0
-           y 0
-           iter 0]
-      (let [abs-squared (+ (* x x) (* y y))]
-        (if (or (> abs-squared 8) (= iter max-iterations))
-          (- iter (/ (Math/log (/ (Math/log abs-squared) log4)) log2))
-          (recur (+ (- (* x x) (* y y)) cx)
-                 (+ (* 2 x y) cy)
-                 (unchecked-inc iter)))))))
+  (loop [x 0
+         y 0
+         iter 0]
+    (let [abs-squared (+ (* x x) (* y y))]
+      (if (or (> abs-squared 8) (= iter max-iterations))
+        (- iter (/ (Math/log (/ (Math/log abs-squared) (Math/log 4))) (Math/log 2)))
+        (recur (+ (- (* x x) (* y y)) cx)
+               (+ (* 2 x y) cy)
+               (unchecked-inc iter))))))

 (defn hue-to-rgb ^long
   [^long hue]
@@ -78,6 +76,6 @@
 (defn -main
   "I don't do a whole lot ... yet."
   [& args]
-  (mandel 800 800))
+  (mandel 400 400))