8,487 karma · joined Feb 1, 2017 (9y ago) · 2,549 submissions
comment 2y ago · link · parent
Multiprocess, OS threads, and asyncio all solve different problems. Threads are pretty heavyweight compared to async coroutines (aka green threads). The big win with coroutines is it is very cheap to put them to sleep waiting on io. So a web server on a 4 core vm might have 4 worker processes, several threads per process, and dozens/hundreds of coroutines.
> So perhaps you can use this for slurping other people's IP in parallel and train the "AIs" that are supposed to make us redundant.
This has absolutely nothing to do with the technical merits of async or threads. For one, the above two examples are taken directly from work I did to combat deep fakes by identifying various "tells" from the media. Some of us are in fact using machine learning for good.
comment 2y ago · link · parent
https://github.com/mypyc/mypyc
You can compile python to c. Right now. Compatibility with extensions still needs a bit of work. But you can write extremely strict python.
That's without getting into things like cython.
comment 2y ago · link · parent
comment 2y ago · link · parent
There are also multiple compilers (mypyc, nuitka, others I forget) which take advantage of types to compile python to machine code.
comment 2y ago · link · parent
> Python itself doesn't do that
The type syntax is python. MyPy is part of Python. It's maintained by the python foundation. Mypy is not part of CPython because modularity is good, the same way that ANSI C doesn't compile anything, that's what gcc, clang, etc are for.
Mojo is literally exactly the same way, the types are optional, and the tooling handles type checking and compilation.
comment 2y ago · link · parent
I'm skeptical that for the vast majority of uses, have time data in the IDs (and also not leaking it from actual timestamp fields) is an issue, and for the cases where it does, just use random IDs.
Even theoretically, is there a way to translate timestamps into a German tank problem? If I give you a sampled set of timestamps (with no other node identifiers), can you estimate the cardinality of the greater dataset?
comment 2y ago · link · parent
If the UI automatically transitions to a totally new screen after completion, I'm never going to see 100% anyways, unless the app does the exact infuriating thing in TFA, which is render 100% (at 99.whatever) and then do some fsync/cleanup and actually be frozen showing 100% which is the contrapositive of oddly satisfying, it's unsurprisingly unsatisfying.
comment 2y ago · link · parent
Dig was an early and widespread DNS CLI tool. "dog" is a logical name for a next-gen dns cli, and of course that exists. "Doggo" is both a pretty standard linguistic drift pattern of English slang (random -> rando, weird -> weirdo), a common internet term of endearment for "dog", and a logical derivation of *-go for go-based tools and software.
comment 2y ago · link · parent
Correct answers: 1.0, 0.0, 1.0
Confidence from algo: 1.0, 0.0, n/a
Confidence on the wire: 1.0, 0.0, 0.0
Score after bug: 66%
Score as it ought to be scored: 100%
It was enough to make several algorithms which were very selective in the data they would attempt to analyze (think jpg vs png images) went from "kinda crap" in the rankings to "really good"
comment 2y ago · link · parent
https://www.ajaonline.org/article/3863
> In July 2014, we conducted a survey of Pompeii’s street network to document traces of iron that were observed on the stone-paved streets, which resulted in the identification of 434 instances of solid iron and iron staining among the paving stones. ... Pompeians were—in addition to using solid iron wedges—pouring molten iron and iron slag onto their streets as a method of emergency repair.
There's a huge gulf of difference between "a civilization is capable of melting iron" and "molten iron is so cheap and easy they used it to fill potholes".
Castable iron: Valuable, scarce, energy intensive, very hard to melt (comparatively), corrodes readily (especially on the coast)
Iron and other metal slag: Byproduct of iron smelting, basically waste, melts fairly easily, was used as ballast in ships, comparatively cheap, rusts superficially but is mostly a matrix of oxides which don't meaningfully react
I'm beyond skeptical that perfectly good cast iron was used to fill potholes. Using slag/dross/failed smelts/other byproducts of metallurgy makes far better sense.
It would be like far future archeologists unearthing rammed earth tire walls and concluding "the 20th century was so efficient at producing rubber they used excess tires as a building material" vs "they used a waste product which would have been landfill anyways".
comment 2y ago · link · parent
It's just game theory. It's like asking how many metaphorical empty barrels do you want to add to your Russian roulette revolver before you are willing to risk it, the reward being basically "ordinary food". Oh and the risk can suddenly one day go from just causing hives to severe anaphylaxis at a much smaller dose.
Most people who learn of a sensitivity (I learned in elementary school after breaking out in hives from doing art involving peanut shells, the horror to think this is something schools just did!) just don't want to know that badly how dire their allergy is and assume it's life threatening, because it's not worth it to be cavalier.
comment 2y ago · link · parent
comment 2y ago · link · parent
We dealt with a bug that for weeks was silently corrupting the results of trials pitting the performance of various algos against each other. Because a valid response was "no reply/opt out", combined with a bug in processing the "opt out" enum, also combined with a bug in score aggregation, functions were treated like they replied "0.0" instead of "confidence = None".
It really should have defaulted NaN for missing floats.
comment 2y ago · link · parent
Addiction is largely driven by neurodevelopmental disorders (ADHD, ASD, MDD, sleep disorders, and many more), psychological disorders (anxiety, OCD, and many more), or both in combination. Most folks don't want to be addicts. At the heart of addiction is executive dysfunction caused by the above conditions, exacerbated by stressors. You treat it like any other mental health problem: therapy, medication, support systems, and a society that cares for its populace.
comment 2y ago · link · parent
comment 2y ago · link · parent
0 - https://news.ycombinator.com/item?id=40040342
1 - https://docs.pex-tool.org/
2 - https://shiv.readthedocs.io/en/latest/
comment 2y ago · link · parent
I don't mind the pace that Go has been moving at when it comes to new features. It still feels very conservative while still evolving.
comment 2y ago · link · parent
I'm pretty sure they legally can't "largely import foreign weapon designs". The Berry and Kissel amendments, not to mention ITAR and a few other regulations, put a strong incentive on in-sourcing when at all possible. The only exceptions are for things that are really hard to get domestically.
comment 2y ago · link · parent
But there's a fair amount of inter-model variety within those four/five brands. My 12v Dewalt impact punches above its weight/price and I have two Bosch 18v drills, similar in form factor but one is frankly inferior quality.
comment 2y ago · link · parent
You might have to use a few tricks/hacks, but I'm pretty sure you can set up python in a way to breakpoint at an exception, including all local state at the throw site. Otherwise pdb would not work.
comment 2y ago · link · parent
> Python is not easy to build into portable binaries
https://pex.readthedocs.io/en/v2.1.40/buildingpex.html
- The package ecosystem is very hard to use in a reproducible way
pip, virtualenv, and requirements.in/txt is extremely reproducible. I will offer that it's not exactly idiot-proof yet and there are tons of stale tutorials out there
> The language is not truly typed - types add massive value for infrastructure and scripts because they are less likely to be unit-tested
Yes it is, if you want it to be. There's nothing stopping someone from using mypy, pyright, or other type tool on the strictest setting, and not passing builds unless you have 100% type coverage.
> The lack of a "let" or "var" keyword makes simple programming errors more likely (again, this code is less likely to be unit-tested)
No, but you get ~95% of the safety guarantees by using immutable-esque objects like @dataclass(frozen=True), pydantic models with the same, or attrs/cattrs with similar setting.
comment 2y ago · link · parent
Dropbox has historically done a lot for python, idk how current that is. Netflix has a huge python codebase but I'm not sure what they contribute.