What do mature network applications do instead?
> assert(data_buf[4] < 8);
While your protocol might guarantee that data_buf[4] should always be a value less than 8, you don't use assert() to check it because it aborts the program if the check fails. The proper thing to do is a range check that returns an error for a protocol error (malformed data, etc.).
ZeroMQ literally called assert and any bad data coming in over the wire would cause your app to abort. Insane.
Here is an example bug report:
https://github.com/zeromq/libzmq/issues/186
Keep in mind this was a LONG time ago! So this is not an indictment of the current project!
Because of the focus on mass manufacturing, hardware is incredibly expensive to change. The industry seems to have centered around doing more planning up front.
But we (software people), learned 20 years ago (from select Hardware companies) that this is backwards. If the cost of change is high, and that's where your pain is, change more frequently. Mitigate that pain and make it a strength. (See: Toyota Production System)
I have a product with an addressable market of something like 300 to 500 units per year. That puts me in the Defense/Aerospace/Medical area, where unit economics are completely insane.
And yes. It does feel like being ripped off when someone puts ~30 minutes ($20 max) of Western labor into something and then turns around and charges me $800 for the privilege of supporting an American company.
I have manufactured in that area and while you are not going to be in the mass volume pricing levels, you don't have to be in the defense level either. You just have to build the product with the right trade-offs and design the appropriate manufacturing processes. Few seem to know how to do this.
Edit: let me expand. Don't injection mold if you can avoid it. Do resin castings or thermo-forming, neither require as expensive of tooling. 3D print parts with a good material like PC CF. Metal fabrication is easy and cheap these days. You can get a shop to laser cut, form, insert PEMs and powder coat for very reasonable prices. We are starting to get a lot of machined parts from China. You can source wire harnesses from China also. Do assembly with a small team. Use as much off-the-shelf electronics as possible, but don't be afraid to make small and simple PCBs if it makes your product cheaper and simpler. Leave the complex boards to a vendor initially because while they might seem simple to design, they can be complex to debug and production test properly.
ZeroMQ was absolutely solid and stable; incredibly trouble free and the only issues we ran into were when IT teams didn't open the ports we documented in the configuration procedure. (The resultant architecture actually looks a lot like Flink)
In any case, ZeroMQ is a fantastic piece of technology that I feel like I don't see out in the wild quite enough. It's dead simple and incredibly stable from my experience.
User Story:
As a Private Citizen and Engineer, I want a graphical multi-input interface to load, view, interact with and post documents to remote and local HTTP servers ("web-browsing") on any personal computing device. I want web-browsing to have out of the box default security and privacy guardrails that are well documented can be disabled or modified by me the user and only me the user. I want this software to be fully modifiable by any person using tools that are easily, freely available and accessible (aka FOSS). I want this capability to be free at the time of use with no restrictions on amount scope or scale of use.
I think the above describes the product that everyone wants
It sure sounds a lot like Firefox to me
Why aren't we collectively putting our time/effort etc.. into making Firefox the singular and best FOSS browser ever?
edit: Oh I didn't realize that Brave totally abandoned their model and started taking Venture from RGA and Page One in 2019. Game has been over since then at least: https://www.crunchbase.com/organization/brave-software/compa...
IIRC, their interfaces were used in some Sony play-stations and also some Intel systems.
If the power goes out, I can't get any cash. I don't keep any meaningful amount cash on hand and neither does anyone I know, including my elderly relatives. Most of the stores I shop at won't actually be able to sell me anything, because none of the products have price tags and I sincerely doubt that any of their staff are trained to revert to pen-and-paper accounting. Even if they did manage to keep things running, they'd likely run out of change by the end of the day. The grocery stores are JIT and have no more than a few days of stock of anything; again, I doubt there's a manual backup to their reordering system.
Maybe things are different in countries with less reliable infrastructure, but I just can't think of a scenario in which cash would gain you any appreciable amount of resilience without much wider systemic changes. So much other stuff beyond payments is wholly reliant on technology. I'm not sure that would be a wise investment versus improving the resilience of power distribution and network infrastructure.
It goes B, KiB, MiB, GiB, TiB, EiB and no more than that (in all the answers) so that can be solved with three if statements at most, no five.
I mean: if it's greater or equal to GiB, you know it won't be B, KiB or MiB. Dichotomy search for the win!
Not a single of the hardcoded solutions do it that way.
Now let's go up to ZiB and YiB: still only three if statements at most, vs up to seven for the hardcoded solutions.
I mention it because I'd personally definitely not go for the whole log/pow/floating-points if I had to write a solution myself (because I precisely know all too well the SNAFU potential).
I'd hardcode if statements... But while doing a dichotomy search. I must be an oddball.
P.S: no horse in this race, no hill to die on, and all the usual disclaimers