You mean it's only included in the Plus Max Ultra Platinum VIP Extra™ plan? 😀
isti115
#FSharp
https://github.com/isti115/advent-of-code/tree/master/2024/day-01
I usually choose to learn a new language each year using these great little puzzles, this time it's FSharp. This naturally means that my solutions will be poorly written at first, since I'm not yet familiar with the language and make do with what I have. For example I'm pretty sure that there should be a better way to parse today's input instead of this monstrosity:
let pairs = lines |> Seq.map (fun l -> Regex.Matches(l, "(\d+)\s+(\d+)"))
let numpairs =
pairs |> Seq.map (Seq.head >> _.Groups >> Seq.tail >> Seq.map (_.Value >> int))
let numtups = numpairs |> Seq.map (fun p -> (Seq.head p, p |> Seq.tail |> Seq.head))
~~Also, I was pretty surprised that I couldn't find the unzip
function for sequences. I would've expected that to be present after using some other functional languages, such as Haskell and Scala. 🤔~~
Edit: Scratch that, I just need to convert the sequence into a list first... 🤦♂️ It actually makes complete sense. https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#unzip Also, I have managed to clean up the parsing a little bit.
Thanks for your input! To me it seems like Nemo
only counts the direct descendants and doesn't recurse, which makes it less useful for this purpose, but still nice to know!
Thank you for the idea! I didn't know about the --inodes
flag before, this seems like a viable solution for systems where I can't / don't want to install additional software!
Oh, wow, thank you! I had ncdu
installed, but it was an older version, which didn't yet have this feature. Now that I updated to the newest (Zig based 🎉) release this looks perfect for my needs!
Thanks! 😀
I've been meaning to post about that as well in order to keep feeding Lemmy with content, but couldn't find either an active alternative to ErgoMechKeyboards
or Battlestations
. 🤔
Well, I'd suggest asking around your nearest toddler, that's how I managed to borrow this one. 😀 Probably it has been inherited through several generations, that might explain it's wisdom!
Thanks for the advice, but lo and behold, the issue was actually caused by a newly introduced generic parameter not being defined after a dependency update. 🙃 Oh, the wonders of the JS/TS ecosystem...
Whoa, I just checked out some images, that one is on another level as well for sure. 😀 If he's as good at fighting bugs as criminals, you're in good ~~hands~~ wings!
Let me preface this by clarifying that I don't claim to have the one and only right explanation that everyone should accept, I'd just like to point out that this theory also exists: https://hermeneutics.stackexchange.com/a/43799
Yes, quite the role reversal between the parts from yesterday. 😀
I also like them (not as much as the originals, but there are some good ones among the new batch as well), luckily they seem to have returned back to normal!