spanish-specific logging output

spanish-specific logging output

--- src/babel/workbook.clj
+++ src/babel/workbook.clj
@@ -2,17 +2,19 @@
   (:refer-clojure :exclude [get-in merge resolve find parents])
   (:require
    [babel.engine :refer [generate]]
+   [babel.enrich :refer [against-pred]]
    [babel.english.grammar :as en]
+   [babel.espanol.grammar :as esg]
    [babel.espanol.writer :as es]
-   [babel.francais.grammar :as fr]
-   [babel.italiano.grammar :as it]
-   [babel.over :refer [over]]
+;   [babel.francais.grammar :as fr]
+;   [babel.italiano.grammar :as it]
+   [babel.over :refer [over overh overhc]]
    [babel.html :as html]
    [babel.korma :as korma]
    [babel.parse :as parse]
    [babel.pos :as pos]
    [babel.reader :as reader]
-   [babel.test.fr :as frtest]
+;   [babel.test.fr :as frtest]
    [clojail.core :refer [sandbox]]
    [clojail.testers :refer :all]
    [clojure.core :exclude [get-in]]
@@ -30,8 +32,10 @@
 (defn parse [string]
   (concat
    (en/parse string)
-   (fr/parse string)
-   (it/parse string)))
+;   (es/parse string)
+;   (fr/parse string)
+;   (it/parse string)))
+   ))

 (defn expr [id]
   (reader/id2expression (Integer. id)))
@@ -87,7 +91,8 @@
             (string/join " "
                          (let [loaded
                                (try
-                                 (workbook-sandbox (read-string expr))
+                                 (binding [*read-eval* true]
+                                   (workbook-sandbox (binding [*read-eval* true] (read-string expr))))
                                  ;; TODO: how can I show the stack trace for the
                                  ;; attempt to process the expression?
                                  (catch Exception e
@@ -199,11 +204,16 @@
 ;;                                @fr/small)
 (def foo
   (do
-    (generate {:synsem {:subcat '()
-                      :infl :imperfect
-                        :sem {:pred :be
-                              :subj {:pred :I}}}}
-              @fr/small)
+
+    (try
+      (generate {:synsem {:sem {:pred :be-called}}} @esg/small :add-subcat false)
+      (catch Exception e
+        (log/warn (str "ignoring exception while trying to generate: e=" e))))
+;    (generate {:synsem {:subcat '()
+;                      :infl :imperfect
+;                        :sem {:pred :be
+;                              :subj {:pred :I}}}}
+;              @fr/small)

     ;; the below is needed to avoid:
     ;;INFO  56:12,470 com.mchange.v2.c3p0.C3P0Registry:


Test multiple, overlapping res-ch in multi-change/change-reqs.

--- src/cbfg/test/kvs.cljs
+++ src/cbfg/test/kvs.cljs
@@ -238,6 +238,34 @@
                          (dissoc (merge m5 {:status :ok})
                                  :change-reqs)
                          (atake tkvs res-ch5))))
+                   (let [res-ch5-1 (achan tkvs) ; Test several noop-changes.
+                         m5 {:opaque @n
+                             :res-ch res-ch5-1
+                             :op :multi-change
+                             :kvs-ident (:kvs-ident open)
+                             :change-reqs [{:change-fn noop-change
+                                            :res-ch res-ch5-1}
+                                           {:change-fn noop-change}
+                                           {:change-fn noop-change
+                                            :res-ch res-ch5-1}]}]
+                     (aput tkvs cmd-ch m5)
+                     (and
+                      (e n (atake tkvs res-ch5-1)
+                         (dissoc (merge m5 {:more true :status :ok})
+                                 :change-reqs)
+                         nil)
+                      (e n (atake tkvs res-ch5-1)
+                         (dissoc (merge m5 {:more true :status :ok})
+                                 :change-reqs)
+                         nil)
+                      (e n (atake tkvs res-ch5-1)
+                         (dissoc (merge m5 {:more true :status :ok})
+                                 :change-reqs)
+                         nil)
+                      (e n (atake tkvs res-ch5-1)
+                         (dissoc (merge m5 {:status :ok})
+                                 :change-reqs)
+                         (atake tkvs res-ch5-1))))
                    (let [res-ch6 (achan tkvs) ; Test simple entry insert.
                          m6 {:opaque @n
                              :res-ch res-ch6


Secure jquery

Secure jquery

--- src/clj_blog/views.clj
+++ src/clj_blog/views.clj
@@ -58,7 +58,7 @@
     [:link {:rel "stylesheet", :href (str (basepath) "static/css/lanyon.css")}]
     [:link {:rel "stylesheet", :href "//fonts.googleapis.com/css?family=PT+Serif:400,400italic,700%7CPT+Sans:400"}]
     [:link {:rel "stylesheet", :href (str (basepath) "static/rrssb/rrssb.css")}]
-    [:script {:src "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"}]
+    [:script {:src "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"}]
     [:script {:src (str (basepath) "static/rrssb/rrssb.min.js")}]
     [:link {:rel "apple-touch-icon-precomposed", :sizes "144x144", :href (str (basepath) "static/apple-touch-icon-precomposed.png")}]
     [:link {:rel "shortcut icon", :href (str (basepath) "static/favicon.ico")}]


text fix

text fix

--- src/clojure2d/core.clj
+++ src/clojure2d/core.clj
@@ -1292,15 +1292,16 @@
   Possible alignments are: `:right`, `:center`, `:left`."
   {:metadoc/categories #{:write}}
   ([^Canvas canvas s x y align]
-   (let [x (long x)
-         y (long y)]
+   (let [x (float x)
+         y (float y)
+         s (str s)]
      (case align
        :right (let [w (.stringWidth (.getFontMetrics ^Graphics2D (.graphics canvas)) s)]
-                (.drawString ^Graphics2D (.graphics canvas) ^String s (- x w) y))
+                (.drawString ^Graphics2D (.graphics canvas) s (- x w) y))
        :center (let [w (/ (.stringWidth (.getFontMetrics ^Graphics2D (.graphics canvas)) s) 2.0)]
-                 (.drawString ^Graphics2D (.graphics canvas) ^String s (m/round (- x w)) y))
-       :left (.drawString ^Graphics2D (.graphics canvas) ^String s x y)
-       (.drawString ^Graphics2D (.graphics canvas) ^String s x y)))
+                 (.drawString ^Graphics2D (.graphics canvas) s (float (- x w)) y))
+       :left (.drawString ^Graphics2D (.graphics canvas) s x y)
+       (.drawString ^Graphics2D (.graphics canvas) s x y)))
    canvas)
   ([canvas s x y]
    (text canvas s x y :left)))


Don't print error.

Don't print error.

--- src/via/endpoint.cljc
+++ src/via/endpoint.cljc
@@ -6,6 +6,7 @@
 ;;   By using this software in any fashion, you are agreeing to be bound by
 ;;   the terms of this license.
 ;;   You must not remove this notice, or any others, from this software.
+
 (ns via.endpoint
   (:refer-clojure :exclude [send])
   (:require #?(:cljs [via.adapters.haslett :as haslett])
@@ -340,8 +341,7 @@
                                     ((adapter/handle-connect (endpoint)) endpoint (merge peer {:connection connection
                                                                                :status :connected}))
                                     peer-id))
-                    (j/call :catch (fn [error]
-                                     (js/console.warn error)
+                    (j/call :catch (fn [_error]
                                      (js/setTimeout
                                       (fn []
                                         (connect endpoint peer-address peer-id ssl-context))


removing test production cluster before recreating it properly

--- src/terraboot/infra.clj
+++ src/terraboot/infra.clj
@@ -8,14 +8,14 @@
 (defn generate-json []
   (do
     (to-file (vpc-vpn-infra "sandpit") (str infra-path "vpc.tf"))
-    (to-file (cluster-infra {:vpc-name vpc-name
-                             :cluster-name "production"
-                             :min-number-of-masters 3
-                             :max-number-of-masters 3
-                             :min-number-of-slaves 2
-                             :max-number-of-slaves 2
-                             :min-number-of-public-slaves 1
-                             :max-number-of-public-slaves 2}) (str infra-path "cluster.tf"))
+    #_(to-file (cluster-infra {:vpc-name vpc-name
+                               :cluster-name "production"
+                               :min-number-of-masters 3
+                               :max-number-of-masters 3
+                               :min-number-of-slaves 2
+                               :max-number-of-slaves 2
+                               :min-number-of-public-slaves 1
+                               :max-number-of-public-slaves 2}) (str infra-path "cluster.tf"))
     (to-file (cluster-infra {:vpc-name vpc-name
                              :cluster-name "staging"
                              :min-number-of-masters 3


GHC: skip blank lines, disallow commas in @tags

--- src/icfp2014/ghc.clj
+++ src/icfp2014/ghc.clj
@@ -3,9 +3,10 @@
             [clojure.string :as s]))

 (defn comment?
-  "Return true if the line ONLY contains commentary."
+  "Return true if the line contains NO CODE."
   [line]
-  (boolean (re-seq #"^\s*;.*" line)))
+  (boolean (or (s/blank? line)
+               (re-seq #"^\s*;.*" line))))

 (defn hashtag
   "Return the name of a hashtag, if any. Otherwise return nil."
@@ -15,7 +16,7 @@
 (defn attag
   "Return the name of an @tag, if any. Otherwise return nil."
   [line]
-  (last (first (re-seq #"@(\S+)" line))))
+  (last (first (re-seq #"@([a-zA-Z\-]+)" line))))

 (defn scan-hashtag
   "Returns a vector of [hashtag line-number] if the line contains a hashtag.


CMR-1980: Refactor for using providers and archive-centers interchangeably.

--- search-app/src/cmr/search/api/keyword.clj
+++ search-app/src/cmr/search/api/keyword.clj
@@ -9,27 +9,30 @@
             [cmr.common.util :as util]
             [cmr.common.services.errors :as errors]
             [cmr.search.services.query-execution.facets-results-feature :as frf]
-            [clojure.string :as str]))
+            [clojure.string :as str]
+            [clojure.set :as set]))

-(def gcmd-keyword-scheme-mapping
-  "Maps the keyword scheme name used by the CMR to the keyword scheme name used by GCMD."
-  {:archive-centers :providers
-   :providers :providers
-   :science-keywords :science-keywords
-   :platforms :platforms
-   :instruments :instruments})
+(def cmr-to-gcmd-keyword-scheme-aliases
+  "Map of all keyword schemes which are referred to with a different name within CMR and GCMD."
+  {:archive-centers :providers})

-(def cmr-keyword-scheme-mapping
-  {:archive-centers :archive-centers
-   :providers :archive-centers
-   :science-keywords :science-keywords
-   :platforms :platforms
-   :instruments :instruments})
+(defn- translate-keyword-scheme-to-gcmd
+  "Translates a keyword scheme into a known keyword scheme for GCMD."
+  [keyword-scheme]
+  (or (keyword-scheme cmr-to-gcmd-keyword-scheme-aliases)
+      keyword-scheme))
+
+(defn- translate-keyword-scheme-to-cmr
+  "Translates a keyword scheme into a known keyword scheme for CMR."
+  [keyword-scheme]
+  (or (keyword-scheme (set/map-invert cmr-to-gcmd-keyword-scheme-aliases))
+      keyword-scheme))

 (defn- validate-keyword-scheme
   "Throws a service error if the provided keyword-scheme is invalid."
   [keyword-scheme]
-  (let [valid-keywords (keys gcmd-keyword-scheme-mapping)]
+  (let [valid-keywords (concat (keys frf/nested-fields-mappings)
+                               (vals cmr-to-gcmd-keyword-scheme-aliases))]
     (when-not (contains? (set valid-keywords) keyword-scheme)
       (errors/throw-service-error
         :bad-request (format "The keyword scheme [%s] is not supported. Valid schemes are: %s, and %s."
@@ -129,8 +132,8 @@
                              request-context :request-context}
       (let [orig-keyword-scheme (csk/->kebab-case-keyword keyword-scheme)]
         (validate-keyword-scheme orig-keyword-scheme)
-        (let [cmr-keyword-scheme (orig-keyword-scheme cmr-keyword-scheme-mapping)
-              gcmd-keyword-scheme (orig-keyword-scheme gcmd-keyword-scheme-mapping)
+        (let [cmr-keyword-scheme (translate-keyword-scheme-to-cmr orig-keyword-scheme)
+              gcmd-keyword-scheme (translate-keyword-scheme-to-gcmd orig-keyword-scheme)
               keywords (vals (gcmd-keyword-scheme (kf/get-gcmd-keywords-map request-context)))
               hierarchical-keywords (parse-hierarchical-keywords
                                       (cmr-keyword-scheme frf/nested-fields-mappings) keywords)]
@@ -138,14 +141,4 @@
            :headers {"Content-Type" (mt/format->mime-type :json)}
            :body (json/generate-string hierarchical-keywords)})))))

-(comment

-  (def keywords
-    (vals (kms/get-keywords-for-keyword-scheme
-            {:system (cmr.indexer.system/create-system)} :science-keywords)))
-
-  (parse-hierarchical-keywords (:science-keywords frf/nested-fields-mappings) keywords)
-
-  )
-
-


Fix ex-info arity

Fix ex-info arity

--- src/compound/core.cljc
+++ src/compound/core.cljc
@@ -210,7 +210,7 @@
      (-> compound
          (remove-keys [k])
          (add-items [new-item]))
-     (throw (ex-info (str "Can't update item, item with key " k " not found" {:compound compound})))))
+     (throw (ex-info (str "Can't update item, item with key " k " not found") {:compound compound}))))
   ([compound k f & args]
    (update-item compound k #(apply f % args))))


Getting rid of carmine related error

Getting rid of carmine related error

--- jvm-runner/project.clj
+++ jvm-runner/project.clj
@@ -8,7 +8,7 @@
                  [com.h2database/h2 "1.3.170"] ; In Memory Database
                  [org.xerial/sqlite-jdbc "3.7.15-M1"] ; SQLite
                  [com.novemberain/monger "2.0.0"] ; Monger
-                 [com.taoensso/carmine "2.7.0"] ; Carmine
+                 [com.taoensso/carmine "2.7.0" :exclusions [org.clojure/clojure]] ; Carmine
                  [org.clojure/core.async "0.1.346.0-17112a-alpha"] ; Go-Routines
                  [org.clojure/test.check "0.5.9"] ; Generative Testing
                  [prismatic/schema "0.2.6"] ; Schema Verification


Fixed namespace in test_json_renderer module

--- test/clouseau/test_json_renderer.clj
+++ test/clouseau/test_json_renderer.clj
@@ -36,7 +36,7 @@
 ;;; exception statement from your version.
 ;;;

-(ns clouseau.test-core
+(ns clouseau.test-json-renderer
   (:require [clojure.test :refer :all]
             [clouseau.json-renderer :refer :all]))


Парсинг трех страниц сайта tender.sk.kz

Парсинг трех страниц сайта tender.sk.kz

--- src/lotsbox/core.clj
+++ src/lotsbox/core.clj
@@ -75,10 +75,10 @@

 ;; tender.sk.kz ------------------------------------------------------------------

-(defn tender-sk-kz-lots []
+(defn tender-sk-kz-lots [url]
   "Получение данных лотов по адресу http://tender.sk.kz/index.php/ru/lots"
   (let [res  "tender.sk.kz"
-        url  "http://tender.sk.kz/index.php/ru/lots"]
+        url  (or url "http://tender.sk.kz/index.php/ru/lots")]
     (-> (h/html-resource (java.net.URL. url))
         (h/select [:.showtab :tr])
         rest ;; Убираем шапку таблицы, берем только тело
@@ -151,8 +151,12 @@
 ;; SHEDULE -----------------------------------------------------------------------------------------

 (defn task-fn-1 []
-  (println (insert-update-rows(tender-sk-kz-lots)))
-  )
+  (println (insert-update-rows (concat
+                                (tender-sk-kz-lots "http://tender.sk.kz/index.php/ru/lots")
+                                (tender-sk-kz-lots "http://tender.sk.kz/index.php/ru/lots/10")
+                                (tender-sk-kz-lots "http://tender.sk.kz/index.php/ru/lots/20")
+                                ))))
+

 (def my-pool (at/mk-pool))

@@ -228,7 +232,7 @@

                            ;; {:text "Доп. сведения" :align "l"
                            ;;  :getfn #(vec [:div
-
+
                            ;;                ])
                            ;;  }

@@ -268,7 +272,7 @@
             (check-box {} :ff-bsum (qp :ff-bsum))
             (text-field {:type "number" :pattern "\\d+(\\.\\d{2})?" :placeholder "сумма" } :bsum (qp :bsum))

-            " до"
+            " до"
             (check-box {} :ff-esum (qp :ff-esum))
             (text-field {:type "number" :pattern "\\d+(\\.\\d{2})?" :placeholder "сумма" } :esum (qp :esum))

@@ -284,12 +288,12 @@
             [:br]
             [:br]
             (submit-button "Послать запрос")
-
+
             ]

-           (println (str "%" (qp :liketext) "%"))
-
+           ;;(println (str "%" (qp :liketext) "%"))
+
            (cw/html-table-with-page-sort request
                                          (cw/items-do-fn table-lots
                                                          (fn [select-lots]
@@ -318,7 +322,7 @@
                                                                                (like :description (str "%" (qp :liketext) "%"))

                                                                                )))
-
+
                                                                  )))

                                                          )


allow jobs to finish before taking snapshots

--- src/wb_es/bulk/core.clj
+++ src/wb_es/bulk/core.clj
@@ -319,7 +319,11 @@
                 (case (:action job-meta)
                   "snapshot" (let [index-id (:index job-meta)
                                    repository-name (:repository job-meta)
-                                   snapshot-id (get-next-snapshot-id repository-name release-id)]
+                                   snapshot-id (get-next-snapshot-id repository-name release-id)
+                                   timeout 60000]
+                               (debug (format "Snapshot paused for %s ms for jobs to finish..." timeout))
+                               (Thread/sleep timeout) ; hack to allow other jobs to finish.
+                               (debug "Snapshot resumed")
                                (save-snapshot index-id repository-name snapshot-id)
                                (debug "Snapshot created" job-meta))
                   (do


Well, that's embarrassing. How'd I miss those basic compiler errors?

--- src/zguide/zhelpers.clj
+++ src/zguide/zhelpers.clj
@@ -114,8 +114,8 @@
 I just need to get something written for my
 \"get the rope thrown across the bridge\" approach.
 It totally falls apart when I'm just trying to send a string."
-  (doseq [m message]
-    (sendmore socket message))
+  (doseq [m messages]
+    (send-more socket m))
   (send socket ""))

 (defn identify


Add tests of util/update

Add tests of util/update

--- test/oxcart/util_test.clj
+++ test/oxcart/util_test.clj
@@ -28,3 +28,13 @@
                   (/ x 2)
                   x))
               1024))))
+
+
+(deftest update-tests
+  (is (= {:foo 4}
+         (update {:foo 3}
+                 :foo inc)))
+
+  (is (= {:foo {:bar 4}}
+         (update {:foo {}}
+                 :foo #(assoc %1 :bar 4)))))


Add read-batch as interop static method

Add read-batch as interop static method

--- src/onyx/interop.clj
+++ src/onyx/interop.clj
@@ -1,12 +1,17 @@
 (ns onyx.interop
   (:gen-class :name onyx.interop
-              :methods [^:static [write_batch [clojure.lang.IPersistentMap] clojure.lang.IPersistentMap]])
-  (:require [onyx.peer.function :refer [write-batch]]
+              :methods [^:static [write_batch [clojure.lang.IPersistentMap] clojure.lang.IPersistentMap]
+                        ^:static [read_batch [clojure.lang.IPersistentMap] clojure.lang.IPersistentMap]])
+  (:require [onyx.peer.function :refer [write-batch read-batch]]
             [onyx.peer.pipeline-extensions :refer [PipelineInput Pipeline]]))

 (defn -write_batch
   [event]
   (write-batch event))
+
+(defn -read_batch
+  [event]
+  (read-batch event))

 (gen-interface
   :name onyx.IPipelineInput


function to calc label

function to calc label

--- src/paulkrake/ml.clj
+++ src/paulkrake/ml.clj
@@ -4,9 +4,27 @@
 (defn fmt [v]
   (/ (int (* 100 (bigdec v))) 100.0))

+(defn score-to-label
+  "Takes a soccer result and translates it into a unique number"
+  [g1 g2]
+  (let [n (+ g1 g2)
+        s (/ (* n (inc n)) 2)]
+    (+ s (inc g2))))
+
+(defn label-to-score
+  "Takes a label and translates it back into a soccer result"
+  [label]
+  (let [g1_0 (as-> (range 0 1000) x
+               (filter (fn [i] (<= (score-to-label i 0) label)) x)
+               (last x))
+        n (/ (* g1_0 (inc g1_0)) 2)
+        g2 (dec (- label n))
+        g1  (- g1_0 g2)]
+    [g1 g2]))
+
 (defn create-features [saison spieltag n out-file]
   (as-> (dc/range-spieltage saison spieltag n) z
-    (map (fn [[s t]] (dc/stat-data 1415 34)) z)
+    (map (fn [[s t]] (dc/stat-data s t)) z)
     (apply concat z)
     (map (fn [[_ _ s1 s2]]
            {:x (concat


Improve texture docstring

Improve texture docstring

--- src/play_clj/g2d.clj
+++ src/play_clj/g2d.clj
@@ -56,11 +56,19 @@
 (defmacro texture
   "Returns an entity based on [TextureRegion](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/TextureRegion.html).

+    ; load image.png
     (texture \"image.png\")
+    ; load image.png, flip it, and only display the specified region
     (texture \"image.png\"
              :flip true false
              :set-region 0 0 100 100)
-    (texture (texture \"image.png\"))"
+    ; create a new texture based on an existing one
+    (texture (texture \"image.png\"))
+    ; rotate a texture 45 degress counterclockwise around the bottom-left corner
+    (assoc (texture \"image.png\")
+           :angle 45
+           :origin-x 0
+           :origin-y 0)"
   [arg & options]
   `(let [entity# (texture* ~arg)]
      (u/calls! ^TextureRegion (u/get-obj entity# :object) ~@options)


Refactor unnecessary let

Refactor unnecessary let

--- src/braid/search/ui/search_button.cljs
+++ src/braid/search/ui/search_button.cljs
@@ -4,9 +4,8 @@
     [braid.core.client.routes :as routes]))

 (defn search-button-view [query]
-  (let [open-group-id (subscribe [:open-group-id])]
-    [:a.search
-     {:href (routes/group-page-path {:group-id @open-group-id
-                                     :page-id "search"
-                                     :query-params {:query query}})}
-     "Search"]))
+  [:a.search
+   {:href (routes/group-page-path {:group-id @(subscribe [:open-group-id])
+                                   :page-id "search"
+                                   :query-params {:query query}})}
+   "Search"])


Load the inference files, fixes a bug loading php

--- src/circle/backend/build/inference.clj
+++ src/circle/backend/build/inference.clj
@@ -3,6 +3,8 @@
   (:use circle.util.fs)
   (:require [circle.backend.build.template :as template])
   (:require [circle.backend.action :as action])
+  (:require circle.backend.build.inference.rails
+            circle.backend.build.inference.php)
   (:use [arohner.utils :only (inspect)]))

 (defn dir-contains-php-files?


Add `java.io.Closeable` type-hint to `conn-pool` for `with-open`, etc.

--- src/taoensso/carmine/connections.clj
+++ src/taoensso/carmine/connections.clj
@@ -92,7 +92,7 @@
 (def ^:private pool-cache (atom {}))

 (defn conn-pool
-  [opts & [cached?]]
+  ^java.io.Closeable [opts & [cached?]]
   (if (satisfies? IConnectionPool opts)
     opts ; 1.x backwards compatiblity, testing
     (if-let [dp (and cached? (@pool-cache opts))]


Remove dead link

Remove dead link

--- src/clj/clojuredocs/pages/quickref.clj
+++ src/clj/clojuredocs/pages/quickref.clj
@@ -107,7 +107,5 @@
        [:div.col-sm-9
         [:h1 "Quickref for Clojure Core"]
         [:p
-         "Adapted from Johannes Friestad's "
-         [:a {:href "http://faustus.webatu.com/clj-quick-ref.html"} "excellent quick ref"]
-         ". "]
+         "Adapted from Johannes Friestad's excellent quick ref."]
         (map $sphere static/quickref-data)]]]}))


use tc/jsonb->clj

use tc/jsonb->clj

--- src/clj/org/openforis/ceo/db/plots.clj
+++ src/clj/org/openforis/ceo/db/plots.clj
@@ -22,7 +22,7 @@
 (defn- prepare-samples-array [plot-id project-id]
   (mapv (fn [{:keys [sample_id sample_geom sampleId geom value]}]
           (merge {:id         sample_id
-                  :sampleGeom sample_geom
+                  :sampleGeom (tc/jsonb->clj sample_geom)
                   :sampleId   sampleId ;TODO I don't think we distinguish between sample_id and sampleId so this could go away
                   :geom       (tc/jsonb->clj geom)}
                  (when (< 2 (count (str value)))


default option bug fix

default option bug fix

--- src/clojure/zensols/actioncli/repl.clj
+++ src/clojure/zensols/actioncli/repl.clj
@@ -24,7 +24,7 @@
   ([short long port]
    [short long "the port bind for the repl server"
      :required "<number>"
-     :default default-port
+     :default port
      :parse-fn #(Integer/parseInt %)
     :validate [#(< 0 % 0x10000) "Must be a number between 0 and 65536"]]))


Try to make open-range test op more reliable.

--- blocks-tests/src/blocks/store/tests.clj
+++ blocks-tests/src/blocks/store/tests.clj
@@ -273,15 +273,20 @@
     (gen/bind
       (choose-block blocks)
       (fn [block]
-        (gen/fmap
-          (fn [positions]
-            (let [[start end] (sort positions)]
-              {:id (:id block)
-               :start start
-               :end end}))
-          (gen/vector-distinct
-            (gen/large-integer* {:min 0, :max (:size block)})
-            {:num-elements 2})))))
+        (if (< 3 (:size block))
+          (gen/fmap
+            (fn [positions]
+              (let [[start end] (sort positions)]
+                {:id (:id block)
+                 :start start
+                 :end end}))
+            (gen/vector-distinct
+              (gen/large-integer* {:min 0, :max (:size block)})
+              {:num-elements 2}))
+          (gen/return
+            {:id (:id block)
+             :start 0
+             :end (:size block)})))))

   (apply-op
     [this store]


doc-generator: remove redundant filename in repo path table

--- scripts/cljs-api-parser/src/core.clj
+++ scripts/cljs-api-parser/src/core.clj
@@ -27,21 +27,21 @@

 ;; Table of namespaces that we will parse
 (def cljs-ns-paths
-  ; NS                        REPO             FILE               FULL PATH
-  {"cljs.core"              {"clojurescript" {"core.cljs"        "src/cljs/cljs/core.cljs"
-                                              "core.clj"         "src/clj/cljs/core.clj"}
-                             "clojure"       {"core.clj"         "src/clj/clojure/core.clj"
-                                              "core_deftype.clj" "src/clj/clojure/core_deftype.clj"
-                                              "core_print.clj"   "src/clj/clojure/core_print.clj"
-                                              "core_proxy.clj"   "src/clj/clojure/core_proxy.clj"}}
-   "cljs.reader"            {"clojurescript" {"reader.cljs"      "src/cljs/cljs/reader.cljs"}}
-   "clojure.set"            {"clojurescript" {"set.cljs"         "src/cljs/clojure/set.cljs"}}
-   "clojure.string"         {"clojurescript" {"string.cljs"      "src/cljs/clojure/string.cljs"}}
-   "clojure.walk"           {"clojurescript" {"walk.cljs"        "src/cljs/clojure/walk.cljs"}}
-   "clojure.zip"            {"clojurescript" {"zip.cljs"         "src/cljs/clojure/zip.cljs"}}
-   "clojure.data"           {"clojurescript" {"data.cljs"        "src/cljs/clojure/data.cljs"}}
-   "cljs.core.async"        {"core.async"    {"async.cljs"       "src/main/clojure/cljs/core/async.cljs"}}
-   "cljs.core.async.macros" {"core.async"    {"macros.clj"       "src/main/clojure/cljs/core/async/macros.clj"}}})
+  ; NS                        REPO             FILE               PATH IN REPO
+  {"cljs.core"              {"clojurescript" {"core.cljs"        "src/cljs/cljs"
+                                              "core.clj"         "src/clj/cljs"}
+                             "clojure"       {"core.clj"         "src/clj/clojure"
+                                              "core_deftype.clj" "src/clj/clojure"
+                                              "core_print.clj"   "src/clj/clojure"
+                                              "core_proxy.clj"   "src/clj/clojure"}}
+   "cljs.reader"            {"clojurescript" {"reader.cljs"      "src/cljs/cljs"}}
+   "clojure.set"            {"clojurescript" {"set.cljs"         "src/cljs/clojure"}}
+   "clojure.string"         {"clojurescript" {"string.cljs"      "src/cljs/clojure"}}
+   "clojure.walk"           {"clojurescript" {"walk.cljs"        "src/cljs/clojure"}}
+   "clojure.zip"            {"clojurescript" {"zip.cljs"         "src/cljs/clojure"}}
+   "clojure.data"           {"clojurescript" {"data.cljs"        "src/cljs/clojure"}}
+   "cljs.core.async"        {"core.async"    {"async.cljs"       "src/main/clojure/cljs/core"}}
+   "cljs.core.async.macros" {"core.async"    {"macros.clj"       "src/main/clojure/cljs/core/async"}}})

 ;;------------------------------------------------------------
 ;; Form Reading
@@ -92,7 +92,7 @@
   "Get path to the given repo file"
   [ns- repo file]
   (let [path (get-in cljs-ns-paths [ns- repo file])]
-    (str repo-dir "/" repo "/" path)))
+    (str repo-dir "/" repo "/" path "/" file)))

 (defn get-forms
   "Get forms from the given repo file"


only scrolls down on message

only scrolls down on message

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -10,7 +10,8 @@
                           :upload-progress nil
                           :data-uploaded 0
                           :current-file-download nil
-                          :current-download-stream-id (new js/Blob)}))
+                          :current-download-stream-id (new js/Blob)
+                          :message-received false}))

 (enable-console-print!)

@@ -43,8 +44,10 @@
         (om/build-all message-view (:messages data))))
     om/IDidUpdate
       (did-update [_ _ _]
-        (let [div (js/$ "#messages")]
-          (.scrollTop div (.prop div "scrollHeight"))))))
+        (if (:message-received @app-state)
+          (let [div (js/$ "#messages")]
+            (.scrollTop div (.prop div "scrollHeight"))
+            (swap! app-state assoc :message-received false))))))

 (defn file-upload-progress-view [data owner]
   (reify
@@ -79,7 +82,8 @@

 (.on socket "chat message"
   (fn [message]
-    (swap! app-state assoc :messages (conj (:messages @app-state) message))))
+    (swap! app-state assoc :messages (conj (:messages @app-state) message))
+    (swap! app-state assoc :message-received true)))

 (.on socket "userslist"
   (fn [users]


got rid of current-sound-id

got rid of current-sound-id

--- src/frontend/core.cljs
+++ src/frontend/core.cljs
@@ -2,7 +2,6 @@

 (defonce room-id (.getAttribute (. js/document (getElementById "roomid")) "data"))
 (defonce socket (js/io))
-(defonce current-sound-id "current-song")
 (defonce default-upload-slots 4)
 (defonce default-download-slots 4)
 (defonce app-state (atom {:signed-in? false
@@ -123,7 +122,7 @@
       (.emit socket "file-download-request" id))))

 (defn pause []
-  (.pause js/soundManager current-sound-id)
+  (.pause (:current-sound @app-state))
   (.emit socket "pause" (.-position (:current-sound @app-state))))

 (defn resume []
@@ -168,15 +167,15 @@
     (set! (.-onloadend reader)
       (fn []
         (swap! app-state assoc :current-sound
-          (.createSound js/soundManager #js {:id current-sound-id
+          (.createSound js/soundManager #js {:id track-id
                                              :type "audio/mpeg"
                                              :url (.-result reader)
                                              :autoLoad true}))
         (.play (:current-sound @app-state)
                #js {:whileplaying while-playing
                     :onfinish on-finish
-                    :onplay #(.setPosition js/soundManager current-sound-id
-                                                           position)})))))
+                    :onplay #(.setPosition (:current-sound @app-state)
+                                           position)})))))

 (.on socket "sign-in-success"
   (fn []
@@ -263,17 +262,17 @@

 (.on socket "pause"
   (fn [position]
-    (.pause js/soundManager current-sound-id)
-    (.setPosition js/soundManager current-sound-id position)))
+    (.pause (:current-sound @app-state))
+    (.setPosition (:current-sound @app-state) position)))

 (.on socket "resume"
   (fn []
-    (.resume js/soundManager current-sound-id)))
+    (.resume (:current-sound @app-state))))

 (.on socket "position-change"
   (fn [position]
     (letfn [(set-pos [position]
-              (.setPosition js/soundManager current-sound-id position))]
+              (.setPosition (:current-sound @app-state) position))]
       (println "Received pos: " position)
       (if (= 0 (.-playState (:current-sound @app-state)))
         (.play (:current-sound @app-state)


Improve some docstrings on promise implementation.

--- src/futura/promise.clj
+++ src/futura/promise.clj
@@ -289,8 +289,8 @@

 (defn all
   "Given an array of promises, return a promise
-  that is fulfilled  when all the items in the
-  array are fulfilled."
+  that is resolved  when all the items in the
+  array are resolved."
   [promises]
   (let [promises (map promise promises)
         futures (map future promises)
@@ -302,8 +302,8 @@

 (defn any
   "Given an array of promises, return a promise
-  that is fulfilled when first one item in the
-  array is fulfilled."
+  that is resolved when first one item in the
+  array is resolved."
   [promises]
   (let [xform (comp
                (map promise)


remove strong types in metrics

remove strong types in metrics

--- src/vignette/perfmonitoring/core.clj
+++ src/vignette/perfmonitoring/core.clj
@@ -1,9 +1,7 @@
 (ns vignette.perfmonitoring.core
   (:require [vignette.common.logger :as log]
             [environ.core :refer [env]]
-            [prometheus.core :as prometheus])
-  (:import)
-    (io.prometheus.client CollectorRegistry))
+            [prometheus.core :as prometheus]))

 (def extended-histogram-buckets (atom [0.001, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.3, 0.5, 0.75, 1.0, 2.0, 3.0, 5.0, 10.0, 20.0, 30.0]))

@@ -63,7 +61,7 @@

 (defn instrument-handler
   "Ring middleware to record request metrics"
-  [handler ^String app-name ^CollectorRegistry registry]
+  [handler app-name registry]
   (let [metrics-store {:registry registry}
         metrics-store (prometheus/register-counter metrics-store
                                         app-name


Fix bug in mesh generation

Fix bug in mesh generation

--- src/wireframes/shapes/primitives.clj
+++ src/wireframes/shapes/primitives.clj
@@ -94,7 +94,7 @@
         i (range x-divisions)
         :let [a (+ i (* j (inc x-divisions)))
               b (inc a)
-              c (+ b y-divisions)
+              c (+ b x-divisions)
               d (inc c)]]
     {:vertices [a b d c]})) ; order of points is important


Add span/search-term when missing from highlight.

--- src/haystack/query.clj
+++ src/haystack/query.clj
@@ -65,6 +65,13 @@

 ;; ------------------------------------------------ extract info

+(defn- build-highlight
+  [v]
+  (let [highlight (join "" v)]
+    (if (re-find #"search-term" highlight)
+      highlight
+      (str "" highlight ""))))
+
 (defn build-document
   [doc]
   (let [source (atom (select-keys
@@ -75,7 +82,7 @@
         highlight (:highlight doc)]
     (doall
      ;; (map (fn [[k v]] (swap! source assoc k (join " .... " v))) highlight))
-     (map (fn [[k v]] (swap! source assoc k (join "" v))) highlight))
+     (map (fn [[k v]] (swap! source assoc k (build-highlight v))) highlight))
     (rename-keys @source {:bh-product-id :id})))

 (defn extract-documents


enable stats

enable stats

--- src/jarkeeper/core.clj
+++ src/jarkeeper/core.clj
@@ -248,9 +248,9 @@
   (GET "/:repo-owner/:repo-name/downloads.svg" [repo-owner repo-name]
     (try
       (do
-        ; (m/swap!
-        ;   (get-ref :downloads repo-owner repo-name)
-        ;   (fn [c] (if (nil? c) 1 (inc c))))
+        (m/swap!
+          (get-ref :downloads repo-owner repo-name)
+          (fn [c] (if (nil? c) 1 (inc c))))
         (-> (downloads/get-badge repo-owner repo-name)
           (resp/response)
           (resp/header "cache-control" "no-cache")
@@ -259,7 +259,7 @@

        ))
       (catch Exception e
-        ; (rollbar/report-exception (env :rollbar-token) "production" e)
+        (rollbar/report-exception (env :rollbar-token) "production" e)
         {:status 404})))

   (GET "/:repo-owner/:repo-name/status.json" [repo-owner repo-name]


fix :before? and :after? to be able to compare datafied, as opposed to plain, objects.

--- src/java_time/data.clj
+++ src/java_time/data.clj
@@ -68,8 +68,8 @@

         {`p/nav (fn [_ k v]
                   (case k
-                    :before? (.isBefore ym v)
-                    :after?  (.isAfter  ym v)
+                    :before? (.isBefore ym (-> v meta ::d/obj))
+                    :after?  (.isAfter  ym (-> v meta ::d/obj))
                     :instant (-> (.atDay ym 1)
                                  (.atStartOfDay)
                                  (.toInstant (or (zone-offset v) @system-offset)))
@@ -89,8 +89,8 @@

         {`p/nav  (fn [_ k v]
                    (case k
-                     :before?    (.isBefore lt v)
-                     :after?     (.isAfter  lt v)
+                     :before?    (.isBefore lt (-> v meta ::d/obj))
+                     :after?     (.isAfter  lt (-> v meta ::d/obj))
                      :iso-format (.format DateTimeFormatter/ISO_TIME lt)
                      :format     (.format (dt-formatter v) lt)
                      nil))})))
@@ -107,8 +107,8 @@

         {`p/nav (fn [_ k v]
                   (case k
-                    :before?    (.isBefore ld v)
-                    :after?     (.isAfter  ld v)
+                    :before?    (.isBefore ld (-> v meta ::d/obj))
+                    :after?     (.isAfter  ld (-> v meta ::d/obj))
                     :iso-format (.format DateTimeFormatter/ISO_DATE ld)
                     :format     (.format (dt-formatter v) ld)
                     :julian     (julian-field ld v)
@@ -130,8 +130,8 @@

         {`p/nav (fn [_ k v]
                   (case k
-                    :before?    (.isBefore ldt v)
-                    :after?     (.isAfter  ldt v)
+                    :before?    (.isBefore ldt (-> v meta ::d/obj))
+                    :after?     (.isAfter  ldt (-> v meta ::d/obj))
                     :iso-format (.format DateTimeFormatter/ISO_LOCAL_DATE_TIME ldt)
                     :format     (.format (dt-formatter v) ldt)
                     :instant    (.toInstant ldt (or (zone-offset v) @system-offset))
@@ -153,8 +153,8 @@

         {`p/nav (fn [_ k v]
                   (case k
-                    :before?    (.isBefore odt v)
-                    :after?     (.isAfter  odt v)
+                    :before?    (.isBefore odt (-> v meta ::d/obj))
+                    :after?     (.isAfter  odt (-> v meta ::d/obj))
                     :iso-format (.format DateTimeFormatter/ISO_OFFSET_DATE_TIME odt)
                     :format     (.format (dt-formatter v) ldt)
                     :instant    (.toInstant odt)
@@ -172,8 +172,8 @@

         {`p/nav (fn [_ k v]
                   (case k
-                    :before?    (.isBefore zdt v)
-                    :after?     (.isAfter  zdt v)
+                    :before?    (.isBefore zdt (-> v meta ::d/obj))
+                    :after?     (.isAfter  zdt (-> v meta ::d/obj))
                     :iso-format (.format DateTimeFormatter/ISO_ZONED_DATE_TIME zdt)
                     :format     (.format (dt-formatter v) zdt)
                     :instant    (.toInstant zdt)
@@ -198,8 +198,8 @@
                  :nano   epoch-nano}}
         {`p/nav (fn [_ k v]
                   (case k
-                    :before?         (.isBefore inst v)
-                    :after?          (.isAfter  inst v)
+                    :before?         (.isBefore inst (-> v meta ::d/obj))
+                    :after?          (.isAfter  inst (-> v meta ::d/obj))
                     :iso-format      (.format DateTimeFormatter/ISO_INSTANT inst)
                     :format          (.format ^DateTimeFormatter v inst)
                     :local-time      (LocalTime/ofInstant      inst  (or (zone-id v) @system-zone))


simpler diff output; txtdiff -> txt_diff for variable

--- src/revdiff/core.clj
+++ src/revdiff/core.clj
@@ -61,14 +61,14 @@

 (defn txtdiff [r1 r2 item]
   (let [v (vpaths r1 r2 item item)]
-    (sh "svn" "diff" "--diff-cmd" "diff" shhh (first v) (second v))))
+    (sh "svn" "diff" "--diff-cmd" "diff" "-x" "-u0" shhh (first v) (second v))))

 ;; A sequence (possibly nil) of the changed lines (denoted by a leading + or -)
 ;; from the given text diff, filtered by the filter term, if provided.

-(defn matches? [txtdiff term]
+(defn matches? [txt_diff term]
   (let [restr (if term (str "[+-][^+-].*" term ".*") ".*")]
-    (seq (filter #(re-matches (re-pattern restr) %) txtdiff))))
+    (seq (filter #(re-matches (re-pattern restr) %) txt_diff))))

 ;; A sequence of files from the revision-pair diff with changed lines matching
 ;; the filter term. The first line of each block contains the file/path name from


DRYer!

DRYer!

--- src/rhymes/rhyme.clj
+++ src/rhymes/rhyme.clj
@@ -13,27 +13,35 @@
         indexed-vowels (filter #(vowel? (second %)) indexed-phones)]
     (first (last indexed-vowels))))

+(defn last-syllable
+  "Get all the phones from the last vowel to the end of the word."
+  [word]
+  (let [p (get d word)
+        idx (last-vowel-index word)]
+    (subvec p idx)))
+
+(defn last-vowel
+  [word]
+  (let [p (get d word)
+        idx (last-vowel-index word)]
+    (get p idx)))
+
+(defn first-phone
+  [word]
+  (get-in d [word 0]))
+
 (defn alliteration?
   [w1 w2]
-  (let [first-phone1 (get-in d [w1 0])
-        first-phone2 (get-in d [w2 0])]
+  (let [[first-phone1 first-phone2] (map first-phone [w1 w2])]
     (= first-phone1 first-phone2)))

 (defn perfect-rhyme?
   [w1 w2]
-  (let [p1 (get d w1)
-        p2 (get d w2)
-        idx1 (last-vowel-index w1)
-        idx2 (last-vowel-index w2)]
-    (= (subvec p1 idx1)
-       (subvec p2 idx2))))
+  (let [[syllable1 syllable2] (map last-syllable [w1 w2])]
+    (= syllable1 syllable2)))

 ; a.k.a. assonance
 (defn slant-rhyme?
   [w1 w2]
-  (let [p1 (get d w1)
-        p2 (get d w2)
-        idx1 (last-vowel-index w1)
-        idx2 (last-vowel-index w2)]
-    (= (get p1 idx1)
-       (get p2 idx2))))
+  (let [[last-vowel1 last-vowel2] (map last-vowel [w1 w2])]
+    (= last-vowel1 last-vowel2)))


Load user init script on Leiningen launch.

--- src/leiningen/core.clj
+++ src/leiningen/core.clj
@@ -103,6 +103,11 @@
            (println "Warning: problem requiring hooks:" (.getMessage e))
            (println "...continuing without hooks completely loaded.")))))

+(defn user-init [project]
+  (let [init-file (File. (get-home-dir) "init.clj")]
+    (when (.exists init-file)
+      (load-file (.getAbsolutePath init-file)))))
+
 (defn ns->path [n]
   (str (.. (str n)
            (replace \- \_)
@@ -160,6 +165,7 @@
      (let [task-name (or (@aliases task-name) task-name "help")
            project (if (project-needed? task-name) (read-project))
            compile-path (:compile-path project)]
+       (user-init project)
        (when compile-path (.mkdirs (File. compile-path)))
        (binding [*compile-path* compile-path]
          (when project


Fix top-level project.clj filtering bug in 'add-commit-facts.

We were handling full, parsed lines so the beginning of line match was
incorrect. Now we filter on the 'path by itself, after parsing.

--- src/leiningen/voom.clj
+++ src/leiningen/voom.clj
@@ -1166,8 +1166,8 @@
                  , (->> (git {:gitdir gitdir}
                              "ls-tree" "-r" "--full-tree" (str sha))
                         :lines
-                        (filter #(re-find #"(^|/)project.clj$" %))
                         (map #(s/split % #"\s+" 4)))
+                   :when (re-find #"(^|/)project.clj$" path)
                    :let [blob-sha (sha/mk bsha)]]
           (->/as pldb
             (pldb/db-fact r-proj-path sha (s/replace path #"(^|/)project.clj$" "") blob-sha)
@@ -1223,7 +1223,7 @@
           (build-shabam (vals new-branches))
           (vary-meta assoc ::dirty true))))))

-(def voomdb-header "voom-db-6")
+(def voomdb-header "voom-db-7")

 (defn ^File git-db-file
   [gitdir]


Get fresh db after setting status

Get fresh db after setting status

fix devth/yetibot#396

--- src/yetibot/core/commands/status.clj
+++ src/yetibot/core/commands/status.clj
@@ -1,5 +1,6 @@
 (ns yetibot.core.commands.status
   (:require
+    [yetibot.core.util :refer [with-fresh-db]]
     [taoensso.timbre :refer [info warn error]]
     [yetibot.core.models.status :as model]
     [clj-time [core :refer [ago minutes hours days weeks years months]]]
@@ -11,8 +12,7 @@
 (defn show-status
   "status # show statuses in the last 8 hours"
   [{:keys [chat-source]}]
-  (let [str-chat-source (pr-str chat-source)]
-    (model/format-sts (model/status-since chat-source (-> 8 hours ago)))))
+  (model/format-sts (model/status-since (pr-str chat-source) (-> 8 hours ago))))

 (defn show-status-since
   "status since <n> <minutes|hours|days|weeks|months> ago # show status since a given time"
@@ -30,7 +30,7 @@
   (let [str-chat-source (pr-str chat-source)]
     (info "add status in" str-chat-source ":" match)
     (model/add-status user str-chat-source match)
-    (show-status args)))
+    (with-fresh-db (show-status args))))

 (cmd-hook #"status"
           #"since (.+) (minutes*|hours*|days*|weeks*|months*)( ago)*" show-status-since


improving fact doc-string

improving fact doc-string

--- src/midje/sweet.clj
+++ src/midje/sweet.clj
@@ -57,8 +57,8 @@
   (defn g [x] nil)
   (defn f [x] (+ (g x) (g x)))

-  (fact \"f of some arg, named ..x.. calls g twice w/ the
-          same arg as was sent to f, and adds up the results\"
+  (fact \"f of some arg, ..x.. calls g twice w/ the same arg,
+          (..x..), that was sent to f, and adds up the results\"
     (f ..x..) => 12
     (provided (g ..x..) => 6 :times 2))


Don't need to specify count for repeatedly

--- src/tracks/core.cljc
+++ src/tracks/core.cljc
@@ -30,7 +30,7 @@
   (assert-args
    (vector? bindings) "a vector for its binding"
    (even? (count bindings)) "an even number of forms in binding vector")
-  (let* [val-syms (repeatedly (/ (count bindings) 2) gensym)
+  (let* [val-syms (repeatedly gensym)
          paths (->> bindings
                     (take-nth 2)
                     (map (fn [sym struct]


docstring of hellhound.kafka.consumer has been fixed

--- extra_components/kafka/src/clj/hellhound/kafka/consumers.clj
+++ extra_components/kafka/src/clj/hellhound/kafka/consumers.clj
@@ -3,9 +3,9 @@
   Consumer API. Here's a very simple example:

   ``` clj
-  (let [c (make-consumer {"bootstrap.servers" "localhost:9092"
-                          "group.id"          "test"})]
-    (subscribe c ["sometopoc"])
+  (let [c (make-consumer {\"bootstrap.servers\" \"localhost:9092\"
+                          \"group.id\"          \"test\"})]
+    (subscribe c [\"sometopoc\"])
     (consume-each c #(println %))
     (.close c)
   ```


Little view refactoring

Little view refactoring

--- src/markiki/views.cljs
+++ src/markiki/views.cljs
@@ -17,20 +17,16 @@
       [:span.glyphicon.glyphicon-search.form-control-feedback]]]))

-(defn article-link [{:keys [path title]}]
-  [:li [:a {:href (str "#" path)} title]])
-
-
-(defn articles-list [articles]
+(defn display-articles-list [articles]
   [:ul.articles-list
-   (for [article articles
-         :let [k (first article)
-               v (second article)]]
+   (for [a articles
+         :let [k (first a)
+               v (second a)]]
      (if (contains? v :path)
-       [article-link v]
+       [:li [:a {:href (str "#" (:path v))} (:title v)]]
        [:li
         [:h4 k]
-        [articles-list v]]))])
+        [display-articles-list v]]))])

 (defn display-searchlist [results]
@@ -61,7 +57,7 @@
         [:div#loaded
          [searchbar]
          (cond
-          (not (empty? @searchlist))    [display-searchlist @searchlist] ;;[:div "Searching"]
+          (not (empty? @searchlist))    [display-searchlist @searchlist]
           (not (empty? @last-article))  [display-article @last-article]
-          (not (empty? @articles))      [articles-list @articles-tree]
+          (not (empty? @articles))      [display-articles-list @articles-tree]
           :else                         [:h1 "No articles!"])]))))


removed a useless print, add deref, ready to tackle nasty memory error

--- src/mediakeys/core.clj
+++ src/mediakeys/core.clj
@@ -22,8 +22,6 @@
 (def incoming-json
     (.map incoming-observable
         (rx/fn* json/read-json)))
-(.subscribe incoming-observable
-    (rx/action* println))
 ;THIS SHOULD ACTUALLY get transformed a bunch
 ;before getting fed into keypress-events

@@ -52,6 +50,6 @@
                         (.send c (name action)))))
             (onClose [c] (println "closed" c))
             (onMessage [c j]
-                (.onNext incoming-sub j))))
+                (.onNext @incoming-sub j))))
     (.add (StaticFileHandler. "."))
     (.start)))


Мелкие исправления

Мелкие исправления

--- src-cljs/ixinfestor/webdocs_edit.cljs
+++ src-cljs/ixinfestor/webdocs_edit.cljs
@@ -220,7 +220,7 @@
                                 [:span {:class "badge"}
                                  (ix/str-to-date-and-format :SHORT_DATETIME "нет" (get-in row [:webdoc-row :udate]))
                                  ]
-                                "Оюновлен:"]]]]
+                                "Обновлен:"]]]]

                             [:div {:class "form-group"}
                              [:label {:class "col-sm-2 control-label"} "URL+"]


fix order of applying generate -> morph

fix order of applying generate -> morph

--- test/babel/test/it.cljc
+++ test/babel/test/it.cljc
@@ -855,8 +855,8 @@
                              :subj {:pred :loro}}}
               :modified false
               :root {:italiano {:italiano "addormentarsi"}}}
-             morph
-             generate))))
+             generate
+             morph))))

 (defn generate-speed-test [spec & [times]]
   (btest/generate-speed-test spec model times))


Added grouping by genre.

Added grouping by genre.

--- src/vertigo/core.clj
+++ src/vertigo/core.clj
@@ -10,16 +10,10 @@

 (defn list-shows [shows]
   [:table
-    (for [{genres  :genres
-           title   :title
-           theatre :theatre
-           image   :image}
-           shows]
-         [:tr
-           [:td [:img {:src image}]]
-           [:td title]
-           [:td theatre]
-           [:td genres]])])
+    (for [day shows]
+      [:tr
+        [:td (:time (first (:comedy day)))]
+        [:td (map :title (:comedy day))]])])

 (defn shows [shows]
   (layout (list-shows shows)))
@@ -40,14 +34,17 @@
                  genres
                  image])

-(def finnish-date-format (formatter "dd.MM.yyyy"))
+(defn group-by-genre [shows]
+  (group-by
+    (fn [{genres :genres}]
+      (condp some genres
+        #{"Komedia"} :comedy
+        #{"Draama"} :drama
+        #{"Toiminta"} :action
+        :other))
+    shows))

-(def url (str "http://finnkino.fi/xml/Schedule/?area=1002&dt="
-              (unparse finnish-date-format (now))))
-
-(def movies (zip/xml-zip (xml/parse url)))
-
-(defn get-shows [xz]
+(defn parse-shows [xz]
   (for [show (xml-> xz :Shows :Show)]
     (Show.
       (xml1-> show :OriginalTitle text)
@@ -56,11 +53,22 @@
       (into #{} (split (xml1-> show :Genres text) #", "))
       (xml1-> show :Images :EventLargeImagePortrait text))))

-; To parse the starting times...
-; (map (fn [{time :time}] (unparse (formatters :hour-minute) (parse time)))   (get-shows movies))
+(def finnish-date-format (formatter "dd.MM.yyyy"))
+
+(def week-of-shows
+  (pmap
+    parse-shows
+    (map
+      #(zip/xml-zip (xml/parse (str "http://finnkino.fi/xml/Schedule/?area=1002&dt=" (unparse finnish-date-format %))))
+      (for [day (range 7)]
+        (.plusDays (now) day)))))
+
+(def week-of-shows-grouped-by-genre
+  (map group-by-genre (filter not-empty week-of-shows)))
+
 (defroutes handler
   (GET "/" []
-    (views/shows (get-shows movies))))
+    (views/shows week-of-shows-grouped-by-genre)))

 (run-jetty handler {:port 8080 :join? false})


Start logging for system too.

Start logging for system too.

--- src/onyx/system.clj
+++ src/onyx/system.clj
@@ -20,7 +20,7 @@
             [onyx.log.commands.kill-job]
             [onyx.log.commands.gc]))

-(def development-components [:log])
+(def development-components [:logging-config :log])

 (def client-components [:log :messaging-require])

@@ -93,7 +93,8 @@
 (defn onyx-development-env
   [config]
   (map->OnyxDevelopmentEnv
-   {:log (zookeeper config)}))
+    {:logging-config (logging-config/logging-configuration config)
+     :log (component/using (zookeeper config) [:logging-config])}))

 (defn onyx-client
   [config]


jdk 6 does not have a System/lineSeparator

--- test/insn/core_test.clj
+++ test/insn/core_test.clj
@@ -355,20 +355,12 @@

   (testing "method"
     (let [obj (core/new-instance
-               {:methods [{:name "foo", :desc [Object]
-                           :emit [[:ldc "java.home"]
-                                  [:invokestatic System "getProperty" 1]
-                                  [:invokestatic System "lineSeparator"]
-                                  [:invokevirtual String "concat"]
-                                  [:areturn]]}
-                          {:name "bar", :desc [[:char] Object]
-                           :emit [[:aload 1]
+               {:methods [{:name "bar", :desc [[:char] Object]
+                           :emit [[:ldc "foo-"]
+                                  [:aload 1]
                                   [:ldc 1]
                                   [:ldc 2]
                                   [:invokestatic String "valueOf" 3]
+                                  [:invokevirtual String "concat"]
                                   [:areturn]]}]})]
-      (is (= (str (System/getProperty "java.home")
-                  (System/lineSeparator))
-             (.foo obj)))
-      (is (= "bc"
-             (.bar obj (.toCharArray "abcd")))))))
+      (is (= "foo-bc" (.bar obj (.toCharArray "abcd")))))))


Added routes for student details

Added routes for student details

--- src/application_management/server/web.clj
+++ src/application_management/server/web.clj
@@ -16,12 +16,13 @@
   (route/resources "/")
   (GET "/" [] views/home-page)
   (GET "/all" [] (resp/response (app/getApplications)))
+  (GET "/form" [] views/user-details)
   (POST "/apply" request (resp/response  (app/create (get-in request [:params]))))
   (POST "/accept" request (resp/response (app/accept (get-in request [:params]))))
   (POST "/reject" request (resp/response (app/reject (get-in request [:params]))))
   (POST "/filter" request (resp/response (app/filterList (get-in request [:params]))))
   (POST "/admin/login" {params :params} (resp/response (app/login params)))
-  (POST "/user/details" request (resp/response (app/save-details (get-in request [:params])))))
+  (POST "/user/details" request (resp/response (app/save-details (get-in request  [:params]))))  )

 (def app
   (-> (handler/site routes)


Make the piped thread use a bound-fn.

Make the piped thread use a bound-fn.

--- src/pjstadig/es.clj
+++ src/pjstadig/es.clj
@@ -109,12 +109,13 @@
         pos (PipedOutputStream.)
         wos (io/writer pos :encoding "utf-8")]
     (.connect pis pos)
-    (doto (Thread. #(with-open [wos wos]
-                      (try
-                        (f wos)
-                        (catch Throwable t
-                          (log/debug t "piped-body thread died unexpectedly")
-                          (throw t)))))
+    (doto (Thread. (bound-fn []
+                     (with-open [wos wos]
+                       (try
+                         (f wos)
+                         (catch Throwable t
+                           (log/debug t "piped-body thread died unexpectedly")
+                           (throw t))))))
       .start)
     {:body pis}))


Add ability to set methods on table cells

--- src/play_clj/ui.clj
+++ src/play_clj/ui.clj
@@ -10,7 +10,8 @@
            [com.badlogic.gdx.scenes.scene2d.utils ActorGestureListener Align
             ChangeListener ClickListener DragListener FocusListener
             NinePatchDrawable SpriteDrawable TextureRegionDrawable
-            TiledDrawable]))
+            TiledDrawable]
+           [com.esotericsoftware.tablelayout Cell]))

 (defmacro drawable
   [type & options]
@@ -37,27 +38,74 @@
   [key]
   `(u/static-field-lower :scenes :scene2d :utils :Align ~key))

+(defn cell!
+  [^Cell cell & args]
+  (let [method-name (first args)
+        [[a1 a2 a3 a4] rest-args] (split-with #(not (keyword? %)) (rest args))]
+    (when method-name
+      (case method-name
+        :width (.width cell ^double a1)
+        :height (.height cell ^double a1)
+        :size (.size cell ^double a1 ^double a2)
+        :min-width (.minWidth cell ^double a1)
+        :min-height (.minHeight cell ^double a1)
+        :min-size (.minSize cell ^double a1 ^double a2)
+        :max-width (.maxWidth cell ^double a1)
+        :max-height (.maxHeight cell ^double a1)
+        :max-size (.minSize cell ^double a1 ^double a2)
+        :space (.space cell ^double a1 ^double a2 ^double a3 ^double a4)
+        :space-top (.spaceTop cell ^double a1)
+        :space-left (.spaceLeft cell ^double a1)
+        :space-bottom (.spaceBottom cell ^double a1)
+        :space-right (.spaceRight cell ^double a1)
+        :pad (.pad cell ^double a1 ^double a2 ^double a3 ^double a4)
+        :pad-top (.padTop cell ^double a1)
+        :pad-left (.padLeft cell ^double a1)
+        :pad-bottom (.padBottom cell ^double a1)
+        :pad-right (.padRight cell ^double a1)
+        :fill (.fill cell ^boolean a1 ^boolean a2)
+        :fill-x (.fillX cell)
+        :fill-y (.fillY cell)
+        :center (.center cell)
+        :top (.top cell)
+        :left (.left cell)
+        :bottom (.bottom cell)
+        :right (.right cell)
+        :expand (.expand cell ^boolean a1 ^boolean a2)
+        :expand-x (.expandX cell)
+        :expand-y (.expandY cell)
+        :ignore (.ignore cell ^boolean a1)
+        :colspan (.colspan cell (int a1))
+        :uniform (.uniform cell ^boolean a1 ^boolean a2)
+        :uniform-x (.uniformX cell)
+        :uniform-y (.uniformY cell)
+        :row (.row cell)
+        nil)
+      (apply cell! cell rest-args))
+    cell))
+
 (defmulti add-to-group! #(-> % first :object type) :default WidgetGroup)

 (defmethod add-to-group! WidgetGroup
-  [[{:keys [^WidgetGroup object]} children]]
-  (doseq [child children]
-    (.addActor object ^Actor (:object child))))
+  [[parent child]]
+  (.addActor ^WidgetGroup (:object parent) ^Actor (:object child)))

 (defmethod add-to-group! Table
-  [[{:keys [^Table object]} children]]
-  (doseq [child children]
-    (cond
-      (map? child)
-      (.add object ^Actor (:object child))
-      (keyword? child)
-      (case child
-        :row (.row object)
-        nil))))
+  [[parent child]]
+  (cond
+    (map? child)
+    (.add ^Table (:object parent) ^Actor (:object child))
+    (vector? child)
+    (apply cell! (add-to-group! [parent (first child)]) (rest child))
+    (keyword? child)
+    (case child
+      :row (.row ^Table (:object parent))
+      nil)))

 (defn add!
   [group children]
-  (add-to-group! [group children])
+  (doseq [child children]
+    (add-to-group! [group child]))
   group)

 (defn ^:private create-group


Add more tests for equality of rtd-records

--- test/active/clojure/record_test.cljc
+++ test/active/clojure/record_test.cljc
@@ -618,6 +618,53 @@
   [a er2-a
    b er2-b])

+(define-record-type EqualityRecord3
+  {:java-class? false
+   :rtd-record? true}
+  make-er3
+  er3?
+  [])
+
+(define-record-type EqualityRecord4
+  {:java-class? false
+   :rtd-record? true}
+  make-er4
+  er4?
+  [])
+
+(define-record-type EqualityRecord5
+  {:java-class? false
+   :rtd-record? true}
+  make-er5
+  er5?
+  [a er-5-a
+   b er-5-b
+   c er-5-c
+   d er-5-d
+   e er-5-e
+   f er-5-f
+   g er-5-g
+   h er-5-h
+   i er-5-i
+   j er-5-j
+   k er-5-k])
+(define-record-type EqualityRecord6
+  {:java-class? false
+   :rtd-record? true}
+  make-er6
+  er6?
+  [a er-6-a
+   b er-6-b
+   c er-6-c
+   d er-6-d
+   e er-6-e
+   f er-6-f
+   g er-6-g
+   h er-6-h
+   i er-6-i
+   j er-6-j
+   k er-6-k])
+
 (defrecord EqualityClojureRecord [a b])

 (deftest equality-of-rtd-records-test
@@ -626,6 +673,19 @@
   (is (not= (make-er 1 2) (make-er 2 2)))
   (is (not= (make-er 1 2) (make-er 2 1)))
   (is (not= (make-er2 1 2) (make-er 1 2)))
+  (is (not= (make-er3) (make-er 1 2)))
+
+
+  (testing "two records of other types with no fields"
+    (is (not= (make-er3) (make-er4))))
+
+  (testing "records with many fields"
+    (is (= (make-er5 1 2 3 4 5 6 7 8 9 10 11)
+           (make-er5 1 2 3 4 5 6 7 8 9 10 11)))
+    (is (not= (make-er5 1 2 3 4 5 6 7 8 9 10 11)
+              (make-er5 1 2 3 0 5 6 7 8 9 10 11)))
+    (is (not= (make-er5 1 2 3 4 5 6 7 8 9 10 11)
+              (make-er2 1 2))))

   (testing "other is not an rtd-record"
     (is (not= (make-er 1 2) 0))


Fix tests

Fix tests

--- test/clj/subman/parser/core_test.clj
+++ test/clj/subman/parser/core_test.clj
@@ -2,7 +2,7 @@
   (:require [clojure.test :refer [deftest testing is]]
             [clojure.core.async :as async :refer [<!!]]
             [test-sugar.core :refer [is=]]
-            [clj-di.core :refer [with-registered]]
+            [clj-di.test :refer [with-registered]]
             [subman.models :as models]
             [subman.parser.base :refer [defsource]]
             [subman.const :as const]


fixed typo in instructions

fixed typo in instructions

--- src/onyx_java/test.clj
+++ src/onyx_java/test.clj
@@ -1,6 +1,6 @@
 ;;useage: for a specific class named "Entity" with a edn spec named "Entity.edn",
 ;;run (prepare-object "Entity").
-;;to get the clojure map, run (get-clojure map "Entity")
+;;to get the clojure map, run (get-clojure-map "Entity")
 ;;all entities can be loaded simultaneously and will be held as atoms in
 ;;a map for further use and investigation.


Update browser-caching version

Update browser-caching version

--- src/leiningen/new/chestnut/project.clj
+++ src/leiningen/new/chestnut/project.clj
@@ -12,7 +12,7 @@
                  [org.clojure/clojurescript "0.0-3308" :scope "provided"]
                  [ring "1.4.0"]
                  [ring/ring-defaults "0.1.5"]
-                 [slester/ring-browser-caching "0.1.0"]
+                 [slester/ring-browser-caching "0.1.1"]
                  [bk/ring-gzip "0.1.1"]
                  [compojure "1.4.0"]
                  [enlive "1.1.6"]


slightly better scale, still very wrong, though

--- src/pc/views/admin.clj
+++ src/pc/views/admin.clj
@@ -41,7 +41,7 @@
          [:line {:x1 padding :y1 (+ padding i)
                  :x2 (+ padding 1000) :y2 (+ padding i)
                  :strokeWidth 1 :stroke "black"}]
-         [:text {:x 0 :y (+ padding i)}
+         [:text {:x (+ (* 1.5 padding) 1000) :y (+ padding i)}
           (- max-users-per-day (int (* i (/ max-users-per-day 500))))]))
       (map-indexed (fn [i user-count]
                      [:circle {:cx (+ padding (* x-tick-width i))
@@ -57,7 +57,7 @@
          [:line {:x1 padding :y1 (+ padding i)
                  :x2 (+ padding 1000) :y2 (+ padding i)
                  :strokeWidth 1 :stroke "black"}]
-         [:text {:x 0 :y (+ padding i)}
+         [:text {:x (+ (* 1.5 padding) 1000) :y (+ padding i)}
           (- max-users (int (* i (/ max-users 500))))]))
       (map-indexed (fn [i user-count]
                      [:circle {:cx (+ padding (* x-tick-width i))


Unohtunut debug-tuloste

Unohtunut debug-tuloste

--- mtg-pairings-server/src/cljs/mtg_pairings_server/events.cljs
+++ mtg-pairings-server/src/cljs/mtg_pairings_server/events.cljs
@@ -274,7 +274,6 @@

 (reg-event-db ::collapse-mobile-menu
   (fn [db _]
-    (.log js/console "Collapse mobile menu")
     (update db :mobile-menu-collapsed? not)))

 (reg-event-fx ::load-deck-construction


Remove unnecessary about page

Remove unnecessary about page

--- src/cljs/flux_challenge_reagent/core.cljs
+++ src/cljs/flux_challenge_reagent/core.cljs
@@ -10,12 +10,7 @@
 ;; Views

 (defn home-page []
-  [:div [:h2 "Welcome to flux-challenge-reagent"]
-   [:div [:a {:href "#/about"} "go to about page"]]])
-
-(defn about-page []
-  [:div [:h2 "About flux-challenge-reagent"]
-   [:div [:a {:href "#/"} "go to the home page"]]])
+  [:div [:h2 "Welcome to flux-challenge-reagent"]])

 (defn current-page []
   [:div [(session/get :current-page)]])
@@ -26,9 +21,6 @@

 (secretary/defroute "/" []
   (session/put! :current-page #'home-page))
-
-(secretary/defroute "/about" []
-  (session/put! :current-page #'about-page))

 ;; -------------------------
 ;; History


Add a listener to bounds changed in maps view

--- src/cljs/gtfve/components/maps_panel.cljs
+++ src/cljs/gtfve/components/maps_panel.cljs
@@ -1,8 +1,12 @@
 (ns gtfve.components.maps-panel
+  (:require-macros [cljs.core.async.macros :refer [go go-loop]]
+                   [gtfve.macros :refer [<?]])
   (:require [om.core :as om]
             [sablono.core :as html :refer-macros [html]]
+            [cljs.core.async :as async :refer [put! chan <! close!]]
             [gtfve.async :refer [raise!]]
             [gtfve.utils :as utils]
+            [gtfve.utils.maps :as maps]
             [goog.events :as gevents]))

 (defonce Maps google.maps)
@@ -14,19 +18,35 @@
                            :mapTypeId (:ROADMAP map-types)
                            :zoom 15})

-(defn maps-canvas [_ owner]
+(defn maps-canvas [editor owner]
   (reify
     om/IInitState
     (init-state [_]
       {:opts default-map-opts
-       :gmap nil})
+       :gmap nil
+       :bounds nil
+       :kill-ch (chan)})
     om/IDisplayName (display-name [_] "Maps View")
     om/IDidMount
     (did-mount [_]
       (let [opts (om/get-state owner :opts)
             node (om/get-node owner "gmap")
-            google-map (Maps.Map. node (clj->js opts))]
-        (om/set-state! owner :gmap (Maps.Map. node (clj->js opts)))))
+            google-map (Maps.Map. node (clj->js opts))
+            bounds-changed-ch (-> (maps/listen google-map "bounds_changed")
+                                  (utils/debounce 100))
+            kill-ch (om/get-state owner :kill-ch)]
+        (om/set-state! owner :gmap google-map)
+        (go-loop []
+          (when-let [[v ch] (alts! [kill-ch bounds-changed-ch])]
+            (if (= ch kill-ch)
+              ::done
+              (do
+                (om/set-state! owner :bounds (.. google-map (getBounds)))
+                (recur)))))))
+    om/IWillUnmount
+    (will-unmount [_]
+      (when-let [kill-ch (:kill-ch (om/get-state owner))]
+        (put! kill-ch (js/Date.))))
     om/IRenderState
     (render-state [_ state]
       (html
@@ -77,4 +97,4 @@
     (render [_]
       (html [:div.maps-panel
              (om/build maps-toolbar editor)
-             (om/build maps-canvas nil)]))))
+             (om/build maps-canvas editor)]))))


Keywords are not seq'able.

Keywords are not seq'able.

--- src/cljs/kixi/hecuba/user_management.cljs
+++ src/cljs/kixi/hecuba/user_management.cljs
@@ -60,7 +60,7 @@
     (let [existing-data (dissoc (-> @data :user) :class :username :data :fetching :typed)
           selected-role (:role selected)
           new-data      (-> (into {} (filter #(seq (val %)) (select-keys selected [:programmes :projects])))
-                            (cond-> (seq role) (assoc :role role)))
+                            (cond-> (not (nil? role)) (assoc :role role)))
           data-to-post  (common/deep-merge existing-data new-data)
           parsed (-> data-to-post
                      (assoc :programmes (into {} (remove #(nil? (val %)) (:programmes data-to-post))))


Cleaner update logic

Cleaner update logic

--- src/reagent/ratom.cljs
+++ src/reagent/ratom.cljs
@@ -202,7 +202,7 @@
 (def maybe-dirty 1)
 (def dirty 2)

-(deftype Reaction [f ^:mutable state ^:mutable dirtyness
+(deftype Reaction [f ^:mutable state ^:mutable ^number dirtyness
                    ^:mutable ^boolean active?
                    ^:mutable watching ^:mutable watches
                    auto-run on-set on-dispose ^:mutable ^boolean norun?]
@@ -267,19 +267,18 @@

   (-handle-change [this sender oldval newval]
     (when active?
-      (let [old-dirty dirtyness]
-        (set! dirtyness (max dirtyness
-                          (if (identical? oldval newval)
-                            (if (instance? Reaction sender)
-                              maybe-dirty clean)
-                            dirty)))
-        (if (and (some? auto-run) (not norun?))
-          (do
-            (-check-clean this)
-            (when-not (== dirtyness clean)
-              ((or auto-run run) this)))
-          (when (and (not (== dirtyness clean))
-                     (== old-dirty clean))
+      (let [old-dirty dirtyness
+            new-dirty (if (identical? oldval newval)
+                        (if (instance? Reaction sender)
+                          maybe-dirty clean)
+                        dirty)]
+        (when (> new-dirty old-dirty)
+          (set! dirtyness new-dirty)
+          (if (some? auto-run)
+            (when-not norun?
+              (-check-clean this)
+              (when-not (== dirtyness clean)
+                (auto-run this)))
             (-notify-watches this state state))))))

   (-update-watching [this derefed]


Solved 6.6 and translated following auxiliary stuff from section 6.4.1 prior to exercise 6.7

--- src/fpinscala/purely_functional_state.clj
+++ src/fpinscala/purely_functional_state.clj
@@ -145,3 +145,29 @@
 ;fpins
 ;Conceptually - the same
 ;-----------------------------------------------------------------------
+
+;6.6
+;mine
+(defn map-rng-2
+  "map2 for exercise 6.6, takes two actions ra and rb and binary function f which combines results of them"
+  [ra rb f]
+  (fn [rng]
+    (from-rng (ra rng) :let [n1 r1]
+              (from-rng (rb r1) :let [n2 r2]
+                        [(f n1 n2) r2]))))
+;fpins
+;Conceptually - the same
+
+(defn both
+  "Translating 'both' from section 6.4.1 - Combining state actions"
+  [ra rb]
+  (map-rng-2 ra rb #(identity [% %2])))
+
+(def int-double-via-both
+  "int-double via both (via map2 (: )"
+  (both non-negative-int-fpins a-double-fpins))
+
+(def double-int-via-both
+  "double-int via both (via map2 (: )"
+  (both a-double-fpins non-negative-int))
+;-----------------------------------------------------------------------


fix log code

fix log code

--- src/s7p/slave/core.clj
+++ src/s7p/slave/core.clj
@@ -41,8 +41,10 @@
    (catch Exception          e {:status :invalid :reason (format "validation process raised unexpected error: %s" e)})))

 (defn log-validated [arg]
-  (let [[{dsp :dsp v :response}] arg]
-   (bidresponse/log (assoc v :id (:dsp_id dsp))))
+  (let [{dsp :dsp res :response status :status} arg]
+    (if (= status :valid)
+      (bidresponse/log (assoc res :status :valid :dsp_id (:id dsp)))
+      (bidresponse/log (assoc (dissoc arg :dsp)  :dsp_id (:id dsp)))))
   arg)

 (defn succeed? [v]


Fix stripes in playlist table.

Fix stripes in playlist table.

--- src/airhead_frontend/components.cljs
+++ src/airhead_frontend/components.cljs
@@ -99,7 +99,7 @@
   [:section#playlist
    [:h2 "Playlist"]
    (if-let [tracks (not-empty (@app-state :playlist))]
-     [:table.pure-table
+     [:table.pure-table.pure-table-striped
       [:thead
        [:tr [:th] [:th  "Title"] [:th "Artist"] [:th "Album"]]]
       [:tbody (for [track tracks]


Update init-pair

Update init-pair

--- src/angelic/search/function_sets.clj
+++ src/angelic/search/function_sets.clj
@@ -89,7 +89,11 @@
     0)))

 (defn make-init-pair [henv]
-  [(state-set/initial-logging-ss (hierarchy/env henv)) (make-tla-fs henv)])
+  (if (vector? henv)
+    (let [[init init-fs] henv]
+      [(state-set/make-logging-factored-state-set
+        [(state/get-logger init (state/current-context init))])])
+    [(state-set/initial-logging-ss (hierarchy/env henv)) (make-tla-fs henv)]))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Utils ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Report failures sending async response

Report failures sending async response

--- src/io/aviso/rook/jetty_async_adapter.clj
+++ src/io/aviso/rook/jetty_async_adapter.clj
@@ -48,22 +48,27 @@
                               (dissoc ::http-servlet-request ::http-servlet-response)
                               handler)
               ;; Jetty can do a timeout, but we have our own.
-              [response] (alts! [response-ch (timeout timeout-ms)])]
+              [response] (alts! [response-ch (timeout timeout-ms)])
+              _ (if response
+                  (l/debugf "Asynchronous response:%n%s" (utils/pretty-print response))
+                  (l/warnf "Request %s `%s' timed out after %d ms."
+                           (-> request :request-method name .toString .toUpperCase)
+                           (-> request :uri)
+                           timeout-ms))
+              response' (or response {:status HttpServletResponse/SC_GATEWAY_TIMEOUT})]
+          (try
+            (-> continuation
+                .getServletResponse
+                (servlet/update-servlet-response response'))
+            (.complete continuation)

-          (if response
-            (l/debugf "Asynchronous response:%n%s" (utils/pretty-print response))
-            (l/warnf "Request %s `%s' timed out after %d ms."
-                     (-> request :request-method name .toString .toUpperCase)
-                     (-> request :uri)
-                     timeout-ms))
+            (catch Throwable t
+              (l/errorf t "Unable to send asynchronous response %s to client."
+                        (binding []
+                          (utils/pretty-print response')))))

-          (-> continuation
-              .getServletResponse
-              (servlet/update-servlet-response
-                (or response
-                    {:status HttpServletResponse/SC_GATEWAY_TIMEOUT})))
-          (.complete continuation)
-          ;; go blocks must return non-nil
+          ;; go blocks must return non-nil, however there should not be anyone receiving
+          ;; from the channel.
           true)))

     ;; Return nil right now, to prevent the proxy handler from sending an immediate response.


Formatting adjustments.

Formatting adjustments.

--- src/shale/sessions.clj
+++ src/shale/sessions.clj
@@ -421,8 +421,7 @@
           (if (arg :force-create)
             (-> arg
                 (rename-keys {:reserve-after-create :reserve-after-create})
-                create-session)
-            )
+                create-session))
           (if-let [candidate (->> (view-models)
                                   (filter
                                     (fn [session-model]
@@ -451,10 +450,7 @@
       (client/delete session-url
                      {:socket-timeout timeout
                       :conn-timeout timeout}))
-
-    (catch [:status 404] _)
-
-    ))
+    (catch [:status 404] _)))

 (defn destroy-session [id & {:keys [immediately] :or [immediately true]}]
   (with-car*


style change

style change

--- src/main/clojure/clojure/tools/reader.clj
+++ src/main/clojure/clojure/tools/reader.clj
@@ -24,7 +24,8 @@
                          PersistentVector IRecord Namespace)
            clojure.tools.reader.reader_types.SourceLoggingPushbackReader
            java.lang.reflect.Constructor
-           (java.util regex.Pattern List LinkedList)))
+           java.util.regex.Pattern
+           (java.util List LinkedList)))

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; helpers


tweak npm version check done for browser builds

shouldn't warn about custom installs. also allow disabling
completely via

   :js-options {:check-versions false}

--- src/main/shadow/build/targets/browser.clj
+++ src/main/shadow/build/targets/browser.clj
@@ -814,6 +814,10 @@
                     ;; not all deps end up being used so we don't need to check the version
                     :when (get pkg-index dep)
                     :let [installed-version (get-in pkg-index [dep :package-json "version"])]
+                    :when (and (not (str/includes? wanted-version "http:"))
+                               (not (str/includes? wanted-version "https:"))
+                               (not (str/includes? wanted-version "file:"))
+                               (not (str/includes? wanted-version "github:")))
                     :when (not (npm-deps/semver-intersects wanted-version installed-version))]

               (util/warn state {:type ::npm-version-conflict
@@ -842,8 +846,11 @@
     :compile-finish
     (-> state
         (module-wrap)
-        (check-npm-versions)
+
         (cond->
+          (not (false? (get-in config [:js-options :check-versions])))
+          (check-npm-versions)
+
           (shared/bootstrap-host-build? state)
           (shared/bootstrap-host-info)))


Drop FakeColumnSource.

Drop FakeColumnSource.

--- src-cljs/pepa/workflows/inbox2.cljs
+++ src-cljs/pepa/workflows/inbox2.cljs
@@ -77,34 +77,6 @@
   om/IWillMount
   (will-mount [_]
     (api/fetch-inbox!)))
-
-(defrecord FakeColumnSource [id]
-  ColumnSource
-  (column-title [_ _]
-    "Fake")
-  (column-pages [_ state]
-    (get-in state [::fake-column-pages]))
-  (remove-pages! [_ state page-ids]
-    (go
-      (println "Removing pages from fake-column")
-      (om/transact! state ::fake-column-pages
-                    (fn [pages]
-                      (remove #(contains? (set page-ids) (:id %)) pages)))))
-  ColumnDropTarget
-  (accepts-drop? [_ state]
-    true)
-  ;; TODO: Make immutable?
-  (accept-drop! [_ state new-pages]
-    (go
-      (println "dropping" (pr-str new-pages) "on fake column")
-      (om/transact! state ::fake-column-pages
-                    (fn [pages]
-                      (into pages
-                            (remove #(contains? (set (map :id pages)) (:id %)))
-                            new-pages)))
-      (println "Fake-saving...")
-      (<! (async/timeout 2000))
-      (println "Saved!"))))

 (defrecord DocumentColumnSource [id document-id]
   ColumnSource
@@ -267,7 +239,6 @@
   (init-state [_]
     (let [gen (IdGenerator.getInstance)
           columns [(->InboxColumnSource (.getNextUniqueId gen))
-                   (->FakeColumnSource (.getNextUniqueId gen))
                    (->DocumentColumnSource (.getNextUniqueId gen) 1)
                    (->DocumentColumnSource (.getNextUniqueId gen) 2)]]
       {:columns (into {}


refine item balance propogation logic

refine item balance propogation logic

--- src/clj_money/models/transactions.clj
+++ src/clj_money/models/transactions.clj
@@ -240,7 +240,7 @@
     (if value-changed
       result
       (-> result
-          (assoc :skip-account-update true)
+          (assoc ::skip-account-update true)
           reduced))))

 (defn- update-affected-balances
@@ -256,7 +256,7 @@
            final (reduce calculate-item-index-and-balance
                          (assoc last-item :storage storage-spec)
                          subsequent-items)]
-       (if-not (:skip-account-update final)
+       (when-not (::skip-account-update final)
          (accounts/update storage-spec {:id account-id
                                         :balance (:balance final)}))))))


better ns decl

better ns decl

--- src/cljc/commos/delta/compscribe.cljc
+++ src/cljc/commos/delta/compscribe.cljc
@@ -1,18 +1,13 @@
 (ns commos.delta.compscribe
   (:require [commos.delta :as delta]
-            #?(:clj [clojure.core.async :refer [chan close!
-                                                <! >!
-                                                put!
-                                                alts!
-                                                pipe
-                                                go go-loop
-                                                mult tap untap]]
-               :cljs [cljs.core.async :refer [chan close!
-                                              <! >!
-                                              put!
-                                              alts!
-                                              pipe
-                                              mult tap untap]])
+            [#?(:clj clojure.core.async
+                :cljs cljs.core.async) :refer [chan close!
+                                               <! >!
+                                               put!
+                                               alts!
+                                               pipe
+                                               #?@(:clj [go go-loop])
+                                               mult tap untap] :as a]
             [clojure.walk :refer [prewalk postwalk]]
             [commos.shared.core :refer [flatten-keys]])
   #?(:cljs (:require-macros [cljs.core.async.macros :refer [go-loop go]])))


Added functions for getting dom element bounds and native collision test.

--- src/cljs/infinitelives/utils/dom.cljs
+++ src/cljs/infinitelives/utils/dom.cljs
@@ -88,3 +88,17 @@
   [elem html]
   (set! (.-innerHTML elem) html)
   elem)
+
+(defn get-bounds [id]
+  "Get a dom entity's bounding rect by id, using getBoundingClientRect."
+  (.getBoundingClientRect (js/document.getElementById id)))
+
+(defn collision-test-by-id [id-a id-b]
+  "Test whether two dom elements are overlapping by id."
+  (let [bounds-a (get-bounds id-a)
+        bounds-b (get-bounds id-b)]
+    (not (or (< bounds-a.right bounds-b.left)
+             (> bounds-a.left bounds-b.right)
+             (< bounds-a.bottom bounds-b.top)
+             (> bounds-a.top bounds-b.bottom)))))
+


add metabadge link to receive page

add metabadge link to receive page

--- src/cljs/salava/badge/ui/receive.cljs
+++ src/cljs/salava/badge/ui/receive.cljs
@@ -151,7 +151,7 @@
              (if (and expires_on (not expired?))
                [:div [:label (t :badge/Expireson) ": "]  (date-from-unix-time (* 1000 expires_on))])

-             [mb/metabadge assertion_url #_(:assertion_url @state)]
+             [:div [mb/metabadge assertion_url #_(:assertion_url @state)]]

              (if assertion
                [:div {:id "assertion-link"}


Clarify protocol documentation: LambdaCD expects build numbers to be integers

--- src/clj/lambdacd/state/protocols.clj
+++ src/clj/lambdacd/state/protocols.clj
@@ -14,7 +14,7 @@
 (defprotocol NextBuildNumberSource
   "Components implementing this protocol provide the LambdaCD execution engine with new build numbers"
   (next-build-number [self]
-    "Returns the build number for the next build. Must be comparable and greater than all existing build numbers")) ; TODO: is build number an int?
+    "Returns the build number for the next build. Must be an integer and greater than all existing build numbers"))

 (defprotocol QueryAllBuildNumbersSource
   "Components implementing this protocol can supply a list of all build numbers present in the datastore"


fix gallery viewing error

fix gallery viewing error

--- src/cljc/salava/gallery/schemas.cljc
+++ src/cljc/salava/gallery/schemas.cljc
@@ -45,7 +45,7 @@
                                    :description           s/Str
                                    :issuer_content_name   s/Str
                                    :issuer_content_url    s/Str
-                                   :issuer_description    s/Str
+                                   :issuer_description    (s/maybe s/Str)
                                    :issuer_verified       (s/maybe s/Int)
                                    :issuer_contact        (s/maybe s/Str)
                                    :issuer_image          (s/maybe s/Str)


clear undo history when selecting new phone - otherwise, navigating the browser history can break the undo feature

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -7,7 +7,8 @@
             [secretary.core :as secretary :include-macros true]
             [goog.events :as events]
             [goog.history.EventType :as EventType]
-            [re-frame.core :as re-frame])
+            [re-frame.core :as re-frame]
+            [re-frame.undo :as undo])
   (:require-macros [reagent.ratom :refer [reaction]])
   (:import goog.History))

@@ -21,6 +22,7 @@
 (secretary/defroute "/phones/:phone-id" {:as params}
                     (session/put! :current-page #'phone-page)
                     (session/put! :params params)
+                    (undo/clear-history!)
                     (re-frame/dispatch [:load-phone-detail (:phone-id params)]))

 (defn redirect-to


add routing and separate phoen page

add routing and separate phoen page

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -142,24 +142,36 @@
   [:div {:class "container-fluid"}
    [:div {:class "row"}
     [:div {:class "col-md-2"}
-     [search-component]]]
-   [:div {:class "row"}
-    [:div {:class "col-md-6"}
-     [order-by-component]]]
-   [:div {:class "row"}
+     [search-component]
+     [order-by-component]]
     [:div {:class "col-md-10"}
      [phones-component]]]])

+(defn phone-page [{phone-id :phone-id}]
+  [:div "TBD: detail view for"
+   [:span phone-id]])
+
 (defn current-page []
-  (session/get :current-page))
+  [:div [(session/get :current-page) (session/get :params)]])

 ;; -------------------------
 ;; Routes
 (secretary/set-config! :prefix "#")

-(secretary/defroute "/" []
+(secretary/defroute "/phones" []
   (session/put! :current-page #'home-page))

+(secretary/defroute "/phones/:phone-id" {:as params}
+  (session/put! :current-page #'phone-page)
+  (session/put! :params params))
+
+(defn redirect-to
+  [resource]
+  (secretary/dispatch! resource)
+  (.setToken (History.) resource))
+
+(secretary/defroute "*" []
+  (redirect-to "/phones"))

 ;; -------------------------
 ;; History


modified invalid-exclude-param-msg function

--- src/cmr/common/services/messages.clj
+++ src/cmr/common/services/messages.clj
@@ -50,7 +50,5 @@

 (defn invalid-exclude-param-msg
   "Creates a message saying supplied parameter(s) are not in exclude params set."
-  ([]
-   (format "Some or all of the supplied parameters can not be used with exclude."))
-  ([param]
-   (format "Parameter [%s] can not be used with exclude." param)))
+  [params-set]
+  (format "Parameter(s) [%s] can not be used with exclude." (str/join ", " (map name params-set))))


CMR-387: Created real function form anonymous function.

--- src/cmr/search/data/complex_to_simple_converters/spatial.clj
+++ src/cmr/search/data/complex_to_simple_converters/spatial.clj
@@ -150,28 +150,26 @@
                 (seq desc-crossing))
         [asc-crossing desc-crossing]))))

+(defn- range->numeric-range-intersection-condition
+  "Create a condtion to test for a numberic range intersection with multiple ranges."
+  [ranges]
+  (qm/or-conds
+    (map (fn [[start-lat end-lat]]
+                               (qm/numeric-range-intersection-condition
+                                 :orbit-start-clat
+                                 :orbit-end-clat
+                                 start-lat
+                                 end-lat))
+                             ranges)))
+
 (defn orbital-condition
   "Create a condition that will use orbit parameters and orbital back tracking to find matches
   to a spatial search."
-  [shape context]
+  [context shape]
   (let [mbr (sr/mbr shape)
         [asc-lat-ranges desc-lat-ranges] (.denormalizeLatitudeRange orbits (:south mbr) (:north mbr))
-        asc-lat-conds (qm/or-conds
-                        (map (fn [range]
-                               (qm/numeric-range-intersection-condition
-                                 :orbit-start-clat
-                                 :orbit-end-clat
-                                 (first range)
-                                 (last range)))
-                             asc-lat-ranges))
-        desc-lat-conds (qm/or-conds
-                         (map (fn [range]
-                                (qm/numeric-range-intersection-condition
-                                  :orbit-start-clat
-                                  :orbit-end-clat
-                                  (first range)
-                                  (last range)))
-                              desc-lat-ranges))
+        asc-lat-conds (range->numeric-range-intersection-condition asc-lat-ranges)
+        desc-lat-conds (range->numeric-range-intersection-condition desc-lat-ranges)
         orbit-params (orbits-for-context context)
         stored-ords (srl/shape->stored-ords shape)
         crossings-map (reduce (fn [memo params]
@@ -219,7 +217,7 @@
   (c2s/reduce-query-condition
     [{:keys [shape]} context]
     (let [shape (d/calculate-derived shape)
-          orbital-cond (orbital-condition shape context)
+          orbital-cond (orbital-condition context shape)
           mbr-cond (br->cond "mbr" (srl/shape->mbr shape))
           lr-cond (br->cond "lr" (srl/shape->lr shape))
           spatial-script (shape->script-cond shape)


[#8121] Resolved ENS address is not checksummed

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

--- src/status_im/ui/screens/wallet/choose_recipient/events.cljs
+++ src/status_im/ui/screens/wallet/choose_recipient/events.cljs
@@ -84,10 +84,11 @@
                           :ens-name recipient
                           :cb       #(re-frame/dispatch [:wallet.send/set-recipient %])}}
        (if (ethereum/address? recipient)
-         (if (eip55/valid-address-checksum? recipient)
-           {:db       (assoc-in db [:wallet :send-transaction :to] recipient)
-            :dispatch [:navigate-back]}
-           {:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})})
+         (let [checksum (eip55/address->checksum recipient)]
+           (if (eip55/valid-address-checksum? checksum)
+             {:db       (assoc-in db [:wallet :send-transaction :to] checksum)
+              :dispatch [:navigate-back]}
+             {:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})}))
          {:ui/show-error (i18n/label :t/wallet-invalid-address {:data recipient})})))))

 (handlers/register-handler-fx


Add a test for the mutation error not returning result

--- test/com/wsscode/pathom/core_test.cljc
+++ test/com/wsscode/pathom/core_test.cljc
@@ -397,9 +397,11 @@
                       [:bar 123] ::p/not-found}})))

 (def error-parser (p/parser {::p/plugins [p/error-handler-plugin]
-                             :mutate     (fn [_ _ _]
+                             :mutate     (fn [_ k _]
                                            {:action (fn []
-                                                      (throw (ex-info "error" {})))})}))
+                                                      (if (= k 'success)
+                                                        "Success!"
+                                                        (throw (ex-info "error" {}))))})}))

 (def error-reader
   {:bar (fn [{:keys [ast]}]
@@ -425,6 +427,11 @@
            ['(call-op {})])
          {'call-op "error"})))

+(deftest test-wrap-mutate-no-error
+  (is (= (error-parser {::p/process-error #(.getMessage %2)}
+           ['(success {})])
+         {'success "Success!"})))
+
 (deftest collapse-error-path-test
   (let [m {:x {:y {:z :com.wsscode.pathom/reader-error}}}]
     (testing "Return exact path when matches"


Use collection-check's action generator in all tests

--- test/psq/clj_test.clj
+++ test/psq/clj_test.clj
@@ -27,17 +27,35 @@
 (def psqgen
   (gen/bind
     (gen/sorted-set igen)
-    (fn [ks]
-      (let [ps (gen/sample igen (count ks))]
-        (gen/return (psq/psqueue* (interleave (vec ks) ps)))))))
+    (fn [init-ks]
+      (let [init-ps (gen/sample igen (count init-ks))
+            init-keypriorities (interleave init-ks init-ps)]
+        (gen/bind
+          (#'cc/gen-map-actions igen igen false true)
+          (fn [actions]
+            (gen/return
+              (first (#'cc/build-collections
+                       (psq/psqueue* init-keypriorities)
+                       (apply sorted-map init-keypriorities)
+                       false
+                       actions)))))))))

 (defn psqgen-by [kcomp pcomp]
   (gen/bind
     (gen/sorted-set igen)
-    (fn [ks]
-      (let [ps (gen/sample igen (count ks))]
-        (gen/return (psq/psqueue-by* kcomp pcomp (interleave (vec ks) ps)))))))
+    (fn [init-ks]
+      (let [init-ps (gen/sample igen (count init-ks))
+            init-keypriorities (interleave init-ks init-ps)]
+        (gen/bind
+          (#'cc/gen-map-actions igen igen false true)
+          (fn [actions]
+            (gen/return
+              (first (#'cc/build-collections
+                       (psq/psqueue-by* kcomp pcomp init-keypriorities)
+                       (apply sorted-map-by kcomp init-keypriorities)
+                       false
+                       actions)))))))))

 (defn loser-node-set


typo fix

typo fix

--- src/gorilla_repl/render_values_mw.clj
+++ src/gorilla_repl/render_values_mw.clj
@@ -36,8 +36,9 @@

 ;; Unfortunately nREPL's interruptible-eval middleware has a fixed dependency on the pr-values middleware. So here,
 ;; what we do is fudge the :requires and :expects values to ensure that our rendering middleware gets inserted into
-;; the linearized middlware stack between the eval middleware and the pr-values middleware. A bit of a hack!
+;; the linearized middleware stack between the eval middleware and the pr-values middleware. A bit of a hack!
 (middleware/set-descriptor! #'render-values
                             {:requires #{#'clojure.tools.nrepl.middleware.pr-values/pr-values}
                              :expects  #{"eval"}
-                             :handles  {}})+                             :handles  {}})
+


adding missing classes key

adding missing classes key

--- src/celestial/puppet_standalone.clj
+++ src/celestial/puppet_standalone.clj
@@ -48,7 +48,7 @@
    (task copy-yaml
      (let [{:keys [hostname module classes]} args path (<< "/tmp/~{hostname}.yml") f (file path) ]
        (info args)
-       (spit f (yaml/generate-string classes))
+       (spit f (yaml/generate-string {:classes classes}))
        (debug "copy from " path remote)
        (copy path (<< "/tmp/~(module :name)/"))
        (.delete f)))


Put commit details back in the build

Put commit details back in the build

--- src/circle/backend/build/config.clj
+++ src/circle/backend/build/config.clj
@@ -260,6 +260,7 @@

       (dosync
        (alter build merge proto-build)
+       (alter build merge commit-details)
        (alter build assoc :node node)
        (alter build assoc :lb-name lb-name)
        (alter build assoc :vcs_revision vcs-revision)


dont follow sync urls

dont follow sync urls

--- src/clj/hsm/controllers/project.clj
+++ src/clj/hsm/controllers/project.clj
@@ -101,7 +101,7 @@
         [:input {:type "hidden" :value (:id proj)}]
         [:button.btn.btn-primary {:type "submit"} "Love It"]]
         (when admin?
-          [:a.btn.btn-danger.btn-sm {:href (format "/p/%s?force-sync=1" id)} "Synchronize"])
+          [:a.btn.btn-danger.btn-sm {:href (format "/p/%s?force-sync=1" id) :rel "nofollow"} "Synchronize"])
         ]
     [:div.col-lg-8
       [:h3


Turned off instrumentation in prod

Turned off instrumentation in prod

--- src/clojure/funcatron/tron/util.clj
+++ src/clojure/funcatron/tron/util.clj
@@ -12,7 +12,7 @@
                      spy get-env]]
             [clojure.java.shell :as shelly]
             [clojure.spec :as s]
-            [clojure.spec.test :as stest])
+            )
   (:import (cheshire.prettyprint CustomPrettyPrinter)
            (java.util Base64 Map Map$Entry List UUID Properties)
            (org.apache.commons.io IOUtils)
@@ -81,8 +81,6 @@
   [kw?]
   (if (keyword? kw?) (name kw?) kw?))

-(stest/instrument 'kwd-to-string)
-
 (s/fdef string-to-kwd
   :args (s/cat :s? string?)
   :ret keyword?)
@@ -90,8 +88,6 @@
   "Converts a String to a Keyword"
   [s?]
   (if (string? s?) (keyword s?) s?))
-
-(stest/instrument 'string-to-kwd)

 (defn stringify-keys
   "Recursively transforms all map keys from keywords to strings."


Bump up cryogen-core dependency

Bump up cryogen-core dependency

--- src/leiningen/new/cryogen/project.clj
+++ src/leiningen/new/cryogen/project.clj
@@ -7,7 +7,7 @@
                            [ring/ring-devel "1.3.2"]
                            [compojure "1.3.1"]
                            [ring-server "0.3.1"]
-                           [cryogen-core "0.1.14"]]
+                           [cryogen-core "0.1.15"]]
             :plugins [[lein-ring "0.8.13"]]
             :main cryogen.core
             :ring {:init cryogen.server/init


Debugged map convertor

Debugged map convertor

--- src/clj/onyx_java/utils/map_fns.clj
+++ src/clj/onyx_java/utils/map_fns.clj
@@ -13,17 +13,16 @@
     (reduce
       ; Strip keywords, convert everything else to a string.
       (fn [ent k]
-        (println "ent=" ent)
-        (println "k=" k)
         (let [n (if (keyword? k)
                   (name k)
                   (str k))
-              rv (get m k)
-              v (if (keyword? rv)
-                  (name rv)
-                  (str rv)) ]
+              bv (get m k "MISSING")
+              v (if (keyword? bv)
+                  (name bv)
+                  bv) ]
           ; Side-effectful
-          (.addParameter ent n v)))
+          (.addParameter ent n v)
+          ent))
       ent
       ks)
     ent))


Added default-config method for Implementation protocol for simulator to use in mocking things

--- src/clj_bots/pin_ctrl/protocols.clj
+++ src/clj_bots/pin_ctrl/protocols.clj
@@ -4,7 +4,9 @@
   "Any implementation the pin-ctrl API must create an object which implements this protocol,
   and register it using the `clj-bots.pin-ctrl.implementation/register-implementation function."
   (create-board! [this config])
-  (models [this]))
+  (models [this])
+  ; Let's add this so the simulator can effectively mock the configuration of pin availability and what not
+  (default-config [this]))

 (defprotocol PBoard
   "Basic board protocol, shared by any board, whether on board or over wire."