I agree that the comment sounded pretty hostile, but I also agreed with the assessment that it might be better to avoid allocation in general. I know the code in the post is highly simplified, but you aren't exactly fully using "lazy iterators," at least in the post. refresh/load_hotels is still allocating new Hotels, each of which contains a one-million-element Vec. If you could reuse the existing self.hotels[id].prices Vec allocations, that might help, again at least in the example code.
On second glance, I guess this is what you're getting at with the ArcSwap comment in the post. It sounds like you really do want to reallocate the whole State and atomically swap it with the previous state, which would make reusing the prices Vec impossible, at least without keeping around two States and swapping between them.
Anyway, tone aside, I still think the comment had validity in a general optimization sense, even if not in this specific case.
Yes, at least the parts that my research group used regularly. I ported them to Rust, though, not modern Fortran. They're also pretty specific to computational chemistry, rather than general packages like PRIMA, but I'll link them here in case you're curious anyway. I was also still learning Rust and followed the original Fortran API and naming scheme where possible, so this code could use a refactor too! But at least there are no gotos.
In grad school I worked on three separate Fortran code bases written as early as the 80s with tens of thousands of lines, no source control or version history, no build systems or even build scripts, and no tests. I think a lot of old scientific software is in the same condition, with some mix of "if ain't broke don't fix it" and the code being very hard to refactor.
This quote from the linked PRIMA page pretty much sums up my experience porting the above code too: "I hope I am the last one in the world to decode a maze of 244 GOTOs in 7939 lines of Fortran 77 code — I did this for three years and I do not want anyone else to do it again"
Yeah the article says these "aren't used anymore," but my image viewer (sxiv) complained that the gif was corrupted until I put something there. It still displayed the image, but it also complained afterwards.
Those examples contain overlap, but not in the first or last digit that is given as the solution. So from the instructions you can't tell that the intermediate list of numbers should be 8, 2, 3, you only know that the final answer is 83.
Personally, I got tired of weird quirks like this with vterm and now bind this command to the key I used to have vterm on to spawn my actual terminal (st) in my current directory. It's probably not what most people want from vterm, but I prefer it.
In org-alert we use `org-map-entries` and a simple `org-alert--parse-entry` function for stripping out the details we're looking for. Depending on what you want, it's not exactly a data structure, but maybe it will help you get started!
It already is! I've been building Emacs from the development branch for the last couple of years, and the improvements in 29 and now 30 have really been great. I barely remember the sluggishness the other comment mentions.
I agree, it's not about it being "easy" to find the documentation or "easy" to watch the video. This is the landing page for the project, and I'd much rather see the commands in the video listed out on the page rather than having to watch someone else's terminal session.
I was recently looking at nushell, and that website has exactly what I would expect to find: example input with screenshots of the output instead of a video.
The example in previous versions of the Go math/rand package suggested using time.Now().UnixNano() to seed the RNG source since that's essentially a random int64.
Not sure exactly what they meant, but I assume most arguments in this vein have something to do with form. A well-executed deadlift is a great exercise, but you have to balance the risk of injury, especially for new lifters without a trainer or coach to help with their form.
For strength training StrongLifts seems like a good program. It used to be highly recommended on the fitness reddits, but I haven't followed them for a few years. Regardless, I think it's a solid program for starting strength training. I do more of a bodybuilding/bro split, but I've been mixing in a couple of heavy days modeled after the StrongLifts plan. It's certainly simple if nothing else.
So write it locally in an unshared document and paste it into overleaf when you want someone else to see it? I don't like overleaf to begin with, but to feel this tied to it is a bit wild.
I think that's pretty clearly not the point. As someone who has worked with legacy scientific code written in Fortran, the copying is not the issue, it's blindly copying code that was written 50 years ago, probably by a graduate student, and not reviewed or revised in any way since. As the parent comment points out, if everyone reuses that code, the same errors propagate. It's not the type of reuse that comes with a nice GitHub repo and an established mechanism for reporting and fixing bugs.
In my case, one of the Fortran files essential to my group's research has 11 (!) versions with only filenames like file.f.goodworking (that's literally one of the extensions) to differentiate them and no version control or history.
On second glance, I guess this is what you're getting at with the ArcSwap comment in the post. It sounds like you really do want to reallocate the whole State and atomically swap it with the previous state, which would make reusing the prices Vec impossible, at least without keeping around two States and swapping between them.
Anyway, tone aside, I still think the comment had validity in a general optimization sense, even if not in this specific case.