I am really annoyed that the Valkey wire protocol does not have a way to send a data block without including a header that indicates its size. There is also no way to break up blocks into smaller pieces. This means that I cannot do a zero-copy/zero-instantiation of my valkey serialisation.

Basically, when I serialise a Kap object, its expanded version is written to a stream. Given the above mentioned limitation in the protocol, I need to write the entire object to an internal buffer, just so that I know the size of it before I write the actual data.

#valkey #kap

A discussion on the BQN Matrix channel about Project Euler number 21 led me to think that the divisors function in Kap would be useful for this.

Turns out I was right. The solution turned out to be pretty simple, once one realises that an amicable number is one where if you take the sum of the divisors twice, you get back to the original number and the sum of the divisors is not the same as the number itself.

The following Kap code solves the problem by taking advantage of this:

+/ ⍸ ≠/ (⊂↑)«=¨»(1↓) (1+ +/¨math:divisors ⊣)\ (⍳10000) 0 0

Run in browser

The code should be reasonably easy to understand for anyone with some APL experience, but I'll be happy to explain in more details if anyone is interested.

The scan operator is being abused a bit by turning it into a preserving version of repeat. I think if there was a collecting version of repeat, that would be a nicer way to do it.

#kap #apl #programmming #maths

REKAP: ⚾️ Chicago Cubs 3-2 loss to Cincinnati Reds. ‘Trainwreck city! No idea what is going on!’ https://www.rawchili.com/4444761/ #Baseball #Chicago #ChicagoCubs #chicagocubs #chicagosports #CincinnatiReds #Cubs #Kap #MLB #rekap #sports #sportsnews #Takethat

De straat op voor Amelisweerd

Domplein, Utrecht, zaterdag 27 september om 13:00 CEST

🌳Save The Date🌳

Op zaterdagmiddag 27 september gaan we wéér de straat op voor Amelisweerd! Want 43 jaar na de kap in 1982 is de strijd nog steeds niet gestreden. In de aanloop naar de aankomende verkiezingen willen wij het absurde plan nu definitief van tafel!

📆 27 september
⏰ 13:00 uur
📍 Domplein

Zien we je daar? 💚🔥🙏

👥 door Amelisweerd Niet Geasfalteerd, Vrienden van Amelisweerd, Kerngroep Ring Utrecht en XR Utrecht (bron)

https://acties.todon.nl/event/de-straat-op-voor-amelisweerd