rm decorate-dots create-dots

rm decorate-dots create-dots

--- examples/lesson-carousel-starter-kit/src/carousel/core.cljs
+++ examples/lesson-carousel-starter-kit/src/carousel/core.cljs
@@ -24,48 +24,6 @@
 (defonce Vec3 (.. math -Vec3))

 (defonce ABSOLUTE (.. Size -ABSOLUTE))
-
-(defn decorate-dots [dots-node]
-  (let [dot-nodes (.. dots-node getChildren)
-        resize (clj->js {:onSizeChange (fn [^Float32Array size]
-                                         "NOTE: this call back is called only once because root-dot setSizeMode is ABSOLUTE (value of 1)"
-                                         (let [size (IndexedSeq. size 0)
-                                               dotWidth 10
-                                               numPages 5
-                                               spacing 5
-                                               totalDotSize (+ (* numPages dotWidth)
-                                                               (* spacing (dec numPages)))
-                                               start-x (/ (- (nth size 0) totalDotSize)
-                                                          2)]
-                                           (doseq [n (range (count dot-nodes))
-                                                   :let [dot-node (nth dot-nodes n)]]
-                                             (.. dot-node (setPosition (+ start-x
-                                                                          (* n
-                                                                             (+ dotWidth spacing)))
-                                                                       0
-                                                                       0)))))})]
-    (doseq [dot-node dot-nodes]
-      (.. (DOMElement. dot-node)
-          (setProperty "borderRadius" "5px")
-          (setProperty "border" "2px solid white")
-          (setProperty "boxSizing" "border-box")))
-
-    (.. dots-node (addComponent resize))))
-
-(defn create-dots [root-node]
-  (let [root-dot (.. root-node addChild)]
-    (doseq [i (range 5)
-            :let [dot-node (.. root-dot addChild)]]
-      (.. dot-node
-          (setSizeMode ABSOLUTE ABSOLUTE)
-          (setAbsoluteSize 5 5)))
-    (.. root-dot
-        (setSizeMode ABSOLUTE ABSOLUTE)
-        (setAbsoluteSize 20 20)
-        (setPosition 0 -50 0)
-        (setAlign 0.5 1 0)
-        (setMountPoint .5, 1, 0))
-    root-dot))

 (defn create-pages [root-node simulation]
   (let [url-base "http://demo.famo.us.s3.amazonaws.com/hub/apps/carousel/Museo_del_Prado_-_Goya_-_Caprichos_-_No._"
@@ -205,7 +163,6 @@
         next-node (second children)
                                         ;next-clicks (events->chan next-node "tap")

-                                        ;dots-node (create-dots root-node)
                                         ;pages (create-pages root-node simulation)

                                         ;current-index (atom 0)


Got navbar working as it should.

Got navbar working as it should.

--- src/cadence/views/common.clj
+++ src/cadence/views/common.clj
@@ -33,17 +33,11 @@
             (base-layout
               [:div#navbar.navbar.navbar-fixed-top
                [:div.navbar-inner
-                [:div.container-fluid
+                [:div.container
                  [:a.btn.btn-navbar
-                  {:data-toggle "collapse" :data-target ".navbar-collapse"}
+                  {:data-toggle "collapse" :data-target ".nav-collapse"}
                   [:span.icon-bar] [:span.icon-bar] [:span.icon-bar]]
-                 [:div#site-title.dropdown.nav
-                  [:a.brand.dropdown-toggle
-                   {:href "#"
-                    :data-toggle "dropdown"}
-                   "Cadence " [:b.caret.white-icon]]
-                  [:ul.dropdown-menu
-                   [:li [:a {:href "cadence.js"} "Cadence.js"]]]]
+                  [:a.brand.dropdown-toggle {:href "#"} "Cadence"]
                   [:div.nav-collapse
                    [:ul.nav
                     [:li.active [:a {:href "/"}
@@ -53,4 +47,5 @@
                     [:li.divider-vertical]
                     (user-links)]
                    ]]]]
-               [:div#main.container-fluid content]))
+               [:div#main-wrapper
+                [:div#main.container content]]))


Add class property to submit

Add class property to submit

--- src/cljs/re_form/submit.cljs
+++ src/cljs/re_form/submit.cljs
@@ -1,7 +1,13 @@
 (ns re-form.submit
   (:require [re-frame.core :as rf]
             [re-form.core :as fc]
-            [re-form.context :as ctx]))
+            [re-form.context :as ctx]
+            [clojure.string :as str]))
+
+(defn- process-class [class]
+  (if (keyword? class)
+    (str/join " " (str/split (name class) \.))
+    class))

 (defn- submit-button* [{:keys [form-name] :as props} & children]
   (let [form-errors (rf/subscribe [:re-form/form-errors form-name])
@@ -11,10 +17,10 @@
                   (when (empty? @form-errors)
                     (and submit-fn (submit-fn @form-value))))]

-    (fn [{submit-fn :submit-fn}]
+    (fn [{:keys [submit-fn class]}]
       (into [:button.submit {:type "submit"
-                             :on-click #(onclick submit-fn)
-                             :disabled disabled?}]
+                             :class (process-class class)
+                             :on-click #(onclick submit-fn)}]
             children))))

 (defn submit-button [props & children]


Use properly the async socket constructor on clojure implementation.

--- src/clojure/nanomsg/core.clj
+++ src/clojure/nanomsg/core.clj
@@ -76,7 +76,7 @@
    (let [factory (get impl/*supported-sockets* socktype)
          socket (factory)
          conn (if (:async opts)
-                (impl/async-socket socket (AsyncSocket. socket))
+                (impl/async-socket socket)
                 (impl/blocking-socket socket))]
      (cond
        (:bind opts) (bind! conn (:bind opts))


status bar

status bar

--- src/mermaid_ldjam/core.cljs
+++ src/mermaid_ldjam/core.cljs
@@ -159,10 +159,10 @@
   (doseq [[k v] (:entities state)] (draw-entity k v (:last-clicked state))))

 (defn draw-status-bar [state]
-  (q/image (load-image "resources/status-bar.png") -10 -6 (+ (q/width) 25) 60)
+  (q/image (load-image "resources/status-bar.png") -10 -6 (+ (q/width) 25) 70)
   (q/fill 54 44 33)
   (q/text-align :left)
-  (q/text (:current-status state) 20 15 (- (q/width) 120) 90)
+  (q/text (:current-status state) 20 15 (- (q/width) 140) 90)
   (q/text-align :right)
   (q/text (:last-clicked state) (- (q/width) 150) 15 120 90))


Fixed a typo

Fixed a typo

--- src/midje/util/laziness.clj
+++ src/midje/util/laziness.clj
@@ -1,15 +1,13 @@
 ;; -*- indent-tabs-mode: nil -*-

-(ns midje.util.laziness
-  (:require [clojure.zip :as zip]))
-
+(ns midje.util.laziness)

 (defn eagerly
   "Descend form, converting all lazy seqs into lists.
    Metadata is preserved. In the result all non-collections
    are identical? to those in the original form (as is
    their metadata). None of the collections are identical?
-   even if they contains no lazy seqs."
+   even if they contain no lazy seqs."
   ;; Modified from clojure.walk/walk
   [form]
   (let [m #(with-meta % (meta form))]


Fix markdown spec.

Fix markdown spec.

--- spec/incise/parsers/impl/markdown_spec.clj
+++ spec/incise/parsers/impl/markdown_spec.clj
@@ -2,13 +2,16 @@
   (:require [speclj.core :refer :all]
             [clojure.java.io :refer [file resource]]
             [incise.core] ; Ensure that layouts have been loaded
-            [incise.parsers.core :as pc]
-            [incise.parsers.impl.markdown :refer :all])
+            (incise.parsers [core :as pc]
+                            [html :refer [html-parser]])
+            [incise.parsers.impl.markdown :refer :all]
+            [markdown.core :as md])
   (:import [java.io File]))

 (describe "parsing"
   (with markdown-file (file (resource "spec/another-forgotten-binding-pry.md")))
+  (with parser (html-parser md/md-to-html-string))
   (it "does something"
-    (should= "" (pc/Parse->string (parse @markdown-file)))))
+    (should-not-throw (@parser @markdown-file))))

 (run-specs)


whoops! uncomment key-queue

whoops! uncomment key-queue

--- frontend/components/key_queue.cljs
+++ frontend/components/key_queue.cljs
@@ -105,27 +105,25 @@
     om/IDidMount
     (did-mount [_]
       (let [ch (om/get-state owner :ch)]
-        (comment        (async/tap key-mult ch)
-                        (async/go-loop [waiting-keys []
-                                        t-chan nil]
-                                       (let [t-chan        (or t-chan (async/chan))
-                                             [e read-chan] (async/alts! [ch t-chan])]
-                                         (if (= read-chan ch)
-                                           (let [all-keys (conj waiting-keys e)]
-                                             (if-let [key-fn (match-keys @keymap all-keys)]
-                                               (do (try (key-fn e)
-                                                        ;; Catch any errors to avoid breaking key loop
-                                                        (catch js/Object error
-                                                          (utils/log-pr "Error calling" key-fn
-                                                                        "with key event" e ":")
-                                                          (utils/stack-trace error)
-                                                          (put! error-ch [:keyboard-handler-error error])))
-                                                   (recur [] nil))
-                                               ;; No match yet, but remember in case user is entering
-                                               ;; a multi-key combination.
-                                               (recur all-keys (async/timeout 1000))))
-                                           ;; Read channel was timeout.  Forget stored keys
-                                           (recur [] nil)))))))
+        (async/tap key-mult ch)
+        (async/go-loop [waiting-keys []
+                        t-chan nil]
+                       (let [t-chan        (or t-chan (async/chan))
+                             [e read-chan] (async/alts! [ch t-chan])]
+                         (if (= read-chan ch)
+                           (let [all-keys (conj waiting-keys e)]
+                             (if-let [key-fn (match-keys @keymap all-keys)]
+                               (do (try (key-fn e)
+                                        ;; Catch any errors to avoid breaking key loop
+                                        (catch js/Object error
+                                          (utils/merror error "Error calling" key-fn "with key event" e)
+                                          (put! error-ch [:keyboard-handler-error error])))
+                                   (recur [] nil))
+                               ;; No match yet, but remember in case user is entering
+                               ;; a multi-key combination.
+                               (recur all-keys (async/timeout 1000))))
+                           ;; Read channel was timeout.  Forget stored keys
+                           (recur [] nil))))))
     om/IWillUnmount
     (will-unmount [_]
       (let [ch (om/get-state owner :ch)]


Display navigation on non home links

Display navigation on non home links

--- src/reddio_frontend/screens/app.cljs
+++ src/reddio_frontend/screens/app.cljs
@@ -2,12 +2,14 @@
   (:require [re-frame.core :as rf]
             [reddio-frontend.bridge :as bridge]
             [reddio-frontend.screens.shared.header :as header]
-            [reddio-frontend.screens.home.top-subreddits :as top-subreddits]))
+            [reddio-frontend.screens.home.top-subreddits :as top-subreddits]
+            [reddio-frontend.screens.listings.listings :as listings]))

 (defn app []
   (let [route @(rf/subscribe [:route])]
     [:> bridge/root-provider
      [:div.app
       [header/main]
-      (when (= route "/")
-        [top-subreddits/main {:url-path "/r/listentothis"}])]]))
+      (if (= route "/")
+        [top-subreddits/main]
+        [listings/main {:url-path route}])]]))


Computer has 65536 bytes of memory, not 64000 :)

--- src/emm_ess_pee/computer.clj
+++ src/emm_ess_pee/computer.clj
@@ -307,7 +307,7 @@
   "Make a bag of state we call a computer, set PC to 0x4400"
   []
   (let [computer {:registers (vec (repeat 16 (make-word 0)))
-                  :memory (vec (repeat 64000 (make-byte 0)))}]
+                  :memory (vec (repeat 0xffff (make-byte 0)))}]
     (set-PC computer 0x4400)))


Refactoring

Refactoring


CMR-665: Create ECHO business schema if it does not already exist

--- metadata-db-app/src/cmr/db.clj
+++ metadata-db-app/src/cmr/db.clj
@@ -5,8 +5,36 @@
             [cmr.oracle.user :as o]
             [cmr.oracle.config :as oracle-config]
             [cmr.metadata-db.config :as mdb-config]
+            [cmr.common.config :as cfg]
+            [cmr.metadata-db.data.oracle.sql-utils :as su]
             [config.migrate-config :as mc])
   (:gen-class))
+
+(def business-user (cfg/config-value-fn :echo-business-user "DEV_52_BUSINESS"))
+
+(def create-security-token-table-sql
+  "Create security token table in ECHO business schema"
+  (format "CREATE TABLE %s.SECURITY_TOKEN (
+          token VARCHAR2(200 CHAR),
+          guest NUMBER(10),
+          user_guid VARCHAR2(50 CHAR),
+          act_as_user_guid VARCHAR2(50 CHAR),
+          expires TIMESTAMP(6),
+          revoked TIMESTAMP(6))" (business-user)))
+
+(def create-group2-member-table-sql
+  "Create group2_member table in ECHO business schema"
+  (format "CREATE TABLE %s.GROUP2_MEMBER (
+          user_guid VARCHAR2(50 CHAR),
+          group_guid VARCHAR2(50 CHAR))" (business-user)))
+
+(defn- create-echo-business-schema
+  "Creates the minimum business-schema setup in order to support metadata-db accesses. Only the
+  tables actually accessed are created and those tables only have the columns used by metadata-db.
+  Throws an exception if creation fails."
+  [db]
+  (su/query db [create-security-token-table-sql])
+  (su/query db [create-group2-member-table-sql]))

 (defn create-user
   []
@@ -14,11 +42,23 @@
         catalog-rest-user (mdb-config/catalog-rest-db-username)
         metadata-db-user (mdb-config/db-username)]
     (o/create-user db metadata-db-user (mdb-config/db-password))
+    ;; Metadata DB needs access to the catalog-rest database tables for the DB synchronization task.
+    ;; It also needed access for the initial migration of data from ECHO to CMR.
     (o/grant-select-privileges db catalog-rest-user metadata-db-user)
+    ;; Allow database synchronization tests to create and drop tables in the Catalog REST database.
+    (o/grant-create-drop-any-table-privileges db metadata-db-user)

-    ;; This is done to allow bootstrap tests to create and drop test tables in the Catalog REST
-    ;; database schema.
-    (o/grant-create-drop-any-table-privileges db metadata-db-user)))
+    ;; Due to poor performance from the ECHO ACL endpoint we directly access the ECHO business
+    ;; schema. For initial setup the database tables may or may not exist already. We create the
+    ;; tables as needed for CMR if they do not exist.
+    (try
+      (create-echo-business-schema db)
+      (catch Exception e
+        (cmr.common.dev.capture-reveal/capture e)
+        (if (= "ORA-00955: name is already used by an existing object\n" (.getMessage e))
+          (info "ECHO business schema already exists, ignoring error")
+          (throw e))))
+    (o/grant-select-privileges db (business-user) metadata-db-user)))

 (defn drop-user
   []


Adjusted video dimensions

Adjusted video dimensions


switch info order

switch info order

--- src/clj/swarmpit/docker/mapper/inbound.clj
+++ src/clj/swarmpit/docker/mapper/inbound.clj
@@ -202,7 +202,7 @@
       (count)))

 (defn ->service-info-status
-  [service-replicas service-replicas-running]
+  [service-replicas-running service-replicas]
   (str service-replicas-running " / " service-replicas))

 (defn ->service-state


Added compojure routes for static resources and 404 not found.

--- src/clj_formal_specifications_app/core.clj
+++ src/clj_formal_specifications_app/core.clj
@@ -1,5 +1,6 @@
 (ns clj-formal-specifications-app.core
   (:require [compojure.core :refer :all]
+            [compojure.route :as route]
             [ring.middleware.defaults :refer :all]
             [ring.util.response :as resp]
             [org.httpkit.server :refer [run-server]]))
@@ -11,7 +12,9 @@
     "text/html"))

 (defroutes site-routes
-  (GET "/" [] index))
+  (GET "/" [] index)
+  (route/resources "/")
+  (route/not-found "Not found!"))

 (defn -main []
   (run-server (wrap-defaults site-routes site-defaults) {:port 5000}))


Modified the REST api so that the returned ref contents are returned as a string imitating clojure data structures instead of json.

--- src/clj_formal_specifications_app/core.clj
+++ src/clj_formal_specifications_app/core.clj
@@ -52,7 +52,7 @@
 (defn conj-spec-refs
   [spec-refs spec-ref-entry]
   (conj spec-refs {:name (key spec-ref-entry)
-                   :contents @(var-get (val spec-ref-entry))}))
+                   :contents (str @(var-get (val spec-ref-entry)))}))

 (defn assoc-to-spec
  [spec map-entry]


Modified Digits program to print the automatic tags

--- src/clojush/problems/software/digits_c.clj
+++ src/clojush/problems/software/digits_c.clj
@@ -121,6 +121,9 @@
   (let [best-test-errors (:test-errors (error-function best :test))
         best-total-test-error (apply +' best-test-errors)]
     (println ";;******************************")
+    (println ";;Automatic tags used to intialize the tagspace:")
+    (println "Auto-tags:" (keys (get (tagspace-initialization (str (:program best)) 100 (make-push-state)) :tag)))
+    (println (get (tagspace-initialization (str (:program best)) 100 (make-push-state)) :tag))
     (printf ";; -*- Digits problem report - generation %s\n" generation)(flush)
     (println "Test total error for best:" best-total-test-error)
     (println (format "Test mean error for best: %.5f" (double (/ best-total-test-error (count best-test-errors)))))


Add network for simple graphql integration

--- src/com/wsscode/pathom/fulcro/network.cljs
+++ src/com/wsscode/pathom/fulcro/network.cljs
@@ -2,7 +2,12 @@
   (:require [clojure.core.async :refer [go <! >! put! promise-chan close!]]
             [com.wsscode.common.async-cljs :refer [<? go-catch <!p]]
             [com.wsscode.pathom.core :as p]
-            [fulcro.client.network :as fulcro.network])
+            [com.wsscode.pathom.profile :as pp]
+            [com.wsscode.pathom.graphql :as pg]
+            [com.wsscode.pathom.diplomat.http :as http]
+            [com.wsscode.pathom.diplomat.http.fetch :as fetch]
+            [fulcro.client.network :as fulcro.network]
+            [fulcro.client.primitives :as fp])
   (:import [goog.net XhrIo EventType]))

 ;; EXPERIMENTAL - all features here are experimental and subject to API changes and breakages
@@ -161,6 +166,39 @@
   [network]
   (transform-remote network
     {::transform-query (fn [_ query] (conj query :com.wsscode.pathom.profile/profile))}))
+
+;; GraphQL Simple Network
+
+(def graphql-response-key (comp keyword pg/camel-case name))
+
+(def graphql-response-parser
+  (p/parser {::p/env    {::p/reader (p/map-reader* {::p/map-key-transform graphql-response-key})}
+             ::p/mutate (fn [env k _]
+                          {:action
+                           (fn []
+                             (let [response (-> (p/entity env) (get (graphql-response-key k)))
+                                   id-param (pg/find-id (get-in env [:ast :params]))]
+                               (cond-> response
+                                 id-param (assoc ::fp/tempids {(val id-param) (get response (graphql-response-key (key id-param)))}))))})}))
+
+(defn graphql-network [url]
+  (fn-network
+    (fn [this edn ok error]
+      (go
+        (try
+          (let [edn      (-> edn
+                             p/query->ast
+                             (p/elide-ast-nodes #{::pp/profile})
+                             p/ast->query)
+                query    (pg/query->graphql edn {::pg/js-name (comp pg/camel-case name)})
+                response (<? (fetch/request-async {::http/url         url
+                                                   ::http/method      ::http/post
+                                                   ::http/as          ::http/json
+                                                   ::http/form-params {:query query}}))
+                {:keys [data errors]} (::http/body response)]
+            (ok (graphql-response-parser {::p/entity data} edn)))
+          (catch :default e
+            (error e)))))))

 ;; Batch Networking


Update location of Cell class

Update location of Cell class

--- src/play_clj/ui.clj
+++ src/play_clj/ui.clj
@@ -6,15 +6,14 @@
            [com.badlogic.gdx.graphics Color Texture]
            [com.badlogic.gdx.graphics.g2d TextureRegion]
            [com.badlogic.gdx.scenes.scene2d Actor Stage]
-           [com.badlogic.gdx.scenes.scene2d.ui ButtonGroup CheckBox Container
-            Dialog HorizontalGroup Image ImageButton ImageTextButton Label
-            ScrollPane SelectBox Skin Slider Stack Table TextButton TextField
-            Tree Tree$Node VerticalGroup WidgetGroup Window]
+           [com.badlogic.gdx.scenes.scene2d.ui ButtonGroup Cell CheckBox
+            Container Dialog HorizontalGroup Image ImageButton ImageTextButton
+            Label ScrollPane SelectBox Skin Slider Stack Table TextButton
+            TextField Tree Tree$Node VerticalGroup WidgetGroup Window]
            [com.badlogic.gdx.scenes.scene2d.utils ActorGestureListener
             ChangeListener ClickListener DragListener FocusListener
             NinePatchDrawable SpriteDrawable TextureRegionDrawable
             TiledDrawable]
-           [com.esotericsoftware.tablelayout Cell]
            [play_clj.entities ActorEntity]))

 (defmacro drawable


output req params

output req params

--- src/rester/core.clj
+++ src/rester/core.clj
@@ -84,9 +84,10 @@
                            :else %)
         format-headers (fn [headers]
                          (->> headers (map #(str/join ":" %)) (str/join "\n")))]
-    (format "\n%s %s\n%s\npayload:\n%s\nresponse status:%d\n%s\nbody:\n%s"
+    (format "\n%s %s\n%s\nparams:%s\npayload:\n%s\nresponse status:%d\n%s\nbody:\n%s"
             (:verb req) (:url req)
             (format-headers (:headers req))
+            (format-headers (:params req))
             (format-body (:payload req))
             (:status res)
             (format-headers (:headers res))


result

result

--- src/secon3/core.clj
+++ src/secon3/core.clj
@@ -1,6 +1,103 @@
-(ns secon3.core)
+(ns secon3.core
+  (:require
+    [hiccup.core :as hc]
+    [hiccup.page :as hp]
+    [ring.middleware.defaults :as rmd]
+    [org.httpkit.server :as ohs]))

-(defn foo
-  "I don't do a whole lot."
-  [x]
-  (println x "Hello, World!"))
+;; start at 18:25
+;; start at 18:57
+
+(defn layout [& cnt]
+  (hp/html5
+    [:head
+     (hp/include-css "/app.css")]
+    [:body
+     cnt
+     (hp/include-js "/app.js")]))
+
+(defn ok [body]
+  {:status 200
+   :body body
+   :headers {"Content-Type" "text/html"}})
+
+(defn index [req]
+  (ok (layout [:textarea#inp] [:div#out])))
+
+#_(def clients (atom #{}))
+
+(defn broad-cast [msg]
+  (doseq [ch @clients]
+    (ohs/send! ch msg)))
+
+(defn c [clr cnt]
+  [:span {:style (str "color:" clr)} cnt])
+
+(defn gray [x]
+  (c "gray" x))
+
+(defn hl [x]
+  (cond
+    (keyword? x) (c "cyan" (pr-str x))
+    (string? x) (c "green" (pr-str x))
+    (number? x) (c "red" (pr-str x))
+    (vector? x) [:span (gray "[") (interpose " " (map hl x)) (gray "]")]
+    (list? x) [:span (gray "(") (c "orange" (first x)) " " (interpose " " (map hl (rest x))) (gray ")")]
+    (map? x) [:span (gray "{")
+              (interpose " " (map (fn [[k v]]
+                                    [:span (hl k) " " (hl v)]
+                                    ) x))
+              (gray "}")]
+    :else (pr-str x)))
+
+(defn myeval [s]
+  (try
+    (let [res (with-out-str
+                (-> (read-string s)
+                    (eval)
+                    (pr-str)
+                    (println)))]
+      [:div.message [:pre (hl (read-string s))] [:pre res]])
+    (catch Exception e
+      [:div.message.error
+       [:pre (with-out-str (clojure.stacktrace/print-stack-trace e))]])))
+
+(defn repl [req]
+  (ohs/with-channel req ch
+    (println "New ch" ch)
+    (swap! clients conj ch)
+    (ohs/on-receive ch
+                    (fn [msg]
+                      (broad-cast (hc/html (myeval msg)))))
+    (ohs/on-close ch (fn [_]
+                       (println "Close ch" ch)
+                       (swap! clients disj ch)))))
+
+(defn not-found [req]
+  (ok (layout [:h1 "Handler for " (:uri req) " not found"])))
+
+(def routes
+  {"/" index
+   "/repl" repl})
+
+(defn dispatch [{uri :uri :as req}]
+  (let [h (get routes uri not-found)]
+    (h req)))
+
+(def app
+  (-> dispatch
+      (rmd/wrap-defaults rmd/site-defaults)))
+
+(defn start [port]
+  (def stop
+    (ohs/run-server #'app {:port port})))
+
+
+(comment
+
+  (start 8080)
+  (require '[vinyasa.pull :as vp])
+  (vp/pull 'http-kit)
+  (vp/pull 'hiccup)
+  (vp/pull 'ring/ring-defaults)
+  )


CMR-7382: set Point count to 100.

CMR-7382: set Point count to 100.

--- spatial-lib/src/cmr/spatial/point.clj
+++ spatial-lib/src/cmr/spatial/point.clj
@@ -140,7 +140,7 @@
               (.equals this o)))
   ;; Don't know what I am doing, put the following three functions here to deal with CI build error:
   ;; java.lang.AbstractMethodError: Method cmr/spatial/point/Point.count()I is abstract
-  (count [this] 0)
+  (count [this] 100)
   (cons [this _o] nil)
   (empty [this] nil)


Project vcs-type must match to show insights

--- src-cljs/frontend/models/project.cljs
+++ src-cljs/frontend/models/project.cljs
@@ -173,14 +173,12 @@
 (defn show-build-timing? [project plan]
   (show-premium-content? project plan))

-(defn show-insights? [plans project]
-  (let [org-name (-> project
-                     (:vcs_url)
-                     (vcs-url/org-name))
+(defn show-insights? [plans {:keys [vcs_url] :as project}]
+  (let [org-name (vcs-url/org-name vcs_url)
+        vcs-type (vcs-url/vcs-type vcs_url)
         org-best-plan (->> plans
-                           (filter #(-> %
-                                        :org_name
-                                        (= org-name)))
+                           (filter #(and (= org-name (:org_name %))
+                                         (= vcs-type (:vcs_type %))))
                            (first)
                            (:plans)
                            (apply max-key plan-model/paid-linux-containers))]


formatting

formatting

--- replication-model/test/replication_model/core_test.clj
+++ replication-model/test/replication_model/core_test.clj
@@ -53,7 +53,7 @@
 (deftest txn-test
   (binding [clojure.pprint/*print-miser-width* 110
             clojure.pprint/*print-right-margin* 110]
-        (pprint (nth (iterate step (state 3)) 100))
+    (pprint (nth (iterate step (state 3)) 100))

     (let [v (violations (state 3) 100000 20)
           vb (boolean v)]


Can now just use var directly

Can now just use var directly

Var is now properly syntax-quoted

--- planck-cljs/src-bundle/cljs/test.clj
+++ planck-cljs/src-bundle/cljs/test.clj
@@ -85,7 +85,7 @@
       `(do
          (def ~(vary-meta name assoc :test `(fn [] ~@body))
            (fn [] (cljs.test/test-var (@cljs.test$macros/vars ~id))))
-         (swap! vars assoc ~id (~'var ~name))
+         (swap! vars assoc ~id (var ~name))
          nil))))

 (defmacro async
@@ -193,7 +193,7 @@
                (filter (fn [[_ v]] (:test v)))
                (sort-by (fn [[_ v]] (:line v)))
                (map (fn [[k _]]
-                      `(~'var ~(symbol (name ns) (name k))))))])
+                      `(var ~(symbol (name ns) (name k))))))])
         [(fn []
            (when (nil? env#)
              (cljs.test/clear-env!)))]))))


As before 0.2.0

As before 0.2.0

--- examples/todomvc/project.clj
+++ examples/todomvc/project.clj
@@ -1,9 +1,9 @@
-(defproject todomvc-re-frame "0.1.8"
+(defproject todomvc-re-frame "0.2.0"
   :dependencies [[org.clojure/clojure "1.6.0"]
                  [org.clojure/clojurescript "0.0-2816"]
                  [reagent "0.5.0-alpha3"]
                  [figwheel "0.2.3-SNAPSHOT"]
-                 [re-frame "0.1.8"]]
+                 [re-frame "0.2.0"]]

   :plugins [[lein-cljsbuild "1.0.4"]
             [lein-figwheel "0.2.3-SNAPSHOT"]]


Change the VPC-DNS Settings

Change the VPC-DNS Settings

--- src/aws_overlord/tasks/networking.clj
+++ src/aws_overlord/tasks/networking.clj
@@ -16,6 +16,8 @@
 (defn- vpc [team-name cidr-block]
   {"Type" "AWS::EC2::VPC"
    "Properties" {"CidrBlock" cidr-block
+                 "EnableDnsSupport" true
+                 "EnableDnsHostnames" false
                  "Tags" [{"Key" "Name"
                           "Value" team-name}]}
    })


#21 - Added update and delete functionality. Cleaned up output.

--- src/biblecli/commands/bucketsync.cljs
+++ src/biblecli/commands/bucketsync.cljs
@@ -142,11 +142,18 @@
 (defn perform-actions [n coll]
   (go
     (let [ch (to-chan coll)
-          workers (->> (range n) (map (fn [_] (perform-action ch))) (vec))]
-      (let [results (<! (async/map (fn [err _] err) workers))
-            err (reduce #(or %1 %2) nil results)
-            res (if err nil true)]
-        [err res]))))
+          results
+          (->>
+            (range n)
+            (map (fn [_] (perform-action ch)))
+            (vec)
+            (async/merge)
+            (async/into [])
+            (<!)
+            (map (fn [[err _]] err)))
+          err (reduce #(or %1 %2) nil results)
+          res (if err nil true)]
+      [err res])))

 (defn object-props [content-type max-age]
   {:content-type content-type
@@ -188,6 +195,16 @@
       (cb (str "Could not resolve content-type for '" key "'.") nil))
     ch))

+(defn delete-s3-objects [s3 keys]
+  (let [params (clj->js {:Delete
+                         {:Objects (->> keys
+                                        (map (fn [key] {:Key key}))
+                                        (vec))}})
+        ch (chan)
+        cb (fn [err data] (put! ch [err data]))]
+    (.deleteObjects s3 params cb)
+    ch))
+
 (defn read-local-file [path]
   (let [ch (chan)
         cb (fn [err data] (put! ch [err data]))]
@@ -198,13 +215,20 @@
   (fn delete []
     (go
       (let [msg (if verbose
-                  (str "deleting S3 object(s) '" (s/join keys "', '") "'")
+                  (str "deleting S3 object(s) '" (s/join "', '" keys) "'")
                   (str "deleting " (count keys) " S3 object(s)"))]
         (log-action (not should-delete) whatif verbose "Skipped " msg ". Use the --delete option.")
         (log-action should-delete whatif verbose "Started " msg ".")
-
-        (log-action (and should-delete verbose) whatif verbose "Finished " msg ".")
-        [nil true]))))
+        (let [[err _] (if (or whatif (not should-delete))
+                        [nil true]
+                        (<! (delete-s3-objects s3 keys)))]
+          (if err
+            (do
+              (log-action true whatif verbose "Failed while " msg ". " err)
+              [err nil])
+            (do
+              (log-action (and should-delete verbose) whatif verbose "Finished " msg ".")
+              [nil true])))))))

 (defn make-copy-file-action [s3 [relpath filepath] whatif verbose]
   (fn copy []
@@ -222,10 +246,10 @@
                             (<! (put-s3-object s3 relpath buff md5buff)))]
               (if err
                 (do
-                  (log-action true whatif  verbose "Failed while " msg ". " err)
+                  (log-action true whatif verbose "Failed while " msg ". " err)
                   [err nil])
                 (do
-                  (log-action verbose whatif  verbose "Finished " msg ".")
+                  (log-action verbose whatif verbose "Finished " msg ".")
                   [nil true])))))))))

 (defn make-update-file-action [s3 [relpath filepath etag] force whatif verbose]
@@ -233,9 +257,29 @@
     (go
       (let [msg (str "updating '" relpath "' to S3")]
         (log-action verbose whatif verbose "Comparing local '" relpath "' with remote.")
-        (log-action true whatif verbose "Started " msg ".")
-        (log-action verbose whatif verbose "Finished " msg ".")
-        [nil true]))))
+        (let [[err buff] (<! (read-local-file filepath))]
+          (if err
+            (do
+              (log-action true whatif verbose "Failed to read local file '" filepath "'. " err)
+              [err nil])
+            (let [md5buff (calc-md5-digest buff)
+                  sourceMd5str (str "\"" (.toUpperCase (.toString md5buff "hex")) "\"")
+                  destMd5str (.toUpperCase etag)]
+              (if (or force (not= sourceMd5str destMd5str))
+                (do
+                  (log-action true whatif verbose "Started " msg ".")
+                  (let [[err _] (if whatif
+                                 [nil true]
+                                 (<! (put-s3-object s3 relpath buff md5buff)))]
+                    (if err
+                      (do
+                        (log-action true whatif verbose "failed while " msg ". " err)
+                        [err nil])
+                      (do
+                        (log-action verbose whatif verbose "Finished " msg ".")
+                        [nil true]))))))))))))
+
+(def remote-key-white-list #"^(BingSiteAuth\.xml)|(google.*\.html)$")

 (defn bucketsync
   {:summary "Synchronize a remote Amazon S3 bucket with a local asset directory."
@@ -256,7 +300,7 @@
                   :default {:bucket "kingjames-beta"
                             :region "us-east-1"
                             :profile "default"}}}
-  [{dir :_ force :force whatif :whatif delete :delete bucket :bucket region :region profile :profile verbose :verbose :as f}]
+  [{dir :_ force :force whatif :whatif delete :delete bucket :bucket region :region profile :profile verbose :verbose}]
   (go
     (if (not= (count dir) 1)
       ["<dir> parameter required." nil]
@@ -274,7 +318,8 @@
                           (concat
                             (map #(make-copy-file-action s3 % whatif verbose) onlylocal)
                             (->> onlyremote
-                                 (map (fn [key _] key))
+                                 (map (fn [[key _]] key))
+                                 (filter #(not (re-find remote-key-white-list %)))
                                  (partition-all 1000)
                                  (map #(make-delete-file-action s3 % delete whatif verbose)))
                             (map #(make-update-file-action s3 % force whatif verbose) both))


[fix #1460] hide emoji on commands selection

--- src/status_im/chat/events/input.cljs
+++ src/status_im/chat/events/input.cljs
@@ -107,6 +107,7 @@
                          [:clear-bot-db]
                          [:set-chat-input-metadata metadata]
                          [:set-chat-ui-props {:show-suggestions?   false
+                                              :show-emoji?         false
                                               :result-box          nil
                                               :validation-messages nil
                                               :prev-command        name}]


sum-xf

sum-xf

--- src/cljc/commos/delta/compscribe.cljc
+++ src/cljc/commos/delta/compscribe.cljc
@@ -335,6 +335,17 @@
       #_(println "unsubscribing" (::identifier (meta unsubs-fn)))
       (unsubs-fn))))

+(def ^:private sum-xf
+  "Transducer that sums deltas and passes on [sum delta] for each
+  delta."
+  (fn [rf]
+    (let [sum (volatile! nil)]
+      (fn
+        ([] (rf))
+        ([result] (rf result))
+        ([result input]
+         (rf result [(vswap! sum delta/add input) input]))))))
+
 (defn- hybrid-cache
   "Caches on endpoints.  Sends the current sum to a new subscriber,
   continues with deltas."


add defaults to import data

add defaults to import data

--- src/cljs/clj_money/views/imports.cljs
+++ src/cljs/clj_money/views/imports.cljs
@@ -275,7 +275,8 @@
                        :caption "Cancel"}]]]))

 (defn- import-list []
-  (let [page-state (r/atom {})
+  (let [page-state (r/atom {:import-data {:options {:lt-capital-gains-account-id "Investment Income/Long Term Gains"
+                                                    :st-capital-gains-account-id "Investment Income/Short Term Gains"}}})
         import-data (r/cursor page-state [:import-data])
         active (r/cursor page-state [:active])]
     (load-imports page-state)


Minor bugfix on workspace settings.

Minor bugfix on workspace settings.

--- src/uxbox/ui/workspace/settings.cljs
+++ src/uxbox/ui/workspace/settings.cljs
@@ -81,7 +81,7 @@
          [:input
           {:type "checkbox"
            :on-change on-align-change
-           :checked (:grid/align opts)
+           :checked (:grid/alignment opts)
            :id "magnet"
            :value "Yes"}]
          [:label {:for "magnet"} "Activate magnet"]]


Use correct query API URL

Use correct query API URL

--- src-cljs/frontend/api.cljs
+++ src-cljs/frontend/api.cljs
@@ -86,7 +86,7 @@

 (defn get-project-workflows [api-ch vcs-url]
   (ajax/ajax :post
-             "https://api.circleci.com/query"
+             "/query-api"
              :workflow-status
              api-ch
              :format :transit


dsn key name changed to match the nginx config env var

--- src/open_company/config.clj
+++ src/open_company/config.clj
@@ -23,4 +23,4 @@

 ;; ----- Sentry config -----

-(defonce dsn (or (env :dsn) false))+(defonce dsn (or (env :open-company-sentry-api) false))


open unify-synthdef into a multi-method supporting a number of input types

--- src/overtone/repl/debug.clj
+++ src/overtone/repl/debug.clj
@@ -3,6 +3,7 @@
         [overtone.sc.machinery.ugen.defaults]
         [overtone.sc.machinery.ugen.special-ops]
         [overtone.sc.machinery.ugen.specs]
+        [overtone.sc.machinery.synthdef]
         [overtone.helpers seq lib]))

 (defn- unify-input
@@ -59,11 +60,7 @@
                    (range))]
     (sort #(compare (:name %1) (:name %2)) ugens)))

-(defn unify-synthdef
-  "Munge synthdef into a readable 'unified' format - ensures that two
-  similar synthdefs will be similarly ordered. Does not preserve ugen
-  order. Useful for comparing two ugen synthdefs (i.e. an Overtone and
-  SCLang synthdef) side-by-side."
+(defn- unify-synthdef-sdef
   [sdef]
   {:name    (:name sdef)
    :params  (:params sdef)
@@ -71,7 +68,51 @@
    :n-ugens (count (:ugens sdef))
    :ugens   (unify-ugens (:ugens sdef) sdef)})

-(defn pp-unified-sc-synth
+(defmulti unify-synthdef
+  "Munge synthdef into a readable 'unified' format - ensures that two
+  similar synthdefs will be similarly ordered. Does not preserve ugen
+  order. Useful for comparing two ugen synthdefs (i.e. an Overtone and
+  SCLang synthdef) side-by-side.
+
+  Accepts at least the following synthdef args types:
+  * synths
+  * synthdefs
+  * imported-synthdefs
+  * keyword (will look up the synthdef with the name matching keyword
+    in the default SuperCollider synthdef directory
+  * string (will look up the synthdef with a path matching string)
+  * URL (will look up the synthdef with URL)"
+  type)
+
+(defmethod unify-synthdef :overtone.sc.machinery.synthdef/synthdef
+  [sdef]
+  (unify-synthdef-sdef sdef))
+
+(defmethod unify-synthdef :overtone.sc.machinery.synthdef/imported-synthdef
+  [sdef]
+  (unify-synthdef-sdef sdef))
+
+(defmethod unify-synthdef clojure.lang.Keyword
+  [sdef-k]
+  (unify-synthdef (synthdef-read sdef-k)))
+
+(defmethod unify-synthdef java.lang.String
+  [sdef-s]
+  (unify-synthdef (synthdef-read sdef-s)))
+
+(defmethod unify-synthdef java.net.URL
+  [sdef-u]
+  (unify-synthdef (synthdef-read sdef-u)))
+
+(defmethod unify-synthdef overtone.sc.synth.Synth
+  [sdef]
+  (unify-synthdef (:sdef sdef)))
+
+(defmethod unify-synthdef :default
+  [sdef]
+  (throw (IllegalArgumentException. (str "Unknown synthdef type to unify: " (type sdef)))))
+
+(defn pp-unified-synthdef
   "Pretty print a unified version of an sc synth based on the name of
   the scsynth. Looks into the appropriate SC directory for synthdef."
   [synth-name]


fix comment

fix comment


SSE resource was not returning a resource

--- src/yada/resources/sse.clj
+++ src/yada/resources/sse.clj
@@ -6,6 +6,7 @@
    [manifold.stream :refer [->source transform]]
    [yada.charset :as charset]
    [yada.protocols :as p]
+   [yada.resource :refer [resource]]
    clojure.core.async.impl.channels
    clojure.core.async.impl.protocols
    manifold.stream.async)
@@ -15,9 +16,10 @@
   ReadPort
   (as-resource [ch]
     (let [mlt (mult ch)]
-      {:produces [{:media-type "text/event-stream"
-                   :charset charset/platform-charsets}]
-       :methods {:get {:response (fn [ctx]
-                                   (let [ch (chan)]
-                                     (tap mlt ch)
-                                     (transform (map (partial format "data: %s\n\n")) (->source ch))))}}})))
+      (resource
+       {:produces [{:media-type "text/event-stream"
+                    :charset charset/platform-charsets}]
+        :methods {:get {:response (fn [ctx]
+                                    (let [ch (chan)]
+                                      (tap mlt ch)
+                                      (transform (map (partial format "data: %s\n\n")) (->source ch))))}}}))))


Don't use medley's dissoc-in for this, it clears the entire map

--- re-frame-todo/src/cljs/re_frame_todo/events.cljs
+++ re-frame-todo/src/cljs/re_frame_todo/events.cljs
@@ -2,8 +2,7 @@
   (:require [cljs.spec.alpha :as spec]
             [re-frame.core :as re-frame]
             [re-frame-todo.db :as db]
-            [re-frame-todo.schema :as schema]
-            [medley.core :as medley]))
+            [re-frame-todo.schema :as schema]))

 (def schema-interceptor (re-frame/after (fn [db]
                                           (when-not (spec/valid? ::schema/db db)
@@ -47,7 +46,7 @@
  [schema-interceptor]
  (fn [db [_ added-at]]
    (-> db
-       (medley/dissoc-in [:items-by-added-at added-at])
+       (update :items-by-added-at dissoc added-at)
        (update :item-list #(remove (partial = added-at) %)))))

 (re-frame/reg-event-db


Closes #24

Closes #24

--- src/re_com/modal_panel.cljs
+++ src/re_com/modal_panel.cljs
@@ -29,7 +29,8 @@
                           :left     "0px"
                           :top      "0px"
                           :width    "100%"
-                          :height   "100%"}
+                          :height   "100%"
+                          :z-index  1020}
                          style)}
           attr)
    [:div
@@ -38,13 +39,13 @@
                 :height           "100%"
                 :background-color backdrop-color
                 :opacity          backdrop-opacity
-                :z-index          1020
+                :z-index          1
                 :pointer-events   "none"}           ;; TODO: trying to prevent change of focus under the when clicking on backdrop (also with the on-click below). Remove!
      :on-click #(do (println "stopping propagation") (.preventDefault %) (.stopPropagation %))
      }]
    [:div
     {:style (merge {:margin  "auto"                 ;; Child
-                    :z-index 1020}
+                    :z-index 2}
                    (when wrap-nicely? {:background-color "white"
                                        :padding          "16px"
                                        :border-radius    "6px"}))}


Autosuggest Image Tags

Autosuggest Image Tags

--- src/cljs/swarmpit/component/service/form_settings.cljs
+++ src/cljs/swarmpit/component/service/form_settings.cljs
@@ -1,5 +1,6 @@
 (ns swarmpit.component.service.form-settings
-  (:require [material.component :as comp]
+  (:require [goog.object]
+            [material.component :as comp]
             [swarmpit.component.state :as state]
             [swarmpit.component.service.form-ports :as ports]
             [swarmpit.component.parser :refer [parse-int]]
@@ -48,15 +49,15 @@
      :renderSuggestion            (fn [s props]
                                     (comp/menu-item
                                       {:key      s
-                                       :selected (.-isHighlighted props)} s))
-     ;:renderSuggestionsContainer  (fn [options]
-     ;                               (let [{:keys [children containerProps]} (keywordize-keys (js->clj options))]
-     ;                                 (comp/paper (merge containerProps
-     ;                                                    {:square true}) children)))
+                                       :selected (goog.object/get props "isHighlighted")} s))
+     :renderSuggestionsContainer  (fn [options]
+                                    (comp/paper
+                                      (merge {:square true} (keywordize-keys (goog.object/get options "containerProps")))
+                                      (goog.object/get options "children")))
      :theme                       {:container                {:position "relative"}
                                    :suggestionsContainerOpen {:position  "absolute"
                                                               :zIndex    1
-                                                              :marginTop 8
+                                                              :marginTop -8
                                                               :left      0
                                                               :right     0}
                                    :suggestionsList          {:margin        0
@@ -191,4 +192,4 @@
            :sm   6} (form-replicas replicas)))
       (comp/grid
         {:item true
-         :xs   12} (form-command (str/join " " command))))))+         :xs   12} (form-command (str/join " " command))))))


search for `foo: bar` => [:like "foo" "bar"]

--- cljs/sledge/core.cljs
+++ cljs/sledge/core.cljs
@@ -429,6 +429,18 @@
     (str (nth js/common_words i1) " " (nth js/common_words i2))))

+(defn parse-search-term [string]
+  (let [[term value] (string/split string #": *")]
+    (if value
+      [:like term value]
+      [:like "_content" string])))
+
+(deftest parse-search-test
+  (is (= (parse-search-term "hello") [:like "_content" "hello"]))
+  (is (= (parse-search-term "shuffle: wibble fish")
+         [:like "shuffle" "wibble fish"]))
+  (is (= (parse-search-term "shuffle:noblank pshaw")
+         [:like "shuffle" "noblank pshaw"])))

 (defn search-entry-view [term owner]
   (reify
@@ -439,7 +451,7 @@
             (fn [e]
               (let [str (.. e -target -value)]
                 (if-not (empty? str)
-                  (put! search-chan [:add [[:like "_content" str]]]))))]
+                  (put! search-chan [:add [(parse-search-term str)]]))))]
         (dom/div
          #js {:className "search-box"
               :onClick (fn [e]


encapsulate pretty printing with display

--- user.clj
+++ user.clj
@@ -1,5 +1,5 @@
 (ns u
-  (:require [clojure.pprint :as pp])
+  (:require [clojure.pprint])
   (:require [clojure.string :as string]))

 ; =======
@@ -36,6 +36,16 @@
     (when-not (empty? unresolved)
       (println (str "\n" "Unable to resolve these symbols: " (string/join ", " unresolved))))))

+(def ^:dynamic *display* :table)
+
+(defn display
+  "Pretty prints data or returns it depending on value of *display*. Default is to print with table."
+  [data & options]
+  (case *display*
+    :pprint (do (clojure.pprint/pprint data) (println ""))
+    :self (identity data)
+    (apply table.core/table data options)))
+
 ; =========
 ; Inspectors: inspect vars, namespaces, fns, envs, properties ...

@@ -44,19 +54,19 @@

 ; mtable 'doc
 (defn var-meta "Prints meta of a symbol" [sym]
-  (table.core/table (meta (resolve sym))))
+  (display (meta (resolve sym))))

 (defn vars-meta "Prints public vars for a namespace with its meta info"
   ([] (vars-meta *ns*))
   ([nsname]
-    (table.core/table (map #( meta (resolve %)) (clojure.repl/dir-fn nsname)))))
+    (display (map #( meta (resolve %)) (clojure.repl/dir-fn nsname)))))

 (defn vars-values
   "Prints dynamic vars for a namespace mapped to their values"
    [& options]
    (let [opts (apply hash-map options)]
      (apply
-       table.core/table
+       display
        (cons
          ["Var" "Value"]
          (map #(identity [% (deref %)]) (ns-dynamic-vars (get opts :ns *ns*))))
@@ -64,15 +74,15 @@
        options)))

 (defn class-paths "Prints list of class paths" []
-  (pp/pprint (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader)))))
+  (clojure.pprint/pprint (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader)))))

 (defn properties "List properties and their values" []
-  (table.core/table
+  (display
     (->> (System/getProperties) .stringPropertyNames
       (reduce #(assoc %1 %2 (System/getProperty %2)) {}))))

 (defn envs "List of envs and their values" []
-  (->> (System/getenv) keys (reduce #(assoc %1 %2 (System/getenv %2)) {}) table.core/table))
+  (->> (System/getenv) keys (reduce #(assoc %1 %2 (System/getenv %2)) {}) display))

 ; Configuration
 (set! clojure.core/*print-length* 100)


Figwheel

Figwheel

--- frontend/core.cljs
+++ frontend/core.cljs
@@ -3,6 +3,7 @@
             [frontend.async :refer [put!]]
             [weasel.repl :as ws-repl]
             [clojure.browser.repl :as repl]
+            [figwheel.client :as fw :include-macros true]
             [clojure.string :as string]
             [dommy.core :as dommy]
             [goog.dom]
@@ -291,3 +292,8 @@
 (defn update-ui! []
   (reinstall-om!)
   (refresh-css!))
+
+(fw/watch-and-reload
+  :websocket-url "ws://localhost:3449/figwheel-ws"
+  :jsload-callback (fn [] (do
+                            (update-ui!))))


extract the setup dispatch function

extract the setup dispatch function

--- frontend/core.cljs
+++ frontend/core.cljs
@@ -2,6 +2,7 @@
   (:require [cljs.core.async :as async :refer [>! <! alts! chan sliding-buffer put! close!]]
             ;; XXX remove browser repl in prod
             [clojure.browser.repl :as repl]
+            [clojure.string :as string]
             [dommy.core :as dommy]
             [goog.dom.DomHelper]
             [frontend.components.app :as app]
@@ -183,14 +184,18 @@
       (catch js/Error e
         (merror e)))))

+(defn dispatch-to-current-location! []
+  (let [uri (goog.Uri. js/document.location.href)]
+    (sec/dispatch! (str (.getPath uri) (when-not (string/blank? (.getFragment uri))
+                                         (str "#" (.getFragment uri)))))))
+
 (defn setup! []
   (main app-state (sel1 :body))
-  (when-let [user (inspect (:current-user @app-state))]
-    (subscribe-to-user-channel user (inspect (get-in @app-state [:comms :ws]))))
+  (dispatch-to-current-location!)
+  (when-let [user (:current-user @app-state)]
+    (subscribe-to-user-channel user (get-in @app-state [:comms :ws])))
   (when (env/development?)
-    (setup-browser-repl))
-  ;; XXX direct dispatching is probably the wrong approach
-  (sec/dispatch! (.getPath (goog.Uri. js/document.location.href))))
+    (setup-browser-repl)))

 ;; Wait for the page to finish loading before we kick off the setup
 ;; process


Fixed error in Atom handling, adapted to different param handling in Compojure

--- src/statuses/views/main.clj
+++ src/statuses/views/main.clj
@@ -87,7 +87,7 @@
    (get-in request [:headers "host"])))

 (defn parse-args [request]
-  (let [{:keys [q limit offset]} (:params request)]
+  (let [{:strs [q limit offset]} (:params request)]
     (let [lmt (parse-num limit 25)
           off (parse-num offset 0)
           q-string (if q (str "&q=" q))
@@ -107,7 +107,7 @@
   [type body]
   (assoc-in {:body body} [:headers "content-type"] type))

-(defn items-page [author format request]
+(defn items-page [format author request]
   (let [[query limit offset next] (parse-args request)]
     (with-etag request (:time (first (core/get-latest @db 1 offset author)))
       (let [items (core/get-latest @db limit offset author)]
@@ -117,7 +117,7 @@
                            (json/as-json {:items items, :next next}))
          (= format :atom)  (content-type
                             "application/atom+xml;charset=utf-8"
-                            (html (atom/feed items (base-uri) (:uri request))))
+                            (html (atom/feed items (base-uri request) (:uri request))))
          :else            (content-type
                            "text/html;charset=utf-8"
                            (list-page items next request)))))))


RS & AB | 15 | Disable caching with no exceptions

--- src/stonecutter/handler.clj
+++ src/stonecutter/handler.clj
@@ -51,7 +51,7 @@
      :authorise                          oauth/authorise
      :authorise-client                   oauth/authorise-client
      :show-authorise-failure             oauth/show-authorise-failure}
-    (m/wrap-handlers m/wrap-disable-caching #{:show-sign-in-form :home})
+    (m/wrap-handlers m/wrap-disable-caching #{})
     (m/wrap-handlers m/wrap-signed-in #{:show-registration-form :register-user
                                         :show-sign-in-form      :sign-in
                                         :sign-out


Remove println.

Remove println.

--- src/uxbox/ui/workspace.cljs
+++ src/uxbox/ui/workspace.cljs
@@ -56,9 +56,6 @@
         classes (classnames
                  :no-tool-bar-right (not right-sidebar?)
                  :no-tool-bar-left (not left-sidebar?))]
-
-    (println left-sidebar? right-sidebar? classes)
-
     (html
      [:div
       (header)


columns

columns

--- src/cljs/matthiasn/systems_toolbox_ui/charts/histogram.cljs
+++ src/cljs/matthiasn/systems_toolbox_ui/charts/histogram.cljs
@@ -24,9 +24,9 @@
     (take keep-n sorted)))

 (defn freedman-diaconis-rule
-  "Implements approximation of Freedman–Diaconis rule for determing bin size in histograms: bin size = 2 IQR(x) n^-1/3
-   where IQR(x) is the interquartile range of the data and n is the number of observations in the sample x.
-   Argument coll is expected to be a collection of numbers."
+  "Implements approximation of Freedman–Diaconis rule for determing bin size in histograms:
+  bin size = 2 IQR(x) n^-1/3 where IQR(x) is the interquartile range of the data and n is the
+  number of observations in the sample x. Argument coll is expected to be a collection of numbers."
   [sample]
   (let [n (count sample)]
     (when (pos? n)
@@ -51,10 +51,12 @@
      [:path (merge path-defaults {:d (str "M" x " " y "l 0 " (* h -1) " z")})]
      (for [n rng]
        ^{:key (str "yt" n)}
-       [:path (merge path-defaults {:d (str "M" x " " (- y (* (/ n increment) scale)) "l -" 6 " 0")})])
+       [:path (merge path-defaults
+                     {:d (str "M" x " " (- y (* (/ n increment) scale)) "l -" 6 " 0")})])
      (for [n rng]
        ^{:key (str "yl" n)}
-       [:text (merge text-default {:x (- x 10) :y (- y (* (/ n increment) scale) -4) :text-anchor :end}) n])]))
+       [:text (merge text-default
+                     {:x (- x 10) :y (- y (* (/ n increment) scale) -4) :text-anchor :end}) n])]))

 (defn histogram-x-axis
   "Draws x-axis for histrogram."
@@ -62,9 +64,12 @@
   (let [rng (range mn (inc mx) increment)]
     [:g
      [:path (merge path-defaults {:d (str "M" x " " y "l" w " 0 z")})]
-     (for [n rng] ^{:key (str "xt" n)}
-                  [:path (merge path-defaults {:d (str "M" (+ x (* (- n mn) scale)) " " y "l 0 " 6)})])
-     (for [n rng] ^{:key (str "xl" n)} [:text (merge x-axis-label {:x (+ x (* (- n mn) scale)) :y (+ y 20)}) n])]))
+     (for [n rng]
+       ^{:key (str "xt" n)}
+       [:path (merge path-defaults {:d (str "M" (+ x (* (- n mn) scale)) " " y "l 0 " 6)})])
+     (for [n rng]
+       ^{:key (str "xl" n)}
+       [:text (merge x-axis-label {:x (+ x (* (- n mn) scale)) :y (+ y 20)}) n])]))

 (defn default-increment-fn
   [rng]
@@ -108,9 +113,13 @@
        [:text {:x     (+ x (/ w 2)) :y (- y 50) :stroke "none" :fill "#DDD" :text-anchor :middle
                :style {:font-weight :bold :font-size 24}} "insufficient data"])
      (histogram-x-axis x (+ y 7) mn2 mx2 w x-scale increment)
-     [:text (merge x-axis-label text-bold {:x (+ x (/ w 2)) :y (+ y 48) :text-anchor :middle}) x-label]
-     [:text (let [x-coord (- x 45) y-coord (- y (/ h 3)) rotate (str "rotate(270 " x-coord " " y-coord ")")]
-              (merge x-axis-label text-bold {:x x-coord :y y-coord :transform rotate})) "Frequencies"]
+     [:text (merge x-axis-label text-bold {:x (+ x (/ w 2)) :y (+ y 48) :text-anchor :middle})
+      x-label]
+     [:text (let [x-coord (- x 45)
+                  y-coord (- y (/ h 3))
+                  rotate (str "rotate(270 " x-coord " " y-coord ")")]
+              (merge x-axis-label text-bold {:x x-coord :y y-coord :transform rotate}))
+      "Frequencies"]
      (histogram-y-axis (- x 7) y h (or binned-freq-mx 10))]))

 (defn histogram-view


fix build-id option for plugin

fix build-id option for plugin

--- plugin/src/leiningen/doo.clj
+++ plugin/src/leiningen/doo.clj
@@ -104,13 +104,12 @@
 (defn args->cli
   "Parses & validates the cli arguments into a consistent format"
   [args]
-  {:post [(every? keyword? (vals %))]}
   (let [[js-env build-id & xs] (remove watch-mode? args)]
     (assert (empty? xs)
       (str "We couldn't parse " xs " as a watch-mode,"
         " only auto or once are supported"))
     {:alias (keyword (or js-env "default"))
-     :build (keyword (or build-id :default))
+     :build (or build-id :default)
      :watch-mode (keyword (or (first (filter watch-mode? args)) "auto"))}))

 (defn cli->js-envs
@@ -194,7 +193,7 @@
 (defn ^{:doc help-string}
   doo
   ([project]
-   (doo project "default" "default" "auto"))
+   (doo project "default" :default "auto"))
   ([project & args]
    ;; FIX: execute in a try catch like the one in run-local-project
    (let [{:keys [alias watch-mode] :as cli} (args->cli args)


add credit in foot of cljs design post

add credit in foot of cljs design post

--- src/pc/views/blog/clojure_is_a_product_design_tool.clj
+++ src/pc/views/blog/clojure_is_a_product_design_tool.clj
@@ -176,7 +176,8 @@
     [:article.blogpost-footnote
      [:p
       "Thanks to "
-      [:a {:href "https://twitter.com/sgrove"} "Sean Grove"] ", and "
-      [:a {:href "https://twitter.com/BrandonBloom"} "Brandon Bloom"]
+      [:a {:href "https://twitter.com/sgrove"} "Sean Grove"] ", "
+      [:a {:href "https://twitter.com/BrandonBloom"} "Brandon Bloom"] ", and "
+      [:a {:href "https://twitter.com/Venantius"} "David Jarvis"]
       " for reading drafts of this."]]
     )})


core: float?

core: float?

--- data/core.clj
+++ data/core.clj
@@ -1741,3 +1741,9 @@
   "Returns true if n is a BigFloat"
   {:added "1.0"}
   [n] (instance? BigFloat n))
+
+(defn float?
+  "Returns true if n is a floating point number"
+  {:added "1.0"}
+  [n]
+  (instance? Double n))


Retry if pub is nil (conn cound have been reset)

--- src/onyx/messaging/aeron/publication_manager.clj
+++ src/onyx/messaging/aeron/publication_manager.clj
@@ -24,9 +24,10 @@
 (defn write-from-buffer [pending-ch publication send-idle-strategy]
   (loop []
     (when-let [msg (<!! pending-ch)]
-      (while (let [result ^long (.offer @publication (:buf msg) (:start msg) (:end msg))]
-               (or (= result backpressured)
-                   (= result not-connected)))
+      (while (if-let [pub @publication]
+               (let [result ^long (.offer pub (:buf msg) (:start msg) (:end msg))]
+                 (or (= result backpressured)
+                     (= result not-connected))))
         ;; idle for different amounts of time depending on whether backpressuring or not?
         (.idle ^IdleStrategy send-idle-strategy 0))
       (recur))))
@@ -70,4 +71,5 @@
       this)))

 (defn new-publication-manager [send-idle-strategy channel stream-id]
-  (->PublicationManager send-idle-strategy channel stream-id (atom nil) (atom nil) (chan write-buffer-size) nil))
+  (->PublicationManager send-idle-strategy channel stream-id
+                        (atom nil) (atom nil) (chan write-buffer-size) nil))


Test for the function restcall-head-handler

--- test/emender_jenkins/server_test.clj
+++ test/emender_jenkins/server_test.clj
@@ -196,3 +196,10 @@
                       http-response/content-type (fn [resp content-type] (assoc resp :content-type content-type))]
             (is (= {:response "", :content-type "application/json"} (restcall-options-handler))))))

+(deftest test-restcall-head-handler
+    "Check the function emender-jenkins.server/restcall-head-handler."
+    (testing "the function emender-jenkins.server/restcall-head-handler."
+        (with-redefs [http-response/response     (fn [resp] {:response resp})
+                      http-response/content-type (fn [resp content-type] (assoc resp :content-type content-type))]
+            (is (= {:response "", :content-type "application/json"} (restcall-head-handler))))))
+


add properties

add properties

--- user.clj
+++ user.clj
@@ -4,8 +4,7 @@
 )

 (defn class-path "Prints list of class paths" []
-  (pp/pprint  (seq  (.getURLs  (java.lang.ClassLoader/getSystemClassLoader))))
-)
+  (pp/pprint  (seq  (.getURLs  (java.lang.ClassLoader/getSystemClassLoader)))))

 ;TODO: macroize so it can sit in front of a call like apply
 (defn spy "Simple print debugging" [arg]
@@ -13,6 +12,11 @@

 (defn java-methods "List of methods for a java class" [klass]
   (sort (distinct (map #(.getName %) (seq (.getMethods klass))))))
+
+(defn properties "List properties and their values" []
+  (table.core/table
+    (->> (System/getProperties) .stringPropertyNames
+      (reduce #(assoc %1 %2 (System/getProperty %2)) {}))))

 ; mtable 'doc
 (defn mtable "Prints meta of a function as a table" [sym]
@@ -37,6 +41,7 @@
     (when-not (empty? unresolved)
       (println (str "\n" "Unable to resolve these symbols: " (string/join ", " unresolved))))))

+; TODO: only display vars local to a namespace
 (defn ns-dynamic-vars
   "dynamic vars for a namespace as determined by *var* convention"
   ([] (ns-dynamic-vars *ns*))


www/admin.clj: added AdminDocResource

www/admin.clj: added AdminDocResource


Don't fetch null points

Don't fetch null points


renaming action to match

renaming action to match

--- test/celestial/integration/persistency.clj
+++ test/celestial/integration/persistency.clj
@@ -6,7 +6,7 @@
     [celestial.redis :refer (clear-all)]
     [flatland.useful.map :refer (dissoc-in*)]
     [celestial.fixtures.core :refer (with-conf is-type?)]
-    [celestial.fixtures.data :refer (redis-prox-spec redis-type user-quota redis-actions)]
+    [celestial.fixtures.data :refer (redis-prox-spec redis-type user-quota redis-deploy)]
     [celestial.persistency.actions :as a]
     [celestial.persistency :as p])
   (:use midje.sweet))
@@ -49,10 +49,10 @@
 (with-state-changes [(before :facts (clear-all))]
   (fact "basic actions usage" :integration :redis :actions
         (p/add-type redis-type)
-        (let [id (a/add-action redis-actions)]
-          (a/get-action id) => redis-actions
+        (let [id (a/add-action redis-deploy)]
+          (a/get-action id) => redis-deploy
           (a/get-action-index :operates-on "redis") => [(str id)]
-          (a/find-action-for :deploy "redis") => redis-actions
+          (a/find-action-for "deploy" "redis") => redis-deploy
           )))


Add test for :alg keyword.

Add test for :alg keyword.

--- test/buddy/hashers_tests.clj
+++ test/buddy/hashers_tests.clj
@@ -21,6 +21,19 @@
   (let [pwd "my-test-password"]
     (are [alg]
         (let [result (hashers/encrypt pwd {:algorithm alg})]
+          (hashers/check pwd result))
+      :pbkdf2+sha1
+      :pbkdf2+sha256
+      :pbkdf2+sha3_256
+      :bcrypt+sha512
+      :scrypt
+      :sha256
+      :md5)))
+
+(deftest buddy-hashers
+  (let [pwd "my-test-password"]
+    (are [alg]
+        (let [result (hashers/encrypt pwd {:alg alg})]
           (hashers/check pwd result))
       :pbkdf2+sha1
       :pbkdf2+sha256


clojure: refactored the morphism function

--- clojure/org/gavrog/clojure/pgraph_morphisms.clj
+++ clojure/org/gavrog/clojure/pgraph_morphisms.clj
@@ -106,6 +106,15 @@
     (.set M* n m (Whole/ONE))
     M*))

+(defn matched-incidences [net v w op sigs]
+  (let [nv (incidences-by-signature net v sigs)
+        nw (incidences-by-signature net w sigs)]
+    (when (= (count nv) (count nw))
+      (for [[d sig] (keys nv)
+            :let [e1 (.get nv [d sig])
+                  e2 (.get nw [(.times d op) (map-sig op sig)])]]
+        [e1 e2]))))
+
 (defn morphism [net v w M]
   (when (.isUnimodularIntegerMatrix M)
     (let [sigs (node-signatures net)
@@ -130,20 +139,9 @@
             (instance? IEdge a)
             (recur (assoc src2img a b) (conj (pop q) [(.target a) (.target b)]))

-            (not= (map-sig op (sigs a)) (sigs b))
-            nil
-
             :else
-            (let [nv (incidences-by-signature net a sigs)
-                  nw (incidences-by-signature net b sigs)]
-              (when (= (count nv) (count nw))
-                (recur (assoc src2img a b)
-                       (into (pop q)
-                             (for [[d sig] (keys nv)
-                                   :let [e1 (.get nv [d sig])
-                                         e2 (.get nw [(.times d op)
-                                                      (map-sig op sig)])]]
-                               [e1 e2])))))))))))
+            (when-let [matches (matched-incidences net a b op sigs)]
+              (recur (assoc src2img a b) (into (pop q) matches)))))))))

 (defn symmetry-from-base-pair [net b1 b2]
   (let [start #(.source (.get % 0))
@@ -151,6 +149,7 @@
     (morphism net (start b1) (start b2) (Matrix/solve (mat b1) (mat b2)))))

 (defn symmetries [net]
+  (assert (node-signatures net))
   (let [bases (iterator-seq (.iterator (.characteristicBases net)))]
     (->> bases
       (map (partial symmetry-from-base-pair net (first bases)))


Fix typo.

Fix typo.

--- src/airhead_frontend/components.cljs
+++ src/airhead_frontend/components.cljs
@@ -143,7 +143,7 @@
       [:form#library-search.pure-form
         [:input.pure-input-3-4 {:type "text"
                                :id "query"
-                               :placeholder "Search trough the library..."
+                               :placeholder "Search through the library..."
                                :value (@app-state :query)
                                :on-change on-query-change}]
         [:span.pure-input-1-4 (str "Tracks: " (count tracks))]]


Single play/pause button

Single play/pause button

--- src/airhead_frontend/components.cljs
+++ src/airhead_frontend/components.cljs
@@ -11,28 +11,29 @@
      [:h1 title]
      [:p message]]))

+(defn now-playing []
+  (let [track (@app-state :now-playing)]
+    [:span (if track
+             (str (:artist track) " - " (:title track))
+             [:em "Nothing is playing"])]))
+
 (defn player-section []
-  (let [cursor  (r/cursor app-state [:info])
-        track   (@app-state :now-playing)
-        url     (@cursor :stream_url)
-        ;; TODO: do not use Id
-        get-audio-tag #(js/document.getElementById "audio-element")]
-    [:section#player
-     (when url
-       [:div
-        [:audio#audio-element {:controls "controls"
-                               :style {:display "none"}}
-         [:source {:src url}]]
-        (let []
-          [:span#controls
-           ;; TODO: show just one of two
-           [:button {:on-click #(.play (get-audio-tag))}  "⏵"]
-           [:button {:on-click #(.pause (get-audio-tag))} "⏸"]])
+  (let [audio-ref (r/atom nil)]
+    (fn []
+      (when-let [url (get-in @app-state [:info :stream_url])]
+        [:section#player

-        (if track
-          (str (:artist track) " - " (:title track))
-          [:em "Nothing is playing"])
-        [:a {:href url} "↗"]])]))
+         [:audio {:ref #(reset! audio-ref %) :style {:display "none"}}
+          [:source {:src url}]]
+
+         [:span#controls
+          (when-let [audio @audio-ref]
+            (if (.-paused audio)
+              [:button {:on-click #(.play audio)}  "⏵"]
+              [:button {:on-click #(.pause audio)} "⏸"]))]
+
+         [now-playing]
+         [:a {:href url} "↗"]]))))

 (defn upload-section []
   [:section#upload


Factor out methods from fs protocol

Factor out methods from fs protocol

--- src/angelic/search/function_sets.clj
+++ src/angelic/search/function_sets.clj
@@ -25,9 +25,14 @@
   (child-seqs [fs input-set] "seq of seqs of FunctionSets. Only valid if above is :live.
                               (= :live (status fs s)) ==>
                                  (subset? (child-seqs fs s-subset) (child-seqs fs s)) (for names)")
-  (precondition-context-set [fs input-set] "Relevant set of variables")
-  (extract-context [fs input-set] "Relevant parts of input-set, for state abstraction")
-  (get-logger  [fs input-set]     "Get logger for input-set, in context of fs (also for SA)."))
+  (precondition-context-set [fs input-set] "Relevant set of variables"))
+
+(defn extract-context [fs input-set]
+  (state/extract-context input-set (precondition-context-set fs input-set)))
+
+(defn get-logger [fs input-set]
+  (state/get-logger input-set (precondition-context-set fs input-set)))
+

 (defn- output-or-nil [[opt rew :as p]]
   (when (and p (not (state-set/empty? opt)) (> rew Double/NEGATIVE_INFINITY))
@@ -46,11 +51,7 @@
     (apply-pess [fs input-set] (output-or-nil (angelic/pessimistic-set-and-reward action input-set)))
     (status     [fs input-set] (status-fn input-set))
     (child-seqs [fs input-set] (child-seq-fn input-set))
-    (precondition-context-set [fs input-set] (angelic/precondition-context-set action input-set))
-    (extract-context [fs input-set]
-      (state/extract-context input-set (angelic/precondition-context-set action input-set)))
-    (get-logger  [fs input-set]
-      (state/get-logger input-set (angelic/precondition-context-set action input-set))))))
+    (precondition-context-set [fs input-set] (angelic/precondition-context-set action input-set)))))

 (defmethod print-method angelic.search.function_sets.FunctionSet [s o]
            (print-method (fs-name s) o))


Fix tests.

Fix tests.

--- test/onyx/coordinator/single_peer_test.clj
+++ test/onyx/coordinator/single_peer_test.clj
@@ -155,9 +155,8 @@

     (facts "The payload node contains the other node paths"
            (let [nodes (:nodes (extensions/read-place sync payload-node))]
-             (fact (contains?
-                    (into #{} (keys nodes))
-                    #{:payload :ack :completion :status}) => true?)))
+             (fact (into #{} (keys nodes)) =>
+                   #{:payload :ack :completion :status :catalog :workflow :peer})))

     (facts "Touching the ack node triggers the callback"
            (let [nodes (:nodes (extensions/read-place sync payload-node))]


log information about in process zk

log information about in process zk

--- src/clj/backtype/storm/zookeeper.clj
+++ src/clj/backtype/storm/zookeeper.clj
@@ -99,6 +99,7 @@
         ))))

 (defn mk-inprocess-zookeeper [localdir port]
+  (log-message "Starting inprocess zookeeper at port " port " and dir " localdir)
   (let [localfile (File. localdir)
         zk (ZooKeeperServer. localfile localfile 2000)
         factory (NIOServerCnxn$Factory. (InetSocketAddress. port))]


Removed extra throttle usage.

Removed extra throttle usage.

--- src/clj/elephantdb/common/domain.clj
+++ src/clj/elephantdb/common/domain.clj
@@ -239,7 +239,7 @@
   "Transfers the supplied shard (specified by `idx`) from the supplied
   remote version's remote store to the appropriate path on the local
   store."
-  [{:keys [local-store remote-store]} version idx]
+  [{:keys [local-store remote-store throttle]} version idx]
   (let [remote-fs   (.getFileSystem remote-store)
         remote-path (.shardPath remote-store idx version)
         local-path  (.shardPath local-store idx version)]
@@ -247,7 +247,7 @@
       (do (log/info
            (format "Copied %s to %s." remote-path local-path))
           (transfer/rcopy remote-fs remote-path local-path
-                        :throttle throttle)
+                          :throttle throttle)
           (log/info
            (format "Copied %s to %s." remote-path local-path)))
       (do (log/info
@@ -258,8 +258,8 @@
   "Transfers the supplied version from the domain's remote store to
   its local store. To throttle the download, provide a throttling
   agent with the optional `:throttle` keyword argument."
-  [domain version & {:keys [throttle]}]
-  (let [{:keys [local-store remote-store]} domain]
+  [domain version]
+  (let [{:keys [local-store remote-store throttle]} domain]
     (.createVersion local-store version)
     (u/do-pmap (partial transfer-shard! domain version)
                (shard-set domain))
@@ -285,23 +285,21 @@
    :version - try to update to some version other than the most recent
   on the remote store."
   [{:keys [remote-store] :as domain}
-   & {:keys [throttle version]
+   & {:keys [version]
       :or {version (.mostRecentVersion remote-store)}}]
   (when (transfer-possible? domain version)
     (status/to-loading domain)
-    (transfer-version! domain version :throttle throttle)
+    (transfer-version! domain version)
     (load-version! version)
     (status/to-ready domain)))

 (defn attempt-update!
   "If the supplied domain isn't currently updating, returns a future
   containing a triggered update computation."
-  [domain & {:keys [throttle version]}]
+  [domain & {:keys [version]}]
   (if (updating? domain)
     (log/info "UPDATER - Not updating as update's still in progress.")
-    (future (update-domain! domain
-                            :throttle throttle
-                            :version version))))
+    (future (update-domain! domain :version version))))

 ;; ### Sharding Logic
 ;;
@@ -333,3 +331,47 @@
   (shard/prioritize-hosts shard-index
                           (key->shard domain key)
                           #{hostname}))
+
+
+(defn memory-persistence []
+  (let [state (atom {})]
+    (reify Persistence
+      (index [this doc]
+        (swap! state assoc (.key doc) (.val doc)))
+      (iterator [this]
+        (map (fn [[k v]] (KeyValDocument. k v))
+             @state))
+      (close [_]))))
+
+(defn memory-coordinator []
+  (let [state (atom {})]
+    (reify Coordinator
+      (openPersistenceForRead [this root opts]
+        (or (get @state root)
+            (let [fresh (memory-persistence)]
+              (swap! state assoc root fresh)
+              fresh))))))
+
+;; ## Type Versions
+;;
+;; TODO -- convert to KeyValPersistence
+
+(deftype MemoryPersistence [state]
+  Persistence
+  (index [{:keys [state]} doc]
+    (swap! state assoc (.key doc) (.val doc)))
+  (iterator [{:keys [state]}]
+    (map (fn [[k v]] (KeyValDocument. k v))
+         @state))
+  (close [_]))
+
+(deftype MemoryCoordinator [state]
+  Coordinator
+  (openPersistenceForRead
+    [{:keys [state]} root opts]
+    (or (get @state root)
+        (let [fresh (memory-persistence)]
+          (swap! state assoc root fresh)
+          fresh))))
+
+


Added basics of a local store.

Added basics of a local store.

--- src/clj/elephantdb/common/domain.clj
+++ src/clj/elephantdb/common/domain.clj
@@ -48,11 +48,15 @@
   (fn [_ remote]
     (class remote)))

+(defmethod mk-local-store nil
+  [local-path null]
+  (DomainStore. local-path))
+
 (defmethod mk-local-store String
   [local-path remote-path]
   (try (mk-local-store local-path (DomainStore. remote-path))
        (catch IllegalArgumentException _
-           (u/throw-runtime "No remote DomainStore at " remote-path))))
+         (u/throw-runtime "No remote DomainStore at " remote-path))))

 (defmethod mk-local-store DomainStore
   [local-path remote-vs]
@@ -89,6 +93,11 @@
             remote-version (.mostRecentVersion remote-store)]
         (when (and local-version remote-version)
           (< local-version remote-version)))))
+
+;; ## Sinking and Sourcing
+;;
+;; These methods allow the user to sink and source objects from the
+;; supplied domain.

 ;; ## Domain Tidying

@@ -186,6 +195,7 @@
 (defrecord Domain
     [local-store remote-store serializer throttle rw-lock
      hostname status domain-data shard-index]
+
   Shutdownable
   (shutdown [this]
     "Shutting down a domain requires closing all of its shards."
@@ -214,6 +224,25 @@
 ;;
 ;; This is the main function used by a database to build its domain objects.

+(defn local-domain
+  "Returns a domain object to be used with local stores only."
+  [local-root]
+  (let [localhost   (u/local-hostname)
+        local-store (mk-local-store local-root nil)
+        index        (shard/generate-index
+                      localhost (.getNumShards (.getSpec local-store)))]
+    (doto (Domain. local-store
+                   nil
+                   (Utils/makeSerializer (.getSpec local-store))
+                   nil
+                   (u/mk-rw-lock)
+                   localhost
+                   (atom (KeywordStatus. :loading))
+                   (atom {})
+                   index)
+      (load-version! (.mostRecentVersion local-store)))))
+
+;; TODO: Add more keyword arguments here! This thing should degrade gracefully.
 (defn build-domain
   "Constructs a domain record."
   [local-root hdfs-conf remote-path hosts replication
@@ -222,7 +251,7 @@
   (let [remote-fs     (h/filesystem hdfs-conf)
         remote-store  (DomainStore. remote-fs remote-path)
         local-store   (mk-local-store local-root remote-store)
-        index (shard/generate-index hosts (-> local-store .getSpec .getNumShards))]
+        index (shard/generate-index hosts (.getNumShards (.getSpec local-store)))]
     (Domain. local-store
              remote-store
              (Utils/makeSerializer (.getSpec local-store))


emap get-ds fixes

emap get-ds fixes

--- src/clojure/migae/datastore/emap.clj
+++ src/clojure/migae/datastore/emap.clj
@@ -67,23 +67,18 @@
 ;; getter
 (defn get-ds
   [keychain]
-  (log/trace "get-ds " keychain)
+  ;; (log/trace "get-ds " keychain)
    (if (clj/empty? keychain)
      (throw (IllegalArgumentException. "keychain vector must not be empty"))
-     (let [k (apply ekey/keychain-to-key keychain)
+     (let [k (ekey/keychain-to-key keychain)
            e (.get (ds/datastore) k)]
-       (log/trace "key: " k)
-       (log/trace "e: " e)
-       ;; throw  EntityNotFoundException
-                  ;; (catch EntityNotFoundException e nil)
-                  ;; (catch DatastoreFailureException e (throw e))
-                  ;; (catch java.lang.IllegalArgumentException e (throw e)))]
        (PersistentEntityMap. e))))

-;; co-constructor
+;; FIXME: does we really need a multimethod here?
+;; TODO: support kinded pulls, e.g. (entity-map* [:A])
 (defmulti entity-map*
-  "entity-map co-constructor.  Retrieve entities with exact, complete
-  match; if no matches, throw exception."
+  "Pull constructor.  Retrieve entities with exact, complete match; if
+  no matches, throw exception."
   ;; FIXME:  implement map matching
   ;; FIXME:  throw notfound exception
     (fn [keychain & valmap]


define return-handler before op-handler

define return-handler before op-handler

--- src/clojure/warreq/kea/calc/calc.clj
+++ src/clojure/warreq/kea/calc/calc.clj
@@ -27,6 +27,11 @@
     "×" *
     (resolve (symbol op))))

+(defn return-handler
+  [_]
+  (swap! expression conj (read-string (deref input)))
+  (reset! input ""))
+
 (defn num-handler
   [n]
   (swap! input str n))
@@ -54,7 +59,4 @@
       (reset! input (.substring cur 1 (.length cur)))
       (reset! input (str "-" cur)))))

-(defn return-handler
-  [_]
-  (swap! expression conj (read-string (deref input)))
-  (reset! input ""))
+


Include java type in logging output for SQL query params

--- src/com/puppetlabs/jdbc/internal.clj
+++ src/com/puppetlabs/jdbc/internal.clj
@@ -8,6 +8,15 @@
   (:require [clojure.java.jdbc :as sql]
             [clojure.tools.logging :as log]))

+(defn query-param->str*
+  "Helper method for converting a single parameter from a prepared statement
+  to a human-eradable string, including the java type of the param value."
+  [param]
+  (let [val (.getValue param)]
+    (format "(%s - %s)"
+      (if (string? val) (str "'" val "'") val)
+      (pr-str (type val)))))
+
 (defn query-params->str*
   "Helper method for converting a list of parameters from a prepared statement
   to a human-readable string.  Our current connection pool library does not
@@ -17,10 +26,9 @@
   [log-statements? params]
   (if log-statements?
     (format "Query Params: %s"
-      (join ", "
-        (map #(str "'" (.getValue %) "'") params)))
+      (join ", " (map query-param->str* params)))
     (str "(Query params unavailable: to enable logging of query params, please set "
-      "'log-statements' to true in the [database] section of your config file.)")))
+        "'log-statements' to true in the [database] section of your config file.)")))

 (defn connection-hook*
   "Helper method for building up a `ConnectionHook` for our connection pool.
@@ -71,7 +79,7 @@
   that a query result limit was exceeded."
   [limit]
   ; TODO: tempted to create a custom exception for this, or at least
-  ;  some kind of general-purpose PuppetDBEsxception
+  ;  some kind of general-purpose PuppetDBException
   (throw (IllegalStateException.
            (format
              "Query returns more than the maximum number of results (max: %s)"


Changing type hints for get-scene-from-panel

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

--- src/conexp/contrib/draw/lattices.clj
+++ src/conexp/contrib/draw/lattices.clj
@@ -86,9 +86,9 @@
 (defn get-scene-from-panel
   "If the given panel contains a lattice editor, returns the
   corresponding scene, nil otherwise."
-  [^JPanel panel]
+  [panel]
   (when (instance? conexp.contrib.draw.lattices.WithScene panel)
-    (.getScene panel)))
+    (.getScene ^conexp.contrib.draw.lattices.WithScene panel)))

 (defn get-layout-from-panel
   "If the given panel contains a lattice editor, return the


Fixing the dev system tests namespace so that it will find all tests.

--- dev-system/src/cmr/dev_system/tests.clj
+++ dev-system/src/cmr/dev_system/tests.clj
@@ -24,23 +24,25 @@
     10
     1))

-(def integration-test-namespaces
+(defn integration-test-namespaces
   "The list of integration test namespaces. Anything that contains 'cmr.' and 'int-test' is
   considered an integration test namespace."
+  []
   (->> (all-ns)
        (map str)
        (filter #(re-find #"cmr\..*int-test" %))
        (sort-by integration-test-ns->compare-value)))

-(def unit-test-namespaces
+(defn unit-test-namespaces
   "This defines a list of unit test namespaaces. Anything namespace name that contains 'cmr.' and
   'test' that is not an integration test namespace is considered a unit test namespace."
+  []
   (set/difference
     (->> (all-ns)
          (map str)
          (filter #(re-find #"cmr\..*test" %))
          set)
-    (set integration-test-namespaces)))
+    (set (integration-test-namespaces))))

 (defn run-tests
   "Runs all the tests matching the list of namespace regular expressions. The tests are run
@@ -132,8 +134,8 @@
   (println "RUNNING ALL TESTS")
   (let [{:keys [fail-fast?]} options
         test-results-handler (fail-fast?->test-results-handler fail-fast?)
-        unittest-results (run-tests unit-test-namespaces true)
-        inttest-results (run-tests integration-test-namespaces false)
+        unittest-results (run-tests (unit-test-namespaces) true)
+        inttest-results (run-tests (integration-test-namespaces) false)
         [took test-results] (u/time-execution
                               (test-results-handler
                                 (concat unittest-results inttest-results)))]


Add test for background-image.

Add test for background-image.

--- test/cljx/snippets/color/setting.cljx
+++ test/cljx/snippets/color/setting.cljx
@@ -24,11 +24,10 @@
       (q/background 0 0 255 120))
     (q/image gr 210 210)))

-#+clj
 (defsnippet background-image {}
   (let [gr (q/create-graphics (q/width) (q/height))]
     (q/with-graphics gr
-      (q/background 0 120 120)
+      (q/background 0 90 120)
       (q/ellipse 250 250 300 300))

     (q/background-image gr)))


uses commands in incomplete service description token tests (#493)

--- waiter/integration/waiter/token_request_test.clj
+++ waiter/integration/waiter/token_request_test.clj
@@ -794,20 +794,22 @@
 (deftest ^:parallel ^:integration-fast test-bad-token
   (testing-using-waiter-url

-    (testing "ignore missing token when have service description"
-      (let [response (make-request waiter-url "/pathabc" :headers {"host" "missing_token" "X-Waiter-CPUS" "1"})]
-        (is (str/includes? (:body response) "Service description using waiter headers/token improperly configured"))
-        (assert-response-status response 400)))
-
-    (testing "ignore invalid token when have service description"
-      (let [response (make-request waiter-url "/pathabc" :headers {"host" "bad/token" "X-Waiter-CPUS" "1"})]
-        (is (str/includes? (:body response) "Service description using waiter headers/token improperly configured"))
-        (assert-response-status response 400)))
-
-    (testing "ignore invalid token when have invalid service description"
-      (let [response (make-request waiter-url "/pathabc" :headers {"host" "bad/token" "X-Waiter-CPUS" "one"})]
-        (is (str/includes? (:body response) "Service description using waiter headers/token improperly configured"))
-        (assert-response-status response 400)))
+    (let [common-headers {"x-waiter-cmd" "foo-bar"
+                          "x-waiter-cmd-type" "shell"}]
+      (testing "ignore missing token when have service description"
+        (let [response (make-request waiter-url "/pathabc" :headers (assoc common-headers "host" "missing_token"))]
+          (is (str/includes? (:body response) "Service description using waiter headers/token improperly configured"))
+          (assert-response-status response 400)))
+
+      (testing "ignore invalid token when have service description"
+        (let [response (make-request waiter-url "/pathabc" :headers (assoc common-headers "host" "bad/token"))]
+          (is (str/includes? (:body response) "Service description using waiter headers/token improperly configured"))
+          (assert-response-status response 400)))
+
+      (testing "ignore invalid token when have invalid service description"
+        (let [response (make-request waiter-url "/pathabc" :headers (assoc common-headers "host" "bad/token"))]
+          (is (str/includes? (:body response) "Service description using waiter headers/token improperly configured"))
+          (assert-response-status response 400))))

     (testing "can't use missing token server"
       (let [response (make-request waiter-url "/pathabc" :headers {"host" "missing_token"})]


ensure any clj-http api requests are on :lock: down

--- test/gh_waiting_room/service_test.clj
+++ test/gh_waiting_room/service_test.clj
@@ -8,15 +8,30 @@
 (def service
   (::bootstrap/service-fn (bootstrap/create-servlet service/service)))

+(defn fail-request!
+  [{:keys [uri server-name server-port query-string scheme]}]
+  (throw (ex-info (format "Unexpected request %s. Web requests are not allowed in this test."
+                          (str (name scheme) "://" server-name
+                               (when server-port (str ":" server-port))
+                               uri
+                               (when query-string (str "?" query-string))))
+                  {})))
+
+(defmacro disallow-web-requests!
+  [& body]
+  `(with-redefs [clj-http.core/request fail-request!]
+     ~@body))
+
 (defn body-of-home-page
   []
-  (with-redefs [github/viewable-issues
-                (constantly [{:position "1"
-                              :id "cldwalker/gh-waiting-room#1"
-                              :url "https://github.com/cldwalker/gh-waiting-room/issues/1"}])
-                service/update-gh-issues (constantly nil)
-                gh-waiting-room.config/gh-user (constantly "Hal")]
-    (:body (response-for service :get "/"))))
+  (disallow-web-requests!
+   (with-redefs [github/viewable-issues
+                 (constantly [{:position "1"
+                               :id "cldwalker/gh-waiting-room#1"
+                               :url "https://github.com/cldwalker/gh-waiting-room/issues/1"}])
+                 service/update-gh-issues (constantly nil)
+                 gh-waiting-room.config/gh-user (constantly "Hal")]
+     (:body (response-for service :get "/")))))

 (deftest home-page-test
   (let [body (body-of-home-page)]
@@ -43,18 +58,19 @@

 (defn fns-called-for-webhook-page
   [action & options]
-  (let [{:keys [issues full-name]
-         :or {issues [{:id "cldwalker/something"}]
-              full-name "cldwalker/stub"}} options
-        mocks-called (atom {})
-        json {"action" action
-              "repository" {"full_name" full-name}
-              "issue" {"number" "1"}}]
-    (with-redefs [service/update-gh-issues (inc-mock-count mocks-called :update-gh-issues)
-                  github/create-issue-comment (inc-mock-count mocks-called :create-issue-comment)
-                  github/viewable-issues (constantly issues)]
-      (service/webhook-page {:json-params json}))
-    @mocks-called))
+  (disallow-web-requests!
+   (let [{:keys [issues full-name]
+          :or {issues [{:id "cldwalker/something"}]
+               full-name "cldwalker/stub"}} options
+               mocks-called (atom {})
+               json {"action" action
+                     "repository" {"full_name" full-name}
+                     "issue" {"number" "1"}}]
+     (with-redefs [service/update-gh-issues (inc-mock-count mocks-called :update-gh-issues)
+                   github/create-issue-comment (inc-mock-count mocks-called :create-issue-comment)
+                   github/viewable-issues (constantly issues)]
+       (service/webhook-page {:json-params json}))
+     @mocks-called)))

 ;;; Doesn't use response-for as it doesn't support :post yet
 (deftest webhook-page-test


CMR-493: Removed commented out test.

CMR-493: Removed commented out test.

--- test/cmr/system_int_test/search/granule_psa_search_test.clj
+++ test/cmr/system_int_test/search/granule_psa_search_test.clj
@@ -78,9 +78,6 @@

   (is (= {:status 422 :errors [(am/attributes-must-be-sequence-msg)]}
          (search/find-refs :granule {"attribute" "string,alpha,a"}))))
-
-  ; (is (= {:status 422 :errors [(am/duplicate-parameter-msg [:value "2"])]}
-  ;        (search/find-refs :granule "attribute[][name]=a&attribute[][type]=string&attribute[][value]=1&attribute[][value]=2"))))

 ;; These are for boolean, datetime_string, time_string, and date_string attribute types which are all indexed and searchable as strings.
 (deftest indexed-as-string-psas-search-test


Minor tweaks to test file

Minor tweaks to test file

--- test/ardoq/swagger_test.clj
+++ test/ardoq/swagger_test.clj
@@ -40,10 +40,10 @@

 (defn count-securities [paths]
   (reduce (fn [counter [_ method]]
-           (+ counter (reduce (fn [inner [_ x]]
-                                (+ inner (count (:security x))))
-                         0
-                         method)))
+            (reduce (fn [inner [_ x]]
+                         (+ inner (count (:security x))))
+                       counter
+                       method))
           0
           paths))

@@ -88,4 +88,3 @@
                            swag (import-spec spec nil json-spec f)]
                        (update-spec spec nil swag json-spec f)
                        (c/delete swag client)))))))
-


fixing test

fixing test

--- test/celestial/test/aws.clj
+++ test/celestial/test/aws.clj
@@ -12,5 +12,5 @@
     (fact "We cannot start a instance without an aws instance id"
           (.start instance) => (throws ExceptionInfo (is-type? :aws.provider/aws:missing-id)))
     (fact "min-count max-count"
-        (:spec instance)  => (contains {:min-count 1 :max-count 1}))))
+        (get-in instance [:spec :aws])  => (contains {:min-count 1 :max-count 1}))))


fix up timing tests

fix up timing tests

--- test/cheshire/test/core.clj
+++ test/cheshire/test/core.clj
@@ -97,9 +97,9 @@
     (dotimes [i 1000]
       (doseq [t tests]
         (t)))
-    (doto (/ (double (- (System/nanoTime) start)) 1000000.0) prn)))
+    (/ (double (- (System/nanoTime) start)) 1000000.0)))

-(deftest test-performance
+#_(deftest test-performance
   (let [tests (->> (ns-publics 'cheshire.test.core)
                    (remove (comp (partial = 'test-performance) first))
                    (map second)
@@ -108,5 +108,6 @@
     (let [times (doall (map timed-tests (repeat 3 tests)))
           min-time (apply min times)
           max-time (apply max times)]
+      (prn min-time max-time)
       (is (> 2000 min-time))
       (is (> 5200 max-time)))))


Add inserts? and uses? predicates to select subsets of the graph.

--- src/main/clojure/clara/tools/viz.clj
+++ src/main/clojure/clara/tools/viz.clj
@@ -6,14 +6,16 @@
            [hiccup.core :as h]
            [clojure.string :as string]))

-(defn get-productions [sources]
+(defn get-productions
+  "Returns a sequence of productions from the given sources."
+  [sources]
   (mapcat
    #(if (satisfies? eng/IRuleSource %)
       (eng/load-rules %)
       %)
    sources))

-(defn condition-to-html
+(defn- condition-to-html
   "Returns an HTML-based description of the given condition. "
   [condition]
   (h/html
@@ -31,7 +33,7 @@
         [:tr [:td [:b (str (last (string/split (.getName (:type condition)) #"\.")))]]])
       [:tr [:td (h/h (str (:constraints condition)))]]])))

-(defn rhs-to-html
+(defn- rhs-to-html
   "Returns an HTML-based description of the right-hand side of a production.."
   [{:keys [name rhs] :as production}]
  (h/html [:table  {:border "0" :cellborder "0"}
@@ -94,7 +96,7 @@
      dot/dot
      dot/show!)))

-(def operators #{:and :or :not})
+(def ^:private operators #{:and :or :not})

 (defn- condition-to-id-map
   "Returns a map associating conditions to node ids"
@@ -114,7 +116,7 @@
           conditions
           (range)))))

-(defn production-to-dot [production]
+(defn- production-to-dot [production]
   (let [condition-to-ids (condition-to-id-map production)

         ;; Identify root conditions by first finding all children,
@@ -157,7 +159,7 @@
      (for [[condition id] root-conditions]
        [id (hash production)]))))

-(defn get-insertions
+(defn- get-insertions
   "Returns the insertions done by a production."
   [production]
   (if-let [rhs (:rhs production)]
@@ -175,7 +177,15 @@
             (subs (name create-fact-fn) 2)))) ; Return the record type.
     #{}))

-(defn insertions-to-dot [productions]
+(defn- get-uses
+  "Returns the facts consumed by a production."
+  [production]
+  (into #{}
+        (for [[condition id] (condition-to-id-map production)
+              :when (:type condition)]
+          (.getName (:type condition)))))
+
+(defn- insertions-to-dot [productions]
   (let [types-to-ids ; A map of all conditions and their node ids.
         (reduce
          (fn [map [type id]]
@@ -199,17 +209,28 @@
           condition-id (get types-to-ids insertion)]
       [(hash production) condition-id {:style :dashed}])))

+(defn inserts?
+  "Predicate that returns true when the given rule inserts the given fact"
+  [rule fact]
+  (contains? (get-insertions rule)
+             (.getName fact)))
+
+(defn uses?
+  "Predicate that returns true when the given rule uses the given fact."
+  [rule fact]
+  (contains? (get-uses rule)
+             (.getName fact)))

 (defn show-logic!
   [& sources]
   (let [productions (get-productions sources)]

-    (->
+    (->>
      (concat
       (mapcat production-to-dot productions)
       (insertions-to-dot productions))
      vec ; dorothy assumes a vector.
-     dot/digraph
-     dot/dot
+     dot/digraph
+     dot/dot
      dot/show!
      )))