Don't test headers

Don't test headers

--- test/obb_api/handlers/index_test.clj
+++ test/obb_api/handlers/index_test.clj
@@ -7,7 +7,4 @@
 (deftest index-test
   (is (=
        (service/get-json "/")
-       {:name "obb-api"}))
-  (is (=
-       (service/get-headers "/")
-       {"Content-Type" "application/json;charset=UTF-8"})))
+       {:name "obb-api"})))


Get more github permissions, fixes a bug displaying private repos

--- backend/src/circle/workers/github.clj
+++ backend/src/circle/workers/github.clj
@@ -46,8 +46,6 @@

 (def settings (default))

-
-
 (defn fetch-github-access-token [userid code]
   "After sending a customer to github to provide us with oauth permission, github
   redirects them back, providing us with a temporary code. We can use this code to ask
@@ -71,11 +69,10 @@
   "The URL that we send a user to, to allow them authorize us for oauth. Redirect is where the should be redirected afterwards"
   (let [endpoint "https://github.com/login/oauth/authorize"
         query-string (client/generate-query-string {:client_id (:client_id settings)
-                                                    :scopes "repo"
+                                                    :scope "repo"
                                                     :redirect_uri redirect})]
     (str endpoint "?" query-string)))

-
 (fact "authorization-url works"
   (-> "http://localhost:3000/hooks/repos" authorization-url) =>
-  "https://github.com/login/oauth/authorize?client_id=586bf699b48f69a09d8c&scopes=repo&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fhooks%2Frepos")
+  "https://github.com/login/oauth/authorize?client_id=586bf699b48f69a09d8c&scope=repo&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fhooks%2Frepos")


Planet-count-based default location for ship-groups working

--- src/glory_of_empires/map.clj
+++ src/glory_of_empires/map.clj
@@ -154,11 +154,27 @@
   { :pre [ (>= clock 0) (<= clock 12) (>= rel-distance 0) (<= rel-distance 1) ] }
   (polar (- 180 (* clock 30)) (* rel-distance 0.5 tile-width)))

-(def default-ship-locs [ [ -90 80 ] [ 90 -80 ] ]) ; suitable for standard 2-planet system
+(defn default-ship-locs [ planets-count ship-count ]
+  (cond
+    (= planets-count 0)
+      (cond
+        (<= ship-count 4) [ [ 0 0 ] ]
+        :else [ [ 0 -80 ] [ 0 80 ] ] )
+    (= planets-count 1)
+      (cond
+        (<= ship-count 2) [ [ 120 0 ] ]
+        (<= ship-count 4) [ [ 120 0 ] [ -120 0 ] ]
+        :else [ [ 120 0 ] [ -120 0 ] [ 0 -120 ] ] )
+    (= planets-count 2)
+      (cond
+        (<= ship-count 6) [ [ -90 80 ] [ 90 -80 ] ]
+        :else [ [ -90 80 ] [ 90 -80 ] [ 0 0 ] ] )
+    (= planets-count 3)
+      [ [ 0 0 ] [ 90 -80 ] [ -90 -90 ] [ 90 110 ] ] ))
+
+(def ship-horiz-spacing 50)

 (def planet-units-locs [ [ 0 -30 ] [ 0 30 ] ])
-
-(def ship-horiz-spacing 50)

 (defn group-ships [ ships group-locs ]
   (let [ ships-per-group (int (Math/ceil (/ (count ships) (count group-locs))))
@@ -201,7 +217,8 @@
                        ships :ships planets :planets } ]
   (let [ center (mul-vec tile-size 0.5)
          system-info (systems/get-system system-id)
-         ships-content (if (or (not ships) (empty? ships)) [] (ships-svg (vals ships) default-ship-locs)) ; TODO: make default locs dependent on number of planets (0, 1, 2, 3)
+         ship-locs (default-ship-locs (count (system-info :planets)) (count ships))
+         ships-content (if (or (not ships) (empty? ships)) [] (ships-svg (vals ships) ship-locs)) ; TODO: make default locs dependent on number of planets (0, 1, 2, 3)
          planets-units (if (or (not planets) (empty? planets)) []
                          (filter #(not (nil? %)) (map #(planet-units-svg % system-info) planets)))
          tile-label (svg/double-text (str/upper-case (name loc-id)) [ 25 200 ] { :id (str (name system-id) "-loc-label") }) ]


feature #7568 - added WIBB token on rinkeby

Signed-off-by: Igor Mandrigin <042dc4512fa3d391c5170cf3aa61e6a638f84342@mandrigin.ru>

--- src/status_im/utils/ethereum/tokens.cljs
+++ src/status_im/utils/ethereum/tokens.cljs
@@ -514,7 +514,11 @@
                    {:symbol   :KDO
                     :nft?     true
                     :name     "KudosToken"
-                    :address  "0x93bb0afbd0627bbd3a6c72bc318341d3a22e254a"}])
+                    :address  "0x93bb0afbd0627bbd3a6c72bc318341d3a22e254a"}
+                   {:symbol   :WIBB
+                    :name     "WIBB"
+                    :address  "0x7d4ccf6af2f0fdad48ee7958bcc28bdef7b732c7"
+                    :decimals 18}])

    :xdai
    (resolve-icons :xdai


fix a bug of :editor.force.wrap command

fix a bug of :editor.force.wrap command

--- src/lt/objs/editor/pool.cljs
+++ src/lt/objs/editor/pool.cljs
@@ -581,8 +581,14 @@
               :exec (fn []
                       (when-let [ed (last-active)]
                         (if (editor/option ed "lineWrapping")
-                          (object/add-tags ed [:editor.force.unwrap])
-                          (object/add-tags ed [:editor.force.wrap]))))})
+                          (do
+                            (object/remove-tags ed [:editor.force.wrap])
+                            (object/add-tags ed [:editor.force.unwrap])
+                            (notifos/set-msg! "Wrapping off" {:timeout 2000}))
+                          (do
+                            (object/remove-tags ed [:editor.force.unwrap])
+                            (object/add-tags ed [:editor.force.wrap])
+                            (notifos/set-msg! "Wrapping on" {:timeout 2000})))))})

 (cmd/command {:command :editor.undo
               :desc "Editor: Undo"


test hook

test hook

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


toString for Namespace

toString for Namespace

--- src/main/cljs/cljs/core.cljs
+++ src/main/cljs/cljs/core.cljs
@@ -9821,6 +9821,8 @@
       (symbol (str name) (str sym)) nil))
   (getMappings [_]
     @mappings)
+  (toString [_]
+    (str name))
   IEquiv
   (-equiv [_ other]
     (if (instance? Namespace other)


Command multimethod and clear command.

Command multimethod and clear command.

--- src/mash_commander/core.cljs
+++ src/mash_commander/core.cljs
@@ -24,6 +24,28 @@
 (defn recognize? [letters]
   (let [last-word (str/join (reverse (take-while #(not= " " %) letters)))]
     (contains? valid-words last-word)))
+
+(defonce valid-commands #{"clear"})
+
+(defmulti dispatch-enter
+  (fn [cursor]
+    (let [letters (get-in cursor [:active :letters])
+          command (str/join (take-while #(not= " " %) (reverse letters)))]
+      (if (contains? valid-commands command)
+        command
+        :default))))
+
+(defmethod dispatch-enter :default
+  [cursor]
+  (as-> cursor c
+    (assoc c :history (cons (:active c) (:history c)))
+    (assoc c :active {:state [:empty] :letters []})))
+
+(defmethod dispatch-enter "clear"
+  [cursor]
+  (as-> cursor c
+    (assoc c :history [])
+    (assoc c :active {:state [:empty] :letters []})))49

 (defn handle-keydown [owner e]
   (let [key (.-key e)]
@@ -55,12 +77,9 @@
             (assoc-in c [:active :state] (rest (get-in c [:active :state])))
             (assoc-in c [:active :letters] (rest (get-in c [:active :letters]))))
           ;; Enter
-          (= "Enter" key)
-          (as-> % c
-            (assoc c :history (cons (:active c) (:history c)))
-            (assoc c :active {:state [:empty] :letters []}))
+          (= "Enter" key) (dispatch-enter %)
           ;; Ignore everything else
-          :default (do (print key) %))))))
+          :default %)))))

 (defn line-view [cursor]
   (reify
@@ -69,8 +88,9 @@
     om/IRenderState
     (render-state [_ state]
       (let [words (str/split (str/join (reverse (:letters cursor))) " ")
-            space (contains? #{:typing-space :mashing-space} (first (:state cursor)))
-            cur (dom/span #js {:style #js {:color "#900"}} "\u2588")
+            spacing (contains? #{:typing-space :mashing-space} (first (:state cursor)))
+            commanding (contains? valid-commands (first words))
+            cursor-char (dom/span #js {:style #js {:color "#900"}} "\u2588")
             rendered-words (interpose
                             (dom/span nil " ")
                             (map #(if (contains? valid-words %)
@@ -80,9 +100,11 @@
         (apply dom/div #js {:style #js {:fontSize "30px"
                                         :lineHeight "40px"
                                         :padding "15px 15px 0 15px"}}
-               (if (:focus state)
-                 (concat rendered-words (if space [(dom/span nil " ") cur] [cur]))
-                 rendered-words))))))
+               (as-> rendered-words r
+                 (if (and (:focus state) spacing) (concat r [(dom/span nil " ") cursor-char]) r)
+                 (if (and (:focus state) (not spacing)) (concat r [cursor-char]) r)
+                 (if commanding (cons (dom/span #js {:style #js {:color "#33f"}} (first words))
+                                      (rest r)) r)))))))

 (defn app-view [cursor owner]
   (reify


Layout improvements on simple todo demo

Layout improvements on simple todo demo

--- workspaces/src/com/wsscode/pathom/workspaces/graphql/simple_todo_demo.cljs
+++ workspaces/src/com/wsscode/pathom/workspaces/graphql/simple_todo_demo.cljs
@@ -1,6 +1,5 @@
 (ns com.wsscode.pathom.workspaces.graphql.simple-todo-demo
   (:require [fulcro.client.primitives :as fp]
-            [fulcro.client.localized-dom :as dom]
             [nubank.workspaces.card-types.fulcro :as ct.fulcro]
             [nubank.workspaces.lib.fulcro-portal :as f.portal]
             [nubank.workspaces.core :as ws]
@@ -8,8 +7,8 @@
             [com.wsscode.pathom.fulcro.network :as pfn]
             [fulcro.client.mutations :as fm]
             [com.wsscode.fulcro.db-helpers :as db.h]
-            [com.wsscode.fulcro.reakit :as rk]
-            ["react-icons/lib/fa" :as fa]))
+            [com.wsscode.fulcro.ui.reakit :as rk]
+            [com.wsscode.fulcro.ui.icons.font-awesome :as fa]))

 (declare TodoItem)

@@ -28,7 +27,7 @@
                      :todo/completed false})
    :ident         [:todo/id :todo/id]
    :query         [:todo/id :todo/title :todo/completed]
-   :css           [[:.completed {:text-decoration "line-through"}]
+   :css           [[:.completed [:label {:text-decoration "line-through"}]]
                    [:.creating {:color "#ccc"}]]
    :css-include   []}
   (rk/block {:classes [(if completed :.completed)
@@ -36,6 +35,7 @@
     (rk/label
       (rk/input {:type    "checkbox"
                  :checked completed
+                 :marginRight 5
                  :onChange #(fp/transact! this [`(update-todo-item ~{:todo/id id :todo/completed (not completed)})])})
       (str title))))

@@ -51,13 +51,13 @@
    :query         [:todo/id :todo/title :todo/completed]
    :css           []
    :css-include   []}
-  (rk/group {}
+  (rk/group {:marginBottom 10}
     (rk/input {:type     "text"
                :value    title
                :onChange #(fm/set-string! this :todo/title :event %)})
     (rk/button {:onClick #(on-save-todo (fp/props this))}
       "Add"
-      (dom/create-element fa/FaPlusSquare))))
+      (fa/plus-square))))

 (fm/defmutation create-todo-item [todo]
   (action [env]


Refactor tests for get-enclosing-sexp

Refactor tests for get-enclosing-sexp

This had ACTUAL EXPECTED insetad of EXPECTED ACTUAL which made it harder
to read the diffs.

--- test/refactor_nrepl/util_test.clj
+++ test/refactor_nrepl/util_test.clj
@@ -3,8 +3,8 @@
             [clojure.test :refer :all]))

 (def file-content (slurp "test/resources/testproject/src/com/example/sexp_test.clj"))
-(def weird-file-content ";; some weird file
-;; not even clojure
+  (def weird-file-content ";; some weird file
+  ;; not even clojure
 ;; perhaps? no parens!")
 (def binding-location [4 10])
 (def funcall-location [7 8])
@@ -13,11 +13,10 @@
 (def weird-location [2 5])

 (deftest get-enclosing-sexp-test
-  (is (= (apply get-enclosing-sexp file-content binding-location)
-         "[some :bindings
-        more :bindings]"))
-  (is (= (apply get-enclosing-sexp file-content funcall-location)
-         "(println #{some}
+  (is (= "[some :bindings
+        more :bindings]"
+         (apply get-enclosing-sexp file-content binding-location)))
+  (is (= "(println #{some}
              ;; helpful comment
              (prn {\"foo\" {:qux [#{more}]}}))"))
   (is (= (apply get-enclosing-sexp file-content set-location) "#{more}"))


Point to my repo.

Point to my repo.

--- src/yetibot/core/webapp/views/common.clj
+++ src/yetibot/core/webapp/views/common.clj
@@ -16,7 +16,7 @@
      (include-css "/css/screen.css")]
     [:body
      [:div.content.animate
-      (link-to "http://github.com/devth/yetibot"
+      (link-to "http://github.com/audaxion/yetibot"
                (image {:class "yeti"} "/img/yeti.png")
                [:h1 "yetibot"]
                [:p version] )]]))


bootlaces version

bootlaces version

--- build.boot
+++ build.boot
@@ -22,7 +22,7 @@
                   [adzerk/boot-reload        "0.3.1"          :scope "test"]
                   [adzerk/boot-cljs-repl     "0.1.9"          :scope "test"]
                   [pandeiro/boot-http        "0.6.3-SNAPSHOT" :scope "test"]
-                  [adzerk/bootlaces          "0.1.11"         :scope "test"]])
+                  [adzerk/bootlaces          "0.1.13"         :scope "test"]])

 (require '[adzerk.boot-cljs      :refer [cljs]]
          '[adzerk.boot-reload    :refer [reload]]


Remove unnecessary require from

Remove unnecessary require from

--- build.boot
+++ build.boot
@@ -19,7 +19,6 @@
    [adzerk/bootlaces "0.1.13" :scope "test"]])

 (require
- '[github-changelog.core :refer [changelog]]
  '[adzerk.boot-test :as boot-test]
  '[tolitius.boot-check :as check]
  '[adzerk.bootlaces :refer :all])


Improved tests execution process.

Improved tests execution process.

--- build.boot
+++ build.boot
@@ -9,7 +9,6 @@
                  [boot-deps "0.1.4" :scope "test"]
                  [funcool/bootutils "0.2.0" :scope "test"]
                  [funcool/boot-codeina "0.1.0-SNAPSHOT" :scope "test"]
-                 [adzerk/boot-test "1.0.4" :scope "test"]

                  ;; Testing dependecines
                  [clj-http "1.1.2" :scope "test"]
@@ -36,7 +35,6 @@
 (require
  '[funcool.bootutils :refer :all]
  '[funcool.boot-codeina :refer :all]
- '[adzerk.boot-test :refer :all]
  '[boot-deps :refer [ancient]])

 (def +version+ "0.2.0-SNAPSHOT")
@@ -75,8 +73,22 @@
          :src-uri "http://github.com/funcool/catacumba/blob/master/"
          :src-uri-prefix "#L"})

-
 (deftask doc
   []
   (comp (javac)
         (apidoc)))
+
+(deftask watch-tests
+  [n namespaces NAMESPACE #{sym} "The set of namespace symbols to run tests in."
+   f filters    EXPR      #{edn} "The set of expressions to use to filter namespaces."
+   s tname      NAME      sym    "The name symbol for filtering."]
+  (let [namespaces (or namespaces
+                       #{'catacumba.core-tests
+                         'catacumba.handlers-tests
+                         'catacumba.ring-tests
+                         'catacumba.websocket-tests})]
+    (comp (javac)
+          (watch :verbose true)
+          (run-tests :namespaces namespaces
+                     :filters filters
+                     :tname tname))))


hazelcast upto 3.9.2

hazelcast upto 3.9.2

--- build.boot
+++ build.boot
@@ -1,11 +1,11 @@
-(def +version+ "0.1.15")
+(def +version+ "0.1.16-SNAPSHOT")

 (set-env!
   :source-paths #{"src"}
   :dependencies '[[org.clojure/clojure "1.8.0"]
                   [org.clojure/tools.logging "0.3.1"]
-                  [com.hazelcast/hazelcast "3.9"]
-                  [com.hazelcast/hazelcast-client "3.9"]
+                  [com.hazelcast/hazelcast "3.9.2"]
+                  [com.hazelcast/hazelcast-client "3.9.2"]
                   [org.hface/hface-client "0.1.5"]
                   [cheshire "5.6.3"]
                   [com.cognitect/transit-clj "0.8.275"]


Update cljs

Update cljs

--- build.boot
+++ build.boot
@@ -4,7 +4,7 @@
   :dependencies '[[org.clojure/test.check "0.9.0" :scope "test"]
                   [adzerk/boot-cljs "1.7.228-2" :scope "test"]
                   ; cljs deps
-                  [org.clojure/clojurescript "1.9.456" :scope "test"]
+                  [org.clojure/clojurescript "1.9.473" :scope "test"]
                   [paren-soup "2.8.4" :scope "test"]
                   [cljsjs/codemirror "5.19.0-0" :scope "test"]
                   ; clj deps


remove accidental dep included

remove accidental dep included

--- build.boot
+++ build.boot
@@ -5,8 +5,7 @@
                     [adzerk/boot-reload        "0.4.5"]
                     [deraen/boot-less          "0.5.0"]
                     [org.clojure/clojurescript "1.7.228"]
-                    [pandeiro/boot-http        "0.7.0"]
-                    [reagent                   "0.6.0-alpha"]])
+                    [pandeiro/boot-http        "0.7.0"]])

 (require
  '[adzerk.boot-cljs   :refer [cljs]]


Five new tests added into server-test: println-and-flush, get-user-name, get-title, get-url-prefix, and finish-processing

--- test/zg/server_test.clj
+++ test/zg/server_test.clj
@@ -27,6 +27,35 @@
 ; Tests for various functions existence
 ;

+(deftest test-println-and-flush-existence
+    "Check that the zg.server/println-and-flush definition exists."
+    (testing "if the zg.server/println-and-flush definition exists."
+        (is (callable? 'zg.server/println-and-flush))))
+
+
+(deftest test-get-user-name-existence
+    "Check that the zg.server/get-user-name definition exists."
+    (testing "if the zg.server/get-user-name definition exists."
+        (is (callable? 'zg.server/get-user-name))))
+
+
+(deftest test-get-title-existence
+    "Check that the zg.server/get-title definition exists."
+    (testing "if the zg.server/get-title definition exists."
+        (is (callable? 'zg.server/get-title))))
+
+
+(deftest test-get-url-prefix-existence
+    "Check that the zg.server/get-url-prefix definition exists."
+    (testing "if the zg.server/get-url-prefix definition exists."
+        (is (callable? 'zg.server/get-url-prefix))))
+
+
+(deftest test-finish-processing-existence
+    "Check that the zg.server/finish-processing definition exists."
+    (testing "if the zg.server/finish-processing definition exists."
+        (is (callable? 'zg.server/finish-processing))))
+
 ;
 ; Test for function behaviours
 ;


Added classificaiton for unknwon groups

Added classificaiton for unknwon groups


Fixing after merge problems

Fixing after merge problems

--- src/kixi/hecuba/web.clj
+++ src/kixi/hecuba/web.clj
@@ -55,14 +55,14 @@
 (defn index [req]
   {:status 200 :body (slurp (io/resource "hecuba/index.html"))})

-(defn make-routes [store]
+(defn make-routes [names producer-config store]
   (let [project (project-resource store)
         projects (projects-resource store project)]
     ["/"
      [["" (->Redirect 307 index)]
       ["overview.html" index]

-      ["name" (wrap-params (name-resource names))]
+      ;;["name" (wrap-params (name-resource names))]
       ["reading" (wrap-params (reading-resource names producer-config))]

       ["projects/" projects]
@@ -86,7 +86,7 @@
   (init [_ system] system)
   (start [_ system]
     (println "My channel is " (satisfying-dependency system config 'jig.async/Channel))
-    (add-bidi-routes system config (make-routes (:names system)
-                                                (first (:kixi.hecuba.kafka/producer-config (:hecuba/kafka system)))
+    (add-bidi-routes system config (make-routes (:names system)
+                                                (first (:kixi.hecuba.kafka/producer-config (:hecuba/kafka system)))
                                                 (lookup-store system config))))
   (stop [_ system] system))


Remove dead analytics code

Remove dead analytics code

--- src-cljs/frontend/analytics.cljs
+++ src-cljs/frontend/analytics.cljs
@@ -74,12 +74,6 @@
 (deftrack track-save-orgs []
   (mixpanel/track "Save Organizations"))

-(deftrack track-collapse-nav []
-  (mixpanel/track "aside_nav_collapsed"))
-
-(deftrack track-expand-nav []
-  (mixpanel/track "aside_nav_expanded"))
-
 (deftrack track-signup []
   (utils/swallow-errors
    (twitter/track-signup)


FIX: Broken routing test

FIX: Broken routing test

--- test/membership_manager/handler_test.clj
+++ test/membership_manager/handler_test.clj
@@ -6,8 +6,7 @@
 (deftest test-app
   (testing "main route"
     (let [response (app (mock/request :get "/"))]
-      (is (= (:status response) 200))
-      (is (= (:body response) "Hello World"))))
+      (is (= (:status response) 200))))

   (testing "not-found route"
     (let [response (app (mock/request :get "/invalid"))]


(maint) refactor test to be a little simpler

Here we reduce the number of atoms and promises we're using by
rearranging the code to deliver the recieved message into a promise
called `recieved`, and compare that to the fields of the message
we formed to send `message`

--- test/puppetlabs/cthun/messaging_test.clj
+++ test/puppetlabs/cthun/messaging_test.clj
@@ -23,8 +23,8 @@
                :ssl-crl-path "./test-resources/ssl/ca/ca_crl.pem"}

    :web-router-service
-              {:puppetlabs.cthun.broker.service/broker-service {:websocket "/cthun"
-                                                                :metrics "/"}}
+   {:puppetlabs.cthun.broker.service/broker-service {:websocket "/cthun"
+                                                     :metrics "/"}}

    :metrics {:enabled true}

@@ -45,57 +45,32 @@
 		   :cacert      "test-resources/ssl/certs/ca.pem"
 		   :identity    (str "cth://" controller-id "/demo-client")
 		   :type        "demo-client"}
-		  {"example/cnc_request" handler-function
-		   "example/any_schema"  handler-function
+		  {"example/any_schema"  handler-function
 		   :default              default-request-handler}))

 (deftest send-message-and-assert-received-unchanged-test
   (testing "binary payloads"
-     (with-app-with-config
-       app
-       [broker-service jetty9-service webrouting-service metrics-service]
-       broker-config
-       (let [expected-data "Hello World!Ѱ$£%^\"\t\r\n(*)"
-             actual-data (atom nil)
-             expected-id (atom nil)
-             actual-id (atom nil)
-             expected-expires (atom nil)
-             actual-expires (atom nil)
-             expected-targets ["cth://0002_controller/demo-client"]
-             actual-targets (atom nil)
-             expected-sender "cth://0001_controller/demo-client"
-             actual-sender (atom nil)
-             msg2-received? (promise)
-             conn1 (connect-controller "0001_controller" default-request-handler)
-             handler (fn [conn2 request]
-                        (log/info "conn2 got message via any_schema" request)
-                        (let [data (String. (message/get-data request) "UTF-8")]
-                           (log/debug "message data as string is:" data)
-                           (reset! actual-data data)
-                           (reset! actual-id (:id request))
-                           (reset! actual-expires (:expires request))
-                           (reset! actual-targets (:targets request))
-                           (reset! actual-sender (:sender request))
-                           (deliver msg2-received? true)))
-              conn2 (connect-controller "0002_controller" handler)]
-                (let [outbound-message (-> (message/make-message)
-                                           (message/set-expiry 3 :seconds)
-                                           (message/set-data (byte-array (.getBytes expected-data "UTF-8")))
-                                           (assoc :targets expected-targets
-                                                  :message_type "example/any_schema"))]
-                     (reset! expected-id (:id outbound-message))
-                     (reset! expected-expires (:expires outbound-message))
-                     (client/send! conn1 outbound-message))
-
-                @msg2-received?
-                (is (= expected-data @actual-data) (str "Comparing sent data \"" expected-data "\" with received data \"" @actual-data "\""))
-                (log/info (str "Asserting that id" @expected-id "equals" @actual-id))
-                (is (= @expected-id @actual-id) (str "Comparing sent id \"" @expected-id "\" with received id \"" @actual-id "\""))
-                (log/info (str "Asserting that expiry \"" @expected-expires "\" equals \"" @actual-expires "\""))
-                (is (= @expected-expires @actual-expires) (str "Comparing sent expires \"" @expected-expires "\" with received expires \"" @actual-expires "\""))
-                (log/info (str "Asserting that targets \"" expected-targets "\" equals \"" @actual-targets "\""))
-                (is (= expected-targets @actual-targets) (str "Comparing sent targets \"" expected-targets "\" with received targets \"" @actual-targets "\""))
-                (log/info (str "Asserting that sender \"" expected-sender "\" equals \"" @actual-sender "\""))
-                (is (= expected-sender @actual-sender) (str "Comparing sent sender \"" expected-sender "\" with received sender \"" @actual-sender "\""))
-                (client/close conn1)
-                (client/close conn2)))))
+    (with-app-with-config
+      app
+      [broker-service jetty9-service webrouting-service metrics-service]
+      broker-config
+      (let [expected-data "Hello World!Ѱ$£%^\"\t\r\n(*)"
+            message       (-> (message/make-message)
+                              (message/set-expiry 3 :seconds)
+                              (message/set-data (byte-array (.getBytes expected-data "UTF-8")))
+                              (assoc :targets      ["cth://0002_controller/demo-client"]
+                                     :message_type "example/any_schema"))
+            received      (promise)
+            sender        (connect-controller "0001_controller" (constantly true))
+            receiver      (connect-controller "0002_controller"
+                                              (fn [conn msg] (deliver received msg)))]
+        (client/send! sender message)
+        (deref received)
+        (client/close receiver) ;; TODO - refactor client so we can with-open it
+        (client/close sender)
+        (is (= expected-data (String. (message/get-data @received) "UTF-8")))
+        (is (= (:id message) (:id @received)))
+        (is (= (:message_type message) (:message_type @received)))
+        (is (= (:expires message) (:expires @received)))
+        (is (= (:targets message) (:targets @received)))
+        (is (= "cth://0001_controller/demo-client" (:sender @received)))))))


[#1340] Add non-row dataset data to share endpoints

--- backend/src/akvo/lumen/lib/public_impl.clj
+++ backend/src/akvo/lumen/lib/public_impl.clj
@@ -20,32 +20,41 @@
 (defmethod visualisation "pivot table"
   [tenant-conn visualisation config]
   (let [dataset-id (:datasetId visualisation)
+        [dataset-tag dataset] (dataset/fetch tenant-conn dataset-id)
         [tag query-result] (aggregation/query tenant-conn
                                               dataset-id
                                               "pivot"
                                               (:spec visualisation))]
-    (when (= tag ::lib/ok)
-      {"visualisations" {(:id visualisation) (assoc visualisation :data query-result)}})))
+    (when (and (= tag ::lib/ok)
+               (= dataset-tag ::lib/ok))
+      {"visualisations" {(:id visualisation) (assoc visualisation :data query-result)}
+        "datasets" { dataset-id (dissoc dataset :rows)}})))

 (defmethod visualisation "pie"
   [tenant-conn visualisation config]
   (let [dataset-id (:datasetId visualisation)
+        [dataset-tag dataset] (dataset/fetch tenant-conn dataset-id)
         [tag query-result] (aggregation/query tenant-conn
                                               dataset-id
                                               "pie"
                                               (:spec visualisation))]
-    (when (= tag ::lib/ok)
-      {"visualisations" {(:id visualisation) (assoc visualisation :data query-result)}})))
+    (when (and (= tag ::lib/ok)
+               (= dataset-tag ::lib/ok))
+      {"visualisations" {(:id visualisation) (assoc visualisation :data query-result)}
+        "datasets" { dataset-id (dissoc dataset :rows)}})))

 (defmethod visualisation "donut"
   [tenant-conn visualisation config]
   (let [dataset-id (:datasetId visualisation)
+        [dataset-tag dataset] (dataset/fetch tenant-conn dataset-id)
         [tag query-result] (aggregation/query tenant-conn
                                               dataset-id
                                               "pie"
                                               (:spec visualisation))]
-    (when (= tag ::lib/ok)
-      {"visualisations" {(:id visualisation) (assoc visualisation :data query-result)}})))
+    (when (and (= tag ::lib/ok)
+               (= dataset-tag ::lib/ok))
+      {"visualisations" {(:id visualisation) (assoc visualisation :data query-result)}
+        "datasets" { dataset-id (dissoc dataset :rows)}})))

 (defmethod visualisation "map"
   [tenant-conn visualisation {:keys [windshaft-url]}]


DM + MG #20 remove post forms for question details, question list, objective details and candidate list pages

--- src/objective8/responses.clj
+++ src/objective8/responses.clj
@@ -186,7 +186,7 @@
   [:#clj-candidate-list-container :h1] (html/content (:title objective))
   [:h1] (html/after (article-meta objective translation))
   [:#clj-candidate-list] (if (empty? candidates) identity (html/content (map a-candidate candidates)))
-  [:#clj-candidate-list-container] (html/after (post-invitation-container translation signed-in (:_id objective) uri))
+  [:#clj-candidate-list-container] (html/after (when-not (:drafting-started objective) (post-invitation-container translation signed-in (:_id objective) uri)))
   [:#clj-candidate-list-container html/any-node] (html/replace-vars translation))

 ;ANSWERS
@@ -236,7 +236,8 @@
   [:h1] (html/after (article-meta objective translation))
   [:#clj-question-list :h1] (html/content (:title objective))
   [:#clj-question-list :.question-list] (if (empty? questions) identity (html/content (map a-question questions)))
-  [:#clj-question-list] (html/after (post-question-container translation signed-in (:_id objective) uri))
+  [:#clj-question-list] (html/after (when-not (:drafting-started objective)
+                                      (post-question-container translation signed-in (:_id objective) uri)))
   [:#clj-question-list html/any-node] (html/replace-vars translation))

 (html/defsnippet question-view-page
@@ -251,7 +252,7 @@
   [:#clj-question-view :h1] (html/content (:question question))
   [:h1] (html/after (article-meta objective translation))
   [:#clj-question-view :.answer-list] (if (empty? answers) identity (html/content (map an-answer answers)))
-  [:#clj-question-view] (html/after (post-answer-container translation signed-in (:objective-id question) (:_id question) uri))
+  [:#clj-question-view] (html/after (when-not (:drafting-started objective) (post-answer-container translation signed-in (:objective-id question) (:_id question) uri)))
   [:#clj-question-view html/any-node] (html/replace-vars translation))

 ;COMMENTS
@@ -310,7 +311,7 @@
   [:#clj-obj-goals-value] (html/content (map a-goal (:goals objective)))
   [:#clj-obj-background-label] (if (empty? (:description objective)) nil identity)
   [:#clj-obj-background-label] (html/after (text->p-nodes (:description objective)))
-  [:#clj-objectives-detail] (html/after (comments-view translation signed-in (:_id objective) comments uri)))
+  [:#clj-objectives-detail] (html/after (when-not (:drafting-started objective) (comments-view translation signed-in (:_id objective) comments uri))))

 ;USERS


prn -> warn

prn -> warn

--- src/onyx/messaging/aeron.clj
+++ src/onyx/messaging/aeron.clj
@@ -60,7 +60,7 @@

 (def no-op-error-handler
   (proxy [Consumer] []
-    (accept [_] (prn "Conductor is down."))))
+    (accept [_] (taoensso.timbre/warn "Conductor is down."))))

 (def media-driver
   (MediaDriver/launch))


Implement and simplify MuxCodec.

Implement and simplify MuxCodec.

--- src/multicodec/core.clj
+++ src/multicodec/core.clj
@@ -140,11 +140,11 @@
 ;; Logical codec which switches between multiple internal codecs to read data.
 ;; Uses two internal functions to select codecs for reading and writing:
 ;;
-;; `codecs` is a vector of maps with `:header` and `:codec` entries. The header
-;; can be either an exact path string or a pattern.
+;; `codecs` is a map from header paths to codecs. Each codec should return a
+;; path string when looking up `:header`.
 ;;
 ;; `select-encoder` should take the collection of codecs and the value to be
-;; encoded and return the selected implementation to render the value with.
+;; encoded and return the selected codec map to render the value with.
 ;;
 ;; `select-decoder` should take the collection of codecs and the header path
 ;; and return the codec to use.
@@ -155,37 +155,44 @@

   (encode
     [this output value]
-    ; TODO: select encoder, write out header, use codec to write value
-    nil)
+    (if-let [codec (select-encoder codecs value)]
+      (let [hlen (write-header! output (:header codec))
+            clen (encode codec output value)]
+        (+ hlen clen))
+      (throw (IllegalStateException.
+               (str "No encoder selected for value: " (pr-str value))))))

   Decoder

   (decode
     [this input]
-    ; TODO: read header, select decoder, use codec to read value
-    nil))
-
-
-(defn- find-codec
-  [codecs header]
-  (some #(let [codec-key (:header %)]
-           (when (or (= header codec-key)
-                   (and (instance? java.util.regex.Pattern codec-key)
-                        (re-seq codec-key header)))
-             (:codec %)))
-        codecs))
+    (let [header (read-header! input)]
+      (if-let [codec (select-decoder codecs header)]
+        (decode codec input)
+        (throw (IllegalStateException.
+                 (str "No decoder selected for header: "
+                      (pr-str header))))))))

 (defn mux-codec
   "Creates a new multiplexing codec which delegates to the given collection of
-  codecs identified by header paths."
-  [primary-key primary-codec & more]
-  (when-not (even? (count more))
+  codecs by reading and writing multicodec headers when coding.
+
+  Each codec should extend `Decoder` and provide a header path for the key
+  `:header`. The first codec must also extend `Encoder`, as by default it's
+  used for all encoding requests. This logic can be changed by setting a
+  different function for `:select-encoder` after construction."
+  [& codecs]
+  (when-not (seq codecs)
     (throw (IllegalArgumentException.
-             "mux-codec requires an even number of arguments")))
-  (let [codecs (mapv #(hash-map :header (first %), :codec (second %))
-                     (partition 2 (list* primary-key primary-codec more)))]
-    (MuxCodec. codecs
-               (fn first-encoder [cs value] (first cs))
-               find-codec)))
+             "mux-codec requires at least one codec")))
+  (when-not (every? (comp string? :header) codecs)
+    (throw (IllegalArgumentException.
+             (str "Every codec must specify a header path: "
+                  (pr-str (first (filter (comp complement string? :header)
+                                         codecs)))))))
+  (MuxCodec.
+    (into {} (map (juxt :header identity) codecs))
+    (constantly (first codecs))
+    get))


Get unit tests passing again

Get unit tests passing again

This particular version of the problem turned out to be a missing :ret
arg to my external-writer spec. s/conform was failing, but s/explain was
still returning nil.

--- src/com/frereth/common/async_zmq.clj
+++ src/com/frereth/common/async_zmq.clj
@@ -46,13 +46,10 @@
         ;; Since a big chunk of that point is to move the decision
         ;; about the actual wire protocol out to clients.
         :ret any?)
-;; Declaring the spec like this fails with the error "Don't know how to create
-;; ISeq from: cljeromq.common$create_test_reader$reify__38077"
-#_(s/fdef ::external-reader
-        :args :cljeromq.common/testable-read-socket
-        :ret bytes?)
-(s/fdef ::external-writer :args (s/cat :sock :cljeromq.common/testable-write-socket
-                                       :frames :cljeromq.common/byte-array-seq))
+(s/fdef ::external-writer
+        :args (s/cat :sock :cljeromq.common/testable-write-socket
+                     :frames :cljeromq.common/byte-array-seq)
+        :ret any?)
 (s/def ::in-chan :com.frereth.common.async-component/async-channel)

 (s/def ::interface (s/keys :req-un [::ex-sock
@@ -239,12 +236,36 @@
         (when-not (s/valid? :com.frereth.common.zmq-socket/port (:port ex-sock))
           (println "Invalid Port:" (s/explain :com.frereth.common.zmq-socket/port (:port ex-sock))))))

-    (when-not (s/valid? ::interface interface)
+    (when-not #_(s/valid? ::interface interface)
+              ;; valid? is actually a wrapper around this
+              (not= :clojure.spec/invalid (s/conform ::interface interface))
       (println "Problem w/ interface: " (keys interface))
       (pprint interface)
-      (throw (ex-info "Component's interface doesn't match spec"
-                      {:problem (s/explain-data ::interface interface)
-                       :incoming component})))
+      ;; I'm getting into issues here where it looks like s/explain is
+      ;; throwing a second exception.
+      ;; It isn't, but protect against that possibility anyway.
+      ;; Start by setting up a promise I can deliver on the success of explanation
+      (let [explained (promise)]
+        (try
+          (let [problem (s/explain-data ::interface interface)]
+            ;; We got here. The exception being caught is this one,
+            ;; which we just want to forward along directly
+            (deliver explained true)
+            (throw (ex-info "Component's interface doesn't match spec"
+                            {:conformed (s/conform ::interface interface)
+                             :description (s/explain ::interface interface)
+                             :incoming component
+                             :problem problem
+                             :valid? (s/valid? ::interface interface)})))
+          (catch RuntimeException ex
+            (if (realized? explained)
+              ;; Forward along that inner exception
+              (throw ex)
+              ;; Calling s/explain-data failed. This is more serious/confusing
+              (throw (ex-info "Failed trying to explain failure"
+                              {:problem "unknown"
+                               :cause ex
+                               :incoming component})))))))
     (throw (ex-info "Component doesn't match spec"
                     {:problem (s/explain-data ::event-loopless-pair component)
                      :incoming component}))))


ssclj server should log with INFO level each http request

--- ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/middleware/logger.clj
+++ ssclj/jar/src/main/clojure/com/sixsq/slipstream/ssclj/middleware/logger.clj
@@ -48,7 +48,7 @@
   (fn [request]
     (let [start             (System/currentTimeMillis)
           formatted-request (formatted-request request)
-          _                 (log/debug formatted-request)
+          _                 (log/info formatted-request)
           response          (handler request)
-          _                 (log/debug (formatted-response formatted-request response start (System/currentTimeMillis)))]
+          _                 (log/info (formatted-response formatted-request response start (System/currentTimeMillis)))]
       response)))


draw-lattice-to-file now uses layout SVG output

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

--- src/conexp/contrib/draw/lattices.clj
+++ src/conexp/contrib/draw/lattices.clj
@@ -11,6 +11,7 @@
         [conexp.fca.lattices               :only (concept-lattice)]
         [conexp.layouts                    :only (standard-layout)]
         [conexp.layouts.util               :only (scale-layout)]
+        [conexp.io.layouts                 :only (write-layout)]
         [conexp.contrib.draw.scenes        :only (scene-canvas,
                                                   add-scrollbars
                                                   save-image)]
@@ -139,23 +140,13 @@

 ;;;

-(defnk draw-lattice-to-file             ;does not work
-  ""
+(defnk draw-lattice-to-file
+  "Exports layout of given lattice to the given file."
   [lattice file-name
    :layout-fn standard-layout,
    :dimension [600 600]]
-  (do-swing-return ;prevent some nasty AWT deadlocks while experimenting
-    (let [frame (JFrame. ""),
-          panel (make-lattice-editor frame (layout-fn lattice)),
-          scene (get-scene-from-panel panel)]
-      (.setPreferredSize panel (Dimension. 600 600))
-      (.add frame panel)
-      (fit-scene-to-layout scene)
-      (.pack frame)
-      (save-image scene (java.io.File. ^String file-name) "png"))))
-
-(alter-meta! #'draw-lattice-to-file assoc :private true)
-
+  (write-layout :svg (layout-fn lattice) file-name))
+
 ;;;

 nil


Let this be a lesson to you, my son

Let this be a lesson to you, my son

I should have just started with the FFT. It was not as hard to code as I
thought - no harder than the mDCT really. (This is not an optimized FFT,
just the basic butterfly radix-2 algorithm from wikipedia)

It uses a silly amount of CPU for what it's doing, but has no trouble
keeping up. I was confused for awhile about getting twice the framerate
I expected until I realized I was getting 16-bit samples. I wasn't sure
how to go from a byte array to shorts with clojure so I just asked for
8-bit samples. (I did try ByteBuffer to ShortBuffer and boy howdy did
that slow things down ridiculously. I may try manually converting and
see if that's faster - it should be)

--- src/examples/spectrum_analyzer.clj
+++ src/examples/spectrum_analyzer.clj
@@ -18,35 +18,56 @@
          (drop-last octaves)
          (drop 1 octaves))))

+(defn expi
+  "e^(i*x) with kudos to Euler"
+  [x]
+  [(Math/cos x) (Math/sin x)])
+
+(defn +i
+  [[a b] [c d]]
+  [(+ a c) (+ b d)])
+
+(defn -i
+  [[a b] [c d]]
+  [(- a c) (- b d)])
+
+(defn *i
+  [[a b] [c d]]
+  [(- (* a c)
+      (* b d))
+   (- (* a d)
+      (* b c))])
+
+(def twiddle
+  (memoize (fn [k n]
+             (expi (* -2 Math/PI (/ k n))))))
+
 (defn fft
   "Return the FFT of the input block,
   whose length (N) must be a power of two.
   The result is a seq of [a b] representing
   the complex number (a + bi)"
-  [block]) ; TODO
-
-(defn mdct
-  "The modified discrete cosine transform of the two
-  input blocks, which must both be the same size, and
-  generally would be 'lapped', i.e. last half of the block for
-  this operation becomes the first half of the next.
-
-  This is slow (O(N^2)) but easy to code and does basically
-  the same thing as FFT (maybe a little nicer due to the
-  lapping consideration)"
-  [xs]
-  (let [N (/ (count xs) 2)
-        pin (/ Math/PI N)]
-    (map (fn [k]
-           (reduce + (map (fn [n]
-                            (* (nth xs k)
-                               (Math/cos
-                                (* pin
-                                   (+ n
-                                      (/ (+ 1 N) 2))
-                                   (+ k (/ 2))))))
-                          (range (* 2 N)))))
-         (range N))))
+  ([block]
+   (let [n (count block)
+         n2 (/ n 2)]
+     (if (= 1 n)
+       [[(first block) 0]]
+       (let [block1 (fft (take-nth 2 block))
+             block2 (fft (take-nth 2 (rest block)))]
+         (concat (map (fn [k x1 x2]
+                        (+i x1
+                            (*i (twiddle k n)
+                                x2)))
+                      (range n2)
+                      block1
+                      block2)
+                 (map (fn [k x1 x2]
+                        (-i x1
+                            (*i (twiddle k n)
+                                x2)))
+                      (range n2)
+                      block1
+                      block2)))))))

 (defn magnitude
   [spectrum]
@@ -76,13 +97,11 @@
   [coll]
   (map dBFS coll))

-;; a companion to the mdct, length is 2N
 (def mp3-window
-  (let [NN (* 2 N)
-        pi2n (/ Math/PI NN)]
+  (let [pi2n (/ Math/PI N)]
     (map #(Math/sin (* pi2n
                        (+ % (/ 2))))
-         (range NN))))
+         (range N))))

 (defn window-by
   [block window]
@@ -90,9 +109,9 @@

 (defn open-audio
   []
-  (let [af (AudioFormat. 44100 16 1 true false)
+  (let [af (AudioFormat. 44100 8 1 true false)
         tdl (AudioSystem/getTargetDataLine af)]
-    (.open tdl)
+    (.open tdl af)
     (.start tdl)
     tdl))

@@ -105,22 +124,21 @@
 (defn now [] (java.util.Date.))
 (defn wha
   [xs name]
-  (pprint (str (now) ": " name " " (take 3 xs)))
+  (pprint [(now) name (count xs)])
   xs)

 ;;; run
 (defn run []
   (let [tdl (open-audio)]
-    (loop [block1 (read-audio tdl N)]
-      (let [block2 (read-audio tdl N)
-            xs (concat block1 block2)
+    (while true
+      (let [xs (read-audio tdl N)
             spectrum (-> xs
                          (window-by mp3-window)
-                         (mdct) ; N wide
+                         (fft) ; N wide
+                         (magnitude)
                          (normalize)
                          (bin-by-octave) ; 11 wide
                          (->dBFS))
             spectrum (take 8 spectrum)]
         ;;(.update pad (render-spectrum spectrum))
-        (wha spectrum "oof")
-        (recur block2)))))
+        (wha spectrum "loop")))))


Add set-resource-path.

Add set-resource-path.

--- src/fhofherr/clj_db_util/dialect.clj
+++ src/fhofherr/clj_db_util/dialect.clj
@@ -11,6 +11,10 @@
          ::parser h2-dialect/h2-parser
          ::replacements h2-dialect/replacements
          ::gen-key-extractor h2-dialect/get-generated-key})
+
+(defn set-resource-path
+  [dialect resource-path]
+  (assoc dialect ::resource-path resource-path))

 (defn parse
   "Use the `dialect`'s parser to parse the `sql-str`.


Added updated field to granule atom format.

--- src/cmr/search/results_handlers/atom_results_handler.clj
+++ src/cmr/search/results_handlers/atom_results_handler.clj
@@ -12,6 +12,7 @@
   [concept-type result-format]
   ["granule-ur"
    "collection-concept-id"
+   "update-time"
    "entry-title"
    "producer-gran-id"
    "size"
@@ -32,6 +33,7 @@
          revision-id :_version
          {[granule-ur] :granule-ur
           [collection-concept-id] :collection-concept-id
+          [update-time] :update-time
           [entry-title] :entry-title
           [producer-gran-id] :producer-gran-id
           [size] :size
@@ -50,8 +52,7 @@
     {:id concept-id
      :title granule-ur
      :collection-concept-id collection-concept-id
-     ;; TODO: last-updated is not indexed yet
-     ; :updated last-updated
+     :updated update-time
      :dataset-id entry-title
      :producer-gran-id producer-gran-id
      :size (str size)
@@ -119,6 +120,7 @@
     (x/element :entry {}
                (x/element :id {} id)
                (x/element :title {:type "text"} title)
+               (x/element :updated {} updated)
                (x/element :echo:datasetId {} dataset-id)
                (when producer-gran-id (x/element :echo:producerGranuleId {} producer-gran-id))
                (when size (x/element :echo:granuleSizeMB {} size))


[base] Enable sente simple-auto-threading

Long-running socket-message handlers can hold up the sente websocket go loop causing timeouts for all clients.

See: https://github.com/ptaoussanis/sente/issues/265#issuecomment-247524010

--- src/braid/base/server/socket.clj
+++ src/braid/base/server/socket.clj
@@ -12,6 +12,7 @@
                                   {:user-id-fn
                                    (fn [ob] (or (get-in ob [:session :user-id])
                                                (get-in ob [:session :fake-id])))
+                                   :simple-auto-threading? true
                                    :csrf-token-fn nil
                                    :ws-kalive-ms 30000
                                    :packer packer})]


flatten routes

flatten routes

--- src/clj/clj_money/web/server.clj
+++ src/clj/clj_money/web/server.clj
@@ -48,139 +48,131 @@
             [clj-money.web.users :as users]
             [clj-money.web.grants :as grants]))

-(defmacro model-route
-  [method path handler]
-  `(~method ~path req# (-> ~handler
-                           wrap-models
-                           wrap-integer-id-params)))
-
-(defroutes protected-routes
+(defroutes all-routes
   ; Entities
-  (model-route GET "/entities" entities/index)
-  (model-route GET "/entities/new" entities/new-entity)
-  (model-route POST "/entities" entities/create-entity)
-  (model-route GET "/entities/:id/edit" entities/edit-entity)
-  (model-route POST "/entities/:id" entities/update)
-  (model-route POST "/entities/:id/delete" entities/delete)
+  (GET "/entities" req entities/index)
+  (GET "/entities/new" req entities/new-entity)
+  (POST "/entities" req entities/create-entity)
+  (GET "/entities/:id/edit" req entities/edit-entity)
+  (POST "/entities/:id" req entities/update)
+  (POST "/entities/:id/delete" req entities/delete)

   ; User grants
-  (model-route GET "/entities/:entity-id/grants" grants/index)
-  (model-route GET "/entities/:entity-id/grants/new" grants/new-grant)
-  (model-route POST "/entities/:entity-id/grants" grants/create)
-  (model-route GET "/grants/:id/edit" grants/edit)
-  (model-route POST "/grants/:id" grants/update)
-  (model-route POST "/grants/:id/delete" grants/delete)
+  (GET "/entities/:entity-id/grants" req grants/index)
+  (GET "/entities/:entity-id/grants/new" req grants/new-grant)
+  (POST "/entities/:entity-id/grants" req grants/create)
+  (GET "/grants/:id/edit" req grants/edit)
+  (POST "/grants/:id" req grants/update)
+  (POST "/grants/:id/delete" req grants/delete)

   ; Accounts
-  (model-route GET "/entities/:entity-id/accounts" accounts/index)
-  (model-route GET "/entities/:entity-id/accounts/new" accounts/new-account)
-  (model-route POST "/entities/:entity-id/accounts" accounts/create)
-  (model-route GET "/accounts/:id" accounts/show)
-  (model-route GET "/accounts/:id/edit" accounts/edit)
-  (model-route POST "/accounts/:id" accounts/update)
-  (model-route POST "/accounts/:id/delete" accounts/delete)
+  (GET "/entities/:entity-id/accounts" req accounts/index)
+  (GET "/entities/:entity-id/accounts/new" req accounts/new-account)
+  (POST "/entities/:entity-id/accounts" req accounts/create)
+  (GET "/accounts/:id" req accounts/show)
+  (GET "/accounts/:id/edit" req accounts/edit)
+  (POST "/accounts/:id" req accounts/update)
+  (POST "/accounts/:id/delete" req accounts/delete)

   ; Budgets
-  (model-route GET "/entities/:entity-id/budgets" budgets/index)
-  (model-route GET "/entities/:entity-id/budgets/new" budgets/new-budget)
-  (model-route POST "/entities/:entity-id/budgets" budgets/create)
-  (model-route GET "/budgets/:id/edit" budgets/edit)
-  (model-route POST "/budgets/:id" budgets/update)
-  (model-route POST "/budgets/:id/delete" budgets/delete)
-  (model-route GET "/budgets/:id" budgets/show)
+  (GET "/entities/:entity-id/budgets" req budgets/index)
+  (GET "/entities/:entity-id/budgets/new" req budgets/new-budget)
+  (POST "/entities/:entity-id/budgets" req budgets/create)
+  (GET "/budgets/:id/edit" req budgets/edit)
+  (POST "/budgets/:id" req budgets/update)
+  (POST "/budgets/:id/delete" req budgets/delete)
+  (GET "/budgets/:id" req budgets/show)

   ; Budget items
-  (model-route GET "/budgets/:budget-id/items/new/:method" budgets/new-item)
-  (model-route POST "/budgets/:budget-id/items" budgets/create-item)
-  (model-route GET "/budget-items/:id/edit/:method" budgets/edit-item)
-  (model-route POST "/budget-items/:id" budgets/update-item)
-  (model-route POST "/budget-items/:id/delete" budgets/delete-item)
+  (GET "/budgets/:budget-id/items/new/:method" req budgets/new-item)
+  (POST "/budgets/:budget-id/items" req budgets/create-item)
+  (GET "/budget-items/:id/edit/:method" req budgets/edit-item)
+  (POST "/budget-items/:id" req budgets/update-item)
+  (POST "/budget-items/:id/delete" req budgets/delete-item)

   ; Budget monitors
-  (model-route GET "/entities/:entity-id/monitors" entities/monitors)
-  (model-route POST "/entities/:entity-id/monitors" entities/create-monitor)
-  (model-route POST "/entities/:entity-id/monitors/:account-id/delete" entities/delete-monitor)
+  (GET "/entities/:entity-id/monitors" req entities/monitors)
+  (POST "/entities/:entity-id/monitors" req entities/create-monitor)
+  (POST "/entities/:entity-id/monitors/:account-id/delete" req entities/delete-monitor)

   ; Commodities
-  (model-route GET "/entities/:entity-id/commodities" commodities/index)
-  (model-route GET "/entities/:entity-id/commodities/new" commodities/new-commodity)
-  (model-route POST "/entities/:entity-id/commodities" commodities/create)
-  (model-route GET "/commodities/:id/edit" commodities/edit)
-  (model-route POST "/commodities/:id" commodities/update)
-  (model-route POST "/commodities/:id/delete" commodities/delete)
+  (GET "/entities/:entity-id/commodities" req commodities/index)
+  (GET "/entities/:entity-id/commodities/new" req commodities/new-commodity)
+  (POST "/entities/:entity-id/commodities" req commodities/create)
+  (GET "/commodities/:id/edit" req commodities/edit)
+  (POST "/commodities/:id" req commodities/update)
+  (POST "/commodities/:id/delete" req commodities/delete)

   ; Prices
-  (model-route GET "/commodities/:commodity-id/prices" prices/index)
-  (model-route GET "/commodities/:commodity-id/prices/new" prices/new-price)
-  (model-route POST "/commodities/:commodity-id/prices" prices/create)
-  (model-route POST "/commodities/:commodity-id/prices/fetch" prices/fetch)
-  (model-route POST "/entities/:entity-id/prices/fetch" prices/fetch-all)
-  (model-route POST "/prices/:id/delete" prices/delete)
+  (GET "/commodities/:commodity-id/prices" req prices/index)
+  (GET "/commodities/:commodity-id/prices/new" req prices/new-price)
+  (POST "/commodities/:commodity-id/prices" req prices/create)
+  (POST "/commodities/:commodity-id/prices/fetch" req prices/fetch)
+  (POST "/entities/:entity-id/prices/fetch" req prices/fetch-all)
+  (POST "/prices/:id/delete" req prices/delete)

   ; Transactions
-  (model-route GET "/entities/:entity-id/transactions" transactions/index)
-  (model-route GET "/entities/:entity-id/transactions/new" transactions/new-transaction)
-  (model-route POST "/entities/:entity-id/transactions" transactions/create)
-  (model-route GET "/transactions/:transaction-date/:id/edit" transactions/edit)
-  (model-route POST "/transactions/:transaction-date/:id" transactions/update)
-  (model-route POST "/transactions/:transaction-date/:id/delete" transactions/delete)
+  (GET "/entities/:entity-id/transactions" req transactions/index)
+  (GET "/entities/:entity-id/transactions/new" req transactions/new-transaction)
+  (POST "/entities/:entity-id/transactions" req transactions/create)
+  (GET "/transactions/:transaction-date/:id/edit" req transactions/edit)
+  (POST "/transactions/:transaction-date/:id" req transactions/update)
+  (POST "/transactions/:transaction-date/:id/delete" req transactions/delete)

   ; Attachments
-  (model-route GET "/transactions/:transaction-id/attachments" attachments/index)
-  (model-route GET "/transactions/:transaction-id/attachments" attachments/index)
-  (model-route GET "/transactions/:transaction-id/attachments/new" attachments/new-attachment)
-  (model-route POST "/transactions/:transaction-id/attachments" attachments/create)
-  (model-route GET "/attachments/:id/edit" attachments/edit)
-  (model-route POST "/attachments/:id" attachments/update)
-  (model-route POST "/attachments/:id/delete" attachments/delete)
+  (GET "/transactions/:transaction-id/attachments" req attachments/index)
+  (GET "/transactions/:transaction-id/attachments" req attachments/index)
+  (GET "/transactions/:transaction-id/attachments/new" req attachments/new-attachment)
+  (POST "/transactions/:transaction-id/attachments" req attachments/create)
+  (GET "/attachments/:id/edit" req attachments/edit)
+  (POST "/attachments/:id" req attachments/update)
+  (POST "/attachments/:id/delete" req attachments/delete)

   ; Images
-  (model-route GET "/images/:image-id" images/show)
+  (GET "/images/:image-id" req images/show)

   ; Trading
-  (model-route GET "/accounts/:account-id/purchases/new" trading/new-purchase)
-  (model-route POST "/accounts/:account-id/purchases" trading/purchase)
-  (model-route GET "/accounts/:account-id/sales/new" trading/new-sale)
-  (model-route POST "/accounts/:account-id/sales" trading/sell)
-  (model-route POST "/transactions/:transaction-id/unbuy" trading/unbuy)
+  (GET "/accounts/:account-id/purchases/new" req trading/new-purchase)
+  (POST "/accounts/:account-id/purchases" req trading/purchase)
+  (GET "/accounts/:account-id/sales/new" req trading/new-sale)
+  (POST "/accounts/:account-id/sales" req trading/sell)
+  (POST "/transactions/:transaction-id/unbuy" req trading/unbuy)

   ; Lots
-  (model-route GET "/accounts/:account-id/lots" lots/index)
+  (GET "/accounts/:account-id/lots" req lots/index)

   ; Reconciliations
-  (model-route GET "/accounts/:account-id/reconciliations/new" reconciliations/new-reconciliation)
-  (model-route POST "/accounts/:account-id/reconciliations" reconciliations/create)
-  (model-route GET "/reconciliations/:id" reconciliations/show)
-  (model-route GET "/reconciliations/:id/edit" reconciliations/edit)
-  (model-route POST "/reconciliations/:id" reconciliations/update)
-  (model-route POST "/reconciliations/:id/delete" reconciliations/delete)
+  (GET "/accounts/:account-id/reconciliations/new" req reconciliations/new-reconciliation)
+  (POST "/accounts/:account-id/reconciliations" req reconciliations/create)
+  (GET "/reconciliations/:id" req reconciliations/show)
+  (GET "/reconciliations/:id/edit" req reconciliations/edit)
+  (POST "/reconciliations/:id" req reconciliations/update)
+  (POST "/reconciliations/:id/delete" req reconciliations/delete)

   ; Imports
-  (model-route GET "/imports/new" imports/new-import)
+  (GET "/imports/new" req imports/new-import)

   ; Reports
-  (model-route GET "/entities/:entity-id/reports" reports/render)
-  (model-route GET "/entities/:entity-id/reports/:type" reports/render)
+  (GET "/entities/:entity-id/reports" req reports/render)
+  (GET "/entities/:entity-id/reports/:type" req reports/render)

   ; Single page apps
-  (model-route GET "/apps" apps/index)
-  (model-route GET "/apps/:id" apps/show))
-
-(defroutes api-routes
-  (model-route GET "/api/entities" entities-api/index)
-  (model-route DELETE "/api/entities/:id" entities-api/delete)
+  (GET "/apps" req apps/index)
+  (GET "/apps/:id" req apps/show)
+
+  (GET "/api/entities" req entities-api/index)
+  (DELETE "/api/entities/:id" req entities-api/delete)

   ; Imports
-  (model-route POST "/api/imports" imports-api/create)
-  (model-route GET "/api/imports/:id" imports-api/show))
-
-(defroutes open-routes
-  (model-route GET "/" pages/home)
-  (model-route GET "/login" pages/login)
-  (model-route GET "/signup" users/new-user)
-  (model-route POST "/users" users/create-user)
-  (model-route GET "/users/:token/password" users/new-password)
-  (model-route POST "/users/:token/password" users/set-password))
+  (POST "/api/imports" req imports-api/create)
+  (GET "/api/imports/:id" req imports-api/show)
+
+  (GET "/" req pages/home)
+  (GET "/login" req pages/login)
+  (GET "/signup" req users/new-user)
+  (POST "/users" req users/create-user)
+  (GET "/users/:token/password" req users/new-password)
+  (POST "/users/:token/password" req users/set-password))

 (def ^:private accept-map
   {"application/json" :json})
@@ -238,13 +230,16 @@
                     (conj wrapper (constantly true))
                     wrapper)]
     (fn [{:keys [request-method uri] :as request}]
-      (if (test-fn request)
-        (do
-          (log/debug "apply middleware " description " to " request-method " " route)
-          ((wrapper-fn handler) request))
-        (do
-          (log/debug "ignore middleware " description " for " request-method " " route)
-          (handler request))))))
+      (when (test-fn request)
+        (pprint {(str "enter " description " " request-method " " uri) (select-keys request [:cookies :session :headers])}))
+      (let [apply? (test-fn request)
+            working-handler (if apply?
+                              (wrapper-fn handler)
+                              handler)
+            response (working-handler request)]
+        (when apply?
+          (pprint {(str "exit " description " " request-method " " uri) (select-keys response [:cookies :session :headers])}))
+        response))))

 (defn-  wrap-routes
   [handler & wrappers]
@@ -253,9 +248,9 @@
           wrappers))

 (def wrapped-routes
-  (wrap-routes (routes open-routes
-                       api-routes
-                       protected-routes)
+  (wrap-routes all-routes
+               [wrap-models                         "models"]
+               [wrap-integer-id-params              "multipart params"]
                [wrap-multipart-params               "multipart params" (complement api?)]
                [wrap-keyword-params                 "keyword params"   (complement api?)]
                [wrap-json-params                    "json params"      api?]


Added support for parsing XML bodies.

Added support for parsing XML bodies.

--- src/clj/cmr/client/http/impl.clj
+++ src/clj/cmr/client/http/impl.clj
@@ -2,6 +2,7 @@
   (:require
    [clj-http.client :as http]
    [clojure.data.json :as json]
+   [clojure.data.xml :as xml]
    [clojure.string :as string])
   (:refer-clojure :exclude [get]))

@@ -37,16 +38,22 @@
   (let [content-type (get-in response [:headers "Content-Type"])]
     (cond
       (string/includes? content-type "json") :json
+      (string/includes? content-type "xml") :xml
       :else :unsupported)))

 (defn read-json-str
   [string-data]
   (json/read-str string-data :key-fn keyword))

+(defn read-xml-str
+  [string-data]
+  (xml/parse-str string-data))
+
 (defn convert-body
   [response content-type]
   (case content-type
      :json (read-json-str (:body response))
+     :xml (read-xml-str (:body response))
      :unsupported (:body response)))

 (defn parse-body!


formatting

formatting

--- src/cljs/dbquery/data_table.cljs
+++ src/cljs/dbquery/data_table.cljs
@@ -48,11 +48,15 @@
             (->> @order
                  (map #(if (neg? %) (str (- %) " desc") %))
                  (s/join ",")
-                 (str " order by ")))]
-
-      (str "SELECT " (s/join "," cols) " FROM " (first tables)
-           " " (map #(if (vector? %) (str "," (s/join " " %))
-                         (str (:join %) " JOIN " ))(rest tables))))))
+                 (str " order by ")))
+          to-str (fn[prefix? t]
+                      (cond
+                        (string? t) (str (if prefix? ",") t)
+                        (map? t) (let[{:keys[join to on] t}]
+                                   (str join " JOIN " to " on " on))))]
+
+      (str "SELECT " (s/join "," cols) " FROM " (-> tables first to-str)
+           " " (->> tables rest (map to-str) (s/join " ") )))))

 (deftype QueryController [ds query data error]
   Object


Set the focus on the word input field

Set the focus on the word input field

--- src/cljs/hyphen_keeper/core.cljs
+++ src/cljs/hyphen_keeper/core.cljs
@@ -103,6 +103,7 @@
     {:id "wordInput"
      :type "text"
      :placeholder "Word"
+     :auto-focus true
      :value @word
      :on-change (fn [e]
                   (reset! word (-> e .-target .-value string/lower-case))


Add with-value helper function to channel monad ns.

--- src/cljx/cats/monad/channel.cljx
+++ src/cljx/cats/monad/channel.cljx
@@ -92,3 +92,12 @@
   proto/Context
   (get-context [_] channel-monad)
   (get-value [self] self))
+
+(defn with-value
+  "Simple helper that creates a channel and attach
+  an value to it."
+  ([value] (with-value value (chan)))
+  ([value ch]
+   (put! ch value)
+   ch))
+


Check the type of dstream before doing reduceByKey.

If it's already of type JavaPairDStream, there's no need to map
identity PairFunction over it. Doing so causes untuple in the next step
to not work correctly

--- src/clojure/flambo/streaming.clj
+++ src/clojure/flambo/streaming.clj
@@ -53,10 +53,17 @@
   (.map dstream (function f)))

 (defn reduce-by-key [dstream f]
-  (-> dstream
+  "Call reduceByKey on dstream of type JavaDStream or JavaPairDStream"
+  (if (instance? org.apache.spark.streaming.api.java.JavaDStream dstream)
+    ;; JavaDStream doesn't have a .reduceByKey so cast to JavaPairDStream first
+    (-> dstream
       (.mapToPair (pair-function identity))
       (.reduceByKey (function2 f))
-      (.map (function f/untuple))))
+      (.map (function f/untuple)))
+    ;; if it's already JavaPairDStream, we're good
+    (-> dstream
+        (.reduceByKey (function2 f))
+        (.map (function f/untuple)))))

 (defn map-to-pair [dstream f]
   (.mapToPair dstream (pair-function f)))


use short classnames

use short classnames

--- src/clojure/flambo/streaming.clj
+++ src/clojure/flambo/streaming.clj
@@ -12,7 +12,7 @@
                                      function2
                                      pair-function
                                      void-function]])
-  (:import [org.apache.spark.streaming.api.java JavaStreamingContext]
+  (:import [org.apache.spark.streaming.api.java JavaStreamingContext JavaDStream]
            [org.apache.spark.streaming.kafka KafkaUtils]
            [org.apache.spark.streaming Duration Time]))

@@ -22,7 +22,7 @@
 (defn time [ms]
   (Time. ms))

-(defn streaming-context
+(defn streaming-context
   "conf can be a SparkConf or JavaSparkContext"
   [conf batch-duration]
   (JavaStreamingContext. conf (duration batch-duration)))
@@ -34,8 +34,8 @@
     (streaming-context conf duration)))

 (defmulti checkpoint (fn [context arg] (class arg)))
-(defmethod checkpoint java.lang.String [streaming-context path] (.checkpoint streaming-context path))
-(defmethod checkpoint java.lang.Long [dstream interval] (.checkpoint dstream (duration interval)))
+(defmethod checkpoint String [streaming-context path] (.checkpoint streaming-context path))
+(defmethod checkpoint Long [dstream interval] (.checkpoint dstream (duration interval)))

 (defn text-file-stream [context file-path]
   (.textFileStream context file-path))
@@ -54,7 +54,7 @@

 (defn reduce-by-key [dstream f]
   "Call reduceByKey on dstream of type JavaDStream or JavaPairDStream"
-  (if (instance? org.apache.spark.streaming.api.java.JavaDStream dstream)
+  (if (instance? JavaDStream dstream)
     ;; JavaDStream doesn't have a .reduceByKey so cast to JavaPairDStream first
     (-> dstream
       (.mapToPair (pair-function identity))


Make GTM use just 2 tapes, with only 1 position

--- src/clojush/instructions/gtm.clj
+++ src/clojush/instructions/gtm.clj
@@ -2,30 +2,33 @@
   (:use [clojush pushstate globals random util])
   (:require [clojure.math.numeric-tower :as math]))

-;; All tapes except 0 are read-only.
-
-;; The head on tape 0 auto-advances to the right after writing.
-
-;; All GTM instructions are no-ops on Push states that lack a GTM.
-
-;; Instructions that read from a tape are no-ops if the head is over a blank.
-
-;; Instructions that write to a tape create an instruction-map (gene) under
-;; the head if none existed previously, with default instruction exec_noop,
-;; silent false, and close 0.
+;; Only read/write to one tape.
+
+;; Single head position.
+
+;; Secondary tape accessed only via gene/component swaps at current location.
+
+;; Read/write by component or all components together.
+
+;; Read (but not swap) no-ops over blanks, write creates an instruction-map
+;; (gene) under the head if none existed previously, with default instruction
+;; exec_noop, silent false, and close 0.
+
+;; All GTM instructions are no-ops on Push states that lack a GTM.
+

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; gtm (genetic turing machine) utilities

 (defn init-gtm
-  "Returns the provided Push state, but with a fresh GTM that has been initialized with
-  the given number of empty tapes."
-  [push-state num-tapes]
+  "Returns the provided Push state, but with a fresh GTM that has been initialized."
+  [push-state]
   (assoc push-state
     :gtm
-    {:active 0
-     :tapes (vec (repeat num-tapes {:position 0 :contents (sorted-map)}))
-     :trace []}))
+    {:position 0
+     :tapes (vec (repeat 2 (sorted-map)))
+     :trace []
+     :offset 0}))

 (defn ensure-instruction-map
   "If instr-map is a hash map, returns it unchanged; otherwise returns a default
@@ -45,7 +48,7 @@
   to contain the provided genome."
   [push-state tape-index genome]
   (assoc-in push-state
-            [:gtm :tapes tape-index :contents]
+            [:gtm :tapes tape-index]
             (into (sorted-map)
                   (zipmap (iterate inc 0)
                           (map ensure-instruction-map genome)))))
@@ -53,7 +56,7 @@
 (defn dump-tape
   "Returns the genome recorded on the specified tape in the GTM of the provided Push state."
   [push-state tape-index]
-  (vec (vals (:contents (get (:tapes (:gtm push-state)) tape-index)))))
+  (vec (vals (get (:tapes (:gtm push-state)) tape-index))))

 (defn trace
   "Returns push-state with trace-info added to the trace recorded in its GTM."
@@ -65,227 +68,268 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; gtm (genetic turing machine) instructions

-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Instructions for moving GTM control from tape to tape. There is always an "active"
-;; tape, to which some instructions refer implicitly.
-
-(define-registered ;; set active to tape0
-  gtm_tape0
-  ^{:stack-types [:gtm]}
-  (fn [state]
-    (if (:gtm state)
-      (trace 'gtm_tape0
-             (-> state
-                 (assoc-in [:gtm :active] 0)))
-      state)))
-
-(define-registered ;; set active to tape1
-  gtm_tape1
-  ^{:stack-types [:gtm]}
-  (fn [state]
-    (if (:gtm state)
-      (trace 'gtm_tape1
-             (-> state
-                 (assoc-in [:gtm :active] 1)))
-      state)))
-
-(define-registered ;; set active to tape2
-  gtm_tape2
-  ^{:stack-types [:gtm]}
-  (fn [state]
-    (if (:gtm state)
-      (trace 'gtm_tape2
-             (-> state
-                 (assoc-in [:gtm :active] 2)))
-      state)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Instructions for moving the read/write head on the primary tape.
-
-(define-registered ;; move head on active tape to the left
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Instructions for moving the read/write head.
+
+(define-registered ;; move head to the left
   gtm_left
   ^{:stack-types [:gtm]}
   (fn [state]
     (if (:gtm state)
       (trace 'gtm_left
-             (update-in state [:gtm :tapes (:active (:gtm state)) :position] dec))
-      state)))
-
-(define-registered ;; move head on active tape to the right
+             (update-in state [:gtm :position] dec))
+      state)))
+
+(define-registered ;; move head to the right
   gtm_right
   ^{:stack-types [:gtm]}
   (fn [state]
     (if (:gtm state)
       (trace 'gtm_right
-             (update-in state [:gtm :tapes (:active (:gtm state)) :position] inc))
-      state)))
-
+             (update-in state [:gtm :position] inc))
+      state)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Instructions for moving the offset.
+
+(define-registered ;; move offset to the left
+  gtm_offset_left
+  ^{:stack-types [:gtm]}
+  (fn [state]
+    (if (:gtm state)
+      (trace 'gtm_offset_left
+             (update-in state [:gtm :offset] dec))
+      state)))
+
+(define-registered ;; move offset to the right
+  gtm_offset_right
+  ^{:stack-types [:gtm]}
+  (fn [state]
+    (if (:gtm state)
+      (trace 'gtm_offset_right
+             (update-in state [:gtm :offset] inc))
+      state)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Instructions for swapping genes between tapes.
+
+(define-registered ;; swap genes at current position between tapes 0 and 1
+  gtm_swap_all
+  ^{:stack-types [:gtm]}
+  (fn [state]
+    (if (:gtm state)
+      (trace 'gtm_swap_all
+             (let [pos (:position (:gtm state))
+                   offset (:offset (:gtm state))]
+               (-> state
+                   (assoc-in [:gtm :tapes 0 pos]
+                             (get-in state [:gtm :tapes 1 (+ pos offset)]))
+                   (assoc-in [:gtm :tapes 1 (+ pos offset)]
+                             (get-in state [:gtm :tapes 0 pos])))))
+      state)))
+
+(define-registered ;; swap instructions at current position between tapes 0 and 1
+  gtm_swap_instruction
+  ^{:stack-types [:gtm]}
+  (fn [state]
+    (if (:gtm state)
+      (trace 'gtm_swap_instruction
+             (let [pos (:position (:gtm state))
+                   offset (:offset (:gtm state))]
+               (-> state
+                   (assoc-in [:gtm :tapes 0 pos :instruction]
+                             (get-in state [:gtm :tapes 1 (+ pos offset) :instruction]))
+                   (assoc-in [:gtm :tapes 1 (+ pos offset) :instruction]
+                             (get-in state [:gtm :tapes 0 pos :instruction])))))
+      state)))
+
+(define-registered ;; swap silent markers at current position between tapes 0 and 1
+  gtm_swap_silent
+  ^{:stack-types [:gtm]}
+  (fn [state]
+    (if (:gtm state)
+      (trace 'gtm_swap_silent
+             (let [pos (:position (:gtm state))
+                   offset (:offset (:gtm state))]
+               (-> state
+                   (assoc-in [:gtm :tapes 0 pos :silent]
+                             (get-in state [:gtm :tapes 1 (+ pos offset) :silent]))
+                   (assoc-in [:gtm :tapes 1 (+ pos offset) :silent]
+                             (get-in state [:gtm :tapes 0 pos :silent])))))
+      state)))
+
+(define-registered ;; swap close markers at current position between tapes 0 and 1
+  gtm_swap_close
+  ^{:stack-types [:gtm]}
+  (fn [state]
+    (if (:gtm state)
+      (trace 'gtm_swap_close
+             (let [pos (:position (:gtm state))
+                   offset (:offset (:gtm state))]
+               (-> state
+                   (assoc-in [:gtm :tapes 0 pos :close]
+                             (get-in state [:gtm :tapes 1 (+ pos offset) :close]))
+                   (assoc-in [:gtm :tapes 1 (+ pos offset) :close]
+                             (get-in state [:gtm :tapes 0 pos :close])))))
+      state)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Instructions for reading/writing to tapes.

-(define-registered ;; copy from active to tape 0
-  gtm_copy
-  ^{:stack-types [:gtm]}
-  (fn [state]
-    (if (and (:gtm state)
-             (not (zero? (:active (:gtm state)))))
-      (let [destination-tape (get (:tapes (:gtm state)) 0)
-            destination-position (:position destination-tape)
-            source (:active (:gtm state))
-            source-tape (get (:tapes (:gtm state)) source)
-            source-position (:position source-tape)
-            source-instr-map (get (:contents source-tape) source-position)]
-        (if source-instr-map
-          (trace 'gtm_copy
-                 (-> state
-                     (assoc-in [:gtm :tapes 0 :contents destination-position]
-                               source-instr-map)
-                     (update-in [:gtm :tapes 0 :position] inc)
-                     (update-in [:gtm :tapes source :position] inc)))
-          state))
-      state)))
-
-(define-registered ;; push boolean indicating whether active tape is blank at current position
+(define-registered ;; push boolean indicating whether tape is blank at current position
   gtm_blank
   ^{:stack-types [:gtm :boolean]}
   (fn [state]
     (if (:gtm state)
-      (let [active (:active (:gtm state))
-            active-tape (get (:tapes (:gtm state)) active)]
-        (trace 'gtm_blank
-               (update-in
-                 (push-item (if (get (:contents active-tape) (:position active-tape))
-                              false
-                              true)
-                            :boolean
-                            state)
-                 [:gtm :tapes active :position]
-                 inc)))
-      state)))
-
-(define-registered ;; make tape 0 blank at current position
+      (trace 'gtm_blank
+             (let [pos (:position (:gtm state))]
+               (push-item (if (get-in state [:gtm :tapes 0 pos])
+                            false
+                            true)
+                          :boolean
+                          state)))
+      state)))
+
+(define-registered ;; make blank at current position
   gtm_erase
   ^{:stack-types [:gtm]}
   (fn [state]
+    (if (:gtm state)
+      (trace 'gtm_erase
+             (let [pos (:position (:gtm state))]
+               (assoc-in state
+                         [:gtm :tapes 0]
+                         (dissoc (get-in state [:gtm :tapes 0]) pos))))
+      state)))
+
+(define-registered ;; push all components to stacks
+  gtm_read_all
+  ^{:stack-types [:gtm :code :boolean :integer]}
+  (fn [state]
+    (if (:gtm state)
+      (let [pos (:position (:gtm state))
+            instr-map (get-in state [:gtm :tapes 0 pos])]
+        (if instr-map
+          (trace 'gtm_read_all
+                 (push-item (:instruction instr-map) :code state)
+                 (push-item (:silent instr-map) :boolean state)
+                 (push-item (:close instr-map) :integer state))
+          state))
+      state)))
+
+(define-registered ;; set all components from stacks
+  gtm_write_all
+  ^{:stack-types [:gtm :code :boolean :integer]}
+  (fn [state]
     (if (and (:gtm state)
-             (not (zero? (:active (:gtm state)))))
-      (let [write-tape (get (:tapes (:gtm state)) 0)
-            write-position (:position write-tape)]
-        (trace 'gtm_erase
-               (-> state
-                   (assoc-in [:gtm :tapes 0 :contents]
-                             (dissoc (:contents write-tape) write-position))
-                   (update-in [:gtm :tapes 0 :position] inc))))
-      state)))
-
-(define-registered ;; push active tape's instruction to code stack
-  gtm_instruction
+             (not (empty? (:code state)))
+             (not (empty? (ensure-list (stack-ref :code 0 state))))
+             (not (empty? (:boolean state)))
+             (not (empty? (:integer state))))
+      (let [pos (:position (:gtm state))
+            write-instr-map (ensure-instruction-map
+                              (get-in state [:gtm :tapes 0 pos]))
+            new-instr (first (flatten (ensure-list (stack-ref :code 0 state))))
+            new-silent (stack-ref :boolean 0 state)
+            new-close (math/abs (stack-ref :integer 0 state))]
+        (trace 'gtm_write_all
+               (-> (pop-item :code state)
+                   (pop-item :boolean state)
+                   (pop-item :integer state)
+                   (assoc-in [:gtm :tapes 0 pos]
+                             (-> write-instr-map
+                                 (assoc :instruction new-instr)
+                                 (assoc :silent new-silent)
+                                 (assoc :close new-close))))))
+      state)))
+
+(define-registered ;; push instruction to code stack
+  gtm_read_instruction
   ^{:stack-types [:gtm :code]}
   (fn [state]
     (if (:gtm state)
-      (let [active (:active (:gtm state))
-            active-tape (get (:tapes (:gtm state)) active)
-            instr-map (get (:contents active-tape) (:position active-tape))]
+      (let [pos (:position (:gtm state))
+            instr-map (get-in state [:gtm :tapes 0 pos])]
         (if instr-map
-          (trace 'gtm_instruction
-                 (update-in
-                   (push-item (:instruction instr-map) :code state)
-                   [:gtm :tapes active :position]
-                   inc))
+          (trace 'gtm_read_instruction
+                 (push-item (:instruction instr-map) :code state))
           state))
       state)))

 (define-registered ;; set instruction to first of flattened top of code stack
-  gtm_set_instruction
+  gtm_write_instruction
   ^{:stack-types [:gtm :code]}
   (fn [state]
     (if (and (:gtm state)
              (not (empty? (:code state)))
              (not (empty? (ensure-list (stack-ref :code 0 state)))))
-      (let [write-tape (get (:tapes (:gtm state)) 0)
-            write-position (:position write-tape)
-            write-contents (:contents write-tape)
+      (let [pos (:position (:gtm state))
             write-instr-map (ensure-instruction-map
-                              (get write-contents write-position))
+                              (get-in state [:gtm :tapes 0 pos]))
             new-instr (first (flatten (ensure-list (stack-ref :code 0 state))))]
-        (trace 'gtm_set_instruction
+        (trace 'gtm_write_instruction
                (-> (pop-item :code state)
-                   (assoc-in [:gtm :tapes 0 :contents write-position]
-                             (assoc write-instr-map :instruction new-instr))
-                   (update-in [:gtm :tapes 0 :position] inc))))
-      state)))
-
-(define-registered ;; push active tape's silent marker to boolean stack
-  gtm_silent
+                   (assoc-in [:gtm :tapes 0 pos]
+                             (assoc write-instr-map :instruction new-instr)))))
+      state)))
+
+(define-registered ;; push silent marker to boolean stack
+  gtm_read_silent
   ^{:stack-types [:gtm :boolean]}
   (fn [state]
     (if (:gtm state)
-      (let [active (:active (:gtm state))
-            active-tape (get (:tapes (:gtm state)) active)
-            instr-map (get (:contents active-tape) (:position active-tape))]
+      (let [pos (:position (:gtm state))
+            instr-map (get-in state [:gtm :tapes 0 pos])]
         (if instr-map
-          (trace 'gtm_silent
-                 (update-in
-                   (push-item (:silent instr-map) :boolean state)
-                   [:gtm :tapes active :position]
-                   inc))
+          (trace 'gtm_read_silent
+                 (push-item (:silent instr-map) :boolean state))
           state))
       state)))

-(define-registered ;; set silent to top of boolean stack
-  gtm_set_silent
+(define-registered ;; set silent marker to top of boolean stack
+  gtm_write_silent
   ^{:stack-types [:gtm :boolean]}
   (fn [state]
     (if (and (:gtm state)
              (not (empty? (:boolean state))))
-      (let [write-tape (get (:tapes (:gtm state)) 0)
-            write-position (:position write-tape)
-            write-contents (:contents write-tape)
+      (let [pos (:position (:gtm state))
             write-instr-map (ensure-instruction-map
-                              (get write-contents write-position))
+                              (get-in state [:gtm :tapes 0 pos]))
             new-silent (stack-ref :boolean 0 state)]
-        (trace 'gtm_set_silent
+        (trace 'gtm_write_silent
                (-> (pop-item :boolean state)
-                   (assoc-in [:gtm :tapes 0 :contents write-position]
-                             (assoc write-instr-map :silent new-silent))
-                   (update-in [:gtm :tapes 0 :position] inc))))
-      state)))
-
-(define-registered ;; push active tape's close marker to integer stack
-  gtm_close
+                   (assoc-in [:gtm :tapes 0 pos]
+                             (assoc write-instr-map :silent new-silent)))))
+      state)))
+
+(define-registered ;; push close marker to integer stack
+  gtm_read_close
   ^{:stack-types [:gtm :integer]}
   (fn [state]
     (if (:gtm state)
-      (let [active (:active (:gtm state))
-            active-tape (get (:tapes (:gtm state)) active)
-            instr-map (get (:contents active-tape) (:position active-tape))]
+      (let [pos (:position (:gtm state))
+            instr-map (get-in state [:gtm :tapes 0 pos])]
         (if instr-map
-          (trace 'gtm_close
-                 (update-in
-                   (push-item (:close instr-map) :integer state)
-                   [:gtm :tapes active :position]
-                   inc))
+          (trace 'gtm_read_close
+                 (push-item (:close instr-map) :integer state))
           state))
       state)))

-(define-registered ;; set close to abs value of top of integer stack
-  gtm_set_close
+(define-registered ;; set close marker to abs value of top of integer stack
+  gtm_write_close
   ^{:stack-types [:gtm :integer]}
   (fn [state]
     (if (and (:gtm state)
              (not (empty? (:integer state))))
-      (let [write-tape (get (:tapes (:gtm state)) 0)
-            write-position (:position write-tape)
-            write-contents (:contents write-tape)
+      (let [pos (:position (:gtm state))
             write-instr-map (ensure-instruction-map
-                              (get write-contents write-position))
+                              (get-in state [:gtm :tapes 0 pos]))
             new-close (math/abs (stack-ref :integer 0 state))]
-        (trace 'gtm_set_close
+        (trace 'gtm_write_close
                (-> (pop-item :integer state)
-                   (assoc-in [:gtm :tapes 0 :contents write-position]
-                             (assoc write-instr-map :close new-close))
-                   (update-in [:gtm :tapes 0 :position] inc))))
+                   (assoc-in [:gtm :tapes 0 pos]
+                             (assoc write-instr-map :close new-close)))))
       state)))

 ;; some tests
@@ -374,4 +418,3 @@
                  (run-pgm)
                  (dump-tape 0))))

-


bump versions

bump versions

--- build.boot
+++ build.boot
@@ -1,11 +1,11 @@
 (set-env!
  :source-paths    #{"src" "test" "styles"}
  :resource-paths  #{"html" "build"}
- :dependencies    '[[adzerk/boot-cljs          "1.7.48-5-SNAPSHOT"]
-                    [adzerk/boot-reload        "0.3.2"]
-                    [deraen/boot-less          "0.4.0"]
-                    [org.clojure/clojurescript "1.7.48"]
-                    [pandeiro/boot-http        "0.6.3"]])
+ :dependencies    '[[adzerk/boot-cljs          "1.7.48-6"]
+                    [adzerk/boot-reload        "0.4.1"]
+                    [deraen/boot-less          "0.4.2"]
+                    [org.clojure/clojurescript "1.7.145"]
+                    [pandeiro/boot-http        "0.7.0"]])

 (require
  '[adzerk.boot-cljs   :refer [cljs]]


Update deps

Update deps

--- build.boot
+++ build.boot
@@ -7,9 +7,12 @@
                   [org.clojure/clojurescript "1.7.170"]

                   [boot/core              "2.3.0"      :scope "test"]
-                  [adzerk/boot-cljs       "1.7.170-1"  :scope "test"]
-                  [adzerk/boot-cljs-repl  "0.2.0"      :scope "test"]
-                  [adzerk/boot-reload     "0.4.0"      :scope "test"]
+                  [adzerk/boot-cljs       "1.7.170-2"  :scope "test"]
+                  [adzerk/boot-cljs-repl  "0.2.1"      :scope "test"]
+                  [com.cemerick/piggieback "0.2.1"     :scope "test"]
+                  [weasel                 "0.7.0"      :scope "test"]
+                  [org.clojure/tools.nrepl "0.2.12"    :scope "test"]
+                  [adzerk/boot-reload     "0.4.2"      :scope "test"]
                   [adzerk/boot-test       "1.0.4"      :scope "test"]
                   [deraen/boot-less       "0.4.2"      :scope "test"]
                   [deraen/boot-sass       "0.1.1"      :scope "test"]
@@ -74,7 +77,7 @@
     (reload :open-file "vim --servername saapas --remote-silent +norm%sG%s| %s"
             :ids #{"js/main"})
     ; This starts a repl server with piggieback middleware
-    (cljs-repl :ids #{"main"})
+    (cljs-repl :ids #{"js/main"})
     (cljs :ids #{"js/main"})
     (start-app :port port)
     (if speak (boot.task.built-in/speak) identity)))


Back to cider 0.9.1

Back to cider 0.9.1

--- build.boot
+++ build.boot
@@ -2,7 +2,7 @@
  :source-paths   #{"src"}
  :resource-paths #{"html"}
  :dependencies '[[adzerk/boot-cljs      "1.7.48-3" :scope "test"]
-                 [adzerk/boot-cljs-repl "0.1.10-SNAPSHOT" :scope "test"]
+                 [adzerk/boot-cljs-repl "0.1.9" :scope "test"]
                  [adzerk/boot-reload    "0.3.2"      :scope "test"]
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                  [prismatic/schema "1.0.0"]
@@ -28,13 +28,13 @@

 (require 'boot.repl)
 (swap! boot.repl/*default-dependencies*
-       concat '[[cider/cider-nrepl "0.10.0-SNAPSHOT"]])
+       concat '[[cider/cider-nrepl "0.9.1"]])

 (swap! boot.repl/*default-middleware*
        conj 'cider.nrepl/cider-middleware)

 (swap! boot.repl/*default-dependencies* conj
-       '[refactor-nrepl "1.1.0-SNAPSHOT"])
+       '[refactor-nrepl "1.1.0"])

 (swap! boot.repl/*default-middleware* conj
        'refactor-nrepl.middleware/wrap-refactor)


Release 0.1.0

Release 0.1.0

--- build.boot
+++ build.boot
@@ -32,7 +32,7 @@
          '[pandeiro.boot-http :refer [serve]])

 (def +project+ 'cljs-audio-utils)
-(def +version+ "0.1.0-SNAPSHOT")
+(def +version+ "0.1.0")

 (bootlaces! +version+ :dont-modify-paths? true)


build.boot: Add "view source" links to the generated API docs

--- build.boot
+++ build.boot
@@ -122,11 +122,13 @@
   (comp
    (building-docs)
    (codox :name "workflo/macros"
+          :version +version+
           :source-paths #{"src/main"}
           :output-path "api-docs"
           :doc-paths #{"docs/"}
           :metadata {:doc/format :markdown}
-          :themes [:default :macros])
+          :themes [:default :macros]
+          :source-uri "https://github.com/functionalfoundry/macros/blob/{version}/{filepath}#L{line}")
    (target)))

 (deftask test-once


fix cancel from queued table

fix cancel from queued table

--- frontend/components/builds_table.cljs
+++ frontend/components/builds_table.cljs
@@ -63,10 +63,15 @@
      (when show-actions?
        [:td.build_actions
         (when (build-model/can-cancel? build)
-          (let [build-id (build-model/id build)]
-            ;; XXX: how are we going to get back to the correct build in the app-state?
+          (let [build-id (build-model/id build)
+                vcs-url (:vcs_url build)
+                build-num (:build_num build)]
+            ;; TODO: how are we going to get back to the correct build in the app-state?
+            ;;       Not a problem here, b/c the websocket will be updated, but something to think about
             (forms/stateful-button
-             [:a {:on-click #(put! controls-ch [:cancel-build-clicked build-id])}
+             [:a {:on-click #(put! controls-ch [:cancel-build-clicked {:build-id build-id
+                                                                       :vcs-url vcs-url
+                                                                       :build-num build-num}])}
               "Cancel"])))])]))

 (defn builds-table [builds owner opts]


add complicated bus manipulation example from the sc book - yey!

--- docs/sc-book/sc-one.clj
+++ docs/sc-book/sc-one.clj
@@ -434,7 +434,7 @@
 ;;(
 ;;// now start the controls
 ;;{Out.kr(~kbus1, LFNoise0.kr(12))}.play;
-;;{Out.kr(~kbus2, LFClipNoise.kr(1/4))}.play;
+#;;{Out.kr(~kbus2, LFClipNoise.kr(1/4))}.play;
 ;;)
 ;;// Now start the second buffer with the same control input buses,
 ;;// but send it to the right channel using Out.ar(1 etc.
@@ -491,7 +491,7 @@
   (def kbus3 (control-bus))
   (def kbus4 (control-bus))

-  (defsynth wave-ctl [] (out:kr kbus3 (lin-lin (sin-osc:kr 1) -1 1 140 740)))
+  (defsynth wave-ctl [] (out:kr kbus3 (lin-lin (sin-osc:kr 1) -1 1 340 540)))
   (defsynth pulse-ctl [] (out:kr kbus4 (lin-lin (sin-osc:kr 1) -1 1 240 640)))

   (defsynth switch [freq 440]
@@ -506,3 +506,89 @@
 (map-ctl s :freq kbus4)

 (stop)
+
+
+;; Page 29
+
+;;(
+;;{
+;;        Out.ar(0,
+;;            Pan2.ar( PlayBuf.ar(1, ~houston, loop: 1) *
+;;                SinOsc.ar(LFNoise0.kr(12, mul: 500, add: 600)),
+;;            0.5)
+;;        )
+;;}.play
+;;)
+
+(demo 10 (pan2 (* (play-buf 1 houston :loop 1)
+                  (sin-osc (+ 600 (* 500 (lf-noise0:kr 12)))))
+               0.5))
+
+;;
+;;(
+;;{
+;;        var source, delay;
+;;        source = PlayBuf.ar(1, ~chooston, loop: 1);
+;;        delay = AllpassC.ar(source, 2, [0.65, 1.15], 10);
+;;        Out.ar(0, Pan2.ar(source) + delay)
+;;}.play
+;;)
+
+(demo 10 (let [source (play-buf 1 chooston :loop 1)
+               delay (allpass-c source 2 [0.65 1.15] 10)]
+           (+ delay (pan2 source))))
+
+
+;;//Create and name buses
+;;~delay = Bus.audio(s, 2);
+;;~mod = Bus.audio(s, 2);
+;;~gate = Bus.audio(s, 2);
+;;~k5 = Bus.control;
+;;
+;;~controlSyn= {Out.kr(~k5, LFNoise0.kr(4))}.play //start the control
+;;
+;;// Start the last item in the chain, the delay
+;;~delaySyn = {Out.ar(0, AllpassC.ar(In.ar(~delay, 2), 2, [0.65, 1.15], 10))}.play(~controlSyn, addAction: \addAfter);
+;;
+;;// Start the next to last item, the modulation
+;;~modSyn = {Out.ar(~delay, In.ar(~mod, 2) * SinOsc.ar(In.kr(~k5) * 500 + 1100))}.play(~delaySyn, addAction: \addBefore);
+;;
+;;//Start the third to last item, the gate
+;;~gateSyn = {Out.ar([0, ~mod], In.ar(~gate, 2) * max(0, In.kr(~k5)))}.play(~modSyn, addAction: \addBefore);
+;;
+;;//make a group for the PlayBuf synths at the head of the chain
+;;~pbGroup = Group.before(~controlSyn);
+;;
+;;// Start one buffer. Since we add to the group, we know where it will go
+;;{Out.ar(~gate, Pan2.ar(PlayBuf.ar(1, ~houston, loop: 1), 0.5))}.play(~pbGroup);
+;;
+;;// Start the other
+;;{Out.ar(~gate, Pan2.ar(PlayBuf.ar(1, ~chooston, loop: 1), -0.5))}.play(~pbGroup);
+
+(do
+  (def delay-b (audio-bus 2))
+  (def mod-b (audio-bus 2))
+  (def gate-b (audio-bus 2))
+  (def k5-b (control-bus))
+
+  (defsynth control-syn [] (out:kr k5-b (lf-noise0:kr 4)))
+  (def c-syn (control-syn))
+
+  (defsynth delay-syn [] (out:ar 0 (allpass-c (in delay-b 2) 2 [0.65 1.15] 10)))
+  (def d-syn (delay-syn :pos :after :tgt c-syn))
+
+  (defsynth mod-syn [] (out delay-b (* (in mod-b 2) (sin-osc (+ 1100 (* 500 (in:kr k5-b)))))))
+  (def m-syn (mod-syn :pos :before :tgt d-syn))
+
+  (defsynth gate-syn [] (out [0 mod-b] (* (in gate-b 2) (maximum 0 (in:kr k5-b)))))
+  (def g-syn (gate-syn :pos :before :tgt m-syn ))
+
+  (def pb-group (group :before c-syn))
+
+  (defsynth hous [] (out gate-b (pan2 (play-buf 1 houston :loop 1) 0.5)))
+  (defsynth choos [] (out gate-b (pan2 (play-buf 1 chooston :loop 1) -0.5))))
+
+(hous :tgt pb-group)
+(choos :tgt pb-group)
+
+(stop)


Switch get-item-texts to use extract-all-result-links.

--- project/scrape-summitpost-data/src/scrape_summitpost_data/get_item_texts.clj
+++ project/scrape-summitpost-data/src/scrape_summitpost_data/get_item_texts.clj
@@ -2,7 +2,7 @@
   (:require [scrape-summitpost-data.extract-pager-links
              :refer [extract-all-pager-links]]
             [scrape-summitpost-data.extract-result-links
-             :refer [extract-result-links]]
+             :refer [extract-all-result-links]]
             [scrape-summitpost-data.extract-from-item
              :refer [extract-item-name extract-item-text]]))

@@ -23,8 +23,7 @@
   items."
   [search-pages]
   (->> search-pages
-       (map extract-result-links)
-       (apply concat)
+       (extract-all-result-links)
        (map (partial str base-url))))

 (defn get-item-texts


Remove ClojureScript compilation in Uber JAR

--- build.boot
+++ build.boot
@@ -41,7 +41,7 @@

 (deftask build []
   (comp
-   (cljs :optimizations :advanced)
+   #_ (cljs :optimizations :advanced)
    (css)
    (aot :namespace '#{chili-dog-night.core})
    (pom :project 'chili-dog-night


Fix regression that prevented requiring binary modules (#164)

--- build.boot
+++ build.boot
@@ -171,9 +171,7 @@

 (deftask package-executable []
   (with-pass-thru _
-    (dosh "node" "scripts/package.js")
-    (when-not windows?
-      (dosh "strip" "build/lumo"))))
+    (dosh "node" "scripts/package.js")))

 (deftask backup-resources
   "Backup resources to be gzipped in the 2nd stage binary


I'm pretty good at checking in println statements when I didn't mean to...

--- contrib/mr-kluj/src/main/clj/com/linkedin/mr_kluj/voldemort_serialization.clj
+++ contrib/mr-kluj/src/main/clj/com/linkedin/mr_kluj/voldemort_serialization.clj
@@ -201,8 +201,6 @@
         (fn [key values context]
           [key (sort-by :index values)]))
       (job/wrap-reducer-input
-        (fn [key values context]
-	    (println key values)
           [false (join-sorted :index :value conj [(into {} key)] values)]))
       (job/wrap-reducer-input
         (let [output-keys (concat (mapcat (fn [[path serializer projections]] (map first projections)) inputs) (map first fields))


Add/Update RMG targets

Add/Update RMG targets

--- build.boot
+++ build.boot
@@ -42,5 +42,9 @@
 (deftask autotest []
   (comp (watch) (test)))

-(deftask make-release-jar []
-  (comp (target) (pom) (jar)))
+;; RMG Only stuff
+(deftask make-jar []
+  (comp (pom) (jar) (target)))
+
+(deftask release []
+  (comp (pom) (jar) (push)))


Remove kioo inclusion in build.boot

Remove kioo inclusion in build.boot

--- build.boot
+++ build.boot
@@ -9,7 +9,6 @@
    [reagent "0.8.1"]
    [re-frame "0.10.6"]
    [day8.re-frame/http-fx "0.1.6"]
-   [kioo "0.5.0" :exclusions [cljsjs/react]]
    [com.taoensso/timbre "4.10.0"]

    [adzerk/boot-cljs "LATEST" :scope "test"]


Prepare for 0.4.0 release

Prepare for 0.4.0 release

--- build.boot
+++ build.boot
@@ -7,7 +7,7 @@

 (require '[radicalzephyr.boot-junit :refer [junit]])

-(def +version+ "0.3.0")
+(def +version+ "0.4.0-SNAPSHOT")

 (bootlaces! +version+)


Inc version to deploy

Inc version to deploy

--- build.boot
+++ build.boot
@@ -1,8 +1,7 @@
 (def project 'parse-names)
-(def version "0.1.0-SNAPSHOT")
+(def version "0.1.1-SNAPSHOT")

 (set-env! :resource-paths #{"resources" "src"}
-
           :source-paths   #{"test"}
           :dependencies   '[[org.clojure/clojure "1.7.0"]
                             [org.clojure/clojurescript "1.7.228"]