isti115

joined 2 years ago
[–] [email protected] 2 points 3 days ago* (last edited 3 days ago) (1 children)

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!

[–] [email protected] 3 points 3 days ago* (last edited 3 days ago)

You mean it's only included in the Plus Max Ultra Platinum VIP Extra™ plan? 😀

 

I just logged in today and found that all stories seem to be gone from my path and the practice hub as well. 🙁 I really hope that this is only something temporary!


Edit: I just checked after about ~10 hours and they seem to have returned!

[–] [email protected] 2 points 2 months ago* (last edited 2 months ago)

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

2
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 

Feel free to share your solutions or browse others' for inspiration! Please tag your comments with the language you solved in to make it easier to search for specific languages in case we happen to get more comments than expected. 😀 I really hope that we can create some discussion here to liven up this community!

 

In preparation for this year's event I started to create a utility library and realized that I might not even need to care about decimal, or even fractional numbers, as I don't remember ever encountering them while solving a problem so far. Does anyone have any examples for problems which required using floating point calculations? Is it maybe even explicitly stated that they are not needed? (I remember that Google Code Jam had some statistical problems where the solution didn't have to be exact, just within an acceptable error margin, but that isn't likely to happen here, right?)

 

I remember that way back around 2015 the double XP boost used to stack, so you could get a 4x multiplier, but I don't think that I've ever got a triple.

 

It seems that they have accidentally posted the announcement earlier than intended, but it will probably show up later during the day.

[–] [email protected] 1 points 11 months ago (1 children)

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!

[–] [email protected] 3 points 11 months ago

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!

[–] [email protected] 3 points 11 months ago* (last edited 11 months ago)

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!

 

There are plenty of utilities (GUI, such as filelight and TUI, such as dua as well) for analyzing disk usage by space, but I would like to view my folders based on the count of files, as I'm making backups, and folders with lots of small files (e.g. node_modules) take very long to move around, so I guess that I'd be better of compressing those into a single file before archiving, as it's already highly unlikely that I'll need to access them anyway. Thanks for any pointers in advance!

[–] [email protected] 2 points 1 year ago (1 children)

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

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago)

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!

[–] [email protected] 7 points 1 year ago* (last edited 1 year ago)

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

[–] [email protected] 3 points 1 year ago

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!

 

If the rolling wooden variant still turns out not to be enough, I might need to source a real live duck. 🦆 Not sure how patient that would be at listening to me explaining code though. 🤔

[–] [email protected] 2 points 1 year ago (1 children)

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

[–] [email protected] 1 points 1 year ago

Yes, quite the role reversal between the parts from yesterday. 😀

 

After getting a comment from the creator of kanata (an awesome piece of software by the way) that he found my story amusing, I figured that I'd also post it here, partly as fun, partly as a cautionary tale. Also, I'd appreciate any tips as to what to check for in my system, it's a weird feeling to know that some stuff might have been messed up under the hood.

 
view more: next ›