8,487 karma · joined Feb 1, 2017 (9y ago) · 2,549 submissions
comment 3y ago · link · parent
.PHONY is truly a bizarre construction. There's nothing like it in modern code systems. It's only by familiarity with make that it gains some semblance of normalcy.
comment 3y ago · link · parent
I try to lean into just such a silver lining. I like to write my code for worst-case future-me: what would it take for my sleep-deprived, Monday morning, uncaffeinated brain to make sense of? It definitely helps, especially even considering that approach, I often find I overestimate my future ability to understand past code.
comment 3y ago · link · parent
This phrasing implies the premise is true, which I don't agree with, so I am going to tackle 3 related questions:
- Why does /any phenomenon/ require explanation?
Because we are curious, and want to know how and why things do what they do. Answers lead to more questions, to more answers, in a loop of learning
- Why do all biological phenomena need an evolutionary explanation?
Because outside of artificial selection, natural selection is the only causal mechanism (outside of pure chance). Mitosis, Miosis, and Mutation are the building blocks.
But much of that boils down to, "why is x the way it is? Because chance". which is not very interesting, which leads to...
- Why does bee sting suicide in particular warrant an explanation?
Because under a naive understanding of evolution, it is a paradox. Also, there was a time when proto-hymenoptera were not eusocial, so how did they become eusocial? Those are really interesting problems to look at.
You are right in pointing out that pop-sci evolutionary handwavy explanations are a problem. But I don't think that is common in the broad science in biology.
comment 3y ago · link · parent
Walking upright is still the strongest hypothesis for the difficult birth process.
https://scitechdaily.com/scientists-have-figured-out-why-chi...
comment 3y ago · link · parent
Manual lazy import meaning:
def uses_foo(x):
import foo
return foo.bar(x)
Manual lazy import sucks because:- it's just ugly, I like imports all at the top so I can see all the deps
- bad for static analysis
- performance hit every time the function is called
Eschewing lazy imports has several problems:
- you always pay the execution cost, even if you don't use it
- also bad for static analysis and testing, since you have to eat the import time even if the code block you want to test doesn't execute the expensive path
- sometimes you need lazy import to avoid circular import errors
It's too bad that the main impediment to this is existing code which relies on side effects. Import-time side effects are an absolute pain in the ass. Avoid it at all costs.
comment 3y ago · link · parent
The most egregious is when you just want to display the help/usage text and not actually execute any code at all. Instead, you have to either manually lazy import (what I usually do now), or eat huge startup costs each time you screw up the command syntax.
comment 3y ago · link · parent
comment 3y ago · link · parent
The most obvious (but not necessarily easiest) approach is to phase out setup.py and move everything to the declarative pyproject.toml approach. This is not just better for metadata (setup scripts make it really hard to statically infer what deps a lib has), it also allows for better control over what installers/toolchains run on install.
Attackers still have quite a lot of latitude during the build phase, but at least libraries have the option to specify declaratively what permissions they need (and presumably the user has the option to forbid them).
Also eval/exec are terrible and I wish there were a mode to disable their usage, but I don't know if the python runtime has some deep dependency on it. Maybe there's a way to restrict it so that only low level frames can call the eval opcode.
comment 3y ago · link · parent
As opposed to... checks notes the Holy Roman Empire?
> (2) intentionally introduces an unwanted misspelling of a common Spanish word that accentuates the Castilian lisp
That's just how the linguistics do. This is the same drivel that tries to argue chop chop and long time no see are somehow offensive, instead of just loanphrases from Chinese pidjin.
> (3) intentionally misgenders the vast majority of people from those regions
No, again this demonstrates a profound ignorance of how language actually works in practice. -o does not imply "default male" in Spanish. There's tomes on this stuff. Grammatical gender is not social gender. A mesa doesn't identify as female.
> (4) denies the existence of non-European South American languages and cultures.
Again, Latin/[aoex]?/ is better in this regard how exactly?
comment 3y ago · link · parent
Note that Fukushima isn't a "true" island, though some think it might come from a block of land isolated by rivers.
comment 3y ago · link · parent
Fluoropolymers don't really leach in significant quantities on commercial timescales. That would sort of defeat their purpose of being inert. So there is a huge difference between "these teflon o-rings in this chemical plant leach 0.1 ppb of small molecule PFAS per day" and "millions of teflon pans go into the landfill each year". And further still to "we produce railcars worth of volatile fluoropolymer monomers for producing teflon and viton".
> I believe a lot of PFAS contamination comes from the production process itself.
This exactly. Low-molecular-weight PFAS are much more mobile than high weight, thus more polluting. Once "bound" in a polymer, the leaching is minimal. The problem is the production process, where you have primarily the small molecules, which inevitably get into the environment.
comment 3y ago · link · parent
Huh, TIL. I was going to rebut this but I looked into it. I didn't realize simply the presence of a -CF3 group is enough to classify the whole molecule as a PFAS according to new definitions.
> More recently (2021) the Organisation for Economic Co-operation and Development (OECD) expanded the definition, stating that "PFASs are defined as fluorinated substances that contain at least one fully fluorinated methyl or methylene carbon atom (without any H/Cl/Br/I atom attached to it), i.e. with a few noted exceptions, any chemical with at least a perfluorinated methyl group (–CF3) or a perfluorinated methylene group (–CF2–) is a PFAS."[3][4]
That's a super popular moeity in medchem for whatever reason, so yeah, RIP all thing trifluoromethyl.
Difluromethylene can be degraded much more quickly as long as the molecule can be "unzipped" (needs a break point where nucleophilic attack can occur), so it's possible we may be able to sub in -CHF2 or -CH2F to "cap" molecules and render them less persistent.
comment 3y ago · link · parent
These "I know it when I see it" kinds of laws are terrible.
comment 3y ago · link · parent
This is still bad (as it singles out HVAC repair folks), but it's worlds better than letting enforcers arbitrarily decide whether a vacuum pump, security torx set, tachometer, or ignition tester is verboten.
Also, oil changes are specifically allowed, and they are one of the primary causes of pollution from home car tinkerers.
comment 3y ago · link · parent
"Latinx" was so obviously created by an English-primary speaker.
comment 3y ago · link · parent
The song "Weapon of Choice" by Fatboy Slim featuring Bootsy Collins is about personal empowerment and strength. The song encourages the listener to find their own individual weapon of choice—that is, whatever resource they find to fight their inner battles and make their way in life—rather than relying on provocation and violence. The song also encourages self-reflection and awareness of the struggles of those around us, and reminds the listener to be careful in challenging situations and to watch out for those they don't know. Ultimately, the song is a passionate and empowering anthem that encourages standing up for one's own self-determination and respecting the journeys of others.
https://www.songtell.com/fatboy-slim-ft-bootsy-collins/weapo...The lyrics are notably Dune references, which the bot completely misses. Not even mentioning the worm, which is one of the most prominent words. It seems like the interpretations fall into one of a few categories:
- Very well known songs with a large corpus of direct discussion on the lyrics, and basically just summarizing what people said (Bohemian Rhapsody)
- Songs with relatively straightforward meanings and it just summarizes directly from the lyrics (insert most pop songs)
- Songs that are too obscure to have widespread discussion but slightly opaque lyrics (Weapon of Choice, Clint Eastwood by Gorillaz)
- completely fabricating from insufficient data (Around the World by Daft Punk)
Still a really cool concept!
comment 3y ago · link · parent
On the other hand...this one was totally a swing and a miss.
https://www.songtell.com/g-nther/ding-dong-song
Edit: quoted cause server is getting overloaded:
> "Ding Dong Song" by Günther is a dance-pop love song about searching for love in the night. The chorus and verses repeat the phrase "you touch my tralala," which is a playful and affectionate way of expressing affection for someone. The song's title, "Ding Dong Song," refers to the phrase that is repeated in the chorus: "Mmm, my ding ding dong". This could be interpreted as a representation of the feeling of joy and excitement that comes with finding and expressing love for someone. The song is about the longing for a connection with a special person and the joy that comes from having that connection.
comment 3y ago · link · parent
More sensitive electronics and the batteries can be put in sealed compartments.
comment 3y ago · link · parent
Disagree on dependency injection. I came from the globals/patch everything school of python, to the Fastapi/Pytest DI flavor, and it's a breath of fresh air. It's just so much easier to abstract the IO providers and swap them out with objects tailored to the test suite - eg for database, I create db objects which roll back any transactions between tests.
Hard disagree on unit tests. Maybe in other languages, but in Python, trying to develop even a moderately complex app without unit tests is a nightmare. I know, I've lived it. Even in an app with >85% unit test coverage, there was still a ton of friction around development on any of the interfaces which had low coverage.
Any gains in velocity of development almost always cost far more in debugging down the road.
I love python, but it is really prone to dumb footguns at runtime, NoneType errors in particular. You need to impose a lot of discipline to make large python apps enjoyable to develop on.
comment 3y ago · link · parent
The closest anyone has come to removing the GIL is the Gilectomy project by Larry Hastings, and it's unlikely to ever be upstreamed unless it could be somehow made to work with libraries that rely on assumptions about GIL mechanics (eg numpy).
comment 3y ago · link · parent
The smaller problem is this does at a small amount of overhead even to single-threaded performance. The gilectomy project improved performance elsewhere so net performance is close to the same.
The bigger problem would be integrating this strategy with all the libraries that rely on existing GIL behavior.
comment 3y ago · link · parent
I'd advise against this habit, even for "light" development work. I've been bitten too many times by some library installing into the wrong env or picking up the wrong path of a library.
Conda's generally a good move if you don't want to manually manage virtualenvs.
comment 3y ago · link · parent
Non-PEP440 compliant libraries are also a pain in the ass.
Put both those facts together and you are playing with fire. In all likelihood you will eventually footgun yourself and end up with a python env superfund.
Just use virtual envs for everything.
I say this coming from over a decade of python experience and lots of time spent installing python in exotic environments.
comment 3y ago · link · parent
Vanilla pip works well with the venv module. I still manually manage the majority of my virtual environments, with the virtualenvwrapper libary, although `source path/to/myvenv/bin/activate` also works.
Pipx is great for installing executable tools.