This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-08
Channels
- # announcements (12)
- # aws (4)
- # beginners (92)
- # calva (2)
- # cider (28)
- # clara (11)
- # clj-kondo (5)
- # cljdoc (9)
- # cljs-dev (195)
- # cljsjs (1)
- # clojure (82)
- # clojure-italy (18)
- # clojure-losangeles (1)
- # clojure-nl (2)
- # clojure-spec (10)
- # clojure-uk (51)
- # clojurescript (40)
- # cursive (7)
- # datomic (19)
- # duct (9)
- # emacs (2)
- # figwheel (3)
- # fulcro (56)
- # graphql (8)
- # jobs (3)
- # luminus (2)
- # off-topic (15)
- # re-frame (5)
- # reitit (3)
- # ring (5)
- # shadow-cljs (22)
- # slack-help (2)
- # sql (51)
- # test-check (9)
- # vim (64)
- # yada (1)
Morning π
If anyone happens to be near Horsham this evening, we'll be hosting our monthly meetup. The current plan is for @matttylr to demo of Clojure Pedestal's interceptors to demonstrate the use of first class functions and Clojure's data structures together. Check out https://www.meetup.com/Horsham-Functional-Programming/events/xcbwxqyzhblb/ for more info if you interested in joining us.
So I'm planning on talking at London Clojurians over the next couple of months about prepls. Anyone have any good name suggestions? I'm hoping for something punny that would make people groan and maybe (propel, prepare?) I'll be focusing on what the prepl is, how it works, what we can use it for and what I've been doing with it (building prepl tooling over prepl tooling). I'll probably touch on what nREPL does for you and how it differs too (spoiler: nREPL does SO much more for you). I'll show integration with figwheel, Clojure and vanilla ClojureScript so it'll be a pretty wide tour of the landscape I hope.
I think it'll mostly be demo rather than slide based, so that could go horribly. Worth seeing if only just for me trying to get xrandr to play ball π
This is also a chance for anyone to shape the talk, let me know what you'd be interested in! (I'll also be demoing Conjure fairly heavily since it's prepl tooling, so that might be interesting for vim folks)
sounds like a good talkβ¦ Iβd certainly like to see a recording of it π
Just in case anyone was thinking of popping in, we've had to cancel tonight's meetup due to lack of (any) attendees
I'd certainly attend that talk if I was in the area!
Like Rick, I hope there's a recording of it π Or maybe you could submit it to Conj and I could see it in the flesh over here? @olical
This sounds extremely terrifying and I'd definitely need to come up with more content. I think Clojure eXchange in London is a big enough jump for me right now π and I haven't even applied there yet!
@yogidevbear Sorry no one turned up π I've had that happen as a user group organizer. And that was with an invited speaker, sometimes, too. There'd be just me, the speaker, and whoever was hosting the meetup (and sometimes no host showed up).
@seancorfield We had a meetup about 2 weeks ago so I don't feel too bad. We had two people that were hoping to attend, but one is at devoxx this week and the other is stuck in London.
We'll keep persisting on a regular monthly basis and see if it improves over summer
One limitation we've just hit is the 50 attendee group limit on http://meetup.com
@jr0cket out of interest, are you using YouTube live to broadcast you weekend online lessons?
Happy to have a chat about YouTube broadcasting and the two different user interfaces (just riding home now though)
I'd be really keen to hear about it. Maybe later in the week π
Early next week suits me. This week is full on... I have Sunday afternoon off, which is earliest I have time
Anyone listened to the David Nolen interview on https://clojurescriptpodcast.com/ ?
@yogidevbear yes. Will be using https://obsproject.com/ as a streaming client very soon. Creating separate channels on YouTube, as their UI is so hard to find anything & it allows people to subscribe to my Clojure and not my cycling in the rain videos π
I will be listening to that podcast soon, as I am supposed to be on it at some point π
Ooo exciting π
I am at Devoxx UK if anyone wants to do some Clojure π
Sorry, very busy this week
Devoxx is a conference, focusing on the JVM community (Java, Scala, Clojure, etc). Lots of interesting stuff about GraalVM this time around, will try out some more Clojure with GraalVM soon.
(t/deftest test-aggregate-by-domain
(t/testing "Happy path"
(t/is (= (sut/aggregate-by-domain :year
(map :fruit) :fruit x/count
[{:year 1 :fruit "apple"}
{:year 1 :fruit "apple"}
{:year 1 :fruit "pear"}
{:year 2 :fruit "apple"}
{:year 2 :fruit "pear"}
{:year 2 :fruit "pear"}])
{1 [2 1], 2 [1 2]}))))
(defn aggregate-by-domain [domain-key
sub-domain-xf sub-domain-key sub-domain-aggregate-xf
data]
(let [sub-domain (into (sorted-set)
sub-domain-xf
data)]
(->> (into (sorted-map)
(x/by-key domain-key
(comp
(x/by-key sub-domain-key sub-domain-aggregate-xf)
(x/into (into (sorted-map)
(map #(vector % 0)
sub-domain)))))
data)
(reduce-kv (fn mapvals [a k v]
(assoc a k (mapv second v)))
(sorted-map)))))
(defn grouped-column
([domain-key domain-name
sub-domain-xf sub-domain-key sub-domain-name sub-domain-aggregate-xf
range-name
records]
(let [domain (into (sorted-set)
sub-domain-xf
records)
data (aggregate-by-domain domain-key
sub-domain-xf
sub-domain-key
sub-domain-aggregate-xf
records)
palette (take (count domain) (color/palette-presets :green-orange-teal))
legend-spec (mapv
(fn [d p]
[:rect d {:color p}])
domain palette)]
(-> (plotb/series [:stack-vertical [:bar data {:palette palette}]])
(plotb/preprocess-series)
(plotb/update-scale :y :ticks 20)
(plotb/update-scale :y :fmt "%,.0f")
(plotb/add-axes :left)
(plotb/add-axes :bottom)
(plotb/add-label :bottom domain-name)
(plotb/add-label :left range-name)
(plotb/add-legend sub-domain-name legend-spec)
(plotr/render-lattice {:width 800 :height 600})))))
that reduce-kv
after using xforms bugs me. I had an uglier way of doing it before, but I feel like I should be able to do it all using xforms
that's alot of nested complexity
can you write a (transduce
clause that
β’ runs sub-domain-xf
(presumably this is a filter?)
β’ creates a vector of keys (suitable for assoc-in
) and their value
β’ write a variant of assoc-in
that creates intermediary (sorted-map)
s
β’ have a single reducing function that calls this assoc-in
to return nested sorted maps
@U793EL04V yeah, I think you are right there. After sleeping on it I've thought of some better ways to break it down. I think the by-key stuff while cool might be a bit too much for me to wrap my head around at the moment