This is not cool of Twitter.
Gobbel2000
Being active is probably most important.
Maybe it would be possible to get a link into a "This Week in Rust"?
Where are these circles coming from!?
That commonwealth is called the EU today and, along with NATO, is the reason why these countries are in a comparitively safer position. It would be much riskier for Russia to invade there.
lemmy.made.me.look.at.this.each.time.i.open.a.terminal
Hostnames can be up to 64 characters long in Linux.
I use Colemak where most punctuation is at the same place as in the US English layout, which programming languages seem to be optimized toward. For the layout I prefer ISO for the larger Enter key.
That's sad that Mozilla has to take it into their own hands to provide a proper alternative to Snap Firefox.
"Würstel Bianchi" als Übersetzung von Weißwürsten finde ich gut.
Rust
I simply check each starting position individually for Part 2, I don't know if there are more clever solutions. Initially that approach ran in 180ms which is a lot more than any of the previous puzzles needed, so I tried if I could optimize it.
Initially I was using two hash sets, one for counting unique energized fields, and one for detecting cycles which also included the direction in the hash. Going from the default rust hasher to FxHash sped it up to 100ms. Seeing that, I thought that this point could be further improved upon, and ended up replacing both hash sets with boolean arrays, since their size is neatly bounded by the input field size. Now it runs in merely 30ms, meaning a 6x speedup just by getting rid of the hashing.
You can create an array filled with all the same values in Rust, but only if all values have the same memory representation because they will be copied. That just doesn't work with Vec's, because they must all have their own unique pointer. And to have uninitialized values at first (think NULL-pointers for every Vec) while creating each Vec, something like this is apparently needed.
The appropriate way would certainly have been to store the map as a Vec>
instead of an array, but I just wanted to see if could.
Rust
Part 1 was super simple with wrapping_add
and wrapping_mul
on a u8
. Building an actual hash map in Part 2 was nice.
Hui, wie divers!