Better HN
topnewbestaskshowjobs
Log inSign up

kortex

8,487 karma · joined Feb 1, 2017 (9y ago) · 2,549 submissions

Submissions

comment 3y ago · link · parent

Very different. Requirements.txt only handles dependency packages, and only handles on kind of dependency (no dev/release distinction). pyproject.toml does dev/release deps, it has package metadata, it can configure all your lint/test tooling, and it is extensible with plugins.

comment 3y ago · link · parent

There are many who argue that no specific law is necessary, that the Constitution gives the right of privacy and bodily autonomy, and that Roe v Wade correctly asserts that constitutional right.

Do you need a specific law protecting the right to throw a barbecue, own a dog, or read books on dangerous topics? No, because the Constitution is a framework which broadly allows actions by people, and carves out specific things that the government has control over.

comment 3y ago · link · parent

To their credit, I remember something about basically every element ionizes to some extent in space, thus exhibiting the "sea of electrons" behavior characteristic of metals.

comment 3y ago · link · parent

As a (former) organic chemist, this is spot-on. "Organic" doesn't really have a strict definition, but it's not so much "majority carbon" as it is presence of a C-H and/or C-C bond. I personally don't consider diamond and graphite organic, but some do. Carbon disulfide and phosgene (COCl2) usually aren't regarded as organic. And as you mentioned, stuff with carbon and lots of carbon atoms is a grey area (looking at you, azidoazide azide, but not looking at it too hard, it might not like that).

comment 3y ago · link · parent

I have bog standard subaru EyeSight lane assist and dynamic cruise. It's quite nice, even though you are still "driving" and ready to take control. It reduces mental CPU by 50-80% (driving for me is practically like walking to begin with, largely subconscious). It's great in stop-and-go and long highway stretches.

comment 3y ago · link · parent

A bird is usually not an issue (unless it's huge like a condor or something).

The problem is ingesting a whole flock. Turbofans are designed to fling debris (rain, hail, gravel, birds) out to the bypass via centrifugal force. However, too much material (or insufficient thrust) causes the impeller to bog down, so more junk gets sucked into the burn chamber, which can cause a flameout.

comment 3y ago · link · parent

I wrote a small service to synch the datetime based on a gps/imu module with an ethernet interface. It needed to be rock solid because it was going to fly in the field (scientific instrument, not avionics). It was faster and easier to write in Rust, despite having no one else with Rust know-how in the company, the rest of the system components in C++/Python, and several months of of c and c++ experience myself. I barely knew rust and yet felt way more confident the program didn't have weird unexpected edge cases, leaks, etc. Not to mention way more ergonomic.

comment 3y ago · link · parent

> Names Sun, Sol /ˈsɒl/,[1] Sól, Helios /hiːliəs/[2]

Also el sol (es), o sol (pr), il sole (it), le soleil (fr), etc.

Technically the IAU hasn't sanctioned an official name, but Sol is fairly well understood.

https://en.m.wikipedia.org/wiki/Sun

https://earthsky.org/space/what-is-the-suns-name/

comment 3y ago · link · parent

I think that muddies the water a bit too much and relies on too much magic. Self might be weird, but it's one of the most central concepts in python. Especially if someone is coming from javascript. Dataclasses don't quite follow the same rules as regular classes, especially with inheritance. I think waiting to understand decorators is a good call.

comment 3y ago · link · parent

Good luck introspecting a given python object and ascertaining "this class only stores data". It's literally impossible given the dynamicism of python.

The consequences are exposing state that you don't necessarily want to expose, missed opportunities for optimization (lose fine-grained memory/performance tradeoff ability), imply something is serializable when it isn't, collisions with metaclasses/inheritance weirdness.

comment 3y ago · link · parent

Off the top of my head, python classes which shouldn't/can't be dataclasses:

The entire modules typing, os, sys, struct, inspect, json.

Anything which is a metaclass or relies on metaclass behavior (you have to be careful combining dataclass with other metaclasses, it's possible but with footguns akimbo).

Datetime actually should be a dataclass, but that api is so crufty and unintuitive that it's never gonna happen, and trying to shoehorn it to a dataclass would break oodles of libraries and applications.

threading: Thread, Lock, Rlock anything whichs uses locks

Numpy.ndarry, pandas.Series, pandas.Dataframe, torch.Tensor. Numerous scikit-learn models.

Probably the vast majority of c extensions.

pydantic.BaseModel, fastapi.FastAPI, fastapi.APIRouter (same with flask/django), celery.Task.

I could go on but I think I've made my point. There are plenty of non-dataclass use cases out there.

comment 3y ago · link · parent

Pydantic, yes, you can just set the default initializer to = [] or = {}. I don't think that works with dataclasses yet.

comment 3y ago · link · parent

I enjoy novel ideas, they are fun to entertain, but this is quite spicy of a take. I kind of understand where OP is coming from, but if you start to understand python internals, you would quickly see why it's completely untenable.

    data Point3D(x, y, z) from Vector:
is never, ever, ever, ever gonna happen. It's ugly, alien to the rest of python style, will be a massive pain to implement in the lexer/parser, adds another keyword and mechanism, and most importantly, makes the word "data" unusable as a variable name. Dataclasses are "just" decorator functions (there is some special optimization and meta magic under the hood, but still just a callable).

There's a glaring reason why we can't "just make all classes dataclasses" - it would break the entire data model of the language. "class" keyword is basically syntactic sugar for the "type" builtin. Everything (with a few small exceptions) you touch in python is a subclass of object. Changing the behavior of class to by default behave like dataclass would have knock-on effects across the entire language on every single python3 codebase on the planet.

Ok, even assuming we could surmount the insurmountable breaking changes, would we even want default classes to be dataclasses? Not in the slightest. Python may not have true private variables, but libraries/APIs leverage dunders, properties, and hidden state to do all kinds of OOPy things. You can't do that with dataclasses. Many times you have objects bound to attributes which don't have concrete types, such as endpoints in HTTP frameworks and anything with dynamic dispatch (yeah there's Callable, but it is tricky to type check).

Dataclass also has a self-documentation effect: it says "this thing is kind of like a record". Not a primitive, not a function, not a router, view, thread, tree node, god-class or stack frame. If I see dataclass, I almost always expect to be able to de/serialize it to some sort of message. Complex state, anything unpickleable, or exotic types don't really belong in a dataclass.

comment 3y ago · link · parent

Operator overloading is what makes the majority of science/math heavy libraries (numpy, scipy, pandas, torch, scikit) work. It ain't going anywhere.

Walrus is fine. It's easy enough to google "python colon equals" and figure it out.

comment 3y ago · link · parent

Thunks-style functors, where you bind a callback to a private variable, to be later called, often with kwargs. Like what most HTTP frameworks do. You can use Callable but the actual function prototype is unknown.

comment 3y ago · link · parent

> But we are in this weird state where people go to a doctor and its like "oh you sneezed? here take these 15 drugs"

Many people say this, but where's the evidence? Probably the best quality article to date in support of overdiagnosis and overtreatment is [1], and that paper is incredibly weak. It does not give any concrete numbers as to the rate of overdiagnosis, only really claims that there are populations of less severe ADHD that have inferior reward/risk outcomes of pharmacotreatment, while also admitting ADHD is underdiagnosed and undertreated in subpopulations, especially girls and minorities.

In other words, it's likely all just misdiagnosis, due to limited sensitivity and specificity.

My hypothesis is that ADHD detection, like any medical test, has limits to its accuracy, and considering even quantitative tests with 90% accuracy have quite large false positive populations, we are seeing a similar situation with the far more qualitative ADHD test system.

[1] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8042533/#!po=9....

comment 3y ago · link · parent

It's not "basically true" though. The whole point of the "disorder" designation is that it interferes with life activities. Everyone has attention deficits at times - that does not a disorder make. Otherwise I agree with the analogy.

comment 3y ago · link · parent

You jest, but I believe some of these incidents have been caused by some sort of delay mechanism which gets stuck, until one day it is dug up or corrodes enough to unstick, at which point it goes off.

comment 3y ago · link · parent

Thanks for the correction! Yeah, I did some more digging and there are in fact some wacky designs. The single-fusing-element is more dominant in modern designs, but war is a crazy place.

(pdf warning)

https://www.fh-campuswien.ac.at/fileadmin/redakteure/News/Do...

comment 3y ago · link · parent

Thank you!

comment 3y ago · link · parent

> The bomb likely had another, undetected detonator

That would be really poor bomb design. Bombs are designed to be stored inert near the airstrip, mounted to staged aircraft and armed quickly by inserting a primer/detonator. There would be one and only one per bomb. The detonator would certainly be removed first before trying to burn out.

Explosives usually become more unstable over time, sometimes forming pockets of primary explosives, which can detonate the bomb. See my sibling comment.

Edit: I'm completely mistaken! Some bombs in fact have multiple fuse pockets, so presumably, multiple fuses. Nonetheless, even with all fuses removed, UXB can still go off during disposal.

comment 3y ago · link · parent

Some context as a chemist. Most explosives require DDT (deflagration to detonation transition) in order to explode. DDT occurs when the flame front goes supersonic in the material and creates a shockwave (simplification but close enough).

Low sensitivity is desirable because you want explosives to go off on demand, not randomly. Thus, most bulk explosives can be safely burned without detonation. Primary explosives have a low DDT threshold, meaning it takes far less energy and/or confinement to DDT. Thus, you can have a small primary, sometimes a secondary booster, to set off your bulk charge. The primer can be removed/dissolved to render the weapon far safer. But not perfectly safe.

I don't know the exact composition, but it is likely a combination of TNT, and one of the hexagen/MX explosives (RDX, HMX) [1]. Luftwaffe used Trialen 105 in their 250kg bomb [2], which is TNT, RDX, and aluminum powder, so lets go with that. TNT is fairly stable, *MX are quite stable, but picrates are ornery. Over time they can break down and react with metals in the casing. Metal picrates are much closer to primaries in temperament. They are also far more shock sensitive, which is why (somewhat paradoxically) it's safer to evac and burn these old bombs out, then to try to relocate it. There are other ways in which unstable residues can be formed, not just picrates (e.g. TNT can release NOx over time and form metal nitrate or fulminate salts). You also have all the impurities from synthesis (such as DNT and mixed nitrates). Over time this forms a witches' brew of mixed nitrates that's typically much more sensitive. Sensitive, as in, workers have died when their shovel struck the bomb casing. There would not even be time for the clunk sound to make it to their ears before obliteration. Or even just...nothing [4]. Hug your loved ones, folks.

(side note: this is why if you ever find old orndance, or old bottles of certain chemicals e.g. ether, you should stop immediately and don't try to move it, just evacuate and call a hazmat team)

What most likely happened is the old bomb corroded and formed a pocket of these unstable salts, and when the flame hit it, a DDT occurred which set off the bulk charge.

This is all well known to ordnance disposal folks, hence the sandbox cover and evacuation radius. [3]

Edit: tweaked wording after some more research into bomb composition.

P.S. I updated my notes on explosive composition. Turns out WW2 US/UK favored picrate mixes far more than the Germans (who favored TNT, RDX, ammonium nitrate, and aluminum), and as a result, allied bombs from this period are much more unstable than German ones. Also note, forming unstable species isn't necessary for DDT: e.g. the Halifax and Beirut explosions were caused solely by burning ammonium nitrate. It's just much, much harder to get a pile of AN to go off than rando metal nitrate salts.

[1] https://en.m.wikipedia.org/wiki/List_of_explosives_used_duri...

[2] https://en.m.wikipedia.org/wiki/SC250_bomb

[3] https://www.bbc.com/future/article/20150922-these-nazi-bombs...

[4] https://www.dw.com/en/wwii-bomb-self-detonates-in-german-fie...

comment 3y ago · link · parent

Because it's almost always the case that the consumer is going to keep a reference to the task in some way, so that is the logical choice for the "primary owner" of the task. Python doesn't have ownership per se like rust, but if you keep more than one hard reference to an object around, it'll prevent collection, so in cases such as this it makes sense to designate one primary owner and have all other references be weakref.

comment 3y ago · link · parent

This is good form. It makes top-level control flow easier to follow, and keeps the concurrency scoped.

comment 3y ago · link · parent

It's typical paper-thin plausible deniability of corporations justifying actions.

- Oil supplies are tough so we are raising gas prices (we know we can get a few weeks/months of crazy profits and blame it on the energy crisis)

- Supply chain issues are tough so we have to tighten out belt (excuse to not give out raises/bonuses)

- The macroeconomic environment is tough, so we gotta lay off 7-10% (we have wanted to trim the fat for some time and now we have the perfect cover)

Funny how it is always slow to go the other way (slow for gas prices to come down, wages to rise, and rosters are expanded).

comment 3y ago · link · parent

> Effeminacy is the inability to undertake what is not pleasurable, whereas delicacy is the inability to endure displeasure

Wow. Not only is that whole site preachy an woo-tacular, that definition is sexist AF. There are not many experiences more displeasurable and uncomfortable than carrying a fetus for 9 months and going into labor. To say nothing of monthly hardship for decades on end.

comment 3y ago · link · parent

Doped strontium alluminate is not exactly food grade (though it is considered non-toxic), but that's not the orifice these devices are going in. The silicone matrix retains the vast majority of the pigment, which itself is fairly inert. It has virtually no bioavailability and any of the micrograms of it that might slough off during a session will almost certainly be exuded in short order.

comment 3y ago · link · parent

United Nuclear is quite the nostalgia bomb. My first experience with them was in 2008, buying a chunk of uranium ore to trigger a geiger counter to use as a true random number generator. I'd say "where else can you just buy a chunk of uranium ore" but... [1]. Of course at the time it wasn't something you could buy on amazon.

1 - https://www.amazon.com/Images-SI-Uranium-Ore/dp/B000796XXM

comment 3y ago · link · parent

It's used in miniscule quantities in glow powder. It's commercial use as a pigment/phosphor in display, lighting, and safety equipment far outweighs its use by hobbyists.

comment 3y ago · link · parent

Add it to anything you want to make glow-in-the-dark: paints, toys, safety equipment. I know someone who produces small batch silicone adult entertainment devices for sale, and the GITD ones are quite popular.
1
181920
85