clojure-europe

For people in Europe... or elsewhere... UGT https://indieweb.org/Universal_Greeting_Time
dharrigan 2020-11-06T06:38:31.176500Z

Good Morning!

2020-11-06T06:55:36.176700Z

Morning

dominicm 2020-11-06T06:57:51.176900Z

Morning

RAMart 2020-11-06T07:07:10.177100Z

πŸ‘‹

simongray 2020-11-06T07:37:18.177400Z

Morning

slipset 2020-11-06T08:23:40.177600Z

morning

borkdude 2020-11-06T08:38:59.177800Z

morning

agile_geek 2020-11-06T08:57:21.178Z

Bore da :welsh_flag:

2020-11-06T09:23:54.178200Z

morning

2020-11-06T09:24:18.178600Z

anyone here using or have good examples of using tap> ?

slipset 2020-11-06T09:24:33.178900Z

Not using it, waiting for tap->

borkdude 2020-11-06T09:26:09.179700Z

@otfrom check out https://github.com/djblue/portal/

2020-11-06T09:26:59.180200Z

I had a look at that before and made it hang with some large values. I'll have another look

2020-11-06T09:27:17.180600Z

I think I also want to keep the data around for later processing

2020-11-06T09:27:31.181Z

(which makes me wonder if I should be looking at doing something else entirely)

2020-11-06T09:28:07.181700Z

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

borkdude 2020-11-06T09:28:58.182100Z

fwiw, I haven't used tap> besides portal. btw portal works with babashka :)

thomas 2020-11-06T09:47:32.182300Z

morning

ordnungswidrig 2020-11-06T10:27:04.182600Z

Guten Morning!

ordnungswidrig 2020-11-06T10:27:56.183700Z

I've used tap in some local dev situations, e.g. where I would send a message in prod, i tap out during development

ordnungswidrig 2020-11-06T10:28:44.184900Z

With some machinery around it I can even selectively filter. Like logging but for a different purpose. And structured.

2020-11-06T10:43:07.185300Z

I think it is that "other machinery" I've not seen good examples for yet

2020-11-06T10:43:24.185600Z

other than something fancy like portal

jasonbell 2020-11-06T10:53:11.185800Z

Morning

plexus 2020-11-06T11:06:20.186400Z

Nextjournal integrates tap>, and you can use their data viewer then to browse through your data. quite nifty.

plexus 2020-11-06T11:07:04.187300Z

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.

plexus 2020-11-06T11:07:27.187700Z

but at least we're getting some open source REBL-alikes

1
plexus 2020-11-06T11:08:18.188700Z

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"

πŸ‘ 1
borkdude 2020-11-06T11:08:23.188800Z

@plexus portal is quite cool, he did a talk at the Apropos podcast/videocast thing

borkdude 2020-11-06T11:09:39.190400Z

Alex once frowned upon my use of non-empty for strings, he recommended using str/blank? which I have been doing since :)

borkdude 2020-11-06T11:11:35.190900Z

I'm not familiar with punk myself

borkdude 2020-11-06T11:13:35.191300Z

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

plexus 2020-11-06T11:15:47.191400Z

str/blank? also checks for whitespace which may or may not be the intention

plexus 2020-11-06T11:15:48.191500Z

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

borkdude 2020-11-06T11:16:40.191700Z

true :)

plexus 2020-11-06T11:30:08.192100Z

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

djblue 2020-11-09T18:10:35.297800Z

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.

plexus 2020-11-10T07:27:40.309700Z

that sounds good! how about big maps or deeply nested maps?

djblue 2020-11-11T02:26:29.343700Z

How big are we talking? Portal lazily renders all data structures so the bottle neck tends to be in transit which is fast enough.

djblue 2020-11-11T02:28:10.343900Z

As a measure, all the analyzer data emitted by cljs works just fine in portal

plexus 2020-11-11T06:43:16.344300Z

Ok that's a great benchmark. That's how I immediately locked up punk the first time I tried it πŸ˜ƒ

borkdude 2020-11-06T11:36:16.192400Z

I recommend posting that as a question in #portal

borkdude 2020-11-06T11:36:46.192800Z

The author is quite active so if it's not supported, maybe he will soon

raymcdermott 2020-11-06T12:26:06.194Z

It’s cold out. Good morning, not to some but every

borkdude 2020-11-06T12:26:40.194400Z

Nice!

raymcdermott 2020-11-06T12:37:40.197700Z

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!

raymcdermott 2020-11-06T12:42:38.198600Z

(defn inc2 [n] (reduce + (dec n) (range 3)))

dominicm 2020-11-06T12:48:26.198900Z

Let the code golf begin

dominicm 2020-11-06T12:48:52.199600Z

(partial + 2) and (comp inc inc) and #(+ 2 %)

dominicm 2020-11-06T12:50:08.200800Z

I feel like aphyr still strike like lightning

2020-11-06T13:02:57.201200Z

I like that you can sing (comp inc inc) to oom pah pah!

🎺 1
mpenet 2020-11-06T13:03:44.201700Z

what about a macro that creates inc incc inccc incccc inccccc, CL style

mpenet 2020-11-06T13:03:49.201900Z

(sorry)

raymcdermott 2020-11-06T13:55:45.202300Z

don't be sorry

raymcdermott 2020-11-06T13:56:32.202700Z

@dominicm your suggestions are way too acceptable

dominicm 2020-11-06T13:59:09.203200Z

I wanted to get them out so only bad ones would be left

dominicm 2020-11-06T14:00:41.203700Z

(second (range n Long/MAX_VALUE 2))

πŸ˜‚ 2
2020-11-06T14:07:53.204800Z

(first (butlast (reverse (range Long/MAX_VALUE))))

😍 1
2020-11-06T14:09:17.205100Z

wow, that does amazing things to my cores

2020-11-06T14:09:55.205600Z

no, wait, I've fallen asleep again, that's completely wrong

2020-11-06T14:10:02.205800Z

(it has been a long week)

mpenet 2020-11-06T14:47:41.206400Z

(nth (iterate inc 0) 2)

mpenet 2020-11-06T14:47:50.206700Z

one of the rare occasions to mess with iterate

😝 1
RAMart 2020-11-06T15:38:49.207Z

(defn inc2
  [n]
  (->> (repeatedly #(rand-int Integer/MAX_VALUE))
       (map (juxt #(- % n) identity))
       (drop-while (comp (partial not= 2) first))
       (first)
       (second)))

⏳ 1
😜 1
val_waeselynck 2020-11-06T15:42:44.208200Z

Uses juxt, comp and partial, therefore is quality code.

βœ”οΈ 2
borkdude 2020-11-06T15:44:16.208500Z

clojure pro bingo?

borkdude 2020-11-06T15:45:10.209Z

although I would have expected some transducer usage in there as well

RAMart 2020-11-06T15:45:41.209200Z

Damn! I hoped that the beautiful execution time would outweighed it...

val_waeselynck 2020-11-06T16:26:26.210100Z

Could stick a little into in there

val_waeselynck 2020-11-06T16:27:04.210600Z

Or eduction

raymcdermott 2020-11-06T16:27:43.211300Z

yes, this is now the eduction channel

val_waeselynck 2020-11-06T16:28:51.212900Z

With luck, it might terminate before we reach a Brexit agreement. The future will tell my grandchildren.

πŸ˜† 1
😭 1
borkdude 2020-11-06T16:30:01.214200Z

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.

borkdude 2020-11-06T16:30:14.214400Z

Now I'm confused.

val_waeselynck 2020-11-06T16:30:54.215400Z

Well, he's not that young you know

borkdude 2020-11-06T16:31:19.216100Z

Let's hope for the best Val ;)

raymcdermott 2020-11-06T16:31:36.216400Z

no way he will run again - Melania needs her divorce and he wants a talk show ... all attention no work

borkdude 2020-11-06T16:33:05.216900Z

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!

val_waeselynck 2020-11-06T16:36:05.218Z

If only the American voting system were that simple and predictable ;)

val_waeselynck 2020-11-06T16:36:33.218700Z

Let's put clj-condo in the constitution

borkdude 2020-11-06T17:01:43.221200Z

@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.

πŸ˜‡ 1