:steam_locomotive::coffee::coffee::coffee::coffee::afterburner:

--- src/clj/mokkameister/train.clj
+++ src/clj/mokkameister/train.clj
@@ -12,6 +12,7 @@

 (def ^:private train-endings {":dash:" 8
                               "" 2
+                              ":afterburner:" 2
                               ":sparkles:" 2
                               ":exclamation:" 1})


Always use request-animation when starting a game

Makes it easier to profile since previously the first frame was it's own
function call that happened to call request-animation.

--- src/cljs/chocolatier/core.cljs
+++ src/cljs/chocolatier/core.cljs
@@ -4,7 +4,7 @@
             [chocolatier.game :refer [init-state]]
             [chocolatier.engine.systems.tiles :refer [load-tilemap]]
             [chocolatier.engine.systems.audio :refer [load-samples]]
-            [chocolatier.engine.core :refer [game-loop-with-stats *running* *state*]]))
+            [chocolatier.engine.core :refer [request-animation game-loop-with-stats *running* *state*]]))

 (defn -start-game!
@@ -29,7 +29,7 @@
     (dom/append! (sel1 :body) (.-domElement stats-obj))

     ;; Start the game loop
-    (game-loop-with-stats state stats-obj)))
+    (request-animation #(game-loop-with-stats state stats-obj))))

 (defn start-game!
   "Load all assets and call the tilemap loader. This is some async wankery to


Now using Mithril routing for URL param

Now using Mithril routing for URL param

This is needed to support bookmarklet use
(among other things)

--- src/cljs/modern_cljs/core.cljs
+++ src/cljs/modern_cljs/core.cljs
@@ -149,6 +149,8 @@
     (m "div" nil ["Count: " count " " (page start - count) " " (page start + count)])))

 (defn ctrl []
+  (let [par (.param (.-route js/m) "hih")]
+    (println "initial param was:" par))
   (if (not (:data db nil))
     (do (println "Calling major Tom")
         (fetch "/data.json"))))
@@ -165,9 +167,10 @@
 (enable-console-print!)
 (println "Hello All!!!")
 (js/foo)
-(.mount js/m
-  (.getElementById js/document "app")
-  (clj->js app))
+(.route js/m
+        (.getElementById js/document "app")
+        "/"
+        (clj->js {"/" app}))

 ;; (require '[modern-cljs.core :as c] :reload)
 ;; alt cmd e -> search repl history


Fixed var name.

Fixed var name.

--- src/dragon/content/rfc5322.clj
+++ src/dragon/content/rfc5322.clj
@@ -6,14 +6,14 @@
             [rfc5322.dev :as rfc-dev]))

 (defn rfc5322-names->metadata-names
-  "Given a form name, convert to a keyword column name."
-  [^clojure.lang.Keyword form-name]
-  (case form-name
+  "Given a field name, convert to a keyword column name."
+  [^clojure.lang.Keyword field-name]
+  (case field-name
     :subject :title
     :from :author
     :keywords :tags
     :comments :comment-link
-    form-name))
+    field-name))

 (defn remap-keys
   "Update the keys in a map, converting them with the provided function."


API and non-API call handler

API and non-API call handler

--- src/emender_service/server.clj
+++ src/emender_service/server.clj
@@ -21,17 +21,27 @@
                 (http-response/content-type content-type))
             (println "return-file(): can not access file: " (.getName file)))))

+(defn api-call-handler
+    [uri method]
+    nil)
+
+(defn non-api-call-handler
+    [request uri]
+    (condp = uri
+        "/favicon.ico"         (return-file "favicon.ico"         "image/x-icon")
+        "/emender-service.css" (return-file "emender-service.css" "image/x-icon")
+        "/bootstrap.min.css"   (return-file "bootstrap.min.css"   "text/css")
+        "/emender-service.css" (return-file "emender-service.css" "text/css")
+        "/bootstrap.min.js"    (return-file "bootstrap.min.js"    "application/javascript")
+        "/"                    (render-front-page request)))
+
 (defn handler
     "Handler that is called by Ring for all requests received from user(s)."
     [request]
     (println "request URI: " (request :uri))
-    (let [uri (request :uri)]
-        (condp = uri
-            "/favicon.ico"         (return-file "favicon.ico"         "image/x-icon")
-            "/emender-service.css" (return-file "emender-service.css" "image/x-icon")
-            "/bootstrap.min.css"   (return-file "bootstrap.min.css"   "text/css")
-            "/emender-service.css" (return-file "emender-service.css" "text/css")
-            "/bootstrap.min.js"    (return-file "bootstrap.min.js"    "application/javascript")
-            "/"                    (render-front-page request)
-    )))
+    (let [uri    (:uri request)
+          method (:request-method request)]
+         (if (.startsWith uri "/v1")
+             (api-call-handler uri method)
+             (non-api-call-handler request uri))))


Enable more helpful validation of task map entries

--- src/onyx/static/validation.clj
+++ src/onyx/static/validation.clj
@@ -86,16 +86,15 @@
     (name-and-type-not-equal entry)
     (min-and-max-peers-sane entry)
     (min-max-n-peers-mutually-exclusive entry)
-    (schema/validate TaskMap entry)
-    #_(try
-        (schema/validate TaskMap entry)
-        (catch Exception e
-          (try (let [friendly-exception (task-map-schema-exception->help e)]
-                 (throw (ex-info (format "Task %s failed validation. Error: %s" (:onyx/name entry) friendly-exception)
-                                 {:explanation friendly-exception})))
-               (catch Exception fe
-                 ;; Throw original exception. We have obviously messed up providing a friendlier one
-                 (throw e)))))))
+    (try
+      (schema/validate TaskMap entry)
+      (catch Exception e
+        (let [friendly-exception (try (task-map-schema-exception->help e)
+                                      (catch Exception fe
+                                        ;; Throw original exception. We have obviously messed up providing a friendlier one
+                                        (throw e)))]
+          (throw (ex-info (format "Task %s failed validation. Error: %s" (:onyx/name entry) friendly-exception)
+                          {:explanation friendly-exception})))))))

 (defn validate-workflow-names [{:keys [workflow catalog]}]
   (when-let [missing-names (->> workflow


Name the play functionin before 'before' because it seems easiest to remember if the play function matches the namespace.

--- src/overtunes/songs/before.clj
+++ src/overtunes/songs/before.clj
@@ -95,7 +95,7 @@
     (play-melody melody-line organ-cornet metro)
     (play-chords (concat chords finish) metro)))

-(defn before-full []
+(defn before []
   "The full version of 'Before', grave."
   (play (concat start middle start middle variation) (metronome 30)))


Bug-fix for new reagent 0.6.0

Bug-fix for new reagent 0.6.0

Now `true` or `false` is passed to checkbox rather than `nil` or `item-id`

--- src/re_com/selection_list.cljs
+++ src/re_com/selection_list.cljs
@@ -41,7 +41,7 @@
      :attr {:on-click (handler-fn (when-not disabled?
                                     (on-change (check-clicked selections item-id (not (selections item-id)) required?))))}
      :child [checkbox
-             :model (selections item-id)
+             :model (some? (selections item-id))
              :on-change #()                                 ;; handled by enclosing box
              :disabled? disabled?
              :label-style (label-style (selections item-id) as-exclusions?)


update extemp comments to mention that this now references external piano samples

--- examples/extemp_piano.clj
+++ examples/extemp_piano.clj
@@ -23,13 +23,19 @@
 ;;                  (random '(2 7 10))
 ;;                  (random '(0 8))))))

+;;Piano samples downloaded from: http://blackhole12.newgrounds.com/news/post/92464
 (def piano-samples (load-samples "~/Desktop/samples/MIS_Stereo_Piano/Piano/*LOUD*"))
+
+(defn matching-notes
+  [note]
+  (filter #(if-let [n (match-note (:name %))]
+             (= note (:midi-note n)))
+          piano-samples))
+
 (defn sampled-piano
   ([note] (sampled-piano note 1))
   ([note vol]
-     (if-let [sample (first
-                      (filter #(if-let [n (match-note (:name %))] (= note (:midi-note n)))
-                              piano-samples))]
+     (if-let [sample (first (matching-notes note))]
        (stereo-player sample :vol vol))))

 (def instrument sampled-piano)
@@ -44,9 +50,10 @@
 (def range-variation 10)
 (def range-period 8)

-;;this assumes you have the mda-piano available. Feel fre to eplace piano with
-;;a different synth which accepts a MIDI note as its first arg such as tb303.
-;;(def instrument tb303)
+;;this assumes you have the mda-piano or the piano samples available. Feel free
+;;to eplace piano with a different synth which accepts a MIDI note as its first
+;;arg such as tb303.
+;; (def instrument tb303)

 (defn beat-loop
   [metro beat chord-idx]
@@ -58,6 +65,7 @@
           (rand-chord (+ root tonic) chord-name (count beat-offsets) (cosr beat range-variation  max-range range-period) )
           beat-offsets))
     (apply-at (metro (inc beat)) #'beat-loop [metro (inc beat) nxt-chord-idx])))
+(stop)

 ;;start the music:
 (beat-loop metro (metro) 0)


🔥 Remove old config validation code

🔥 Remove old config validation code

Why:
- The config is already being validated better using schema

--- src/territory_bro/main.clj
+++ src/territory_bro/main.clj
@@ -69,8 +69,4 @@
       (stop-app))))

 (defn -main [& _args]
-  (log-mount-states (mount/start #'config/env))
-  (when (nil? (:database-url config/env))
-    (log/error "Database configuration not found, :database-url must be set before running")
-    (System/exit 1))
   (start-app))


Update to latest aleph

Update to latest aleph

--- modules/aleph/project.clj
+++ modules/aleph/project.clj
@@ -1,11 +1,11 @@
 ;; Copyright © 2014 JUXT LTD.

-(defproject juxt.modular/aleph "0.0.4"
+(defproject juxt.modular/aleph "0.0.5"
   :description "A modular extension that provides support for aleph"
   :url "https://github.com/juxt/modular/tree/master/modules/aleph"
   :license {:name "The MIT License"
             :url "http://opensource.org/licenses/MIT"}
-  :dependencies [[aleph "0.4.0-beta1" :exclusions [org.clojure/clojure]]
+  :dependencies [[aleph "0.4.0-beta3" :exclusions [org.clojure/clojure]]
                  [prismatic/schema "0.3.5"]
                  [juxt.modular/ring "0.5.2"]
                  ]


Add code that indicates completed tasks.

--- src/todo_repl_webapp/views.clj
+++ src/todo_repl_webapp/views.clj
@@ -28,7 +28,9 @@
   [task-map]
   (core/html
       [:div.col-md-7.col-md-offset-1
-        [:p.lead (:name task-map)]]
+        (if (= :complete (:status task-map))
+            [:p.lead.text-muted [:strike (:name task-map)]]
+            [:p.lead (:name task-map)])]
       [:div.col-md-2
         (if-not (nil? (:context task-map))
           [:p.text-muted (:context task-map)])]


add hack for midi+interval FR

add hack for midi+interval FR

--- resources/duckling/rules/fr.time.clj
+++ resources/duckling/rules/fr.time.clj
@@ -463,7 +463,7 @@
   (interval %1 %3 true)

   "de <time-of-day> - <time-of-day> (interval)"
-  [#"(?i)de" {:form :time-of-day} #"\-|[aà]|au|jusqu'(au|[aà])" {:form :time-of-day}]
+  [#"(?i)(midi )?de" {:form :time-of-day} #"\-|[aà]|au|jusqu'(au|[aà])" {:form :time-of-day}] ;hack to fix midi + interval intersection
   (interval %2 %4 true)

   "entre <time-of-day> et <time-of-day> (interval)"


refer missed throw+

refer missed throw+

--- src/pc/email.clj
+++ src/pc/email.clj
@@ -11,7 +11,7 @@
             [pc.models.cust :as cust-model]
             [pc.models.doc :as doc-model]
             [pc.utils]
-            [slingshot.slingshot :refer (try+)]))
+            [slingshot.slingshot :refer (throw+ try+)]))

 (defn emails-to-send [db eid]
   (set (map first


Parallalize autoscale to run at same time as main job launches. (#2155)

* Let autoscale run in parallel with main launches.

Co-authored-by: Scott Crosby <23e8f75489aff47cf2cd5a529e9a769a24e9501c@twosigma.com>

--- scheduler/src/cook/scheduler/scheduler.clj
+++ scheduler/src/cook/scheduler/scheduler.clj
@@ -1226,9 +1226,6 @@
                             :max-jobs-for-autoscaling-scaled max-jobs-for-autoscaling-scaled
                             :number-considerable-jobs number-considerable-jobs
                             :number-unmatched-jobs number-unmatched-jobs})
-      ;; This call needs to happen *after* launch-matched-tasks!
-      ;; in order to avoid autoscaling tasks taking up available
-      ;; capacity that was already matched for real Cook tasks.
       (trigger-autoscaling! filtered-autoscalable-jobs pool-name compute-clusters job->acceptable-compute-clusters-fn))))

@@ -1402,17 +1399,22 @@
                     _ (when-not no-matches?
                         ; This has to happen before we do handle-resource-offers-autoscaling-helper so that it can see
                         ; the updated
+                        (log-structured/debug (print-str "Updated pool-name->pending-jobs-atom:" @pool-name->pending-jobs-atom)
+                                              {:pool pool-name})
                         (swap! pool-name->pending-jobs-atom
                                remove-matched-jobs-from-pending-jobs
-                               matched-job-uuids pool-name)
-                        (log-structured/debug (print-str "Updated pool-name->pending-jobs-atom:" @pool-name->pending-jobs-atom)
-                                              {:pool pool-name})
+                               matched-job-uuids pool-name))
+                    autoscale-future (future
+                                       (handle-resource-offers-autoscaling-helper
+                                         pool-name->pending-jobs-atom
+                                         user->usage user->quota pool-name compute-clusters
+                                         job->acceptable-compute-clusters-fn number-considerable-jobs number-unmatched-jobs))
+                    ; This creates instances for each compute cluster and launches (parallel across compute clusters)
+                    _ (when-not no-matches?
                         (launch-matched-tasks! matches conn db (:fenzo fenzo-state) mesos-run-as-user pool-name)
-                        (update-host-reservations! rebalancer-reservation-atom matched-job-uuids))
-                    _ (handle-resource-offers-autoscaling-helper
-                        pool-name->pending-jobs-atom
-                        user->usage user->quota pool-name compute-clusters
-                        job->acceptable-compute-clusters-fn number-considerable-jobs number-unmatched-jobs)]
+                        (update-host-reservations! rebalancer-reservation-atom matched-job-uuids))]
+                ; Block until autoscale is done.
+                @autoscale-future
                 matched-head-or-no-matches?))
           (catch Throwable t
             (meters/mark! handle-resource-offer!-errors)


Indent sub-entries in toc for each format in neu-im-sortiment


rf: any? is now defined in terms of arg matching protocols


Trimming down core namespace

Trimming down core namespace


doc-generator: rename 'Return' section to 'Return Type' (close #23)

--- scripts/cljs-api-parser/src/core.clj
+++ scripts/cljs-api-parser/src/core.clj
@@ -395,7 +395,7 @@
     (keep identity
       [(cljsdoc-section "Name" (:full-name item))
        (cljsdoc-section "Type" (:fn-or-macro item))
-       (cljsdoc-section "Return" (:return-type item))
+       (cljsdoc-section "Return Type" (:return-type item))
        (cljsdoc-section "Docstring" (:docstring item))
        (cljsdoc-section "Signature" (join "\n" (:signatures item)))
        (cljsdoc-section "Filename" (:filename item))


render current track images from url

render current track images from url

--- src/frontend/renderer.cljs
+++ src/frontend/renderer.cljs
@@ -1,5 +1,6 @@
 (ns moomoo-frontend.renderer
-  (:require [om.core :as om  :include-macros true]
+  (:require [clojure.string :as string]
+            [om.core :as om  :include-macros true]
             [om.dom  :as dom :include-macros true]
             [moomoo-frontend.core :as core]
             [moomoo-frontend.player :as player]))
@@ -81,26 +82,8 @@

 (defn current-track-tags-view [data owner]
   (reify
-    om/IDidUpdate
-    (did-update [_ _ _]
-      (let [prev-state (om/get-state owner)]
-        (if-not (nil? (:current-track-id data))
-          (if-not (= (:track-id prev-state) (:current-track-id data))
-            (let [picture-data (first
-                                 (.-picture
-                                   (.-tags
-                                     (core/get-music-info-from-id (:current-track-id data)))))]
-              (if (nil? picture-data)
-                (om/set-state! owner{:cover-image nil
-                                     :track-id (:current-track-id data)})
-                (let [picture-format (.-format picture-data)
-                      picture-buffer (.-data picture-data)
-                      base64-data (js/base64ArrayBuffer picture-buffer)
-                      data-uri (str "data:" "image/jpeg" ";base64," base64-data)]
-                  (om/set-state! owner {:cover-image data-uri
-                                        :track-id (:current-track-id data)}))))))))
-    om/IRenderState
-    (render-state [this state]
+    om/IRender
+    (render [this]
       (if-not (nil? (:current-track-id data))
         (let [music-info (core/get-music-info-from-id (:current-track-id data))
               tags (.-tags music-info)]
@@ -109,11 +92,12 @@
             (dom/div #js {:style #js {:float "left"
                                       :width "10%"
                                       :height "10%"}}
-              (if (nil? (:cover-image state))
+              (if (nil? (.-picture tags))
                 (dom/img #js {:src grey-out-image
                               :style #js {:width "100%"
                                           :height "100%"}})
-                (dom/img #js {:src (:cover-image state)
+                (dom/img #js {:src (str (first (string/split (.-href (.-location js/window))
+                                                             #"/rooms")) (.-picture tags))
                               :style #js {:width "100%"
                                           :height "100%"}})))
             (dom/div nil


change url-base

change url-base

--- sample/_config.clj
+++ sample/_config.clj
@@ -11,8 +11,8 @@
  :post-filename-format "$(year)-$(month)/$(filename)"
  ;;:post-filename-format "article/$(year)/$(month)/$(day)_$(filename)" ;; o-blog format
  :compile-with-post ["index.html" "archives.html" "atom.xml"]
- :url-base "/misaki-orgmode/"
- ;;:url-base "/"
+ ;;:url-base "/misaki-orgmode/"
+ :url-base "/"
  :posts-per-page 2
  :recent-posts-num 2
  :emacs "/usr/local/bin/emacs"


Improvements to the checkout: Don't attempt to use password authentication. Abort on checkout failure. Ensure the git url is an ssh url

--- backend/src/circle/backend/action/vcs.clj
+++ backend/src/circle/backend/action/vcs.clj
@@ -1,16 +1,18 @@
 (ns circle.backend.action.vcs
   "build actions for checking out code."
-  (:require [clj-url.core :as url])
+  (:require [circle.backend.action.bash :as bash])
+  (:require [circle.backend.build :as build])
+  (:require [circle.sh :as sh])
+  (:require fs)
+  (:use [arohner.utils :only (inspect)])
+  (:use [circle.backend.action :only (defaction abort!)])
+  (:use [circle.backend.action.bash :only (remote-bash-build)])
+  (:use [circle.backend.action.user :only (home-dir)])
+  (:use [circle.backend.github-url :only (->ssh)])
   (:use [circle.util.except :only (throw-if-not)])
-  (:use [circle.backend.action :only (defaction)])
   (:use [clojure.tools.logging :only (infof)])
-  (:require [circle.backend.action.bash :as bash])
-  (:require [circle.sh :as sh])
-  (:use [circle.backend.action.bash :only (remote-bash-build)])
-  (:require [circle.backend.build :as build])
-  (:require fs)
   (:use midje.sweet)
-  (:use [circle.backend.action.user :only (home-dir)]))
+  (:require [clj-url.core :as url]))

 (defn vcs-type
   "returns the VCS type for a given url. Returns one of :git, :hg, :svn or nil, if unknown"
@@ -30,13 +32,15 @@
   (throw-if-not (pos? (.length url)) "url must be non-empty")
   (throw-if-not (pos? (.length path)) "path must be non-empty")
   (println "checking out" url " to " path)
-  (if revision
-    (remote-bash-build build (sh/quasiquote
-                              (git clone ~url ~path --no-checkout)
-                              (cd ~path)
-                              (git checkout ~revision)))
-    (remote-bash-build build (sh/quasiquote
-                              (git clone ~url ~path --depth 1)))))
+  (let [checkout-cmd (if revision
+                       (sh/quasiquote
+                        (git clone ~url ~path --no-checkout)
+                        (cd ~path)
+                        (git checkout ~revision))
+                       (sh/quasiquote
+                        (git clone ~url ~path --depth 1)))]
+    (remote-bash-build build checkout-cmd
+                       :environment {"SSH_ASKPASS" false})))

 (defmethod checkout-impl :default [{:keys [vcs]}]
   (throw (Exception. "don't know how to check out code of type" vcs)))
@@ -49,8 +53,10 @@
   (fn [build]
     (let [dir (checkout-dir build)
           result (-> (checkout-impl {:build build
-                                     :url (-> @build :vcs-url)
+                                     :url (->ssh (-> @build :vcs-url))
                                      :path dir
                                      :vcs (-> @build :vcs-url vcs-type)
                                      :revision (-> @build :vcs-revision)}))]
+      (when (not= 0 (-> result :exit))
+        (abort! build "checkout failed"))
       result)))


add Jason Marmon to hall of fame

add Jason Marmon to hall of fame

--- src-cljs/frontend/components/security.cljs
+++ src-cljs/frontend/components/security.cljs
@@ -23,6 +23,7 @@
          [:section
           [:p "We would like to thank the following people for responsibly disclosing security issues to us."]]
          [:ul
+          [:li [:a {:href "https://github.com/jtmarmon"} "Jason Marmon"] " (2014-12-15)"]
           [:li [:a {:href "https://twitter.com/exploitprotocol"} "Aditya Agrawal"] " (2014-04-07)"]
           [:li [:a {:href "http://kevinmccarthy.org/"} "Kevin McCarthy"] " (2014-04-07)"]
           [:li [:a {:href "https://twitter.com/gazly"} "J.m.Gazzaly"] " (2014-03-27)"]


Add on-input for the editor

Add on-input for the editor

--- src-frontend/cljs/cljs_webrepl/editor.cljs
+++ src-frontend/cljs/cljs_webrepl/editor.cljs
@@ -23,12 +23,14 @@
                           (js/CodeMirror.normalizeKeyMap))))

 (defn cm-did-mount [node editor {:keys [on-change on-key-down] :as options} text]
-  (let [element (-> node (r/dom-node))
+  (let [element (r/dom-node node)
         cm-opts (cm-options options)
         editor  (reset! editor (js/CodeMirror.fromTextArea element cm-opts))]
     (.setValue editor text)
     (when on-change
-      (.on editor "change" on-change))))
+      (.on editor "change" on-change))
+    (when on-input
+      (.on editor "input" on-input))))

 (defn cm-will-update [node editor [_ _ text]]
   (debugf "Update")


Add more info to sensors.

Add more info to sensors.

--- src-cljs/kixi/hecuba/main.cljs
+++ src-cljs/kixi/hecuba/main.cljs
@@ -61,6 +61,7 @@
                                                         :sort [:entity-id :device-id]}}
                                      :sensors {:name "Sensors"
                                                :header {:cols {"type" {:label "Type"}
+                                                               "unit" {:label "Unit"}
                                                                "period" {:label "Period"}
                                                                "deviceId" {:label "Device"}}
                                                         :sort ["type"]}}}


Galleon : Test : Adding passing test.check defspec

Copied the failing defspec and fixed it by adding the
:key-fn arg to the json/read-str function.

--Tom

--- test/gangway/message_tests.clj
+++ test/gangway/message_tests.clj
@@ -23,3 +23,14 @@
                        json/json-str
                        json/read-str))))

+(defspec fixed-abstract-message
+  ;; testing that reading EDN data structure into JSON and converting
+  ;; back yields the same data structure.
+  ;; Note: This test fails. Committing failing test to show how
+  ;; test.check reports failures.
+  (prop/for-all [ab-message (gen/vector (gen/map gen/keyword gen/string))]
+    (= ab-message (-> ab-message
+                      (json/json-str)
+                      (json/read-str :key-fn keyword))))
+
+)


Adding msging to test wait loops to keep circleci alive

--- test/kixi/integration/base.clj
+++ test/kixi/integration/base.clj
@@ -18,6 +18,9 @@

 (def wait-tries (Integer/parseInt (env :wait-tries "30")))
 (def wait-per-try (Integer/parseInt (env :wait-per-try "100")))
+(def wait-emit-msg (Integer/parseInt (env :wait-emit-msg "5000")))
+
+(def every-count-tries-emit (int (/ wait-emit-msg wait-per-try)))

 (defmacro is-submap
   [expected actual]
@@ -125,9 +128,9 @@

 (defn wait-for-url
   ([url]
-   (wait-for-url url wait-tries nil))
-  ([url tries last-result]
-   (if (pos? tries)
+   (wait-for-url url wait-tries 1 nil))
+  ([url tries cnt last-result]
+   (if (<= cnt tries)
      (let [md (client/get url
                           {:accept :transit+json
                            :as :stream
@@ -136,8 +139,10 @@
                                           :decode t/read-handlers}})]
        (if (= 404 (:status md))
          (do
+           (when (zero? (mod cnt every-count-tries-emit))
+             (prn (str "Waited " cnt " times for " url)))
            (Thread/sleep wait-per-try)
-           (recur url (dec tries) md))
+           (recur url tries (inc cnt) md))
          md))
      last-result)))

@@ -174,14 +179,16 @@

 (defn wait-for-metadata-key
   ([id k]
-   (wait-for-metadata-key id k wait-tries nil))
-  ([id k tries lr]
-   (if (pos? tries)
+   (wait-for-metadata-key id k wait-tries 1 nil))
+  ([id k tries cnt lr]
+   (if (<= cnt tries)
      (let [md (get-metadata id)]
        (if-not (get-in md [:body k])
          (do
+           (when (zero? (mod cnt every-count-tries-emit))
+             (prn (str "Waited " cnt " times for " k " to be metadata for " id)))
            (Thread/sleep wait-per-try)
-           (recur id k (dec tries) md))
+           (recur id k tries (inc cnt) md))
          md))
      (throw (Exception. (str "Metadata key never appeared: " k ". Response: " lr))))))


changing box to absolute size, adding jail

--- cartagena-web/src/cartagena_web/core.cljs
+++ cartagena-web/src/cartagena_web/core.cljs
@@ -1,4 +1,4 @@
-(ns cartagena-web.core
+(ns ^:figwheel-always cartagena-web.core
   (:require [reagent.core :as reagent :refer [atom]]))

 (enable-console-print!)
@@ -9,16 +9,20 @@

 (defonce app-state (atom nil))

+(defn jail []
+  [:rect {:x 0 :y 0 :width 50 :height 90 :stroke "black" :fill "brown"}])
+
 (defn main-view []
   [:center
    [:h1 "CARTAGENA"
     [:div
      [:svg
-      {:view-box "0 0 500 400"
-       :width "100%"
-       :height "100%"}
-      [:rect {:x 0 :y 0 :width "100%" :height "100%" :stroke "black" :stroke-width "1" :fill "tan"}]
-      [:rect {:x 5 :y 5 :width "80%" :height "65%" :stroke "black" :stroke-width "0.5" :fill "burlywood"}]]]]])
+      {:view-box "0 0 800 600"
+       :width 800
+       :height 600}
+      [:rect {:x 0 :y 0 :width 800 :height 600 :stroke "black" :stroke-width "1" :fill "tan"}]
+      [:rect {:x 0 :y 0 :width 500 :height 400 :stroke "black" :stroke-width "0.5" :fill "burlywood"}]
+      (jail)]]]])

 (defn ^:export main []
   (when-let [app (. js/document (getElementById "app"))]


shuffle and reset players on start

shuffle and reset players on start

--- cartagena-web/src/cartagena_web/main.cljs
+++ cartagena-web/src/cartagena_web/main.cljs
@@ -5,7 +5,8 @@
 (enable-console-print!)

 (defonce app-state (atom nil))
-(defonce names (atom {:black nil :blue nil :green nil :orange nil :red nil}))
+(def empty-names {:black nil :blue nil :green nil :orange nil :red nil})
+(defonce names (atom empty-names))

 (defn set-name! [color name]
   (swap! names assoc color name))
@@ -104,8 +105,7 @@
    ;; transition 3
    {:x 450 :y 210}
    ;; ship
-   {:x 400 :y 240}
-   ])
+   {:x 400 :y 240}])

 ;; TODO: duplicated from server code
 (defn active-player
@@ -117,7 +117,6 @@
   (.log js/console (str "ERROR [" status "] " status-text)))

 (defn on-new-game [response]
-  (println "on-new-game" response)
   (reset! app-state response))

 (defn new-game! []
@@ -126,11 +125,11 @@
                         (get-name :blue) (conj {:name (get-name :blue) :color :blue})
                         (get-name :green) (conj {:name (get-name :green) :color :green})
                         (get-name :orange) (conj {:name (get-name :orange) :color :orange})
-                        (get-name :red) (conj {:name (get-name :red) :color :red})
-                        )]
+                        (get-name :red) (conj {:name (get-name :red) :color :red}))]
   (reset! app-state (dissoc @app-state :select-players))
+  (swap! names empty-names)
   (ajax/POST "http://localhost:3000/new-game"
-             {:params {:players players}
+             {:params {:players (shuffle players)}
               :handler on-new-game
               :error-handler on-error})))


Minor reconfiguration.

Minor reconfiguration.

--- src/angelic/search/implicit/dash_astar.clj
+++ src/angelic/search/implicit/dash_astar.clj
@@ -247,16 +247,16 @@
 ;; Doing it all with stubs makes subsumption forwarding easier.
 (defn- add-sp-child-stub! [sp child-stub up?]
   (assert (not (terminal? sp)))
-  (let [ts (sp-ts sp)]
-   (connect-and-watch-stub! sp child-stub up?
-     (fn [child-sp]
-       (summaries/summary-changed-local! sp)
-       (when (identical? (ts-stub ts) (stub sp))
-         (let [child-ts (sp-ts child-sp)]
-           (summaries/connect! ts child-ts)
-           (summaries/connect-subsumed! ts child-ts)
-           (summaries/summary-changed! ts)))
-       (add-output! sp child-sp)))))
+  (let [ts (sp-ts sp)
+        underived? (identical? (ts-stub ts) (stub sp))]
+    (connect-and-watch-stub! sp child-stub up?
+      (fn [child-sp]
+        (summaries/summary-changed-local! sp)
+        (when underived?
+          (summaries/connect! ts (tree-summarizer child-stub))
+          (summaries/connect-subsumed! ts (tree-summarizer child-stub))
+          (summaries/summary-changed! ts))
+        (add-output! sp child-sp)))))

 (comment
 ;; TODO: propagation could be done more efficiently using a separate,


these do nothing

these do nothing

--- server/project.clj
+++ server/project.clj
@@ -30,9 +30,7 @@
                     :datomic {:config "resources/datomic-transactor.properties"
                               :db-uri "datomic:free://localhost:4334/gp2"}}
               :datomic {:config "resources/datomic-transactor.properties"
-                        :db-uri "datomic:free://localhost:4334/gp2"
-                        :username ""
-                        :password ""}}
+                        :db-uri "datomic:free://localhost:4334/gp2"}}

              :production
              {:env {:html-paths ["public"]}}}


Fix version number

Fix version number

--- server/project.clj
+++ server/project.clj
@@ -1,4 +1,4 @@
-(defproject nightweb-server/Nightweb "0.1.0-SNAPSHOT"
+(defproject nightweb-server/Nightweb "0.0.1-SNAPSHOT"
   :description "FIXME: write description"
   :url "http://example.com/FIXME"
   :license {:name "Public Domain"


rabbit failure tolerance on partition size change

manually tested, no tests yet

--- hyrax/src/clojure/hyrax/dist/rabbit.clj
+++ hyrax/src/clojure/hyrax/dist/rabbit.clj
@@ -375,25 +375,24 @@
   (when (log/enabled? :debug)
     (log-peer-changes last-peers peers peer-id))

-  (when (not= last-size new-size)
-
-    (log/infof "[%s] detected %s consumer(s), using bucket partition size of %s (was %s)"
-              peer-id (count peers) new-size last-size)
-
-    (stop-bucket-consumer! consumer)
-
-    (let [start-fn #(try
-                      (start-bucket-consumer! conn queue-name new-size peer-id consumer true)
-                      (catch Exception e
-                        (log/errorf e "[%s] bucket-consumer start failed" peer-id)
-                        nil))]
-      (loop []
-        (let [result (start-fn)]
-          result
-          (do
-            (interruptible-sleep 2000 peer-id)
-            (log/infof "[%s] retrying bucket-consumer startup" peer-id)
-            (recur)))))))
+  (let [start-fn #(try
+                    (start-bucket-consumer! conn queue-name new-size peer-id consumer)
+                    (catch Exception e
+                      (log/errorf e "[%s] bucket-consumer start failed" peer-id)
+                      nil))]
+
+    (if (not= last-size new-size)
+
+      (do
+        (log/infof "[%s] detected %s consumer(s), using bucket partition size of %s (was %s)"
+                   peer-id (count peers) new-size last-size)
+        (stop-bucket-consumer! consumer) ;; doesn't throw exceptions on errors
+        (start-fn))
+
+      (let [{:keys [status]} @consumer]
+        (when (= status :stopped)
+          (log/infof "[%s] retrying bucket-consumer startup" peer-id)
+          (start-fn))))))

 (defn peer-id-old []
   (let [hostname (-> (java.net.InetAddress/getLocalHost) .getHostName)
@@ -490,7 +489,7 @@

     (defn- dist-add []
       (swap! distributors
-             #(conj % (let [conn (rmq/connect {:vhost "boofa"})
+             #(conj % (let [conn (rmq/connect {:vhost "boofa" :requested-heartbeat 1 :connection-timeout 1})
                             scheduler (Executors/newScheduledThreadPool 1)
                             buckets (->> (range 100) (map str) (into []))]
                         (start-bucket-distributor! conn "bucket-too" buckets scheduler {}))))
@@ -524,7 +523,3 @@
   (release! consumer (buckets! consumer))
   )

-
-;; todo: is it a good idea to just restart the distributor entirely, periodically?
-;; just in case something goes wrong with it?
-;; need to do failure testing


Remove unnecessary comment

Remove unnecessary comment

--- src/server/clojure_template/templates/layouts.clj
+++ src/server/clojure_template/templates/layouts.clj
@@ -3,7 +3,6 @@
             [hiccup.page :refer [html5 include-css include-js]]
             [ring.middleware.anti-forgery :refer [*anti-forgery-token*]]))

-;<csrf-meta-tag csrf=data.layoutData.csrf />
 (defn application [& content]
   (html5 [:head
           [:meta {:charset "utf-8"}]


Fix size extraction. Close #5.

Fix size extraction. Close #5.

--- src/clj/quil_site/controllers/sketches.clj
+++ src/clj/quil_site/controllers/sketches.clj
@@ -8,9 +8,10 @@
             [me.raynes.fs :as fs]
             [quil-site.views.sketches :as views]
             [quil-site.examples :refer [get-example-source]]
-            [clojure.tools.reader.edn :as edn]
+            [clojure.tools.reader :as reader]
             [clojure.tools.reader.reader-types :refer [string-push-back-reader]]
-            [clojure.core.cache :as cache]))
+            [clojure.core.cache :as cache]
+            [cljs.tagged-literals :as tags]))

 (def test-source "(ns my.core
   (:require [quil.core :as q :include-macros true]
@@ -50,11 +51,15 @@
             (try
               (let [reader (string-push-back-reader text)
                     endof (gensym)]
-                (->> #(edn/read {:eof endof} reader)
-                     (repeatedly)
-                     (take-while #(not= % endof))
-                     (doall)))
-              (catch Exception e '())))
+                (binding [reader/*read-eval* false
+                          reader/*data-readers* tags/*cljs-data-readers*]
+                  (->> #(reader/read reader false endof)
+                       (repeatedly)
+                       (take-while #(not= % endof))
+                       (doall))))
+              (catch Exception e
+                (println e)
+                '())))
           (defsketch? [form]
             (and (list? form)
                  (symbol? (first form))


add more constraints on s/obj to prevent [s/obj H:ditransitive-vp-nonphrasal-head-1]

--- src/babel/english/grammar.cljc
+++ src/babel/english/grammar.cljc
@@ -326,8 +326,8 @@
                                                 :reflexive reflexive}}}}}))
    (unify-check
     {:rule "s/obj"}
-    (let [object-synsem (atom {:top :top})
-          subject-synsem (atom :top)]
+    (let [object-synsem (atom {:cat :noun})
+          subject-synsem (atom {:cat :noun :subcat []})]
       (unify-check head-last
                    head-principle
                    {:comp {:synsem subject-synsem}


add subcategorization for "disappoint"

add subcategorization for "disappoint"

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -515,8 +515,9 @@
             :english {:past "drove"}}

    "disappoint" {:synsem {:cat :verb
-                          :sem {:pred :deludere}}}
-
+                          :sem {:pred :deludere}
+                          :subcat {:2 {:cat :noun
+                                       :sem {:human true}}}}}
    "do" {:synsem {:cat :verb
                   :sem {:pred :do}}
          :english {:past "did"


addedabrazar

addedabrazar

--- src/babel/espanol/lexicon.cljc
+++ src/babel/espanol/lexicon.cljc
@@ -66,6 +66,9 @@
    "abandonar" {:synsem {:cat :verb
                          :sem {:pred :abandon}}}

+   "abrazar" {:synsem {:cat :verb
+                         :sem {:pred :abrazar}}}
+
    "acabar" {:synsem {:cat :verb
                       :sem {:pred :finish}}}


“lavorare”: subject must be human

“lavorare”: subject must be human

--- src/babel/italiano/lexicon.clj
+++ src/babel/italiano/lexicon.clj
@@ -1201,7 +1201,8 @@
                                      :sem subject-semantics}}}})

    "lavorare"  {:synsem {:cat :verb
-                         :sem {:pred :work-human}}}
+                         :sem {:subj {:human true}
+                               :pred :work-human}}}
    "le"
    {:synsem {:cat :det
              :def :def


Change function name ppr -> paragraph-properties in wpml

--- src/bakyeono/litedocx/wpml.clj
+++ src/bakyeono/litedocx/wpml.clj
@@ -349,7 +349,7 @@
         (node :w:basedOn {:w:val "a0"}) ; Parent Style ID
         (run-properties options)))

-(defn- ppr
+(defn- paragraph-properties
   "Creates w:pPr tag node. Called by paragaph-style."
   [{:as options
     :keys [word-wrap?
@@ -414,7 +414,7 @@
            (when (or word-wrap? align
                      space-before space-after space-line
                      indent-left indent-right indent-first-line mirror-indents?)
-             (ppr options))
+             (paragraph-properties options))
            (when (or font font-size font-color bold? italics? underline?)
              (run-properties options)))
            (when font
@@ -487,7 +487,7 @@
            (when (or word-wrap? align
                      space-before space-after space-line
                      indent-left indent-right indent-first-line mirror-indents?)
-             (ppr options))
+             (paragraph-properties options))
            (when (or font font-size font-color bold? italics? underline?)
              (run-properties options))
            ;; Style Table Properties


add logging to block sync process

add logging to block sync process

--- src/block_chain/block_sync.clj
+++ src/block_chain/block_sync.clj
@@ -9,13 +9,20 @@
 (defn block-hashes [chain] (map q/bhash chain))

 (defn synced-chain [db peer]
+  (log/info "Building Synced chain from peer:" peer)
   (loop [this-batch (pc/blocks-since peer (q/highest-hash db))
          db db]
     (if (empty? this-batch)
-      (let [next-batch (pc/blocks-since peer (q/highest-hash db))]
-        (if (empty? next-batch)
-          db
-          (recur next-batch db)))
+      (do
+        (log/info "Got empty batch of blocks against parent: " (q/highest-hash db))
+        (let [next-batch (pc/blocks-since peer (q/highest-hash db))]
+          (if (empty? next-batch)
+            (do
+              (log/info "Finished fetching sync blocks; will return db")
+              db)
+            (do
+              (log/info "Finished one batch will fetch again")
+              (recur next-batch db)))))
       (let [next-block (pc/block peer (first this-batch))]
         (do
           (let [val-errs (bv/validate-block db next-block)]


commit all layouting data in one go

commit all layouting data in one go

--- cljs/src/main/plastic/cogs/editor/layout/core.cljs
+++ cljs/src/main/plastic/cogs/editor/layout/core.cljs
@@ -23,10 +23,7 @@
         selectables (utils/extract-all-selectables layout)
         spatial-web (build-spatial-web form-loc selectables)
         structural-web (build-structural-web form-loc)]
-    (dispatch :editor-commit-selectables editor-id form-id selectables)
-    (dispatch :editor-commit-spatial-web editor-id form-id spatial-web)
-    (dispatch :editor-commit-structural-web editor-id form-id structural-web)
-    (dispatch :editor-commit-layout editor-id form-id layout)))
+    (dispatch :editor-commit-layout editor-id form-id layout selectables spatial-web structural-web)))

 (defn update-forms-layout-if-needed [editor form-locs]
   (let [reducer (fn [editor form-loc]
@@ -53,25 +50,14 @@
 (defn update-layout [editors [editor-selector]]
   (editor/apply-to-specified-editors layout-editor editors editor-selector))

-(defn commit-layout [editors [editor-id form-id layout]]
+(defn commit-layout [editors [editor-id form-id layout selectables spatial-web structural-web]]
   (let [editor (get editors editor-id)
-        new-editor (editor/set-layout-for-form editor form-id layout)]
+        new-editor (-> editor
+                     (editor/set-layout-for-form form-id layout)
+                     (editor/set-selectables-for-form form-id selectables)
+                     (editor/set-spatial-web-for-form form-id spatial-web)
+                     (editor/set-structural-web-for-form form-id structural-web))]
     (dispatch :editor-run-analysis editor-id form-id)
-    (assoc editors editor-id new-editor)))
-
-(defn commit-selectables [editors [editor-id form-id selectables]]
-  (let [editor (get editors editor-id)
-        new-editor (editor/set-selectables-for-form editor form-id selectables)]
-    (assoc editors editor-id new-editor)))
-
-(defn commit-spatial-web [editors [editor-id form-id spatial-web]]
-  (let [editor (get editors editor-id)
-        new-editor (editor/set-spatial-web-for-form editor form-id spatial-web)]
-    (assoc editors editor-id new-editor)))
-
-(defn commit-structural-web [editors [editor-id form-id structural-web]]
-  (let [editor (get editors editor-id)
-        new-editor (editor/set-structural-web-for-form editor form-id structural-web)]
     (assoc editors editor-id new-editor)))

 ; ----------------------------------------------------------------------------------------------------------------
@@ -79,6 +65,3 @@

 (register-handler :editor-update-layout paths/editors-path update-layout)
 (register-handler :editor-commit-layout paths/editors-path commit-layout)
-(register-handler :editor-commit-selectables paths/editors-path commit-selectables)
-(register-handler :editor-commit-spatial-web paths/editors-path commit-spatial-web)
-(register-handler :editor-commit-structural-web paths/editors-path commit-structural-web)


fixed compiler exception

fixed compiler exception

--- src/clinvar_submitter/form.clj
+++ src/clinvar_submitter/form.clj
@@ -149,8 +149,8 @@
                         (if-not (nil? pref-hgvs)
                           (str/split pref-hgvs #":")
                           (if-not (nil? b37-hgvs)
-                            (str/split b37-hgvs #":"
-                              (vec (repeat 2 (str "*E-203" ":" interp-num)))))))
+                            (str/split b37-hgvs #":")
+                            (vec (repeat 2 (str "*E-203" ":" interp-num))))))
         chr (if-not (nil? hgvs)
               (ld1-> sym-tbl b38-ctx-allele "related chromosome" "label"))
         coord (if-not (nil? hgvs)


Add docstring links to the issues related to TODOs.

--- src/clj/forma/ops/classify.clj
+++ src/clj/forma/ops/classify.clj
@@ -10,7 +10,7 @@

   TODO: add back in preconditions when this function can accommodate a
   thrift object as a forma-val.  Simplify the fuck out of this
-  function."
+  function. See: https://github.com/reddmetrics/forma-clj/issues/104"
   [forma-val neighbor-val]
   ;; {:pre [(instance? forma.schema.FormaValue forma-val)
          ;; (instance? forma.schema.NeighborValue neighbor-val)]}
@@ -31,7 +31,8 @@
   vector resulting from a logistic regression.

   TODO: replace the `maps` with a list comprehension and just
-  generally simplify this function."
+  generally simplify this function.
+  See: https://github.com/reddmetrics/forma-clj/issues/105"
   [tuples]
   (let [make-binary  (fn [x] (if (zero? x) 0 1))
         label-seq    (map (comp make-binary first) tuples)


win+lose condition with inventory

win+lose condition with inventory

--- src/cljs/dragonspawn/core.cljs
+++ src/cljs/dragonspawn/core.cljs
@@ -12,6 +12,9 @@
 (def cell-size 32)
 (def aspectRatio (float (/ 4 3)))
 (def time-limit 10)
+(def number-bones-needed 10)
+(def win-message "You won and can build a dragon")
+(def lose-message "You lost! The villagers will kill you now :(")

 (defn abs
   [number]
@@ -40,10 +43,26 @@
   [(pixels->cell (/ game-width 2))
    (- (pixels->cell game-height) 1)])

+(defn random-location
+  []
+  (map (comp int rand) [(inc game-x-cells) game-y-cells]))
+
+(defn random-item-spawns
+  [item number]
+  (into {}
+        (map #(vector % item) (take number (repeatedly random-location)))))
+
+(defn random-spawns
+  []
+  (merge (random-item-spawns :flask 5)
+         (random-item-spawns :bones 30)))
+
 (defn initial-state
   []
   {:start-time (js/Date.)
-   :state :playing
+   :game-state :playing
+   :item-locations (random-spawns)
+   :inventory []
    :player start-position} )

 (def keycode->key
@@ -78,33 +97,51 @@
     (.drawImage draw-context sprite x y size size)))

 (defn draw-text
-  [state x y text]
-  (let [[x y] (cell->coords x y)]
-    (set! (.-font draw-context) "bold 1.5em sans-serif")
-    (set! (.-textBaseline draw-context) "top")
-    (set! (.-textAlign draw-context) "right")
-    (.fillText draw-context text x y)))
+  ([state x y text] (draw-text state x y text "top"))
+  ([state x y text baseline] (draw-text state x y text baseline "right"))
+  ([state x y text baseline align]
+   (let [[x y] (cell->coords x y)]
+     (set! (.-font draw-context) "bold 1.5em sans-serif")
+     (set! (.-textBaseline draw-context) baseline)
+     (set! (.-textAlign draw-context) align)
+     (.fillText draw-context text x y))))

 (defn elapsed-time
   [start-time]
   (int (/ (- (js/Date.) start-time) 1000)))

-(defmulti render :state)
+(defn bone-count
+  [inventory]
+  (count (filter #(= :bones %) inventory)))
+
+(defn enough-bones?
+  [inventory]
+  (>= (bone-count inventory) number-bones-needed))
+
+(defmulti render :game-state)

 (defmethod render :playing
   [state]
-  (let [{:keys [player start-time]} state
+  (let [{:keys [player start-time item-locations inventory]} state
         countdown (- time-limit (elapsed-time start-time))
         [player-x player-y] player]
     (doseq [x (range game-x-cells) y (range game-y-cells)]
       (draw-sprite state x y cell-size :grass))
-    (draw-sprite state 1 2 cell-size :bones)
-    (draw-sprite state 4 4 cell-size :flask)
+    (doseq [[[x y] sprite] item-locations]
+      (draw-sprite state x y cell-size sprite))
     (draw-sprite state player-x player-y cell-size :player)
-    (draw-text state game-x-cells 0 (str countdown " seconds"))))
-
-(defmethod render :finished
-  [state])
+    (draw-text state 0 0 (str (bone-count inventory) " bones") "top" "left")
+    (draw-text state game-x-cells 0 (str countdown " seconds") "top" "right")))
+
+(defmethod render :win
+  [state]
+  (let [x (int (/ game-x-cells 2))]
+    (draw-text state x 0 win-message "top" "center")))
+
+(defmethod render :lose
+  [state]
+  (let [x (int (/ game-x-cells 2))]
+    (draw-text state x 0 lose-message "top" "center")))

 (defn render-world
   [state]
@@ -118,18 +155,29 @@

 (defn move-player
   [state direction]
-  (swap! state
-         (fn [current]
-           (let [{:keys [player]} current
-                 [player-x player-y] player]
-             (assoc current
-                    :player (boundary
-                              (condp = direction
-                                :left [(dec player-x) player-y]
-                                :right [(inc player-x) player-y]
-                                :forward [player-x (dec player-y)]
-                                :back [player-x (inc player-y)]
-                                player)))))))
+  (when (= :playing (:game-state @state))
+    (swap! state
+           (fn [current]
+             (let [{:keys [player inventory item-locations]} current
+                   [player-x player-y] player
+                   new-player (boundary
+                                (condp = direction
+                                  :left [(dec player-x) player-y]
+                                  :right [(inc player-x) player-y]
+                                  :forward [player-x (dec player-y)]
+                                  :back [player-x (inc player-y)]
+                                  player))
+                   item-at-player (get item-locations new-player)
+                   new-inventory (if item-at-player
+                                   (conj inventory item-at-player)
+                                   inventory)
+                   new-item-locations (if item-at-player
+                                        (dissoc item-locations new-player)
+                                        item-locations)]
+               (assoc current
+                      :player new-player
+                      :inventory new-inventory
+                      :item-locations new-item-locations))))))

 (defn timeup?
   [start-time]
@@ -139,16 +187,17 @@
   [state]
   (swap! state
          (fn [current]
-           (let [{:keys [game-state start-time]} current]
-             (if (timeup? start-time)
-               (assoc current :state :finished)
-               current)))))
+           (let [{:keys [game-state start-time inventory]} current]
+             (assoc current :game-state
+                    (cond
+                      (enough-bones? inventory) :win
+                      (timeup? start-time) :lose
+                      :else game-state))))))

 (defn handle-keyevent
   [state keyevent]
-  (.log js/console "you pressed:" keyevent)
-  (log-state @state)
-  (move-player state keyevent))
+  (move-player state keyevent)
+  (log-state @state))

 (defn translate-keyboard-event
   [e]


introducing sync component making use of core.async

--- src/cljs/manager_web/core.cljs
+++ src/cljs/manager_web/core.cljs
@@ -49,6 +49,8 @@
 ;; ==========================
 ;;

+(def sync-ch (chan))
+
 (defn editable-input
   [state owner {:keys [key type label placeholder]}]
   (reify
@@ -62,20 +64,25 @@
                                :placeholder placeholder
                                :onChange (fn [e])
                                :onBlur (fn [e]
-                                         (om/transact! state key
-                                                       #(.. e -target -value)))})))))
-
-(defn server-synced-view
-  [state owner]
-  (reify
+                                         (let [newval (.. e -target -value)]
+                                           (put! sync-ch (str "a message: " newval))
+                                           (om/transact! state key (fn [] newval))))})))))
+
+(defn synced-view
+  [state owner {:keys [view channel] :as opts}]
+  (reify
+    om/IWillMount
+    (will-mount [_]
+      (go-loop [msg (<! channel)]
+        (println "got sync message:")
+        (println owner)
+        (println state)
+        (println msg)
+        (println "===")
+        (recur (<! channel))))
     om/IRender
     (render [_]
-      (dom/input #js {:type "text" :value (:value state)
-                      :onChange (fn [e])
-                      :onBlur (fn [e]
-                                (om/transact! state :value
-                                              (fn [_]
-                                                (.. e -target -value))))}))))
+      (om/build view state {:opts opts}))))

 ;;
 ;; ==========================
@@ -184,9 +191,22 @@
                (om/build editable-input
                          (-> app :server-state :input1)
                          {:opts {:key :value
+                                 :type "checkbox"
+                                 :label "check1"}})
+               (om/build editable-input
+                         (-> app :server-state :input1)
+                         {:opts {:key :value
                                  :type "text"
                                  :label "text2"
                                  :placeholder "placeholder2"}})
+               (om/build synced-view
+                         (-> app :server-state :input1)
+                         {:opts {:view editable-input
+                                 :channel sync-ch
+                                 :key :value
+                                 :type "text"
+                                 :label "synced1"
+                                 :placeholder "placeholder3"}})
                (when err-msg
                  (dom/div nil err-msg))))))


Switch "new" and "save" buttons

Switch "new" and "save" buttons

--- src/cljs/underground/core.cljs
+++ src/cljs/underground/core.cljs
@@ -81,13 +81,7 @@
      :on-mouse-move #(js/removeclasshoveritem)
      :style {:left (-> @menu-position :x (- 100))
              :top (-> @menu-position :y (- 80))}}
-    [:a [:li {:on-click (fn [e]
-                          (network-save-state)
-                          (reset-menu-position)
-                          )
-              } "Save"]]
-    [:a [:li {:id :hoveritem
-              :on-click #(let [my (.-clientY %)
+    [:a [:li {:on-click #(let [my (.-clientY %)
                                mx (.-clientX %)
                                {ox :x oy :y} @origin
                                x (- mx ox)
@@ -98,9 +92,15 @@
                                   (-> @gen-id str keyword)
                                   {:x x :y y :md "## placeholder" :html "
placeholder
"})
                            )
+              } "New"]]
+    [:a [:li {:id :hoveritem
+              :on-click (fn [e]
+                          (network-save-state)
+                          (reset-menu-position)
+                          )
               :on-mouse-leave #(js/removeclasshoveritem)
               :on-mouse-move #(js/removeclasshoveritem)
-              } "New"]]
+              } "Save"]]
     (if @clicked-note
       [:a [:li {:on-click (fn [e]
                             (swap! positions dissoc @clicked-note)


Add util/pp-str

Add util/pp-str

--- src/cljx/clojuredocs/util.cljx
+++ src/cljx/clojuredocs/util.cljx
@@ -2,6 +2,7 @@
   (:require [clojure.string :as str]
             [clojuredocs.md5 :as md5]
             #+clj  [cheshire.core :as json]
+            #+clj  [clojure.pprint :refer [pprint]]
             #+cljs [goog.string :as gstring])
   #+clj
   (:import [org.pegdown PegDownProcessor]
@@ -138,3 +139,9 @@
   (-> (java.util.UUID/randomUUID)
       str
       (str/replace #"-" "")))
+
+#+clj
+(defn pp-str [o]
+  (let [w (java.io.StringWriter.)]
+    (pprint o w)
+    (str/trim (.toString w))))


Parse the port to an int.

Parse the port to an int.

--- src/onyx_benchmark/peer.clj
+++ src/onyx_benchmark/peer.clj
@@ -36,7 +36,7 @@
 (defn -main [zk-addr riemann-addr riemann-port id n-peers subscriber-count messaging & args]
   (let [local? (= zk-addr "127.0.0.1:2189")

-        m-cfg (load-monitoring-config riemann-addr riemann-port)
+        m-cfg (load-monitoring-config riemann-addr (Integer/parseInt riemann-port))
         monitoring-thread (start-riemann-sender m-cfg)

         env-config {:onyx.bookkeeper/server? true


Cleanup whitespace

Cleanup whitespace

--- src/conceptnet_clj/handler.clj
+++ src/conceptnet_clj/handler.clj
@@ -11,5 +11,4 @@
 (defn app [context]
   (-> (home-routes context)
       (routes app-routes)
-      (handler/site)))
-
+      (handler/site)))


Re-align

Re-align

--- src/asciinema/player/processing.cljs
+++ src/asciinema/player/processing.cljs
@@ -1,6 +1,6 @@
 (ns asciinema.player.processing
   (:require [cljs.core.async :refer [chan close!]]
-   [asciinema.player.util :as util]
+            [asciinema.player.util :as util]
             [asciinema.player.messages :as m]
             [asciinema.player.frames :as f]
             [asciinema.player.source :as source]))


Use direct-child selector for hljs styles

--- src/braid/client/ui/styles/hljs.cljs
+++ src/braid/client/ui/styles/hljs.cljs
@@ -15,7 +15,7 @@
 (def window "#4d5057")

 (def hljs-styles
-  [:.hljs
+  [:>.hljs

    [:.hljs-comment
     :.hljs-quote


ws-routes turned to a customizable function

--- src/clj/hellhound/http/websocket.clj
+++ src/clj/hellhound/http/websocket.clj
@@ -51,18 +51,52 @@
     (when (.isOpen session))))
 `      (async/put! channel message)

-(def ws-routes
-  {"/hellhound/ws"
-   {
-    :on-connect (websocket/start-ws-connection new-client-connected!)
-    :on-text    (fn [msg] (log/info :msg (str "A client sent - " msg)))
-    :on-binary  (fn [payload offset length] (log/info :msg "Binary Message!" :bytes payload))
-    :on-error   (fn [t] (log/error :msg "WS Error happened" :exception t))
-    :on-close   (fn [num-code reason-text]
-                  (log/info :msg "WS Closed:" :reason reason-text))}})
+(defn ws-on-connect
+  "Default `on-connect` callback for the websocket connection"
+  [& rest]
+  (websocket/start-ws-connection new-client-connected!))
+
+(defn ws-on-text
+  "Default `on-text` callback for the websocket server"
+  [msg]
+  (log/info :msg (str "A client sent " msg)))
+
+(defn ws-on-binary
+  "Default `on-text` callback for the websocket server"
+  [payload offset length]
+  (log/info :msg "Binary Message!" :bytes payload))
+
+(defn ws-on-error
+  [t]
+  (log/error :msg "WS Error happened" :exception t))
+
+(defn ws-on-close
+  [num-code reason-text
+   (log/info :msg "WS Closed:" :reason reason-text)])
+
+(defn ws-routes
+  [url {:keys [on-connect on-text on-binary on-error on-close]
+        :as   options
+        :or   {on-connect ws-on-connect
+               on-text    ws-on-text
+               on-binary  ws-on-binary
+               on-error   ws-on-error
+               on-close   ws-on-close}}]
+
+  {url
+   {:on-connect ws-on-connect
+    :on-text    ws-on-text
+    :on-binary  ws-on-binary
+    :on-error   ws-on-error
+    :on-close   ws-on-close}})

 (defn add-endpoint
   [request {:keys [packer]
             :as   options
             :or   [packer (json/JsonPacker.)]}]
-  (websocket/add-ws-endpoints request ws-routes))
+  (websocket/add-ws-endpoints request (ws-routes)))
+
+(defn add-websocket
+  "Add websocket endpoints to the given `service-map`."
+  [service-map {:keys [packer url] :as   options}]
+  (assoc service-map))


[RENAME] Add `!` suffix to `html-timetable-prune-empty-rows-for-day`

Signed-off-by: Pang Yan Han <22594c345857f664c61cd411f607c4d40a9d4af9@gmail.com>

--- src/cljs/cljs_nusmods/timetable.cljs
+++ src/cljs/cljs_nusmods/timetable.cljs
@@ -778,7 +778,7 @@
                       :divElem $lessonDiv)))
            lessonInfoSeq))))

-(defn- html-timetable-prune-empty-rows-for-day
+(defn- html-timetable-prune-empty-rows-for-day!
   "Removes <tr> elements corresponding to empty rows in `Timetable`.
    The 2nd argument should be the return value of the
    `timetable-day-get-empty-and-non-empty-rows` function."
@@ -1538,7 +1538,7 @@
                             (.stringify js/JSON (clj->js (:nonEmptyRows rowsPartition)))))

       (timetable-prune-empty-rows-for-day! day rowsPartition)
-      (html-timetable-prune-empty-rows-for-day day rowsPartition))))
+      (html-timetable-prune-empty-rows-for-day! day rowsPartition))))

 (defn remove-module!
   "Removes a module from the timetable.


Be less confusing with comment about validation types.

--- src/active/clojure/validation.cljc
+++ src/active/clojure/validation.cljc
@@ -34,7 +34,9 @@
             [active.clojure.condition :as condition]
             [active.clojure.lens :as lens]))

-;;; A ValidationResult is either a ValidationSuccess or a ValidationFailure.
+;;; A ValidationResult is one of the following
+;; - a ValidationSuccess
+;; - a ValidationFailure.
 (define-record-type ^{:doc "Signifies a failured validation.  Holds
   the [[ValidationError]]."}
   ValidationFailure


Small html fix

Small html fix

--- webapp/src/org/teamweek/webapp/endpoint/views.clj
+++ webapp/src/org/teamweek/webapp/endpoint/views.clj
@@ -63,7 +63,7 @@
           [:div.pure-control-group
            (if (map? schedule)
             (concat (for [[val checked? text] (:days schedule)]
-                      [:label.pure-checkbox {:for "val"}
+                      [:label.pure-checkbox {:for val}
                        [:input {:type "checkbox" :value val :id val :name val :checked checked?} text]])
                     [(form/label "hr" "Hour: ")
                      (form/drop-down "hr" (map str (range 24)) (:hr schedule))


Update model in reaction to :new-set/create-failed

--- src/app/cljs/one/repmax/model.cljs
+++ src/app/cljs/one/repmax/model.cljs
@@ -150,9 +150,10 @@
       (assoc-in [:new-set :reps] nil)
       (assoc-in [:new-set :state] :ready-for-new-set))))

-(defmethod update-model :new-set/create-failed [state _]
-  (.log js/console "TODO update-model :new-set/create-failed")
-  state)
+(defmethod update-model :new-set/create-failed [state {:keys [error]}]
+  (-> state
+    (assoc-in [:new-set :state] :create-failed)
+    (assoc-in [:new-set :error] error)))

 (defn set-map-for-exercise-history
   "Given a map that represents all data for a single exercise set, return a map


Add servlet LocalApiProxy property to container to fix LocalChannelServlet and others

--- src/appengine_magic/core_local.clj
+++ src/appengine_magic/core_local.clj
@@ -58,7 +58,10 @@

 (defn make-appengine-request-environment-filter []
   (reify javax.servlet.Filter
-    (init [_ _])
+    (init [_ filter-config]
+      (.setAttribute (.getServletContext filter-config)
+                     "com.google.appengine.devappserver.ApiProxyLocal"
+                     (ApiProxy/getDelegate)))
     (destroy [_])
     (doFilter [_ req resp chain]
       (let [all-cookies (.getCookies req)


Factor-out render fn

Factor-out render fn

--- src/braid/client/desktop/core.cljs
+++ src/braid/client/desktop/core.cljs
@@ -21,6 +21,9 @@

 (enable-console-print!)

+(defn render []
+  (r/render [app-view] (.getElementById js/document "app")))
+
 (defn ^:export init []
   (dispatch-sync [:initialize-db])

@@ -29,7 +32,7 @@
                        (dispatch [:set-window-visibility
                                   (= "visible" (.-visibilityState js/document))])))

-  (r/render [app-view] (. js/document (getElementById "app")))
+  (render)

   (router/init)

@@ -41,4 +44,4 @@
   "Force a re-render. For use with figwheel"
   []
   (quests/install-quests-handler!)
-  (r/render [app-view] (.getElementById js/document "app")))
+  (render))


catch-errors middleware added

catch-errors middleware added

--- src/clj/backtype/storm/ui/core.clj
+++ src/clj/backtype/storm/ui/core.clj
@@ -774,9 +774,25 @@
   (route/resources "/")
   (route/not-found "Page not found"))

+(defn exception->html [ex]
+  (concat
+    [[:h2 "Internal Server Error"]]
+    [[:pre (let [sw (java.io.StringWriter.)]
+      (.printStackTrace ex (java.io.PrintWriter. sw))
+      (.toString sw))]]))
+
+(defn catch-errors [handler]
+  (fn [request]
+    (try
+      (handler request)
+      (catch Exception ex
+        (-> (resp/response (ui-template (exception->html ex)))
+          (resp/status 500)
+          (resp/content-type "text/html"))
+        ))))
+
 (def app
-  (handler/site main-routes)
- )
+  (handler/site (-> main-routes catch-errors )))

 (defn start-server! [] (run-jetty app {:port (Integer. (*STORM-CONF* UI-PORT))
                                        :join? false}))


Don't hide the remove button

Don't hide the remove button

--- src/clojure/nightcode/projects.clj
+++ src/clojure/nightcode/projects.clj
@@ -214,7 +214,6 @@
            :update-project-buttons
            (fn [_ _ _ path]
              (s/config! (s/select @ui/root [:#remove])
-                        :visible? (not (nil? path))
                         :enabled? (and (not (nil? path))
                                        (or (contains? @ui/tree-projects path)
                                            (.isFile (io/file path)))))


Add docstring.

Add docstring.

--- src/flo_invest/morningstar.clj
+++ src/flo_invest/morningstar.clj
@@ -24,8 +24,15 @@
   [predicate coll]
   (first (filter predicate coll)))

-(defn parse-income [income]
+(defn parse-income
+  "Parse an income statement as issued by Morningstar.

+  Look for the header line which specifies the currency and the end of
+  the fiscal years (usual 5 years). Then go and find the Revenue line.
+  Return a vector of maps {:name :amount :date}, where :name is always
+  :annual_sales, and :amount and :date give the revenue for a given
+  year."
+  [income]
   (let [date-header (date-vec (income 1))
         year-currency-pat #"Fiscal year ends in \w+. (\w+) in millions except per share data."
         currency (last (re-matches year-currency-pat (first (income 1))))


Refactored mapping-selector

Refactored mapping-selector

Code-review.

[PDOK]

--- src/gml_to_featured/runner.clj
+++ src/gml_to_featured/runner.clj
@@ -24,33 +24,36 @@
   (for [pf path-features]
     (merge (map #(hash-map (merge (-> pf first) (:tag %1)) %1) (-> pf second :content)))))

-(defn unnest-features [nested path-depth]
-  (loop [result nested
-         iter 0]
-    (if (>= iter path-depth)
-      result
-      (recur (flatten result)
-             (inc iter)))))
-
 (defn get-possible-paths [feature path-depth]
-  (let [f (z/xml-zip feature)
-        path (-> f first :tag)
-        result-firstnode {[path] (first f)}]
+  (let [first-feature (-> feature z/xml-zip first)
+        path (:tag first-feature)
+        result-firstnode {[path] first-feature}]
     (loop [result result-firstnode
            iter 1]
       (if (>= iter path-depth)
         result
         (let [paths-to-proces (filter #(= (count %) iter) (keys result))
-              result (merge result (into {} (unnest-features (get-path-and-feature (select-keys result paths-to-proces)) iter)))]
+              result (merge result
+                            (into {} (-> result
+                                         (#(select-keys % paths-to-proces))
+                                         get-path-and-feature
+                                         flatten)))]
           (recur result (inc iter)))))))

 (defn member->map [fm]
   (let [feature (*feature-identifier* fm)
-        path-depth (apply max (map count (keys *translators*)))
+        path-depth (-> *translators*
+                        keys
+                       ((partial map count))
+                       ((partial apply max)))
         possible-paths-feature (get-possible-paths feature path-depth)
-        selected-feature (first (select-keys possible-paths-feature (keys *translators*)))
+        selected-feature (-> *translators*
+                             keys
+                             (#(select-keys possible-paths-feature %))
+                             first)
         translator (get *translators* (first selected-feature) unknown-translator)
-        translated (translator (*feature-selector* (second selected-feature)))]
+        translated (-> selected-feature second *feature-selector* translator)
+        ]
     (if (sequential? translated)
       translated
       [translated])))


Refactor project follow/unfollow to use base-project-url

--- src-cljs/frontend/api/path.cljs
+++ src-cljs/frontend/api/path.cljs
@@ -45,22 +45,14 @@
    (base-project-url-path vcs-type) project-name token))

 (defn project-follow [vcs-type project]
-  (case vcs-type
-    "bitbucket" (gstring/format
-                  "/api/dangerzone/project/%s/%s/follow"
-                  vcs-type project)
-    "github" (gstring/format
-               "/api/v1/project/%s/follow"
-               project)))
+  (gstring/format
+   "%s/%s/follow"
+   (base-project-url-path vcs-type) project))

 (defn project-unfollow [vcs-type project]
-  (case vcs-type
-    "bitbucket" (gstring/format
-                  "/api/dangerzone/project/%s/%s/unfollow"
-                  vcs-type project)
-    "github" (gstring/format
-               "/api/v1/project/%s/unfollow"
-               project)))
+  (gstring/format
+   "%s/%s/unfollow"
+   (base-project-url-path vcs-type) project))

 (defn build-retry [vcs-type org-name repo-name build-num]
   (gstring/format


Refactor

Refactor

--- src-cljs/visibility_2d/ray.cljs
+++ src-cljs/visibility_2d/ray.cljs
@@ -5,8 +5,6 @@

 (defn ray? [ray]
   (instance? Ray ray))
-
-;;; A ray consists of an origin and a direction vector as follows

 (defn ray
   "Creates a ray from vector u to vector v, optionally rotated by theta"


add all results to play queue

add all results to play queue

--- src-cljs/core.cljs
+++ src-cljs/core.cljs
@@ -23,9 +23,9 @@
     om/IRenderState
     (render-state [this {:keys [enqueue]}]
       (dom/div #js {:className "track"}
-               (dom/span #js {:className "title"} (get track "title"))
                (dom/span #js {:className "artist"} (get track "artist"))
                (dom/span #js {:className "album"} (get track "album" ))
+               (dom/span #js {:className "title"} (get track "title"))
                (dom/button #js {:onClick (fn [e] (put! enqueue @track))}
                            "+")))))

@@ -41,6 +41,14 @@
     om/IRenderState
     (render-state [this {:keys [enqueue]}]
       (apply dom/div #js {:className "results tracks" }
+             (dom/div #js {:className "track header"}
+                      (dom/span #js {:className "artist"} "Artist")
+                      (dom/span #js {:className "album"} "Album" )
+                      (dom/span #js {:className "title"} "Title")
+                      (dom/button #js {:onClick
+                                       (fn [e] (doall (map #(put! enqueue %)
+                                                           (:results @app))))}
+                                  "+"))
              (om/build-all results-track-view (:results app)
                            {:init-state {:enqueue enqueue}})
              ))))


Skip calc if resolution is zero.

Skip calc if resolution is zero.

This isn't something we should really be following for the difference
series. We don't need to pad this yet, we only need to pad when we are
trying to add data series.

We should also have a job that checks each sensor and the measurements
to see if the resolution of the measurements matches the resolution as
stored on the sensor and update it.

--- src/kixi/hecuba/data/calculate.clj
+++ src/kixi/hecuba/data/calculate.clj
@@ -120,22 +120,23 @@
   stored in the sensor data. If resolution is not specified, default 60 seconds is used."
   [store {:keys [sensor range]}]
   (log/debugf "Sensor: %s Range: %s" sensor range)
-  (let [resolution                  (if-let [r (:resolution sensor)] (edn/read-string r) 60)
-        {:keys [start-date end-date]} range
-        timestamps                  (expected-timestamps start-date end-date resolution)
-        measurements                (measurements-for-range store sensor range (t/hours 1))
-        template-reading            (-> (first measurements)
-                                        (assoc :value "n/a")
-                                        (dissoc :timestamp :reading_metadata))]
-    (log/debugf "Retrieved Measurements: %s" (vec (take 10 measurements)))
-    (when (> (count (take 2 measurements)) 1)
-      (let [{:keys [device_id type]} sensor
-            quantized            (quantized-measurements resolution measurements)
-            grouped-measurements (grouped-readings quantized)
-            new-type             (ext-type type)
-            padded-measurements  (filled-measurements template-reading grouped-measurements timestamps)
-            calculated           (diff-seq padded-measurements)]
-        (m/insert-measurements store {:device_id device_id :type new-type} calculated 100)))))
+  (let [resolution (if-let [r (:resolution sensor)] (edn/read-string r) 60)]
+    (when (> resolution 0)
+      (let [{:keys [start-date end-date]} range
+            timestamps                  (expected-timestamps start-date end-date resolution)
+            measurements                (measurements-for-range store sensor range (t/hours 1))
+            template-reading            (-> (first measurements)
+                                            (assoc :value "n/a")
+                                            (dissoc :timestamp :reading_metadata))]
+        (log/debugf "Retrieved Measurements: %s" (vec (take 10 measurements)))
+        (when (> (count (take 2 measurements)) 1)
+          (let [{:keys [device_id type]} sensor
+                quantized            (quantized-measurements resolution measurements)
+                grouped-measurements (grouped-readings quantized)
+                new-type             (ext-type type)
+                padded-measurements  (filled-measurements template-reading grouped-measurements timestamps)
+                calculated           (diff-seq padded-measurements)]
+            (m/insert-measurements store {:device_id device_id :type new-type} calculated 100)))))))

 (defn kWh->co2
   "Converts measurements from kWh to co2."


[PDOK-2332] alter the order of the constraint list, so in the public.geometry_columns (table/view) the MULTI* are shown.

--- src/main/clojure/pdok/postgres.clj
+++ src/main/clojure/pdok/postgres.clj
@@ -209,9 +209,9 @@
   (str "ALTER TABLE " schema-name-quoted "." table-name-quoted " ADD CONSTRAINT " constraint-name " CHECK (" geo-column-quoted " IS NULL OR " constraint "(" geo-column-quoted ")" constraint-pred ")")))

 (def geo-constraints
-  {:_geometry_point "'POINT'::text, 'MULTIPOINT'::text, 'POINTM'::text, 'MULTIPOINTM'::text"
-   :_geometry_line "'LINESTRING'::text, 'MULTILINESTRING'::text, 'LINESTRINGM'::text, 'MULTILINESTRINGM'::text"
-   :_geometry_polygon "'POLYGON'::text, 'MULTIPOLYGON'::text, 'CIRCULARSTRING'::text, 'COMPOUNDCURVE'::text, 'MULTICURVE'::text, 'CURVEPOLYGON'::text, 'MULTISURFACE'::text, 'GEOMETRY'::text, 'GEOMETRYCOLLECTION'::text, 'POLYGONM'::text, 'MULTIPOLYGONM'::text, 'CIRCULARSTRINGM'::text, 'COMPOUNDCURVEM'::text, 'MULTICURVEM'::text, 'CURVEPOLYGONM'::text, 'MULTISURFACEM'::text, 'GEOMETRYCOLLECTIONM'::text"})
+  {:_geometry_point "'MULTIPOINT'::text, 'POINT'::text, 'MULTIPOINTM'::text, 'POINTM'::text"
+   :_geometry_line "'MULTILINESTRING'::text, 'LINESTRING'::text, 'MULTILINESTRINGM'::text, 'LINESTRINGM'::text"
+   :_geometry_polygon "'MULTIPOLYGON'::text, 'POLYGON'::text, 'CIRCULARSTRING'::text, 'COMPOUNDCURVE'::text, 'MULTICURVE'::text, 'CURVEPOLYGON'::text, 'MULTISURFACE'::text, 'GEOMETRY'::text, 'GEOMETRYCOLLECTION'::text, 'POLYGONM'::text, 'MULTIPOLYGONM'::text, 'CIRCULARSTRINGM'::text, 'COMPOUNDCURVEM'::text, 'MULTICURVEM'::text, 'CURVEPOLYGONM'::text, 'MULTISURFACEM'::text, 'GEOMETRYCOLLECTIONM'::text"})

 (defn add-geo-constraints [db schema table geometry-column ndims srid]
   (let [column-name (-> geometry-column name)


added document for log-panel

added document for log-panel

--- src/main/clojure/slide/logging.clj
+++ src/main/clojure/slide/logging.clj
@@ -86,7 +86,10 @@
                                              :finest  handler-finest)))
     ([] (copy-log-to-clipboard :fine)))

-  (defn ^JPanel log-panel []
+  (defn ^JPanel log-panel
+    "Return a JPanel for viewing logs.
+     Call \"configure-logging-swing\" before calling this function."
+    []
     (letfn [(reset-model [tbl hdr cols]
               (reset! current-handler @hdr)
               (.setModel tbl (.getModel @hdr))


Update scrabble-score/example.clj

Update scrabble-score/example.clj

Based on my solution. The tests were failing and
the code felt inefficient and non-idiomatic to me.

--- scrabble-score/example.clj
+++ scrabble-score/example.clj
@@ -1,17 +1,29 @@
 (ns scrabble-score
   (:require [clojure.string :refer [split]]))

+;; The letter values as shown in the README
+(def ^:private letter-values
+  {"AEIOULNRST" 1
+   "DG"         2
+   "BCMP"       3
+   "FHVWY"      4
+   "K"          5
+   "JX"         8
+   "QZ"        10})
+
+;; A map from letter (as string) to score
+(def ^:private letter->score
+  (reduce-kv (fn [acc letters score]
+               (-> (map str letters)
+                   (zipmap (repeat score))
+                   (->> (merge acc))))
+             {} letter-values))
+
+;; Defaults to 0 for non-alphabetic input
 (defn score-letter [letter]
-  (let [ul (.toUpperCase letter)]
-    (cond
-      (some #{ul} (split "AEIOULNRST" #""))  1
-      (some #{ul} (split "DG" #"")        )  2
-      (some #{ul} (split "BCMP" #"")      )  3
-      (some #{ul} (split "FHVWY" #"")     )  4
-      (some #{ul} (split "K" #"")         )  5
-      (some #{ul} (split "JX" #"")        )  8
-      (some #{ul} (split "QZ" #"")        ) 10
-    )))
+  (get letter->score (.toUpperCase (str letter)) 0))

 (defn score-word [word]
-  (reduce + (map score-letter (rest (split word #"")))))
+  (reduce (fn [score letter]
+            (+ score (score-letter letter)))
+          0 word))


Clear out :ackers on killed job.

Clear out :ackers on killed job.

--- src/onyx/log/commands/kill_job.clj
+++ src/onyx/log/commands/kill_job.clj
@@ -15,6 +15,7 @@
         (update-in [:killed-jobs] conj (:job args))
         (update-in [:killed-jobs] vec)
         (update-in [:allocations] dissoc (:job args))
+        (update-in [:ackers] dissoc (:job args))
         (merge {:peer-state (into {} (map (fn [p] {p :idle}) peers))})
         (reconfigure-cluster-workload))))


Send a notification to Change Service when adding or removing a reply to a poll.

--- src/oc/storage/api/entries.clj
+++ src/oc/storage/api/entries.clj
@@ -444,14 +444,16 @@
         index-map (zipmap (map :poll-uuid (:polls entry)) (-> entry :polls count range))
         final-entry (assoc-in entry [:polls (get index-map (:poll-uuid poll))] updated-poll)
         updated-entry (entry-res/update-entry-no-user! conn (:uuid entry) final-entry)]
+    (notification/send-trigger! (notification/->trigger :update org board {:new updated-entry :old entry} user nil (api-common/get-change-client-id ctx)))
     {:updated-entry updated-entry}))

-(defn- delete-poll-reply [conn ctx org board entry poll poll-reply]
+(defn- delete-poll-reply [conn ctx org board entry poll poll-reply user]
   (let [updated-poll (update poll :replies (fn [replies]
                                              (filterv #(not= (:reply-id %) (:reply-id poll-reply)))))
         index-map (zipmap (map :poll-uuid (:polls entry)) (-> entry :polls count range))
         final-entry (update-in entry [:polls (get index-map (:poll-uuid poll))] updated-poll)
         updated-entry (entry-res/update-entry-no-user! conn (:uuid entry) final-entry)]
+    (notification/send-trigger! (notification/->trigger :update org board {:new updated-entry :old entry} user nil (api-common/get-change-client-id ctx)))
     {:updated-entry updated-entry}))

 (defn- update-reply [user-id voting-reply-id add? reply]
@@ -1191,7 +1193,7 @@

   ;; Actions
   :delete! (fn [ctx] (delete-poll-reply conn ctx (:existing-org ctx) (:existing-board ctx) (:existing-entry ctx)
-                      (:existing-poll ctx) (:existing-poll-reply ctx)))
+                      (:existing-poll ctx) (:existing-poll-reply ctx) (:user ctx)))

   ;; Responses
   :handle-ok (by-method {


Remove the useless error message commited by error.

--- src/app/clj/fnx/meta/expose.clj
+++ src/app/clj/fnx/meta/expose.clj
@@ -50,19 +50,13 @@
   ([f]
      (map (comp fun-str str) (mapcat #(ns-public-fn (symbol %)) (load-file-ns f)))))

-;.;. FAIL at (NO_SOURCE_FILE:1)
-;.;. Actual result did not agree with the checking function.
-;.;.         Actual result: ("fnx.meta.example/hello" "fnx.meta.example/one-arg-fn" "fnx.meta.example/hello-noir" "fnx.meta.example/three-arg-fn" "fnx.meta.example/two-arg-fn" "fnx.meta.example2/hello" "fnx.meta.example2/three-arg-fn")
-;.;.     Checking function: (contains ["fnx.meta.example/one-arg-fn" "fnx.meta.example/hello-noir" "fnx.meta.example/two-arg-fn" "fnx.meta.example2/hello" "fnx.meta.example2/three-arg-fn"] :in-any-order)
-;.;.     The checker said this about the reason:
-;.;.         Best match found: ["fnx.meta.example/two-arg-fn" "fnx.meta.example2/hello" "fnx.meta.example2/three-arg-fn"]
 (fact
   (load-fq-fn! :file) => (contains
                            ["fnx.meta.example/one-arg-fn"
-                          "fnx.meta.example/hello-noir"
-                          "fnx.meta.example/two-arg-fn"
-                          "fnx.meta.example2/hello"
-                          "fnx.meta.example2/three-arg-fn"] :in-any-order)
+                            "fnx.meta.example/hello-noir"
+                            "fnx.meta.example/two-arg-fn"
+                            "fnx.meta.example2/hello"
+                            "fnx.meta.example2/three-arg-fn"] :in-any-order)
   (provided
     (load-file-ns :file) => ["fnx.meta.example" "fnx.meta.example2"]))


New test: test-format-time-1

New test: test-format-time-1

--- test/clj_calendar/format_datetime_test.clj
+++ test/clj_calendar/format_datetime_test.clj
@@ -24,10 +24,8 @@
     [function-name]
     (clojure.test/function? function-name))

-
-
 ;
-; Actual tests.
+; Tests for various defs and functions existence
 ;

 (deftest test-format-time-existence
@@ -65,3 +63,22 @@
     (testing "if the clj-calendar.format-datetime/format-seconds function definition exists."
         (is (callable? 'clj-calendar.format-datetime/format-seconds))))

+;
+; Actual tests.
+;
+
+(deftest test-format-time-1
+    "Check the function clj-calandar.format-datetime/format-time-."
+    (testing "the function clj-calandar.format-datetime/format-time-."
+        (are [x y] (= x y)
+              "one minute ago"                (format-time- 1 0 "minute" "second")
+              "one minute and one second ago" (format-time- 1 1 "minute" "second")
+              "one minute and 2 seconds ago"  (format-time- 1 2 "minute" "second")
+              "one day ago"                   (format-time- 1 0 "day" "hour")
+              "one day and one hour ago"      (format-time- 1 1 "day" "hour")
+              "one day and 2 hours ago"       (format-time- 1 2 "day" "hour")
+              "one month ago"                 (format-time- 1 0 "month" "year")
+              "one month and one year ago"    (format-time- 1 1 "month" "year")
+              "one month and 2 years ago"     (format-time- 1 2 "month" "year"))))
+
+


job-scheduler + messaging are now in log-parameters

--- src/onyx/monitoring/events.clj
+++ src/onyx/monitoring/events.clj
@@ -80,22 +80,12 @@
            :tags ["monitoring-config"]
            :metric bytes}))

-(defn zookeeper-write-job-scheduler [ch config {:keys [latency bytes]}]
-  (>!! ch {:service "zookeeper.write-job-scheduler.latency"
-           :state "ok"
-           :tags ["monitoring-config"]
-           :metric latency})
-  (>!! ch {:service "zookeeper.write-job-scheduler.bytes"
-           :state "ok"
-           :tags ["monitoring-config"]
-           :metric bytes}))
-
-(defn zookeeper-write-messaging [ch config {:keys [latency bytes]}]
-  (>!! ch {:service "zookeeper.write-messaging.latency"
-           :state "ok"
-           :tags ["monitoring-config"]
-           :metric latency})
-  (>!! ch {:service "zookeeper.write-messaging.bytes"
+(defn zookeeper-write-log-parameters [ch config {:keys [latency bytes]}]
+  (>!! ch {:service "zookeeper.write-log-parameters.latency"
+           :state "ok"
+           :tags ["monitoring-config"]
+           :metric latency})
+  (>!! ch {:service "zookeeper.write-log-parameters.bytes"
            :state "ok"
            :tags ["monitoring-config"]
            :metric bytes}))
@@ -162,14 +152,8 @@
            :tags ["monitoring-config"]
            :metric latency}))

-(defn zookeeper-read-job-scheduler [ch config {:keys [latency]}]
-  (>!! ch {:service "zookeeper.read-job-scheduler.latency"
-           :state "ok"
-           :tags ["monitoring-config"]
-           :metric latency}))
-
-(defn zookeeper-read-messaging [ch config {:keys [latency]}]
-  (>!! ch {:service "zookeeper.read-messaging.latency"
+(defn zookeeper-read-log-parameters [ch config {:keys [latency]}]
+  (>!! ch {:service "zookeeper.read-log-parameters.latency"
            :state "ok"
            :tags ["monitoring-config"]
            :metric latency}))
@@ -320,8 +304,7 @@
      :zookeeper-write-lifecycles (partial zookeeper-write-lifecycles ch)
      :zookeeper-write-task (partial zookeeper-write-task ch)
      :zookeeper-write-chunk (partial zookeeper-write-chunk ch)
-     :zookeeper-write-job-scheduler (partial zookeeper-write-job-scheduler ch)
-     :zookeeper-write-messaging (partial zookeeper-write-messaging ch)
+     :zookeeper-write-log-parameters (partial zookeeper-write-log-parameters ch)
      :zookeeper-force-write-chunk (partial zookeeper-force-write-chunk ch)
      :zookeeper-write-origin (partial zookeeper-write-origin ch)
      :zookeeper-read-catalog (partial zookeeper-read-catalog ch)
@@ -331,8 +314,7 @@
      :zookeeper-read-task (partial zookeeper-read-task ch)
      :zookeeper-read-chunk (partial zookeeper-read-chunk ch)
      :zookeeper-read-origin (partial zookeeper-read-origin ch)
-     :zookeeper-read-job-scheduler (partial zookeeper-read-job-scheduler ch)
-     :zookeeper-read-messaging (partial zookeeper-read-messaging ch)
+     :zookeeper-read-log-parameters (partial zookeeper-read-log-parameters ch)
      :zookeeper-gc-log-entry (partial zookeeper-gc-log-entry ch)
      :peer-gc-peer-link (partial peer-gc-peer-link ch)
      :peer-backpressure-on (partial peer-backpressure-on ch)


add feminine singular exception: 'difficile' not 'difficila'

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -878,7 +878,8 @@
                              :artifact true
                              :physical-object true
                              :edible false}}
-              :italiano {:cat :adjective}})
+              :italiano {:cat :adjective
+                         :fem {:sing "difficile"}}})

       "dipingere" {:synsem {:cat :verb
                             :sem {:pred :paint}}


Simplify random strings/collections

Simplify random strings/collections

--- src/main/clojure/lazytest/random.clj
+++ src/main/clojure/lazytest/random.clj
@@ -1,5 +1,6 @@
 (ns lazytest.random
-  "Composable generators for random data.")
+  "Composable generators for random data."
+  (:refer-clojure :exclude (double vector-of)))

 (defn rand-int-in-range
   "Returns a random integer between min (inclusive) and max (exclusive)."
@@ -53,23 +54,21 @@
   "Returns a function whicn returns a sequence populated with the
   results of calling f a random number of times. options
   are :min (inclusive) and :max (exclusive) for the length of the
-  list, default to min-random-length and max-random-length. The
-  returned sequence will be passed through the 'constructor' function
-  before being returned."
-  [constructor f & options]
+  list, default to min-random-length and max-random-length."
+  [f & options]
   (let [{:keys [min max]
 	 :or {min min-random-length, max max-random-length}} options]
-    (fn [] (constructor (repeatedly (rand-int-in-range min max) f)))))
+    (fn [] (repeatedly (rand-int-in-range min max) f))))

 (defn list-of
   "Like sequence-of; returns a list."
   [f & options]
-  (apply sequence-of list* f options))
+  (comp list* (apply sequence-of f options)))

 (defn vector-of
   "Like sequence-of; returns a vector."
   [f & options]
-  (apply sequence-of vec f options))
+  (comp vec (apply sequence-of f options)))

 (defn pair
   "Returns a function which returns a pair of random values selected
@@ -80,31 +79,34 @@
 (defn map-of
   "Like sequence-of; returns a map. f must return a key-value pair."
   [f & options]
-  (apply sequence-of #(into {} %) f options))
+  (comp #(into {} %) (apply sequence-of options)))

 (defn string-of
   "Like sequence-of; returns a string."
   [f & options]
-  (apply sequence-of #(apply str %) f options))
+  (comp #(apply str %) (apply sequence-of f options)))

 (def ^{:doc "Collection of whitespace characters: space, tab, and newline"}
      whitespace [\space \tab \newline])

 (def ^{:doc "Collection of characters for digits 0 through 9"}
-     digit (vec (map char (range 48 58))))
+     digit "0123456789")

 (def ^{:doc "Collection of upper-case English letters"}
-     upper-case (vec (map char (range 65 91))))
+     upper-case "ABCDEFGHIJKLMNOPQRSTUVWXYZ")

 (def ^{:doc "Collection of lower-case English letters"}
-     lower-case (vec (map char (range 97 123))))
+     lower-case "abcdefghijklmnopqrstuvwxyz")

 (def ^{:doc "Collection of upper- and lower-case English letters"}
-     letter (vec (concat upper-case lower-case)))
+     letter (str upper-case lower-case))
+
+(def ^{:doc "Collection of digits and letters"}
+     alphanumeric (str digit letter))

 (def ^{:doc "Collection of printable ASCII characters, including
      spaces but not tabs or line breaks."}
-     printable (vec (map char (range 32 127))))
+     printable (apply str (map char (range 32 127))))

 (defn pick
   "Returns a function which returns a random element from any of the


add styles for testimonial switching

add styles for testimonial switching

--- frontend/components/language_landing.cljs
+++ frontend/components/language_landing.cljs
@@ -98,7 +98,7 @@
                     [:a {:href="#"} "Read documentation on " (:language template)]]
                    ]
                   ]
-                 [:div.languages-testimonials
+                 [:div.languages-testimonials {:class (arrow-class selected-testimonial)}
                   [:div.languages-body.remove-margin
                    [:div.center-text
                     [:h3 "TESTIMONIALS"
@@ -107,7 +107,7 @@
                    [:div.testimonial-authors
                     (map-indexed (fn [i testimonial] [:img {:src (:img testimonial) :on-click #(put! controls-ch [:language-testimonial-tab-selected {:index i}])}])
                                  (:testimonials template))]
-                   [:div.testimonial-box {:class (arrow-class selected-testimonial)}
+                   [:div.testimonial-box
                     [:div.testimonial
                      [:p.testimonial-text (get-in template [:testimonials selected-testimonial :text])]


Temp fix for registering user

Temp fix for registering user

--- src/braid/server/routes/api.clj
+++ src/braid/server/routes/api.clj
@@ -31,14 +31,14 @@
         disallowed-chars #"[ \t\n\]\[!\"#$%&'()*+,.:;<=>?@\^`{|}~/]"
         nick (-> (first (string/split email #"@"))
                  (string/replace disallowed-chars ""))]
+    ; TODO: is there a way to combine these two txns into one?
     (db/run-txns!
-      (concat
-        (user/create-user-txn {:id id
-                               :email email
-                               :password (random-nonce 50)
-                               :avatar avatar
-                               :nickname nick})
-        (group/user-join-group-txn id group-id)))
+      (user/create-user-txn {:id id
+                             :email email
+                             :password (random-nonce 50)
+                             :avatar avatar
+                             :nickname nick}))
+    (db/run-txns! (group/user-join-group-txn id group-id))
     (sync/broadcast-new-user-to-group id group-id)
     id))


Add round corners to error bars so they would match the thread

--- src/braid/ui/styles/thread.cljs
+++ src/braid/ui/styles/thread.cljs
@@ -32,7 +32,9 @@
       :height (px 5)
       :position "absolute"
       :top 0
-      :left 0}]
+      :left 0
+      :border-radius [[vars/border-radius
+                       vars/border-radius 0 0]]}]

       [:&.archived
        [:.head:before
@@ -202,4 +204,4 @@
     (mixins/fontawesome \uf110)
     mixins/spin
     {:font-size (em 1.5)
-     :text-align "center"}]])+     :text-align "center"}]])


implement Security Chip

implement Security Chip

--- src/clj/game/cards-hardware.clj
+++ src/clj/game/cards-hardware.clj
@@ -323,6 +323,28 @@
                                                                   (:deck runner)) :hand)
                                                       (shuffle! :deck))}}}}}

+   "Security Chip"
+   {:abilities [{:label "[Trash]: Add [Link] strength to a non-Cloud icebreaker until the end of the run"
+                 :msg (msg "add " (:link runner) " strength to " (:title target) " until the end of the run")
+                 :req (req (:run @state))
+                 :prompt "Choose one non-Cloud icebreaker"
+                 :choices {:req #(and (has? % :subtype "Icebreaker")
+                                      (not (has? % :subtype "Cloud"))
+                                      (:installed %))}
+                 :effect (effect (pump target (:link runner) :all-run)
+                                 (trash (get-card state card) {:cause :ability-cost}))}
+                {:label "[Trash]: Add [Link] strength to any Cloud icebreakers until the end of the run"
+                 :msg (msg "add " (:link runner) " strength to " (count targets) " Cloud icebreakers until the end of the run")
+                 :req (req (:run @state))
+                 :prompt "Choose any number of Cloud icebreakers"
+                 :choices {:max 50 :req #(and (has? % :subtype "Icebreaker")
+                                              (has? % :subtype "Cloud")
+                                              (:installed %))}
+                 :effect (req (doseq [t targets]
+                                (pump state side t (:link runner) :all-run)
+                                (update-breaker-strength state side t))
+                              (trash state side (get-card state card) {:cause :ability-cost}))}]}
+
    "Security Nexus"
    {:effect (effect (gain :link 1) (gain :memory 1))
     :leave-play (effect (lose :link 1) (lose :memory 1))


Add cell output in describe mode when dev-mode is active

--- src/cljc/robinson/describe.cljc
+++ src/cljc/robinson/describe.cljc
@@ -45,6 +45,7 @@
            :short-grass            "short grass"
            :bamboo                 "a bamboo grove"
            :mountain               "a mountain"
+           :shallow-water          "shallow water"
            :swamp                  "swamp"
            :lava                   "a lava flow"
            :freshwater-hole        (if (> (get cell :water 0) 10)
@@ -123,7 +124,9 @@
            :white-upper-left-2     "a pale ornate corner"
            :white-upper-right-2    "a pale ornate corner"
            :white-bottom-left-2    "a pale ornate corner"
-           :white-bottom-right-2   "a pale ornate corner"))
+           :white-bottom-right-2   "a pale ornate corner"
+           :crushing-wall-trigger  "TODO"
+           :wall-darts-trigger     "TODO"))
     "strange land"))

 (defn describe-npc


Missing clipboard reagent class

Missing clipboard reagent class

--- src/cljs/cljs_webrepl/core.cljs
+++ src/cljs/cljs_webrepl/core.cljs
@@ -25,6 +25,20 @@

 (defn pprint-str [data]
   (with-out-str (fipp/pprint data)))
+
+
+(defn clipboard [child]
+  (let [clipboard-atom (atom nil)]
+    (r/create-class
+     {:display-name           "clipboard-button"
+      :component-did-mount    (fn [node]
+                                (let [clipboard (new js/Clipboard (r/dom-node node))]
+                                  (reset! clipboard-atom clipboard)))
+      :component-will-unmount (fn []
+                                (when-not (nil? @clipboard-atom)
+                                  (.destroy @clipboard-atom)
+                                  (reset! clipboard-atom nil)))
+      :reagent-render         (fn [child] child)})))

 (defn on-repl-eval [state num [ns expression]]
   (when num


Activate scrolling events in re-frame

Activate scrolling events in re-frame

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -4,6 +4,7 @@
             [comic-reader.subscriptions
              :refer [init-subscriptions!]]
             [comic-reader.history :as history]
+            [comic-reader.scrolling :as scrolling]
             [reagent.core :as reagent :refer [atom]]
             [re-frame.core :as rf]
             [secretary.core :as secretary
@@ -104,6 +105,7 @@
 (defn ^:export run []
   (init-handlers!)
   (init-subscriptions!)
+  (scrolling/setup-scrolling-events!)
   (try
     (history/hook-browser-navigation!)
     (catch js/Error e