Better HN
topnewbestaskshowjobs
Log inSign up

ComputerGuru

32,383 karma · joined Jan 3, 2008 (18y ago) · 8,295 submissions

mqudsi on most sites.
Submissions

comment 3y ago · link · parent

If you ignore the "best by" label on UHT milk, it can easily (safely) last 8 months. Especially if you store it at 32/33° F.

But more practically, there are different types of containers for UHT milk hermetically sealed to different extents. The more expensive kinds can last years. The US Military says 10 months for "normal" UHT milk stored under "normal" conditions [0]. The more expensive kinds can go much longer.

[0]: https://www.dla.mil/Troop-Support/Subsistence/Operational-ra...

comment 3y ago · link · parent

That second greenhouse picture is a nightmare! If it were anywhere else on the planet, I'd say someone needs to trim the tomatoes and give them some breathing room to avoid fungal infections but the low humidity and the carefully cultured environment probably take care of that.

comment 3y ago · link · parent

Here is as good of a place as any to ask: does anyone know of an embeddable scripting language pretty much exactly like Lua but with more C-like syntax?

EDIT: the best alternatives I'd previously found were rhai (still niche and weak library) and sandboxed JS (heavier than I would like and the standard library is still poor).

comment 3y ago · link · parent

Their app has been showing advertisements in notifications for the past few months, where previously a notification was only generated if movement was detected while the cam was in away mode (i.e. a serious matter).

comment 3y ago · link · parent

J’ai drapeaué

comment 3y ago · link · parent

Interesting that it took AI to pull this off. I think mutagen testing would have discovered the first (by virtue of checking which code isn’t necessary globally) though likely not the second (which needs a new branch, unless that branch was already there?).

comment 3y ago · link · parent

As a Dvorak user (for 20 years now), I always say "I came for the speed benefits that never materialized, but stayed for the ergonomics (reduced strain)"

comment 3y ago · link · parent

RL: Reinforcement Learning

comment 3y ago · link · parent

Another poster shared this link: http://www.highprogrammer.com/alan/numbers/dl_us_shared.html

It has the encoding formula for Wisconsin, Illinois, and Florida (which match the parent's comment) but there may be others.

comment 3y ago · link · parent

Tip: you can favorite the submission then un-favorite it after you've read it.

comment 3y ago · link · parent

> Or maybe they'll buy the most popular cross platform client and retool it to be official.

They did that already. AlienBlue was then the Reddit iOS client that Appllo is now. Reddit bought it, gutted everything that made it good, then released it as the official iOS app.

comment 3y ago · link · parent

> some makefiles were not well constructed in terms of dependency ordering, so would break⁵ with make -j even without my hack layered on top

That remains true to this day of even makefiles from some really big name projects. Huge pet peeve of mine and I’ve filed PRs with fixes many times.

comment 3y ago · link · parent

I love your comment and it is 100% spot-on. extern C is the magic sauce for making anything fast.

The only downside is that it adds a ton of boilerplate and a lot of maintenance overhead. You need separate compilation units for everything and then you need a sub-struct to use the pimpl approach. Fast pimpl (in-place new in reserved space in the parent struct itself) gets rid of the heap allocations but you still have a pointer indirection and prevent the compiler from properly stripping out unused code across translation units normally (that’s where LTO comes in these days).

Really, the problem is just that it’s a PITA to write compared to sticking everything in the header file.

(It’s ironic that rust meets the first two rules by design but is still much slower than C++ to compile, though it does imply what’s already known, specifically that there’s a lot of room for improvement.)

comment 3y ago · link · parent

> their CPUs are close enough I might be able to use ccache, too

It’s the compiler that needs to line up for that. But my recommendation is to install sccache which will figure it out for you.

comment 3y ago · link · parent

Someone else asked this upstream, but don’t you “share” your privileged communications with your (and your lawyer’s) email provider when corresponding without E2E encryption?

A third party can be necessary to facilitate the communication between the client and the attorney. A clearer example was if you needed an interpreter to speak to your lawyer - surely that conversation remains privileged and the third party in the room cannot disclose what was learned?

comment 3y ago · link · parent

As much as the broader programming world is loving WASM as a barebones VM and sandbox, it ultimately was created to further the interests of the organizations championing it and their desires and it's clear that making it a complete JS stand-in is the direction it is heading. GC is only a question of time.

comment 3y ago · link · parent

> But the Supreme Court disagrees with me on parts of that.

To be fair, I think SCOTUS disagrees with itself on some parts of that.

comment 3y ago · link · parent

WTF locks under C++ and Parking Lot under rust are great low level futex-esque cross-platform abstractions/implementations. They originate from the WebKit codebase (unless it was Blink but I think they predate the fork).

They run under Windows, Linux, the various BSDs, and macOS.

comment 3y ago · link · parent

No, it compiles to a state machine (there is no “background”) and you just loop over the fixed list of futures/tasks in your main calling next/poll() to step through the states - there is no runtime so you have to do that yourself.

comment 3y ago · link · parent

It depends on how they classify them but in many systems sales is separate from the rest because you generate quotes and invoices and mark them as sold but reconcile that against the actual line items in your bank account separately. I.E. sales isn’t ( ecessairly) a subset of all transactions but entirely apart. In addition to sharing few fields and having more columns all to itself, it can just be semantically completely orthogonal to the journals.

But I say all this not having looked at this product and I don’t know if sales here works that way or not.

comment 3y ago · link · parent

I do embedded development in rust on severely limited/constrained MCUs and agree with that being the biggest hurdle. There are resources to detect any panics in the resulting binary and bail as well as the compiler option to halt rather than unwind on panic. Together with a custom panic handler you can get most of that in check. Oh and you really have to compile in release mode or a profile derived from it - debug is just too damn big.

The bigger issue is that you are at the whims of llvm as to what your codegen looks like. Regressions as llvm versions are upgraded are routine and can sometimes result in significant regressions on micro benchmarks. The good news is the rust team treats these pretty seriously even if they do take time (and several versions) to get fixed but you’ll never see the issue closed out in the issue tracker. All of performance regressions, codegen bloat regressions, and llvm optimization failures (eg not stripping out a panic handler in safe rust when it should be possible to deduce that the panic cannot be reached) are all tagged and monitored and tests are often added to catch regressions once fixes land. The good news is that when you run into these in safe rust you can usually work around them with unsafe rust - unreachable_unchecked() is your best friend here and is amazingly easy to use either with an if or with a match to disavow a potential state before the code that handles it.

comment 3y ago · link · parent

Because a function can be assumed to work one or two ways and nodiscard can prevent you from assuming the wrong thing. Imagine a fake string::concat(other) that does what it says on the tin. You can assume it appends to s but what if it allocates a new str instead? You label it with nodiscard because there is literally zero purpose in ever calling this method but ignoring the result - if you ignore it, it’s as if it was never called (since the existing variables were not modified) except you paid the price with the allocations. So either use the result or drop the call.

Using it to enforce that every return value is handled is stupid as it can lead to error blindness and you’ll ignore it when you actually need it.

comment 3y ago · link · parent

Oh what a shame! I just replied to the parent comment (before seeing your reply) about how incredible async/await “coroutines” were with embedded rust requiring actually zero runtime cost (no alloc, no runtime, no dynamic scheduler).

comment 3y ago · link · parent

Async/await in no_std rust was a godsend for embedded firmware and driver development, turning really simple and linear code into a tiny state machine with zero alloc and no runtime cost. I can imagine how coroutines could provide similar for C++.

I migrated a rust LoRa driver from traditional blocking to async/await in order to test two modules in simultaneous send/receive mode as part of the test suite on a single STM32 chip. Aside from pleasing the HAL abstraction by bubbling all the generics throughout, it was an entirely pleasurable experience and made much better use of available resources than the traditional approaches without having to manually manage state across yield points or use a dynamic task scheduler. No OS, no runtime, no manual save/restore of stack, no global variables. It is really the future of the truly micro barebones embedded development.

comment 3y ago · link · parent

> If you go to ChatGPT and just ask it, you’ll get the equivalent of asking Reddit: a decent chance of someone writing you some fan-fiction, or providing plausible bullshit for the lulz.

I disagree. A layman can’t troll someone from the industry let alone a subject matter expert but ChatGPT can. It knows all the right shibboleths, appears to have the domain knowledge, then gets you in your weak spot: individual plausible facts that just aren’t true. Reddit trolls generally troll “noobs” asking entry-level questions or other readers. It’s like understanding why trolls like that exist on Reddit but not StackOverflow. And why SO has a hard ban on AI-generated answers: because the existing controls to defend against that kind of trash answer rely on sniff tests that ChatGPT passes handily until put to actual scrutiny.

comment 3y ago · link · parent

I’m certainly not discounting your experience but do you really think this is something that took shape only over a couple of weeks? Or did you mean that you woke to the realization?

comment 3y ago · link · parent

The economic benefits of NATO for the USA wouldn’t change much today if Germany had its own troops instead of the US troops stationed there. Of course, if the troops were never there in the first place, that’s a different matter.

The biggest actual difference isn’t US troops stationed in NATO countries but rather the extent of the US as a global reserve currency and the power of the petrodollar. The concerns over these are well-founded as the powers that be have willingly traded the latter in exchange for upping the US’ position in the current brinksmanship with Russia, when Russia was never the economic juggernaut to be reckoned with and certainly not worth giving up those cards for.

comment 3y ago · link · parent

Looking at government benefits has its own set of shortcomings - it hides the struggle of “the middle class” where “middle class” is defined as starting at the point where one no longer qualifies for the most substantial government wealth transfer programs.

comment 3y ago · link · parent

That comparison only holds for the smaller sizes.

comment 3y ago · link · parent

pg_upgrade is not an option on many systems if you are installing with the package manager as it requires both old and new binaries to be simultaneously present.
1
606162
277