Use unique etherscan key

Use unique etherscan key

--- src/status_im/utils/transactions.cljs
+++ src/status_im/utils/transactions.cljs
@@ -2,6 +2,8 @@
   (:require [status-im.utils.utils :as utils]
             [status-im.utils.types :as types]
             [status-im.utils.money :as money]))
+
+(def etherscan-api-key "DMSI4UAAKUBVGCDMVP3H2STAMSAUV7BYFI")

 (defn get-network-subdomain [network]
   (case network
@@ -16,7 +18,7 @@
 (defn get-transaction-url [network account]
   (let [network-subdomain (get-network-subdomain network)]
     (str "https://" network-subdomain ".etherscan.io/api?module=account&action=txlist&address=0x"
-         account "&startblock=0&endblock=99999999&sort=desc&apikey=YourApiKeyToken?q=json")))
+         account "&startblock=0&endblock=99999999&sort=desc&apikey=" etherscan-api-key "?q=json")))

 (defn- format-transaction [account {:keys [value timeStamp blockNumber hash from to gas gasPrice gasUsed nonce confirmations input]}]
   (let [inbound?    (= (str "0x" account) to)]


just about have SGD there... one more function

--- src/thinktopic/cortex/autoencoder.clj
+++ src/thinktopic/cortex/autoencoder.clj
@@ -62,11 +62,29 @@
       activation)))

 ;; Gradient descent
+
+(defn backprop
+  [{:keys [biases weights] :as net} input label]
+  )
+
+
 (defn update-mini-batch
   [{:keys [biases weights] :as net} learning-rate data labels batch]
   (let [bias-gradients (map #(mat/zero-array (mat/shape %)) biases)
-        weight-gradients (map #(mat/zero-array (mat/shape %)) weights)]
-    ))
+        weight-gradients (map #(mat/zero-array (mat/shape %)) weights)
+        batch-size (count batch)
+        batch-rate (/ learning-rate batch-size)
+        [bias-gradients weight-gradients] (reduce
+                                            (fn [[bias-gradients weight-gradients] sample-index]
+                                              (let [[bias-deltas weight-deltas] (backprop net (mat/get-row data) (mat/get-row labels))
+                                                    bias-gradients (map mat/add! bias-gradients bias-deltas)
+                                                    weight-gradients (map mat/add! weight-gradients weight-deltas)]
+                                                [bias-gradients weight-gradients]))
+                                            [bias-gradients weight-gradients]
+                                            batch)
+        biases (map (fn [b nb] (mat/sub! b (mat/mul batch-rate nb))) biases bias-gradients)
+        weights (map (fn [w nw] (mat/sub! w (mat/mul batch-rate nw))) weights weight-gradients)]
+    (assoc net :biases biases :weights weights)))

 (defn sgd
   [net {:keys [learning-rate learning-rate-decay momentum n-epochs batch-size] :as config} training-data training-labels]


backpropping...

backpropping...

--- src/thinktopic/cortex/autoencoder.clj
+++ src/thinktopic/cortex/autoencoder.clj
@@ -10,9 +10,17 @@
   [z]
   (/ 1.0  (+ 1.0 (Math/exp (- z)))))

+(defn mat-sigmoid
+  [z]
+  (mat/emap sigmoid z))
+
 (defn sigmoid-prime
   [z]
   (* (sigmoid z) (- 1 (sigmoid z))))
+
+(defn mat-sigmoid-prime
+  [z]
+  (mat/emap sigmoid-prime z))

 ;; K-sparse autoencoder
 ;0) setup
@@ -78,12 +86,37 @@
                                [(conj activations activation) (conj zs z)]))
                            [[input] []]
                            (map vector biases weights))
+
+        ; # backward pass
+        ;delta = self.cost_derivative(activations[-1], y) * \
+        ;    sigmoid_prime(zs[-1])
+        ;nabla_b[-1] = delta
+        ;nabla_w[-1] = np.dot(delta, activations[-2].transpose())
+        ;# Note that the variable l in the loop below is used a little
+        ;# differently to the notation in Chapter 2 of the book.  Here,
+        ;# l = 1 means the last layer of neurons, l = 2 is the
+        ;# second-last layer, and so on.  It's a renumbering of the
+        ;# scheme in the book, used here to take advantage of the fact
+        ;# that Python can use negative indices in lists.
+        ;for l in xrange(2, self.num_layers):
+        ;    z = zs[-l]
+        ;    sp = sigmoid_prime(z)
+        ;    delta = np.dot(self.weights[-l+1].transpose(), delta) * sp
+        ;    nabla_b[-l] = delta
+        ;    nabla_w[-l] = np.dot(delta, activations[-l-1].transpose())
+        ;return (nabla_b, nabla_w)
+
+
         cost-derivs (mat/sub (last activations) label)
-        output-deltas (mat/emul cost-derivs (mat/emap sigmoid-prime (last zs)))
+        output-deltas (mat/emul cost-derivs (mat-sigmoid-prime (last zs)))
         output-bias-gradients output-deltas
         output-weight-gradients (mat/mmul output-deltas (mat/transpose (last (drop-last activations))))
-        ]
-    ))
+        [bias-deltas weight-deltas]
+        (reduce
+          (fn []
+            )
+          [(next (reverse weights)) (next (reverse activations))]
+          )]))

 (defn update-mini-batch
@@ -92,14 +125,15 @@
         weight-gradients (map #(mat/zero-array (mat/shape %)) weights)
         batch-size (count batch)
         batch-rate (/ learning-rate batch-size)
-        [bias-gradients weight-gradients] (reduce
-                                            (fn [[bias-gradients weight-gradients] sample-index]
-                                              (let [[bias-deltas weight-deltas] (backprop net (mat/get-row data) (mat/get-row labels))
-                                                    bias-gradients (map mat/add! bias-gradients bias-deltas)
-                                                    weight-gradients (map mat/add! weight-gradients weight-deltas)]
-                                                [bias-gradients weight-gradients]))
-                                            [bias-gradients weight-gradients]
-                                            batch)
+        [bias-gradients weight-gradients]
+        (reduce
+          (fn [[bias-gradients weight-gradients] sample-index]
+            (let [[bias-deltas weight-deltas] (backprop net (mat/get-row data) (mat/get-row labels))
+                  bias-gradients (map mat/add! bias-gradients bias-deltas)
+                  weight-gradients (map mat/add! weight-gradients weight-deltas)]
+              [bias-gradients weight-gradients]))
+          [bias-gradients weight-gradients]
+          batch)
         biases (map (fn [b nb] (mat/sub! b (mat/mul batch-rate nb))) biases bias-gradients)
         weights (map (fn [w nw] (mat/sub! w (mat/mul batch-rate nw))) weights weight-gradients)]
     (assoc net :biases biases :weights weights)))


implement extract-content for smb-fs

implement extract-content for smb-fs

--- src/brainbot/nozzle/smb_fs.clj
+++ src/brainbot/nozzle/smb_fs.clj
@@ -1,6 +1,7 @@
 (ns brainbot.nozzle.smb-fs
   (:require
    [clojure.string :as string])
+  (:require [brainbot.nozzle.extract :refer [convert]])
   (:require [brainbot.nozzle.vfs :as vfs]
             [brainbot.nozzle.misc :as misc])
   (:import [jcifs.smb SmbFile NtlmPasswordAuthentication SID ACE]))
@@ -38,6 +39,12 @@

 (defrecord SmbFilesystem [root auth]
   vfs/Filesystem
+  (extract-content [fs entry]
+    (let [smb-file (smb-file-for-entry fs entry)]
+      (with-open [in (.getInputStream smb-file)]
+        {:tika-content (convert in)})))
+
+
   (get-permissions [fs entry]
     (let [smb-file (smb-file-for-entry fs entry)
           acl (seq (.getSecurity smb-file true))]


Coffeescream

Coffeescream

--- src/clj/mokkameister/train.clj
+++ src/clj/mokkameister/train.clj
@@ -45,6 +45,7 @@
    (train ":coffee:" ":nuclear:")
    (train ":coffee:" ":timwendelboe:")
    (train ":coffee:" ":jan-richter:")
+   (train ":coffee:" ":scream:")
    (train ":syringe:" ":hocho:")
    (train ":coffee:" ":heavy_heart_exclamation_mark_ornament:")
    (train ":coffee:" ":badger:" ":mushroom:")


Simplify + bug fix

Simplify + bug fix

--- src/cljs/underground/core.cljs
+++ src/cljs/underground/core.cljs
@@ -20,9 +20,6 @@
 (def gen-id (atom 0))
 (def origin (atom nil))
 (def positions (atom {}))
-; (def positions (atom {:1 {:x 400 :y 200 :md "# hi there" :html "
hi there
"}
-;                       :2 {:x 400 :y 400 :md "# you" :html "
you
"}
-;                       }))

 (def statenames {:genid gen-id
@@ -94,39 +91,27 @@
              :top (-> @menu-position :y (- 80))}}
     [:a [:li {:on-click reset-menu-position
               } "Arrow"]]
-    ; [:a
-    ;  [:li "New"]]
-    ; [:a [:li {:id :hoveritem
-    ;           :on-mouse-leave #(js/removeclasshoveritem)
-    ;           :on-mouse-move #(js/removeclasshoveritem)
-    ;           :on-click reset-menu-position
-    ;           } "New"]]
     [:a [:li {:id :hoveritem
               :on-click #(let [my (.-clientY %)
-                               mx (.-clientX %)]
+                               mx (.-clientX %)
+                               {ox :x oy :y} @origin
+                               x (- mx ox)
+                               y (- my oy)]
                            (reset-menu-position)
                            (swap! gen-id inc)
                            (swap! positions assoc
                                   (-> @gen-id str keyword)
-                                  {:x mx :y my :md "## placeholder" :html "
placeholder
"})
+                                  {:x x :y y :md "## placeholder" :html "
placeholder
"})
                            )
               :on-mouse-leave #(js/removeclasshoveritem)
               :on-mouse-move #(js/removeclasshoveritem)
-              ; :on-click reset-menu-position
               } "New"]]
-    ; [:a [:li {:on-click network-get-state
-    ;           } "Load"]]
-    ; [:a [:li "Export"]]
     (if @clicked-note
       [:a [:li {:on-click (fn [e]
                             (swap! positions dissoc @clicked-note)
                             (reset-menu-position)
                             )
                 } "Delete"]])
-    [:a [:li {:on-click reset-menu-position
-              } "Export"]]
-    [:a [:li {:on-click reset-menu-position
-              } "Import"]]
     ])


WIP: The load balancer will continue until one request goes through or all services exhausted

--- src/clojure/fault/patterns.clj
+++ src/clojure/fault/patterns.clj
@@ -1,6 +1,6 @@
 (ns fault.patterns
   (:require [fault.core :as core])
-  (:import (fault ServiceExecutor)))
+  (:import (fault ServiceExecutor RejectedActionException)))

 (set! *warn-on-reflection* true)

@@ -19,14 +19,18 @@
                                                (iterate next-fn start-idx)))))))

 (defn submit-load-balanced-action [load-balancer key->fn timeout-millis]
-  (let [[key {:keys [service]}] (load-balancer)]
-    (core/submit-action ^ServiceExecutor service
-                        (get key->fn key)
-                        timeout-millis)))
+  (some (fn [[key {:keys [service]}]]
+          (try (core/submit-action ^ServiceExecutor service
+                                   (get key->fn key)
+                                   timeout-millis)
+               (catch RejectedActionException _ nil)))
+        (load-balancer)))

 (defn perform-load-balanced-action [load-balancer key->fn]
-  (let [[key {:keys [service]}] (load-balancer)]
-    (core/perform-action service (get key->fn key))))
+  (some (fn [[key {:keys [service]}]]
+          (try (core/perform-action service (get key->fn key))
+               (catch RejectedActionException _ nil)))
+        (load-balancer)))

 (defn shotgun [key->service action-count]
   (let [key-service-tuples (vec key->service)
@@ -44,4 +48,7 @@
                            (reduced (persistent! acc1))
                            acc1)))
                      (transient #{})
-                     (repeatedly rand-fn)))))))+                     (repeatedly rand-fn)))))))
+
+(defn submit-shotgun-actions [shotgun key->fn timeout-millis]
+  )


http-kit/clojure: ===> (1) Utilize constants: Bring out digits regexp to constants. (2) Minify: Move func args to a line above.

--- src/clojure/src/dnsresolvh.clj
+++ src/clojure/src/dnsresolvh.clj
@@ -15,14 +15,15 @@
 (ns dnsresolvh)

 ; Helper constants.
-(defmacro EXIT-FAILURE     []    1) ;    Failing exit status.
-(defmacro EXIT-SUCCESS     []    0) ; Successful exit status.
-(defmacro EMPTY-STRING     []   "")
-(defmacro COLON-SPACE-SEP  [] ": ")
-(defmacro COMMA-SPACE-SEP  [] ", ")
-(defmacro NEW-LINE         [] "\n")
-(defmacro ONE-SPACE-STRING []  " ")
-(defmacro PRINT-BANNER-OPT [] "-V")
+(defmacro EXIT-FAILURE     []      1) ;    Failing exit status.
+(defmacro EXIT-SUCCESS     []      0) ; Successful exit status.
+(defmacro EMPTY-STRING     []     "")
+(defmacro COLON-SPACE-SEP  []   ": ")
+(defmacro COMMA-SPACE-SEP  []   ", ")
+(defmacro NEW-LINE         []   "\n")
+(defmacro ONE-SPACE-STRING []    " ")
+(defmacro PRINT-BANNER-OPT []   "-V")
+(defmacro DIGITS           [] #"\d+")

 ; Common error messages.
 (defmacro ERR-PORT-MUST-BE-POSITIVE-INT [](str ": <port_number> must be "
@@ -58,8 +59,7 @@
 (defmacro DMN-AUTHOR      [] "Radislav Golubtsov <ragolubtsov@my.com>")

 (defn cleanups-fixate
-    "Helper function. Makes final buffer cleanups, closes streams, etc."
-    [log]
+    "Helper function. Makes final buffer cleanups, closes streams, etc." [log]

     ; Closing the system logger.
     ; --- Calling <syslog.h> closelog(); ---
@@ -67,8 +67,7 @@
 )

 (defn separator-draw
-    "Helper function. Draws a horizontal separator banner."
-    [banner-text]
+    "Helper function. Draws a horizontal separator banner." [banner-text]

     (let [i (count banner-text)]


Fixing NullPointerException found in Catalog REST testing.

--- src/cmr/transmit/echo/rest.clj
+++ src/cmr/transmit/echo/rest.clj
@@ -32,7 +32,7 @@
          ; _ (debug "Making ECHO GET Request" url (pr-str params))
          response (client/get url params)
          {:keys [status body headers]} response
-         parsed (if (.startsWith ^String (get headers "Content-Type") "application/json")
+         parsed (if (.startsWith ^String (get headers "Content-Type" "") "application/json")
                   (json/decode body true)
                   nil)]
      [status parsed body])))


fixing typo

fixing typo

--- src/command_line_tool/core.clj
+++ src/command_line_tool/core.clj
@@ -1,6 +1,6 @@
 (ns command-line-tool.core
   (:require [clojure.java.io :as io]) ; entire java.io library
-  (:use [clojure.tools.cli :only (cli)]) ; expression loads only cli namesame from tools
+  (:use [clojure.tools.cli :only (cli)]) ; expression loads only cli namespace from tools
   (:gen-class))

 (defn do-something


CMR-4589: add tests

CMR-4589: add tests

CMR-4589 - Code cleanup.

DROP THIS COMMIT: added debugging.

--- common-lib/src/cmr/common/validations/json_schema.clj
+++ common-lib/src/cmr/common/validations/json_schema.clj
@@ -41,12 +41,18 @@
   com.github.fge.jsonschema.core.report.ListProcessingReport.

   For details, see:
-  * http://fge.github.io/json-schema-validator/2.2.x/index.html
-  * http://java-json-tools.github.io/json-schema-core/1.2.x/index.html"
+  * [ProcessingMessage](http://java-json-tools.github.io/json-schema-core/1.2.x/com/github/fge/jsonschema/core/report/ProcessingMessage.html)
+  * [ListProcessingReport](http://java-json-tools.github.io/json-schema-core/1.2.x/com/github/fge/jsonschema/core/report/ListProcessingReport.html)"
   [^ListProcessingReport report]
   (flatten
     (for [error-report (seq (.asJson report))
           :let [json-error-report (json/decode (str ^Object error-report) true)]]
+      ;; XXX DEBUG
+      (warn "DEBUG: error-report")
+      (warn error-report)
+      (warn "DEBUG: error-report (JSON)")
+      (warn json-error-report)
+      ;; XXX END DEBUG
       (conj (parse-nested-error-report (:reports json-error-report))
             (parse-error-report json-error-report)))))

@@ -91,7 +97,10 @@
   json string to validate. Uses com.github.fge.jsonschema to perform the
   validation. The JSON schema must be provided as a
   com.github.fge.jsonschema.main.JsonSchema object and the json-to-validate must
-  be a string. Returns a list of the errors found."
+  be a string. Returns a list of the errors found.
+
+  For details, see:
+  * [JsonSchema](http://java-json-tools.github.io/json-schema-validator/2.2.x/com/github/fge/jsonschema/main/JsonSchema.html)"
   [^JsonSchema json-schema json-to-validate]
   (let [validation-report (.validate json-schema (json-string->JsonNode json-to-validate))]
     (parse-validation-report validation-report)))


More performance testing code

More performance testing code

--- test/clj/cortex/performance_test.clj
+++ test/clj/cortex/performance_test.clj
@@ -7,6 +7,7 @@
             [cortex.optimise :as opt]
             [cortex.backends :as b]
             [cortex.protocols :as cp]
+            [criterium.core :as q]
             [core.blas.protocols :as blas]
             [clojure.core.matrix.protocols :as mp]
             [clojure.test :refer [deftest is are]]
@@ -47,10 +48,17 @@
 ;; miscellaneous performance tests
 (comment
   ;; testing for linear layer computation
-  (let [a (layers/linear-layer 1000 1000)
-        input (vec (range 1000))
-        ograd (vec (range 1000))
+  (let [SIZE 1000
+        a (layers/linear-layer SIZE SIZE)
+        input (m/array :vectorz (range SIZE))
+        ograd (m/array :vectorz (range SIZE))
         a (time (core/forward a input))
-        a (time (core/backward a input ograd))]
-    :OK)
+        _ (q/quick-bench (core/backward a input ograd))])
+
+  ;; testing for outer products
+  (let [SIZE 1000
+        m (m/new-array [SIZE SIZE])
+        a (m/array :vectorz (range SIZE))
+        b (m/array :vectorz (range SIZE))]
+    (q/quick-bench (m/add-outer-product! m a b)))
   )


correct unit test for user validation

correct unit test for user validation

--- test/clj_money/models/users_test.clj
+++ test/clj_money/models/users_test.clj
@@ -38,7 +38,7 @@
 (deftest try-to-create-with-invalid-data
   (testing "Email is required"
     (try
-    (users/create data-store (dissoc attributes :email))
+      (users/create data-store (dissoc attributes :email))
       (catch clojure.lang.ExceptionInfo e
-        (is (= {:email "missing-required-key"}
+        (is (= {:email 'missing-required-key}
                (:error (ex-data e))))))))


fixed typo

fixed typo

--- test/ctia/http/routes/actor_test.clj
+++ test/ctia/http/routes/actor_test.clj
@@ -1,11 +1,11 @@
 (ns ctia.http.routes.actor-test
+  (:refer-clojure :exclude [get])
   (:require
    [clojure.test :refer [deftest is testing use-fixtures join-fixtures]]
    [ctia.test-helpers.core :refer [delete get post put] :as helpers]
    [ctia.test-helpers.fake-whoami-service :as whoami-helpers]
    [ctia.test-helpers.store :refer [deftest-for-each-store]]
    [ctia.test-helpers.auth :refer [all-capabilities]]))
-
 (use-fixtures :once (join-fixtures [helpers/fixture-schema-validation
                                     helpers/fixture-properties:clean
                                     whoami-helpers/fixture-server]))


Logging for rollups.

Logging for rollups.

--- src/kixi/hecuba/controller/pipeline.clj
+++ src/kixi/hecuba/controller/pipeline.clj
@@ -140,9 +140,15 @@
                     range      (misc/start-end-dates :rollups s where)
                     new-item   (assoc item :sensor s :range range)]
                 (when range
-                  (calculate/hourly-rollups store new-item)
-                  (calculate/daily-rollups store new-item)
-                  (misc/reset-date-range store s :rollups (:start-date range) (:end-date range))))))))
+                  (log/debugf "Started Rolling Up for Sensor: %s:%s Start: %s End: %s" device_id type (:start-date range) (:end-date range))
+                  (try
+                    (calculate/hourly-rollups store new-item)
+                    (calculate/daily-rollups store new-item)
+                    (misc/reset-date-range store s :rollups (:start-date range) (:end-date range))
+                    (catch Throwable t
+                      (log/errorf t "FAILED to Roll Up for Sensor: %s:%s Start: %s End: %s" device_id type (:start-date range) (:end-date range))
+                      (throw t)))
+                  (log/debugf "COMPLETED Rolling Up for Sensor: %s:%s Start: %s End: %s" device_id type (:start-date range) (:end-date range))))))))
       (log/info "Finished rollups."))

     (defnconsumer spike-check-q [item]


Minor refactoring: let if empty? -> if-let seq

It's more idiomatic, compact, and a bit easier to understand

--- src/main/clojure/clojure/test/check.clj
+++ src/main/clojure/clojure/test/check.clj
@@ -103,10 +103,9 @@
             ;; if so, traverse down them. If not, save this as the best example
             ;; seen now and then look at the right-siblings
             ;; children
-            (let [children (rose/children head)]
-              (if (empty? children)
-                (recur tail (rose/root head) (inc total-nodes-visited) depth)
-                (recur children (rose/root head) (inc total-nodes-visited) (inc depth))))))))))
+            (if-let [children (seq (rose/children head))]
+              (recur children (rose/root head) (inc total-nodes-visited) (inc depth))
+              (recur tail (rose/root head) (inc total-nodes-visited) depth))))))))

 (defn- failure
   [property failing-rose-tree trial-number size seed]


add dev mode for convenience

add dev mode for convenience

--- cljs-admin/tourneybot_admin/core.cljs
+++ cljs-admin/tourneybot_admin/core.cljs
@@ -29,6 +29,9 @@

 (def tournament-state-url "../tournament.json")
 (def info-page-url "../info.md")
+
+;; NOTE: this is for developer convenience
+(def in-dev-mode? (not= -1 (.indexOf js/document.location.href "dev=true")))

 ;;------------------------------------------------------------------------------
 ;; Page State Atom
@@ -771,8 +774,12 @@
   (swap! page-state assoc :logging-in? true
                           :password-error? false
                           :password-valid? false)
-  (let [password (:password @page-state)]
-    (check-password password check-password-success check-password-error)))
+  (if in-dev-mode?
+    ;; simulate the API call
+    (js/setTimeout check-password-success (rand-int 200 400))
+    ;; else make the actual API call
+    (let [password (:password @page-state)]
+      (check-password password check-password-success check-password-error))))

 (rum/defc PasswordPage < rum/static
   [{:keys [logging-in? password password-error? title]}]


Add more defop

Add more defop

Signed-off-by: Yen-Chin Lee <082d453d72dce940e12089a4ad48b97cfe1f3ec4@gmail.com>

--- src/emulator_chip8/opcode.cljc
+++ src/emulator_chip8/opcode.cljc
@@ -63,17 +63,66 @@
   "Skip the following instruction if the value of register VX is equal to the value of register VY"
   [])

-;;;;;;;;;;;
-
 (defop :6XNN
-  []
-  ;;(println "ad")
-  )
+  "Store number NN in register VX."
+  [])
+
+(defop :7XNN
+  "Add the value NN to register VX."
+  [])
+
+(defop :8XY0
+  "Store the value of register VY in register VX"
+  [])
+
+(defop :8XY1
+  "Set VX to VX OR VY"
+  [])
+
+(defop :8XY2
+  "Set VX to VX AND VY"
+  [])

 (defop :8XY3
-  []
-  ;;(println "ad")
-  )
+  "Set VX to VX XOR VY"
+  [])
+
+(defop :8XY4
+  "Add the value of register VY to register VX.
+  Set VF to 1 if a carry occurs
+  Set VF to 0 if a carry does not occur."
+  [])
+
+(defop :8XY5
+  "Subtract the value of register VY from register VX
+  Set VF to 0 if a borrow occurs
+  Set VF to 1 if a borrow does not occur."
+  [])
+
+(defop :8XY6
+  "Store the value of register VY shifted right one bit in register VX.
+  Set register VF to the least significant bit prior to the shift."
+  [])
+
+(defop :8XY7
+  "Set register VX to the value of VY minus VX
+  Set VF to 00 if a borrow occurs
+  Set VF to 01 if a borrow does not occur"
+  [])
+
+(defop :8XYE
+  "Store the value of register VY shifted left one bit in register VX.
+Set register VF to the most significant bit prior to the shift."
+  [])
+
+(defop :9XY0
+  "Skip the following instruction if the value of register VX is not equal to
+  the value of register VY."
+  [])
+
+
+
+;;;;;;

 (deref opcode-table)


after reporting a match redirect to player stats

--- src/foosball/routes/report.clj
+++ src/foosball/routes/report.clj
@@ -18,7 +18,7 @@
       (do
         (info {:validated-report validated-report})
         (db/create-match validated-report)
-        (redirect-after-post "/matches"))
+        (redirect-after-post "/stats/players"))
       (layout/common (match/form (db/get-players) validated-report)))))

 (defn matches-page []


Remove dead code.

Remove dead code.

--- src/cljs/quil_site/examples/heart.cljs
+++ src/cljs/quil_site/examples/heart.cljs
@@ -51,9 +51,6 @@
         (update :counter dec)
         (update :points #(mapv (:scaling-function state) %)))))

-  (q/defsketch sk
-)
-
 (defn run-sketch [host size] ;DELETE
 (q/sketch
   :host host


Generate the correct filtering date

Generate the correct filtering date

We're now using `20200201` as the date format locally, but the fastly
logs will have a prefix of `2020-02-01`.

--- src/clojars/tools/combine_cdn_logs.clj
+++ src/clojars/tools/combine_cdn_logs.clj
@@ -19,6 +19,8 @@
     (let [[raw-container-name cf-user cf-key
            s3-bucket aws-region aws-key aws-secret
            date output-file] args
+          date               (apply format "%s-%s-%s"
+                                    (rest (re-find #"(\d{4})(\d{2})(\d{2})" date)))
           dest-file          (io/file output-file)
           name-regex         (re-pattern (str "^" date))
           down-conn          (connect cf-user cf-key raw-container-name)


Refactor move tests

Refactor move tests

--- test/obb_rules/actions/move_test.clj
+++ test/obb_rules/actions/move_test.clj
@@ -39,86 +39,84 @@
         (is (not (some #(= new-coord %) possible-moves)))
         (is (failed? result))))))

-(deftest movement-restrictions
-
-  (testing "front movement east"
-    (let [element (element-direction crusader-element :east)
-          board (place-element (create-board) [2 2] element)]
-      (test-complete-move board [2 2] [1 1] false)
-      (test-complete-move board [2 2] [1 2] false)
-      (test-complete-move board [2 2] [1 3] false)
-      (test-complete-move board [2 2] [2 1] false)
-      (test-complete-move board [2 2] [2 3] false)
-      (test-complete-move board [2 2] [3 1] false)
-      (test-complete-move board [2 2] [3 2] true)
-      (test-complete-move board [2 2] [3 3] false)))
-
-  (testing "front movement north"
-    (let [element (element-direction crusader-element :west)
-          board (place-element (create-board) [2 2] element)]
-      (test-complete-move board [2 2] [1 1] false)
-      (test-complete-move board [2 2] [1 2] true)
-      (test-complete-move board [2 2] [1 3] false)
-      (test-complete-move board [2 2] [2 1] false)
-      (test-complete-move board [2 2] [2 3] false)
-      (test-complete-move board [2 2] [3 1] false)
-      (test-complete-move board [2 2] [3 2] false)
-      (test-complete-move board [2 2] [3 3] false)))
-
-  (testing "front movement south"
-    (let [board (place-element (create-board) [2 2] crusader-element)]
-      (test-complete-move board [2 2] [1 1] false)
-      (test-complete-move board [2 2] [1 2] false)
-      (test-complete-move board [2 2] [1 3] false)
-      (test-complete-move board [2 2] [2 1] false)
-      (test-complete-move board [2 2] [2 3] true)
-      (test-complete-move board [2 2] [3 1] false)
-      (test-complete-move board [2 2] [3 2] false)
-      (test-complete-move board [2 2] [3 3] false)))
-
-  (testing "front movement north"
-    (let [element (element-direction crusader-element :north)
-          board (place-element (create-board) [2 2] element)]
-      (test-complete-move board [2 2] [1 1] false)
-      (test-complete-move board [2 2] [1 2] false)
-      (test-complete-move board [2 2] [1 3] false)
-      (test-complete-move board [2 2] [2 1] true)
-      (test-complete-move board [2 2] [2 3] false)
-      (test-complete-move board [2 2] [3 1] false)
-      (test-complete-move board [2 2] [3 2] false)
-      (test-complete-move board [2 2] [3 3] false)))
-
-  (testing "normal movement"
-    (let [board (place-element (create-board) [2 2] nova-element)]
-      (test-complete-move board [2 2] [1 1] false)
-      (test-complete-move board [2 2] [1 2] true)
-      (test-complete-move board [2 2] [1 3] false)
-      (test-complete-move board [2 2] [2 1] true)
-      (test-complete-move board [2 2] [2 3] true)
-      (test-complete-move board [2 2] [3 1] false)
-      (test-complete-move board [2 2] [3 2] true)
-      (test-complete-move board [2 2] [3 3] false)))
-
-  (testing "diagonal movement"
-    (let [board (place-element (create-board) [2 2] pretorian-element)]
-      (test-complete-move board [2 2] [1 1] true)
-      (test-complete-move board [2 2] [1 2] false)
-      (test-complete-move board [2 2] [1 3] true)
-      (test-complete-move board [2 2] [2 1] false)
-      (test-complete-move board [2 2] [2 3] false)
-      (test-complete-move board [2 2] [3 1] true)
-      (test-complete-move board [2 2] [3 2] false)
-      (test-complete-move board [2 2] [3 3] true)))
-
-  (testing "all-movement"
-    (test-complete-move board [2 2] [1 1] true)
+(deftest front-movement-east
+  (let [element (element-direction crusader-element :east)
+        board (place-element (create-board) [2 2] element)]
+    (test-complete-move board [2 2] [1 1] false)
+    (test-complete-move board [2 2] [1 2] false)
+    (test-complete-move board [2 2] [1 3] false)
+    (test-complete-move board [2 2] [2 1] false)
+    (test-complete-move board [2 2] [2 3] false)
+    (test-complete-move board [2 2] [3 1] false)
+    (test-complete-move board [2 2] [3 2] true)
+    (test-complete-move board [2 2] [3 3] false)))
+
+(deftest front-movement-north
+  (let [element (element-direction crusader-element :west)
+        board (place-element (create-board) [2 2] element)]
+    (test-complete-move board [2 2] [1 1] false)
     (test-complete-move board [2 2] [1 2] true)
-    (test-complete-move board [2 2] [1 3] true)
+    (test-complete-move board [2 2] [1 3] false)
+    (test-complete-move board [2 2] [2 1] false)
+    (test-complete-move board [2 2] [2 3] false)
+    (test-complete-move board [2 2] [3 1] false)
+    (test-complete-move board [2 2] [3 2] false)
+    (test-complete-move board [2 2] [3 3] false)))
+
+(deftest front-movement-south
+  (let [board (place-element (create-board) [2 2] crusader-element)]
+    (test-complete-move board [2 2] [1 1] false)
+    (test-complete-move board [2 2] [1 2] false)
+    (test-complete-move board [2 2] [1 3] false)
+    (test-complete-move board [2 2] [2 1] false)
+    (test-complete-move board [2 2] [2 3] true)
+    (test-complete-move board [2 2] [3 1] false)
+    (test-complete-move board [2 2] [3 2] false)
+    (test-complete-move board [2 2] [3 3] false)))
+
+(deftest front-movement-north
+  (let [element (element-direction crusader-element :north)
+        board (place-element (create-board) [2 2] element)]
+    (test-complete-move board [2 2] [1 1] false)
+    (test-complete-move board [2 2] [1 2] false)
+    (test-complete-move board [2 2] [1 3] false)
+    (test-complete-move board [2 2] [2 1] true)
+    (test-complete-move board [2 2] [2 3] false)
+    (test-complete-move board [2 2] [3 1] false)
+    (test-complete-move board [2 2] [3 2] false)
+    (test-complete-move board [2 2] [3 3] false)))
+
+(deftest normal-movement
+  (let [board (place-element (create-board) [2 2] nova-element)]
+    (test-complete-move board [2 2] [1 1] false)
+    (test-complete-move board [2 2] [1 2] true)
+    (test-complete-move board [2 2] [1 3] false)
     (test-complete-move board [2 2] [2 1] true)
     (test-complete-move board [2 2] [2 3] true)
+    (test-complete-move board [2 2] [3 1] false)
+    (test-complete-move board [2 2] [3 2] true)
+    (test-complete-move board [2 2] [3 3] false)))
+
+(deftest diagonal-movement
+  (let [board (place-element (create-board) [2 2] pretorian-element)]
+    (test-complete-move board [2 2] [1 1] true)
+    (test-complete-move board [2 2] [1 2] false)
+    (test-complete-move board [2 2] [1 3] true)
+    (test-complete-move board [2 2] [2 1] false)
+    (test-complete-move board [2 2] [2 3] false)
     (test-complete-move board [2 2] [3 1] true)
-    (test-complete-move board [2 2] [3 2] true)
+    (test-complete-move board [2 2] [3 2] false)
     (test-complete-move board [2 2] [3 3] true)))
+
+(deftest all-movement
+  (test-complete-move board [2 2] [1 1] true)
+  (test-complete-move board [2 2] [1 2] true)
+  (test-complete-move board [2 2] [1 3] true)
+  (test-complete-move board [2 2] [2 1] true)
+  (test-complete-move board [2 2] [2 3] true)
+  (test-complete-move board [2 2] [3 1] true)
+  (test-complete-move board [2 2] [3 2] true)
+  (test-complete-move board [2 2] [3 3] true))

 (deftest allow-default-quantity
   (let [old-coord [2 2]


Carmine proper: fix broken test key fn

Carmine proper: fix broken test key fn

--- test/taoensso/carmine/tests/main.clj
+++ test/taoensso/carmine/tests/main.clj
@@ -8,7 +8,7 @@
 (comment (test/run-tests '[taoensso.carmine.tests.main]))

 (defmacro wcar* [& body] `(car/wcar {:pool {} :spec {}} ~@body))
-(defn tkey [key] (car/key :carmine :temp :test))
+(def tkey (partial car/key :carmine :temp :test))
 (defn clean-up-tkeys! [] (when-let [ks (seq (wcar* (car/keys (tkey :*))))]
                            (wcar* (apply car/del ks))))


Update process_lisp.clj

Update process_lisp.clj

--- src/iyye/bios/process_lisp.clj
+++ src/iyye/bios/process_lisp.clj
@@ -18,7 +18,8 @@
    (:require [clojure.string :as str]
              [iyye.bios.parse-lisp :as parse]
              [iyye.bios.ioframes :as ioframes]
-             [iyye.bios.words :as words]))
+             [iyye.bios.words :as words]
+             [iyye.subcon.knowledge.words :as scwords]))

 (defn process-control [tree input IO]
   (let [cmd (first tree)
@@ -28,15 +29,26 @@
       (dorun (words/action cmd params IO))
       (ioframes/process-output IO (str "failed to parse: " input)))))

+(defn process-lispy-control [tree input IO]
+  (let [cmd (first tree)
+        params (for [cur (rest tree)] (if (seq? cur) (process-lispy-control cur "substr" IO) cur))]
+    ;    (println "processing" cmd)
+    (if cmd
+      (dorun (scwords/action cmd params IO))
+      (ioframes/process-output IO (str "failed to parse: " input))))
+  )
+
 (defn process-lispy-ctrl-input [IO input]
   (let [tree (parse/get-syntax-tree input)]
-    (future (Thread/sleep 1000)
+    (future (Thread/sleep 500)
             (process-control tree input IO))))

 (defn process-lispy-input [IO input]
   (if (= \# (first input))
     (process-lispy-ctrl-input IO (subs input 1))
-    (future (Thread/sleep 1000) (ioframes/process-output IO "parsing lispy sentences not implemented yet"))))
+    ;(future (Thread/sleep 1000) (ioframes/process-output IO "parsing lispy sentences not implemented yet"))
+    (let [tree (parse/get-syntax-tree input)]
+      (future (process-lispy-control tree input IO)))))

 (defn process-input [IO input]
    (if (= input "What is answer to life, the universe and everything?")


Extend view devcard to exercise calling commands from views

--- src/docs/workflo/macros/docs/view.cljs
+++ src/docs/workflo/macros/docs/view.cljs
@@ -35,23 +35,35 @@
 (defcard-doc
   "# Example: Users

-  The User view renders a user and triggers a callback function
-  when the user is clicked.
+  The User view renders a user and triggers a command
+  when the user name is clicked. The command is executed
+  using the `:handle-command` hook that is configured
+  with
+
+  ```
+  (workflo.macros.view/configure! {:handle-command ...})
+  ```
+
+  This allows arbitrary code to be executed, such as
+  generating `om/transact!` calls or calling external
+  services.

   ```
   (defview User
     [user [name email]]
-    [clicked-fn]
     (key name)
     (ident [:user name])
+    (commands [open])
     (render
-      (dom/div #js {:onClick #(clicked-fn name)}
-        (dom/p nil \"Name: \" name)
-        (dom/p nil \"Email: \" email))))
+      (dom/p nil
+        \"Name: \"
+        (dom/button #js {:onClick #(open {:user/name name})}
+          name))
+      (dom/p nil \"Email: \" email))))
   ```

-  The UserList view renders multiple children, exercising the
-  `:wrapper-view` feature that automatically wraps the content
+  The User and UserList views render multiple children, exercising
+  the `:wrapper-view` feature that automatically wraps the content
   of `(render ...)` if it does not return a single element.

   The UserList view also demonstrates that, with views, the
@@ -73,16 +85,19 @@

 (defview User
   [user [name email]]
-  [clicked-fn]
   (key name)
   (ident [:user name])
+  (commands [open])
   (render
-   (dom/div #js {:onClick #(clicked-fn name)}
-     (dom/p nil "Name: " name)
-     (dom/p nil "Email: " email))))
+    (dom/p nil
+      "Name: "
+      (dom/button #js {:onClick #(open {:user/name name})}
+        name))
+    (dom/p nil "Email: " email)))

 (defview Header
   [text]
+  (key text)
   (render
     (dom/h3 nil text)))


p031: moving tests form midje back to clj.test


Removes stale FIXME

Removes stale FIXME

--- test/expound/alpha_test.cljc
+++ test/expound/alpha_test.cljc
@@ -2484,7 +2484,6 @@
   [f]
   (f 1))

-;; FIXME - why is CLJ and CLJS output different?
 (deftest explain-results
   (testing "single bad result (failing return spec)"
     (is (= (pf


Fix test/is usage in 3 tests

Fix test/is usage in 3 tests

--- test/promesa/core_tests.cljc
+++ test/promesa/core_tests.cljc
@@ -141,7 +141,7 @@
      (let [p1 (future-ok 200 2)
            p2 (p/then p1 inc)
            p3 (p/then p2 inc)]
-       (t/is @p3 4))))
+       (t/is (= @p3 4)))))

 (t/deftest chaining-using-map
   #?(:cljs
@@ -156,7 +156,7 @@
      (let [p1 (future-ok 200 2)
            p2 (p/map inc p1)
            p3 (p/map inc p2)]
-       (t/is @p3 4))))
+       (t/is (= @p3 4)))))

 (t/deftest chaining-using-mapcat
   #?(:cljs
@@ -173,7 +173,7 @@
            inc #(p/resolved (inc %))
            p2 (p/mapcat inc p1)
            p3 (p/mapcat inc p2)]
-       (t/is @p3 4))))
+       (t/is (= @p3 4)))))

 (t/deftest canclel-scheduled-task
   #?(:cljs


have tests keep track of all messages received on a socket

--- test/subrosa/test/expect.clj
+++ test/subrosa/test/expect.clj
@@ -21,7 +21,7 @@
   (try
     (.readLine in)
     (catch java.net.SocketTimeoutException e
-      nil)))
+      :timeout)))

 (defn connect
   ([] (connect *host* *port*))
@@ -30,7 +30,8 @@
                (.setSoTimeout 1000))]
        {:socket s
         :in (BufferedReader. (InputStreamReader. (.getInputStream s)))
-        :out (.getOutputStream s)})))
+        :out (.getOutputStream s)
+        :received (atom [])})))

 (defmacro with-connection [s & body]
   `(let [~s (connect)]
@@ -44,19 +45,23 @@
     (.write out (.getBytes (str command "\n")))
     (.flush out)))

+(defn found? [pattern lines]
+  (some (partial re-find pattern) lines))
+
 (defn expect
   ([socket pattern] (expect socket pattern (or *timeout* 0)))
   ([socket pattern timeout]
      (.setSoTimeout (:socket socket) timeout)
      (let [in (:in socket)]
-       (loop [received []]
-         (let [line (socket-read-line in)]
-                                        ; (println "RECEIVED:" line) ;; verbose mode
-           (if (nil? line)
-             (join "\n" received)
-             (if (re-find pattern line)
-               true
-               (recur (conj received line)))))))))
+       (loop [line (socket-read-line in)]
+         (swap! (:received socket) conj (if (= :timeout line)
+                                          ""
+                                          line))
+         (if (found? pattern @(:received socket))
+           true
+           (if (= :timeout line)
+             (join "\n" @(:received socket))
+             (recur (socket-read-line in))))))))

 (defmethod assert-expr 'received? [msg form]
   (let [socket (nth form 1)


Get a naive item list in place

Get a naive item list in place

--- fulcro-todo/src/main/app/ui.cljs
+++ fulcro-todo/src/main/app/ui.cljs
@@ -29,19 +29,56 @@

 (def ui-item-adder (om/factory ItemAdder))

+(defui ^:once Item
+  static
+  fc/InitialAppState
+  (initial-state [c {:keys [added-at text]}] {:added-at added-at
+                                              :text text
+                                              :checked? false})
+  Object
+  (render [this]
+          (let [{:keys [added-at text checked?]} (om/props this)]
+            (dom/li
+             #js {:className "item"}
+
+             (dom/button
+              #js {:className "item__checkbox"}
+              (dom/img
+               #js {:className (if checked?
+                                 "item__checkbox__sprite item__checkbox__sprite--shifted"
+                                 "item__checkbox__sprite")
+                    :alt "checkbox"
+                    :src "images/checkbox-sprite.svg"}))
+
+             (dom/div
+              #js {:className "item__text"}
+              text)
+
+             (dom/button
+              #js {:className "item__trash"}
+              (dom/img
+               #js {:alt "trashx"
+                    :src "images/trash-icon.svg"}))))))
+
+(def ui-item (om/factory Item))
+
 (defui ^:once ItemList
   static
   fc/InitialAppState
   (initial-state [c params] {:items-by-added-at {1508175827181 {:added-at 1508175827181
-                                                                :text "hello"
-                                                                :checked? false}
+                                                                :text "hello"}
                                                  1508175970713 {:added-at 1508175970713
-                                                                :text "world"
-                                                                :checked? true}}
-                             :item-list '(1508175827181 1508175970713)})
+                                                                :text "world"}}
+                             :item-list '(1508175827181 1508175970713)
+                             :items [(fc/get-initial-state Item {:added-at 1508175827181
+                                                                 :text "hello"
+                                                                 :checked? false})
+                                     (fc/get-initial-state Item {:added-at 1508175970713
+                                                                 :text "world"
+                                                                 :checked? true})]})
   Object
   (render [this]
-          (let [{:keys [items-by-added-at item-list]} (om/props this)]
+          (let [{:keys [items-by-added-at item-list items]} (om/props this)]
             (if (empty? item-list)
               (dom/div
                #js {:className "item-list"}
@@ -59,12 +96,13 @@
                 (dom/div
                  #js {:className "item-list__options__divider"})
                 (dom/button
-                 #js {:className "item-list__options__sort"
-                      :alt "smiley"
-                      :src "images/smiley-icon.svg"}
+                 #js {:className "item-list__options__sort"}
                  (dom/img
                   #js {:alt "sort"
-                       :src "images/sort-icon.svg"}))))))))
+                       :src "images/sort-icon.svg"})))
+               (dom/ul
+                nil
+                (map ui-item items)))))))

 (def ui-item-list (om/factory ItemList))


don't let the mousedowns prevent the signup action

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -140,51 +140,52 @@
                                                      :event "Signup Clicked"
                                                      :properties {:source "username-overlay"}})))
                                :onMouseDown
-                               #(do
-                                  (.stopPropagation %)
-                                  (let [group? (and (< 1 (count selected-eids))
-                                                    (contains? selected-eids (:db/id layer)))]
-
-                                    (cond
-                                      (and (= :text tool)
-                                           (= :layer.type/text (:layer/type layer)))
-                                      (cast! :text-layer-re-edited layer)
-
-                                      (not= :select tool) nil
-
-                                      (or (= (.-button %) 2)
-                                          (and (= (.-button %) 0) (.-ctrlKey %)))
-                                      (cast! :layer-properties-opened {:layer layer
-                                                                       :x (first (cameras/screen-event-coords %))
-                                                                       :y (second (cameras/screen-event-coords %))})
-
-
-                                      (and (.-altKey %) group?)
-                                      (cast! :group-duplicated
-                                             {:layer-eids selected-eids
-                                              :x (first (cameras/screen-event-coords %))
-                                              :y (second (cameras/screen-event-coords %))})
-
-                                      (and (.-altKey %) (not group?))
-                                      (cast! :layer-duplicated
-                                             {:layer layer
-                                              :x (first (cameras/screen-event-coords %))
-                                              :y (second (cameras/screen-event-coords %))})
-
-                                      (and (.-shiftKey %) (contains? selected-eids (:db/id layer)))
-                                      (cast! :layer-deselected {:layer layer})
-
-
-                                      group?
-                                      (cast! :group-selected {:x (first (cameras/screen-event-coords %))
-                                                              :y (second (cameras/screen-event-coords %))
-                                                              :layer-eids selected-eids})
-
-                                      :else
-                                      (cast! :layer-selected {:layer layer
-                                                              :x (first (cameras/screen-event-coords %))
-                                                              :y (second (cameras/screen-event-coords %))
-                                                              :append? (.-shiftKey %)}))))))
+                               (when-not (:layer/signup-button layer)
+                                 #(do
+                                    (.stopPropagation %)
+                                    (let [group? (and (< 1 (count selected-eids))
+                                                      (contains? selected-eids (:db/id layer)))]
+
+                                      (cond
+                                        (and (= :text tool)
+                                             (= :layer.type/text (:layer/type layer)))
+                                        (cast! :text-layer-re-edited layer)
+
+                                        (not= :select tool) nil
+
+                                        (or (= (.-button %) 2)
+                                            (and (= (.-button %) 0) (.-ctrlKey %)))
+                                        (cast! :layer-properties-opened {:layer layer
+                                                                         :x (first (cameras/screen-event-coords %))
+                                                                         :y (second (cameras/screen-event-coords %))})
+
+
+                                        (and (.-altKey %) group?)
+                                        (cast! :group-duplicated
+                                               {:layer-eids selected-eids
+                                                :x (first (cameras/screen-event-coords %))
+                                                :y (second (cameras/screen-event-coords %))})
+
+                                        (and (.-altKey %) (not group?))
+                                        (cast! :layer-duplicated
+                                               {:layer layer
+                                                :x (first (cameras/screen-event-coords %))
+                                                :y (second (cameras/screen-event-coords %))})
+
+                                        (and (.-shiftKey %) (contains? selected-eids (:db/id layer)))
+                                        (cast! :layer-deselected {:layer layer})
+
+
+                                        group?
+                                        (cast! :group-selected {:x (first (cameras/screen-event-coords %))
+                                                                :y (second (cameras/screen-event-coords %))
+                                                                :layer-eids selected-eids})
+
+                                        :else
+                                        (cast! :layer-selected {:layer layer
+                                                                :x (first (cameras/screen-event-coords %))
+                                                                :y (second (cameras/screen-event-coords %))
+                                                                :append? (.-shiftKey %)})))))))
            (when-not (= :layer.type/text (:layer/type layer))
              (svg-element selected-eids (assoc layer
                                                :className (str "layer-outline ")


focus on canvas if coming out of chat

focus on canvas if coming out of chat

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -290,15 +290,12 @@
                                          (js/clearInterval (om/get-state owner :touch-timer))
                                          ((:handle-mouse-move! handlers) (aget touches "0")))))
                       :onMouseDown (fn [event]
-                                     (.preventDefault event)
+                                     ;;(.preventDefault event)
                                      (.stopPropagation event)
-                                     ;;(.addEventListener js/document "mousemove" handle-mouse-move false)
-                                     (js/console.log event)
                                      ((:handle-mouse-down handlers) event))
                       :onMouseUp (fn [event]
                                    (.preventDefault event)
                                    (.stopPropagation event)
-                                   ;;(.removeEventListener js/document "mousemove" handle-mouse-move false)
                                    ((:handle-mouse-up handlers) event))
                       :onWheel (fn [event]
                                  (.preventDefault event)


handle arrows for in-progress drawings

handle arrows for in-progress drawings

--- src-cljs/frontend/components/canvas.cljs
+++ src-cljs/frontend/components/canvas.cljs
@@ -630,7 +630,8 @@
                                     :layer/start-y (second layer-center)
                                     :layer/end-x (get-in drawing [:relation :rx])
                                     :layer/end-y (get-in drawing [:relation :ry])
-                                    :layer/type :layer.type/line)))))
+                                    :layer/type :layer.type/line
+                                    :markerEnd "url(#arrow-point)")))))

           (when (and (:in-progress? drawing)
                      (= :layer.type/text (get-in drawing [:layers 0 :layer/type])))
@@ -689,12 +690,26 @@
     om/IRender
     (render [_]
       (let [db @(om/get-shared owner :db)
-            pointer-datoms (seq (d/datoms db :aevt :layer/points-to))]
+            pointer-datoms (seq (d/datoms db :aevt :layer/points-to))
+            drawing-layers (reduce (fn [acc layer]
+                                     (assoc acc (:db/id layer) (assoc layer
+                                                                      :layer/end-x (:layer/current-x layer)
+                                                                      :layer/end-y (:layer/current-y layer))))
+                                   {} (:layers (cursors/observe-drawing owner)))
+            subscriber-layers (reduce (fn [acc layer]
+                                        (assoc acc (:db/id layer) (assoc layer
+                                                                         :layer/end-x (:layer/current-x layer)
+                                                                         :layer/end-y (:layer/current-y layer))))
+                                      {} (mapcat :layers (vals (cursors/observe-subscriber-layers owner))))]
         (apply dom/g #js {:className "layer-arrows"}
                (for [pointer-datom pointer-datoms
-                     :let [origin (d/entity db (:e pointer-datom))
+                     :let [origin (or (get drawing-layers (:e pointer-datom))
+                                      (get subscriber-layers (:e pointer-datom))
+                                      (d/entity db (:e pointer-datom)))
                            origin-center (layers/center origin)
-                           dest (d/entity db (:v pointer-datom))
+                           dest (or (get drawing-layers (:v pointer-datom))
+                                    (get subscriber-layers (:v pointer-datom))
+                                    (d/entity db (:v pointer-datom)))
                            dest-center (layers/center dest)
                            [start-x start-y] (layers/layer-intercept origin dest-center)
                            [end-x end-y] (layers/layer-intercept dest origin-center)]]


Remove v1 message alerts

Remove v1 message alerts

--- src-cljs/frontend/components/common.cljs
+++ src-cljs/frontend/components/common.cljs
@@ -66,23 +66,14 @@
   ([msgs opts]
    (let [{:keys [show-warning-text?]} (merge messages-default-opts opts)]
      (when (pos? (count msgs))
-       (if (feature/enabled? :ui-v2)
-         [:div.col-xs-12
-          (map (fn [message]
-                 [:div.row
-                  [:div.alert.alert-info.iconified
-                   [:div.alert-icon
-                    [:img {:src (icon-path "Info-Info")}]]
-                   [:div {:dangerouslySetInnerHTML #js {"__html" (normalize-html (:message message))}}]]])
-               msgs)]
-         [:div.container-fluid
-          [:div.row
-           [:div#build-messages.col-xs-offset-1.col-xs-10
-            (map (fn [message]
-                   [:div.alert.alert-info
-                    (when show-warning-text? [:strong "Warning: "])
-                    [:span {:dangerouslySetInnerHTML #js {"__html" (normalize-html (:message message))}}]])
-                 msgs)]]])))))
+       [:div.col-xs-12
+        (map (fn [message]
+               [:div.row
+                [:div.alert.alert-info.iconified
+                 [:div.alert-icon
+                  [:img {:src (icon-path "Info-Info")}]]
+                 [:div {:dangerouslySetInnerHTML #js {"__html" (normalize-html (:message message))}}]]])
+             msgs)]))))

 ;; TODO: Why do we have ico and icon?
 (def ico-paths


Dismiss both banners if you 'x' out of the first

--- src-cljs/frontend/components/header.cljs
+++ src-cljs/frontend/components/header.cljs
@@ -403,7 +403,11 @@
                                                                                (when (= response "granted") (raise! owner [:set-web-notifications {:enabled? true
                                                                                :response response}]))))}
                                                                          "Click here to activate web notifications."]]
-                                                           :impression-event-type  :web-notification-banner-impression})
+                                                           :impression-event-type  :web-notification-banner-impression
+                                                           :dismiss-fn #(do
+                                                                          (raise! owner [:dismiss-web-notif-banner {:banner-number "one"
+                                                                                :response "default"}])
+                                                                          (raise! owner [:dismiss-web-notif-banner {:banner-number "two"}]))})
                (and dismissed-banner-one
                     (not dismissed-banner-two)) (om/build top-banner/banner
                                                           {:banner-type (case (n/notifications-permission)


reset input height

reset input height

--- src-cljs/frontend/components/issues.cljs
+++ src-cljs/frontend/components/issues.cljs
@@ -62,7 +62,8 @@
                                                                                :frontend/issue-id (utils/squuid)
                                                                                :vote/cust (:cust/email cust)}}])
                                                     (put! (om/get-shared owner [:comms :nav]) [:navigate! {:path (str "/issues/" fe-id)}]))
-                                                  (om/set-state! owner :issue-title ""))
+                                                  (om/set-state! owner :issue-title "")
+                                                  (om/set-state! owner :input-height 64))
                                                 (finally
                                                   (om/set-state! owner :submitting? false)))))}
           [:div.adaptive


data-warning for title input

data-warning for title input

--- src-cljs/frontend/components/issues.cljs
+++ src-cljs/frontend/components/issues.cljs
@@ -63,10 +63,12 @@
                                                 (finally
                                                   (om/set-state! owner :submitting? false)))))}
           [:div.adaptive
-           [:textarea {:value issue-title
-                       :required "true"
-                       :disabled (or submitting? (not (utils/logged-in? owner)))
-                       :onChange #(om/set-state! owner :issue-title (.. % -target -value))}]
+           [:textarea (merge {:value issue-title
+                              :required "true"
+                              :disabled (or submitting? (not (utils/logged-in? owner)))
+                              :onChange #(om/set-state! owner :issue-title (.. % -target -value))}
+                             (when (neg? chars-left)
+                               {:data-warning "true"}))]
            [:label (merge {:data-label (if (utils/logged-in? owner)
                                          "How can we improve Precursor?"
                                          "Sign in to make an issue.")}


fix tabs on iOS release build

fix tabs on iOS release build

--- src/status_im/components/tabs/tabs.cljs
+++ src/status_im/components/tabs/tabs.cljs
@@ -54,5 +54,11 @@

 (defn tabs [{:keys [tab-list selected-view-id prev-view-id]}]
   [tabs-container
-   [view st/tabs-inner-container
-    (doall (map-indexed #(create-tab %1 %2 selected-view-id prev-view-id) tab-list))]])
+   (into
+     [view st/tabs-inner-container]
+     (let [tabs (into [] tab-list)]
+       [[create-tab 0 (nth tabs 0) selected-view-id prev-view-id]
+        [create-tab 1 (nth tabs 1) selected-view-id prev-view-id]
+        [create-tab 2 (nth tabs 2) selected-view-id prev-view-id]])
+     ;; todo: figure why it doesn't work on iOS release build
+     #_(map-indexed #(create-tab %1 %2 selected-view-id prev-view-id) tab-list))])


run :after-load callbacks on upsert response

--- src/er_cassandra/model/alia/upsert.clj
+++ src/er_cassandra/model/alia/upsert.clj
@@ -219,13 +219,19 @@
                 (return nil))

             ;; re-select the record for nice empty-collections etc
-            final-record (if updated-record-with-keys
-                           (r/select-one
-                            session
-                            (get-in model [:primary-table :name])
-                            (get-in model [:primary-table :key])
-                            (t/extract-uber-key-value model record))
-                           (return nil))]
+            reselected-record (if updated-record-with-keys
+                              (r/select-one
+                               session
+                               (get-in model [:primary-table :name])
+                               (get-in model [:primary-table :key])
+                               (t/extract-uber-key-value model record))
+                              (return nil))
+
+            ;; gotta make the re-selected record presentable!
+            final-record (t/run-callbacks-single
+                          model
+                          :after-load
+                          reselected-record)]

        (return
         (pair final-record


schema/defn

schema/defn

--- src/er_cassandra/model/alia/upsert.clj
+++ src/er_cassandra/model/alia/upsert.clj
@@ -45,8 +45,11 @@
       (return
        [:ok record :upserted]))))

-(defn stale-secondary-key-value
-  [^Entity entity old-record new-record secondary-table]
+(s/defn stale-secondary-key-value
+  [entity :- Entity
+   old-record :- t/MaybeRecordSchema
+   new-record :- t/MaybeRecordSchema
+   secondary-table :- t/SecondaryTableSchema]
   (let [key (:key secondary-table)
         old-key-value (k/extract-key-value key old-record)
         new-key-value (k/extract-key-value key new-record)]
@@ -55,8 +58,11 @@
                (not= old-key-value new-key-value))
       old-key-value)))

-(defn delete-stale-secondaries
-  [^Session session ^Entity entity old-record new-record]
+(s/defn delete-stale-secondaries
+  [session :- Session
+   entity :- Entity
+   old-record :- t/MaybeRecordSchema
+   new-record :- t/MaybeRecordSchema]
   (combine-responses
    (filter
     identity
@@ -73,9 +79,10 @@
                          stale-key-value)
           (return [:ok nil :no-stale-secondary])))))))

-(defn upsert-secondaries
-  "returns Deferred[Right[]]"
-  [^Session session ^Entity entity record]
+(s/defn upsert-secondaries
+  [session :- Session
+   entity :- Entity
+   record :- t/MaybeRecordSchema]
   (combine-responses
    (for [t (t/mutable-secondary-tables entity)]
      (let [k (:key t)]
@@ -84,8 +91,11 @@
               (k/extract-key-value k record))
          (upsert-record session entity t record))))))

-(defn stale-lookup-key-values
-  [^Entity entity old-record new-record lookup-key-table]
+(s/defn stale-lookup-key-values
+  [entity :- Entity
+   old-record :- t/MaybeRecordSchema
+   new-record :- t/MaybeRecordSchema
+   lookup-key-table :- t/LookupTableSchema]
   (let [key (:key lookup-key-table)
         col-colls (:collections lookup-key-table)]

@@ -94,8 +104,11 @@
             new-kvs (set (k/extract-key-value-collection key new-record col-colls))]
         (filter identity (set/difference old-kvs new-kvs))))))

-(defn delete-stale-lookups
-  [^Session session ^Entity entity old-record new-record]
+(s/defn delete-stale-lookups
+  [session :- Session
+   entity :- Entity
+   old-record :- t/MaybeRecordSchema
+   new-record :- t/MaybeRecordSchema]
   (combine-responses
    (mapcat
     identity
@@ -105,9 +118,11 @@
         (for [kv stale-kvs]
           (delete-record session entity t kv)))))))

-(defn lookup-record-seq
+(s/defn lookup-record-seq
   "returns a seq of tuples [table lookup-record]"
-  [model old-record record]
+  [model :- Entity
+   old-record :- t/MaybeRecordSchema
+   record :- t/MaybeRecordSchema]
   (mapcat
    identity
    (for [t (t/mutable-lookup-tables model)]
@@ -136,14 +151,19 @@
                                     lookup-record))]
                [t lookup-record]))))))))

-(defn upsert-lookups
-  [^Session session ^Entity entity old-record record]
+(s/defn upsert-lookups
+  [session :- Session
+   entity :- Entity
+   old-record :- t/MaybeRecordSchema
+   record :- t/MaybeRecordSchema]
   (combine-responses
    (for [[t r] (lookup-record-seq entity old-record record)]
      (upsert-record session entity t r))))

-(defn copy-unique-keys
-  [^Entity entity from to]
+(s/defn copy-unique-keys
+  [entity :- Entity
+   from :- t/MaybeRecordSchema
+   to :- t/MaybeRecordSchema]
   (let [unique-key-tables (:unique-key-tables entity)]
     (reduce (fn [r t]
               (let [key-col (last (:key t))]
@@ -151,43 +171,55 @@
             to
             unique-key-tables)))

-(defn has-lookups?
-  [^Entity entity]
+(s/defn has-lookups?
+  [entity :- Entity]
   (boolean
    (or (not-empty (t/mutable-secondary-tables entity))
        (not-empty (t/mutable-lookup-tables entity)))))

-(defn update-secondaries-and-lookups
+(s/defn update-secondaries-and-lookups
   "update non-LWT secondary and lookup entries"

-  ([^Session session ^Entity entity old-record updated-record-with-keys]
-   (with-context deferred-context
-     (mlet [stale-secondary-responses (delete-stale-secondaries
-                                       session
-                                       entity
-                                       old-record
-                                       updated-record-with-keys)
-
-            stale-lookup-responses (delete-stale-lookups
-                                    session
-                                    entity
-                                    old-record
-                                    updated-record-with-keys)
-
-            secondary-reponses (upsert-secondaries
-                                session
-                                entity
-                                updated-record-with-keys)
-
-            lookup-responses (upsert-lookups
-                              session
-                              entity
-                              old-record
-                              updated-record-with-keys)]
-
-       (return updated-record-with-keys)))))
-
-(defn upsert*
+  [session :- Session
+   entity :- Entity
+   old-record :- t/MaybeRecordSchema
+   updated-record-with-keys :- t/MaybeRecordSchema]
+  (with-context deferred-context
+    (mlet [stale-secondary-responses (delete-stale-secondaries
+                                      session
+                                      entity
+                                      old-record
+                                      updated-record-with-keys)
+
+           stale-lookup-responses (delete-stale-lookups
+                                   session
+                                   entity
+                                   old-record
+                                   updated-record-with-keys)
+
+           secondary-reponses (upsert-secondaries
+                               session
+                               entity
+                               updated-record-with-keys)
+
+           lookup-responses (upsert-lookups
+                             session
+                             entity
+                             old-record
+                             updated-record-with-keys)]
+
+      (return updated-record-with-keys))))
+
+(s/defschema UpsertOptsSchema
+  (s/maybe
+   {(s/optional-key :if-not-exists) s/Bool
+    (s/optional-key :only-if) [s/Any]
+    (s/optional-key :columns) [(s/one s/Keyword :column) s/Keyword]
+    (s/optional-key :where) [s/Any]
+    (s/optional-key :using) {(s/optional-key :timestamp) s/Int
+                             (s/optional-key :ttl) s/Int}}))
+
+(s/defn upsert*
   "upsert a single instance, upserting primary, secondary, unique-key and
    lookup records as required and deleting stale secondary, unique-key and
    lookup records
@@ -196,7 +228,10 @@
    updated-record is the record as currently in the db and key-failures
    is a map of {key values} for unique keys which were requested but
    could not be acquired "
-  [^Session session ^Entity entity record opts]
+  [session :- Session
+   entity :- Entity
+   record :- t/MaybeRecordSchema
+   opts :- UpsertOptsSchema]
    (with-context deferred-context
      (mlet [:let [[record] (t/run-callbacks entity :before-save [record])]


Fix uberjar task when using garden-watcher

It was still referencing it under the old name, garden-reloader.

--- src/leiningen/new/chestnut.clj
+++ src/leiningen/new/chestnut.clj
@@ -75,7 +75,7 @@

 (defn project-prep-tasks [name opts]
   (cond-> ["compile" ["cljsbuild" "once" "min"]]
-    (garden? opts) (conj ["run" "-m" "garden-reloader.main" (str (sanitize-ns name) ".styles")])))
+    (garden? opts) (conj ["run" "-m" "garden-watcher.main" (str (sanitize-ns name) ".styles")])))

 (defn project-uberjar-hooks [opts]
   (cond-> []


Only apply hold time if the gate is still open

--- src/main/audio_utils/gate.cljs
+++ src/main/audio_utils/gate.cljs
@@ -44,7 +44,8 @@
           (>> samples-held 0)
           (maybe-toggle-gate this :open)
           (dequeue-from-buffer this channel))
-        (if (<= (<< samples-held) hold)
+        (if (and (= (<< state) :open)
+                 (< (<< samples-held) hold))
           (do
             (aswap! samples-held inc)
             (maybe-toggle-gate this :open)


add a data migration to clean up the duplicate FK entries.

--- src/metabase/db/migrations.clj
+++ src/metabase/db/migrations.clj
@@ -7,6 +7,7 @@
             (metabase.models [activity :refer [Activity]]
                              [card :refer [Card]]
                              [database :refer [Database]]
+                             [foreign-key :refer [ForeignKey]]
                              [table :refer [Table]]
                              [setting :as setting])
             [metabase.sample-data :as sample-data]
@@ -96,3 +97,14 @@
   (when-not (contains? activity-feed-topics :database-sync-begin)
     (k/delete Activity
       (k/where {:topic "database-sync"}))))
+
+
+;; Clean up duplicate FK entries
+(defmigration remove-duplicate-fk-entries
+  (let [existing-fks (db/sel :many ForeignKey)
+        grouped-fks  (group-by #(str (:origin_id %) "_" (:destination_id %)) existing-fks)]
+    (doseq [[k fks] grouped-fks]
+      (when (< 1 (count fks))
+        (log/debug "Removing duplicate FK entries for" k)
+        (doseq [duplicate-fk (drop-last fks)]
+          (db/del ForeignKey :id (:id duplicate-fk)))))))


Fixed mistakenly duplicated test name

Fixed mistakenly duplicated test name

--- test/tropefest/test/parsing_nodes.clj
+++ test/tropefest/test/parsing_nodes.clj
@@ -93,7 +93,7 @@
                           :url "http://tvtropes.org/pmwiki/pmwiki.php/Main/HomePage")
     ))

-(deftest test-record-page-local
+(deftest test-record-page-same-provenance
   ; See note on test-record-page-local about the provenance URL
   (tdb/wipe-test-db)
   (let [path  (str tp/test-file-path "TakeMeInstead-pruned.html")


Do not compress by default.

Do not compress by default.

--- src/onyx/compression/nippy.clj
+++ src/onyx/compression/nippy.clj
@@ -2,7 +2,7 @@
   (:require [taoensso.nippy :as nippy]))

 (defn compress [x]
-  (nippy/freeze x))
+  (nippy/freeze x {:compressor nil}))

 (defn decompress [x]
   (nippy/thaw x {:v1-compatibility? false}))


Suppress errors from thread, only receiving org.apache.zookeeper.KeeperException

--- src/onyx/coordinator/async.clj
+++ src/onyx/coordinator/async.clj
@@ -194,9 +194,12 @@
                     #(>!! ack-head %)
                     #(>!! exhaust-head %)
                     #(>!! complete-head %)
-                    #(thread (<!! (timeout revoke-delay))
-                             (extensions/create sync :revoke-log %)
-                             (>!! revoke-head %)))
+                    #(thread
+                      (try
+                        (<!! (timeout revoke-delay))
+                        (extensions/create sync :revoke-log %)
+                        (>!! revoke-head %)
+                        (catch Exception e))))
         (extensions/checkpoint sync :offer-log offset)
         (recur)))))


make cta steps actual circles

make cta steps actual circles

--- frontend/components/language_landing.cljs
+++ frontend/components/language_landing.cljs
@@ -154,17 +154,17 @@
              "How do I start using my " (:language template) " app with CircleCI?"]
             [:div.languages-cta-steps
              [:div.languages-cta-step
-              [:div.step-number "1"]
+              [:div.step-number]
               [:div
                "Start by signing up "
                [:br]
                "using GitHub"]]
              [:div.languages-cta-step
-              [:div.step-number "2"]
+              [:div.step-number]
               [:div
                "Run one of your Ruby projects on Circle"]]
              [:div.languages-cta-step
-              [:div.step-number "3"]
+              [:div.step-number]
               [:div
                [:strong "That's it!"]
                " Contact support if you run in to any issues. "]]]


Consistent capitalization

Consistent capitalization

--- frontend/components/project_settings.cljs
+++ frontend/components/project_settings.cljs
@@ -29,7 +29,7 @@
    [:li [:a {:href "edit"} "Overview"]]
    [:li.side-title "Tweaks"]
    [:li [:a {:href "#parallel-builds"} "Parallelism"]]
-   [:li [:a {:href "#env-vars"} "Environment variables"]]
+   [:li [:a {:href "#env-vars"} "Environment Variables"]]
    [:li [:a {:href "#experimental"} "Experimental Settings"]]
    [:li.side-title "Test Commands"]
    [:li [:a {:href "#setup"} "Dependencies"]]
@@ -39,10 +39,10 @@
    [:li [:a {:href "#webhooks"} "Webhooks"]]
    [:li [:a {:href "#badges"} "Status Badges"]]
    [:li.side-title "Permissions"]
-   [:li [:a {:href "#checkout"} "Checkout SSH keys"]]
-   [:li [:a {:href "#ssh"} "SSH keys"]]
-   [:li [:a {:href "#api"} "API tokens"]]
-   [:li [:a {:href "#aws"} "AWS keys"]]
+   [:li [:a {:href "#checkout"} "Checkout SSH Keys"]]
+   [:li [:a {:href "#ssh"} "SSH Keys"]]
+   [:li [:a {:href "#api"} "API Tokens"]]
+   [:li [:a {:href "#aws"} "AWS Keys"]]
    [:li.side-title "Build Artifacts"]
    [:li [:a {:href "#artifacts"} "Artifacts"]]
    [:li.side-title "Continuous Deployment"]
@@ -96,7 +96,8 @@
     (render [_]
       (html
        [:div.project-settings-block
-        [:h2 "How to configure " (vcs-url/project-name (get-in project-data [:project :vcs_url]))]
+        [:h2 "Overview for " (vcs-url/project-name (get-in project-data [:project :vcs_url]))]
+        [:p "How to configure your project:"]
         [:ul.overview-options
          [:li.overview-item
           [:h4 "Option 1"]
@@ -245,7 +246,7 @@
       (let [controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:div
-          [:h2 (str "Change parallelism for " (vcs-url/project-name (get-in project-data [:project :vcs_url])))]
+          [:h2 (str "Change Parallelism for " (vcs-url/project-name (get-in project-data [:project :vcs_url])))]
           (if-not (:plan project-data)
             [:div.loading-spinner common/spinner]
             (list (parallelism-picker project-data controls-ch)
@@ -263,7 +264,7 @@
             controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:div.environment-variables
-          [:h2 "Environment variables for " (vcs-url/project-name (:vcs_url project))]
+          [:h2 "Environment Variables for " (vcs-url/project-name (:vcs_url project))]
           [:div.environment-variables-inner
            [:p
             "Add environment variables to the project build.  You can add sensitive data (e.g. API keys) here, rather than placing them in the repository. "
@@ -399,7 +400,7 @@
             controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:div.dependencies-page
-          [:h2 "Install dependencies for " (vcs-url/project-name (:vcs_url project))]
+          [:h2 "Install Dependencies for " (vcs-url/project-name (:vcs_url project))]
           [:p
            "You can also set your dependencies commands from your "
            [:a {:href "/docs/configuration#dependencies"} "circle.yml"] ". "
@@ -447,7 +448,7 @@
             controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:div.tests-page
-          [:h2 "Set up tests for " (vcs-url/project-name (:vcs_url project))]
+          [:h2 "Tests Setup for " (vcs-url/project-name (:vcs_url project))]
           [:p
            "You can also set your test commands from your "
            [:a {:href "/docs/configuration#dependencies"} "circle.yml"] ". "
@@ -549,7 +550,7 @@
             settings (state-utils/merge-inputs project inputs project-model/notification-keys)]
         (html
          [:div
-          [:h2 "Chatroom setup for " (vcs-url/project-name (:vcs_url project))]
+          [:h2 "Chatroom Setup for " (vcs-url/project-name (:vcs_url project))]
           [:div.chat-rooms
            (for [chat-spec [{:service "Hipchat"
                              :doc (list [:p "To get your API token, create a \"notification\" token via the "
@@ -668,7 +669,7 @@
     (om/component
      (html
       [:div.status-page
-       [:h2 "Status badges for " project-name]
+       [:h2 "Status Badges for " project-name]
        [:div "Use this tool to easily create embeddable status badges. Perfect for your project's README or wiki!"]
        [:div.status-page-inner
         [:form
@@ -736,7 +737,7 @@
             controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:div.sshkeys-page
-          [:h2 "SSH keys for " (vcs-url/project-name (:vcs_url project))]
+          [:h2 "SSH Keys for " (vcs-url/project-name (:vcs_url project))]
           [:div.sshkeys-inner
            [:p "Add keys to the build VMs that you need to deploy to your machines. If the hostname field is blank, the key will be used for all hosts."]
            [:form
@@ -800,7 +801,7 @@
             controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:div.checkout-page
-          [:h2 "Checkout keys for " project-name]
+          [:h2 "Checkout Keys for " project-name]
           [:div.checkout-page-inner
            (if (nil? checkout-keys)
              [:div.loading-spinner common/spinner]
@@ -945,7 +946,7 @@
             controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:div.circle-api-page
-          [:h2 "API tokens for " (vcs-url/project-name (:vcs_url project))]
+          [:h2 "API Tokens for " (vcs-url/project-name (:vcs_url project))]
           [:div.circle-api-page-inner
            [:p "Create and revoke project-specific API tokens to access this project's details using our API. First choose a scope "
             [:i.fa.fa-question-circle#scope-popover-hack {:title "Scope"}]
@@ -1000,7 +1001,7 @@
   (om/component
    (html
     [:div
-     [:h2 "Build artifacts for " (vcs-url/project-name (get-in project-data [:project :vcs_url]))]
+     [:h2 "Build Artifacts for " (vcs-url/project-name (get-in project-data [:project :vcs_url]))]
      [:div.doc
       [:p
        "Circle supports saving files from any build. See "
@@ -1020,7 +1021,7 @@
             controls-ch (om/get-shared owner [:comms :controls])]
         (html
          [:div.heroku-api
-          [:h2 "Set personal Heroku API key for " (vcs-url/project-name (:vcs_url project))]
+          [:h2 "Personal Heroku API Key for " (vcs-url/project-name (:vcs_url project))]
           [:div.heroku-step
            [:h4 "Step 1: Heroku API key"]
            [:div (when (:heroku_api_key user)
@@ -1076,7 +1077,7 @@
    (html
     [:div
      [:h2
-      "Other deployments for " (vcs-url/project-name (get-in project-data [:project :vcs_url]))]
+      "Other Deployments for " (vcs-url/project-name (get-in project-data [:project :vcs_url]))]
      [:div.doc
       [:p "Circle supports deploying to any server, using custom commands. See "
        [:a {:target "_blank",
@@ -1100,7 +1101,7 @@
             input-path (fn [& ks] (apply conj state/inputs-path :aws :keypair ks))]
         (html
          [:div.aws-page
-          [:h2 "AWS keys for " (vcs-url/project-name (:vcs_url project))]
+          [:h2 "AWS Keys for " (vcs-url/project-name (:vcs_url project))]
           [:div.aws-page-inner
            [:p "Set the AWS keypair to be used for authenticating against AWS services during your builds. "
             "Credentials are installed on your containers into the " [:code "~/.aws/config"] " and "


Update to reflect API changes

Update to reflect API changes

--- super-koalio/desktop/src-common/super_koalio/entities.clj
+++ super-koalio/desktop/src-common/super_koalio/entities.clj
@@ -9,10 +9,12 @@
          :stand-left (texture stand :flip true false)
          :jump-right jump
          :jump-left (texture jump :flip true false)
-         :walk-right (animation u/duration walk :loop-pingpong)
+         :walk-right (animation u/duration
+                                walk
+                                :set-play-mode (play-mode :loop-pingpong))
          :walk-left (animation u/duration
                                (map #(texture % :flip true false) walk)
-                               :loop-pingpong)
+                               :set-play-mode (play-mode :loop-pingpong))
          :width 1
          :height (/ 26 18)
          :x-velocity 0


Type-hint context lookup since it happens every request.

This also hints the servlet proxy to speed it up.

--- modules/web/src/main/clojure/immutant/web/servlet.clj
+++ modules/web/src/main/clojure/immutant/web/servlet.clj
@@ -20,9 +20,10 @@
         [immutant.web.session.internal :only [servlet-session-wrapper]]
         [immutant.util :only [with-tccl]])
   (:require [ring.util.servlet :as servlet])
-  (:import javax.servlet.http.HttpServletRequest))
+  (:import javax.servlet.Servlet
+           javax.servlet.http.HttpServletRequest))

-(defn- context [^HttpServletRequest request]
+(defn- ^String context [^HttpServletRequest request]
   (str (.getContextPath request)
        (.getServletPath request)))

@@ -48,8 +49,8 @@
     (init [_ _])
     (destroy [_])))

-(deftype ServletProxy [servlet]
-  javax.servlet.Servlet
+(deftype ServletProxy [^Servlet servlet]
+  Servlet
   (init [_ config]
     (with-tccl (.init servlet config)))
   (service [_ request response]


Add missing require.

Add missing require.

--- src/kixi/hecuba/application/system.clj
+++ src/kixi/hecuba/application/system.clj
@@ -11,6 +11,7 @@
    [modular.bidi :refer (new-bidi-ring-handler-provider #_resolve-routes-contributors)]
    [modular.cassandra :refer (new-session new-cluster)]

+   kixi.hecuba.application.safe
    [kixi.hecuba.controller.pipeline :refer (new-pipeline)]
    [kixipipe.scheduler]
    [kixi.hecuba.queue :refer (new-queue)]


cosmetic changes in test

cosmetic changes in test

--- test/hu/ssh/github_changelog/formatters/markdown_test.clj
+++ test/hu/ssh/github_changelog/formatters/markdown_test.clj
@@ -29,14 +29,15 @@
 (def pull (c/complete {:number 1 :html_url "http://example.com/" :sha (gen-sha)} Pull))
 (def change (c/complete {:type "feat" :scope "scope" :subject "new something" :pull-request pull :issues []} Change))

-(def expected-change "new something [#1](http://example.com/)")
+(def expected-change (str "new something " (markdown/link "#1" "http://example.com/")))

 (deftest format-change
   (is (= expected-change (f-markdown/format-change change))))

 (def grouped (group-by :scope [change change]))
 (def expected-scope (markdown/emphasis "scope:"))
+(def expected-changes (markdown/ul [expected-change expected-change]))

 (deftest format-grouped-changes
   (is (= (str expected-scope " " expected-change) (f-markdown/format-grouped-changes ["scope" [change]])))
-  (is (= (str expected-scope (markdown/ul [expected-change expected-change])) (f-markdown/format-grouped-changes (first grouped)))))
+  (is (= (str expected-scope expected-changes) (f-markdown/format-grouped-changes (first grouped)))))


translate timeline

translate timeline

--- src/cljs/just_married/home/timeline.cljs
+++ src/cljs/just_married/home/timeline.cljs
@@ -32,18 +32,18 @@
         :cake-champagne "Cake and Champagne"
         :final-cake "Cake and Champagne"}

-   :it {:waiting "Waiting for the bride aperitif"
+   :it {:waiting "Aperitivo aspettando la sposa"
         :timeline "Programma Della Giornata"
-        :civil-start "Civil cerimony starts"
-        :civil-end "Civil cerimony ends"
-        :cheers "Cheers and Greetings to Mr and Mrs Andrea Crotti - Moving to Parco dei Principi"
+        :civil-start "Inizio cerimonia civile"
+        :civil-end "Fine cerimonia civile"
+        :cheers "Saluti agli sposi Crotti - trasferimento al Parco dei Principi"
         :grand-buffet "Grand Buffet"
-        :lunch-reception "Lunch Reception"
-        :games-kick-off "Games kick-off"
-        :evening-reception "Evening Reception"
-        :music-party "Music and Evening After Party"
-        :cake-champagne "Cake and Champagne"
-        :final-cake "Cake and Champagne"}})
+        :lunch-reception "Pranzo"
+        :games-kick-off "Inizio dei giochi"
+        :evening-reception "Cena"
+        :music-party "Musica e serata"
+        :cake-champagne "Torta e Champagne"
+        :final-cake "Torta e Champagne"}})

 (def ^:private tr (partial translate timeline-dict))


reset for select

reset for select

--- src/cljs/re_form/inputs/select_impl.cljs
+++ src/cljs/re_form/inputs/select_impl.cljs
@@ -16,6 +16,10 @@
      :padding [[(u/px-div h 2) (u/px 12)]]
      :line-height (u/px h2)
      :border border}
+    [:.flex {:display :inline-flex
+             :width (u/percent 100)}
+     [:.cross {:margin-left :auto
+               :color "#e1e1e1"}]]
     [:&.error
      {:border error-border}]
     [:span.triangle {:color "gray"
@@ -82,11 +86,17 @@
            :on-click (fn [_] (on-change i))}
           (label-fn i)]))]))

-(defn select [{:keys [on-search debounce-interval on-blur]}]
+(defn select [{:keys [on-search debounce-interval on-blur on-change]}]
   (let [state (r/atom {:active false})
         doc-click-listener (fn [e]
-                             (when (and (not (cmn/has-ancestor (.-target e) (:root-node @state)))
-                                        (:active @state))
+                             (when (or (and (not (cmn/has-ancestor
+                                                  (.-target e)
+                                                  (:root-node @state)))
+                                            (:active @state))
+                                       (=
+                                        (.-target e)
+                                        (cmn/f-child (:root-node @state)
+                                                     "cross")))
                                (on-blur e)
                                (swap! state assoc :active false)))
         search-fn (if debounce-interval
@@ -113,7 +123,9 @@
                             (.. first-opt -classList (add "active"))
                             (swap! state assoc :selected first-opt
                                    :suggestions-container
-                                   (cmn/f-child (:root-node @state) "options")))))]
+                                   (cmn/f-child (:root-node @state) "options")))))
+        reset-input (fn [e] (on-change nil))]
+
     (r/create-class
      {
       :component-did-mount
@@ -136,17 +148,18 @@
         [:div.re-select-container
          [:div.re-re-select
           {:class (when-not (empty? errors) :error)}
-          [:div
+          [:div.flex
            {:on-click (fn [_] (do
                                 (when search-fn (js/setTimeout #(.focus (:input-node @state)) 10))
                                 (swap! state assoc :active true
                                        :selected nil)))}
            [:span.triangle "▾"]
            (if value
-             [:span.value
-              [:span.value (label-fn value)]]
+             [:span.value (label-fn value)]
              [:span.choose-value
-              (or (:placeholder props) "Select...")])]]
+              (or (:placeholder props) "Select...")])
+           (when value
+             [:span.cross {:on-click reset-input} "❌"])]]
          (when search-fn
            [:input.re-search-search
             {:tab-index 0


Motor-cortex/move translates clj data to byte-array for choreo

--- src/clojure/life/daemon/motor_cortex.clj
+++ src/clojure/life/daemon/motor_cortex.clj
@@ -1,8 +1,10 @@
 (ns life.daemon.motor-cortex
   (:import [android.bluetooth BluetoothAdapter]
-           [android.content Intent]))
+           [android.content Intent]
+           [java.nio ByteBuffer]))

 (def bt nil)
+(def actiity nil)

 (defn -throw-if-no-bt []
   (if (= bt nil)
@@ -55,37 +57,53 @@
         (do (print (.read istream))
             (recur (.available istream)))))))

-(def ex [
-         0x02 ;number of motors
-         0x00 ;motor id
-         0x04 ;num-commands
-         0x00 ;command id
-         0x00 0x14 ;amount0
-         0x03 0xE8 ;duration0
-         0x01 ;command id
-         0xFF 0xEC ;amount1
-         0x03 0xE8 ;duration1
-         0x02 ;command id
-         0x00 0x14 ;amount0
-         0x03 0xE8 ;duration0
-         0x03 ;command id
-         0xFF 0xEC ;amount1
-         0x03 0xE8 ;duration1
-         0x01 ;motor id
-         0x04 ;num-commands
-         0x04 ;command id
-         0x00 0x14 ;amount0
-         0x03 0xE8 ;duration0
-         0x05 ;command id
-         0xFF 0xEC ;amount1
-         0x03 0xE8 ;duration1
-         0x06 ;command id
-         0x00 0x14 ;amount0
-         0x03 0xE8 ;duration0
-         0x07 ;command id
-         0xFF 0xEC ;amount1
-         0x03 0xE8 ;duration1
-         ])
+(def ex-command
+  {0 [{:id 0 :amount 20 :duration 1000} {:id 1 :amount -20 :duration 1000}]
+   1 [{:id 2 :amount 10 :duration 1000} {:id 3 :amount -10 :duration 1000}]})
+
+
+(defn unsigned-to-signed
+  [unsigned]
+  (if (> unsigned 127)
+    (+ -128 (- unsigned 128))
+    unsigned))
+
+(defn bytes? [x]
+  (if (nil? x)
+    false
+    (= (Class/forName "[B")
+       (.getClass x))))
+
+(defn move
+  [commands]
+  (->> [
+        ;;Number of motors
+        (count commands)
+        (map
+         (fn [[key data]]
+           [
+            ;;motor id
+            key
+
+            ;;num-commands
+            (count data)
+
+            (map
+             (fn [procedure]
+               [(byte (:id procedure))
+                (-> (ByteBuffer/allocate 4)
+                    (.putShort (:amount procedure))
+                    (.putShort (:duration procedure))
+                    (.array))])
+             data)])
+         commands)]
+       (flatten)
+       (map #(if (not (bytes? %))
+               (vector (unsigned-to-signed %))
+               %))
+
+       (mapcat seq)
+       (byte-array)))


Add loop limit in alternation, since genome_alternation can call with crazy params; also fixed other bugs and made alternation return vector, not seq.

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -321,10 +321,10 @@
 (defn uniform-addition
   "Returns the individual with each element of its genome possibly preceded or followed by
   a new gene, with probability given by uniform-addition-rate."
-  [ind {:keys [uniform-addition-rate maintain-ancestors atom-generators]}]
+  [ind {:keys [uniform-addition-rate maintain-ancestors atom-generators] :as argmap}]
   (let [new-genome (vec (apply concat
                                (map #(if (< (lrand) uniform-addition-rate)
-                                      (lshuffle [% (random-plush-instruction-map atom-generators)])
+                                      (lshuffle [% (random-plush-instruction-map atom-generators argmap)])
                                       [%])
                                     (:genome ind))))]
     (make-individual :genome new-genome
@@ -345,17 +345,21 @@
         s2 (:genome parent2)
         new-genome (loop [i 0
                           use-s1 (lrand-nth [true false])
-                          result-genome []]
+                          result-genome []
+                          iteration-budget (+ (count s1) (count s2))]
                      (if (or (>= i (count (if use-s1 s1 s2))) ;; finished current program
-                             (> (count result-genome) max-points)) ;; runaway growth
-                       (seq result-genome);; Return, converting back into a sequence
+                             (> (count result-genome) max-points) ;; runaway growth
+                             (<= iteration-budget 0)) ;; looping too long
+                       result-genome ;; Return
                        (if (< (lrand) alternation-rate)
                          (recur (max 0 (+' i (Math/round (*' alignment-deviation (gaussian-noise-factor)))))
                                 (not use-s1)
-                                result-genome)
+                                result-genome
+                                (dec iteration-budget))
                          (recur (inc i)
                                 use-s1
-                                (conj result-genome (nth (if use-s1 s1 s2) i))))))]
+                                (conj result-genome (nth (if use-s1 s1 s2) i))
+                                (dec iteration-budget)))))]
     (make-individual :genome new-genome
                      :history (:history parent1)
                      :ancestors (if maintain-ancestors


Experiment more with meta-errors

Experiment more with meta-errors

--- src/clojush/pushgp/genetic_operators.clj
+++ src/clojush/pushgp/genetic_operators.clj
@@ -1092,6 +1092,21 @@
            (not (zero? c2-diff))
            (not= c1-diff c2-diff)))))

+(defn four-generation-reproductive-difference-diversifying?
+  [ind argmap]
+  (let [g (:genome ind)
+        child1 (produce-child-genome-by-autoconstruction g g argmap)
+        child2 (produce-child-genome-by-autoconstruction child1 g g argmap)
+        child3 (produce-child-genome-by-autoconstruction child2 g g argmap)
+        c1-diff (sequence-similarity g child1)
+        c2-diff (sequence-similarity g child2)
+        c3-diff (sequence-similarity g child3)]
+    (assoc ind :diversifying
+      (and (not (zero? c1-diff))
+           (not (zero? c2-diff))
+           (not (zero? c3-diff))
+           (distinct? c1-diff c2-diff c3-diff)))))
+
 (defn use-mate-diversifying?
   [ind argmap]
   (let [g (:genome ind)
@@ -1218,6 +1233,7 @@
                 :three-gens-size-and-instruction three-gens-size-and-instruction-diversifying?
                 :diffmeans diffmeans-diversifying?
                 :minimal-reproductive-difference minimal-reproductive-difference-diversifying?
+                :four-generation-reproductive-difference four-generation-reproductive-difference-diversifying?
                 :use-mate use-mate-diversifying?
                 :use-mate-differently use-mate-differently-diversifying?
                 :si-and-mate-use si-and-mate-use-diversifying?


disable last-clusters for now

disable last-clusters for now

--- src/polismath/conversation.clj
+++ src/polismath/conversation.clj
@@ -100,7 +100,7 @@
                 (sort-by :id
                   (kmeans (assoc rating-mat :matrix proj)
                     (:base-k opts')
-                    :last-clusters (:base-clusters conv)
+;                    :last-clusters (:base-clusters conv)
                     :cluster-iters (:base-iters opts')))))

        :group-clusters
@@ -109,7 +109,7 @@
                 (sort-by :id
                   (kmeans (xy-clusters-to-nmat2 base-clusters)
                     (choose-group-k base-clusters)
-                    :last-clusters (:group-clusters conv)
+ ;                   :last-clusters (:group-clusters conv)
                     :cluster-iters (:group-iters opts')))))

        :bid-to-pid (plmb/fnk [base-clusters]