Good Morning!
Morning
Morning
π
Morning
morning
morning
Bore da :welsh_flag:
morning
anyone here using or have good examples of using tap>
?
Not using it, waiting for tap->
https://clojure.atlassian.net/browse/CLJ-2538?jql=text%20~%20%22tap-%3E%22
@otfrom check out https://github.com/djblue/portal/
I had a look at that before and made it hang with some large values. I'll have another look
I think I also want to keep the data around for later processing
(which makes me wonder if I should be looking at doing something else entirely)
the process that is running some times blows up in the middle tho, so storing it all in memory and dumping it at the end doesn't work
fwiw, I haven't used tap> besides portal. btw portal works with babashka :)
morning
Guten Morning!
I've used tap in some local dev situations, e.g. where I would send a message in prod, i tap out during development
With some machinery around it I can even selectively filter. Like logging but for a different purpose. And structured.
I think it is that "other machinery" I've not seen good examples for yet
other than something fancy like portal
Morning
Nextjournal integrates tap>
, and you can use their data viewer then to browse through your data. quite nifty.
I hadn't seen Portal yet. I've used Punk but it also has no protection for dealing with big values. And it uses EDN over the wire which I find questionable.
but at least we're getting some open source REBL-alikes
today was the first time I thought about using some
with not-empty
, they combine well, even works with strings
(some not-empty ["" nil "foo"])
;; => "foo"
@plexus portal is quite cool, he did a talk at the Apropos podcast/videocast thing
Alex once frowned upon my use of non-empty
for strings, he recommended using str/blank?
which I have been doing since :)
I'm not familiar with punk myself
Here's an example of invoking portal with babashka to view EDN files (and YAML, etc): https://github.com/borkdude/babashka/tree/master/examples#portal
str/blank?
also checks for whitespace which may or may not be the intention
I will say one nice thing about str/blank?
, it's one of the only (perhaps the only?) function in clojure.string
that doesn't just explode when it sees a nil
true :)
do you know if portal has any mechanism for incrementally fetching nested values or parts of long sequences? Unrepl had that and it's seems shadow's object inspector thingy as well, but Punk doesn't which makes its usefulness limited
I think you might find https://github.com/djblue/portal/pull/18 interesting. Still working on it but it should address your concerns around long sequences.
that sounds good! how about big maps or deeply nested maps?
How big are we talking? Portal lazily renders all data structures so the bottle neck tends to be in transit which is fast enough.
As a measure, all the analyzer data emitted by cljs works just fine in portal
Ok that's a great benchmark. That's how I immediately locked up punk the first time I tried it π
I recommend posting that as a question in #portal
The author is quite active so if it's not supported, maybe he will soon
Itβs cold out. Good morning, not to some but every
Nice!
What is the best way to implement inc2 and dec2 (add or subtract 2 rather than 1)? Itβs obviously easy just wondering what are the craziest options!
(defn inc2 [n] (reduce + (dec n) (range 3)))
Let the code golf begin
(partial + 2) and (comp inc inc) and #(+ 2 %)
I feel like aphyr still strike like lightning
I like that you can sing (comp inc inc)
to oom pah pah!
what about a macro that creates inc incc inccc incccc inccccc, CL style
(sorry)
don't be sorry
@dominicm your suggestions are way too acceptable
I wanted to get them out so only bad ones would be left
(second (range n Long/MAX_VALUE 2))
(first (butlast (reverse (range Long/MAX_VALUE))))
wow, that does amazing things to my cores
no, wait, I've fallen asleep again, that's completely wrong
(it has been a long week)
(nth (iterate inc 0) 2)
one of the rare occasions to mess with iterate
(defn inc2
[n]
(->> (repeatedly #(rand-int Integer/MAX_VALUE))
(map (juxt #(- % n) identity))
(drop-while (comp (partial not= 2) first))
(first)
(second)))
Uses juxt, comp and partial, therefore is quality code.
clojure pro bingo?
although I would have expected some transducer usage in there as well
Damn! I hoped that the beautiful execution time would outweighed it...
Could stick a little into in there
Or eduction
yes, this is now the eduction channel
With luck, it might terminate before we reach a Brexit agreement. The future will tell my grandchildren.
I just read an article by a Dutch philosopher who thinks that it would be better if Trump won again, so we got rid of him in 4 years, instead of giving him 4 years to run again and destroy everything with more impact.
Now I'm confused.
Well, he's not that young you know
Let's hope for the best Val ;)
no way he will run again - Melania needs her divorce and he wants a talk show ... all attention no work
TIL that this works:
mv resources/clj_kondo.config/clj_kondo/fulcro/{README.md,src} fulcro
I tried it without reading any docs, just hoping it would work, and it did!If only the American voting system were that simple and predictable ;)
Let's put clj-condo in the constitution
@val_waeselynck btw, after reading your article on _
I now use :tag_uuid
instead of :tag/uuid
at work in our backend and front-end :P. Saves me quite some hassle with converting back and forth.