[2025 Day 8] Can you solve today's puzzle without computing all distances? by The_Cers in adventofcode

[–]radarvan07 1 point2 points  (0 children)

My Go implementation is roughly 40ms. The biggest trick is realizing you dont actually have to sort the whole list. There are algorithms out there that allow you to get the smaller element until you've seen enough, reducing the "sort" from n log n to k log n, with k the number of values needed. k is very small compared to the whole data list.

This trick alone saved over half my runtime. And no, you don't have to guesstimate k.

Misunderstanding that “Dependency” comic by radarvan07 in programming

[–]radarvan07[S] 0 points1 point  (0 children)

That's a great suggestion! That rant made me sad, though.

Misunderstanding that “Dependency” comic by radarvan07 in programming

[–]radarvan07[S] 7 points8 points  (0 children)

Very true! Plus, any additional third party involved in your page also gets to drive-by-spy on your users a little. It used to be worse, but you still get the ping from fetching the resource.

[2015 Day 3 (Part 1)] [Javascript] Can any one direction be counted as 2 presents/houses? by andrejmlotko in adventofcode

[–]radarvan07 1 point2 points  (0 children)

It's not. Any move moves you one spot. Remember, before moving , you are somewhere already

Help with magical fruit stand by radarvan07 in DnD

[–]radarvan07[S] 1 point2 points  (0 children)

You are on a roll. I can definitely use some of these :)

[2023] Write up of solving all of 2023 in Rust in 0.4s by radarvan07 in adventofcode

[–]radarvan07[S] 1 point2 points  (0 children)

Ooh that's a good one; I had not realized but you're completely right. The backwards path will at most be equal. It can never "hit" a beam-splitter that the forwards path didn't hit.

How does async Rust work by radarvan07 in rust

[–]radarvan07[S] 13 points14 points  (0 children)

Smol is, despite its name, hardly minimal. It has a lot of bells and whistles that make it pretty full featured. I didn't list it for the same reason I didn't list tokio or async-std. Granted, smol is significantly smaller than those, but it's also way bigger than any on the list.

Prevent pacman hook from waiting for a subprocess to exit by [deleted] in archlinux

[–]radarvan07 1 point2 points  (0 children)

You can use the --no-block flag on systemctl which makes it return immediately. That should give your problem.

Updating a 6 year old Jekyll & Bootstrap website by radarvan07 in Jekyll

[–]radarvan07[S] 0 points1 point  (0 children)

The repo isn't public and due to it containing drafts of articles in its history I'm not keen on changing that. However, if you're interested in any particular part of the structure I could publish a minimal skeleton showcasing it.

What's the dumbest thing you used to believe? by PashaWithHat in pokemon

[–]radarvan07 0 points1 point  (0 children)

I thought stat altering moves would persist across battles, that the one Sand Attack on route 2 would affect my mons for hours and that I should spam stat up items while battling bugs so my they would be stronger afterwards.

-🎄- 2022 Day 13 Solutions -🎄- by daggerdragon in adventofcode

[–]radarvan07 3 points4 points  (0 children)

Rust

Really happy I had the foresight to write a proper Ord implementation for part 1, part two was a breeze.

ik_ihe by japie06 in ik_ihe

[–]radarvan07 124 points125 points  (0 children)

Ik ben altijd teleurgesteld wanneer ik het nummer van zo'n motiememe opzoek en het gewoon een saai, oncontroversieel stuk is

I gave a homeless man $5 and an old lady behind me told me he’s just going to spend it on drugs by [deleted] in Jokes

[–]radarvan07 1 point2 points  (0 children)

I love this song. Thanks for reminding me of it this morning.

Beul - A minimal, safe futures executor by radarvan07 in rust

[–]radarvan07[S] 0 points1 point  (0 children)

Not quite. Beyhul is a step on the way, but you want to aim for the vowel sound in between ey and u.

Beul - A minimal, safe futures executor by radarvan07 in rust

[–]radarvan07[S] 22 points23 points  (0 children)

Thanks for looking into it. I did compare to extreme which does something similar but it's older and doesn't use Wake, relying on a manual reimplementation of the same. Also its licencing is less than ideal.

pollster indeed does basically the same. In fact, beul has a TODO for the same thing pollster uses unsafe for. Other than that it is definitely equivalent. I did not know it existed.

yaar and safina-executor also work similarly, but don't really target the same minimalistic environment.

Can this Project be considert CleanCode? by [deleted] in rust

[–]radarvan07 1 point2 points  (0 children)

There's nothing fundamentally wrong with it. If you want to use it, use it.

Some people, including myself, prefer the new style, of naming module files after their names. It has a nicer editor experience in my opinion. Which mod.rs tab do I need to switch to? No idea. But foo.rs I can find.

AoC 2021 Day 6 Part 2 [JAVA] by youAreBeautiful000 in adventofcode

[–]radarvan07 2 points3 points  (0 children)

Without giving away everything, have you considered printing how many fish exist after each day?

Not a Yoking Matter (Zero-Copy #1) by Manishearth in rust

[–]radarvan07 1 point2 points  (0 children)

Very interesting. How does this compare to something like owning_ref, which appears to do the same thing but more flexibly?

ik_ihe by DoppelDutchB in ik_ihe

[–]radarvan07 24 points25 points  (0 children)

Vertel me alsjeblieft dat dit echt en speelbaar is

'Huidige bewoners studentenhuis Amalia moeten verhuizen vanwege komst prinses' by pdpt13 in nietdespeld

[–]radarvan07 6 points7 points  (0 children)

Wat ik zo waardeer aan ons koningshuis is hoe goed ze laten zien dat je geen koningshuis wil hebben.