remove unneeded param to (generate2); call (do-defaults) on add-comps

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -157,10 +157,10 @@
                         bolts-at))))))
 (defn generate2
   "Return all expressions matching spec _spec_ given the model _model_."
-  [spec model depth]
+  [spec model]
   (log/debug (str "generate2: spec: " spec))
   (mapcat (fn [bolt]
-            (let [comps-map (comp-paths-to-bolts-map bolt model depth max-total-depth)
+            (let [comps-map (comp-paths-to-bolts-map bolt model 0 max-total-depth)
                   comp-paths (keys comps-map)
                   comp-bolts (map #(get comps-map %)
                                   comp-paths)]
@@ -169,13 +169,14 @@
               ;; there is a non-empty set of bolts that satisfies
               ;; that complement's path.
               (when (not (some empty? (vals comps-map)))
-                (add-comps bolt
-                           model
-                           comp-paths
-                           comp-bolts
-                           depth max-total-depth
-                           bolt))))
-          (lightning-bolts model spec depth max-total-depth)))
+                (mapfn #(do-defaults % model)
+                       (add-comps bolt
+                                  model
+                                  comp-paths
+                                  comp-bolts
+                                  0 max-total-depth
+                                  bolt)))))
+          (lightning-bolts model spec 0 max-total-depth)))

 (defn generate-n
   "Returns all possible expressions generated by the given language model, constrained by the given spec.


add (lazy-seq) to (defn add comps)

add (lazy-seq) to (defn add comps)

--- src/babel/generate.cljc
+++ src/babel/generate.cljc
@@ -125,22 +125,23 @@
   "given a bolt, return the lazy sequence of all bolts derived from this bolt after adding,
    at each supplied path in comp-paths, the bolts for that path."
   [bolt model comp-paths bolts-at-paths depth max-depth & [top-bolt path-from-top]]
-  (let [top-bolt (or top-bolt bolt)]
-    (if (empty? comp-paths)
-      [bolt] ;; done: we've added all the comps to the bolt, so just return the bolt as a singleton vector.
-      ;; else, more comp-paths to go.
-      (flatten
-       (mapfn #(add-comps % model
-                          (rest comp-paths)
-                          (rest bolts-at-paths)
-                          depth max-depth top-bolt path-from-top)
-              (let [path (first comp-paths)
-                    bolts-at (first bolts-at-paths)]
-                (flatten
-                 (mapfn
-                  (fn [bolt-at]
+  (lazy-seq
+   (let [top-bolt (or top-bolt bolt)]
+     (if (empty? comp-paths)
+       [bolt] ;; done: we've added all the comps to the bolt, so just return the bolt as a singleton vector.
+       ;; else, more comp-paths to go.
+       (flatten
+        (mapfn #(add-comps % model
+                           (rest comp-paths)
+                           (rest bolts-at-paths)
+                           depth max-depth top-bolt path-from-top)
+               (let [path (first comp-paths)
+                     bolts-at (first bolts-at-paths)]
+                 (flatten
+                  (mapfn
+                   (fn [bolt-at]
                     (add-bolt-at top-bolt bolt path bolt-at model depth max-depth))
-                  bolts-at))))))))
+                   bolts-at)))))))))

 (defn add-bolt-at [top-bolt bolt path bolt-at model depth max-depth]
   (lazy-seq


some minimum comment on fn usage

some minimum comment on fn usage

--- src/badger/badgerer.clj
+++ src/badger/badgerer.clj
@@ -2,7 +2,9 @@
   "hands out the badge onto the profile pic"
   (:require [quil.core :as q]))

-(defn add-badge [profile-filename badge-num]
+(defn add-badge
+  "receives profile pic filename and badge number, and saves the badged pic and return the filename"
+  [profile-filename badge-num]
   (let [result-filename (clojure.string/replace profile-filename #"\." (str "_" badge-num "."))
         profile-size 600 badge-size 200]
     (q/defsketch badged-profile


implementing some more interfaces for RangeMap

--- sample/src/sample/rangemap.clj
+++ sample/src/sample/rangemap.clj
@@ -58,7 +58,16 @@
   Object

   (toString [this]
-    (.toString m)))
+    (.toString m))
+
+  (equiv [this o]
+    (.equiv m o))
+
+
+  clojure.lang.IHashEq
+
+  (hasheq [this]
+    (.hasheq m)))

 (defn range-map [kind & kvs]


fix order of about entries

fix order of about entries

--- frontend/components/about.cljs
+++ frontend/components/about.cljs
@@ -28,6 +28,15 @@
     :email "allen@circleci.com"
     :bio ["Allen loves Ultimate Frisbee: he's played in the snow, on the beach, on Thanksgiving Day, New Year's Eve, and New Year's Day, and he regularly plays in 110 degree August heat. His future plans include the tacocopter, the burrito bomber, and the mosquito laser. When Allen's not coding, he spends his time making his own pizza dough and brewing his own beer. He'd make his own whiskey, too, if he wanted to wait 10 years for a drink.",
           "Back in the day, Allen started work on his own self-hosting, native code lisp, and then the clouds parted and he discovered Clojure. Since then, he's become a Clojure contributor, and has commits in clojure.core, contrib, lein, ring, compojure, noir, and about a dozen more libraries. He finished SICP, and wrote Scriptjure, a Clojure to Javascript compiler, 2 years before ClojureScript. Other devs used his work as a basis for Stevedore, which he's happy to say is used in production every day at Circle. In addition to co-founding Circle as a means to bring Continuous Deployment to the masses, he looks forward to building tools that help debug test failures by anticipating common problems. He currently deploys six times a day, and more on weekends."]}
+   {:name "Jenneviere Villegas"
+    :img-path (stefon/asset-path "/img/outer/about/jenneviere.png")
+    :visible true
+    :role "Operations"
+    :github "jenneviere"
+    :twitter "jenneviere"
+    :email "jenneviere@circleci.com"
+    :bio ["Jenneviere moved to the Bay Area in 2010 after spending a few months there, singing and dancing, as the lead in a rock opera. She then worked as an extra on the movie Twixt, and when she realized that Mr. Coppola wasn't going to cast her as the lead in his next film, she began drowning her sorrows in hoppy IPAs and the soothing click of knitting needles. She took the black and works the Gate at That Thing In The Desert, and has only written a single line of code, ever.",
+          "Drawing from her many years' experience in her previous position as the Customer Amazement Specialist, Operations Manager, Returns Siren, and Retail Store Maven for a certain large utility kilt manufacturer, Jenneviere brings her skills as a professional pottymouth, dabbler in inappropriate and snarky humor, and cat wrangling to the team at Circle, and spends most of her time trying to keep everyone well-groomed and hairball free."]}
    {:name "David Lowe"
     :visible true
     :role "Backend Developer"
@@ -37,15 +46,6 @@
     :img-path (stefon/asset-path "/img/outer/about/david.png")
     :bio ["David is responsible for all of the bugs. He wrote his first buggy code in BASIC with a pencil and paper, and he's been getting better at it ever since. He keeps a 1/4 acre garden and eats almost entirely home-grown veggies during the growing season. Helping to balance out the numerous times that he's lost at chess, David has won the IOCCC on 6 separate occasions. In a past life, he wrote MTA software which at one time was sending about 1% of the internet's email.",
           "Besides being invited to speak at the Frozen Perl Conference, OIT's CSET Department, and SOU's CS Department, David co-founded the SF perl user group, the southern Oregon geek group, and the Rogue hack lab hackerspace. He drank the automated testing kool-aid years ago, and after introducing and championing (and constantly fiddling with) continuous integration tools at his last N jobs, he came to Circle, and is particularly keen on building and scaling things which would be impossible to justify for any single small company where CI isn't what they do. He splits his time between introducing new bugs, telling kids to get off his lawn, and baking pies. His current running total is roughly 1500 delicious pastry concoctions."]}
-   {:name "Jenneviere Villegas"
-    :img-path (stefon/asset-path "/img/outer/about/jenneviere.png")
-    :visible true
-    :role "Operations"
-    :github "jenneviere"
-    :twitter "jenneviere"
-    :email "jenneviere@circleci.com"
-    :bio ["Jenneviere moved to the Bay Area in 2010 after spending a few months there, singing and dancing, as the lead in a rock opera. She then worked as an extra on the movie Twixt, and when she realized that Mr. Coppola wasn't going to cast her as the lead in his next film, she began drowning her sorrows in hoppy IPAs and the soothing click of knitting needles. She took the black and works the Gate at That Thing In The Desert, and has only written a single line of code, ever.",
-          "Drawing from her many years' experience in her previous position as the Customer Amazement Specialist, Operations Manager, Returns Siren, and Retail Store Maven for a certain large utility kilt manufacturer, Jenneviere brings her skills as a professional pottymouth, dabbler in inappropriate and snarky humor, and cat wrangling to the team at Circle, and spends most of her time trying to keep everyone well-groomed and hairball free."]}
    {:name "Daniel Woelfel"
     :img-path (stefon/asset-path "/img/outer/about/daniel.png")
     :visible true
@@ -91,12 +91,6 @@
     :email "nick@circleci.com"
     :bio ["Nick is an aspiring merman who spends most of his time outside of the Circle office in the ocean; surfing, diving, sailing, and swimming. He lived in Japan for 3 years as a student, consultant, actor, and vagabond and wrote his senior thesis on the cultural importance of baseball in the country. He won a hackathon by building a social haiku app for iPhone (which is still in the App Store). Eventually he came back to the US and got his first ‘real job’ at a digital consultancy where he optimized conversion rates for websites that comprise hundreds of thousands of visitors and generate millions in revenue every month.",
           "In 2012 Nick was lured to San Francisco by the prospect of hitting it big with his own startup, which crashed and burned, but he liked the place so decided to stick around. He loves the open work culture at Circle which allows him to fulfill his constant need to get-shit-done while helping developers do the same. One day he will unplug his computer and sail around the world."]}
-   {:name "Travis Vachon"
-    :visible true
-    :role "Developer"
-    :github "travis"
-    :twitter "tvachon"
-    :email "travis@circleci.com"}
    {:name "Emile Snyder"
     :visible true
     :role "Backend Developer"
@@ -139,7 +133,13 @@
     :role "Developer Success"
     :github "musicalchair"
     :twitter "timreinke"
-    :email "tim.reinke@circleci.com"}])
+    :email "tim.reinke@circleci.com"}
+   {:name "Travis Vachon"
+    :visible true
+    :role "Developer"
+    :github "travis"
+    :twitter "tvachon"
+    :email "travis@circleci.com"}])

 (def placeholder-image [:svg.about-placeholder {:height "150px" :width "150px" :viewBox "0 0 150 150"}
                         [:path.bust {:d "M-1.673,151.75v-13.856c0,0,0.901-8.505,11.143-11.142c0,0,16.495-6.022,29.415-11.646 c6.681-2.907,8.119-4.652,14.859-7.631c0,0,0.703-3.461,0.45-5.521h5.271c0,0,1.204,0.702,0-7.43c0,0-6.425-1.705-6.725-14.655 c0,0-4.825,1.625-5.121-6.224c-0.202-5.321-4.318-9.939,1.607-13.753l-3.012-8.131c0,0-6.023-32.826,11.294-28.008 c-7.305-8.734,41.409-17.465,44.574,10.24c0,0,2.256,14.958,0,25.197c0,0,7.113-0.824,2.357,12.852c0,0-2.609,9.836-6.627,7.628 c0,0,0.656,12.447-5.668,14.559c0,0,0.449,6.625,0.449,7.075l6.025,0.903c0,0-0.906,5.424,0.152,6.022c0,0,7.142,4.894,15.657,7.081 c16.414,4.212,35.837,11.44,35.837,17.766c0,0,1.659,8.435,1.659,18.673H-1.673z",


add test for data.clj

add test for data.clj

--- server/test/kyoodos/data_test.clj
+++ server/test/kyoodos/data_test.clj
@@ -0,0 +1,35 @@
+(ns kyoodos.data-test
+  (:require [clojure.test :refer :all]
+            [kyoodos.data :refer :all]))
+
+(deftest get-user-test
+  (testing "you can get user by id"
+    (is (= "Sevada Abraamyan" ( -> (get-user 1) first :username )))))
+
+(deftest get-group-test
+  (testing "you can get a group by its id"
+    (is (= "front" ( -> (get-group 1) first :name)))))
+
+(deftest get-kyoodos-from-test
+  (testing "you can get kyoodos from a user"
+    (is (= "Great job!" ( -> (get-kyoodos "from" 41) first :content)))))
+
+(deftest get-kyoodos-to-test
+  (testing "you can get kyoodos to a user"
+    (is (= "Great job!" ( -> (get-kyoodos "to" 180) first :content)))))
+
+(deftest valid-user-test
+  (testing "should be true if user exists in db"
+    (is (= true (valid-user? 1)))))
+
+(deftest invalid-user-test
+  (testing "should be false if user does not exist in db"
+    (is (= false (valid-user? 300000)))))
+
+(deftest valid-group-test
+  (testing "should be true if group exists in db"
+    (is (= true (valid-group? 1)))))
+
+(deftest invalid-group-test
+  (testing "should be true if group exists in db"
+    (is (= false (valid-group? 300000)))))


Vorlesung 12.11.

Vorlesung 12.11.

--- src/fpc/vl05.clj
+++ src/fpc/vl05.clj
@@ -169,7 +169,8 @@
 (factorial 6)
 ;=> 720

-(factorial 1000N)
+(factorial 5000N)
+(fact2 5000N)
 ;=> eine sehr große Zahl!!

 ;; Noch eine andere Variante der Implementierung der Endrekursion
@@ -205,7 +206,7 @@

   Wir wollen eine Funktion (pascal zeile spalte) schreiben,
   die die entsprechende Pascal'sche Zahl berechnet, dabei fängt
-  die Zählung von Zeile und Spalte jeweilse bei 1 an.
+  die Zählung von Zeile und Spalte jeweils bei 1 an.

   Beispiele
   (pascal 5 1) ;=> 1
@@ -217,7 +218,7 @@
 ;; (pascal zeile spalte) berechnet

 (comment
-                  0 falls z < 1 oder s > z
+                  0 falls z < 1 oder s <1 oder s > z

   pascal(z s)  =  1 falls z = 1 oder z = s

@@ -258,7 +259,7 @@
 (pascal1 5 6)
 ;=> 0

-
+(pascal1 1000 500)
 ;; Aber: diese Lösung ist nicht endrekursiv.
 ;; Können wir die Berechnung endrekursiv machen?

@@ -331,3 +332,7 @@

 (pascal 5 6)
 ;=> 0
+
+(pascal 100 50)
+(pascal 1000 500)
+(pascal 10000 500)


omit unused import

omit unused import

--- src/keypin/type/record.clj
+++ src/keypin/type/record.clj
@@ -13,7 +13,7 @@
     [keypin.type :as t])
   (:import
     [java.util Map]
-    [clojure.lang Associative IDeref ILookup IPersistentCollection IPersistentMap Named Seqable]
+    [clojure.lang Associative IDeref ILookup IPersistentCollection IPersistentMap Seqable]
     [keypin.type KeyAttributes]))


turn candidate var name into a symbol first

--- src/bract/core/util.clj
+++ src/bract/core/util.clj
@@ -277,7 +277,7 @@
   (if (empty? bindings)
     `(do ~@body)
     (let [[left right] bindings]
-      `(let [right# ~right
+      `(let [right# (symbol ~right)
              ns# (symbol (namespace right#))]
          (try (require ns#)
            (catch FileNotFoundException e#


Must be logged in to get at app page.

Must be logged in to get at app page.

--- src/kixi/hecuba/routes.clj
+++ src/kixi/hecuba/routes.clj
@@ -138,11 +138,9 @@

    ;; Main Application
    (GET (compojure-route :app) []
-        app-page
-        ;; (friend/wrap-authorize
-        ;;  app-page
-        ;;  #{:kixi.hecuba.security/user})
-        )
+        (friend/wrap-authorize
+         app-page
+         #{:kixi.hecuba.security/user}))

    ;; AMON API Routes
    (amon-api-routes store)


Make starting music nicer.

Make starting music nicer.


day3: better moving pattern, from balefrost

--- src/adventofcode2017/day3.clj
+++ src/adventofcode2017/day3.clj
@@ -3,61 +3,53 @@
 (def input 325489)

 ; part 1
-(defn next-pos [[x y]]
-  (let [abs-x (Math/abs x)
-        abs-y (Math/abs y)]
-    (cond
-      (and (= x y)
-           (neg? x))
-      [(inc x) y]
+(def north [0 1])
+(def east [1 0])
+(def south [0 -1])
+(def west [-1 0])

-      (and (= x y)
-           (pos? x))
-      [(dec x) y]
+(def direction-pattern
+  (cycle [east north west south]))

-      (and (zero? (+ x y))
-           (neg? x))
-      [x (dec y)]
+(def distance-pattern
+  (mapcat
+    (fn [x] [x x])
+    (iterate inc 1)))

-      (and (zero? (+ x y))
-           (>= x 0))
-      [(inc x) y]
+(def pattern
+  (mapcat
+    (fn [distance direction]
+      (repeat distance direction))
+    distance-pattern
+    direction-pattern))

-      (and (= abs-x (max abs-x abs-y))
-           (pos? x))
-      [x (inc y)]
+(defn next-pos [current-pos dir]
+  (mapv + current-pos dir))

-      (and (= abs-y (max abs-x abs-y))
-           (pos? y))
-      [(dec x) y]
-
-      (and (= abs-x (max abs-x abs-y))
-           (neg? x))
-      [x (dec y)]
-
-      (and (= abs-y (max abs-x abs-y))
-           (neg? y))
-      [(inc x) y])))
-
-(def grid (iterate next-pos [0 0]))
+(def grid
+  (reductions
+    next-pos
+    [0 0]
+    pattern))

 (let [[x y] (nth grid (dec input))]
   (+ (Math/abs x) (Math/abs y)))
 ; 552

 ;; part 2
-(defn total-around [m [x y]]
-  (+ (get m [x (inc y)] 0)
-     (get m [x (dec y)] 0)
-     (get m [(inc x) y] 0)
-     (get m [(inc x) (inc y)] 0)
-     (get m [(inc x) (dec y)] 0)
-     (get m [(dec x) y] 0)
-     (get m [(dec x) (inc y)] 0)
-     (get m [(dec x) (dec y)] 0)))
+(defn neighbors [[x y]]
+  (for [dx [-1 0 1]
+        dy [-1 0 1]
+        :when (not= 0 dx dy)]
+    [(+ x dx) (+ y dy)]))
+
+(defn pos-val [m pos]
+  (apply +
+         (for [p (neighbors pos)]
+           (get m p 0))))

 (reduce (fn [m [x y]]
-          (let [v (total-around m [x y])]
+          (let [v (pos-val m [x y])]
             (if (> v input)
               (reduced v)
               (assoc m [x y] v))))


Implement JSON conf file

Implement JSON conf file

Uses repo locations are specified in json.conf

--- src/atom_finder/constants.clj
+++ src/atom_finder/constants.clj
@@ -1,13 +1,16 @@
 (ns atom-finder.constants
   (:require [atom-finder.util :refer :all]
-            [clj-jgit.porcelain :as gitp]))
+            [clj-jgit.porcelain :as gitp]
+            [clojure.data.json :as json]))

-(def gcc-path (expand-home "~/opt/src/gcc"))
-(def gcc-repo (gitp/load-repo gcc-path))
+(def conf-data (json/read-str (slurp (resource-path "conf.json")):key-fn keyword))

-(def ag-path (expand-home "~/opt/src/the_silver_searcher"))
+(def gcc-path (expand-home (get conf-data :gcc-path)))
+(def gcc-repo (gitp/load-repo "Z:\\Github\\gcc"))
+
+(def ag-path (expand-home (get conf-data :ag-path)))
 (def ag-repo (gitp/load-repo ag-path))

 (def root (tu (resource-path "logic-as-control-flow.c")))
-(def big-root (tu (expand-home "~/opt/src/github-top-c/php-src/ext/sqlite3/libsqlite/sqlite3.c")))
-(def github-top-c (expand-home "~/opt/src/github-top-c"))
+(def big-root (tu (expand-home (get conf-data :big-root))))
+(def github-top-c (expand-home (get conf-data :github-top-c)))


added change clothes

added change clothes

--- src/babel/english/lexicon.clj
+++ src/babel/english/lexicon.clj
@@ -232,8 +232,15 @@
                                         :pet true})}})

    "change" {:synsem {:cat :verb
-                      :sem {:pred :cambiare}}} ;; TODO: add reflexive sense
-
+                      :sem {:pred :change}}} ;; TODO: add reflexive sense
+
+   "change clothes" {:synsem {:cat :verb
+                              :sem {:pred :change-clothes
+                                    :subj {:human true}}}
+                     :english {:present {:3sing "changes clothes"}
+                               :participle "changing clothes"
+                               :past "changed clothes"}}
+
    "chat" {:synsem {:cat :verb
                     :sem {:pred :chat}}
            :english {:participle "chatting"


(PDB-4907) Add a fact path gc lock_timeout

For now, default to ten minutes, but allow changes via the
PDB_FACT_PATH_GC_SQL_LOCK_TIMEOUT_MS environment variable, which can
also be set to "system" to avoid making any changes at all, i.e. to
rely on the server value, which is typically no timeout.

We have observed this gc blocking on access exclusive locks for a very
long time (hours) in some (already overloaded) installations.

--- src/puppetlabs/puppetdb/scf/storage.clj
+++ src/puppetlabs/puppetdb/scf/storage.clj
@@ -52,7 +52,7 @@
            [java.util Arrays]
            [org.postgresql.util PGobject]
            [org.joda.time Period]
-           [java.sql Timestamp]
+           [java.sql SQLException Timestamp]
            (java.time Instant LocalDate LocalDateTime Year ZoneId ZonedDateTime)
            (java.time.temporal ChronoUnit)
            (java.time.format DateTimeFormatter)))
@@ -1682,6 +1682,10 @@
           ;; in the DLO
           (throw e)))))))

+(def fact-path-gc-lock-timeout-ms
+  (env-config-for-db-ulong "PDB_FACT_PATH_GC_SQL_LOCK_TIMEOUT_MS"
+                           (* 10 60 1000)))
+
 (defn garbage-collect!
   "Delete any lingering, unassociated data in the database"
   [db]
@@ -1694,4 +1698,12 @@
      (jdbc/with-transacted-connection' db :repeatable-read
        ;; May or may not require postgresql's "stronger than the
        ;; standard" behavior for repeatable read.
-       (delete-unused-fact-paths)))))
+       (try
+         (some->> fact-path-gc-lock-timeout-ms
+                  (format "set local lock_timeout = %d")
+                  (sql/execute! jdbc/*db*))
+         (delete-unused-fact-paths)
+         (catch SQLException ex
+           (when-not (= (jdbc/sql-state :query-canceled) (.getSQLState ex))
+             (throw ex))
+           (log/warn (trs "sweep of stale fact paths timed out"))))))))


Include `:parent-path` in parsed file metadata

--- src/io/perun.clj
+++ src/io/perun.clj
@@ -148,7 +148,7 @@
                                                (assoc :path page-filepath)
                                                (assoc :filename (string/replace filename
                                                                                #"(?i).[a-z]+$" ".html"))
-                                               (dissoc :parsed :extension :file-type :parent-path
+                                               (dissoc :parsed :extension :file-type
                                                        :full-path :mime-type :original))]
                                  (perun/create-file tmp page-filepath parsed)
                                  entry)))


partway through 14.3

partway through 14.3

--- src/joy/ch14.clj
+++ src/joy/ch14.clj
@@ -1,6 +1,7 @@
 (ns joy.ch14
   (:require [clojure.data :as d]
-            [clojure.edn :as edn]))
+            [clojure.edn :as edn]
+            [clojure.set :as sql]))

 (rand-int 1024)
 (+ (rand-int 100) (rand-int 100))
@@ -35,11 +36,6 @@

 (d/diff [1 2 3] [1 2 4])

-#_(defspec slope-rules
-  (fn [p1 p2] (slope :p1 p1 :p2 p2))
-  [[^long ^long] [^long ^long]]
-  (assert (float? %)))
-
 (defn filter-rising [segments]
   (clojure.set/select
    (fn [{:keys [p1 p2]}]
@@ -70,7 +66,7 @@
             :cm 1/100
             :mm [1/10 :cm]}))

-#unit/legth [1 :km]
+;;#unit/legth [1 :km]

 (def time-reader
   (partial convert
@@ -89,10 +85,56 @@

 (edn/read-string "42")

-(edn/read-string "#ch14/time [1 :min 30 :sec]")
+#_(edn/read-string "#ch14/time [1 :min 30 :sec]")

 (def T ('ch14/time #'joy.ch14/time-reader))

-(edn/read-string {:readers T} "#ch14/time [1 :min 30 :sec]")
+#_(edn/read-string {:readers T} "#ch14/time [1 :min 30 :sec]")

 (edn/read-string {:readers T, :default vector} "#what/the :huh?")
+
+;; 14.3
+(defn valid? [event]
+  (boolean (:result event)))
+
+(valid? {})
+(valid? {:result 42})
+
+(defn effect [{:keys [ab h] :or {ab 0, h 0}} event]
+  (let [ab (inc ab)
+        h (if (= :hit (:result event)) (inc h) h)
+        avg (double (/ h ab))]
+    {:ab ab :h h :avg avg}))
+
+(effect {} {:result :hit})
+
+(effect {:ab 599 :h 180}
+        {:result :out})
+
+(defn apply-effect [state event]
+  (if (valid? event) (effect state event) state))
+
+(apply-effect {:ab 600 :h 180}
+              {:result :hit})
+
+(def effect-all #(reduce apply-effect %1 %2))
+
+(effect-all {:ab 0 :h 0}
+            [{:result :hit}
+             {:result :out}
+             {:result :hit}
+             {:result :out}])
+
+(def events
+  (repeatedly 100
+              (fn [] (rand-map 1
+                              #(-> :result)
+                              #(if (<  (rand-int 10) 3)
+                                 :hit :out)))))
+
+(effect-all {} events)
+(effect-all {} (take 50 events))
+
+(def fx-timeline #(reductions apply-effect %1 %2))
+
+(fx-timeline {} (take 3 events))


Add coercions to java.util.Date instances.

--- src/tick/core.clj
+++ src/tick/core.clj
@@ -42,25 +42,34 @@
   (zone [_] "Make a java.time.ZoneId instance."))

 (extend-protocol IConstructors
+
   Instant
+  (inst [i] (Date/from i))
   (instant [i] i)
   (date
     ([i] (throw (ex-info "Needs zone" {})))
     ([i zone] (.. i (atZone zone) toLocalDate)))
+
   String
+  (inst [s] (inst (instant s)))
   (instant [s] (Instant/from (.parse (DateTimeFormatter/ISO_INSTANT) s)))
   (date
     ([s] (LocalDate/parse s))
     ([s zone] (date (instant s) zone)))
   (zone [s] (ZoneId/of s))
+
   Date
+  (inst [d] d)
   (instant [d] (.toInstant d))
   (date
     ([d] (throw (ex-info "Needs zone" {})))
     ([d zone] (date (instant d) zone)))
+
   ZoneId
   (zone [z] z)
+
   ZonedDateTime
+  (inst [zdt] (inst (instant zdt)))
   (instant [zdt] (.toInstant zdt)))

 (defprotocol ITimeArithmetic


Include the action type on defactions

Include the action type on defactions

--- src/circle/backend/action.clj
+++ src/circle/backend/action.clj
@@ -176,4 +176,5 @@
        (throw-if-not (fn? f#) "f must be a fn")
        (action
         :name act-name#
-        :act-fn f#))))
+        :act-fn f#
+        :type (-> act-map# :type)))))


Oops, Mordred is not Merlin.

Oops, Mordred is not Merlin.

--- src/clj/avalon/api/people.clj
+++ src/clj/avalon/api/people.clj
@@ -33,7 +33,7 @@

 (defn get-info [game role]
   (let [teams (:teams game)
-        evil (get-people #{:morgana :merlin :assassin :bad} teams)]
+        evil (get-people #{:morgana :mordred :assassin :bad} teams)]
     (condp = role
       :merlin (get-people #{:morgana :bad :assassin :oberon} teams)
       :percival (get-people #{:morgana :merlin} teams)


Manually add special forms to autocomplete

--- src/clj/clojuredocs/entry.clj
+++ src/clj/clojuredocs/entry.clj
@@ -70,6 +70,41 @@
                                         :column :added :static :doc :line])))]
     (clucy/add search-index nm)))

+(def special-forms
+  [{:name 'def
+    :ns "clojure.core"
+    :doc "Creates and interns or locates a global var with the name of symbol and a namespace of the value of the current namespace (*ns*). See http://clojure.org/special_forms for more information."}
+   {:name 'if
+    :ns "clojure.core"
+    :doc "Evaluates test."}
+   {:name 'do
+    :ns "clojure.core"
+    :doc "Evaluates the expressions in order and returns the value of the last. If no expressions are supplied, returns nil. See http://clojure.org/special_forms for more information."}
+   {:name 'quote
+    :ns "clojure.core"
+    :doc "Yields the unevaluated form. See http://clojure.org/special_forms for more information."}
+   {:name 'var
+    :ns "clojure.core"
+    :doc "The symbol must resolve to a var, and the Var object itself (not its value) is returned. The reader macro #'x expands to (var x). See http://clojure.org/special_forms for more information."}
+   {:name 'recur
+    :ns "clojure.core"
+    :doc "Evaluates the exprs in order, then, in parallel, rebinds the bindings of the recursion point to the values of the exprs."}
+   {:name 'throw
+    :ns "clojure.core"
+    :doc "Evaluates the exprs in order, then, in parallel, rebinds the bindings of the recursion point to the values of the exprs. "}
+   {:name 'try
+    :ns "clojure.core"
+    :doc "The exprs are evaluated and, if no exceptions occur, the value of the last is returned. If an exception occurs and catch clauses are provided, each is examined in turn and the first for which the thrown exception is an instance of the named class is considered a matching catch clause. If there is a matching catch clause, its exprs are evaluated in a context in which name is bound to the thrown exception, and the value of the last is the return value of the function. If there is no matching catch clause, the exception propagates out of the function. Before returning, normally or abnormally, any finally exprs will be evaluated for their side effects."}
+   {:name '.
+    :ns "clojure.core"
+    :doc "The '.' special form is the basis for access to Java. It can be considered a member-access operator, and/or read as 'in the scope of'."}
+   {:name 'set!
+    :ns "clojure.core"
+    :doc "Assignment special form. When the first operand is a field member access form, the assignment is to the corresponding field. If it is an instance field, the instance expr will be evaluated, then the expr. In all cases the value of expr is returned. Note - you cannot assign to function params or local bindings. Only Java fields, Vars, Refs and Agents are mutable in Clojure."}])
+
+(doseq [m special-forms]
+  (clucy/add search-index m))
+
 ;; https://gist.github.com/ck/960716
 (defn- compute-next-row
   "computes the next row using the prev-row current-element and the other seq"
@@ -102,7 +137,7 @@

 (defn lucene-escape [s]
   (-> s
-      (str/replace #"[\+\-\!\(\)\{\}\[\]\^\"\~\*\?\:\\]" "\\\\$0")))
+      (str/replace #"[\+\-\!\(\)\{\}\[\]\^\"\~\*\?\:\\\/]" "\\\\$0")))

 (defn search [query]
   (when-not (empty? query)


wrap http response

wrap http response

--- src/clj/hdfs_cleaner/core.clj
+++ src/clj/hdfs_cleaner/core.clj
@@ -30,7 +30,7 @@
 (def app-routes
   (routes
     (GET ["/scan:path", :path #"\/.+"] {{hdfs-path :path} :route-params}
-      (hdfs/scan hdfs-path))
+      (http-res/response (hdfs/scan hdfs-path)))
     (route/not-found (http-res/error 404 "Not Found"))))


symbol?

symbol?

--- src/clj/hdfs_cleaner/core.clj
+++ src/clj/hdfs_cleaner/core.clj
@@ -30,8 +30,9 @@

 (def app-routes
   (routes
-    (GET ["/scan:path", :path #"\/.+"] {{hdfs-path :path} :route-params
-                                        {max-depth :max-depth} :params}
+    (GET ["/scan:path", :path #"\/.+"]
+         {{hdfs-path :path} :route-params
+          {max-depth :depth} :query-params}
       (spy max-depth)
       (http-res/response (hdfs/scan [hdfs-path max-depth])))
     (GET "/ping" {}


log WIP

log WIP

--- src/clj/shadow/cljs/build.clj
+++ src/clj/shadow/cljs/build.clj
@@ -836,10 +836,11 @@
           ;; merge resource data & return it
           (-> (merge rc cache-data)
               (dissoc :analyzer :cache-options :age-of-deps)
-              (assoc :output (slurp cache-js))))))))
+              (assoc :cached true
+                     :output (slurp cache-js))))))))

 (defn write-cached-cljs-resource
-  [{:keys [cache-dir cljs-runtime-path] :as state} {:keys [ns name js-name] :as rc}]
+  [{:keys [ns name js-name] :as rc} {:keys [cache-dir cljs-runtime-path] :as state}]

   ;; only cache files that don't have warnings!
   (when-not (seq (:warnings rc))
@@ -887,10 +888,11 @@
                              from-jar)))]
     (or (when cache?
           (load-cached-cljs-resource state src))
-        (let [src (do-compile-cljs-resource state src)]
-          (when cache?
-            (write-cached-cljs-resource state src))
-          src))))
+        (-> (do-compile-cljs-resource state src)
+            (cond->
+              cache?
+              (write-cached-cljs-resource state))
+            (assoc :cached false)))))

 (defn merge-provides [state provided-by provides]
   (reduce
@@ -1307,7 +1309,7 @@

   ;; if only one module is defined we dont need all this work
   (if (= 1 (count modules))
-    (vals modules)
+    (vec (vals modules))
     ;; else: multiple modules must be sorted in dependency order
     (let [module-graph
           (module-graph modules)
@@ -1444,18 +1446,12 @@
         (fn [state source-name]
           (let [src (get-in state [:sources source-name])
                 compiled-src (generate-output-for-source state src)]
-            (-> state
-                (assoc-in [:sources source-name] compiled-src)
-                (cond->
-                  (not= (:compiled-at src)
-                        (:compiled-at compiled-src))
-                  (update :compiled conj source-name)
-                  ))))
-        (assoc state :compiled [])
+            (assoc-in state [:sources source-name] compiled-src)))
+        state
         source-names))))

 (defn par-compile-one
-  [state ready-ref compiled-ref errors-ref source-name]
+  [state ready-ref errors-ref source-name]
   (let [{:keys [requires] :as src}
         (get-in state [:sources source-name])]

@@ -1488,10 +1484,6 @@
             (let [{:keys [provides] :as compiled-src}
                   (generate-output-for-source state src)]

-              (when (not= (:compiled-at src)
-                          (:compiled-at compiled-src))
-                (swap! compiled-ref conj source-name))
-
               (swap! ready-ref set/union provides)
               compiled-src)
             (catch Exception e
@@ -1510,10 +1502,6 @@
             ready
             (atom #{})

-            ;; files that were actually compiled (not recycled)
-            compiled
-            (atom [])
-
             ;; source-name -> exception
             errors
             (atom {})
@@ -1524,7 +1512,7 @@
             tasks
             (->> (for [source-name source-names]
                    ;; bound-fn for with-compiler-state
-                   (let [task-fn (bound-fn [] (par-compile-one state ready compiled errors source-name))]
+                   (let [task-fn (bound-fn [] (par-compile-one state ready errors source-name))]
                      (.submit exec ^Callable task-fn)))
                  (doall) ;; force submit all, then deref
                  (into [] (map deref)))]
@@ -1548,7 +1536,7 @@
                                    (assoc sources name src))
                                  sources
                                  tasks)))
-            (assoc :compiled @compiled))))))
+            )))))

 (defn compile-sources
   [{:keys [n-compile-threads] :as state} source-names]
@@ -1565,10 +1553,8 @@

 (defn do-compile-modules
   "compiles source based on :build-modules (created by prepare-modules)"
-  [{:keys [build-modules] :as state}]
-  (let [source-names
-        (into [] (mapcat :sources build-modules))]
-    (compile-sources state source-names)))
+  [{:keys [build-sources] :as state}]
+  (compile-sources state build-sources))

 (defn prepare-compile
   "prepares for compilation (eg. create source lookup index, runtime-setup)"
@@ -1589,7 +1575,9 @@

         modules
         (sort-and-compact-modules state)]
-    (assoc state :build-modules modules)))
+    (assoc state
+      :build-modules modules
+      :build-sources (into [] (mapcat :sources modules)))))

 (defn compile-modules
   "compiles according to configured :modules"


enforce scope in budget index page

enforce scope in budget index page

--- src/clj_money/web/budgets.clj
+++ src/clj_money/web/budgets.clj
@@ -14,6 +14,7 @@
             [clj-money.inflection :refer [humanize]]
             [clj-money.util :refer [format-number format-date]]
             [clj-money.validation :as validation]
+            [clj-money.authorization :refer [apply-scope]]
             [clj-money.models.accounts :as accounts]
             [clj-money.models.budgets :as budgets]
             [clj-money.web.money-shared :refer [grouped-options-for-accounts]])
@@ -64,7 +65,10 @@
          [:th.text-right "Start date"]
          [:th.text-right "End date"]
          [:th " "]]
-        (map budget-row (budgets/select-by-entity-id (env :db) (:id entity)))]
+        (map budget-row (budgets/search (env :db)
+                                        (apply-scope {:entity-id (:id entity)}
+                                                     :budget
+                                                     (env :db))))]
        [:a.btn.btn-primary {:href (format "/entities/%s/budgets/new" (:id entity))}
         "Add"]]])))


redeploy route def

redeploy route def

--- src/cljc/swarmpit/routes.cljc
+++ src/cljc/swarmpit/routes.cljc
@@ -32,7 +32,8 @@
                                          "/networks" :service-networks
                                          "/tasks"    :service-tasks}}
                          :delete {[:id] :service-delete}
-                         :post   {[:id] :service-update}}
+                         :post   {[:id] {""          :service-update
+                                         "/redeploy" :service-redeploy}}}
        "/networks"      {:get  :networks
                          :post :network-create}
        "/networks/"     {:get    {[:id] :network}


move remaining debug functionality to dev tab #10

--- src/cljs/go_client/views.cljs
+++ src/cljs/go_client/views.cljs
@@ -72,11 +72,18 @@
        :children [[current-game-title @game-title]
                   [game-board @game-id @placed-stones @empty-vertices @playable-stones]]])))

+(defn state-panel [{:keys [connected? logged-user]}]
+  [re-com/v-box
+   :children [[:p (str "connected to server: " (if connected? "Y" "N"))]
+              [:p (str "user: " (or logged-user "N/A"))]]])
+
 (defn development-panel []
-  [re-com/v-box
-   :children [[:p {:on-click #(re-frame/dispatch [:send-event-to-server [:util/echo "echo"]])} "echo"]
-              [:p {:on-click #(re-frame/dispatch [:log-into-server "rafael"])} "login"]
-              [:p {:on-click #(re-frame/dispatch [:logout-from-server])} "logout"]]])
+  (let [server-state (re-frame/subscribe [:server-state])]
+    [re-com/v-box
+     :children [[state-panel @server-state]
+                [:p {:on-click #(re-frame/dispatch [:send-event-to-server [:util/echo "echo"]])} "echo"]
+                [:p {:on-click #(re-frame/dispatch [:log-into-server "rafael"])} "login"]
+                [:p {:on-click #(re-frame/dispatch [:logout-from-server])} "logout"]]]))

 ;; --------------------
 (defmulti panels identity)
@@ -88,11 +95,6 @@
 (defmethod panels :default [] [:div])

-(defn state-panel [{:keys [connected? logged-user]}]
-  [re-com/v-box
-   :children [[:p (str "connected to server: " (if connected? "Y" "N"))]
-              [:p (str "user: " (or logged-user "N/A"))]]])
-
 (def tabs-definition
   [{:id :development-panel :label "Development"}
    {:id :home-panel :label "Home"}
@@ -101,10 +103,6 @@
    {:id :game-panel :label "Game"}])

 (defn header []
-  (let [server-state (re-frame/subscribe [:server-state])]
-    (fn [] [state-panel @server-state])))
-
-(defn tabs []
   (let [selected-panel (re-frame/subscribe [:active-panel])]
     [re-com/horizontal-tabs
      :model selected-panel
@@ -117,5 +115,4 @@
       [re-com/v-box
        :height "100%"
        :children [[header]
-                  [tabs]
                   (panels @active-panel)]])))


Delete unused file.

Delete unused file.

--- src/cljs/vinculum/weight.cljs
+++ src/cljs/vinculum/weight.cljs
@@ -1,41 +0,0 @@
-(ns vinculum.weight)
-
-;;   google.load('visualization', '1', {packages: ['corechart']});
-;;     google.setOnLoadCallback(drawChart);
-
-;;     function drawChart() {
-;; /*
-;;       var data = new google.visualization.DataTable();
-
-;;       data.addColumn('date', 'X');
-;;       data.addColumn('number', 'Dogs');
-;;       data.addColumn('number', 'Cats');
-
-;;       data.addRows([[new Date('2015-01-01'), 2, 3],
-;;                     [new Date('2015-01-02'), 6, 9],
-;;                     [new Date('2015-01-03'), 2, 19]]);
-;;         */
-;;     var data = google.visualization.arrayToDataTable([
-;;         ['Number', 'Age'],
-;;         [new Date('2015-01-01'), 8],
-;;         [new Date('2015-01-02'), 13],
-;;         [new Date('2015-01-19'), 23]]);
-
-;;       var options = {
-;;         width: 1000,
-;;         height: 563,
-;;         hAxis: {
-;;           title: 'Time'
-;;         },
-;;         vAxis: {
-;;           title: 'Popularity'
-;;         },
-;;         colors: ['#AB0D06', '#007329'],
-;;         trendlines: { 0: {visibleInLegend: true}}
-;;       };
-
-;;       var chart = new google.visualization.LineChart(document.getElementById('ex7'));
-
-;;       chart.draw(data, options);
-
-;


remove cljs? debug message

remove cljs? debug message

--- src/clj/speclj/core.clj
+++ src/clj/speclj/core.clj
@@ -4,8 +4,6 @@
   (:require [clojure.data]))

 (def ^:private cljs? (boolean (find-ns 'cljs.analyzer)))
-
-(println "cljs?: " cljs?)

 (defmacro -new-exception
   ([] (if cljs? `(js/Error.) `(java.lang.Exception.)))


Add type annotation to with-graphics (#288)

Add type annotation to with-graphics macro

--- src/cljc/quil/core.cljc
+++ src/cljc/quil/core.cljc
@@ -4533,7 +4533,7 @@
   graphics. 'with-graphics' cannot be nested (you can draw simultaneously
   only on 1 graphics)"
   [graphics & body]
-  `(let [gr# ~graphics]
+  `(let [^PGraphics gr# ~graphics]
      (binding [quil.core/*graphics* gr#]
        (.beginDraw gr#)
        ~@body


In order to have same behaviour as in clj always use `color-mode` with range 255 in cljs.

--- src/cljc/quil/core.cljc
+++ src/cljc/quil/core.cljc
@@ -964,10 +964,10 @@
   parameters range1, range2, range3, and range 4."
   ([mode]
    (let [mode (u/resolve-constant-key mode color-modes)]
-     (.colorMode (current-graphics) mode)))
+     (.colorMode (current-graphics) mode #?(:cljs 255))))
   ([mode max]
    (let [mode (u/resolve-constant-key mode color-modes)]
-     (.colorMode (current-graphics) mode) (float max)))
+     (.colorMode (current-graphics) mode (float max))))
   ([mode max-x max-y max-z]
    (let [mode (u/resolve-constant-key mode color-modes)]
      (.colorMode (current-graphics) mode (float max-x) (float max-y) (float max-z))))


remove cases in extend-type nil where we refer to data types, regular fns now do this work

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -443,18 +443,11 @@
   IEmptyableCollection
   (-empty [_] nil)

-  ICollection
-  (-conj [_ o] (list o))
-
   IIndexed
   (-nth
    ([_ n] nil)
    ([_ n not-found] not-found))

-  ISeq
-  (-first [_] nil)
-  (-rest [_] (list))
-
   INext
   (-next [_] nil)

@@ -462,9 +455,6 @@
   (-lookup
    ([o k] nil)
    ([o k not-found] not-found))
-
-  IAssociative
-  (-assoc [_ k v] (hash-map k v))

   IMap
   (-dissoc [_ k] nil)
@@ -824,11 +814,13 @@
   'added'. (conj nil item) returns (item).  The 'addition' may
   happen at different 'places' depending on the concrete type."
   ([coll x]
-     (-conj coll x))
+    (if-not (nil? coll)
+      (-conj coll x)
+      (list x)))
   ([coll x & xs]
-     (if xs
-       (recur (conj coll x) (first xs) (next xs))
-       (conj coll x))))
+    (if xs
+      (recur (conj coll x) (first xs) (next xs))
+      (conj coll x))))

 (defn empty
   "Returns an empty collection of the same category as coll, or nil"
@@ -899,7 +891,9 @@
    val(s). When applied to a vector, returns a new vector that
    contains val at index."
   ([coll k v]
-     (-assoc coll k v))
+    (if-not (nil? coll)
+      (-assoc coll k v)
+      (hash-map k v)))
   ([coll k v & kvs]
      (let [ret (assoc coll k v)]
        (if kvs
@@ -2863,9 +2857,11 @@
   "Returns a new coll consisting of to-coll with all of the items of
   from-coll conjoined."
   [to from]
-  (if (satisfies? IEditableCollection to)
-    (persistent! (reduce -conj! (transient to) from))
-    (reduce -conj to from)))
+  (if-not (nil? to)
+    (if (satisfies? IEditableCollection to)
+      (persistent! (reduce -conj! (transient to) from))
+      (reduce -conj to from))
+    (reduce conj () from)))

 (defn mapv
   "Returns a vector consisting of the result of applying f to the
@@ -3355,7 +3351,7 @@
   IAssociative
   (-assoc [coll key val]
     (let [v-pos (+ start key)]
-      (build-subvec meta (-assoc v v-pos val)
+      (build-subvec meta (assoc v v-pos val)
                start (max end (inc v-pos))
                nil)))

@@ -3593,7 +3589,7 @@
   (-meta [coll] meta)

   ISeq
-  (-first [coll] (-first front))
+  (-first [coll] (first front))
   (-rest  [coll]
     (if-let [f1 (next front)]
       (PersistentQueueSeq. meta f1 rear nil)
@@ -3633,7 +3629,7 @@
   (-rest [coll] (rest (seq coll)))

   IStack
-  (-peek [coll] (-first front))
+  (-peek [coll] (first front))
   (-pop [coll]
     (if front
       (if-let [f1 (next front)]
@@ -5700,7 +5696,7 @@

   ICollection
   (-conj [coll o]
-    (PersistentHashSet. meta (-assoc hash-map o nil) nil))
+    (PersistentHashSet. meta (assoc hash-map o nil) nil))

   IEmptyableCollection
   (-empty [coll] (with-meta cljs.core.PersistentHashSet/EMPTY meta))


fix typo

fix typo

--- src/cljs/cljs/core.cljs
+++ src/cljs/cljs/core.cljs
@@ -18,7 +18,7 @@
 (def *unchecked-if* false)

 (def
-  ^{:doc "Each runtime environment provides a diffenent way to print output.
+  ^{:doc "Each runtime environment provides a different way to print output.
   Whatever function *print-fn* is bound to will be passed any
   Strings which should be printed." :dynamic true}
   *print-fn*


now with a slight pause before the workout

--- src/cljs/moon/core.cljs
+++ src/cljs/moon/core.cljs
@@ -135,8 +135,13 @@
   (let [state-channel (chan)
         completed-channel (chan)
         clock-channel (wall-clock)]
-    (progressor clock-channel state-channel)
-    (onto-chan state-channel workout)))
+    (go (<! (go-loop [i 10]
+              (<! clock-channel)
+              (play (done? i))
+              (when (> i 0)
+                (recur (dec i)))))
+        (progressor clock-channel state-channel)
+        (onto-chan state-channel workout))))

 (defn add-id [workout]
   (map-indexed (fn [i coll] (assoc coll :id i)) workout))


abit more refactoring

abit more refactoring

Former-commit-id: 9179cc61b45dd5c42a496cafdcb46ef411150758

--- src/status_im/chat/views/message_input.cljs
+++ src/status_im/chat/views/message_input.cljs
@@ -34,25 +34,28 @@
 (defn message-input-container [input]
   [view st/message-input-container input])

+(def plain-input-options
+  {:style           st-message/message-input
+   :onChangeText    plain-message/set-input-message
+   :onSubmitEditing plain-message/send})
+
+(def command-input-options
+  {:style           st-response/command-input
+   :onChangeText    command/set-input-message
+   :onSubmitEditing command/send-command})
+
 (defview message-input [input-options]
   [command? [:animations :command?]
    input-message [:get-chat-input-text]
    input-command [:get-chat-command-content]]
-  [text-input (merge {:style           (if command?
-                                         st-response/command-input
-                                         st-message/message-input)
-                      :ref             #(dispatch [:set-message-input %])
-                      :autoFocus       false
-                      :blurOnSubmit    false
-                      :onChangeText    (if command?
-                                         command/set-input-message
-                                         plain-message/set-input-message)
-                      :onSubmitEditing (if command?
-                                         command/send-command
-                                         plain-message/send)}
-                     (when command?
-                       {:accessibility-label :command-input})
-                     input-options)
+  [text-input (merge
+                (if command?
+                  command-input-options
+                  plain-input-options)
+                {:autoFocus           false
+                 :blurOnSubmit        false
+                 :accessibility-label :input}
+                input-options)
    (if command? input-command input-message)])

 (defview plain-message-input-view [{:keys [input-options validator]}]


Fix shutdown

Fix shutdown

Use to spew errors and not shutdown cleanly because it didn't close the
control channel.  The receive channel takes care of itself once the
control channel closes down.

--- src/rente/ws.clj
+++ src/rente/ws.clj
@@ -50,13 +50,12 @@
           :ch-recv ch-recv
           :connected-uids connected-uids
           :send-fn send-fn
-          :stop-the-thing (sente/start-chsk-router! ch-recv event-msg-handler*)
+          :stop-fn (sente/start-chsk-router! ch-recv event-msg-handler*)
           :ring-handlers
           (->WSRingHandlers ajax-post-fn ajax-get-or-ws-handshake-fn)))))
   (stop [component]
-    (when ch-recv (async/close! ch-recv))
+    (when-let [stop-fn (:stop-fn component)] (stop-fn))
     (log/debug "WebSocket connection stopped")
-    (:stop-the-thing component)
     (assoc component
       :ch-recv nil :connected-uids nil :send-fn nil :ring-handlers nil)))

@@ -74,6 +73,3 @@

 (defn new-ws-connection []
   (map->WSConnection {}))
-
-
-


Removed obsolete macro with-swing-threads

do-swing from clojure.contrib.swing does the same.

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

--- src/conexp/gui/util.clj
+++ src/conexp/gui/util.clj
@@ -58,11 +58,6 @@
   [fn]
   (SwingUtilities/invokeAndWait fn))

-(defmacro with-swing-threads
-  "Executes body with invoke-later to make it thread-safe to Swing."
-  [& body]
-  `(invoke-later #(do ~@body)))
-
 (defn get-resource
   "Returns the resource res if found, nil otherwise."
   [res]
@@ -76,6 +71,8 @@
   "Returns menubar of given frame."
   [frame]
   (get-component frame #(= (class %) JMenuBar)))
+
+;; convert menus to hash-maps and vice versa

 (declare hash-to-menu)

@@ -119,18 +116,20 @@
   "Adds the additional menus to the frame in front of the first Box.Filler
   found in the menu-bar of frame."
   [frame menus]
-  (with-swing-threads
-    (let [menu-bar (get-menubar frame)
-	  menu-bar-as-seq (.getComponents menu-bar)
-	  menu-entries-before-filler (take-while #(not (instance? javax.swing.Box$Filler %))
-						 menu-bar-as-seq)
-	  menu-entries-from-filler   (drop-while #(not (instance? javax.swing.Box$Filler %))
-						 menu-bar-as-seq)]
-      (.removeAll menu-bar)
-      (add-menus-to-menubar frame menu-entries-before-filler)
-      (add-menus-to-menubar frame menus)
-      (add-menus-to-menubar frame menu-entries-from-filler)
-      (.validate frame))))
+  (do-swing
+   (let [menu-bar (get-menubar frame)
+	 menu-bar-as-seq (.getComponents menu-bar)
+	 menu-entries-before-filler (take-while #(not (instance? javax.swing.Box$Filler %))
+						menu-bar-as-seq)
+	 menu-entries-from-filler   (drop-while #(not (instance? javax.swing.Box$Filler %))
+						menu-bar-as-seq)]
+     (.removeAll menu-bar)
+     (add-menus-to-menubar frame menu-entries-before-filler)
+     (add-menus-to-menubar frame menus)
+     (add-menus-to-menubar frame menu-entries-from-filler)
+     (.validate frame))))
+
+;;

 (defvar --- {}
   "Separator for menu entries used in add-menus.")
@@ -182,9 +181,9 @@
 (defn add-icons
   "Adds icons to toolbar of frame."
   [frame icons]
-  (with-swing-threads
-    (add-to-toolbar frame (get-toolbar frame) icons)
-    (.validate frame)))
+  (do-swing
+   (add-to-toolbar frame (get-toolbar frame) icons)
+   (.validate frame)))

 (defvar | {}
   "Separator for icons in toolbars used in add-icons.")
@@ -257,13 +256,13 @@
 (defn add-tab
   "Addes given panel to the tabpane of frame with given title, if given."
   ([frame pane title]
-     (with-swing-threads
-       (let [#^JTabbedPane tabpane (get-tabpane frame)]
-	 (.add tabpane pane)
-	 (let [index (.indexOfComponent tabpane pane)]
-	   (.setTabComponentAt tabpane index (make-tab-head tabpane pane title))
-	   (.setSelectedIndex tabpane index)))
-       (.validate frame)))
+     (do-swing
+      (let [#^JTabbedPane tabpane (get-tabpane frame)]
+	(.add tabpane pane)
+	(let [index (.indexOfComponent tabpane pane)]
+	  (.setTabComponentAt tabpane index (make-tab-head tabpane pane title))
+	  (.setSelectedIndex tabpane index)))
+      (.validate frame)))
   ([frame pane]
      (add-tab frame pane "")))


fix fragment macro, resolves #227

fix fragment macro, resolves #227

--- src/rum/core.clj
+++ src/rum/core.clj
@@ -431,7 +431,7 @@

 (defmacro fragment
   "(rum/fragment [button] [input] ...)"
-  [{:keys [key] :as attrs} & children]
+  [attrs & children]
   (let [[attrs children] (if (map? attrs)
                            [attrs children]
                            [nil (concat [attrs] children)])]


fix defcontext macro, resolves #214

fix defcontext macro, resolves #214

--- src/rum/core.clj
+++ src/rum/core.clj
@@ -335,7 +335,7 @@
      `(def ~(with-meta name {:dynamic true}))))
   ([name value]
    (if (:ns &env)
-     `(def ~(with-meta name {:dynamic true}) (let [ctx# (create-context value)]
+     `(def ~(with-meta name {:dynamic true}) (let [ctx# (create-context ~value)]
                                                (set! (.-displayName ctx#) ~(sym->context-name name &env))
                                                ctx#))
      `(def ~(with-meta name {:dynamic true}) ~value))))


only pull in 'in-osc-bundle' - neatonk's commit was better :-)

--- src/overtone/sc/server.clj
+++ src/overtone/sc/server.clj
@@ -8,7 +8,7 @@
   (:use [overtone.libs event]
         [overtone.sc.machinery.server connection comms ]
         [overtone.util.lib :only [deref!]]
-        [overtone.osc])
+        [overtone.osc :only [in-osc-bundle]])
   (:require [overtone.util.log :as log]))

 (def OVERTONE-VERSION {:major 0


update comments

update comments

--- src/v/hophacks2016/babluki_np_extractor.clj
+++ src/v/hophacks2016/babluki_np_extractor.clj
@@ -7,6 +7,9 @@

 ;; I think the key insights are optimized (faster/simpler) tagging and
 ;; then custom noun-phrase chunking
+
+;; Main point is to not do full parsing that identifies VP in addition
+;; to NP and all the other stuff, but to just quickly scan for NP

 (def path-prefix (case (System/getProperty "user.dir")
                    "/home/bmillare/dj/usr/src/dj.scratch"


more than the first stuff is executed. reduce and merge corpus next

--- src/crawler/execute.clj
+++ src/crawler/execute.clj
@@ -43,4 +43,7 @@

   ([start-url {action-seqs :action-seq pagination :pagination} limit]
      (let [planned-model (plan-model action-seqs)]
-       (execute-model start-url (reverse (first (first planned-model))) pagination limit))))
+       (map
+        (fn [[a-seq estimate]]
+          (execute-model start-url (reverse a-seq) pagination limit))
+        planned-model))))


thru rm_cmn_profile_enterprise

thru rm_cmn_profile_enterprise

--- src/pg_demo/table_defs.clj
+++ src/pg_demo/table_defs.clj
@@ -3346,6 +3346,26 @@
               PRIMARY KEY (ID)
           ); " }

+    { "rm_cmn_profile_enterprise"
+          "CREATE TABLE rm_cmn_profile_enterprise (
+              ENTERPRISE_ID numeric NOT NULL,
+              SECTION varchar(300) NOT NULL,
+              KEY varchar(300) NOT NULL,
+              VALUE varchar(1000),
+              TREE_NAME varchar(100),
+              KEY_TYPE numeric(2),
+              KEY_LABEL varchar(500),
+              KEY_OPTIONS varchar(1000),
+              LINK_TABLE varchar(100),
+              LINK_COLUMN_SEQ varchar(100),
+              LINK_COLUMN_DISPLAY varchar(100),
+              HELP_TEXT_TREE_NAME varchar(300),
+              NEXT_KEY varchar(300),
+              SORT_ORDER numeric,
+              DELETED timestamp,
+              PRIMARY KEY (ENTERPRISE_ID,SECTION,KEY)
+          ); " }
+
   ] ))

 (def dummy


wip: execution - declare execute-fields

wip: execution - declare execute-fields

--- src/graphql_clj/execution.clj
+++ src/graphql_clj/execution.clj
@@ -95,6 +95,8 @@
                   (map (arg-fn default-args vars))
                   (into {}))]
     (merge default-args args)))
+
+(declare execute-fields)

 (defn- resolve-field-value
   "6.4.2 Value Resolution


Fix possible deadlock in await job completion.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -31,14 +31,14 @@
   (future
     (loop []
       (let [ch (chan 1)
-            task-path (extensions/resolve-node sync :task job-id)
-            task-nodes (extensions/bucket-at sync :task job-id)
-            task-nodes (filter #(not (impl/completed-task? %)) task-nodes)]
+            task-path (extensions/resolve-node sync :task job-id)]
         (extensions/on-child-change sync task-path (fn [_] (>!! ch true)))
-        (if (every? (partial impl/task-complete? sync) task-nodes)
-          true
-          (do (<!! ch)
-              (recur)))))))
+        (let [task-nodes (extensions/bucket-at sync :task job-id)
+              task-nodes (filter #(not (impl/completed-task? %)) task-nodes)]
+          (if (every? (partial impl/task-complete? sync) task-nodes)
+            true
+            (do (<!! ch)
+                (recur))))))))

 ;; A coordinator that runs strictly in memory. Peers communicate with
 ;; the coordinator by directly accessing its channels.


Register with live.

Register with live.

--- src/onyx/api.clj
+++ src/onyx/api.clj
@@ -106,7 +106,7 @@
                    (let [rets
                          (try
                            (let [live (component/start v-peer)]
-                             (register-peer coord (:node (:peer (:peer v-peer))))
+                             (register-peer coord (:node (:peer (:peer live))))

                              (let [restart-ch (:dead-restart-tail-ch (:peer live))
                                    [v ch] (alts!! [stop-ch restart-ch] :priority true)]


Drop the :added metadata from clojure.string

--- src/str/core.clj
+++ src/str/core.clj
@@ -18,7 +18,7 @@
          (def ~name))
        ;; When copying metadata, disregard {:macro false}.
        ;; Workaround for http://www.assembla.com/spaces/clojure/tickets/273
-       #(conj (dissoc % :macro)
+       #(conj (dissoc % :macro :added)
               (apply dissoc (meta (var ~orig)) (remove #{:macro} (keys %)))))
       (var ~name)))
   ([name orig doc]
@@ -581,4 +581,4 @@
    (case algorithm
      :lehvenstein (distance s1 s2)
      :hamming (hamming-distance s1 s2)
-     (throw (IllegalArgumentException. (str "Unknown algorithm: " algorithm) )))))
+     (throw (IllegalArgumentException. (str "Unknown algorithm: " algorithm))))))


Change init route

Change init route

--- src/discuss/config.cljs
+++ src/discuss/config.cljs
@@ -5,7 +5,7 @@
 (def user "Q2hyaXN0aWFu")

 (def api {:host "http://172.18.0.3/"
-          :init "api/"
+          :init "api/elektroautos"
           :base "api/"
           :add  {:add-start-statement "add/start_statement"
                  :add-start-premise   "add/start_premise"


fix movement, remove unused method

fix movement, remove unused method

--- src/dodgeball/core.cljs
+++ src/dodgeball/core.cljs
@@ -42,10 +42,6 @@

 (defn coords [m]
   (dissoc m :move))
-
-(defn all-units [cells]
-  (let [{:keys [:blue-team :red-team :balls] :as units} (:cells (om/root-cursor app-state))]
-  units))

 (defn red-unit? [x y]
   (let [{:keys [:red-team]} (:cells (om/root-cursor app-state))]
@@ -118,8 +114,8 @@
               (om/transact! app [:cells :red-team]
                 (fn [units]
                   (map
-                    #(if (= selected %) target %)
-                    units)))))
+                   #(if (= selected %) target %)
+                   units)))))
           (recur)))))

     om/IRenderState
@@ -130,7 +126,7 @@
           (vec (for [y board-size]
             (apply dom/tr #js {:className (border-top y)}
               (vec (for [x board-size]
-                (om/build tile-view all-units
+                (om/build tile-view app
                   {:state {:move move :x x :y y}})))))))
         (bench)))))


Revert "Implement copy-directory! using nio/walk-file-tree"

This reverts commit 7aeeb24c9f8b88482c703968a2d260fe0e8bf526.

--- src/mdr2/util.clj
+++ src/mdr2/util.clj
@@ -3,8 +3,7 @@
   (:require [org.tobereplaced.nio.file :as nio]
             [clojure.tools.logging :as log])
   (:import (java.nio.file FileSystemException
-                          DirectoryNotEmptyException
-                          FileVisitResult)
+                          DirectoryNotEmptyException)
            java.lang.InterruptedException))

 (def ^:private delete-retry-millis 100)
@@ -48,14 +47,3 @@
     (catch FileSystemException e
       (log/error e))))

-(defn copy-directory!
-  "Copy a directory from `from` to `to` recursively"
-  [from to]
-  (let [copy (fn [path]
-               (nio/copy! path (nio/resolve-path to (nio/relativize from path)))
-               FileVisitResult/CONTINUE)]
-    (nio/walk-file-tree
-     from
-     (nio/naive-visitor
-      :pre-visit-directory copy
-      :visit-file copy))))


Fixed issue with extraction of votes from 'batches'

--- src/polismath/conv_man.clj
+++ src/polismath/conv_man.clj
@@ -269,8 +269,9 @@
               msgs      (take-all! msgbox)
               msgs      (concat [first-msg] msgs)
               {:keys [votes moderation]}
-                        (group-by first msgs)]
-          (swap! conv update-fn votes err-handler))
+                        (group-by first msgs)
+              vote-batches (map second votes)]
+          (swap! conv update-fn vote-batches err-handler))
         (catch Exception e
           (log/error "Excpetion not handler by err-handler:" e)
           (.printStackTrace e)))


Formatting or removing useless comment.

Formatting or removing useless comment.

--- src/app/cljs/one/sample/view.cljs
+++ src/app/cljs/one/sample/view.cljs
@@ -223,7 +223,7 @@
     ;; display the inputs
     (append! fnd (str "
Input the arguments - Arity - " arity "
"))

-    ;; find a way to use the templating... enlive?!
+    ;; find a way to use the templating...
     (dorun (map #(append! fnd (let [n (str fnar "-" (str %))]
                                 (str
                                  "
"
@@ -232,7 +232,8 @@
                                  "<input id='id-fn-" n "' size='30' type= 'text'/>"
                                  ""
                                  "

"
-                                 "
"))) args))
+                                 "
")))
+                args))
     ;; display the button run
     (append! fnd (str "
<input type='button' id='run-button-" fnar
                       "' value='run!' />
"))


This should work inside uberjar

This should work inside uberjar

--- src/notv/core.clj
+++ src/notv/core.clj
@@ -21,8 +21,8 @@

 (defn get-revision
   []
-  (if-let [file (io/file (io/resource "gitrevision.txt"))]
-    file
+  (if-let [file (io/resource "gitrevision.txt")]
+    (slurp file)
     "local"))

 (defroutes app


Cleaned up some of the parsing functions

--- src/extracter/parse.clj
+++ src/extracter/parse.clj
@@ -7,11 +7,11 @@
 (def doc-parser (insta/parser (io/resource "doc.bnf")))

 (defn parse
-  "Parse x (file or string) using the CFG for comment docs. If the result is nil, log that."
-  [x]
-  (if-let [result (doc-parser x)]
+  "Parse s using the CFG for comment docs. If the result is nil, log that."
+  [^String s]
+  (if-let [result (doc-parser s)]
     result
-    (println "Error while parsing:" x)))
+    (println "Error while parsing:" s)))

 (defn code?
   [s]
@@ -51,8 +51,6 @@
   [^String path]
   (->> path
        files/facts-in-dir
-       (map slurp-comments)
-       (pmap parse)
-       (map (partial insta/transform transformations))
+       (pmap (comp (partial insta/transform transformations) parse slurp-comments))
        flatten
        (filter :title))) ;; we don't want "facts" with nil values


re-implement inspection tasks.

re-implement inspection tasks.

--- src/leiningen/ancient/get.clj
+++ src/leiningen/ancient/get.clj
@@ -1,13 +1,11 @@
-(ns ^{ :doc "List artifact version information."
-       :author "Yannick Scherer" }
-  leiningen.ancient.get
-  (:require [leiningen.ancient.utils.projects :refer [collect-repositories]]
-            [leiningen.ancient.utils.cli :refer [parse-cli]]
-            [leiningen.ancient.utils.io :refer [with-output-settings]]
-            [ancient-clj.verbose :refer :all]
-            [ancient-clj.core :as anc]
-            [version-clj.core :as v]
-            [ancient-clj.repository :refer [retrieve-latest-version-string!]]))
+(ns leiningen.ancient.get
+  (:refer-clojure :exclude [get])
+  (:require [leiningen.ancient
+             [utils :as utils]
+             [verbose :refer :all]]
+            [jansi-clj.core :as color]
+            [ancient-clj.core :as ancient]
+            [version-clj.core :as v]))

 (def ^:private ^:const WIDTH
   "Maximum width of labels for `:get`."
@@ -19,7 +17,7 @@
   (when v
     (print (str "  * " label ": "))
     (print (apply str (repeat (- WIDTH (count label)) \space)))
-    (print (green "\"" (first v) "\""))
+    (print (color/green "\"" (:version-string v) "\""))
     (println)))

 (defn- print-version-seq
@@ -30,7 +28,7 @@
           indent (apply str (repeat (+ 8 WIDTH) \space))
           label (if (>= c WIDTH) (str label ":") (str label ":" (apply str (repeat (- WIDTH c) \space))))]
       (print (str "  * " label " [ "))
-      (let [vps (partition 5 5 nil (map first vs))]
+      (let [vps (partition 5 5 nil (map :version-string vs))]
         (doseq [v (first vps)] (print (pr-str v) ""))
         (doseq [vp (rest vps)]
           (println)
@@ -38,46 +36,53 @@
           (doseq [v vp] (print (pr-str v) ""))))
       (println "]"))))

-(defn- wrap-version-retrieval-task
-  [f task-name]
-  (let [error-msg (format "'%s' expects an artifact to retrieve version information for." task-name)]
-    (fn [project [package & args]]
-      (if-not package
-        (println error-msg)
-        (let [settings (assoc (parse-cli args) :aggressive? true)
-              artifact (anc/artifact-map [package "RELEASE"])]
-          (with-output-settings settings
-            (let [repos (collect-repositories project)]
-              (f settings repos package artifact))))))))
+(defn- print-all-versions
+  [vs]
+  (let [releases (filter (complement (comp v/qualified? :version)) vs)
+        snapshots (filter (comp v/snapshot? :version) vs)
+        qualified (filter (comp  #(and (not (v/snapshot? %)) (v/qualified? %)) :version) vs)]
+    (println)
+    (println (str "  * " (count vs) " version(s) found."))
+    (print-version "latest release" (first releases))
+    (print-version "latest SNAPSHOT" (first snapshots))
+    (print-version "latest qualified" (first qualified))
+    (print-version-seq "all releases" releases)
+    (print-version-seq "all SNAPSHOTs" snapshots)
+    (print-version-seq "all qualified versions" qualified)
+    (println)))

-(def run-get-task!
-  (->
-    (fn [settings repos package {:keys [group-id artifact-id] :as artifact}]
-      (let [artifact-str (str group-id "/" artifact-id)
-            settings (assoc settings :snapshots? true :qualified? true)]
-        (println "Getting Version Information for" (yellow artifact-str)
-                 "from" (count repos) "Repositories ...")
-        (let [vs (->> (anc/versions! settings repos artifact)
-                      (sort #(v/version-seq-compare (second %1) (second %2)))
-                      (reverse))]
-          (if-not (seq vs)
-            (println "No versions found.")
-            (let [releases (filter (complement (comp v/qualified? second)) vs)
-                  snapshots (filter (comp v/snapshot? second) vs)
-                  qualified (filter (comp  #(and (not (v/snapshot? %)) (v/qualified? %)) second) vs)]
-              (println (str "  * " (count vs) " version(s) found."))
-              (print-version "latest release" (first releases))
-              (print-version "latest SNAPSHOT" (first snapshots))
-              (print-version "latest qualified" (first qualified))
-              (print-version-seq "all releases" releases)
-              (print-version-seq "all SNAPSHOTs" snapshots)
-              (print-version-seq "all qualified versions" qualified))))))
-    (wrap-version-retrieval-task "get")))
+(utils/deftask get
+  {:docstring "List all versions for a given artifact."
+   :exclude [:all :allow-all :allow-snapshots :allow-qualified
+             :check-clojure :interactive :plugins :no-profiles
+             :no-tests :tests :print :recursive]
+   :fixed {:snapshots? true
+           :qualified? true
+           :dependencies? true
+           :plugins? true}}
+  [{:keys [artifact-opts args]}]
+  (if-let [artifact' (first args)]
+    (let [{:keys [symbol] :as artifact} (ancient/read-artifact artifact')]
+      (verbosef "retrieving versions for %s from %d repositories ..."
+                (color/yellow symbol)
+                (count (:repositories artifact-opts)))
+      (let [vs (ancient/versions! artifact artifact-opts)]
+        (if (seq vs)
+          (print-all-versions vs)
+          (verbosef "no versions found."))))
+    (errorf "no artifact coordinates given.")))

-(def run-latest-vector-task!
-  (->
-    (fn [settings repos package {:keys [group-id artifact-id]}]
-      (if-let [latest (retrieve-latest-version-string! settings repos group-id artifact-id)]
-        (println (format "[%s \"%s\"]" package latest))
-        (println "No versions found.")))
-    (wrap-version-retrieval-task "latest")))
+(utils/deftask latest
+  {:docstring "List all versions for a given artifact."
+   :exclude [:all :check-clojure :interactive :plugins
+             :no-profiles :no-tests :tests :print :recursive]
+   :fixed {:dependencies? true
+           :plugins? true}}
+  [{:keys [artifact-opts args]}]
+  (if-let [artifact' (first args)]
+    (let [{:keys [symbol] :as artifact} (ancient/read-artifact artifact')
+          vs (ancient/latest-version-string! artifact artifact-opts)]
+      (if vs
+         (println (format "[%s %s]" symbol (pr-str vs)))
+         (println "no versions found.")))
+    (errorf "no artifact coordinates given.")))


added github.clj to render list

added github.clj to render list

--- src/leiningen/new/cryogen.clj
+++ src/leiningen/new/cryogen.clj
@@ -46,4 +46,5 @@
                ["src/cryogen/rss.clj" (render "src/cryogen/rss.clj")]
                ["src/cryogen/server.clj" (render "src/cryogen/server.clj")]
                ["src/cryogen/sitemap.clj" (render "src/cryogen/sitemap.clj")]
-               ["src/cryogen/watcher.clj" (render "src/cryogen/watcher.clj")]))))
+               ["src/cryogen/watcher.clj" (render "src/cryogen/watcher.clj")]
+               ["src/cryogen/github.clj" (render "src/cryogen/github.clj")]))))


comments

comments

--- src/hangman/triples.clj
+++ src/hangman/triples.clj
@@ -265,17 +265,15 @@
 ;;
 ;;   => #<Graph e9a62310-7238-1195-8101-7831c1bbb832 (2 triples)>

-
 ;; (with-context #{[1 2 3]}
 ;;   (query (graph *context*) 1 2 nil))
 ;;
 ;;  => #{[1 2 3]}

-
- (with-context (select (graph #{[1 2 3] [4 5 6]}) [nil nil nil])
-   (triples (select (graph nil) [nil nil nil])))
+;; (with-context (select (graph #{[1 2 3] [4 5 6]}) [nil nil nil])
+;;   (triples (select (graph nil) [nil nil nil])))
 ;;
-;; #{[4 5 6] [1 2 3]}
+;;  => #{[4 5 6] [1 2 3]}

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -304,13 +302,3 @@
   (every? #(= (triples g) %) (map triples more)))

-
-;; (:triples
-;; (graph-union
-;;   (make-graph (word-triples "EVERYTHING"))
-;;   (make-graph (word-triples "SOMETHING"))))
-
-;; (:triples
-;; (graph-intersection
-;;   (make-graph (word-triples "EVERYTHING"))
-;;   (make-graph (word-triples "EVERYTHING"))))


formatting, TODO comment

formatting, TODO comment

--- src/braid/ui/views/pages/tag.cljs
+++ src/braid/ui/views/pages/tag.cljs
@@ -22,24 +22,25 @@
         inbox-thread-ids (subscribe [:open-thread-ids])
         known-threads (reaction
                         (->> @threads
-                               vals
-                               (filter
-                                 (fn [t] (contains? (set (t :tag-ids)) (@tag :id))))))
+                             vals
+                             (filter
+                               (fn [t] (contains? (set (t :tag-ids)) (@tag :id))))))
         sorted-threads (reaction
                          (->> (@page :thread-ids)
-                            (select-keys @threads)
-                            vals
-                            (into (set @known-threads))
-                            (map (fn [t] (assoc t :open? (contains? @inbox-thread-ids (t :id)))))
-                            ; sort-by last reply, newest first
-                            (sort-by
-                              (comp (partial apply max)
-                                    (partial map :created-at)
-                                    :messages))
-                            reverse))]
+                              (select-keys @threads)
+                              vals
+                              (into (set @known-threads))
+                              (map (fn [t] (assoc t :open? (contains? @inbox-thread-ids (t :id)))))
+                              ; sort-by last reply, newest first
+                              (sort-by
+                                (comp (partial apply max)
+                                      (partial map :created-at)
+                                      :messages))
+                              reverse))]
     (r/create-class
       {:component-did-mount
        (fn []
+         ; TODO: need to do this when page-id changes, not just on mount!
          (dispatch! :threads-for-tag {:tag-id @page-id}))
        :reagent-render
        (fn []


Fix url matching when urls include query params

--- src/sinusoides/routes.cljs
+++ src/sinusoides/routes.cljs
@@ -50,7 +50,9 @@

 (defn- no-prefix [uri]
   (let [prefix (secretary/get-config :prefix)]
-    (string/replace uri (re-pattern (str "^" prefix)) "")))
+    (-> uri
+       (string/replace (re-pattern (str "^" prefix)) "")
+       (string/replace (re-pattern #"\?.*$") ""))))

 (defn init-history! []
   (when (aget js/window "SINUSOIDES_DEBUG_MODE")


Fix really long statement

Fix really long statement

--- src/sleuth/definitions.clj
+++ src/sleuth/definitions.clj
@@ -55,7 +55,10 @@
                            :project project
                            :user-id user-id})]
     (if (v/valid? valid-definition record)
-      (mc/save-and-return "defintions" (merge record {:page-ids (into [] (map :_id (create-or-update-pages! pages)))}))
+      (mc/save-and-return "defintions" (merge record {:page-ids (->> pages
+                                                                     create-or-update-pages!
+                                                                     (map :_id)
+                                                                     (into []))}))
       {})))

 (defn respond-with


added a new function to custom collect only coeffs and tstats from a linear model

--- src/clj/forma/trends/analysis.clj
+++ src/clj/forma/trends/analysis.clj
@@ -91,6 +91,28 @@
     (for [x (range start-index (inc end-index))]
       (subvec base-vec 0 x))))

+;; Functions to collect cleaning functions for use in the trend
+;; feature extraction
+
+(defn clean-trend
+  "filter out bad values and remove seasonal component for a spectral
+  time series (with frequency `freq`) using information in an
+  associated reliability time series"
+  [freq spectral-ts reli-ts]
+  spectral-ts)
+
+(defn clean-tele-trends
+  "clean trends (i.e., filter out bad values and remove seasonal
+  component) for each intervening time period between `start-idx` and
+  `end-idx`.
+
+  TODO: THIS is the most time-intensive function of all the trend
+  analysis."
+  [freq start-idx end-idx spectral-ts reli-ts]
+  (map (partial clean-trend freq)
+       (lengthening-ts start-idx end-idx spectral-ts)
+       (lengthening-ts start-idx end-idx reli-ts)))
+
 ;; Short-term trend characteristic; supporting functions

 (defn trend-mat
@@ -138,27 +160,7 @@
        (moving-subvec block-len
                       (i/matrix (clean-trend freq spectral-ts reli-ts)))))

-;; Functions to collect cleaning functions for use in the trend
-;; feature extraction

-(defn clean-trend
-  "filter out bad values and remove seasonal component for a spectral
-  time series (with frequency `freq`) using information in an
-  associated reliability time series"
-  [freq spectral-ts reli-ts]
-  spectral-ts)
-
-(defn clean-tele-trends
-  "clean trends (i.e., filter out bad values and remove seasonal
-  component) for each intervening time period between `start-idx` and
-  `end-idx`.
-
-  TODO: THIS is the most time-intensive function of all the trend
-  analysis."
-  [freq start-idx end-idx spectral-ts reli-ts]
-  (map (partial clean-trend freq)
-       (lengthening-ts start-idx end-idx spectral-ts)
-       (lengthening-ts start-idx end-idx reli-ts)))

 ;; Collect the long- and short-term trend characteristics


fix for Laramy Fisk forced draw

fix for Laramy Fisk forced draw

--- src/clj/game/cards-identities.clj
+++ src/clj/game/cards-identities.clj
@@ -185,7 +185,7 @@
                                 (not (get-in @state [:per-turn (:cid card)]))
                                 (empty? (let [successes (map first (turn-events state side :successful-run))]
                                           (filter #(not (= % :remote)) successes)))))
-                 :effect (req (effect (draw :corp)) (swap! state assoc-in [:per-turn (:cid card)] true))}]}
+                 :effect (req (draw state :corp) (swap! state assoc-in [:per-turn (:cid card)] true))}]}

    "Leela Patel: Trained Pragmatist"
    {:events {:agenda-scored {:choices {:req #(and (not (:rezzed %)) (= (:side %) "Corp"))} :msg "add 1 unrezzed card to HQ"


Fix for Adam

Fix for Adam

Install only one for each directive.

Fixes mtgred/netrunner#649 and fixes mtgred/netrunner#628

--- src/clj/game/cards-identities.clj
+++ src/clj/game/cards-identities.clj
@@ -2,14 +2,15 @@

 (def cards-identities
   {"Adam: Compulsive Hacker"
-   {:effect (req (let [titles ["Safety First" "Always Be Running" "Neutralize All Threats"]
-                       indeck (filter #(some #{(:title %)} titles) (:deck runner))
-                       inhand (filter #(some #{(:title %)} titles) (:hand runner))]
-                   (doseq [c (concat indeck inhand)]
-                     (runner-install state side c {:no-cost true
+   (let [titles #{"Safety First" "Always Be Running" "Neutralize All Threats"}
+         one-of-each   (fn [cards] (->> cards (group-by :title) (map second) (map first)))
+         get-directives (fn [source] (filter #(some #{(:title %)} titles) source))]
+   {:effect (req (let [directives (-> (:deck runner) (concat (:hand runner)) (get-directives) one-of-each)]
+                   (doseq [c directives]
+                     (runner-install state side c {:no-cost true
                                                    :custom-message (str "starts with " (:title c) " in play")}))
-                   (draw state :runner (count inhand))))}
-
+                   (draw state :runner (count (filter #(= (:zone %) [:hand]) directives)))))})
+
    "Andromeda: Dispossessed Ristie"
    {:effect (effect (gain :link 1) (draw 4)) :mulligan (effect (draw 4))}

@@ -33,7 +34,7 @@
    "Armand \"Geist\" Walker: Tech Lord"
    {:effect (effect (gain :link 1))
     :events {:runner-trash {:optional {:req (req (and (= side :runner) (= (second targets) :ability-cost)))
-                                       :prompt "Draw a card?"
+                                       :prompt "Draw a card?"
                                        :yes-ability {:msg "draw a card"
                                                      :effect (effect (draw 1))}}}}}


The cat's clavicle, or collarbone, does not connect with other bones but is buried in the muscles of the shoulder region. This lack of a functioning collarbone allows them to fit through any opening the size of their head.

--- src/clj/quiz_site/routes/quiz.clj
+++ src/clj/quiz_site/routes/quiz.clj
@@ -47,14 +47,20 @@
     (m/reset-in! root [:quizzes (keyword quiz-id)] (merge quiz {:result-id result-id}))
     (m/reset-in! root [:results (keyword result-id)] {:quiz-id quiz-id})
     {:quiz-url (str host "/quiz/" quiz-id)
-     :result-url (str host "/quiz/" result-id)}))
+     :result-url (str host "/result/" result-id)}))

 (defn get-quiz
   [& {:keys[quiz-id] :as args}]
   (log/debug "get-quiz")
   (log/debug "args:   " args)
-  (let [quiz (do-get-quiz* quiz-id)]
-    quiz))
+  (let [quiz (do-get-quiz* quiz-id)
+        qs   (:questions quiz)
+        qs2  (reduce-kv
+               (fn [m k v]
+                 (assoc m k (dissoc v :c)))
+               {}
+               qs)]
+    (assoc (dissoc quiz :questions :result-id) :questions qs2)))

 (defn get-quiz-results
   [& {:keys[result-id] :as args}]
@@ -100,6 +106,7 @@
     {:correct ncorrect
      :outof (:nQuestions quiz)
      :sid sid}))
+
 (def quiz-routes
   (defroutes document-routes
     (context "/quiz" []


Show stash

Show stash

--- src/cljs/battle_console/game.cljs
+++ src/cljs/battle_console/game.cljs
@@ -44,6 +44,27 @@
             (dom/td nil (str (get-in game ["p1" "name"]) " vs " (get-in game ["p2" "name"])))
             (dom/td nil (get game "_id"))))))))

+(defn- get-stash
+  "Gets the current stash"
+  [game]
+  (get-in game ["battle" "stash" "p1"]))
+
+(defn- game-stash
+  "Shows the current stash if available"
+  [game]
+  (dom/div #js {:className "row"}
+    (dom/div #js {:className "col-lg-4"}
+      (dom/div #js {:className "bs-component"}
+        (apply dom/table #js {:className "table table-striped table-hover"}
+          (dom/caption nil "Stash")
+          (dom/tr nil
+            (dom/th nil "Unit")
+            (dom/th nil "Quantity"))
+          (for [[unit quantity] (get-stash game)]
+            (dom/tr nil
+              (dom/td nil unit)
+              (dom/td nil quantity))))))))
+
 (defn- render-game
   "Renders the index page"
   [state owner]
@@ -52,7 +73,8 @@
       (if-let [msg (state/get-state :loading-game)]
         (dom/div nil msg)
         (dom/div nil
-                 (game-header (state :game-data))))
+                 (game-header (state :game-data))
+                 (game-stash (state :game-data))))
       (dom/div #js {:className "hide"}))))

 (defn- register-renderer


Fix transaction success listener, make example work.

--- src/cljs/geschichte/platform.cljs
+++ src/cljs/geschichte/platform.cljs
@@ -64,6 +64,8 @@
 (defn start-server! [ip port]
   {throw "No server functionality in js yet. Node port welcome."})

+(defn error-handler [topic res e]
+  (.log js/console topic e) (close! res) (throw e))

 (defrecord IndexedDBKeyValueStore [db store-name]
@@ -75,7 +77,7 @@
           obj-store (.objectStore tx store-name)
           req (.get obj-store (str fkey))]
       (set! (.-onerror req)
-            (fn [e] (log e) (close! res) (throw e)))
+            (partial error-handler (str "cannot get-in" fkey) res))
       (set! (.-onsuccess req)
             (fn [e] (when-let [r (.-result req)]
                      (put! res(-> r
@@ -86,61 +88,63 @@
               (close! res)))
       res))
   (-assoc-in [this key-vec value]
-    (go (let [[fkey & rkey] key-vec
-              res (chan)
-              tx (.transaction db #js [store-name] "readwrite")
-              obj-store (.objectStore tx store-name)
-              req (.get obj-store (str fkey))]
-          (set! (.-onerror req)
-                (fn error-handler [e] (log e) (close! res) (throw e)))
-          (set! (.-onsuccess req)
-                (fn read-old [e]
-                  (let [old (when-let [r (.-result req)]
-                              (-> r .-edn_value read-string))
-                        up-req (.put obj-store
-                                     (clj->js {:key (str fkey)
-                                               :edn_value
-                                               (str (if-not (empty? rkey)
-                                                      (assoc-in old rkey value)
-                                                      value))}))]
-                    (set! (.-oncomplete up-req)
-                          (fn [e] (close! res))))))
-          (<! res))))
+    (let [[fkey & rkey] key-vec
+          res (chan)
+          tx (.transaction db #js [store-name] "readwrite")
+          obj-store (.objectStore tx store-name)
+          req (.get obj-store (str fkey))]
+      (set! (.-onerror req)
+            (partial error-handler (str "cannot get for assoc-in" fkey) res))
+      (set! (.-onsuccess req)
+            (fn read-old [e]
+              (let [old (when-let [r (.-result req)]
+                          (-> r .-edn_value read-string))
+                    up-req (.put obj-store
+                                 (clj->js {:key (str fkey)
+                                           :edn_value
+                                           (str (if-not (empty? rkey)
+                                                  (assoc-in old rkey value)
+                                                  value))}))]
+                (set! (.-onerror up-req)
+                      (partial error-handler (str "cannot put for assoc-in" fkey) res))
+                (set! (.-onsuccess up-req)
+                      (fn [e] (close! res))))))
+      res))
   (-update-in [this key-vec up-fn]
-    (go (let [[fkey & rkey] key-vec
-              res (chan)
-              tx (.transaction db #js [store-name] "readwrite")
-              obj-store (.objectStore tx store-name)
-              req (.get obj-store (str fkey))]
-          (set! (.-onerror req)
-                (fn error-handler [e] (log e) (close! res) (throw e)))
-          (set! (.-onsuccess req)
-                (fn read-old [e]
-                  (let [old (when-let [r (.-result req)]
-                              (-> r .-edn_value read-string))
-                        up-req (.put obj-store
-                                     (clj->js {:key (str fkey)
-                                               :edn_value
-                                               (str (if-not (empty? rkey)
-                                                      (update-in old rkey up-fn)
-                                                      (up-fn value)))}))]
-                    (set! (.-oncomplete up-req)
-                          (fn [e] (close! res))))))
-          (<! res)))))
+    (let [[fkey & rkey] key-vec
+          res (chan)
+          tx (.transaction db #js [store-name] "readwrite")
+          obj-store (.objectStore tx store-name)
+          req (.get obj-store (str fkey))]
+      (set! (.-onerror req)
+            (partial error-handler (str "cannot get for update-in" fkey) res))
+      (set! (.-onsuccess req)
+            (fn read-old [e]
+              (let [old (when-let [r (.-result req)]
+                          (-> r .-edn_value read-string))
+                    new (if-not (empty? rkey)
+                          (update-in old rkey up-fn)
+                          (up-fn value))
+                    up-req (.put obj-store
+                                 (clj->js {:key (str fkey)
+                                           :edn_value
+                                           (str new)}))]
+                (set! (.-onerror up-req)
+                      (partial error-handler (str "cannot put for update-in" fkey) res))
+                (set! (.-onsuccess up-req)
+                      (fn [e] (put! res [old new]) (close! res))))))
+      res)))

 (defn new-indexeddb-store [name]
   (let [res (chan)
         req (.open js/window.indexedDB name 1)]
     (set! (.-onerror req)
-          (fn error-handler [e]
-            (log (js->clj (.-target e)))
-            (close! res)
-            (throw e)))
+          (partial error-handler "ERROR opening DB:" res))
     (set! (.-onsuccess req)
           (fn success-handler [e]
             (log "db-opened:" (.-result req))
-            (put! res (IndexedDBKeyValueStore. (.-result req) "geschichte"))))
+            (put! res (IndexedDBKeyValueStore. (.-result req) name))))
     (set! (.-onupgradeneeded req)
           (fn upgrade-handler [e]
             (let [db (-> e .-target .-result)]
@@ -154,13 +158,14 @@

   (go (def my-db (<! (new-indexeddb-store "geschichte"))))

-  (def my-kv (IndexedDBKeyValueStore. my-db "geschichte"))
+  (go (println "get:" (<! (-get-in my-db ["1"]))))

-  (go (println "get:" (<! (-get-in my-kv ["test"]))))
+  (go (doseq [i (range 10)]
+        (<! (-assoc-in my-db [i] i))))

-  (go (println (<! (-assoc-in my-kv ["test2"] {:a 1 :b 4.2}))))
+  (go (println (<! (-assoc-in my-db ["test2"] {:a 1 :b 4.2}))))

-  (go (println (<! (-assoc-in my-kv ["test" :a] 43))))
+  (go (println (<! (-assoc-in my-db ["test" :a] 43))))

-  (go (println (<! (-update-in my-kv ["test" :a] inc))))
+  (go (println (<! (-update-in my-db ["test" :a] inc))))
   )


Highlight card name text

Highlight card name text

--- src/cljs/netrunner/gameboard.cljs
+++ src/cljs/netrunner/gameboard.cljs
@@ -27,7 +27,6 @@
 (.on socket "reconnect" #(when (.-onbeforeunload js/window)
                            (notify "Reconnected to the server.")
                            (.emit socket "netrunner" #js {:action "reconnect" :gameid (:gameid @app-state)})))
-

 (def anr-icons {"[Credits]" "credit"
                 "[$]" "credit"
@@ -148,18 +147,19 @@
   (if (is-card-item item)
     [(.substring item 1 (.indexOf item "~"))
      (.substring item (inc (.indexOf item "~")) (dec (count item)))]))
-
+
 (defn create-span [item]
   (if-let [class (anr-icons item)]
     [:span {:class (str "anr-icon " class)}]
   (if-let [[title code] (extract-card-info item)]
-    [:span {:on-mouse-enter #(put! zoom-channel {:code code})
+    [:span {:class "fake-link"
+            :on-mouse-enter #(put! zoom-channel {:code code})
             :on-mouse-leave #(put! zoom-channel false)} title]
   [:span item])))
-
+
 (defn add-image-codes [text]
   (reduce #(.replace %1 (:title %2) (str "[" (:title %2) "~"(:code %2) "]")) text (:cards @app-state)))
-
+
 (defn get-message-parts [text]
   (let [with-image-codes (add-image-codes (if (nil? text) "" text))]
       (.split with-image-codes (js/RegExp. "(\\[[^\\]]*])" "g"))))
@@ -613,7 +613,7 @@
                                      "OK"]]
                          (for [c (:choices prompt)]
                            (if (string? c)
-                             [:button {:on-click #(send-command "choice" {:choice c})}
+                             [:button {:on-click #(send-command "choice" {:choice c})}
                                        (for [item (get-message-parts c)] (create-span item))]
                              [:button {:on-click #(send-command "choice" {:card @c})} (:title c)]))))]
                     (if run


small fix

small fix

--- src/cljs/salava/page/ui/edit.cljs
+++ src/cljs/salava/page/ui/edit.cljs
@@ -454,7 +454,7 @@
 (defn page-form [state]
   [:div
    [:div.panel.thumbnail
-    [:div.panel-heading [:p.block-title "Page Information"]]
+    ;[:div.panel-heading [:p.block-title "Page Information"]]
     [:div.panel-body
      [:div.form-horizontal
       [:div {:id "title-and-description"}


Initialize parinfer later so it runs in the right order

--- src/clojure/nightcode/editors.clj
+++ src/clojure/nightcode/editors.clj
@@ -388,8 +388,7 @@
        (.setLineWrap (contains? utils/wrap-exts extension))
        (.setMarginLineEnabled true)
        (.setMarginLinePosition 80)
-       (.setTabSize (if (contains? utils/clojure-exts extension) 2 4))
-       (init-parinfer! extension edit-history)))))
+       (.setTabSize (if (contains? utils/clojure-exts extension) 2 4))))))

 (defn create-console
   ([path]
@@ -540,6 +539,7 @@
             (update-buttons! editor-pane text-area))
           (removeUpdate [this e]
             (update-buttons! editor-pane text-area))))
+      (init-parinfer! text-area extension edit-history)
       ; return a map describing the editor
       {:view editor-pane
        :text-area text-area


Restore parallel job execution, yet again.

--- src/clojure/parkour/mapreduce.clj
+++ src/clojure/parkour/mapreduce.clj
@@ -29,8 +29,9 @@
 (defn local-runner?
   "True iff `conf` specifies the local job runner."
   [conf]
-  (or (= "local" (conf/get conf "mapred.job.tracker" "local"))
-      (= "local" (conf/get conf "mapreduce.framework.name" "local"))))
+  (= "local" (or (conf/get conf "mapred.job.tracker" nil)
+                 (conf/get conf "mapreduce.framework.name" nil)
+                 "local")))

 (defn keys
   "Produce keys only from the tuples in `context`.  Deprecated."


Removed superfluous comment

Removed superfluous comment


[#422] [Client] Provide a dynamic var to override default client (@fpischedda)

This is a useful feature in itself, but the primary motivation is to provide a hook
where we can easily swap in an SNI-capable client for #422.

--- src/org/httpkit/client.clj
+++ src/org/httpkit/client.clj
@@ -95,6 +95,12 @@

 ;;; "Get the default client. Normally, you only need one client per application. You can config parameter per request basic"
 (defonce default-client (delay (HttpClient.)))
+
+(defonce
+  ^{:dynamic true
+    :doc "Specifies the default HttpClient used by the `request` function.
+Value may be a delay. See also `make-client`."}
+  *default-client* default-client)

 (defn make-client
   "Returns an HttpClient with specified options:
@@ -212,7 +218,7 @@
          proxy-port -1
          proxy-url nil}}
    & [callback]]
-  (let [client (or client @default-client)
+  (let [client (or client (force *default-client*))
         {:keys [url method headers body sslengine]} (coerce-req opts)
         deliver-resp #(deliver response ;; deliver the result
                                (try


fix for 0.18

fix for 0.18

--- src/otp_api_proxy/util.clj
+++ src/otp_api_proxy/util.clj
@@ -268,13 +268,25 @@
   ridership does not operate on an exact schedule."
   [plan]
   ;; see java.util.Comparator docs
-  (let [itins (:itineraries plan)
+  (let [itins (or (:itineraries (:itineraries plan)) ; see comment below.
+                  (:itineraries plan))
         itins-merged (summarize-collection (collect-by-route-sequence itins))
         itins-sorted (sort
                        (fn [a b]
                          (- (:walkDistance a) (:walkDistance b)))
                        itins-merged)]
-    (assoc plan :itineraries itins-sorted)))
+    ;; Format changed in 0.18 so that two itineraries tags are nested:
+    ;; <itineraries><itineraries> ... </itineraries></itineraries>
+    ;;
+    ;; This is likely a bug, but we can work around it.
+    ;;
+    ;; Hence we look for itineraries lists in both locations, and then
+    ;; insert our results into both locations so as to be compatible with
+    ;; either version of the javascript client.
+    ;;
+    ;; Ed 2015-10-17
+    (assoc    plan :itineraries itins-sorted)
+    (assoc-in plan [:itineraries :itineraries] itins-sorted)))

 (defn plan->add-route-url
   "Add routeUrl (schedule information) for each route in otp itinerary."


add ensure-connected!

add ensure-connected!

--- src/overtone/sc/server.clj
+++ src/overtone/sc/server.clj
@@ -197,3 +197,9 @@
   (log/level :error)
   (sc-osc-debug-off)
   (snd "/dumpOSC" 0))
+
+(defn ensure-connected!
+  "Throws an exception if the server isn't currently connected"
+  []
+  (when-not (connected?)
+    (throw (Exception. "Server needs to be connected before you can perform this action."))))


fix typo

fix typo

--- src/pc/email.clj
+++ src/pc/email.clj
@@ -218,7 +218,7 @@
                        :text (str "You have a new invoice for the " (:team/subdomain team) " team.")
                        :html (view/invoice-html team invoice)
                        :attachments (let [temp (fs/temp-file (str "invoice-"
-                                                                  (:team/subscribe team)
+                                                                  (:team/subdomain team)
                                                                   "-"
                                                                   (:db/id invoice)))
                                           os (io/output-stream temp)]


Moved location of the Node record definition

--- src/retro_fever/scene.cljs
+++ src/retro_fever/scene.cljs
@@ -18,6 +18,15 @@
   (get-element [this element-id])
   (get-elements [this element-ids])
   (get-elements-at [this node-id]))
+
+(defrecord Node [children]
+  INode
+  (add-child-id [this id]
+    (update-in this [:children] conj id))
+  (get-children-ids [this]
+    (:children this))
+  (remove-child-id [this id]
+    (update-in this [:children] disj id)))

 (defrecord Scene []
   IScene
@@ -51,15 +60,6 @@

 (defn get-id [element]
   (:se-id (meta element)))
-
-(defrecord Node [children]
-  INode
-  (add-child-id [this id]
-    (update-in this [:children] conj id))
-  (get-children-ids [this]
-    (:children this))
-  (remove-child-id [this id]
-    (update-in this [:children] disj id)))

 (defn group
   ([]


Don't redirect to image, just proxy the request so that we can continually refresh and get a different image

--- src/riff/core.clj
+++ src/riff/core.clj
@@ -4,11 +4,15 @@
   (:use riff.flickr)
   (:require [compojure.handler :as handler]
             [compojure.route :as route]
+            [org.httpkit.client :as http]
             [ring.adapter.jetty :as jetty]
             [ring.util.response :as resp]))

 (defroutes app-routes
-  (GET "/" [] (resp/redirect (random-image (fetch-flickr-public-feed)))))
+  (GET "/" [] (let [body (:body @(http/get (random-image (fetch-flickr-public-feed))))]
+                {:status 200
+                 :headers {}
+                 :body body})))

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