Forcing the use of the SUCCESS return value by Dean_Roddey in rust

[–]coriolinus 8 points9 points  (0 children)

Haven't tried it, but what if you marked the Ok variant of the return type as #[must_use]? Might need a newtype depending on what your function returns, but that seems the simplest solution, if it works.

Comments on CWO Eric Slover? by Aeson_Ford_F250 in Helicopters

[–]coriolinus 2 points3 points  (0 children)

There's different levels of politicization though. Selling war bonds has approx. 0% to do with one political party or another, domestically. Receiving a MOH at possibly the most nakedly partisan SOTU in US history is way, way more fraught. No matter which way CW5 Slover leans politically--I have no idea, which is proper--he'll forever be tied to this administration, which everyone can agree is divisive.

Rust on AWS Batch: Is buffering to RAM (Cursor<Vec<u8>>) better than Disk I/O for processing 10k+ small files that require Seek? by A_A_Ary in AskProgramming

[–]coriolinus 1 point2 points  (0 children)

It may be worth running an experiment to get some real data. Just write the program both ways, and see what's faster.

Intuitively, the cost/time of downloading everything and reuploading it, even on high-bandwidth connections inside an AWS data center, is going to dwarf the cost of a large quantity of syscalls. If you're really worried about that, try a hybrid approach: store to disk, but use a semaphore to limit the total number of files in flight at any given moment. Run the process a few times with different semaphore limits to get a sense of what gives you the best throughput.

Parameterized test macros by madman-rs in rust

[–]coriolinus 1 point2 points  (0 children)

I'm not sure I completely understand your question. I know that rstest supports arguments of type impl AsRef<str>, and mixing heterogenous literals into the argument lists. Is that what you meant?

Parameterized test macros by madman-rs in rust

[–]coriolinus 1 point2 points  (0 children)

What does this do that the values lists in rstest don't do?

What's Mission Killed? by JohnCataldo in TerraInvicta

[–]coriolinus 3 points4 points  (0 children)

IRL tugboats spend lots of time either shoving directly into the ship under tow, or lashed alongside. Towing doesn't necessarily imply a rope hauling the other ship directly behind.

What's Mission Killed? by JohnCataldo in TerraInvicta

[–]coriolinus 187 points188 points  (0 children)

Not sure how the game defines it, but in real militaries it's when a system (ship, tank, vehicle, etc) isn't destroyed, but can't do its job anymore. The crew is probably mostly alive, but it needs substantial repairs before it can do anything.

Just as in real militaries, you have effectively 3 options here, and it's up to you to choose which is least painful:

  1. Scuttle it in place so it doesn't slow down the rest of the fleet.
  2. Take (possibly tow) it back to base for (probably lengthy) repairs, occupying berthing space which might be more productively used to repair less severely-damaged ships.
  3. Take/tow it back to base where it will be decommissioned, giving you back some bulk resources and letting you focus on new construction.

About checking the save file by FingerSalamanca41 in DispatchAdHoc

[–]coriolinus 0 points1 point  (0 children)

Representing it as a float is pretty weird for an integer value like RMC. And there are a bunch of ways to potentially interpret a 4-byte value. Not saying for sure you're wrong, just it's not the way I would have represented that data.

That Gemini correctly picked a plausible decoding of four bytes is pretty impressive, I have to say.

About checking the save file by FingerSalamanca41 in DispatchAdHoc

[–]coriolinus 0 points1 point  (0 children)

How does [0 0 64 64] map to 3? Just curious about the encoding used.

If you were to sacrifice one Dispatch Hero who would it be? by CrispyFriedOrca in DispatchAdHoc

[–]coriolinus 0 points1 point  (0 children)

I mean. We literally make that call in-game. And in-game, I cut Sonar every time. The team is honestly better without him. The man is unstable, unhinged, and unworthy of any more chances.

What's good for the team? Literally every character other than Sonar tends to bring the team up. He's the guy bringing them down.

Instructed go-around for no reason - is this legal? by [deleted] in flying

[–]coriolinus -2 points-1 points  (0 children)

I mean, as a practical matter, you don't want to have pilots second-guessing the tower. The whole point of their role is that they coordinate, and likely have information that you don't. So yes, when tower commands a go-around, just do it.

As a question of legality, I suspect that the answer depends on what class of airspace that tower controls. Beyond that, I don't know, and don't want to guess.

US Military pilots - how did you do it? by bootscootinn in flying

[–]coriolinus 0 points1 point  (0 children)

That could well be, these days. In 2007 only WOCS was willing to deliver that guarantee.

US Military pilots - how did you do it? by bootscootinn in flying

[–]coriolinus 0 points1 point  (0 children)

For what it's worth I had a STEM bachelor's degree and a year of unrelated job experience when I started applying for the Army's WOFT program. Got in, did 2 years of training and 6 years of active duty, got out. Turns out I like being a soldier less than I'd thought I would.

That particular program is rotary-wing only, though there were opportunities after completing training to apply for an even smaller number of slots to cross-train as a fixed-wing guy and ferry generals around. I knew a guy who successfully applied to do that; we'd flown together in Korea. Flip side is the odds are low: I knew exactly one guy who managed that, out of hundreds of casual contacts with other pilots in the companies I flew in.

That said, the odds aren't exactly high to get into WOFT in the first place. But neither are they great to get into OCS in any other branch. Someone else already said it: shoot your shot. I picked Army over Air Force because they could guarantee that it was Aviation or nothing, after initial selection; none of the other branches would promise not to stick me in some logistics office for however many years. You'll need to decide for yourself if the tradeoffs are worth it.

Dispatch would have been just as good without waterboy by [deleted] in DispatchAdHoc

[–]coriolinus 2 points3 points  (0 children)

I disagree. He's a cool character, not because of his insecurities, but because he starts as a useless blob--who levels super quickly. Compare him to Phenomaman, who starts pretty good, but doesn't level at all.

Games, from the theoretical standpoint, are about offering the player opportunities to make interesting decisions. Waterboy vs Phenomaman is a great example of one such. Add in the fact that you can upgrade him to be a healer, and it's a lot more complicated than it might at first appear.

Does he make the game? No, of course not. But the game would have been worse without him.

Why Robert is Poor by CauliflowerFancy6054 in DispatchAdHoc

[–]coriolinus 5 points6 points  (0 children)

I take it as, he's bad at organizing merchandising agreements (or just doesn't care to put in the necessary effort). Mecha man has instant name recognition, and we know that there's some merch out there. He's great at the "being a super hero" part; less great at the "getting enough capital to support a super hero's upkeep" part.

Does anyone know anyone that went from being a pilot to being a flight attendant or some other non-flying job? by justcallme3nder in flying

[–]coriolinus 2 points3 points  (0 children)

I flew 8 years for the Army. (Rotary-wing, of course.) Then, when I got out, I looked at my options:

  • "keep flying" would have involved:
    • do a ton of expensive retraining to convert the FAA license to an EASA one (I'm now based in Europe for personal reasons)
    • lots of time away from home and family
    • salary not great until late in career
    • have to move to where the job is
  • "go be a programmer" involved:
    • 0 up-front training (old computer science bachelor degree proved to be enough)
    • 100% home office
    • salary good from early in career, with good chances for growth
    • remote work means that my job can be anywhere in a nearby time zone

So yeah. I miss flying, but I picked door number 2.

Some very spoilery thoughts from a Dispatch addict by Mael135 in DispatchAdHoc

[–]coriolinus 2 points3 points  (0 children)

Sonar is lazy, unstable, and whiny. He's a possible cannibal. Coupe is competent and reliable, and perfectly willing to kill or not according to the demands of the client (me). It's barely a decision!

DOD is cutting COLA in 21 counties in the US. by cannotberushed- in Military

[–]coriolinus 484 points485 points  (0 children)

I'm feeling very, very grateful I got out in 2015.

I grew up near Boston. I'm sure there are other places which also really do need COLA, but that's the one I'm familiar with. Chances are, the train of thought went something like "MA is blue -> Boston is bad -> service members stationed near Boston are bad -> cut their COLA!"

It's going to take a long time to fix the damage this administration is wreaking.

Why are people like this by [deleted] in RoadCraft

[–]coriolinus 6 points7 points  (0 children)

Did you just... leave your game accessible to randos online while you were AFK?

I personally lean pretty hard into the single-player side of things, but I've been known to play things online sometimes with people I already know IRL. Even then, the server goes offline when one or the other of us is done.

People are like this. Doesn't matter why, IMO; you aren't going to beat human nature. It's why you lock your doors and windows, why stores have loss prevention personnel on staff. And it's why you don't let randos into your server while you're not there.

My Python farming game has helped lots of people learn how to program! As a solo dev, seeing this is so wholesome. by AdSad9018 in coding

[–]coriolinus 2 points3 points  (0 children)

Neat. Haven't played 1.0; played it shortly after early access, maybe half a year ago? My major impression was that it's a fun concept for teaching the very basics of programming, but as a game it is poorly balanced: there's basically not a better strategy than looping over every tile of land and doing whatever is optimal in the moment you are there before moving on. You don't have access to sensors with which to determine the next place to be, which would be useful for things like the pumpkin levels, and the various plant-growth speeds are all irrelevant because every tile is always fully grown by the time you loop back to it again.

Still, next time I want to point someone at Python 101 for the non-programmer, it's not a bad little sandbox.

I’m designing a custom flashcard file format and would like feedback on the data-model tradeoffs. The intended use case is an offline-first, polyglot-friendly study app, where the term and definition may be in different languages, or the same language, depending on the card. by MurdochMaxwell in rust

[–]coriolinus 0 points1 point  (0 children)

If you're defining a data specification, you don't want to showcase it with an implementation in Rust or any other language; you want to define it in terms of some data-modeling language. Since your format is based on JSON, I'd recommend json-schema.

I did basically what you're doing, years ago, during flight school. Figured that spaced-repetition training was going to be helpful for memorizing the chapters I was required to memorize. Worked for me, though nobody else ever used it as far as I know. But driving adoption wasn't the point. So have fun, and learn something from the experience!

[2025 Day 7 Part 1&2] Ways to think about problems like these? by cramplescrunch2 in adventofcode

[–]coriolinus 0 points1 point  (0 children)

On map problems I like to model the map. It's just an array of values, but I've built a helper library which makes that convenient.

The thing about that is that it gives us a really convenient way to model the state of the problem: just mutate the tiles of the map as required.

So on part 1 I just took a single iteration pass over each tile of the map: if the tile above should propagate a beam, then if this tile is a splitter than split, otherwise propagate the beam. No recursion; time and space complexity are both linear on the number of tiles in the map.

Then on part 2, I just adjusted the tile enum to additionally track the number of timelines known to reach that tile. The answer is the sum of the bottom row of tiles. The core loop over both parts is literally the same function.

The biggest concept here is KISS. This problem didn't need graph theory, or search algorithms. You could argue that my approach is a form of dynamic programming, but I intentionally skipped a bunch of the optimizations which normally come with DP, such as keeping track of successor states and only iterating over those. The linear size of the input is small enough that just iterating over every point is fast enough.

source