more of the api

more of the api

--- src/bitcoinrpc/core.clj
+++ src/bitcoinrpc/core.clj
@@ -49,7 +49,7 @@

 ;;--------RPC calls-----------

-
+;blockchain

 (s/fdef getbestblockhash :ret string?)
 (def-rpc getbestblockhash)
@@ -69,7 +69,127 @@
   :ret string?)
 (def-rpc getblockhash height)

-
+(s/fdef getblockheader
+  :args (s/alt :verbose (s/cat :hash string?), :choice (s/cat :hash string?, :verbose boolean?)))
+(def-rpc-opt getblockheader hash verbose)
+
+(s/fdef getchaintips :ret vector?)
+(def-rpc getchaintips)
+
+(s/fdef getdifficulty :ret integer?)
+(def-rpc getdifficulty)
+
+(def-rpc-opt getmempoolancestors txid verbose)
+(def-rpc-opt getmempooldescendants txid verbose)
+(def-rpc getmempoolentry txid)
+(def-rpc getmempoolinfo)
+(def-rpc-opt getrawmempool verbose)
+(def-rpc-opt gettxout txid n include_mempool)
+
+;(s/def gettxoutproof ["txid",...] ( blockhash )
+(def-rpc gettxoutproof txids blockhash)
+
+(def-rpc gettxoutsetinfo)
+(def-rpc preciousblock blockhash)
+(def-rpc pruneblockchain)
+;verifychain ( checklevel nblocks )
+(def-rpc verifytxoutproof proof)
+
+
+;== Control ==
+(def-rpc getinfo)
+(def-rpc getmemoryinfo)
+;help ( "command" )
+(def-rpc stop)
+
+;== Generating ==
+(def-rpc-opt generate nblocks maxtries)
+(def-rpc-opt generatetoaddress nblocks address maxtries)
+
+;== Mining ==
+(def-rpc-opt getblocktemplate TemplateRequest )
+(def-rpc getmininginfo)
+;getnetworkhashps ( nblocks height )
+;prioritisetransaction <txid> <priority delta> <fee delta>
+(def-rpc-opt submitblock hexdata jsonparametersobject)
+
+;== Network ==
+(def-rpc addnode node action)
+(def-rpc clearbanned)
+(def-rpc disconnectnode address)
+(def-rpc-opt getaddednodeinfo node)
+(def-rpc getconnectioncount)
+(def-rpc getnettotals)
+(def-rpc getnetworkinfo)
+(def-rpc getpeerinfo)
+(def-rpc listbanned)
+(def-rpc ping)
+;setban "subnet" "add|remove" (bantime) (absolute)
+(def-rpc setnetworkactive b)
+
+;== Rawtransactions ==
+;createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime )
+(def-rpc decoderawtransaction hexstring)
+(def-rpc decodescript hexstring)
+(def-rpc-opt fundrawtransaction hexstring options)
+(def-rpc-opt getrawtransaction txid  verbose)
+(def-rpc-opt sendrawtransaction hexstring allowhighfees)
+;signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )
+
+;== Util ==
+(def-rpc createmultisig nrequired the-keys)
+(def-rpc estimatefee nblocks)
+(def-rpc estimatepriority nblocks)
+(def-rpc estimatesmartfee nblocks)
+(def-rpc estimatesmartpriority nblocks)
+(def-rpc signmessagewithprivkey privkey message)
+(def-rpc validateaddress address)
+(def-rpc verifymessage address signature message)
+
+;== Wallet ==
+(def-rpc abandontransaction txid)
+(def-rpc-opt addmultisigaddress nrequired the-keys account)
+(def-rpc addwitnessaddress address)
+(def-rpc backupwallet destination)
+(def-rpc-opt bumpfee txid options)
+(def-rpc dumpprivkey address)
+(def-rpc dumpwallet filename)
+(def-rpc encryptwallet passphrase)
+(def-rpc getaccount address)
+(def-rpc getaccountaddress account)
+(def-rpc getaddressesbyaccount account)
+;getbalance ( "account" minconf include_watchonly )
+(def-rpc-opt getnewaddress account)
+(def-rpc getrawchangeaddress)
+(def-rpc-opt getreceivedbyaccount account minconf)
+(def-rpc-opt getreceivedbyaddress address minconf)
+(def-rpc-opt gettransaction txid include_watchonly)
+(def-rpc getunconfirmedbalance)
+(def-rpc getwalletinfo)
+;importaddress "address" ( "label" rescan p2sh )
+(def-rpc importmulti requests options)
+;importprivkey "bitcoinprivkey" ( "label" ) ( rescan )
+(def-rpc importprunedfunds)
+;importpubkey "pubkey" ( "label" rescan )
+(def-rpc importwallet filename)
+(def-rpc-opt keypoolrefill newsize)
+;listaccounts ( minconf include_watchonly)
+(def-rpc listaddressgroupings)
+(def-rpc listlockunspent)
+;listreceivedbyaccount ( minconf include_empty include_watchonly)
+;listreceivedbyaddress ( minconf include_empty include_watchonly)
+;listsinceblock ( "blockhash" target_confirmations include_watchonly)
+;listtransactions ( "account" count skip include_watchonly)
+;listunspent ( minconf maxconf  ["addresses",...] [include_unsafe] )
+;lockunspent unlock ([{"txid":"txid","vout":n},...])
+;move "fromaccount" "toaccount" amount ( minconf "comment" )
+(def-rpc removeprunedfunds txid)
+;sendfrom "fromaccount" "toaddress" amount ( minconf "comment" "comment_to" )
+;sendmany "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...] )
+;sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount )
+(def-rpc setaccount address account)
+(def-rpc settxfee amount)
+(def-rpc signmessage address message)

 ;;--------------------------------


Don't exit after data push

Don't exit after data push

--- src/kiries/core.clj
+++ src/kiries/core.clj
@@ -32,7 +32,7 @@
                      ["-h" "--host" "Interface to listen on." :default "0.0.0.0"]
                      ["-p" "--port" "Port to listen on." :default 9090 :parse-fn #(Integer. %)]
                      ["-r" "--riemann" "Run Riemann internally." :default true :flag true]
-                     ["-t" "--total" "Import total records" :default 100]
+                     ["-t" "--total" "Import total records" :default 1000]
                      ["-d" "--data" "Import test data" :default false :flag true]]
              )]

@@ -55,5 +55,4 @@

     (when (:data options)
       (println "Pushing test data")
-      (dp/push-data (:total options))
-      (System/exit 0))))
+      (dp/push-data (:total options)))))


Try to grab some minerals

Try to grab some minerals

--- src/korhal/core.clj
+++ src/korhal/core.clj
@@ -55,7 +55,16 @@
     (when (= (.getTypeID unit) (.getID jnibwapi.types.UnitType$UnitTypes/Zerg_Larva))
       (when (and (< 50 (.. (:api @this) getSelf getMinerals)) (not (:morphed-drone this)))
         (.morph (:api @this) (.getID unit) (.getID jnibwapi.types.UnitType$UnitTypes/Zerg_Drone))
-        (swap-keys (.state this) :morphed-drone true)))))
+        (swap-keys (.state this) :morphed-drone true))))
+
+  ;; collect minerals
+  (for [unit (.getMyUnits (:api @this))]
+    (when (= (.getTypeID unit) (.getID jnibwapi.types.UnitType$UnitTypes/Zerg_Drone))
+      (when (and (.isIdle unit) (not (= (.getID unit) (:pool-drone @this))))
+        (let [mineral? (fn [unit] (= (.getTypeID unit) (.getID jnibwapi.types.UnitType$UnitTypes/Mineral_Field)))
+              mineral (first (filter mineral? (.getNeutralUnits (:api @this))))]
+        (.rightClick (.getID unit) (.getID mineral)))))))
+

 (defn korhal-gameEnded [this])


Trying once more

Trying once more

--- src/korhal/core.clj
+++ src/korhal/core.clj
@@ -1,21 +1,22 @@
 (ns korhal.core
-  (:import (jnibwapi JNIBWAPI BWAPIEventListener)
-           (jnibwapi.model Unit)
-           (jnibwapi.util BWColor)))
+  (:import (jnibwapi.JNIBWAPI)
+           (jnibwapi.BWAPIEventListener)
+           (jnibwapi.model.Unit)
+           (jnibwapi.util.BWColor)))

 (gen-class
  :name "korhal.core"
- :implements [JNIBWAPI]
+ :implements [jnibwapi.BWAPIEventListener]
  :state state
  :main true
  :constructors {[] []}
  :prefix "korhal-")

 (defn korhal-main [& args]
-  (let [ai (new korhal.core)
-        api (JNIBWAPI. ai)]
+  (let [ai (korhal.core.)
+        api (jnibwapi.JNIBWAPI. ai)]
     (compare-and-set! (.state ai) @(.state ai) (merge @(.state ai) {:api api}))
-    (.start api))))
+    (.start api)))

 (defn korhal-init [this]
   [[] (atom {})])


Renamed to lanes-in / lanes-out.

Renamed to lanes-in / lanes-out.

--- src/cbfg/world/net.cljs
+++ src/cbfg/world/net.cljs
@@ -10,21 +10,20 @@
             [cbfg.world.base :refer [replay-cmd-ch world-cmd-loop start-test]]))

 (defn server-conn-loop [actx server-send-ch server-recv-ch close-server-recv-ch]
-  (let [fenced-pump-lane-in-ch (achan actx)
-        fenced-pump-lane-out-ch (achan actx)]
+  (let [lanes-in-ch (achan actx)
+        lanes-out-ch (achan actx)]
     (cbfg.lane/make-lane-pump actx
-                              fenced-pump-lane-in-ch fenced-pump-lane-out-ch
+                              lanes-in-ch lanes-out-ch
                               cbfg.world.lane/make-fenced-pump-lane)
-    (act-loop fenced-pump-lane-in actx [num-ins 0]
-              (let [msg (atake fenced-pump-lane-in server-recv-ch)]
-                (aput fenced-pump-lane-in fenced-pump-lane-in-ch msg)
+    (act-loop lanes-in actx [num-ins 0]
+              (let [msg (atake lanes-in server-recv-ch)]
+                (aput lanes-in lanes-in-ch msg)
                 (when (> (:sleep msg) 0)
-                  (let [sleep-ch (atimeout fenced-pump-lane-in (:sleep msg))]
-                    (atake fenced-pump-lane-in sleep-ch)))
+                  (let [sleep-ch (atimeout lanes-in (:sleep msg))]
+                    (atake lanes-in sleep-ch)))
                 (recur (inc num-ins))))
-    (act-loop fenced-pump-lane-out actx [num-outs 0]
-              (aput fenced-pump-lane-out server-send-ch
-                    [(atake fenced-pump-lane-out fenced-pump-lane-out-ch)])
+    (act-loop lanes-out actx [num-outs 0]
+              (aput lanes-out server-send-ch [(atake lanes-out lanes-out-ch)])
               (recur (inc num-outs)))))

 (defn server-accept-loop [actx accept-ch close-accept-ch]


Use transient for message decode

Use transient for message decode

--- common/src/patavi/common/zeromq.clj
+++ common/src/patavi/common/zeromq.clj
@@ -58,13 +58,13 @@
   [^ZMsg msg types & flags]
   (when (contains? (set flags) :drop-first)
     (.destroy (.pop msg)))
-  (loop [acc [] msg msg types types]
-    (if (and (seq types) (not (empty? msg)))
+  (loop [acc (transient []) msg msg types types]
+    (if (and (seq types) (seq msg))
       (let [^ZFrame frame (.unwrap msg)
             content (bytes-to (.getData frame) (first types))]
         (.destroy frame)
-        (recur (conj acc content) msg (rest types)))
-      acc)))
+        (recur (conj! acc content) msg (rest types)))
+      (persistent! acc))))

 (defn receive!
   ([^ZMQ$Socket socket]


Ãpilates

Ãpilates

--- src/ontrail/nlp.clj
+++ src/ontrail/nlp.clj
@@ -27,6 +27,7 @@
                "Muu merkintä" "merkitsi jotain muuta"
                "Nyrkkeily" "nyrkkeili"
                "Perinteinen hiihto" "hiihti"
+               "Pilates" "harrasti pilatesta"
                "Potkukelkkailu" "potkukelkkaili"
                "Pyöräily" "pyöräili"
                "Ratsastus" "ratsasti"
@@ -61,4 +62,4 @@
       (if (= nil verb)
         (str "harrasti lajia " (.toLowerCase sport-id))
         verb))
-    "nil-sport-id"))+    "nil-sport-id"))


add 2-arg-arity to list-companies to retrieve add. fields

--- src/open_company/resources/company.clj
+++ src/open_company/resources/company.clj
@@ -220,10 +220,14 @@
 ;; ----- Collection of companies -----

 (defn list-companies
-  "Return a sequence of company property maps with slugs and names, sorted by slug."
-  []
-  (vec (sort-by primary-key
-    (common/read-resources table-name [primary-key "name"]))))
+  "Return a sequence of company property maps with slugs and names, sorted by slug.
+  Note: if additional-keys are supplied only documents containing those keys will be returned"
+  ([] (list-companies []))
+  ([additional-keys]
+   (->> (into [primary-key "name"] additional-keys)
+        (common/read-resources table-name)
+        (sort-by primary-key)
+        vec)))

 (defn get-companies-by-index
   "Given the name of a secondary index and a value, retrieve all matching companies"


Fixes typo

Fixes typo

--- src/wordly/util.clj
+++ src/wordly/util.clj
@@ -1,7 +1,7 @@
 ;; Handy helper functions
 (ns wordly.util)

-word-count(defmacro dbg [body]
+(defmacro dbg [body]
   `(let [x# ~body]
      (println "dbg:" '~body "=" x#)
           x#))


Realms default to "default"

Realms default to "default"

--- src/yada/schema.clj
+++ src/yada/schema.clj
@@ -264,7 +264,7 @@
    (s/optional-key :verify) s/Any})

 (s/defschema AuthSchemes
-  {:authentication-schemes [AuthScheme]})
+  {(s/optional-key :authentication-schemes) [AuthScheme]})

 ;; Authorization can contain any content because it is up to the
 ;; authorization interceptor, which is pluggable.
@@ -306,10 +306,11 @@
 (def SingleRealmMapping
   {AccessControlValue
    (fn [x]
-     (if-let [realm (:realm x)]
+     (if-not (:realms x)
        (-> x
            ;; Merge everything we want to KEEP from the realm
-           (merge {:realms {realm (select-keys x [:authentication-schemes :verify :scheme :authorization])}})
+           (merge {:realms {(or (:realm x) "default")
+                            (select-keys x [:authentication-schemes :verify :scheme :authorization])}})
            ;; Remove anything we want to REMOVE from the rest of the
            ;; access-control definition
            (dissoc :realm :scheme :verify :authentication-schemes :authorization))


working on Neo4j stuff

working on Neo4j stuff

--- src/webapp/framework/client/neo4j.cljs
+++ src/webapp/framework/client/neo4j.cljs
@@ -132,7 +132,7 @@
     (log (<! (count-all-neo4j-records-with-field :type)))
 )

-(delete-all-neo-4j-nodes :are-you-sure? "yes")
+;(delete-all-neo-4j-nodes :are-you-sure? "yes")

 (comment go
     (log (<! (count-all-neo4j-records)))
@@ -144,4 +144,8 @@

-(comment create-neo4j-record {:name "Dev" :type "environment"})
+(comment create-neo4j-record {
+                      :name "defn-html"
+                      :type "code"
+                      })
+


Move Create to button above table

Move Create to button above table

--- src/cljs/early_vote_site/election_detail/views.cljs
+++ src/cljs/early_vote_site/election_detail/views.cljs
@@ -50,19 +50,17 @@
       [:tbody
        (if (seq @site-list)
          (map (partial site->row state-fips) @site-list)
-         [:tr [:td {:colSpan 6} "No Early Vote Sites"]])
-       [:tr
-        [:td {:colSpan 5}]
-        [:td
-         [:span {:class "btn-link"
-                 :on-click #(re-frame/dispatch [:navigate/early-vote-site-form])}
-          "Create an Early Vote Site"]]]]]]))
+         [:tr [:td {:colSpan 6} "No Early Vote Sites"]])]]]))

 (defn election-details [election]
   (when election
     [:div
      [:h3 (-> election :state-fips places/fips-name)]
-     [:h4 (-> election :election-date utils/format-date-string)]]))
+     [:h4 {:style {:display "inline"}} (-> election :election-date utils/format-date-string)]
+     [:button.button
+      {:style {:float "right" :margin-bottom "10px"}
+       :on-click #(re-frame/dispatch [:navigate/early-vote-site-form])}
+      "Create an Early Vote Site"]]))

 (defn breadcrumb [election]
   (when election


form render-info contains mapping from ids->parser-nodes

--- cljs/src/main/quark/cogs/editor/layouter.cljs
+++ cljs/src/main/quark/cogs/editor/layouter.cljs
@@ -13,7 +13,8 @@
             [quark.cogs.editor.layout.headers :refer [build-headers-render-info]]
             [quark.cogs.editor.layout.selections :refer [build-selections-render-info]]
             [quark.cogs.editor.analyzer :refer [analyze-full]]
-            [quark.cogs.editor.utils :refer [debug-print-analysis ancestor-count loc->path leaf-nodes make-zipper collect-all-right]])
+            [quark.cogs.editor.utils :refer [debug-print-analysis ancestor-count loc->path leaf-nodes make-zipper collect-all-right]]
+            [rewrite-clj.node :as node])
   (:require-macros [quark.macros.logging :refer [log info warn error group group-end]]
                    [quark.macros.glue :refer [react! dispatch]]
                    [cljs.core.async.macros :refer [go]]))
@@ -32,8 +33,18 @@
 (defn extract-selectables-from-docs [docs-infos]
   (flatten (map (fn [info] [(:id info) info]) docs-infos)))

+(defn collect-nodes [node]
+  (let [relevant-nodes (fn [nodes] (remove #(or (node/whitespace? %) (node/comment? %)) nodes))
+        child-nodes (fn [node]
+                      (if (node/inner? node)
+                        (flatten (map collect-nodes (relevant-nodes (node/children node))))))]
+    (concat [(:id node) node] (child-nodes node))))
+
 (defn prepare-form-render-info [loc]
+  {:pre [(= (node/tag (zip/node (zip/up loc))) :forms)]}
   (let [node (zip/node loc)
+        _ (assert node)
+        nodes (apply hash-map (collect-nodes node))
         analysis (->> {}
                    (analyze-scopes node)
                    (analyze-symbols node)
@@ -46,6 +57,7 @@
     (debug-print-analysis node analysis)
     {:id          (:id node)
      :text        (zip/string loc)
+     :nodes       nodes
      :analysis    analysis
      :tokens      tokens                                    ; will be used for soup generation
      :selectables selectables                               ; will be used for selections
@@ -56,11 +68,11 @@
 (defn prepare-render-infos-of-top-level-forms [editor]
   (let [tree (:parse-tree editor)
         top (make-zipper tree)                              ; root "forms" node
-        loc (zip/down top)
-        right-siblinks (collect-all-right loc)
+        loc (zip/down top)                                  ; TODO: here we should skip possible whitespace
+        right-siblinks (collect-all-right loc)              ; TODO: here we should use explicit zipping policy
         old-forms (get-in editor [:render-state :forms])
-        find-old (fn [{:keys [id]}] (some #(if (= (:id %) id) %) old-forms))]
-    (map #(merge (find-old (first %)) (prepare-form-render-info %)) right-siblinks)))
+        find-old-form (fn [{:keys [id]}] (some #(if (= (:id %) id) %) old-forms))]
+    (map #(merge (find-old-form (first %)) (prepare-form-render-info %)) right-siblinks)))

 (defn analyze-with-delay [editor-id delay]
   (go


reorder menu items

reorder menu items

--- src/checkmate/views.clj
+++ src/checkmate/views.clj
@@ -19,8 +19,8 @@
             [:a.navbar-brand {:href "/"} "Check-Mate"]]
            [:div.collapse.navbar-collapse.navbar-ex1-collapse
             [:ul.nav.navbar-nav
-             [:li [:a {:href "/new"} "New Checklist"]]
-             [:li [:a {:href "/"} "A-Z"]]]]]
+             [:li [:a {:href "/"} "A-Z"]]
+             [:li [:a {:href "/new"} "New Checklist"]]]]]
           [:div.container body]]))

 (defn bs-button [text & {:keys [tooltip onclick] :as options :or {tooltip "" onclick nil}}]


One more test case for subsumption

One more test case for subsumption

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

--- src/conexp/contrib/tests/dl/framework/reasoning.clj
+++ src/conexp/contrib/tests/dl/framework/reasoning.clj
@@ -9,6 +9,7 @@
 (ns conexp.contrib.tests.dl.framework.reasoning
   (:use conexp
 	conexp.contrib.dl.framework.syntax
+	conexp.contrib.dl.framework.boxes
 	conexp.contrib.dl.framework.reasoning
 	conexp.contrib.dl.languages.EL-gfp)
   (:use clojure.test))
@@ -18,14 +19,21 @@
 (define-dl FamilyDL [Mother, Female, Father, Male] [MarriedTo, HasChild] []
   :extends EL-gfp)

+(def parent* (make-tbox FamilyDL #{(make-dl-definition 'Child (dl-expression FamilyDL (and))),
+				   (make-dl-definition 'Partner (dl-expression FamilyDL
+									       (and (exists HasChild Child)
+										    (exists MarriedTo Self))))
+				   (make-dl-definition 'Self (dl-expression FamilyDL
+									    (and (exists HasChild Child)
+										 (exists MarriedTo Partner))))}))
 (deftest test-subsumed-by?
   (are [dl exp] (subsumed-by? (dl-expression dl exp) (dl-expression dl exp))
-       FamilyDL (exists Child (and Mother Female (exists Child (and))))
+       FamilyDL (exists HasChild (and Mother Female (exists HasChild (and))))
        FamilyDL Mother)
   (are [dl exp-1 exp-2] (subsumed-by? (dl-expression dl exp-1) (dl-expression dl exp-2))
-       FamilyDL (exists Child Female) (exists Child (and)),
-       FamilyDL (and Female Mother) (and Female)))
-
+       FamilyDL (exists HasChild Female) (exists HasChild (and)),
+       FamilyDL (and Female Mother) (and Female)
+       FamilyDL [parent* Self] (exists MarriedTo [parent* Self])))
 ;;;

 nil


Fix :fullscreen size.

Fix :fullscreen size.

--- src/clj/quil/applet.clj
+++ src/clj/quil/applet.clj
@@ -90,34 +90,17 @@
         (string? renderer) renderer
         :default (throw (RuntimeException. ":renderer should be keyword or string"))))

-(defn- display-size
-  "Returns size of screen. If there are 2 or more screens it probably return size of
-  default one whatever it means."
-  ([]
-   (let [bounds (.. (java.awt.GraphicsEnvironment/getLocalGraphicsEnvironment)
-                    getDefaultScreenDevice
-                    getDefaultConfiguration
-                    getBounds)]
-     [(.-width bounds) (.-height bounds)]))
-
-  ([display]
-   (if-let [bounds (some->
-                    (get (.getScreenDevices (GraphicsEnvironment/getLocalGraphicsEnvironment)) display)
-                    .getDefaultConfiguration
-                    .getBounds)]
-     [(.-width bounds) (.-height bounds)]
-     (throw (IllegalArgumentException.
-             (str "Invalid display index: " display ". Displays are numbered starting from 0"))))))
-
-(defn- process-size
+(defn- validate-size
   "Checks that the size vector is exactly two elements. If not, throws
   an exception, otherwise returns the size vector unmodified."
-  [size display]
-  (cond (= size :fullscreen) (if (= :default display) (display-size)
-                               (display-size display))
-        (and (coll? size) (= 2 (count size))) size
-        :else (throw (IllegalArgumentException.
-                      (str "Invalid size definition: " size ". Was expecting :fullscreen or 2 elements vector: [x-size y-size].")))))
+  [size]
+  (if (or (= size :fullscreen)
+          (and (coll? size) (= 2 (count size))))
+    size
+    (throw (IllegalArgumentException.
+            (str "Invalid size definition: " size
+                 ". Was expecting :fullscreen or 2 elements vector: "
+                 "[width height].")))))

 (defn- to-method-name [keyword]
   "Converts keyword to java-style method symbol. :on-key-pressed => onKeyPressed"
@@ -185,8 +168,10 @@
 (defn -settings
   "Overriding PApplet.settings() to set size."
   [this]
-  (let [[width height] (:size (meta this))]
-    (.size this width height)))
+  (let [size (:size (meta this))]
+    (if (= size :fullscreen)
+      (.fullScreen this)
+      (.size this (first size) (second size)))))

 (defn -setup [this]
   ; If renderer is :pdf - we need to set it via size method,
@@ -411,7 +396,7 @@
                                  features)

         display           (or (:display options) :default)
-        size              (process-size (:size options) display)
+        size              (validate-size (:size options))

         title             (or (:title options) (str "Quil " (swap! untitled-applet-id* inc)))
         renderer          (or (:renderer options) :java2d)


Add IAtom protocol

Add IAtom protocol

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -7039,6 +7039,9 @@

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Reference Types ;;;;;;;;;;;;;;;;

+(defprotocol IAtom
+  (-reset! [o new-value]))
+
 (deftype Atom [state meta validator watches]
   IEquiv
   (-equiv [o other] (identical? o other))
@@ -7088,14 +7091,16 @@
   "Sets the value of atom to newval without regard for the
   current value. Returns newval."
   [a new-value]
-  (let [validate (.-validator a)]
-    (when-not (nil? validate)
-      (assert (validate new-value) "Validator rejected reference state")))
-  (let [old-value (.-state a)]
-    (set! (.-state a) new-value)
-    (when-not (nil? (.-watches a))
-      (-notify-watches a old-value new-value)))
-  new-value)
+  (if (instance? Atom a)
+    (let [validate (.-validator a)]
+      (when-not (nil? validate)
+        (assert (validate new-value) "Validator rejected reference state"))
+      (let [old-value (.-state a)]
+        (set! (.-state a) new-value)
+        (when-not (nil? (.-watches a))
+          (-notify-watches a old-value new-value))
+        new-value))
+    (-reset! a new-value)))

 (defn swap!
   "Atomically swaps the value of atom to be:


:source-maps -> :source-map

:source-maps -> :source-map

--- src/cljs/cljs/test.cljs
+++ src/cljs/cljs/test.cljs
@@ -312,9 +312,9 @@

 (defn mapped-line-and-column [env filename line column]
   (let [default [filename line column]]
-    (if-let [source-maps (:source-maps env)]
+    (if-let [source-map (:source-map env)]
       ;; source maps are 0 indexed for lines
-      (if-let [columns (get-in source-maps [filename (dec line)])]
+      (if-let [columns (get-in source-map [filename (dec line)])]
         (vec
           (map
             ;; source maps are 0 indexed for columns


Rework handling to-be evaled expressions in defui macro

--- src/clojure/neko/ui.clj
+++ src/clojure/neko/ui.clj
@@ -181,7 +181,9 @@
                   `(.addView ~obj ~(make-ui-element el el-type)))
                 inside-elements)
          ~obj))
-    (make-ui-element (eval element) container-type)))
+    (if (and (sequential? element) (= (first element) 'quote))
+      (second element)
+      (make-ui-element (eval element) container-type))))

 (defmacro defui [tree]
   (make-ui-element tree nil))


Refactor form parsing

Refactor form parsing

--- src/clojure_pf/form.clj
+++ src/clojure_pf/form.clj
@@ -1,47 +1,52 @@
 (ns clojure-pf.form
-  "Module to retrieve useful information from user-define packet form")
+  "Module to retrieve useful information from user-defined packet form")

 ; Utilities

-(def ^:private ^:const entry->width 3)
+(def ^:private ^:const entry->size 3)

 (defn- entry->valid? [entry]
   "Tests whether a form entry is valid according to the following rules:
    * A form field must be a keyword.
-   * The type must be a keyword denoting a number or a buffer.
+   * The kind must be a keyword denoting a number or a buffer.
     - If it's a number, check if the size is either 1, 2, 4 or 8.
     - If it's a buffer, check if the size is above zero."
   (and (keyword? (:field entry))
-       (case (:type entry)
+       (case (:kind entry)
          :int (contains? #{1 2 4 8} (:size entry))
          :buf (pos? (:size entry)))))

-(defn- form->next-entry [form]
-  "Returns the next entry of a packet form along
-  with the rest of it in a pair."
-  (let [[field _type size] (take entry->width form)
-        entry {:field field :type _type :size size}]
-    (when (entry->valid? entry)
-      [entry (drop entry->width form)])))
+(defn- entry->parse [form]
+  "Parses an entry from a form."
+  (let [[field kind size] (take entry->size form)
+        entry {:field field
+               :kind kind
+               :size size}]
+    (if (entry->valid? entry)
+      entry)))

 ; Exports

-(defn entry-list [form]
-  "Returns a list containing the field, type, size and offset
-  of each entry in a packet form."
-  (loop [[entry form] (form->next-entry form)
-         entries      []
-         offset       0]
-    (if-not entry
-      entries
-      (let [next-entry  (form->next-entry form)
-            entry       (assoc entry :offset offset)
-            entries     (conj entries entry)
-            offset      (+ offset (:size entry))]
-        (recur next-entry entries offset)))))
+(defn to-entries [form]
+  "Returns a list of form entries, each containing the following information:
+   * field name
+   * value kind (type)
+   * value size
+   * value offset"
+  (loop [entries  []
+         form     form
+         offset   0]
+    (let [entry (entry->parse form)]
+      (if-not entry
+        entries
+        (let [entry   (assoc entry :offset offset)
+              entries (conj entries entry)
+              form    (drop entry->size form)
+              offset  (+ offset (:size entry))]
+          (recur entries form offset))))))

 (defn size [form]
-  "Returns the sum of all the sizes defined in the packet form."
-  (->> (entry-list form)
+  "Returns the total packet size defined by a form."
+  (->> (to-entries form)
        (map :size)
        (reduce +)))


wiring textarea to component state

wiring textarea to component state

--- src-cljs/components.cljs
+++ src-cljs/components.cljs
@@ -121,7 +121,7 @@
         (let [{:keys [ok? note] :as res} (<! rsp-ch)]
           (case ok?
             true (do
-              (om/set-state! owner :text "") ; TODO: not working because state is not correctly wired to the textarea
+              (om/set-state! owner :text "")
               (om/transact! app :notes #(vec (cons note %))))
             false (println "sad face") ; TODO: error msg...
           )
@@ -129,10 +129,7 @@

   (render-state [this {:keys [text visibility rsp-ch]}]
     (dom/div
-      ; TODO: we need to wire the textarea to our state so on-create-click views the most up to date data
-      ; set-state! when the textarea is being edited.. but that's a bit inneficient, no?
-      ; -text- is not being set when textarea is changed
-      (dom/textarea {:rows 5 :columns 20 :ref "text" :placeholder "Don't forget, create a note..." });:value text})
+      (dom/textarea {:rows 5 :columns 20 :ref "text" :placeholder "Don't forget, create a note..." :value text :on-change #(om/set-state! owner :text (.. % -target -value))})
       (dom/button {:ref "visibility" :on-click (partial on-create-vis-click owner)} visibility)
       (dom/button {:on-click (partial on-create-click user-id owner)} "create!")
   )))


CMR-6016: Add CMR-Timed-Out header to expected response in test

--- system-int-test/test/cmr/system_int_test/search/granule_timeline_test.clj
+++ system-int-test/test/cmr/system_int_test/search/granule_timeline_test.clj
@@ -282,5 +282,5 @@
                                                      :include-headers true})
               headers (:headers response)]
           (is (= "application/json;charset=utf-8" (get headers "Content-Type")))
-          (is (= "CMR-Hits, CMR-Request-Id, CMR-Scroll-Id"
+          (is (= "CMR-Hits, CMR-Request-Id, CMR-Scroll-Id, CMR-Timed-Out"
                  (get headers "Access-Control-Expose-Headers"))))))))


Add byte-bufs ns

Add byte-bufs ns

--- test/caesium/crypto/secretbox_test.clj
+++ test/caesium/crypto/secretbox_test.clj
@@ -3,7 +3,8 @@
             [caesium.test-utils :refer [const-test]]
             [caesium.util :as u]
             [caesium.vectors :as v]
-            [clojure.test :refer [are deftest testing]]))
+            [clojure.test :refer [are deftest testing]]
+            [caesium.byte-bufs :as bb]))

 (const-test
  s/keybytes 32


Update playground

Update playground

--- test/com/wsscode/pathom/playground.clj
+++ test/com/wsscode/pathom/playground.clj
@@ -58,12 +58,18 @@
 ; => {[:person/id 1] {:person/id 1 :person/name "Tom" :person/address {:address/city "Salem}}}

 (comment
-  (time
-    (parser {} [{[:person/id 1] [:person/name {:person/address [:address/city]}]}]))
+  (parser {} [{[:person/id 1] [:person/name {:person/address [:address/city]}]}])

-  (parser {} [{:people [:person/name `(do-something)]}])
+  (parser {} [{:people [:person/name]}])

   (eql/query->ast '[{:foo [(bar)]}])
+
+  ((requiring-resolve 'com.wsscode.pathom.viz.ws-connector.core/connect-parser)
+   {:com.wsscode.pathom.viz.ws-connector.core/parser-id "p2"}
+   parser)
+
+  (parser {} {:pathom/entity {:person/id 1}
+              :pathom/ast    (eql/query->ast [:person/name])})

   (pc/reprocess-index
     '{::pc/index-resolvers


2nd test for the function get-job-name-from-uri-or-param

--- test/emender_jenkins/rest_api_test.clj
+++ test/emender_jenkins/rest_api_test.clj
@@ -393,6 +393,13 @@
             "   " nil "prefix" "prefix%20%20%20"
             "test-Product_Name-Product_Version-Book_Name-en-US (prod)" nil "http://10.20.30.40:8080/" "http://10.20.30.40:8080/test-Product_Name-Product_Version-Book_Name-en-US%20(prod)"
             "test-Product_Name-Product_Version-Book_Name-en-US (prod)" nil "http://jenkins.server.com:8080/" "http://jenkins.server.com:8080/test-Product_Name-Product_Version-Book_Name-en-US%20(prod)")))
+
+(deftest test-get-job-name-from-uri-or-param-2
+    "Check the function emender-jenkins.rest-api/get-job-name-from-uri-or-params."
+    (testing "the function emender-jenkins.rest-api/get-job-name-from-uri-or-params."
+        (are [result request uri-prefix uri] (= result (get-job-name-from-uri-or-params request uri-prefix uri))
+            "job-name" {:params {"name" "job-name"}} "prefix" "prefix"
+        )))

 (deftest test-body->results
     "Check the function emender-jenkins.rest-api/body->results."


Comment cruft

Comment cruft

--- src/net/dishevelled/mailindex/MailindexAnalyzer.clj
+++ src/net/dishevelled/mailindex/MailindexAnalyzer.clj
@@ -25,21 +25,3 @@
                       (StopFilter. stopwords)
                       (MailindexURLFilter.))]
     (Analyzer$TokenStreamComponents. src tokenizer)))
-
-
-;;   @Override
-;;   protected TokenStreamComponents createComponents(final String fieldName) {
-;;     final ClassicTokenizer src = new ClassicTokenizer();
-;;     src.setMaxTokenLength(maxTokenLength);
-;;     TokenStream tok = new ClassicFilter(src);
-;;     tok = new LowerCaseFilter(tok);
-;;     tok = new StopFilter(tok, stopwords);
-;;     return new TokenStreamComponents(src, tok) {
-;;       @Override
-;;       protected void setReader(final Reader reader) {
-;;         src.setMaxTokenLength(ClassicAnalyzer.this.maxTokenLength);
-;;         super.setReader(reader);
-;;       }
-;;     };
-;;   }
-;; }


PRS should print debug logs when HTTP error occurs, cimi filter do not support float

--- jar-placement-lib/src/sixsq/slipstream/placement/core.clj
+++ jar-placement-lib/src/sixsq/slipstream/placement/core.clj
@@ -105,7 +105,8 @@
             result)
           (catch Exception ex
             (log/error "retry failed; sending nil result")
-            nil))))))
+            nil))
+        (log/error "got an HTTP error while querying service offers: " (ex-data ex))))))

 (defn- priceable?
        [service-offer]
@@ -197,7 +198,7 @@
 (def cimi-or (partial cimi-op "or"))

 (defn to-MB-from-GB [input]
-  (when input (* input 1024)))
+  (when input (int (* input 1024))))

 (defn clause-cpu-ram-disk-os
   [{cpu :cpu.nb, ram :ram.GB, disk :disk.GB, os :operating-system}]


Tests for cumulative count :yum:

Tests for cumulative count :yum:


Stagger time intervals.

Stagger time intervals.

--- test/onyx/coordinator/cluster_test.clj
+++ test/onyx/coordinator/cluster_test.clj
@@ -1,6 +1,6 @@
 (ns onyx.coordinator.cluster-test
   (:require [clojure.test :refer :all]
-            [clojure.core.async :refer [chan <!! >!! <! >! tap go]]
+            [clojure.core.async :refer [chan <!! >!! <! >! tap go timeout]]
             [clojure.data.generators :as gen]
             [com.stuartsierra.component :as component]
             [datomic.api :as d]
@@ -21,12 +21,14 @@
             (>! (:born-peer-ch-head coordinator) peer)

             (loop [payload-node payload]
+              (<! (timeout (rand-nth (range 800))))
               (<! sync-spy)

               (let [nodes (:nodes (extensions/read-place sync-storage payload-node))]
                 (extensions/on-change sync-storage (:status nodes) #(go (>! status-spy %)))
                 (extensions/touch-place sync-storage (:ack nodes))
                 (<! status-spy)
+                (<! (timeout (rand-nth (range 1200))))

                 (let [next-payload (extensions/create sync-storage :payload)]
                   (extensions/write-place sync-storage peer next-payload)
@@ -170,3 +172,4 @@

 (run-tests 'onyx.coordinator.cluster-test)

+


change filter function to make it reemit the same element

--- src/datasplash/core.clj
+++ src/datasplash/core.clj
@@ -238,7 +238,7 @@
     (let [elt (get-element-from-context c)
           result (f elt)]
       (when result
-        (.output c elt)))))
+        (.output c (.element c))))))

 (defn didentity
   {:doc "Identity function for use in a ParDo"


basically works on cljs now ... but

basically works on cljs now ... but

stop-system!, start-system! system-map all
need re-implementing on promesa, since they deal
with the promise values directly and have a
manifold imple on clj

--- src/deferst/system.cljc
+++ src/deferst/system.cljc
@@ -312,10 +312,11 @@
    config-ctx value fns) stop the system, running
    destructor functions in reverse order to object construction"
   [dsys]
-  (d/chain
-   dsys
-   (fn [[_ system]]
-     (stop-system* system))))
+  #?(:clj
+     (d/chain
+      dsys
+      (fn [[_ system]]
+        (stop-system* system)))))

 (defn start-system!
   "given a system-builder, start a system with the seed config
@@ -325,27 +326,28 @@
    far been constructed.
    returns a Deferred<[_, system]>"
   [system-builder seed]
-  (-> (run-state system-builder seed)
-      (d/catch
-          Exception
-          (fn [e]
-            (let [{st :state :as xd} (ex-data e)
-                  sd (system-destructor st)]
-              (d/chain
-               (d/catch
-                   (run-state sd st)
-                   Exception
-                   (fn [ue]
-                     (throw
-                      (ex-info "unwind failed after start-system! failed"
-                               {:state st
-                                :error e
-                                :unwind-error ue}))))
-               (fn [_]
-                 (throw
-                  (ex-info "start-system! failed and unwound"
-                           {:state st
-                            :error e})))))))))
+  #?(:clj
+     (-> (run-state system-builder seed)
+         (d/catch
+             Exception
+             (fn [e]
+               (let [{st :state :as xd} (ex-data e)
+                     sd (system-destructor st)]
+                 (d/chain
+                  (d/catch
+                      (run-state sd st)
+                      Exception
+                    (fn [ue]
+                      (throw
+                       (ex-info "unwind failed after start-system! failed"
+                                {:state st
+                                 :error e
+                                 :unwind-error ue}))))
+                  (fn [_]
+                    (throw
+                     (ex-info "start-system! failed and unwound"
+                              {:state st
+                               :error e}))))))))))
 (defn- system-map*
   [system]
   (filter-system-map system))
@@ -355,10 +357,11 @@
    a Deferred<[system-map, system]>, extract the system-map
    returning a Deferred<system-map>"
   [dsys]
-  (d/chain
-   dsys
-   (fn [[_ system]]
-     (system-map* system))))
+  #?(:clj
+     (d/chain
+      dsys
+      (fn [[_ system]]
+        (system-map* system)))))

 (comment
   (require '[deferst.system :as dfs])


Change update! implementations

Change update! implementations

--- src-cljs/kixi/hecuba/web/chart.cljs
+++ src-cljs/kixi/hecuba/web/chart.cljs
@@ -53,23 +53,6 @@
 (defn- remove-chart []
   (.remove (first (nodelist-to-seq (.getElementsByTagName js/document "svg")))))

-(defn- fetch-data!
-  "The data need to be a vector."
-  [cursor opts]
-  (om/transact! cursor (fn [cursor]
-                         (assoc cursor :data (get mock-data (:selected cursor)))))
-  ;(om/update! cursor #(assoc % :data (get mock-data (:selected cursor))))
-  )
-
-(defn- select-device!
-  [cursor device-id]
-  (.log js/console device-id)
- ; (remove-chart)
-  (om/update! cursor [:selected] (constantly (vector device-id)))
- ; (om/transact! cursor (fn [cursor] (assoc cursor :selected (vector device-id))))
- ; (om/update! cursor #(assoc % :selected (vector device-id)))
-  )
-
 ;;;;;;;;;; Components ;;;;;;;;;;;;;;;;;

 (def chart-state
@@ -87,13 +70,17 @@
   [devices]
   (fn [cursor owner]
     (om/component
+     (.log js/console "[device-list-item] I render")
     (let [device-details  (for [device devices] (get cursor device))
           device-id       (nth device-details 0) ;; TODO Sersiously need to change the way elements are accessed
           device-name     (str (nth device-details 1))
           selected        (= device-id (first (:selected cursor)))]
       (apply dom/input #js {:className (when selected "selected")
                             :type "checkbox"
-                            :onClick #(select-device! data device-id)}
+                            :onClick
+                            (fn [e]
+                              (.log js/console "Clicked")
+                              (om/update! cursor [:selected] (fn [selected] (vector device-id))))}
             device-name)))))

 ;;;;;;;;;; Component 2: Chart UI ;;;;;;;;;;
@@ -102,28 +89,28 @@
   [device-details]
   (fn [cursor opts]
     (reify
-      om/IInitState
-      (init-state [this]
-        (om/update! cursor #(assoc % :selected (vector "01"))) ; TOFIX this does not update :selected
-        (.log js/console (get cursor :selected)))
       om/IWillMount
       (will-mount [this]
-        (fetch-data! cursor opts)) ;; TOFIX This does not update :data
+        (.log js/console "[chart-item] I will mount")
+        (om/update! cursor [:data] (fn [data] (get mock-data (:selected cursor)))))
       om/IRender
       (render [this]
+        (.log js/console "[chart-item] I render")
         (dom/div #js {:id "chart"}))
       om/IDidMount
       (did-mount [this owner]
+        (.log js/console "[chart-item] I did mount")
         (let [Chart        (.-chart dimple)
               svg          (.newSvg dimple "#chart" 400 350)
               measurements (:data cursor)
               dimple-chart (Chart. svg (clj->js measurements))]
-          (.log js/console measurements)
+         ; (.log js/console measurements)
           (.setBounds dimple-chart 60 30 300 300)
           (.addCategoryAxis dimple-chart "x" "month")
           (.addMeasureAxis dimple-chart "y" "reading")
           (.addSeries dimple-chart nil js/dimple.plot.line)
-          (.draw dimple-chart) )))))
+          (.draw dimple-chart))
+        (.log js/console "[chart-item] Finished I did mount")))))

 ;;;;;;;;;;; Bootstrap ;;;;;;;;;;;;


[upload dialog] Remove the react-key. We have no unique key here.

--- src-cljs/pepa/workflows/upload.cljs
+++ src-cljs/pepa/workflows/upload.cljs
@@ -97,8 +97,7 @@
   (render [_]
     [:ul.files
      (om/build-all file-row files
-                   {:init-state {:hide-fn (partial remove-file! files)}
-                    :key :file})]))
+                   {:init-state {:hide-fn (partial remove-file! files)}})]))

 (defn add-file [upload file]
   (update-in upload [:files]


sketched a (simple) evolutionary algorithm

--- test/simple_symbolic_regression_clojure/gp_test.clj
+++ test/simple_symbolic_regression_clojure/gp_test.clj
@@ -199,7 +199,7 @@

 (def token-generator
-  [#(rand-int 100) :x :+ :- :* :÷])
+  ['(rand-int 100) :x :+ :- :* :÷])

 (fact "we can make a population of random individuals"
@@ -240,27 +240,56 @@
           sine-rubrics)))) => true)

-(defn new-babies
-  "produce `n` new Individuals by applying `operator` to `population` given `token-generator`"
-  [n operator population token-generator]
-  )
-
-; (fact "we can produce a pile of new babies from a population"
-;   (new-babies ))
-
-; (defn population-step
-;   []
-;   ...)
-
-
-
-; (defn future-history
-;   [init-pop]
-;   (iterate population-step init-pop))
-
-
-; (def run (take 10 (future-history (random-population 1000 dude))))
-
-
-(fact "it happens"
-  )+(defn make-baby
+  "creates a new scored Individual by sampling a population (with uniform probability) and applying one-pt crossover and mutation, then scoring with the rubrics"
+  [population mutation-rate rubrics]
+  (let [mom (:script (rand-nth population))
+        dad (:script (rand-nth population))
+        baby-script (uniform-mutation
+                      (one-point-crossover mom dad)
+                      token-generator
+                      mutation-rate)]
+    (make-individual baby-script (total-score-on baby-script rubrics))))
+
+
+(fact "`make-baby` produces a new scored Individual"
+  (let [random-dude (fn [] (random-individual token-generator 100))
+        population (score-population
+                    (random-population 10 random-dude)
+                    sine-rubrics)]
+    (> (count (:script (make-baby population 0.01 sine-rubrics))) 0)  => true
+    (nil? (:score (make-baby population 0.01 sine-rubrics))) => false
+  ))
+
+
+(defn one-seasonal-cycle
+  "doubles the population size by calling `make-baby`, sorts the entire population by score (worse is bigger), removes the worst-scoring ones"
+  [population mutation-rate rubrics]
+  (let [carrying-capacity (count population)
+        new-brood (repeatedly
+                    carrying-capacity
+                    #(make-baby population mutation-rate rubrics))]
+    (take carrying-capacity (sort-by :score (concat population new-brood)))
+    ))
+
+
+(def random-sine-guess (fn [] (random-individual token-generator 100)))
+
+
+(def initial-sine-population
+  (score-population (random-population 200 random-sine-guess) sine-rubrics))
+
+
+; (println (sort-by :score initial-sine-population))
+
+; (println (sort-by :score (one-seasonal-cycle initial-sine-population 0.01 sine-rubrics)))
+
+(defn future-history
+  "creates a lazy list of iterations by applying `one-seasonal-cycle` to an initial population"
+  [initial-pop mutation-rate rubrics]
+  (iterate #(one-seasonal-cycle % mutation-rate rubrics) initial-pop))
+
+
+(println (sort-by
+            :score
+            (nth (future-history initial-sine-population 0.05 sine-rubrics) 50)))


a whole new world

a whole new world

--- ros/angelic_planning/src/ros/robot_actions.clj
+++ ros/angelic_planning/src/ros/robot_actions.clj
@@ -964,7 +964,7 @@

 (defmethod sample-robot-hla-refinement-det ::GoDropRegionHLA [nh a env random]
    [(make-go-drop-hla (:right? a) (:obj-name a) (:table-name a)
-		      (conj (vec (sample-region-border-det (:drop-region a) 0.2 random))
+		      (conj (vec (sample-region-border-det (:drop-region a) 0.1 random))
 			    (+ 0.12 (:height (safe-get* (:world env) (:table-name a))))))])

 (defmethod robot-action-name ::GoDropRegionHLA [a]


Use the same message for all the Sentry record for limit exceeding emails so they are gouped together for stats. Pass the human readable and the real file size in the extra field.

--- src/oc/email/mailer.clj
+++ src/oc/email/mailer.clj
@@ -71,12 +71,12 @@
         (when (>= file-size size-limit)
           ;; Send a Sentry notification
           (when c/dsn ; Sentry is configured
-            (sentry/capture c/dsn {:message (str "Rendered update email is over size limit at "
-                                                 (int (Math/ceil (/ file-size 1000)))
-                                                 "KB")
+            (sentry/capture c/dsn {:message "Rendered update email is over size limit"
                                    :extra {
                                       :company-slug (:company-slug snapshot)
                                       :update-slug (:slug snapshot)
+                                      :human-size (str (int (Math/ceil (/ file-size 1000))) "KB")
+                                      :size file-size
                                       :topic-count (count (:sections snapshot))}}))
           ;; Render an alternative, smaller email
           (spit html-file (content/snapshot-link-html full-snapshot)) ; create the email in a tmp file


Make Eastwood happy. Thanks Eastwood!

Make Eastwood happy. Thanks Eastwood!

--- src/oc/email/mailer.clj
+++ src/oc/email/mailer.clj
@@ -42,11 +42,12 @@
                           :source (str company-name "<" company-slug "@" c/email-from-domain ">")
                           :reply-to (if (s/blank? reply-to) default-reply-to reply-to)
                           :subject subject}
-                    {:html body}))
-              to)))
+                    {:html body})
+              to))))

-(defn send-snapshot [{note :note snapshot :snapshot :as msg}]
+(defn send-snapshot
   "Create an HTML snapshot and email it to the specified recipients."
+  [{note :note snapshot :snapshot :as msg}]
   (let [uuid-fragment (subs (str (java.util.UUID/randomUUID)) 0 4)
         html-file (str uuid-fragment ".html")
         inline-file (str uuid-fragment ".inline.html")]
@@ -59,8 +60,9 @@
         (io/delete-file html-file true)
         (io/delete-file inline-file true)))))

-(defn send-invite [message]
+(defn send-invite
   "Create an HTML and text invite and email it to the specified recipients."
+  [message]
   (let [uuid-fragment (subs (str (java.util.UUID/randomUUID)) 0 4)
         html-file (str uuid-fragment ".html")
         inline-file (str uuid-fragment ".inline.html")


- fix .write error not existing on BufferedWriter (use spit from duck-streams instead of clojure.core)

--- src/overtone/config.clj
+++ src/overtone/config.clj
@@ -1,5 +1,6 @@
 (ns overtone.config
-  (:use [clojure.contrib.io :only (slurp*)])
+  (:use [clojure.contrib.io :only (slurp*)]
+        [clojure.contrib.duck-streams :only (spit)])
   (:import (java.io FileOutputStream FileInputStream)))

 ;; Provides a simple key/value configuration system with support for automatically


use namespaced keywords to represent bus types

--- src/overtone/sc/bus.clj
+++ src/overtone/sc/bus.clj
@@ -10,11 +10,13 @@
 ;; but in SC they are implemented using a simple integer referenced
 ;; array of float values.

+(derive ::audio-bus ::bus)
+(derive ::control-bus ::bus)
+
 (defn bus?
   [b]
   (and (associative? b)
-       (or (= :audio-bus (type b))
-           (= :control-bus (type b)))))
+       (or (isa? (type b) ::bus))))

 ; TODO: In order to allocate multi-channel busses we actually need to
 ; allocate multiple, adjacent busses, which the current bitset based
@@ -27,7 +29,7 @@
      (with-meta {:id id
                  :n-channels n-channels
                  :rate :control}
-                {:type :control-bus}))))
+                {:type ::control-bus}))))

 (defn audio-bus
   "Allocate one ore more audio busses."
@@ -37,13 +39,13 @@
      (with-meta {:id id
                  :n-channels n-channels
                  :rate :audio}
-                {:type :audio-bus}))))
+                {:type ::audio-bus}))))

 (defn free-bus
   [b]
   (case (type b)
-    :audio-bus   (free-id :audio-bus (:id b))
-    :control-bus (free-id :control-bus (:id b))))
+    ::audio-bus   (free-id :audio-bus (:id b))
+    ::control-bus (free-id :control-bus (:id b))))

 ; Reserve the first 11 busses for audio I/O and mixer, forever.
 (dotimes [i 11]
@@ -54,4 +56,3 @@
   nil)

 ;(on-sync-event :reset :reset-busses reset-busses)
-


update

update

--- src/panpan/reminder.clj
+++ src/panpan/reminder.clj
@@ -5,6 +5,9 @@

 (def remind-schedule
   (scheduler/schedules
+    "0 5 12 * * * *"
+    #(adapter/out "uochan 住所確認した？")
+
     "0 28 18 6 * * *"
     #(adapter/out "青空レストラン始まるよ")


fix link in ph embed

fix link in ph embed

--- src/pc/product_hunt.clj
+++ src/pc/product_hunt.clj
@@ -49,7 +49,7 @@
                      content])]
     (h/html
      [:div.product-hunt-card
-      [:a.ph-big-link {:href "#"}]
+      [:a.ph-big-link {:href (get info "discussion_url")}]
       [:div.ph-upvote
        (make-link (get info "votes_count"))]
       [:div.ph-info


Cosmetic fixes to parse-config method

Cosmetic fixes to parse-config method

--- src/com/puppetlabs/puppetdb/cli/services.clj
+++ src/com/puppetlabs/puppetdb/cli/services.clj
@@ -181,19 +181,18 @@
   "Parses the given config file/directory and configures its various
   subcomponents."
   [path]
+  {:pre [(string? path)]}
   (let [file (file path)]
-    (if-not (and (.exists file)
-                 (.canRead file))
+    (when-not (.canRead file)
       (throw (IllegalArgumentException.
-        (format "Configuration path '%s' must be exist and must be readable." path)))))
-
-  (let [config (if path (inis-to-map path) {})]
-    (-> config
-        (configure-logging!)
-        (configure-commandproc-threads)
-        (configure-web-server)
-        (configure-database)
-        (set-global-configuration!))))
+        (format "Configuration path '%s' must exist and must be readable." path)))))
+
+  (-> (inis-to-map path)
+      (configure-logging!)
+      (configure-commandproc-threads)
+      (configure-web-server)
+      (configure-database)
+      (set-global-configuration!)))

 (defn on-shutdown
   "General cleanup when a shutdown request is received."


This seems to be faster but also more unpredictable.

--- src/dsbdp/local_data_processing_pipeline.clj
+++ src/dsbdp/local_data_processing_pipeline.clj
@@ -28,10 +28,10 @@
 ;  `(ArrayBlockingQueue. *queue-size*))

 (defmacro enqueue
-  [^TransferQueue queue data]
-;  [^BlockingQueue queue data]
-;  `(.put ~queue ~data))
-  `(.tryTransfer ~queue ~data))
+;  [^TransferQueue queue data]
+  [^BlockingQueue queue data]
+  `(.put ~queue ~data))
+;  `(.tryTransfer ~queue ~data))

 (defmacro take-from-queue
   [^BlockingQueue queue]


Add schemas for badge advert

Add schemas for badge advert

--- src/cljc/salava/extra/application/schemas.cljc
+++ src/cljc/salava/extra/application/schemas.cljc
@@ -31,3 +31,31 @@
 (s/defschema BadgeAdvertUnpublish {:remote_url s/Str
                                    :remote_id s/Str
                                    :remote_issuer_id s/Str})
+
+
+
+(s/defschema BadgeAdvertModal (-> BadgeAdvert
+                                  (dissoc :issuer_content_id :badge_content_id
+                                                       :criteria_content_id :ctime :deleted :remote_url :remote_id :remote_issuer_id)
+                                    (assoc :followed s/Int
+                                           :image_file s/Str
+                                           :issuer_content_url s/Str
+                                           :issuer_content_name s/Str
+                                           :name s/Str
+                                           :tags (s/maybe s/Str))))
+
+(s/defschema BadgeAdverts {:applications [(-> BadgeAdvert
+                                               (dissoc :issuer_content_id :badge_content_id
+                                                       :criteria_content_id :ctime :deleted :remote_url :remote_id :remote_issuer_id)
+                                               (assoc :followed s/Int
+                                                      :image_file s/Str
+                                                      :issuer_content_url s/Str
+                                                      :issuer_content_name s/Str
+                                                      :name s/Str
+                                                      :tags (s/maybe s/Str)
+                                                      :not_after (s/maybe s/Int)
+                                                      :not_before (s/maybe s/Int)))]
+                           :countries [[(s/maybe s/Str)]]
+                           :user-country (s/maybe s/Str)})
+
+


select-input close on blur

select-input close on blur

--- src/cljs/re_form/inputs/select_input_impl.cljs
+++ src/cljs/re_form/inputs/select_input_impl.cljs
@@ -1,5 +1,6 @@
 (ns re-form.inputs.select-input-impl
   (:require [reagent.core :as r]
+            [re-form.inputs.common :as cmn]
             [garden.units :as u]))

 (defn select-input-style
@@ -48,30 +49,49 @@
      [:&.active {:background-color hover-bg-color}]
      [:&:hover {:background-color hover-bg-color}]]]])

-(defn select-input [_]
-  (let [state (r/atom {:active false})]
-    (fn [{:keys [class value on-change value-fn label-fn match-fn items] :as props}]
-      (let [label-fn (or label-fn pr-str)
-            value-fn (or value-fn identity)
-            match-fn (or match-fn
-                         (fn [v] (->> items
-                                      (filter #(= (value-fn %) v))
-                                      first label-fn)))]
-        [:div.re-select
-         {:on-click #(swap! state update :active not)
-          :class class}
-         [:span.triangle "▾"]
-         (if value
-           [:span.value
-            [:span.value (match-fn value) #_(or (label-fn value) (value-fn value) (str value))]]
-           [:span.choose-value
-            (or (:placeholder props) "Select...")])
-
-         (when (:active @state)
-           [:div.options
-            (for [i items] ^{:key (pr-str i)}
-              [:div.option
-               {:on-click (fn [_] (on-change (value-fn i)))
-                :class (when (= value (value-fn i)) "active")}
-               (label-fn i)
-               ])])]))))
+(defn select-input [{:keys [on-blur]}]
+  (let [state (r/atom {:active false})
+        my-on-blur (or on-blur identity)
+        doc-click-listener
+        (fn [e]
+          (when (and (not (cmn/has-ancestor (.-target e) (:root-node @state)))
+                     (:active @state))
+            (my-on-blur e)
+            (swap! state assoc :active false)))]
+    (r/create-class
+     {
+      :component-did-mount
+      (fn [this]
+        (swap! state assoc :root-node (r/dom-node this))
+        (.addEventListener js/document "click" doc-click-listener))
+
+      :component-will-unmount
+      (fn [this]
+        (.removeEventListener js/document "click" doc-click-listener))
+
+      :reagent-render
+      (fn [{:keys [class value on-change value-fn label-fn match-fn items on-blur] :as props}]
+        (let [label-fn (or label-fn pr-str)
+              value-fn (or value-fn identity)
+              match-fn (or match-fn
+                           (fn [v] (->> items
+                                        (filter #(= (value-fn %) v))
+                                        first label-fn)))]
+          [:div.re-select
+           {:on-click #(swap! state update :active not)
+            :class class}
+           [:span.triangle "▾"]
+           (if value
+             [:span.value
+              [:span.value (match-fn value) #_(or (label-fn value) (value-fn value) (str value))]]
+             [:span.choose-value
+              (or (:placeholder props) "Select...")])
+
+           (when (:active @state)
+             [:div.options
+              (for [i items] ^{:key (pr-str i)}
+                [:div.option
+                 {:on-click (fn [_] (on-change (value-fn i)))
+                  :class (when (= value (value-fn i)) "active")}
+                 (label-fn i)
+                 ])])]))})))


execute should build on top of execute-async

--- src/clojure/clojurewerkz/cassaforte/client.clj
+++ src/clojure/clojurewerkz/cassaforte/client.clj
@@ -174,26 +174,6 @@
   [query & values]
   (vector query values))

-(defn execute
-  "Executes a pre-built query.
-
-   Options
-     * prepared - whether the query should or should not be executed as prepared, always passed
-       explicitly, because `execute` is considered to be a low-level function."
-  ([^Session session query]
-     (execute session query {}))
-  ([^Session session query {:keys [prepared]}]
-     (let [^Statement statement (if prepared
-                                  (if (coll? query)
-                                    (build-statement (prepare session (first query))
-                                                     (second query))
-                                    (throw (IllegalArgumentException.
-                                            "Query is meant to be executed as prepared, but no values were supplied.")))
-                                  (build-statement query))
-           ^ResultSetFuture future (.executeAsync session statement)
-           res                     (.getUninterruptibly future)]
-       (conv/to-clj res))))
-
 (defn ^ResultSetFuture execute-async
   "Executes a pre-built query and returns a future.

@@ -212,6 +192,19 @@
                                   (build-statement query))]
        (.executeAsync session statement))))

+(defn execute
+  "Executes a pre-built query.
+
+   Options
+     * prepared - whether the query should or should not be executed as prepared, always passed
+       explicitly, because `execute` is considered to be a low-level function."
+  ([^Session session query]
+     (execute session query {}))
+  ([^Session session query opts]
+     (let [^ResultSetFuture future (execute-async session query opts)
+           res                     (.getUninterruptibly future)]
+       (conv/to-clj res))))
+
 (defn ^String export-schema
   "Exports the schema as a string"
   [^Session client]


Optimize loading animation

Optimize loading animation

--- frontend/src/cruncher/communication/main.cljs
+++ frontend/src/cruncher/communication/main.cljs
@@ -29,12 +29,13 @@
 ;;;; Requests
 (defn ajax-get
   "Make ajax call to defined server in config."
-  ([url success-handler error-handler]
-   (lib/loading!)
+  ([url success-handler error-handler toggle-loading?]
+   (when toggle-loading?
+     (lib/loading!))
    (GET (clib/make-url url)
         {:handler       success-handler
          :error-handler error-handler}))
-  ([url success-handler] (ajax-get url success-handler error-handler))
+  ([url success-handler] (ajax-get url success-handler error-handler true))
   ([url] (ajax-get url success-handler)))


Update webget board in sample data

Update webget board in sample data

--- frontend/src/faceboard/data/sample_board.cljs
+++ frontend/src/faceboard/data/sample_board.cljs
@@ -82,5 +82,5 @@
             :content {:inkpad-id "aqBdkShhea"}}
            {:id      "more"
             :label   "More"
-            :kind    "gist"
-            :content {:url ""}}]})+            :kind    "webget"
+            :content {:url "https://www.dropbox.com/"}}]})


add semantic constraints for {:time true} and {:place false}

--- src/babel/lexiconfn.cljc
+++ src/babel/lexiconfn.cljc
@@ -363,6 +363,22 @@
                   :edible false
                   :legible false}{})

+         place-false (if (= (get-in input '(:place))
+                            false)
+                       {:city false})
+
+         time (if (= (get-in input [:time])
+                      true)
+                 {:activity false
+                  :animate false
+                  :city false
+                  :speakable false
+                  :physical-object true
+                  :drinkable false
+                  :edible false
+                  :legible false
+                  :place false})
+
          ]
      (let [merged
            (cond (= input :fail) :fail
@@ -378,6 +394,7 @@
                         edible furniture human inanimate
                         legible material-false non-places
                         not-legible-if-not-artifact part-of-human-body pets place
+                        place-false time
                         ))]
        (log/trace (str "sem-impl so far: " merged))
        (if (not (= merged input)) ;; TODO: make this check more efficient: count how many rules were hit


Add softer fov

Add softer fov

--- src/robinson/render.clj
+++ src/robinson/render.clj
@@ -52,6 +52,10 @@
    :fushia      (vec (hex-str-to-dec "D30094"))
    :beige       (vec (hex-str-to-dec "C8B464"))})

+(defn limit-color
+  [v]
+  (min (max 0 v) 255))
+
 (defn rgb->mono
   [rbg]
   (let [avg (/ (reduce + rbg) 3)]
@@ -61,7 +65,7 @@
   ([rgb]
   (vec (map #(/ % 3) rgb)))
   ([rgb d]
-  (vec (map #(* % d) rgb))))
+  (vec (map #(limit-color (* % d)) rgb))))

 (defn color->rgb
   [color]
@@ -638,7 +642,8 @@
   (let [screen         (state :screen)
         [columns rows] (get-size screen)
         place          (current-place state)
-        current-time   (get-in state [:world :time])]
+        current-time   (get-in state [:world :time])
+        [player-x player-y] (player-xy state)]
     ;(debug "begin-render")
     ;(clear (state :screen))
     (trace "rendering place" (current-place state))
@@ -761,7 +766,10 @@
                                         [chr fg :brown]
                                         ["\u2225" :black :brown]))
                                   :else
-                                    out-char)]
+                                    out-char)
+                shaded-out-char (if (= (get cell :discovered) current-time)
+                                  (update-in shaded-out-char [1] (fn [c] (darken-rgb c (min 1 (/ 2 (max 1 (distance-from-player state (xy->pos x y))))))))
+                                  shaded-out-char)]
               (apply put-string screen x y shaded-out-char)))))
     ;; draw character
     ;(debug (-> state :world :player))


Bring back erronously removed functions

Bring back erronously removed functions

--- src/braid/uploads/db.clj
+++ src/braid/uploads/db.clj
@@ -2,7 +2,21 @@
   (:require
    [datomic.api :as d]
    [braid.core.server.db :as db]
-   [braid.core.server.db.common :refer [create-entity-txn db->upload upload-pull-pattern]]))
+   [braid.core.server.db.common :refer [create-entity-txn]]))
+
+(def upload-pull-pattern
+  [:upload/id
+   :upload/url
+   :upload/uploaded-at
+   {:upload/thread [:thread/id]}
+   {:upload/uploaded-by [:user/id]}])
+
+(defn db->upload [e]
+  {:id (:upload/id e)
+   :uploaded-at (:upload/uploaded-at e)
+   :thread-id (get-in e [:upload/thread :thread/id])
+   :uploader-id (get-in e [:upload/uploaded-by :user/id])
+   :url (:upload/url e)})

 ;; Queries


feat(main): load new connections every day just after midnight

--- src/busa_server/main.clj
+++ src/busa_server/main.clj
@@ -2,7 +2,8 @@
   (:require
     [busa-server.page.driver :as page-driver]
     [busa-server.model.db :as db]
-    [busa-server.core.connections :as connections])
+    [busa-server.core.connections :as connections]
+    [busa-server.core.scheduler :as scheduler])
   (:gen-class))

 (defn init []
@@ -11,7 +12,8 @@
   (db/setup-db)
   (println "Database initialized")
   (connections/load-connections)
-  (println "Todays connections loaded"))
+  (println "Connections loaded")
+  (scheduler/run-everyday-after-midnight connections/load-connections))

 (defn -main
   [& args]


Schematized fen.cljs

Schematized fen.cljs

--- src/chessground/fen.cljs
+++ src/chessground/fen.cljs
@@ -1,20 +1,24 @@
 (ns chessground.fen
   "Forsyth Edwards notation"
   (:require [chessground.common :refer [pp]]
-            [clojure.string :refer [lower-case]]))
+            [chessground.schemas :refer [ChessPiece BoardState]]
+            [clojure.string :refer [lower-case]]
+            [schema.core :as s])
+  (:require-macros [schema.macros :as sm :refer [defschema]]))

 (def default "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1")

 (def role-names {"p" "pawn" "r" "rook" "n" "knight" "b" "bishop" "q" "queen" "k" "king"})

-(defn- pos-to-key [pos]
+(sm/defn pos-to-key :- s/Str
+  [pos :- s/Num]
   (str (get "abcdefgh" (mod pos 8))
        (- 8 (int (/ pos 8)))))

-(defn- parse-squares
+(sm/defn parse-squares :- (s/maybe BoardState)
   "Parses a FEN-notation of a chess board into a map of locations ->
   piece, where piece is represented as {:role r, :color c}."
-  [fen-chars]
+  [fen-chars :- s/Str]
   (loop [pieces {}
          pos 0
          [current & next] fen-chars]
@@ -31,8 +35,6 @@
                     piece {:role role :color color}]
                 (recur (assoc pieces key piece) (inc pos) next))))))

-(defn parse [fen]
-  (parse-squares
-    (->> (or fen default)
-      (remove #(= "/" %))
-      (take-while #(not= \space %)))))
+(sm/defn parse :- BoardState
+  [fen :- s/Str]
+  (parse-squares (or fen default)))


com.google.javascript.jscomp.JSSourceFile was an empty deprecated wrapper around com.google.javascript.jscomp.SourceFile. JSSourceFile -> SourceFile.

--- src/clj/cljs/closure.clj
+++ src/clj/cljs/closure.clj
@@ -54,7 +54,7 @@
            com.google.javascript.jscomp.SourceMap$Format
            com.google.javascript.jscomp.SourceMap$DetailLevel
            com.google.javascript.jscomp.ClosureCodingConvention
-           com.google.javascript.jscomp.JSSourceFile
+           com.google.javascript.jscomp.SourceFile
            com.google.javascript.jscomp.Result
            com.google.javascript.jscomp.JSError
            com.google.javascript.jscomp.CheckLevel
@@ -79,13 +79,13 @@
 (defmulti js-source-file (fn [_ source] (class source)))

 (defmethod js-source-file String [^String name ^String source]
-  (JSSourceFile/fromCode name source))
+  (SourceFile/fromCode name source))

 (defmethod js-source-file File [_ ^File source]
-  (JSSourceFile/fromFile source))
+  (SourceFile/fromFile source))

 (defmethod js-source-file BufferedInputStream [^String name ^BufferedInputStream source]
-  (JSSourceFile/fromInputStream name source))
+  (SourceFile/fromInputStream name source))

 (defn set-options
   "TODO: Add any other options that we would like to support."


extra encoders

extra encoders

--- src/clj/dbquery/core.clj
+++ src/clj/dbquery/core.clj
@@ -38,7 +38,9 @@
   (add-encoder java.sql.Blob #(.writeString %2 "<binary>"))
   (add-encoder java.util.Date (date-time-encoder "dd/MM/yyyy"))
   (add-encoder java.sql.Date (date-time-encoder "dd/MM/yyyy"))
-  (add-encoder java.sql.Timestamp (date-time-encoder "dd/MM/yyyy HH:mm:ss")))
+  (add-encoder java.sql.Timestamp (date-time-encoder "dd/MM/yyyy HH:mm:ss"))
+  (add-encoder java.sql.RowId #(.writeString %2 %1))
+  (add-encoder oracle.sql.ROWID #(.writeString %2 (.stringValue %1))))

 (def ds-cache (atom (cache/lru-cache-factory {})))


Add run-tests to the repl namespace

Add run-tests to the repl namespace

--- src/clj/memoria/repl.clj
+++ src/clj/memoria/repl.clj
@@ -1,5 +1,6 @@
 (ns memoria.repl
-  (:require [memoria.db :as db]))
+  (:require [memoria.db :as db]
+            [clojure.test :as t]))

 (defn migrate-db
   [& args]
@@ -9,3 +10,7 @@
   [& args]
   (db/rollback-db args))

+(defn run-tests
+  [_n]
+  (t/run-tests _n))
+


Experiment with discounted case improvements

--- src/clojush/evaluate.clj
+++ src/clojush/evaluate.clj
@@ -173,8 +173,8 @@
                                            ;(+ (first case-history) (- 1.0 sum))
                                            ; (mostly) arbitrating improvement ties with error
                                            ;(+ (first case-history) (* 1000 (/ 1.0 sum)))
-                                           ;(- 1.0 sum)
-                                           (* (first case-history) (- 1.0 sum))
+                                           (- 1.0 sum)
+                                           ;(* (first case-history) (- 1.0 sum))
                                            )))))))
                           (= cat :reproductive-infidelity)
                           (let [g (:genome ind)]


`butlast`

`butlast`

--- src/such/better_doc.clj
+++ src/such/better_doc.clj
@@ -104,3 +104,9 @@

          (symbol \"no.such.namespace\" \"the\") => 'no.such.namespace/the
 ")
+
+(local-copy #'clojure.core/butlast
+  "Return a seq of all but the last item in coll, in linear time.
+   If you are working on a vector and want the result to be a vector, use `pop`.")
+
+


fix passes-opts handling

fix passes-opts handling

--- src/main/clojure/clojure/tools/analyzer/js.clj
+++ src/main/clojure/clojure/tools/analyzer/js.clj
@@ -475,9 +475,8 @@
                              {#'*ns* *ns*})
                            (:bindings opts))
        (env/ensure (global-env)
-         (env/with-env (swap! env/*env* merge
-                              {:passes-opts (:passes-opts opts)})
-           (run-passes (-analyze form env)))))))
+         (swap! env/*env* merge {:passes-opts (:passes-opts opts)})
+         (run-passes (-analyze form env))))))

 (defn analyze'
   "Like `analyze` but runs cleanup on the AST"


Allow executors to update the exclusive_executor_resource field

--- src/cider_ci/dispatcher/scripts.clj
+++ src/cider_ci/dispatcher/scripts.clj
@@ -66,7 +66,9 @@
   #{:state :exit_status :environment_variables
     :working_dir :command :issues
     :script_file :wrapper_file
-    :finished_at :started_at })
+    :finished_at :started_at
+    :exclusive_executor_resource
+    })

 (defn remove-null-values [data]
   (->> data


final review

final review

--- src/clj/org/openforis/ceo/proxy.clj
+++ src/clj/org/openforis/ceo/proxy.clj
@@ -3,7 +3,7 @@
             [clj-http.client :as client]
             [org.openforis.ceo.utils.type-conversion :as tc]
             [org.openforis.ceo.utils.part-utils      :as pu]
-            [org.openforis.ceo.db.imagery  :refer [get-imagery-source-config]]))
+            [org.openforis.ceo.db.imagery :refer [get-imagery-source-config]]))

 (defn- planet-url [source-config params]
   (let [{:keys [year month tile x y z]} params]
@@ -13,7 +13,6 @@
          "_mosaic/gmap/" z "/" x "/" y ".png?api_key="
          (:accessToken source-config))))

-;; TODO since we dropped STYLE=default for SecureWatch, we can drop STYLE= in buildSecureWatch
 (defn- default-styles [params geoserver-params]
   (update params :STYLES #(if (= "" %)
                             (str/join ","


New function: update-jenkins-url

New function: update-jenkins-url

--- src/clj_jenkins_api/jenkins_api.clj
+++ src/clj_jenkins_api/jenkins_api.clj
@@ -30,4 +30,13 @@
     [jenkins-url job-name]
     (str jenkins-url "job/" (.replaceAll job-name " " "%20")))

+(defn update-jenkins-url
+    "Updates URL to Jenkins (API) by adding basic authorization string if provided."
+    [job-config-url jenkins-basic-auth]
+    (if (empty? jenkins-basic-auth)
+        job-config-url
+        (cond (.startsWith job-config-url "https://") (str "https://" jenkins-basic-auth "@" (subs job-config-url 8))
+              (.startsWith job-config-url "http://")  (str "http://"  jenkins-basic-auth "@" (subs job-config-url 7))
+              :else job-config-url)))

+


all but unform working.

all but unform working.

--- src/test/clojure/clojure/test_clojure/spec.clj
+++ src/test/clojure/clojure/test_clojure/spec.clj
@@ -305,7 +305,7 @@
 (deftest keys-star
   (let [mspec (s/keys* :req-un [::a ::c])]
     (testing "conform and unform"
-      #_(check-conform-unform
+      (check-conform-unform
        mspec
        [[:a 1 :c 2]]
        [{:a 1 :c 2}])


Fix single-attr-resolver sym

Fix single-attr-resolver sym

--- src/com/wsscode/pathom/connect.cljc
+++ src/com/wsscode/pathom/connect.cljc
@@ -1351,7 +1351,7 @@

   `f` receives a single argument, which is the input value from `from`."
   [from to f]
-  (let [sym (str (attr-alias-name from to) "-single-attr-transform")]
+  (let [sym (symbol (str (attr-alias-name from to) "-single-attr-transform"))]
     (resolver sym
       {::input  #{from}
        ::output [to]}
@@ -1361,7 +1361,7 @@
 (defn single-attr-resolver2
   "Similar single-attr-resolver, but `f` receives two arguments, `env` and the input."
   [from to f]
-  (let [sym (str (attr-alias-name from to) "-single-attr-transform")]
+  (let [sym (symbol (str (attr-alias-name from to) "-single-attr-transform"))]
     (resolver sym
       {::input  #{from}
        ::output [to]}


formatting, and some asserts

formatting, and some asserts

--- src/chat/server/extensions/asana.clj
+++ src/chat/server/extensions/asana.clj
@@ -105,21 +105,23 @@
     (if-let [signature (get-in event-req [:headers "x-hook-signature"])]
       (let [body (str (:body event-req))]
         (timbre/debugf "webhook %s" event-req)
-          (if (hmac-verify {:secret (get-in extension [:config :webhook-secret])
-                            :data body
-                            :mac signature})
-            (do
-              (timbre/debugf "webhook signature okay")
-              (let [data (json/read-str (:body event-req))
-                    new-issues (->> (data "events")
-                                    (filter (fn [e] (and (= "task" (e "type"))
-                                                         (= "added" (e "action"))))))]
-                ; TODO: start a new thread for the issue & watch the thread
-                (timbre/debugf "event data: %s" data)
-                (timbre/debugf "new issues %s" new-issues)
-                {:status 200}))
-            (do (timbre/debugf "bad hmac")
-                {:status 400 :body "bad hmac"})))
+        (assert (some? (get-in extension [:config :webhook-secret]))
+          "Extension must have a webhook secret before it can recieve data")
+        (if (hmac-verify {:secret (get-in extension [:config :webhook-secret])
+                          :data body
+                          :mac signature})
+          (do
+            (timbre/debugf "webhook signature okay")
+            (let [data (json/read-str (:body event-req))
+                  new-issues (->> (data "events")
+                                  (filter #(and (= "task" (% "type"))
+                                             (= "added" (% "action")))))]
+              ; TODO: start a new thread for the issue & watch the thread
+              (timbre/debugf "event data: %s" data)
+              (timbre/debugf "new issues %s" new-issues)
+              {:status 200}))
+          (do (timbre/debugf "bad hmac")
+              {:status 400 :body "bad hmac"})))
       (do (timbre/warnf "missing signature on webhook %s" event-req)
           {:status 400 :body "missing signature"}))))


fix error when different format in packages received

--- src/clj/ikea_clojure_cup/product.clj
+++ src/clj/ikea_clojure_cup/product.clj
@@ -14,11 +14,12 @@
               (let [d (filter-fn m)
                     units (map #(cs/split % #" ") d)]
                 (conj v {:dimensions-and-weight (map #(-> (re-find #"\d+" %) Integer/parseInt) d)
-                         :packages (-> (filter-fn (first (s/select (s/class "measure-quantity") m)))
-                                       first
-                                       (cs/split #" ")
-                                       first
-                                       Integer/parseInt)
+                         :packages (let [p (first (filter-fn (first (s/select (s/class "measure-quantity") m))))]
+                                     (when p
+                                       (-> p
+                                           (cs/split #" ")
+                                           first
+                                           Integer/parseInt)))
                          :dimension-unit (-> units first last)
                          :weight-unit (-> units last last)})))
             []


fix phone-query

fix phone-query

--- src/cljs/phonecat_re_frame/core.cljs
+++ src/cljs/phonecat_re_frame/core.cljs
@@ -23,11 +23,6 @@
  :phones             ;; usage (subscribe [:phones])
  (fn [db]
    (reaction (:phones @db))))  ;; pulls out :phones
-=======
-   :phones             ;; usage (subscribe [:phones])
-   (fn [db]
-     (reaction (:phones @db))))  ;; pulls out :phones
->>>>>>> d540ae1... bump up to reframe 0.2.0

 (re-frame/register-sub
  :search-input
@@ -35,19 +30,11 @@
    (reaction (:search-input @db))))

 (re-frame/register-sub
- :phone-query
- (fn [db [_ phone-id]]
-   (let [phone-details-reaction (reaction (:phone-details @db))]
-     (reaction ((fn []
-                  ((keyword phone-id) @phone-details-reaction)))))))
-
-(re-frame/register-sub
  :phone-details
  (fn [db]
    (reaction (:phone-details @db))))

 (re-frame/register-sub
->>>>>>> d540ae1... bump up to reframe 0.2.0
  :order-prop
  (fn [db]
    (reaction (:order-prop @db))))


issuer connections

issuer connections

--- src/cljs/salava/badge/ui/issuer.cljs
+++ src/cljs/salava/badge/ui/issuer.cljs
@@ -1,5 +1,5 @@
 (ns salava.badge.ui.issuer
-  (:require [reagent.core :refer [atom]]
+  (:require [reagent.core :refer [atom cursor]]
             [salava.core.i18n :refer [t]]
             [salava.core.ui.ajax-utils :as ajax]
             [salava.core.ui.helper :refer [path-for private?]]
@@ -7,17 +7,40 @@

+
+(defn init-issuer-connection [issuer-id state]
+  (ajax/GET
+    (path-for (str "/obpv1/social/issuer_connected/" issuer-id))
+    {:handler (fn [data]
+                (swap! state assoc :connected data)
+                )}))
+
 (defn init-issuer-content [state issuer-id]
   (ajax/GET
     (path-for (str "/obpv1/badge/issuer/" issuer-id))
-    {:handler (fn [data] (reset! state data))}))
+    {:handler (fn [data]
+                (reset! state data)
+                (init-issuer-connection issuer-id state))
+     }))

 (defn init-creator-content [state creator-id]
   (ajax/GET
     (path-for (str "/obpv1/badge/creator/" creator-id))
     {:handler (fn [data]
-                (prn data)
                 (reset! state data))}))
+
+(defn add-issuer-to-favourites [issuer-id state]
+  (ajax/POST
+    (path-for (str "/obpv1/social/create_connection_issuer/" issuer-id))
+    {:handler (fn []
+                (init-issuer-connection issuer-id state))}))
+
+
+(defn remove-issuer-from-favourites [issuer-id state]
+  (ajax/POST
+    (path-for (str "/obpv1/social/delete_connection_issuer/" issuer-id))
+    {:handler (fn []
+                (init-issuer-connection issuer-id state))}))

 (defn- issuer-image [path]
   (when (not-empty path)
@@ -26,12 +49,21 @@
       :style {:width "50px"}}]))

 (defn content [issuer-id]
-  (let [state (atom {:issuer nil :endorsement []})]
+  (let [state (atom {:issuer nil :endorsement []})
+        connected? (cursor state [:connected])]
     (init-issuer-content state issuer-id)
     (fn []
       (let [{:keys [name description email url image_file]} @state]
         [:div.row {:id "badge-contents"}
          [:div.col-xs-12
+          [:div.row
+           ;TODO users not logged in don't see this
+           [:div.pull-right
+            (if-not @connected?
+              [:a {:href "#" :on-click #(add-issuer-to-favourites issuer-id state)} [:i {:class "fa fa-bookmark-o"}] " add to favourites"]
+              [:a {:href "#" :on-click #(remove-issuer-from-favourites issuer-id state)} [:i {:class "fa fa-bookmark"}] " remove from favourites"]
+              )]
+           ]
           [:h2.uppercase-header
            (issuer-image image_file)
            " "


init-ws w/ :quiet to avoid exception

init-ws w/ :quiet to avoid exception

--- src/com/billpiel/mem_tracer/core.clj
+++ src/com/billpiel/mem_tracer/core.clj
@@ -35,7 +35,7 @@
   "`ns-sym` is a symbol that references an existing namespace. Applies an enabled
   trace to all functions in that namespace. Adds the traces to the active workspace trace set."
   [ns-sym]
-  (#'ws/add-trace-ns! (init-workspace!)
+  (#'ws/add-trace-ns! (init-workspace! :quiet)
                       ns-sym))

 (defn remove-trace-ns!


Simplified week rendering for calendar example

--- src/css-guide/styles/components.cljs
+++ src/css-guide/styles/components.cljs
@@ -1362,6 +1362,11 @@
           (dom/button #js {:className "c-button c-button--postfix u-hide@sm"} "Start"))))))

+(defn render-calendar-week [lowerRange upperRange]
+  (for [x (range lowerRange (+ upperRange 1))
+       :let [y (dom/td #js {:key (str "id-" x) :className "c-calendar__day"} x)]]
+   y))
+
 (defexample calendar-example
   "### Calendar Example"
   (dom/div #js {}
@@ -1397,40 +1402,18 @@
                 (dom/td #js {:className "c-calendar__day is-inactive"} "29")
                 (dom/td #js {:className "c-calendar__day is-inactive"} "30")
                 (dom/td #js {:className "c-calendar__day is-inactive"} "31")
-                (dom/td #js {:className "c-calendar__day"} "1")
-                (dom/td #js {:className "c-calendar__day"} "2"))
+                (render-calendar-week 1 2))
               (dom/tr #js {}
-                (dom/td #js {:className "c-calendar__day"} "3")
-                (dom/td #js {:className "c-calendar__day"} "4")
-                (dom/td #js {:className "c-calendar__day"} "5")
-                (dom/td #js {:className "c-calendar__day"} "6")
-                (dom/td #js {:className "c-calendar__day"} "7")
-                (dom/td #js {:className "c-calendar__day"} "8")
-                (dom/td #js {:className "c-calendar__day"} "9"))
+                (render-calendar-week 3 9))
               (dom/tr #js {}
-                (dom/td #js {:className "c-calendar__day"} "10")
-                (dom/td #js {:className "c-calendar__day"} "11")
-                (dom/td #js {:className "c-calendar__day"} "12")
-                (dom/td #js {:className "c-calendar__day"} "13")
-                (dom/td #js {:className "c-calendar__day"} "14")
-                (dom/td #js {:className "c-calendar__day"} "15")
-                (dom/td #js {:className "c-calendar__day"} "16"))
+                (render-calendar-week 10 16))
               (dom/tr #js {}
-                (dom/td #js {:className "c-calendar__day"} "17")
-                (dom/td #js {:className "c-calendar__day"} "18")
+                (render-calendar-week 17 18)
                 (dom/td #js {:className "c-calendar__day is-active"} "19")
-                (dom/td #js {:className "c-calendar__day"} "20")
-                (dom/td #js {:className "c-calendar__day"} "21")
-                (dom/td #js {:className "c-calendar__day"} "22")
-                (dom/td #js {:className "c-calendar__day"} "23"))
+                (render-calendar-week 20 23))
               (dom/tr #js {}
-                (dom/td #js {:className "c-calendar__day"} "24")
-                (dom/td #js {:className "c-calendar__day"} "25")
-                (dom/td #js {:className "c-calendar__day"} "26")
-                (dom/td #js {:className "c-calendar__day"} "27")
-                (dom/td #js {:className "c-calendar__day"} "28")
-                (dom/td #js {:className "c-calendar__day"} "29")
-                (dom/td #js {:className "c-calendar__day"} "30")))))))))
+                (render-calendar-week 24 30)
+                ))))))))

 (defn toggle-drawer [this] (om/update-state! this update :drawer not))


Hide pinned subscriptions and search behind debug flag

--- src/day8/re_frame_10x/view/subs.cljs
+++ src/day8/re_frame_10x/view/subs.cljs
@@ -106,101 +106,103 @@

 (defn pod-header [{:keys [id layer path open? diff? pin? run-times order]}]
-  [rc/h-box
-   :class    "app-db-path--header"
-   :style {:background-color (when pin? "lightblue")}
-   :align    :center
-   :height   common/gs-31s
-   :children [[pod-header-section
-               :children [[rc/box
-                           :width  common/gs-31s
-                           :height common/gs-31s
-                           :class  "noselect"
-                           :style  {:cursor "pointer"}
-                           :attr   {:title    (str (if open? "Close" "Open") " the pod bay doors, HAL")
+  (let [debug? @(rf/subscribe [:settings/debug?])]
+    [rc/h-box
+     :class "app-db-path--header"
+     :style {:background-color (when pin? "lightblue")}
+     :align :center
+     :height common/gs-31s
+     :children [[pod-header-section
+                 :children [[rc/box
+                             :width common/gs-31s
+                             :height common/gs-31s
+                             :class "noselect"
+                             :style {:cursor "pointer"}
+                             :attr {:title    (str (if open? "Close" "Open") " the pod bay doors, HAL")
                                     :on-click (handler-fn (rf/dispatch [:subs/open-pod? id (not open?)]))}
-                           :child  [rc/box
-                                    :margin "auto"
-                                    :child [:span.arrow (if open? "▼" "▶")]]]]]
-
-              #_[rc/box
-                 ;:width "64px"                                ;; (100-36)px from box above
-                 :child [sub-tag (first order) (short-tag-desc (first order))]]
-
-              ;; TODO: report if a sub was run multiple times
-              #_(when run-times
-                  [:span "Warning: run " run-times " times"])
-
-              [rc/h-box
-               :class "app-db-path--path-header"
-               :size "auto"
-               :style {:height       common/gs-31s
-                       :border-right pod-border-edge}
-               :background-color "white"
-               :align :center
-               :children [[rc/input-text
-                           :style {:height  "25px"
-                                   :border  "none"
-                                   :padding (css-join "0px" common/gs-7s)
-                                   :width   "-webkit-fill-available"} ;; This took a bit of finding!
-                           :width "100%"
-                           :model path
-                           :disabled? true]]]
-
-              (when @(rf/subscribe [:settings/debug?])
+                             :child [rc/box
+                                     :margin "auto"
+                                     :child [:span.arrow (if open? "▼" "▶")]]]]]
+
+                #_[rc/box
+                   ;:width "64px"                                ;; (100-36)px from box above
+                   :child [sub-tag (first order) (short-tag-desc (first order))]]
+
+                ;; TODO: report if a sub was run multiple times
+                #_(when run-times
+                    [:span "Warning: run " run-times " times"])
+
+                [rc/h-box
+                 :class "app-db-path--path-header"
+                 :size "auto"
+                 :style {:height       common/gs-31s
+                         :border-right pod-border-edge}
+                 :background-color "white"
+                 :align :center
+                 :children [[rc/input-text
+                             :style {:height  "25px"
+                                     :border  "none"
+                                     :padding (css-join "0px" common/gs-7s)
+                                     :width   "-webkit-fill-available"} ;; This took a bit of finding!
+                             :width "100%"
+                             :model path
+                             :disabled? true]]]
+
+                (when debug?
+                  [pod-header-section
+                   :min-width "50px"
+                   :children [[rc/label :label (str id)]]])
+
                 [pod-header-section
-                 :min-width "50px"
-                 :children [[rc/label :label (str id)]]])
-
-              [pod-header-section
-               :min-width "106px" ;; common/gs-131s - (2 * 12px padding) - (1px border)
-               :gap       common/gs-12s
-               :style     {:padding "0px 12px"}
-               :children  (into []
-                                (comp
-                                  (take 3)
-                                  (map (fn [o] [short-sub-tag o (short-tag-desc o)])))
-                                order)]
-
-              [pod-header-section
-               :width    common/gs-31s
-               :children [[rc/box
-                           :style {:width            common/gs-19s
-                                   :height           common/gs-19s
-                                   :border           pod-border-edge
-                                   :border-radius    "50%"
-                                   :margin           "auto"
-                                   :background-color "white"}
-                           :child (if (some? layer)
-                                    [:div {:style {:margin "auto"}} layer]
-                                    [rc/link {:label "?"
-                                              :style {:margin "auto"}
-                                              :href  "https://github.com/Day8/re-frame-10x/blob/master/docs/HyperlinkedInformation/UnchangedLayer2.md#why-do-i-sometimes-see-layer--when-viewing-a-subscription"}])]]]
-
-              [pod-header-section
-               :width "50px"
-               :attr     {:on-click (handler-fn (rf/dispatch [:subs/set-pinned id (not pin?)]))}
-               :children [[rc/box
-                           :style {:margin "auto"}
-                           :child [rc/checkbox
-                                   :model pin?
-                                   :label ""
-                                   :style {:margin-left "6px"
-                                           :margin-top  "1px"}
-                                   :on-change #(rf/dispatch [:subs/set-pinned id (not pin?)])]]]]
-
-              [pod-header-section
-               :width "50px"
-               :attr     {:on-click (handler-fn (rf/dispatch [:subs/set-diff-visibility id (not diff?)]))}
-               :last?    true
-               :children [[rc/box
-                           :style {:margin "auto"}
-                           :child [rc/checkbox
-                                   :model diff?
-                                   :label ""
-                                   :style {:margin-left "6px"
-                                           :margin-top  "1px"}
-                                   :on-change #(rf/dispatch [:subs/set-diff-visibility id (not diff?)])]]]]]])
+                 :min-width "106px"                         ;; common/gs-131s - (2 * 12px padding) - (1px border)
+                 :gap common/gs-12s
+                 :style {:padding "0px 12px"}
+                 :children (into []
+                                 (comp
+                                   (take 3)
+                                   (map (fn [o] [short-sub-tag o (short-tag-desc o)])))
+                                 order)]
+
+                [pod-header-section
+                 :width common/gs-31s
+                 :children [[rc/box
+                             :style {:width            common/gs-19s
+                                     :height           common/gs-19s
+                                     :border           pod-border-edge
+                                     :border-radius    "50%"
+                                     :margin           "auto"
+                                     :background-color "white"}
+                             :child (if (some? layer)
+                                      [:div {:style {:margin "auto"}} layer]
+                                      [rc/link {:label "?"
+                                                :style {:margin "auto"}
+                                                :href  "https://github.com/Day8/re-frame-10x/blob/master/docs/HyperlinkedInformation/UnchangedLayer2.md#why-do-i-sometimes-see-layer--when-viewing-a-subscription"}])]]]
+
+                (when debug?
+                  [pod-header-section
+                   :width "50px"
+                   :attr {:on-click (handler-fn (rf/dispatch [:subs/set-pinned id (not pin?)]))}
+                   :children [[rc/box
+                               :style {:margin "auto"}
+                               :child [rc/checkbox
+                                       :model pin?
+                                       :label ""
+                                       :style {:margin-left "6px"
+                                               :margin-top  "1px"}
+                                       :on-change #(rf/dispatch [:subs/set-pinned id (not pin?)])]]]])
+
+                [pod-header-section
+                 :width "50px"
+                 :attr {:on-click (handler-fn (rf/dispatch [:subs/set-diff-visibility id (not diff?)]))}
+                 :last? true
+                 :children [[rc/box
+                             :style {:margin "auto"}
+                             :child [rc/checkbox
+                                     :model diff?
+                                     :label ""
+                                     :style {:margin-left "6px"
+                                             :margin-top  "1px"}
+                                     :on-change #(rf/dispatch [:subs/set-diff-visibility id (not diff?)])]]]]]]))

 (def no-prev-value-msg [:p {:style {:font-style "italic"}} "No previous value exists to diff"])
@@ -328,10 +330,11 @@
                :width "32px" ;; common/gs-31s + 1 border
                :justify :center
                :child [rc/label :style {:font-size "9px"} :label "LAYER"]]
-              [rc/box
-               :width "51px" ;;  50px + 1 border
-               :justify :center
-               :child [rc/label :style {:font-size "9px"} :label "PINS"]]
+              (when @(rf/subscribe [:settings/debug?])
+                [rc/box
+                 :width "51px"                              ;;  50px + 1 border
+                 :justify :center
+                 :child [rc/label :style {:font-size "9px"} :label "PINS"]])
               [rc/box
                :width "51px" ;;  50px + 1 border
                :justify :center
@@ -395,6 +398,6 @@
    :size     "1"
    :style    {:margin-right common/gs-19s}
    :children [[panel-header]
-              [filter-section]
+              (when @(rf/subscribe [:settings/debug?]) [filter-section])
               [pod-section]
               [rc/gap-f :size common/gs-19s]]])


Functions to select and insert product into products table

--- src/emender_jenkins/db_interface.clj
+++ src/emender_jenkins/db_interface.clj
@@ -15,5 +15,34 @@

 (require '[clojure.java.jdbc       :as jdbc])

-(require '[emender-jenkins.db-spec     :as db-spec])
+(require '[clojure.tools.logging   :as log])

+(require '[emender-jenkins.db-spec :as db-spec])
+
+(defn select-product-id
+    [product-name]
+    (log/info "select-product-id" product-name)
+    (->
+        (jdbc/query db-spec/emender-jenkins-db
+           ["select id from product_names where name=?" product-name])
+           first
+           :id))
+
+(defn insert-product-name
+    [product-name]
+    (log/info "insert-product-name" product-name)
+    (jdbc/insert! db-spec/emender-jenkins-db
+        :product_names {:name product-name}))
+
+(defn select-product-id-or-insert
+    [product-name]
+    (if-let [product-id (select-product-id product-name)]
+            product-id
+            (do (insert-product-name product-name)
+                (select-product-id product-name))))
+
+(defn insert-test-waive
+    [waive-data]
+    (println waive-data)
+)
+


more testing

more testing

--- test/cljc/ow/starbuck/message_router_test.cljc
+++ test/cljc/ow/starbuck/message_router_test.cljc
@@ -133,3 +133,20 @@
                :starbuck/route-count 1
                :postprocessed true
                :error true}]))))
+
+(t/deftest route-err1
+  (let [msg {:route :98hosedgosg}]
+    (t/is (= (mr/advance msg example-ruleset)
+             []))))
+
+(t/deftest route-err2
+  (let [msg {:route :switch-booking
+             :comp :soagdoe3245}]
+    (t/is (= (mr/advance msg example-ruleset)
+             []))))
+
+(t/deftest event-err1
+  (let [msg {:route :saoiuhg08ehn
+             :error true}]
+    (t/is (= (mr/advance msg example-ruleset)
+             []))))


Add todo.

Add todo.


comments

comments

--- src-cljs/cuttle/core.cljs
+++ src-cljs/cuttle/core.cljs
@@ -33,6 +33,7 @@
 ;; NOTE: this function is the poster-child for how go blocks are cleaner than
 ;; nested callbacks
 ;; don't judge me please; I was sick when I wrote this
+;; TODO: we need to handle when there is a permission error here
 (defn- copy-lein-files! [next-fn]
   (.ensureDir fs windows-bin-dir (fn []
     (.copy fs (path-join js/__dirname "bin" "lein.bat")


Fix broken test require.

Fix broken test require.

--- test/org/playasophy/wonderdome/layout_test.clj
+++ test/org/playasophy/wonderdome/layout_test.clj
@@ -1,7 +1,7 @@
 (ns org.playasophy.wonderdome.layout-test
   (:require
     [clojure.test :refer :all]
-    [org.playasophy.wonderdome.layout :as layout]))
+    [org.playasophy.wonderdome.geometry.layout :as layout]))

 ; FIXME: broken test