Keyboard in freestyle mode.

Keyboard in freestyle mode.

--- src/mash_commander/keyboard.cljs
+++ src/mash_commander/keyboard.cljs
@@ -22,10 +22,11 @@
                             :color (if (contains? key-set letter)
                                      "#0b0" "#444")}
                            (:style letter-spec)))
-                  :onMouseDown #(when (contains? key-set letter)
+                  :onMouseDown #(when (or (empty? key-set) (contains? key-set letter))
                                   (mode/dispatch-keydown cursor owner
                                                          (condp = letter
                                                            "Esc" "Escape"
+                                                           "Space" " "
                                                            letter)))}
              letter)))

@@ -43,26 +44,26 @@
   (reify
     om/IRender
     (render [_]
-      (when (= :set (get-in cursor [:active :mode]))
-        (let [key-set (set (keys (get-in cursor [:active :trie])))
-              key-set (conj key-set "Esc")
-              rv (partial row-view (:active cursor) owner)]
-          (dom/div #js {:style #js {:position "absolute"
-                                    :width "100vw"
-                                    :heigth "100vh"}}
-                   (dom/div #js {:style #js {:backgroundColor "#ddd"
-                                             :width "870px"
-                                             :height "25vm"
-                                             :maxHeight "100%"
-                                             :margin "60vh auto 0 auto"
-                                             :zIndex "100"}}
-                            (rv (cons {:letter "Esc" :style {:width "80px"
-                                                             :margin-right "20px"}}
-                                      (standard-keys "1234567890")) "0px" key-set)
-                            (rv (standard-keys "qwertyuiop") "130px" key-set)
-                            (rv (concat
-                                 (standard-keys "asdfghjkl")
-                                 [{:letter "Enter" :style {:width "120px"
-                                                           :margin-left "50px"}}]) "150px" key-set)
-                            (rv (standard-keys "zxcvbnm") "170px" key-set)
-                            (rv [{:letter "Space" :style {:width "295px"}}] "290px" key-set))))))))
+      (let [key-set (if (= :set (get-in cursor [:active :mode]))
+                      (conj (set (keys (get-in cursor [:active :trie]))) "Esc")
+                      #{})
+            rv (partial row-view (:active cursor) owner)]
+        (dom/div #js {:style #js {:position "absolute"
+                                  :width "100vw"
+                                  :heigth "100vh"}}
+                 (dom/div #js {:style #js {:backgroundColor "#ddd"
+                                           :width "870px"
+                                           :height "25vm"
+                                           :maxHeight "100%"
+                                           :margin "60vh auto 0 auto"
+                                           :zIndex "100"}}
+                          (rv (cons {:letter "Esc" :style {:width "80px"
+                                                           :marginRight "20px"}}
+                                    (standard-keys "1234567890")) "0px" key-set)
+                          (rv (standard-keys "qwertyuiop") "130px" key-set)
+                          (rv (concat
+                               (standard-keys "asdfghjkl")
+                               [{:letter "Enter" :style {:width "120px"
+                                                         :marginLeft "50px"}}]) "150px" key-set)
+                          (rv (standard-keys "zxcvbnm") "170px" key-set)
+                          (rv [{:letter "Space" :style {:width "295px"}}] "290px" key-set)))))))


Add API for storing data to CouchDB

Add API for storing data to CouchDB

--- src/loggerbotter/database.clj
+++ src/loggerbotter/database.clj
@@ -1,9 +1,11 @@
 (ns loggerbotter.database
-  (:require [clj-time.core :as time]))
+  (:require [clj-time [core :as time] [coerce :as time-coerce]]
+            [cheshire [generate :refer [add-encoder]]]
+            [com.ashafa.clutch :as clutch]))

 (defprotocol Database
-  (save-raw-data [db data] "Save unprocessed data to database")
-  (save-meter-data [db data] "Save meter data to database")
+  (save-raw-data! [db data] "Save unprocessed data to database")
+  (save-meter-data! [db data] "Save meter data to database")
   (get-meter-data [db after-date] "Fetch all meter data after given date"))

 (defn- conj-to-key [d ks v]
@@ -12,10 +14,10 @@

 (defrecord InMemoryDatabase [db-atom]
   Database
-  (save-raw-data [db data]
+  (save-raw-data! [db data]
     (swap! (:db-atom db)
            #(conj-to-key % [:raw-log] data)))
-  (save-meter-data [db data]
+  (save-meter-data! [db data]
     (swap! (:db-atom db)
            #(conj-to-key % [:meters] data)))
   (get-meter-data [db after-date]
@@ -24,5 +26,69 @@
          (filter #(time/before? after-date (:time %)))
          (sort-by :time))))

-(defn new-memory-db []
+(defn create-memory-db []
   (->InMemoryDatabase (atom {})))
+
+(defn- remove-data-older-than [coll date]
+  (remove #(time/after? date (:time %)) coll))
+
+(defn- remove-old-data-for-field [db field before-date]
+  (update-in db [field]
+             #(remove-data-older-than % before-date)))
+
+(defn drop-old-data [memory-db before-date]
+  (swap! (:db-atom memory-db)
+         (fn [db]
+           (reduce
+             #(remove-old-data-for-field %1 %2 before-date)
+             db [:meters :raw-log]))))
+
+(add-encoder org.joda.time.DateTime
+             (fn [dt json-generator]
+               (.writeString json-generator
+                             (str (time-coerce/to-string dt)))))
+
+(defrecord CouchDatabase [db-url]
+  Database
+  (save-raw-data! [db data]
+    (if (map? data)
+      (clutch/put-document (:db-url db)
+                           (into {:datatype "raw-log"} data))))
+  (save-meter-data! [db data]
+    (if (map? data)
+      (clutch/put-document (:db-url db)
+                           (into {:datatype "meter"} data))))
+  (get-meter-data [db after-date]
+    (->> (clutch/get-view (:db-url db) "meterdata" "by-time"
+                          {:startkey (time-coerce/to-string after-date)})
+         (map :value))))
+
+(def meterdata-by-time-javascript
+  "function(doc, req) {
+    if (doc.time && doc.datatype === \"meter\") {
+      emit(doc.time, doc);
+    }
+  }")
+
+(def meterdata-javascript-views
+  {:by-time {:map meterdata-by-time-javascript}})
+
+(defn initialize-couchdb-db [db-url]
+  (clutch/get-database db-url)
+  (clutch/save-view db-url "meterdata"
+                    [:javascript meterdata-javascript-views])
+  (->CouchDatabase db-url))
+
+(defrecord CachedDatabase [master cache]
+  Database
+  (save-raw-data! [db data]
+    (do (save-raw-data! (:master db) data)
+        (save-raw-data! (:cache db) data)))
+  (save-meter-data! [db data]
+    (do (save-meter-data! (:master db) data)
+        (save-meter-data! (:cache db) data)))
+  (get-meter-data [db after-date]
+    (let [data (get-meter-data (:cache db) after-date)]
+      (if (empty? data)
+        (get-meter-data (:master db) after-date)
+        data))))


Stop censoring our tunnels!

Stop censoring our tunnels!

--- src/monkey_music/wrapper.cljs
+++ src/monkey_music/wrapper.cljs
@@ -81,11 +81,8 @@
    "inventory" (map name inventory)
    "score" score})

-(defn layoutable->str [layoutable]
-  (if (isa? layoutable ::trap) "trap" (name layoutable)))
-
 (defn layout->json [layout]
-  (map (partial map layoutable->str) layout))
+  (map (partial map name) layout))

 ;;; Exports


include :display_name in the set of hydrated fields on a table for Activity

--- src/metabase/models/activity.clj
+++ src/metabase/models/activity.clj
@@ -34,6 +34,6 @@
                             (assoc :database (delay (-> (Database database_id)
                                                         (select-keys [:id :name :description]))))
                             (assoc :table (delay (-> (Table table_id)
-                                                     (select-keys [:id :name :description])))))))
+                                                     (select-keys [:id :name :display_name :description])))))))

 (extend-ICanReadWrite ActivityEntity :read :public-perms, :write :public-perms)


CMR-2133 Removes extraneous test cases

CMR-2133 Removes extraneous test cases

--- access-control-app/int_test/cmr/access_control/int_test/access_control_group_acl_test.clj
+++ access-control-app/int_test/cmr/access_control/int_test/access_control_group_acl_test.clj
@@ -164,8 +164,7 @@

       (testing "with permission"
         (is (= {:status 200 :concept-id sys-group-id :revision-id 2}
-               (u/update-group sys-token sys-group-id (assoc sys-group :description "Updated name"))))
-        (u/assert-group-saved sys-group "user1" sys-group-id 2)))
+               (u/update-group sys-token sys-group-id (assoc sys-group :description "Updated name"))))))

     (testing "updating provider groups"
       (testing "without permission"
@@ -178,5 +177,4 @@

       (testing "with permission"
         (is (= {:status 200 :concept-id prov-group-id :revision-id 2}
-               (u/update-group prov-token prov-group-id (assoc prov-group :description "Updated name"))))
-        (u/assert-group-saved prov-group "user2" prov-group-id 2)))))
+               (u/update-group prov-token prov-group-id (assoc prov-group :description "Updated name"))))))))


Add GPG key ID to profiles.clj

Add GPG key ID to profiles.clj


Fix bug where state would be stopped twice

--- src/onyx/peer/task_lifecycle.clj
+++ src/onyx/peer/task_lifecycle.clj
@@ -847,7 +847,6 @@
            ex-f (fn [e state]
                   (let [lifecycle (get-lifecycle state)
                         action (handle-exception-action state lifecycle e)]
-                    (stop state)
                     (handle-exception task-information log e lifecycle action
                                       group-ch outbox-ch id job-id)))]
        (info log-prefix "Enough peers are active, starting the task")


Simplify less/sass stuff

Simplify less/sass stuff

--- src/leiningen/new/chestnut/src/clj/chestnut/server.clj
+++ src/leiningen/new/chestnut/src/clj/chestnut/server.clj
@@ -1,6 +1,6 @@
 (ns {{project-ns}}.server
   (:require [clojure.java.io :as io]
-            [{{project-ns}}.dev :refer [is-dev? inject-devmode-html browser-repl start-figwheel{{less-refer}}{{sass-refer}}]]
+            [{{project-ns}}.dev :refer [is-dev? inject-devmode-html browser-repl start-figwheel{{less-sass-refer}}]]
             [compojure.core :refer [GET defroutes]]
             [compojure.route :refer [resources]]
             [net.cgrand.enlive-html :refer [deftemplate]]


Shorter file names in simple-report

Shorter file names in simple-report

--- src/main/clojure/com/stuartsierra/lazytest/report.clj
+++ src/main/clojure/com/stuartsierra/lazytest/report.clj
@@ -1,6 +1,7 @@
 (ns com.stuartsierra.lazytest.report
   (:use com.stuartsierra.lazytest
-        [clojure.stacktrace :only (print-cause-trace)]))
+        [clojure.stacktrace :only (print-cause-trace)])
+  (:import (java.io File)))

 (defn source-name
   "Given a Test/Assertion result, returns an identifying form for
@@ -26,9 +27,12 @@
   [r]
   (let [m (meta (:source r))
         line (:line m)
-        file (:file m)]
-    (when (or line file)
-      (str "(" file ":" line ")"))))
+        file (:file m)
+        file (when file
+               (.getName (File. file)))]
+    (if (or line file)
+      (str "(" file ":" line ")")
+      "")))

 (defn print-result
   "Prints full details of a TestResult, including file and line
@@ -56,7 +60,7 @@
              (do (println indent "FAIL" (source-name r) (line-and-file r))
                  (print-source-doc r)
                  (doseq [c (:children r)]
-                   (simple-report c (str indent "     ")))))
+                   (simple-report c (str indent "   ")))))

            (= :com.stuartsierra.lazytest/TestThrown (type r))
            (do (println indent "ERROR" (source-name r) (line-and-file r))


add staticsphere angle sweeping

add staticsphere angle sweeping

--- src/solar_system_of_js/core.cljs
+++ src/solar_system_of_js/core.cljs
@@ -1,4 +1,5 @@
 (ns solar-system-of-js.core
+
   (:require-macros
     [cljs.core.async.macros :refer [go go-loop]])
   (:require
@@ -50,7 +51,8 @@
                :font-alpha 0}
    :static {:title {:alpha 0}
             :sphere {:alpha 0
-                     :r 200}
+                     :r 200
+                     :angle 0}
             :typescript {:alpha 0}
             :soundscript {:alpha 0}
             :flow {:alpha 0}}
@@ -302,31 +304,88 @@
   [opts]
   (draw-sign! opts "MODULE SYS" 2))

+(defn draw-static-arc!
+  [start-a stop-a color]
+  (save!)
+  (let [r-out (-> @state :static :sphere :r)
+        r-in (-> @state :js-face :r)
+        dr (- r-out r-in)
+        r (+ r-in (/ dr 2))
+        thick (* 0.8 dr)]
+    (line-width! thick)
+    (stroke-style! color)
+    (begin-path!)
+    (arc! 0 0 r start-a stop-a false)
+    (stroke!)
+    )
+  (restore!))
+
+(defn draw-typescript!
+  [{:keys [alpha]}]
+  (when-not (zero? alpha)
+    nil))
+
+(defn draw-soundscript!
+  [opts]
+  )
+
+(defn draw-flow!
+  [opts]
+  )
+
 (defn draw-staticsphere!
-  [{:keys [alpha r]}]
+  [{:keys [angle alpha r]}]
   (save!)
   (when-not (zero? alpha)
     (global-alpha! alpha)
     (circle! 0 0 r)
     (fill-style! "#BCC")
-    (fill!))
+    (fill!)
+
+    ;; draw the arc
+    (let [a (/ PI 2)
+          da (/ (* 2 PI) 3)
+          start-a (+ a da)]
+
+      (draw-static-arc! start-a (+ start-a angle) "#FFF")
+
+      ;; hack to grey out previously visited arcs
+      (let [second-a (cond
+                       (> angle (* 2 da)) (* 2 da)
+                       (> angle da) da)]
+        (draw-static-arc! start-a (+ start-a second-a) "#CDD")))
+
+    ;; draw dividers
+    (when (= 1 alpha)
+      (line-width! 24)
+      (stroke-style! "#BCC")
+      (let [r (-> @state :static :sphere :r)]
+        (dotimes [i 3]
+          (stroke-line! 0 0 0 r)
+          (rotate! (/ (* 2 PI) 3)))))
+    )
   (restore!))

 (defn draw-static!
-  [{:keys [title sphere typescript soundscript flow]}]
-  (save!)
-
-  (save!)
-  (global-alpha! (:alpha title))
-  (font! "100 90px Roboto")
-  (text-baseline! "middle")
-  (text-align! "center")
-  (fill-style! "#677")
-  (fill-text! "STATIC TYPING" 0 -600)
-  (restore!)
-
-  (draw-staticsphere! sphere)
-  (restore!))
+  [{:keys [title sphere angle typescript soundscript flow]}]
+  (when-not (zero? (:alpha sphere))
+    (save!)
+
+    (save!)
+    (global-alpha! (:alpha title))
+    (font! "100 90px Roboto")
+    (text-baseline! "middle")
+    (text-align! "center")
+    (fill-style! "#677")
+    (fill-text! "STATIC TYPING" 0 -600)
+    (restore!)
+
+    (draw-staticsphere! sphere)
+    (draw-typescript! typescript)
+    (draw-soundscript! soundscript)
+    (draw-flow! flow)
+
+    (restore!)))

 ;;--------------------------------------------------------------------------------
 ;; Drawing
@@ -564,9 +623,32 @@
         (<! (multi-animate!
               {:a :_ :b 1 :duration 1} [:static :title :alpha]
               {:a :_ :b 1 :duration 1} [:static :sphere :alpha]
-              {:a :_ :b 400 :duration 1} [:static :sphere :r]))
-        )
-
+              {:a :_ :b 400 :duration 1} [:static :sphere :r])))
+
+     (let [angle (/ (* 2 PI) 3)]
+       [;; show typescript
+        #(go
+           (<! (multi-animate!
+                 {:a :_ :b 300 :duration 1} [:cam :x]
+                 {:a :_ :b 1 :duration 1} [:static :typescript :alpha]
+                 {:a :_ :b angle :duration 1} [:static :sphere :angle]
+                 )))
+
+        ;; show flow
+        #(go
+           (<! (multi-animate!
+                 {:a :_ :b 1 :duration 1} [:static :flow :alpha]
+                 {:a :_ :b 0.5 :duration 1} [:static :typescript :alpha]
+                 {:a :_ :b (* 2 angle) :duration 1} [:static :sphere :angle]
+                 )))
+
+        ;; show soundscript
+        #(go
+           (<! (multi-animate!
+                 {:a :_ :b 0.5 :duration 1} [:static :flow :alpha]
+                 {:a :_ :b 1 :duration 1} [:static :soundscript :alpha]
+                 {:a :_ :b (* 3 angle) :duration 1} [:static :sphere :angle]
+                 )))])

      ])))


remove println

remove println

Former-commit-id: 86f80dc52560402abe0956abae83ee4092f35dc7

--- src/status_im/chat/handlers.cljs
+++ src/status_im/chat/handlers.cljs
@@ -288,7 +288,6 @@
   (let [chat-id (or id current-chat-id)
         messages (get-in db [:chats chat-id :messages])
         db' (assoc db :current-chat-id chat-id)]
-    (println "wuuut..." chat-id messages)
     (if (seq messages)
       db'
       (-> db'


Add better handling for nil in post function.

--- src/todo_repl_webapp/handler.clj
+++ src/todo_repl_webapp/handler.clj
@@ -45,11 +45,13 @@
   (GET "/" [] (do (println "get /")
                   (home-page)))
   (POST "/eval" [evalInput]
-    (do (println "/eval " evalInput)
-        (binding [*ns* (find-ns 'todo-repl-webapp.handler)]
-          (let [result (load-string evalInput)]
-            (println "evals to: " result)
-            (eval-page (str result))))))
+    (if (nil? evalInput)
+      (eval-page "nil")
+      (do (println "/eval " evalInput)
+          (binding [*ns* (find-ns 'todo-repl-webapp.handler)]
+            (let [result (load-string evalInput)]
+              (println "evals to: " result)
+              (eval-page (str result)))))))
   (route/resources "/")
   (route/not-found "Not Found"))


Story ID: GEM-557 Fixing parse-claims in openid_client

--- src/untangled/openid_client.cljs
+++ src/untangled/openid_client.cljs
@@ -22,7 +22,7 @@
               (s/split params #"&"))))

 (defn parse-claims [token]
-  (-> token (s/split #"\.") second js/atob js/JSON.parse))
+  (some-> token (s/split #"\.") second js/atob js/JSON.parse))

 (defn setup
   "Installs openid information into the passed in untangled-client app's initial state,
@@ -33,7 +33,7 @@
   (let [tokens (or
                  (get-tokens-from-cookies)
                  (tokens-from-params (params)))
-        id-claims (-> tokens (get "id_token") parse-claims js->clj w/keywordize-keys)]
+        id-claims (some-> tokens (get "id_token") parse-claims js->clj w/keywordize-keys)]
     (swap! app update-in [:initial-state]
            (fn [m]
              (assoc m


GAWB:2189: made cancel-editing function private, moved swap

--- src/cljs/main/broadfcui/page/workspace/method_configs/method_config_editor.cljs
+++ src/cljs/main/broadfcui/page/workspace/method_configs/method_config_editor.cljs
@@ -169,9 +169,7 @@
                                      :onClick #(this :-commit)}]
                [comps/SidebarButton {:color :exception-state :margin :top
                                      :text "Cancel Editing" :icon :cancel
-                                     :onClick (fn []
-                                                (swap! state assoc :editing? false)
-                                                (this :cancel-editing))}]))]))]))
+                                     :onClick #(this :-cancel-editing)}]))]))]))
    :-render-main
    (fn [{:keys [state this]}]
      (let [{:keys [editing? loaded-config wdl-parse-error inputs-outputs methods]} @state
@@ -328,12 +326,12 @@
                         (do
                           (swap! state assoc :blocker nil :wdl-parse-error (:message response))
                           (comps/push-error (style/create-server-error-message (:message response)))))))})))
-   :cancel-editing
+   :-cancel-editing
    (fn [{:keys [state props refs]}]
      (let [original-loaded-config (:original-config @state)
            original-inputs-outputs (:original-inputs-outputs @state)
            method-ref (-> original-loaded-config :methodConfiguration :methodRepoMethod)]
-       (swap! state assoc :loaded-config original-loaded-config :inputs-outputs original-inputs-outputs)
+       (swap! state assoc :editing? false :loaded-config original-loaded-config :inputs-outputs original-inputs-outputs)
        ((@refs "methodDetailsViewer") :load-agora-method {:namespace (:methodNamespace method-ref)
                                                           :name (:methodName method-ref)
                                                           :snapshotId (:methodVersion method-ref)})))})


Add generative tests for short circuit flow conditions

--- test/onyx/flow_conditions/flow_conditions_gen_test.clj
+++ test/onyx/flow_conditions/flow_conditions_gen_test.clj
@@ -60,7 +60,7 @@
                   (gen/return {:flow/predicate ::false-pred
                                :pred/val false})))

-(defn short-circuit-flow-condition-gen [base-gen]
+(defn flow-short-circuit-condition-gen [base-gen]
   (merge-gen-maps base-gen (gen/return {:flow/short-circuit? true})))

 (defn exception-flow-condition-gen [base-gen]
@@ -148,19 +148,19 @@
                      (flow-condition-gen)
                      (flow-to-tasks-gen)
                      (false-flow-condition-gen)
-                     (short-circuit-flow-condition-gen)))
+                     (flow-short-circuit-condition-gen)))
     true-1
     (gen/not-empty (gen/vector (->> :a
                                     (flow-condition-gen)
                                     (flow-to-tasks-gen)
                                     (true-flow-condition-gen)
-                                    (short-circuit-flow-condition-gen))))
+                                    (flow-short-circuit-condition-gen))))
     false-2
     (gen/vector (->> :a
                      (flow-condition-gen)
                      (flow-to-tasks-gen)
                      (false-flow-condition-gen)
-                     (short-circuit-flow-condition-gen)))
+                     (flow-short-circuit-condition-gen)))
     mixed-1
     (gen/vector (->> :a
                      (flow-condition-gen)
@@ -197,7 +197,7 @@
     (gen/vector (->> :a
                      (flow-condition-gen)
                      (flow-to-tasks-gen)
-                     (short-circuit-flow-condition-gen)
+                     (flow-short-circuit-condition-gen)
                      (maybe-predicate)))
     exceptions
     (gen/vector (->> :a
@@ -421,3 +421,18 @@
                                  (flow-to-none-gen))))]
     (let [fcs (into [] (concat fcs-other fcs-none))]
       (is (thrown? Exception (v/validate-flow-conditions fcs []))))))
+
+
+(deftest short-circuit-placed-before-other
+  (checking
+    ":flow/short-circuit? true should be placed before other conditions"
+    (times 50)
+    [fcs-other (gen/not-empty
+                 (gen/vector (->> :a
+                                  (flow-condition-gen))))
+     fcs-short-circuit (gen/not-empty
+                        (gen/vector (->> :a
+                                         (flow-condition-gen)
+                                         (flow-short-circuit-condition-gen ))))]
+    (let [fcs (into [] (concat fcs-other fcs-short-circuit))]
+      (is (thrown? Exception (v/validate-flow-conditions fcs []))))))


Updates to cassandra and schema

Updates to cassandra and schema

--- talkpocket-api/src/talkpocket_api/entry/entry_dal.clj
+++ talkpocket-api/src/talkpocket_api/entry/entry_dal.clj
@@ -9,9 +9,11 @@

 (def cluster (alia/cluster {:contact-points ["127.0.0.1"]}))
 (def session (alia/connect cluster))
-(def insert-entry-query "INSERT INTO articles (article_id, file_id, file_url, audio_format) VALUES (?, ?, ?, ?)")
-(def get-entry-by-id-query "SELECT * FROM articles WHERE article_id = ?")
+(def insert-entry-query "INSERT INTO articles (id, file_id, file_url, audio_format, state) VALUES (?, ?, ?, ?, ?)")
+(def update-entry-state-query "UPDATE articles SET state = ? WHERE id = ?")
+(def get-entry-by-id-query "SELECT * FROM articles WHERE id = ?")
 (def insert-entry-prepared (delay (alia/prepare session insert-entry-query)))
+(def update-entry-state-prepared (delay (alia/prepare session update-entry-state-query)))
 (def get-entry-by-id-prepared (delay (alia/prepare session get-entry-by-id-query)))

 (defn- create-schema []
@@ -19,20 +21,26 @@
                          WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 3};")
   (alia/execute session "USE talkpocket;")
   (alia/execute session "CREATE TABLE IF NOT EXISTS articles (
-                                                article_id varchar,
+                                                id varchar,
                                                 file_id varchar,
                                                 file_url varchar,
                                                 audio_format varchar,
-                                                PRIMARY KEY (article_id));"))
+                                                state int,
+                                                PRIMARY KEY (id));"))
 (defn- insert-entry
-  [article-id file-id file_url audio-format]
+  [id file-id file_url audio-format state]
   (alia/execute session "USE talkpocket;")
-  (alia/execute session @insert-entry-prepared {:values [article-id file-id file_url audio-format]}))
+  (alia/execute session @insert-entry-prepared {:values [id file-id file_url audio-format state]}))
+
+(defn- update-article-state
+  [id new-state]
+  (alia/execute session "USE talkpocket;")
+  (alia/execute session @update-entry-state-prepared {:values [id new-state]}))

 (defn- get-entry
-  [article-id]
+  [id]
   (alia/execute session "USE talkpocket;")
-  (alia/execute session @get-entry-by-id-prepared {:values [article-id]}))
+  (alia/execute session @get-entry-by-id-prepared {:values [id]}))

 (defn- get-all []
   (alia/execute session "USE talkpocket;")
@@ -47,13 +55,16 @@
             {operation :op} entry]
         (cond
           (= operation "insert")
-           (let [{article-id :id file-id :file_id  file-url :url audio-format :format} entry]
-            (create-schema)
-            (insert-entry article-id file-id file-url (str audio-format))
-            (>! out entry))
+           (let [{id :id file-id :file_id file-url :url audio-format :format} entry]
+             (create-schema)
+             (insert-entry id file-id file-url (str audio-format) (int 0))
+             (>! out entry))
+           (= operation "update")
+           (let [{id :id} entry]
+             (update-article-state 1 id))
            (= operation "search")
-           (let [{article-id :id} entry]
-             (>! out (get-entry article-id)))
+           (let [{id :id} entry]
+             (>! out (get-entry id)))
            (= operation "all")
            (>! out (get-all))
           )))


CMR-3207: Refactor remove-duplicate-params

--- search-app/src/cmr/search/services/query_execution/facets/hierarchical_links_helper.clj
+++ search-app/src/cmr/search/services/query_execution/facets/hierarchical_links_helper.clj
@@ -124,37 +124,46 @@
                                   (get-potential-matching-query-params query-params field-name))]
      (remove-value-from-query-params-for-hierachical-field query-params potential-qp-matches value))))

+(defn- remove-index-from-params
+  "Returns the query parameters for the provided base-field with the index removed from the
+  parameter name."
+  [query-params base-field]
+  (util/map-keys #(str/replace % #"\[\d+\]" "") query-params))
+
+(defn- find-duplicate-indexes
+  "Returns a set of indexes that have query parameters that are completely duplicated by another
+  index for the given base field."
+  [base-field params-by-index]
+  (set
+   (flatten
+    (for [[idx qps] params-by-index
+          :let [qps (remove-index-from-params qps base-field)]]
+      (keep (fn [[matching-index matching-qps]]
+              (when (and (not= idx matching-index)
+                         ;; remove the index from the parameters to compare
+                         (let [matching-qps (remove-index-from-params matching-qps base-field)]
+                           ;; another group of params fully contains this group of params
+                           (and (= qps (select-keys matching-qps (keys qps)))
+                                (or (not= qps matching-qps)
+                                    ;; If multiple sets of parameters exactly match, get rid of one
+                                    ;; and keep one
+                                    (< idx matching-index)))))
+                idx))
+            params-by-index)))))
+
 (defn- remove-duplicate-params
   "Removes any parameters for the provided field which are exact subsets of another index for the
   same field."
   [query-params base-field]
-  (let [potential-qps (filter (fn [[k _]]
-                                (re-find (re-pattern base-field) k))
-                              query-params)   ;; Eliminate any params we do not care about
-        ;; Group the remaining params by index
-        param-groups-by-index (group-by (fn [[k _]]
-                                          (second (re-find #"\[\d+\]" k)))
-                                        potential-qps)
-        ;; Iterate through each set of parameters
-        indexes-to-remove
-         (set
-          (flatten
-           (for [[idx qps] param-groups-by-index
-                 :let [qps (util/map-keys #(str/replace % #"\[\d+\]" "")
-                                          (into {} qps))]]
-             (keep (fn [[matching-index matching-qps]]
-                     (when (and (not= idx matching-index)
-                                ;; remove the index
-                                (let [matching-qps (util/map-keys #(str/replace % #"\[\d+\]" "")
-                                                                  (into {} matching-qps))]
-                                  ;; another group of params fully contains this group of params
-                                  (and (= qps (select-keys matching-qps (keys qps)))
-                                       (or (not= qps matching-qps)
-                                           (< (Integer/parseInt (format "%s" idx))
-                                              (Integer/parseInt (format "%s" matching-index)))))))
-                       idx))
-                   param-groups-by-index))))
-        query-keys-to-remove (mapcat #(keys (get param-groups-by-index %)) indexes-to-remove)]
+  (let [base-field-params-by-index (group-by (fn [[k _]]
+                                               (when (re-find (re-pattern base-field) k)
+                                                 (->> (re-find #"\[\d+\]" k)
+                                                      second
+                                                      (format "%s")
+                                                      Integer/parseInt)))
+                                             query-params)
+        indexes-to-remove (find-duplicate-indexes base-field base-field-params-by-index)
+        query-keys-to-remove (mapcat #(keys (get base-field-params-by-index %)) indexes-to-remove)]
     (if (seq query-keys-to-remove)
       (apply dissoc query-params query-keys-to-remove)
       query-params)))
@@ -190,8 +199,7 @@
     applied-children-tuples]
    (if (keys (dissoc ancestors-map "category"))
      ;; Check if all ancestors are in the query-params with the parent index
-    ;  (let [[base-field subfield] (split-into-base-field-and-subfield field-name)
-     (let [[_ base-field subfield] (re-find #"(.*)\[\d+\]\[(.*)\]" field-name)
+     (let [[base-field subfield] (split-into-base-field-and-subfield field-name)
            ;; In order for a field to be considered for removal, it and all of its ancestors must
            ;; be found in the query parameters. This builds a sequence of query parameters to check
            ;; against (one set of query parameters for each potential parent index).


Don't let emoji text replacement eat random colon-delimited text

--- src/braid/emoji/text_replacements.cljs
+++ src/braid/emoji/text_replacements.cljs
@@ -16,8 +16,14 @@
           ;; component
           [pre _ post] (seq (.split text re replace-fn))]
       (if-let [match (second (re-find re text))]
-        (if (or (string/blank? pre) (re-matches #".*\s$" pre))
+        (cond
+          (not (emoji/unicode match))
+          text-or-node
+
+          (or (string/blank? pre) (re-matches #".*\s$" pre))
           [:span.dummy pre (replace-fn match) post]
+
+          :else
           text)
         text))
     text-or-node))


debounce autocomplete, use components for emoji

--- src/chat/client/views/new_message.cljs
+++ src/chat/client/views/new_message.cljs
@@ -1,11 +1,13 @@
 (ns chat.client.views.new-message
+  (:require-macros [cljs.core.async.macros :refer [go]])
   (:require [om.core :as om]
             [om.dom :as dom]
+            [cljs.core.async :as async :refer [<! put! chan alts!]]
             [clojure.string :as string]
             [chat.client.dispatcher :refer [dispatch!]]
             [chat.client.store :as store]
             [chat.client.emoji :as emoji]
-            [chat.client.views.helpers :refer [id->color]])
+            [chat.client.views.helpers :refer [id->color debounce]])
   (:import [goog.events KeyCodes]))

@@ -48,6 +50,17 @@
 ;                text to replace message with

+(defn emoji-view [emoji owner]
+  (reify
+    om/IRender
+    (render [_]
+      (dom/div #js {:className "emoji-match"}
+        (emoji/shortcode->html emoji)
+        (dom/div #js {:className "name"}
+          emoji)
+        (dom/div #js {:className "extra"}
+          "...")))))
+
 (def engines
   [
    ; ... :emoji  -> autocomplete emoji
@@ -57,7 +70,6 @@
          (->> emoji/unicode
               (filter (fn [[k v]]
                         (simple-matches? k query)))
-              (take 10)
               (map (fn [[k v]]
                      {:action
                       (fn [thread-id])
@@ -66,12 +78,7 @@
                         (string/replace text pattern (str k " ")))
                       :html
                       (fn []
-                        (dom/div #js {:className "emoji-match"}
-                          (emoji/shortcode->html k)
-                          (dom/div #js {:className "name"}
-                            k)
-                          (dom/div #js {:className "extra"}
-                            "...")))}))))))
+                        (om/build emoji-view k {:react-key k}))}))))))

    ; ... @<user>  -> autocompletes user name
    (fn [text thread-id]
@@ -128,15 +135,33 @@
     (init-state [_]
       {:text ""
        :force-close? false
-       :highlighted-result-index -1})
+       :highlighted-result-index -1
+       :results nil
+       :kill-chan (chan)
+       :autocomplete-chan (chan)
+       })
+    om/IWillMount
+    (will-mount [_]
+      (let [autocomplete (debounce (om/get-state owner :autocomplete-chan) 200)
+            kill-chan (om/get-state owner :kill-chan)]
+        (go (loop []
+              (let [[v ch] (alts! [autocomplete kill-chan])]
+                (when (= ch autocomplete)
+                  (om/set-state! owner :results
+                                 (seq (mapcat (fn [e] (e v (config :thread-id))) engines)))
+                  (recur)))))))
+    om/IWillUnmount
+    (will-unmount [_]
+      (put! (om/get-state owner :kill-chan) (js/Date.)))
+    om/IWillUpdate
+    (will-update [_ next-props next-state]
+      (let [next-text (next-state :text)
+            prev-text (om/get-render-state owner :text)]
+        (when (not= next-text prev-text)
+          (put! (om/get-state owner :autocomplete-chan) next-text))))
     om/IRenderState
-    (render-state [_ {:keys [text force-close? highlighted-result-index] :as state}]
-      (let [constrain (fn [x a z]
-                        (cond
-                          (> x z) z
-                          (< x a) a
-                          :else x))
-            results (seq (mapcat (fn [e] (e text (config :thread-id))) engines))
+    (render-state [_ {:keys [results text force-close? highlighted-result-index] :as state}]
+      (let [constrain (fn [x a z] (Math/min z (Math/max a x)))
             highlight-next!
             (fn []
               (om/update-state! owner :highlighted-result-index
@@ -217,7 +242,8 @@
                                      (highlight-clear!))))})

             (when autocomplete-open?
-              (dom/div #js {:className "autocomplete"}
+              (dom/div #js {:className "autocomplete"
+                            :onWheel (fn [e] (.log js/console "wheel" e))}
                 (if (seq results)
                   (apply dom/div nil
                     (map-indexed


Doubled max points

Doubled max points

--- src/clojush/problems/software/calc.clj
+++ src/clojush/problems/software/calc.clj
@@ -489,7 +489,7 @@
    :max-generations 100000
    :evalpush-limit 3000
    :tag-limit 10000
-   :max-points 6000
+   :max-points 12000
    :max-genome-size-in-initial-program 500 ;;100
    :mutation-probability 0.0
    :crossover-probability 0.0


fix case where nothing is captured by inner trace

--- src/com/billpiel/sayid/deep_trace2.clj
+++ src/com/billpiel/sayid/deep_trace2.clj
@@ -588,10 +588,10 @@

 (defn record-trace-tree!
   [[tree-atom src-map]]
-  (let [children (-> (@tree-atom nil)
-                     deref-children
-                     :children
-                     deref)]
+  (let [children (some-> (@tree-atom nil)
+                         deref-children
+                         :children
+                         deref)]
     (doseq [child children]
       (swap! (:children trace/*trace-log-parent*)
              conj


Whitespace fix.

Whitespace fix.

--- src/com/lemondronor/turboshrimp/at.clj
+++ src/com/lemondronor/turboshrimp/at.clj
@@ -270,5 +270,6 @@
      :forward 0
      :down 3)))

+
 (defcommand :set-camera-framerate [fps]
   (build-command :config "video:codec_fps" fps))


fix the typo in the metric name

fix the typo in the metric name

--- scheduler/src/cook/mesos/scheduler.clj
+++ scheduler/src/cook/mesos/scheduler.clj
@@ -405,7 +405,7 @@
 (def front-of-job-queue-mem-atom (atom 0))
 (def front-of-job-queue-cpus-atom (atom 0))
 (gauges/defgauge [cook-mesos scheduler front-of-job-queue-mem] (fn [] @front-of-job-queue-mem-atom))
-(gauges/defgauge [cook-mesos-scheduler front-of-job-queue-cpus] (fn [] @front-of-job-queue-cpus-atom))
+(gauges/defgauge [cook-mesos scheduler front-of-job-queue-cpus] (fn [] @front-of-job-queue-cpus-atom))

 (defn handle-resource-offer!
   "Gets a list of offers from mesos. Decides what to do with them all--they should all


don't need the uberkey here

don't need the uberkey here

--- src/er_cassandra/model/alia/upsert.clj
+++ src/er_cassandra/model/alia/upsert.clj
@@ -80,10 +80,7 @@

 (defn stale-lookup-key-values
   [^Model model old-record new-record lookup-key-table]
-  (let [uber-key (t/uber-key model)
-        uber-key-value (t/extract-uber-key-value model (or new-record
-                                                           old-record))
-        key (:key lookup-key-table)
+  (let [key (:key lookup-key-table)
         col-colls (:collections lookup-key-table)]

     (when (k/has-key? key new-record)


continue to isolate/encapsulate join internal rep

--- dada2-core/src/test/clojure/org/dada2/test_join_model.clj
+++ dada2-core/src/test/clojure/org/dada2/test_join_model.clj
@@ -47,6 +47,16 @@
 ;;--------------------------------------------------------------------------------
 ;; this layer encapsulates access to rhs indeces

+(defn- rhs-assoc [old-indeces i key rhs]
+  (let [old-index (nth old-indeces i)
+	value (key rhs)
+	old-rhses (or (old-index value) [])
+	new-rhses (conj old-rhses rhs)
+	new-index (assoc old-index value new-rhses)
+	new-indeces (assoc old-indeces i new-index)]
+    new-indeces
+    ))
+
 (defn- rhses-get [rhs-indeces keys lhs]
   "return a lazy seq of seqs where each seq contains the rhses which
 join the lhs via corresponding key"
@@ -85,16 +95,10 @@
 ;; TODO: return a pair - first is notification fn, second is new-indeces - use swap*! to apply

 (defn- rhs-upsert [old-indeces i lhs-key rhs-ks v join-fn joined-model]
-  (let [
-	old-index (nth old-indeces i)
-	key (lhs-key v)
-	old-value (or (old-index key) [])
-	new-value (conj old-value v)
-	new-index (assoc old-index key new-value)
-	new-indeces (assoc old-indeces i new-index)
+  (let [new-indeces (rhs-assoc old-indeces i lhs-key v)
 	lhs-indeces (first old-indeces)
 	lhs-index (nth lhs-indeces (dec i))
-	lhses (key lhs-index)
+	lhses ((lhs-key v) lhs-index)
 	rhs-indeces (rest new-indeces)
 	joins (mapcat (fn [lhs] (derive-joins lhs rhs-indeces rhs-ks join-fn)) lhses)
 	]


Not need for threading macro here

Not need for threading macro here

--- src/hu/ssh/github_changelog/github.clj
+++ src/hu/ssh/github_changelog/github.clj
@@ -8,5 +8,6 @@
 (defn fetch-pulls [user repo {:keys [token]}]
   {:pre  [(string? user) (string? repo)]
    :post [(seq? %)]}
-  (->> (pulls/pulls user repo (merge {:token token :all-pages true :state "closed"}))
-       (map #(assoc % :sha (pull-sha %)))))
+  (map
+    #(assoc % :sha  (pull-sha %))
+    (pulls/pulls user repo (merge {:token token, :all-pages true, :state  "closed"}))))


Re-enabled sorting by entry summary.

Re-enabled sorting by entry summary.

--- src/lambda_blog/templates/archives.clj
+++ src/lambda_blog/templates/archives.clj
@@ -22,7 +22,7 @@
                   (thead (tr (th (span "Posted on"))
                              (th (span "Title"))
                              (th (span "Tags"))
-                             (th {:class [:sorter-false :hidden-xs :hidden-sm]}
+                             (th {:class [:hidden-xs :hidden-sm]}
                                  (span "Summary"))))
                   (tbody (map archive-entry entries))))
       (p {:class [:hidden-xs :hidden-sm]}


Use old metadata syntax for Clojure 1.2.x compatibility

--- src/main/clojure/clojure/data/json.clj
+++ src/main/clojure/clojure/data/json.clj
@@ -17,9 +17,9 @@

 ;;; JSON READER

-(def ^:dynamic ^:private *bigdec*)
-(def ^:dynamic ^:private *key-fn*)
-(def ^:dynamic ^:private *value-fn*)
+(def ^{:dynamic true :private true} *bigdec*)
+(def ^{:dynamic true :private true} *key-fn*)
+(def ^{:dynamic true :private true} *value-fn*)

 (defn- default-write-key-fn
   [x]
@@ -273,8 +273,8 @@

 ;;; JSON WRITER

-(def ^:dynamic ^:private *escape-unicode*)
-(def ^:dynamic ^:private *escape-slash*)
+(def ^{:dynamic true :private true} *escape-unicode*)
+(def ^{:dynamic true :private true} *escape-slash*)

 (defprotocol JSONWriter
   (-write [object out]


Replace use of deprecated lambdacd.step.support namespace with the current alternative

--- example-pipeline/src/lambdaui/example/simple_pipeline.clj
+++ example-pipeline/src/lambdaui/example/simple_pipeline.clj
@@ -9,7 +9,7 @@
             [lambdaui.core :as ui]
             [lambdacd.steps.manualtrigger :refer [wait-for-manual-trigger parameterized-trigger]]
             [lambdacd.runners :as pipeline-runners]
-            [lambdacd.steps.support :as support])
+            [lambdacd.stepsupport.output :as output])
   (:import (java.nio.file.attribute FileAttribute)
            (java.nio.file Files)))

@@ -36,8 +36,8 @@
   {:status (swap! lastStatus swapStatus)})

 (defn output-parameters [args ctx]
-  (let [p (support/new-printer)
-        out #(support/print-to-output ctx p %)
+  (let [p (output/new-printer)
+        out #(output/print-to-output ctx p %)
         revision (get args :revision)

         ]
@@ -120,4 +120,4 @@

 (defn start []
   (stop)
-  (-main))+  (-main))


Even more better error messages

Even more better error messages

--- test/comic_reader/sites_test.clj
+++ test/comic_reader/sites_test.clj
@@ -17,7 +17,8 @@
     (catch java.lang.RuntimeException re
       (is false
           (str "Contents of `sites/" site ".clj'"
-               " cannot be empty")))))
+               " cannot be empty. Should be a map "
+               "literal (i.e. `{}')")))))

 (defn try-read-file [filename error-message]
   (try


Add a generic try-read-file function to tests

--- test/comic_reader/sites_test.clj
+++ test/comic_reader/sites_test.clj
@@ -44,6 +44,14 @@
     (catch java.lang.RuntimeException re
       (is false
           (str "Contents of `sites/" site ".clj'"
+               " cannot be empty")))))
+
+(defn try-read-file [filename]
+  (try
+    (read-file filename)
+    (catch java.lang.RuntimeException re
+      (is false
+          (str "Contents of `" filename "'"
                " cannot be empty")))))

 (def ^:dynamic site-name)


Expand the test utilities to support mocking out heads and tentacles. This is.... on the clunky side at the moment (second arg unused); think of a better way to do this.

--- test/doctopus/test_utilities.clj
+++ test/doctopus/test_utilities.clj
@@ -1,6 +1,8 @@
 (ns doctopus.test-utilities
   (:require [clojure.string :as str]
             [clojure.test :refer :all]
+            [doctopus.doctopus.head :refer [->Head]]
+            [doctopus.doctopus.tentacle :refer [map->Tentacle]]
             [doctopus.storage :refer [remove-from-storage backend]]
             [doctopus.test-utilities :refer :all])
   (:import [org.joda.time DateTime]
@@ -38,3 +40,15 @@
       (if (= (count acc) length)
         (apply str acc)
         (recur (conj acc (rand-nth candidate-chars)))))))
+
+(defmethod mock-data :tentacle
+  [_ _]
+  (map->Tentacle {:name (mock-data :string 10)
+                  :html-commands [(mock-data :string 10)]
+                  :output-root (mock-data :string 15)
+                  :source-location (mock-data :string 10)
+                  :entry-point (mock-data :string 10)}))
+
+(defmethod mock-data :head
+  [_ _]
+  (->Head (mock-data :string 18)))


switch out tour link with pricing link at bottom

--- frontend/components/landing_b.cljs
+++ frontend/components/landing_b.cljs
@@ -387,10 +387,10 @@
                  [:h3.slogan.context {:item-prop "Next you'll just need to sign in using your GitHub account."
                                       :alt       "Signing up using your GitHub login lets us start really fast."}
                   "Next you'll just need to sign in using your GitHub account."]
-                 [:h3.slogan.context {:item-prop "Still not convinced yet? Try taking the full tour."
+                 [:h3.slogan.context {:item-prop "Still not convinced yet? Check out our pricing."
                                       :alt       "Currently, we must request permissions in bulk."}
-                  "Still not convinced yet? Try taking the "
-                  [:a {:href "#"} "full tour"]
+                  "Still not convinced yet? Check out our "
+                  [:a {:href "pricing"} "pricing"]
                   "."]]
                 [:div.home-avatars
                  [:div.avatars


oops forgot to add fact title

oops forgot to add fact title

--- test/midje/checkers/t_chatty.clj
+++ test/midje/checkers/t_chatty.clj
@@ -25,7 +25,7 @@
                 [ '( (f) (+ 1 2))  '(1 (g-101 0) 33 (g-101 1))  ])

 (tabular
-  (fact ""
+  (fact "knows if is worth reporting on"
     (chatty-worth-reporting-on? ?arg) => ?worth-it)

     ?arg   ?worth-it


Formatting

Formatting

--- test/yada/file_resource_test.clj
+++ test/yada/file_resource_test.clj
@@ -24,10 +24,10 @@
 (def exists? (memfn exists))

 #_(deftest legal-name-test
-  (are [x] (not (#'legal-name x))
-    ".." "./foo" "./../home" "./.." "/foo" "a/b")
-  (are [x] (legal-name x)
-    "a" "b.txt" "c..txt"))
+    (are [x] (not (#'legal-name x))
+      ".." "./foo" "./../home" "./.." "/foo" "a/b")
+    (are [x] (legal-name x)
+      "a" "b.txt" "c..txt"))

 ;; Test an actual file resource
 (st/deftest file-test


Minor cosmetic fix on history ref declaration.

--- frontend/src/uxbox/main/ui/workspace/sidebar/history.cljs
+++ frontend/src/uxbox/main/ui/workspace/sidebar/history.cljs
@@ -25,8 +25,8 @@
 ;; --- Lenses

 (def history-ref
-  (as-> (l/in [:workspace :history]) $
-    (l/derive $ st/state)))
+  (-> (l/key :history)
+      (l/derive refs/workspace)))

 ;; --- History Item (Component)


Improve make-test-page to allow multiple urls and add multiple url test for extract-result-links.

--- project/scrape-summitpost-data/test/scrape_summitpost_data/extract_result_links_test.clj
+++ project/scrape-summitpost-data/test/scrape_summitpost_data/extract_result_links_test.clj
@@ -4,21 +4,27 @@
             [scrape-summitpost-data.extract-result-links :as test-ns]))

 (defn- make-test-page
-  [url]
-  (let [template "

-

-

-
-
-
-
-

-

-
"]
-    (string/replace template "{}" url)))
+  [urls]
+  (let [header "

+
"
+        row-template "

+
+
+
+
+
"
+        footer "

+
"
+        rows (mapv #(string/replace row-template "{}" %) urls)
+        page (conj (cons header rows) footer)]
+    (apply str page)))

 (deftest extract-result-links-test
-  (let [page (make-test-page "/test-item-name/12345")]
-    (is (= ["/test-item-name/12345"]
-           (test-ns/extract-result-links page))
-        "extracts link to item from search results table")))
+  (let [urls ["/test1"]]
+    (is (= urls
+           (test-ns/extract-result-links (make-test-page urls)))
+        "extracts single link from search results table"))
+  (let [urls ["/test1" "/test2" "/test3"]]
+    (is (= urls
+           (test-ns/extract-result-links (make-test-page urls)))
+        "extracts multiple links from search results table")))


update at most once per second

update at most once per second

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

--- plugins/DataBrowser/src/org/micromanager/browser/core.clj
+++ plugins/DataBrowser/src/org/micromanager/browser/core.clj
@@ -747,7 +747,9 @@
     (persist-window-shape prefs "browser-shape" frame)
     (add-watch current-data "updater" (fn [_ _ old new]
                                         (when (not= old new)
-                                          (update-no-faster-than update-browser-table 1000))))
+                                          (update-no-faster-than
+                                            #(awt-event (update-browser-table))
+                                            1000))))
     (gen-map frame table scroll-pane settings-button search-field
              collection-menu refresh-button)))


Finish manga-fox site definition

Finish manga-fox site definition

--- resources/sites/manga-fox.clj
+++ resources/sites/manga-fox.clj
@@ -15,4 +15,6 @@
  :manga-url-suffix-pattern "(.*?)/"
  :comic-list-selector [:div.manga_list :ul :li :a]

- :manga-list-format "%s/manga/"}
+ :manga-list-format "%s/manga/"
+
+ :comic->url-format "%s%s/"}


properly working sidebar

properly working sidebar

--- src-cljs/mappt/components/sidebar.cljs
+++ src-cljs/mappt/components/sidebar.cljs
@@ -1,45 +1,43 @@
 (ns mappt.components.sidebar
+  (:require-macros [cljs.core.async.macros :refer [go]])
   (:require [om.core :as om :include-macros true]
             [sablono.core :as html :refer-macros [html]]
             [cljs.core.async :refer [put! chan <!]]
-            [secretary.core :as secretary]
             [mappt.style.icon :refer [gen-icon]]))

-(def navigate-channel (chan))
-
-(defn click-handler [state url name e]
-  (.log js/console "clicked!" url)
-  (om/transact! state [:sidebar :selected] #(str name))
-  (put! navigate-channel url))
-
-(defn sidebar-widget [{:keys [name url icon] :as state} owner]
+(defn sidebar-widget [{:keys [name url icon] :as data} owner]
   (reify
     om/IRenderState
-    (render-state [this {:keys [selected] :as state}]
-      (html [:div {:class "sidebar-element"
+    (render-state [this {:keys [selected select-chan] :as state}]
+      (html [:div {:class
+                   (str "sidebar-element"
+                        (when (= name selected) " selected"))
                    :on-click
                    (fn [_]
-                     (.log js/console "clicked!" name selected))}
-             [:div {:class "sidebar-icon"}]
+                     (put! select-chan name)
+                     (om/refresh! owner))}
+             [:div {:class (str "sidebar-icon")}]
              [:div {:class "sidebar-name"} name]]))))
-
-(defn gen-sidebar-element [state & {:keys [name url icon selected]
-                                    :or {name "unknown"
-                                         url "/#/"
-                                         icon ""
-                                         selected false}}]
-  [:div {:class (str "sidebar-element" (when selected " selected"))
-         :on-click (partial click-handler state url name)}
-   [:div {:class "sidebar-icon"}]
-   [:div {:class "sidebar-name"} name]])

 (defn widget [data owner]
   (reify
-    om/IRender
-    (render [this]
+    om/IInitState
+    (init-state [this]
+      {:select-chan (chan)})
+    om/IWillMount
+    (will-mount [this]
+      (let [select-chan (om/get-state owner :select-chan)]
+        (go (loop []
+              (let [selected (<! select-chan)]
+                (om/update! data [:sidebar :selected] selected)
+                (recur))))))
+    om/IRenderState
+    (render-state [this {:keys [select-chan] :as state}]
       (html [:div {:class "sidebar-navigation"}
              (om/build-all
               sidebar-widget
               (get-in data [:sidebar :buttons])
               {:init-state
+               {:select-chan select-chan}
+               :state
                {:selected (get-in data [:sidebar :selected])}})]))))


modified init-cross-hairs

modified init-cross-hairs

--- src/maqueta/hello/physics.clj
+++ src/maqueta/hello/physics.clj
@@ -106,15 +106,14 @@
   [app]
   (let [gui-node (.getGuiNode app)
         font (load-font "Interface/Fonts/Default.fnt")
-        ch (BitmapText. font false)]
+        ch (BitmapText. font false)
+        size (* 2 (.getRenderedSize (.getCharSet font)))]
     (.detachAllChildren gui-node)
     (doto ch
-      (.setSize (* 2 (.getRenderedSize (.getCharSet font))))
+      (.setSize size)
       (.setText "+")
       (.setLocalTranslation (- (/ (.getWidth *app-settings*) 2)
-                               (* 2
-                                  (/ (.getRenderedSize (.getCharSet font))
-                                     3)))
+                               (/ size 3))
                             (+ (/ (.getHeight *app-settings*) 2)
                                (/ (.getLineHeight ch) 2))
                             0))


resolve tilde paths loading synthdefs from files

--- src/overtone/sc/machinery/synthdef.clj
+++ src/overtone/sc/machinery/synthdef.clj
@@ -9,7 +9,8 @@
         [overtone.util lib]
         [overtone.libs event deps]
         [overtone.sc server]
-        [overtone.sc.machinery.server comms])
+        [overtone.sc.machinery.server comms]
+        [overtone.helpers.file :only [resolve-tilde-path]])
   (:require [overtone.util.log :as log]))

 ;; param-name is :
@@ -139,7 +140,7 @@
   (first (:synths
           (cond
            (keyword? data) (spec-read-url synthdef-file-spec (java.net.URL. (str "file:" (supercollider-synthdef-path (to-str data)))) )
-           (string? data) (spec-read-url synthdef-file-spec (java.net.URL. (str "file:" data)))
+           (string? data) (spec-read-url synthdef-file-spec (java.net.URL. (str "file:" (resolve-tilde-path data))))
            (instance? java.net.URL data) (spec-read-url synthdef-file-spec data)
            (byte-array? data) (spec-read-bytes synthdef-file-spec data)
            :default (throw (IllegalArgumentException. (str "synthdef-read expects either a string, a URL, or a byte-array argument.")))))))
@@ -231,4 +232,5 @@
 (defn load-synth-file
   "Load a synth definition file onto the audio server."
   [path]
-  (snd "/d_recv" (synthdef-bytes (synthdef-read path))))
+  (let [path (resolve-tilde-path path)]
+    (snd "/d_recv" (synthdef-bytes (synthdef-read path)))))


Scijava REPL (#15)

Scijava REPL (#15)

--- src/plugins/Scripts/Funimage/REPL_.clj
+++ src/plugins/Scripts/Funimage/REPL_.clj
@@ -1,4 +1,19 @@

-(.run (Clojure.Clojure_Interpreter.) "")
+;; This is the old Clojure REPL
+;(.run (Clojure.Clojure_Interpreter.) "")

-; Update this to use the script interpreter (possibly merge script interpreter with the script editor)
+(import '[org.scijava Context]
+        '[org.scijava.ui.swing.script InterpreterWindow]
+        '[org.scijava.script ScriptService])
+;        '[org.scijava.`object`.ObjectService
+
+(def context (Context.))
+(def interpreter-window (InterpreterWindow. context))
+
+(.show interpreter-window)
+(.lang (.getREPL interpreter-window) "Clojure")
+;(.eval (.getInterpreter interpreter-window) "(println \"Hello from Clojure\")")
+;(.print "Hello!")
+
+
+


refactoring in carousel

refactoring in carousel

--- src/cljs/iwaswhere_web/ui/entry/thumbnails.cljs
+++ src/cljs/iwaswhere_web/ui/entry/thumbnails.cljs
@@ -23,13 +23,13 @@

 (defn carousel
   "Renders react-responsive-carousel with linked images."
-  [entry linked]
-  (let [react-responsive-carousel (aget js/window "deps" "react-responsive-carousel")
-        ts (:timestamp entry)]
-    (when (seq linked)
-      (into
-        [:> react-responsive-carousel]
-        (mapv (fn [img-entry] (image-view img-entry "?width=600")) linked)))))
+  [ts linked]
+  (let [responsive-carousel (aget js/window "deps" "react-responsive-carousel")]
+    (fn [ts linked]
+      (when (seq linked)
+        (into
+          [:> responsive-carousel]
+          (mapv (fn [img-entry] (image-view img-entry "?width=600")) linked))))))

 (defn thumbnails
   "Renders thumbnails of photos in linked entries. Respects private entries."
@@ -50,4 +50,4 @@
                        (filter (u/pvt-filter @options @entries-map) with-imgs))]
         (when-not entry-active?
           [:div.thumbnails
-           [carousel entry filtered]])))))
+           [carousel ts filtered]])))))


Cosmetics

Cosmetics

--- src/clojure/clojurewerkz/cassaforte/metrics.clj
+++ src/clojure/clojurewerkz/cassaforte/metrics.clj
@@ -18,9 +18,9 @@
 (defn console-reporter
   [^Session client]
   (let [registry (-> client
-                     (.getCluster)
-                     (.getMetrics)
-                     (.getRegistry))]
+                     .getCluster
+                     .getMetrics
+                     .getRegistry)]
     (ConsoleReporter/enable registry 1000 TimeUnit/SECONDS)))

 (defn csv-reporter


Fix negative RTT issue

Fix negative RTT issue

The root cause behind this part of the problem in the past few (?)
commits was checking for < instead of >.

--- src/clojure/frereth_cp/message/flow_control.clj
+++ src/clojure/frereth_cp/message/flow_control.clj
@@ -22,7 +22,7 @@
     :as state}
    ackd-time]
   (let [rtt (- recent ackd-time)]
-    (when (< 0 rtt)
+    (when (> 0 rtt)
       ;; I'm getting into scenarios with negative RTT, which
       ;; seems to have something to do with math overflow
       ;; warnings. That seems to be breaking things.
@@ -38,7 +38,7 @@
       ;; doesn't sound like something a library should mess
       ;; with. Although it might make sense in terms of unit
       ;; testing.
-      (throw (ex-info "ACK arrived before recent"
+      (throw (ex-info "ACK arrived after recent"
                       {::specs/recent recent
                        ::ackd-time ackd-time
                        ::delta rtt})))


[#12329] No redirect to 1-1 chat when starting chat via "Chat" button in profile

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

--- src/status_im/navigation.cljs
+++ src/status_im/navigation.cljs
@@ -12,13 +12,12 @@

 (fx/defn navigate-to-cofx
   [{:keys [db]} go-to-view-id screen-params]
-  (when (not= go-to-view-id (:view-id db))
-    {:db
-     (-> (assoc db :view-id go-to-view-id)
-         (all-screens-params go-to-view-id screen-params))
-     :navigate-to-fx              go-to-view-id
-     ;; simulate a navigate-to event so it can be captured be anon-metrics
-     ::anon-metrics/transform-and-log {:coeffects {:event [:navigate-to go-to-view-id screen-params]}}}))
+  {:db
+   (-> (assoc db :view-id go-to-view-id)
+       (all-screens-params go-to-view-id screen-params))
+   :navigate-to-fx              go-to-view-id
+   ;; simulate a navigate-to event so it can be captured be anon-metrics
+   ::anon-metrics/transform-and-log {:coeffects {:event [:navigate-to go-to-view-id screen-params]}}})

 (fx/defn navigate-to
   {:events [:navigate-to]}


add nested steps

add nested steps

--- backend/test/lambdaui/testpipeline/simple_pipeline.clj
+++ backend/test/lambdaui/testpipeline/simple_pipeline.clj
@@ -2,8 +2,10 @@
   (:use [compojure.core])
   (:require [lambdacd.steps.shell :as shell]
             [lambdacd.steps.manualtrigger :refer [wait-for-manual-trigger]]
-            [lambdacd.steps.control-flow :refer [either with-workspace in-parallel run]]
-            [lambdacd.steps.support :refer [capture-output]]))
+            [lambdacd.steps.control-flow :refer [either with-workspace in-parallel run] :as step]
+            [lambdacd.steps.support :refer [capture-output]]
+
+            ))

 (def repo "https://github.com/flosell/testrepo.git")

@@ -21,6 +23,9 @@
   (println x)
   x)

+(defn successfullStep [args ctx]
+  {:status :success :out "Wohoo!"})
+
 (defn a-lot-output [args context]
   (shell/bash context (:cwd args) "for i in {1..200}; do echo \"Outputline ${i}\"; done")
   )
@@ -36,6 +41,13 @@
 (def pipeline-structure
   `( wait-for-manual-trigger
      a-lot-output
-     different-status
+     (step/alias "i have substeps"
+            (run successfullStep
+                 successfullStep
+                 (step/alias "i have more substeps"
+                        (run a-lot-output
+                             different-status))
+                 a-lot-output)
+            )
      long-running-task-20s
      ))


Cosmetic fixes on images ns on frontend module.

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

 (defn list-images
   [{user :identity route-params :route-params}]
-  (let [params {:collection (uuid/from-string (:id route-params)) :user user :type :list/images}
+  (let [params {:collection (uuid/from-string (:id route-params))
+                :user user
+                :type :list/images}
         thumbnail-opts +thumbnail-options+
         populate-thumbnails-url #(images/populate-thumbnails % thumbnail-opts)]
     (-> (sv/query params)


Remove comments

Remove comments

--- src/videotest/coral/coral.clj
+++ src/videotest/coral/coral.clj
@@ -4,11 +4,6 @@
    [videotest.coral.color :as color]
    [videotest.coral.hex :as hex]))

-
-;; Should have a chance to attach, when:
-;; - at bottom,
-;; - run into existing coral,
-;; -

 ;; (def NUM-CORAL-COL-BINS 64.0)
 ;; (def HEX-W 10.0)


Here we go, we display everything!

Here we go, we display everything!

--- src/app/cljs/one/sample/animation.cljs
+++ src/app/cljs/one/sample/animation.cljs
@@ -37,8 +37,7 @@

 ;; ------------- fnx -------------

-(comment
-  (defn initialize-views-fnx
+(defn initialize-views-fnx
   "Accepts the form and greeting view HTML and adds them to the
   page. Animates the form sliding in from above. This function must be
   run before any other view functions. It may be called from any state
@@ -49,13 +48,9 @@
     (set-html! content-fnx ns-nav)
     (append! content-fnx fn-display)
     (append! content-fnx spinner)
-    (set-styles! (by-id "ns-nav") {:display "none"})
-    (set-styles! (by-id "fn-display") {:display "none"})
-    (set-styles! (by-id "spinner") {:display "block"}))))
-
-(defn initialize-views-fnx
-  [ns-nav fn-display spinner]
-    (js/alert (str ns-nav fn-display spinner)))
+    (set-styles! (by-id "ns-nav") {:display "block"})
+    (set-styles! (by-id "fn-display") {:display "block"})
+    (set-styles! (by-id "spinner") {:display "block"})))

 ;; ------------- fnx -------------


Refactoring game area locator

Refactoring game area locator

--- src/bejeweled_bot/gamearea_locator.clj
+++ src/bejeweled_bot/gamearea_locator.clj
@@ -22,17 +22,21 @@
    (byte (- (bit-shift-right (bit-and int-val 0x00ff0000) 16) 128))])
    ;(byte (bit-shift-right int-val 24))]) ; we don't use alpha

+(defn get-image-matrix []
+  (let
+    [robo (Robot.)
+     screenshot (.createScreenCapture robo (Rectangle. (.getScreenSize (Toolkit/getDefaultToolkit))))
+     image-ints (mat-from-buffer screenshot)
+     image-bytes (byte-array (mapcat int-to-bytes image-ints))
+     sourceImg (Mat. (.getWidth screenshot) (.getHeight screenshot) CvType/CV_8UC3)]
+    (.put sourceImg 0 0 image-bytes)
+    sourceImg))
+
 (defn find-area
   "Finds left upper corner of board area"
   []
-  ;(def sourceImg (Highgui/imread "resources/whole.png"))
-  (def robo (Robot.))
-  (def screenshot (.createScreenCapture robo (Rectangle. (.getScreenSize (Toolkit/getDefaultToolkit)))))
-  (def image-ints (mat-from-buffer screenshot))
-  (def image-bytes (byte-array (mapcat int-to-bytes image-ints)))
-  (def sourceImg (Mat. (.getWidth screenshot) (.getHeight screenshot) CvType/CV_8UC3))
-  (.put sourceImg 0 0 image-bytes)
-
+  ;Too damn many defs!
+  (def sourceImg (get-image-matrix))
   (def targetArea (Highgui/imread "resources/area.png"))
   (def targetCols (.cols targetArea))
   (def targetRows (.rows targetArea))
@@ -40,13 +44,8 @@
   (def rows (+ (- (.rows sourceImg) targetRows) 1))
   (def result (Mat.))
   (.create result rows, cols, CvType/CV_32FC1)
-  ;(def displayImg (Mat.))
-  ;(.copyTo sourceImg displayImg)
-  (Imgproc/matchTemplate sourceImg targetArea result Imgproc/TM_CCOEFF_NORMED)
-  ;(Imgproc/matchTemplate sourceImg targetArea result Imgproc/TM_CCORR_NORMED)
-  ;(def threshold 0.8)
+  (Imgproc/matchTemplate sourceImg targetArea result Imgproc/TM_CCOEFF_NORMED) ;or Imgproc/TM_CCORR_NORMED
   (Core/normalize result result 0 255 Core/NORM_MINMAX -1 (Mat.))
-  ;(Highgui/imwrite "resources/output.png" result)

   (def floatArr (make-array Float/TYPE (.total result)))
   (.get result 0 0 floatArr)


Don't need to wrap subscribe with fn

Don't need to wrap subscribe with fn

--- src/braid/client/ui/views/sidebar.cljs
+++ src/braid/client/ui/views/sidebar.cljs
@@ -53,10 +53,9 @@

 (defn badge-view [group-id]
   (let [cnt (subscribe [:group-unread-count group-id])]
-    (fn []
-      (if (and @cnt (> @cnt 0))
-        [:div.badge @cnt]
-        [:div]))))
+    (if (and @cnt (> @cnt 0))
+      [:div.badge @cnt]
+      [:div])))

 (defn groups-view []
   (let [active-group (subscribe [:active-group])


Use onyx curator

Use onyx curator

--- src/clj/onyx_dashboard/http/server.clj
+++ src/clj/onyx_dashboard/http/server.clj
@@ -14,7 +14,7 @@
             [compojure.route :as route]
             [com.stuartsierra.component :as component]
             [onyx-dashboard.onyx-deployment :as od]
-            [zookeeper :as zk]
+            [onyx.log.curator :as zk]
             [taoensso.timbre :as timbre :refer [info error spy]]))

 (deftemplate page


small refinements

small refinements

--- src/cljs/clj_money/views/accounts.cljs
+++ src/cljs/clj_money/views/accounts.cljs
@@ -269,7 +269,7 @@

 (defn- item-row
   [item]
-  ^{:key (:id item)}
+  ^{:key (str "item-row-" (:id item))}
   [:tr
    [:td.text-right (util/format-date (:transaction-date item))]
    [:td (:description item)]
@@ -391,7 +391,9 @@
                     :icon :ok
                     :title "Click here to save the transaction"})]]))

-(defn- show-account [id]
+(defn- show-account
+  [id]
+  (reset! transaction-items nil)
   (accounts/get-all (:id @state/current-entity)
                     #(reset! *accounts* (-> % nest unnest))
                     notify/danger)


Comment out code for exporting history animation

--- src/cljs/goya/components/mainmenu.cljs
+++ src/cljs/goya/components/mainmenu.cljs
@@ -87,30 +87,30 @@
     (set! (.-href download-link) (.createObjectURL js/URL blob))
     (.click download-link)))

-(defn export-history-animation [owner]
-  (let [render-canvas (. js/document (createElement "canvas"))
-        max-width 64
-        max-height 64
-        zoom-factor 2
-        app-history @timemachine/app-history
-        gif (js/GIF. #js {:workers 2
-                          :quality 10
-                          :width (* max-width zoom-factor)
-                          :height (* max-height zoom-factor)
-                          :workerScript "./gifjs/dist/gif.worker.js"})]
-    (om/set-state! owner :is-processing true)
-    (om/set-state! owner :progress 0)
-    (dotimes [x (count app-history)]
-      (let [history-snapshot (nth app-history x)
-            width (get-in history-snapshot [:canvas-width])
-            height (get-in history-snapshot [:canvas-height])
-            image-data (get-in history-snapshot [:image-data])
-            context (.getContext render-canvas "2d")]
-        (canvasdrawing/draw-image-to-canvas image-data render-canvas width height zoom-factor)
-        (.addFrame gif context #js {:copy true :delay 300})))
-    (.on gif "finished" #(download-history-animation % owner))
-    (.on gif "progress" #(show-progress % owner))
-    (.render gif)))
+;; (defn export-history-animation [owner]
+;;   (let [render-canvas (. js/document (createElement "canvas"))
+;;         max-width 64
+;;         max-height 64
+;;         zoom-factor 2
+;;         app-history @timemachine/app-history
+;;         gif (js/GIF. #js {:workers 2
+;;                           :quality 10
+;;                           :width (* max-width zoom-factor)
+;;                           :height (* max-height zoom-factor)
+;;                           :workerScript "./gifjs/dist/gif.worker.js"})]
+;;     (om/set-state! owner :is-processing true)
+;;     (om/set-state! owner :progress 0)
+;;     (dotimes [x (count app-history)]
+;;       (let [history-snapshot (nth app-history x)
+;;             width (get-in history-snapshot [:canvas-width])
+;;             height (get-in history-snapshot [:canvas-height])
+;;             image-data (get-in history-snapshot [:image-data])
+;;             context (.getContext render-canvas "2d")]
+;;         (canvasdrawing/draw-image-to-canvas image-data render-canvas width height zoom-factor)
+;;         (.addFrame gif context #js {:copy true :delay 300})))
+;;     (.on gif "finished" #(download-history-animation % owner))
+;;     (.on gif "progress" #(show-progress % owner))
+;;     (.render gif)))

 (defn export-animation [owner]
@@ -195,7 +195,7 @@
             (when (= command :export-doc) (export-image))
             (when (= command :export-spritesheet) (export-spritesheet))
             (when (= command :export-animation) (export-animation origin-owner))
-            (when (= command :export-history-animation) (export-history-animation origin-owner))
+;;             (when (= command :export-history-animation) (export-history-animation origin-owner))
           (recur))))))

     om/IRenderState


bug #6261 - removed blue dot from outgoing payment messages

Signed-off-by: Julien Eluard <c768e13f1ba4c3ebed2909a1fc1e4b50bb021a2f@gmail.com>

--- src/status_im/chat/commands/impl/transactions/styles.cljs
+++ src/status_im/chat/commands/impl/transactions/styles.cljs
@@ -80,7 +80,7 @@

 (defn command-amount-currency-separator [outgoing]
   {:opacity 0
-   :color   colors/white})
+   :color   (if outgoing colors/blue colors/white)})

 (defn command-send-currency-text [outgoing]
   {:font-size      22


Check for no user-id for anonymous reads of public boards before looking for user fave reactions.

--- src/oc/storage/api/boards.clj
+++ src/oc/storage/api/boards.clj
@@ -41,7 +41,7 @@
   ([conn {interactions :interactions} org-id user-id]
   (let [entry-reactions (filter :reaction interactions) ; reactions on the entry
         ;; user's favorite reactions if we need them
-        user-faves (if (< (count entry-reactions) config/max-favorite-reaction-count)
+        user-faves (if (and user-id (< (count entry-reactions) config/max-favorite-reaction-count))
                       (concat entry-reactions (map #(hash-map :reaction %) (reaction-res/user-favorites conn user-id)))
                       entry-reactions)
         ; org's favorite reactions if we need them


Fix digest api.

Fix digest api.

--- src/oc/storage/api/digest.clj
+++ src/oc/storage/api/digest.clj
@@ -31,7 +31,7 @@
         unfollow-limit (- limit (count following-data))
         follow-unfollowing-data (assoc follow-data :unfollowing true)
         load-unfollow? (and (pos? unfollow-limit)
-                            (seq (:unfollow-board-uuids)))
+                            (seq (:unfollow-board-uuids follow-data)))
         unfollowing-data (if load-unfollow?
                            (activity-res/paginated-entries-for-digest conn (:uuid org) :desc start direction unfollow-limit (vals boards-by-uuid) follow-unfollowing-data {})
                            [])


Added simple backwards time travel

Added simple backwards time travel

--- src/divergence/system/time_travel.cljs
+++ src/divergence/system/time_travel.cljs
@@ -15,13 +15,13 @@
 (defn get-prev-node [timestream [timeline time]]
   (get-in timestream [timeline time :prev-node]))

-(defn reverse-time [timestream timeline time-left-in-timeline rewind-time]
+(defn reverse-time [timestream [timeline time-left-in-timeline] rewind-time]
   (if (> time-left-in-timeline rewind-time)
     [timeline (- time-left-in-timeline rewind-time)]
     (let [[prev-timeline prev-time] (get-in timestream [timeline 0 :prev-node])]
       (println "prev node is" [prev-timeline prev-time])
       (println "rewind" rewind-time)
-      (reverse-time timestream prev-timeline prev-time (- rewind-time time-left-in-timeline)))))
+      (reverse-time timestream [prev-timeline prev-time] (- rewind-time time-left-in-timeline)))))

 (defn end-node-in-time?
   "true if it's the last node on a timeline"
@@ -33,15 +33,18 @@

 (defn save-entities-to-timestream! [timestream-entity entities]
-  (let [{:keys [timestream timeline prev-node]} (:timestream @timestream-entity)]
-    (swap! timestream-entity
-           assoc-in [:timestream :timestream]
-           (conj-to-timestream timestream timeline prev-node (mapv deref entities)))))
+  (let [{:keys [prev-node timeline]} (:timestream @timestream-entity)]
+    (when (get-in @timestream-entity [:timestream :traveled-back])
+      (swap! timestream-entity assoc-in [:timestream :traveled-back] false)
+      (swap! timestream-entity assoc-in [:timestream :prev-node] [(inc timeline) 0])
+      (swap! timestream-entity update-in [:timestream :timeline] inc))
+    (let [{:keys [timestream timeline traveled-back]} (:timestream @timestream-entity)]
+      (swap! timestream-entity
+             assoc-in [:timestream :timestream]
+             (conj-to-timestream timestream timeline prev-node (mapv deref entities))))))

 (defn update-prev-node! [timestream-entity]
   (swap! timestream-entity update-in [:timestream :prev-node 1] inc))
-
-

 (def once (atom true))

@@ -57,17 +60,19 @@
       (let [{:keys [timestream timeline prev-node]} (:timestream @timestream-entity)
             time (count (timestream timeline))
             time-flux-capacitor-value 1
-            base-node (reverse-time timestream timeline time time-flux-capacitor-value)
+            base-node (reverse-time timestream prev-node time-flux-capacitor-value)
             old-entity (first (:value (get-in timestream base-node)))]
-        (println "prev-node is" prev-node)
         (println "timeline is" timeline)
         (println "time is" timeline)
+        (println "prev-node is" prev-node)
         (println "base node is" base-node)

         (when old-entity
           (reset! player-entity old-entity)
-          (swap! timestream-entity update-in [:timestream :timeline] inc)
-          (swap! timestream-entity assoc-in [:timestream :timestream (inc timeline)] [{:prev-node ((get-in timestream base-node) :prev-node) :value [old-entity]}])
+          (swap! timestream-entity assoc-in [:timestream :traveled-back] true)
+          #_(swap! timestream-entity assoc-in [:timestream :timeline] (first base-node))
+          #_(swap! timestream-entity assoc-in [:timestream :time] (second base-node))
+          #_(swap! timestream-entity assoc-in [:timestream :timestream (inc timeline)] [{:prev-node ((get-in timestream base-node) :prev-node) :value [old-entity]}])
           (swap! timestream-entity assoc-in [:timestream :prev-node] base-node))
         ))))


Using the Named protocol

Using the Named protocol

--- src/app/javaparser.clj
+++ src/app/javaparser.clj
@@ -3,11 +3,13 @@
 (import japa.parser.ast.Node)
 (import japa.parser.ast.body.ClassOrInterfaceDeclaration)
 (import japa.parser.ast.body.EnumDeclaration)
+(import japa.parser.ast.body.EnumConstantDeclaration)
 (import japa.parser.ast.body.ConstructorDeclaration)
 (import japa.parser.ast.body.FieldDeclaration)
 (import japa.parser.ast.body.MethodDeclaration)
+(import japa.parser.ast.body.ModifierSet)
 (import japa.parser.ast.body.TypeDeclaration)
-(import japa.parser.ast.body.ModifierSet)
+(import japa.parser.ast.body.VariableDeclaratorId)

 ; ============================================
 ; Parsing
@@ -150,15 +152,24 @@
     (.getName this)))

 (extend-protocol Named
+  EnumConstantDeclaration
+  (getName [this]
+    (.getName this)))
+
+(extend-protocol Named
+  MethodDeclaration
+  (getName [this]
+    (.getName this)))
+
+(extend-protocol Named
+  VariableDeclaratorId
+  (getName [this]
+    (.getName this)))
+
+(extend-protocol Named
   SingleFieldDeclaration
   (getName [this]
     (getName (.getId (.variable this)))))
-
-(defn getName [el]
-  (if
-    (map? el)
-    (.getName (.getId (:variable el)))
-    (.getName el)))

 (defn typeQname [cl]
   (let


誤字を修正

誤字を修正

--- src/ghostly/momonga/guikit/widgets.clj
+++ src/ghostly/momonga/guikit/widgets.clj
@@ -393,7 +393,7 @@
         :subcategory nil
         :added "0.1" }
   control-font
-  "コントロールのフォントを帰します。"
+  "コントロールのフォントを返します。"
   [a_control]
   (.getFont a_control))

@@ -413,7 +413,7 @@
         :subcategory nil
         :added "0.1" }
   control-parent
-  "古ントロールの親を返します。"
+  "コントロールの親を返します。"
   [a_control]
   (.getParent a_control))


+require babel.english.grammar :as grammar

--- src/babel/english.cljc
+++ src/babel/english.cljc
@@ -4,10 +4,11 @@
    [dag_unify.core :refer (fail-path get-in unifyc)]
    [babel.engine :as engine]
    [babel.generate :as generate]
-   [babel.english.grammar :refer [medium np-grammar
-                                  small-lexicon small-plus-vp-pronoun
-                                  small-plus-plus-np
-                                  verbcoach]]
+   [babel.english.grammar :as grammar
+    :refer [medium np-grammar
+            small-lexicon small-plus-vp-pronoun
+            small-plus-plus-np
+            verbcoach]]
    [babel.english.morphology :as morph :refer [fo]]
    [babel.over :refer [over truncate]]
    [babel.parse :as parse]


changing name to scrollfader

changing name to scrollfader

--- dmmproj/src/dmm/examples/jul_6_2017_experiment.cljs
+++ dmmproj/src/dmm/examples/jul_6_2017_experiment.cljs
@@ -1,121 +0,0 @@
-(ns dmm.examples.jul-6-2017-experiment
-  (:require [quil.core :as q :include-macros true]
-            [quil.middleware :as m]
-            [dmmproj.widgets :as wid]
-            [dmm.core :as dc
-                      :refer [v-accum v-identity
-                              down-movement up-movement
-                              rec-map-sum]]))
-
-(defn init-state []
-  (->
-   {:init-matrix
-    {v-accum {:self {:accum {v-accum {:self {:single 1}}}}}}}
-
-   ((fn[m]
-      (assoc m :update-1-matrix-hook
-             {v-identity
-              {:update-1 {:single {v-identity {:update-1 {:single 1}}}}}}
-
-             :update-2-matrix-hook
-             {v-identity
-              {:update-2 {:single {v-identity {:update-2 {:single 1}}}}}}
-
-             :update-3-matrix-hook
-             {v-identity
-              {:update-3 {:single {v-identity {:update-3 {:single 1}}}}}}
-
-             :start-update-of-network-matrix
-             {v-accum {:self {:delta {v-identity {:update-1 {:single 1}}}}}})))
-
-   ((fn[m]
-      (assoc m :start-matrix
-             (rec-map-sum
-              (m :init-matrix)
-              (m :update-1-matrix-hook)
-              (m :update-2-matrix-hook)
-              (m :update-3-matrix-hook)
-              (m :start-update-of-network-matrix)))))
-
-
-   ((fn[m]
-      (assoc m
-             :update-1-matrix
-             (rec-map-sum
-              {v-accum {:self {:delta {v-identity {:update-1 {:single -1}}}}}}
-              {v-accum {:self {:delta {v-identity {:update-2 {:single 1}}}}}})
-
-             :update-2-matrix
-             (rec-map-sum
-              {v-accum {:self {:delta {v-identity {:update-2 {:single -1}}}}}}
-              {v-accum {:self {:delta {v-identity {:update-3 {:single 1}}}}}})
-
-             :update-3-matrix
-             (rec-map-sum
-              {v-accum {:self {:delta {v-identity {:update-3 {:single -1}}}}}}
-              {v-accum {:self{:delta {v-identity {:update-1 {:single 1}}}}}}))))
-
-   ((fn[m]
-      (assoc m :init-output
-             (rec-map-sum
-              {v-accum {:self {:single (m :start-matrix)}}}
-              {v-identity {:update-1 {:single (m :update-1-matrix)}}}
-              {v-identity {:update-2 {:single (m :update-2-matrix)}}}
-              {v-identity {:update-3 {:single (m :update-3-matrix)}}}))))))
-
-(def state (atom (init-state)))
-
-
-(defn setup []
-  ; Set frame rate to 4 frames per second.
-  (q/frame-rate (@wid/app-state :frame-rate))
-  ; setup function returns initial state. It contains
-  ; the initial output layer of the generalized neural network.
-  {:output-layer (@state :init-output)
-   })
-
-(defn update-state [state]
-  ;; Update sketch state by performing one cycle of the "two-stroke engine"
-  ;; of the generalized neural network.
-  (q/frame-rate (@wid/app-state :frame-rate))
-  (let [current-input (down-movement (:output-layer state))]
-    {:input-layer current-input
-     :output-layer (up-movement current-input)
-     }))
-
-
-(defn extract-matrix [current-output]
-  (((current-output v-accum) :self) :single))
-
-(defn extract-delta [current-output]
-  ((((extract-matrix current-output) v-accum) :self) :delta))
-
-
-(defn draw-state [state]
-  ;; Clear the sketch by filling it with grey color.
-  ;; (q/background 127)
-  (q/fill 127 50)
-  (q/rect 0 0 (q/width) (q/height))
-  (q/fill 0)
-
-  (q/text-size 24)
-
-  (let [sub-delta-row (->> state :output-layer extract-delta)]
-    (q/text (str (q/frame-count) " " sub-delta-row)
-            50  (mod (+ 50 (* 25 (q/frame-count))) (q/height)))))
-
-
-(q/defsketch quil-sketch
-  ;;:title "A Quil-controlled DMM"
-  :host "quil-try"
-  :size [500 500]
-  ;; setup function called only once, during sketch initialization.
-  :setup setup
-  ;; update-state is called on each iteration before draw-state.
-  :update update-state
-  :draw draw-state
-  ;;:features [:keep-on-top]
-  ;; This sketch uses functional-mode middleware.
-  ;; Check quil wiki for more info about middlewares and particularly
-  ;; fun-mode.
-  :middleware [m/fun-mode])