Every time I use Zig, I love the result, but I hate writing it. The language is just a little too inflexible for quick and dirty solutions to quickly try out an idea or debug print something useful, but once you're done and have a result, it feels quite complete.
I reused my Grid struct from day 17 for part 1, just to realize that I'll need to expand the grid for part 2 so I awkwardly hacked it to be a Vec> instead of a linear Vec.
I solved task 2 by reading through the reddit thread and trying to puzzle together what I was supposed to do. Took me a while to figure it out, even with literally looking at other people's solutions. I wrote a lengthy comment about it for anyone that's still struggling, but I honestly still don't really understand why it works. I think I wouldn't have solved it if I didn't end up looking at other solutions. Not a fan of the "analyze the input and notice patterns in them" puzzles.
I'm a little confused about this one. The mappings are total, that is any number that is not defined explicitly gets mapped to itself. So it's easy to create an example where the lowest number does not get mentioned within a range:
Here, we have seeds 0, 1 and 2. seed 0 gets mapped to location 10, seed 1 gets mapped to location 11 and seed 2 gets mapped to location 2. That means location 2 would be the answer, but it's not a start of any range. I guess this just doesn't happen in any of the inputs?
EDIT: actually it's double weird. If you implemented a backwards search, that is you create reverse mappings and then try out all locations (which is what I and many others did), the result of the above example is location 0, whereas if you create a forwards brute force of all seeds, the result is 2. For the reverse approach to work in all cases, the mappings would have to be bijective.
tbf that's a lot easier to say when you're the president of one of the richest companies in the industry. I don't disagree, but not everybody has the resources to just keep developing forever, and that's easy to forget too.
The only feature I miss in the Epic client is a way to make yourself appear as offline. Other than that, Steam has a bunch of social features that I couldn't care less about.
I'm aware of nautilus-admin, but not only is it not maintained, imho it should be part of nautilus by default, and it has to open a new nautilus window when you use it. What I want is to drag and drop files to /usr/local and then get a password prompt to do the move. With nautilus-admin, I need to have the foresight to use "Open as admin" when going into /usr/local, but if I had that foresight then I might as well just start nautilus as root to begin with. Usually I just want to look into the folder, and only then realize I need to change something, which means a good old "go back up one folder, then search the local folder again, then right click, search for 'Open as admin', then get thrown into a new window, completely disorienting myself in the process".
Personally I never understood why file managers in linux refuse to do operations that require privileges. Guess what, if I have Nautilus open and want to move files into, let's say, /usr/local, I don't want to have to switch to the terminal to do so if I already have the stuff copied within nautilus. On Windows, I just get an admin password prompt if I try to do naughty stuff. On Linux, we have the whole polkit system, but no file manager seems to ever use it. Tbf, this is not a nautilus problem, as no file manager seems to do this.
Actually when it comes to C++ 23 library features, MSVC is ahead of both. In fact, as far as I can tell, MSVC is the only compiler that fully supports all C++ 20 core language features at the moment. So credit where credit is due, MSVC has gotten way way better the past few years. Visual Studio is still awful, but the compiler has become quite competent.
IntelliJ and PyCharm are the only JetBrains IDEs with community editions. If you want to use CLion for example, you'll either have to be a student or you have to pay.
The MS extensions are quite convenient, like Live Share and the MS C/C++ extension. There are equivalent free versions, but those are more work to setup and might not have the full feature set.
Haven't seen anyone mention the Zed Text Editor yet. It's only available on MacOS as of now, but I've tried it out a bit and once it's more mature (and available on other OSes), I might switch over from Sublime Text. It's got a similar speed as Sublime, but with LSP, vim emulation and collaboration features built in, whereas in Sublime I need to install packages to achieve the same. Also made by the same people who originally made Atom and Treesitter.
I also want to mention Onivim. Unfortunately, development has stopped, so it's not really a viable option anymore, but I loved the idea. The idea was to make a vscode/vim hybrid. To that extend, it's written in Reason which allowed them to support vscode extensions, thus they didn't have to create their own extension ecosystem, while still being faster than electron. As for the vim part, the entire editor could be controlled with a keyboard. They had a global shortcut to go into a "UI move mode" so to say, which allowed you to go to every single piece of UI you had on screen. Thus they were able to copy the vscode UI, but still be keyboard-only. It was a surprisingly effective idea, so I hope some people can revive it someday.
I think Zed looks really promising in that regard, although it's only on MacOS so far (but other OSes will come). It feels like sublime text, but with modern LSP, vim emulation and collaboration features built in.
The way UTF-8 works is fixed though, isn't it? A new Unicode standard should not change that, so as long as the string is UTF-8 encoded, you can determine the character count without needing to have the latest Unicode standard.
Plus in Rust, you can instead use .chars().count() as Rust's char type is UTF-8 Unicode encoded, thus strings are as well.
turns out one should read the article before commenting
I've turned off Updates with group policies and have not had an issue with that ever since Windows 10 got released. Afaik the same can be done with registry when on Windows Home. It will still check for updates, but if set up correctly it should not download nor install them.
Zig
https://github.com/Treeniks/advent-of-code/blob/master/2023/day22/zig/src/main.zig
(or on codeberg if you don't like to use github: https://codeberg.org/Treeniks/advent-of-code/src/branch/master/2023/day22/zig/src/main.zig )
Every time I use Zig, I love the result, but I hate writing it. The language is just a little too inflexible for quick and dirty solutions to quickly try out an idea or debug print something useful, but once you're done and have a result, it feels quite complete.