Better HN
topnewbestaskshowjobs
Log inSign up

masklinn

69,262 karma · joined Apr 25, 2009 (17y ago) · 21,100 submissions

Submissions

comment 1d ago · link · parent

I don’t disagree that `continue-on-error` is error-prone and should be warned about, but if the team actively wants to bypass the sec scan they can just… remove it, or replace it with an always-passing job/step.

comment 3d ago · link · parent

You want mist to weigh down the dust on the ground, but rain means runoff and now the dust doesn't just get settled on the ground, it gets carried away.

comment 3d ago · link · parent

> I can see at least ONE scenario where this substance was stockpiled for good reasons at first,

The problem is not the stockpile, it's negligence in maintaining the stockpile.

> Why not give benefit of doubt?

Because the article?

> It appears that this lead azide has not been stored well.

Proper inspection and maintenance of stock is important to any inventory which is not immune to decay, which is most of them.

comment 1w ago · link · parent

It's the same syntax tho? jQuery uses CSS selectors (with a few extensions), querySelector uses CSS selectors.

comment 1w ago · link · parent

> For example, the Julian calendar was not dropped in favor of the Gregorian instantaneously everywhere. Some countries, like Russia, continued using the Julian calendar into the 20th century.

An other fun one is that some of the transition schemes were... imaginative, let's say. Famously Sweden didn't want a hard break so in 1699 they decided that they would just skip leap days until they were on Gregorian. So they skipped the one in 1700, then promptly forgot the 1704 and 1708 ones because they were busy with the Great Northern War, as a result the scheme was cancelled by reverting to the Julian calendar, which they did by adding a second leap day in 1712 (which thus had a February 30th, and 367 days). Sweden ended up doing the switch at once in 1753.

That's calendaring rather than timezoning tho. Timezones really only became a factor once timekeeping was precise enough and times had to be communicated and synchronised across vast distances, which really came about with the railways (first formal "time zone" was the Railway Time of England's Great Western Railway). Before that, cities and villages oft had their individual time based on apparent solar time at the location (aka a sundial). For instance Paris Mean Time was 9 minutes and 21 seconds ahead of London.

comment 1w ago · link · parent

> This feels like duplicative work better done in a library.

While not necessarily wrong, it should probably be a separate library entirely: there are projects maintaining GIS boundaries for the IANA timezones.

comment 1w ago · link · parent

There’s a jiff-diesel, but in burntsushi’s own words

> Yeah I had a really hard time making the jiff-diesel and jiff-sqlx crates. Part of the problem is the very poor datetime support in the underlying databases. The other part of the problem is that I'm not a user of either diesel or sqlx, so there are some unknown unknowns for me.

https://www.reddit.com/r/rust/comments/1xx7v4v/comment/19sp2...

So I’m sure they’d be glad for assistance.

comment 1w ago · link · parent

Honestly it’s the best case of having called something shit code, it means you’ve improved enough to recognise its faults, and at most you’re hurting your own feelings and nobody else’s.

comment 1w ago · link · parent

Having a date/time library in the standard library actually makes it very difficult for other libraries to take off, and when it's deeply deficient (which is generally the case, turns out time is quite hard) it's actively detrimental to users of the ecosystem, both because it's hell to use and because it teaches them to do things incorrectly. Which then makes an innovative library have a harder time take off, because they need to fix most of their possible users.

comment 1w ago · link · parent

In fairness, Temporal largely follows the model originally defined by Joda, and refined in java.time. So I'd say that Java is probably one of the few languages with a well designed datetime library in the standard library.

Temporal does improve some things (it has more strict zoning / less defaults, and improves serialization through RFC 9557), but some of the divergences are not necessarily improvements and rather divergences of opinion (e.g. java.time wilfully made non-ISO calendars second-class, Temporal makes them first class more like Joda, and it's one of the things Colebourne — the lead author of Joda and java.time — strongly disagrees with[1], but the Temporal authors have pretty compelling reasons for it[2]).

[1] https://blog.joda.org/2009/11/why-jsr-310-isn-joda-time_4941... https://github.com/tc39/proposal-temporal/issues/5 https://github.com/tc39/proposal-temporal/issues/1454

[2] https://tc39.es/proposal-temporal/docs/calendar-review#why-a...

comment 1w ago · link · parent

> I will roll my own in JS

Hopefully Safari will soon have temporal implemented and we can leave that behind (it's in 27.3b so not out of the question).

> Chrono actually is comparatively nice

burntsushi has written pretty extensively about:

1. comparisons to existing datetime libraries (https://docs.rs/jiff/latest/jiff/_documentation/comparison/i...), chrono's original author also commented (https://github.com/BurntSushi/jiff/issues/63)

2. why they felt it was a good idea to write a new library (https://docs.rs/jiff/latest/jiff/_documentation/design/index...)

3. why they didn't wish to contribute to either chrono or time (https://docs.rs/jiff/latest/jiff/_documentation/design/index...)

And as randomblock linked, chrono is deprecating itself.

comment 1w ago · link · parent

ClF3 best broad-spectrum antiseptic.

comment 1w ago · link · parent

> isn’t chemotherapy also quite the toxic cocktail?

Yes. Chemo tries to kill the cancer faster than it kills the host.

Cyanide just kills everything.

comment 1w ago · link · parent

You can also type erase and shunt shit up by hand, that is what Go or Swift do (the latter with more syntactic support). It is essentially unwinding by hand, but it avoids the issue of unwitting unwinding so you don’t have a “secret” code path on the side.

comment 1w ago · link · parent

> if one of them crashes

But that's the point see? You have to catch panics because it's easy, straightforward and "common" to trigger panics.

If it were not, you wouldn't, because the buggy user-provided code would not be triggering panics, in the same way you're not catching `std::process::abort` or segfaults or whatnot.

comment 1w ago · link · parent

Does the system provide ready made backoff and / or bounded CAS loop primitives? Because if you have to write the entire thing in full every time I can see why it’s get skipped.

comment 1w ago · link · parent

OTOH that panics are ok and easy to reach for and unwind is why you have to handle them and keep the program running.

I don’t think that an unwind-less rust would have fit within the weirdness budget 10 years ago, today it would definitely be something to consider. Although it would have an unwind effect to contend with.

comment 1w ago · link · parent

> Isn't this just over-engineering it?

When users are complaining that your shuffle is hot garbage, it's just engineering.

> It's not like one is gambling with money on what song is played next.

Which... is rather the point? If one was doing that, your scheme would be fine.

comment 1w ago · link · parent

Except "small" is very large because this runs face first into the birthday problem so the average distance between duplicates grows to the square root of the number of files.

Hell even actual shuffling is not necessarily enough to "feel" right for human psyche, famously despite the ipod doing actual shuffling[0] users complained because tracks of the same artist / album could still cluster over shuffling an entire library, so they implemented "smart shuffle" to skew the shuffle and break up clusters. An other option is to weight the random pick by how far back a track was last played, or how little it's been played overall. This has the advantage of favouring less played tracks across listening sessions.

[0] and frankly if the ipod was able to do actual shuffling back in 2005 the memory footprint is just a lazy excuse

comment 1w ago · link · parent

The errors part of compilation is `cargo check` and that’s usually (though not always!) a fairly small amount of the total. Codegen is where the compiler usually spends most of its time.

comment 1w ago · link · parent

Now I just need the integer types to gain in-place inc() and dec()

I don’t know how to feel about toggle returning neither old nor new value tho.

comment 1w ago · link · parent

Which oauth tokens are you talking about? Because GitHub’s created by oauth or gh apps have a lifetime of either 8h or forever.

comment 2w ago · link · parent

It's not hard to run the number and see how likely it is (spoiler alert: not very).

The first easy number is the sheer amount of energy, diesel has an energy density of 10.7kWh/L, so a 30gal tank holds 1460kWh. By comparison a silverado EV (probably the best currently available EV tower short of a semi) has a 215kWh battery.

The second more complicated number and why diesel is so good at towing (and other high-power applications) is that diesel gets more efficient when loaded, by a factor of 2-ish: an unloaded diesel might only use ~20% of the fuel it burns to actually move stuff, or on a 30gal you get around 300kWh out of your 1460kWh tank, but that will climb to 35~40% as the load increases if kept in the efficiency range, so towing you might have 500~550kWh out of 1460kWh available to actually move your load.

There's no such thing on an EV, there's some variation but load isn't really a factor, pretty much just the band, so your Silverado gets 205kWh usable at the wheels unloaded and the same loaded. Therefore all the towing losses (rolling resistance and drag) come straight out of your range.

And short of a breakthrough on batteries it's difficult to add more battery capacity, the battery already accounts for a third of a silverado's weight and a significant fraction of its internal volume. Getting a 500kWh battery in a truck is currently impossible: that's the sort of capacity you find on semis (european EV semis cluster around 550~650).

And then of course you have the charge concern, charging a 500kWh battery in half an hour requires a megawatt charger running at more than 1MW, and the ability to ingest that in your pack (on 800V battery tech that's 1250 amps, which is within MCS specs but the vehicle side is pretty damn rough).

comment 2w ago · link · parent

That's 2-3 days worth without changing your use pattern, which surely you would do if you expected a long blackout period?

comment 2w ago · link · parent

> It sounds amazing. Only thing I wonder if it can even be set up so that it will be like an Uninterruptible Power Supply. So that when there is a blackout, the V2H supplies all the power without any interruption.

That's the point of V2H (or a residential battery, which it emulates). Although you still want a UPS for computers: I doubt "without any interruption" is at the scale of a UPS, and possibly not at the scale a desktop computer will require. Notably it depends how the grids cuts off, if it cuts off in one shot (like throwing the breaker) the failover should be almost instantaneous, but if it fluctuates before failing the battery might need a lot longer to engage.

comment 2w ago · link · parent

V2L will also do the trick, although it's more annoying.

If power loss is a regular event you probably want V2H, but if it's just a remote fear or something that happens once every 5~10 then V2L and a few extension cords will do.

comment 2w ago · link · parent

Also very important: the cybertruck is not the only vehicle capable of doing that (the keywords are V2H and V2L, V2H is the more convenient — the car just plugs into the mains and acts as a house battery — while V2L means you have to go and plug your stuff to the car's mains outputs directly)

> Most of the disasters I'm aware of people either get their power back in a short enough amount of time that they can use a normal generator for the gap

TBF an EV car has an absolutely massive battery relative to the electric consumption of a house, unless you're using resistive heating all around. Especially if you ration use.

comment 2w ago · link · parent

Minimum to qualify as "people" rather than "person".

comment 3w ago · link · parent

That is indeed a person who did not, can not, or will not read instructions.

comment 3w ago · link · parent

And what, pray tell, is the rule about?
12345
704