Kotlin, path manipulation
Speaking of Kotlin, how does Kotlin standard library deal with paths?
`File("/var/www").resolve(File("/etc/passwd"))` ends up with /etc/passwd, but I am much happier with that named "resolve" than "join".
`File(File("/var/www"), "/etc/passwd"))` doesn't error, but gives /var/www/etc/passwd. You can totally construct /var/www/../../etc/passwd that way, though.
That's `File(File, String)` but there is no `File(File, File)`.
And I don't find any other `File.x(File)` where `x` is anything like `child` or `descendant`.
extending classes (Kotlin +)
This also reminds me that Kotlin's ability to extend classes is real nice.
I could define an extension to pathlib.Path that provides a `safejoin` method. Logically, it's the same as providing a function `safejoin(path1, path2)`, but allows the syntax of `path1.safejoin(path2)`. That makes it look consistent with the original methods, and I can use it by importing safejoin without having to make any Path instance I see into an instance of some SafePath proxy or subclass.
Of course, if I pass that Path instance out to any other library, it's likely to still do the unsafe operation, but can't do anything about that without breaking contracts.
Python 3 (-), Old Man Yells At Cloud
I was appreciating the fact that with Python 3, we finally get a Path type in the standard library.
Until I discovered that `Path('/var/www').joinpath('/etc/passwd')` doesn't throw `InsecurePath`.
Okay, I can imagine there are some use cases where you want to be able to represent `foo/../../assets` or something, but usually not, and resetting the root to `/` never.
which is why t.p.filepath has guarded against that sort of thing since its inception in 2003.
Come on, stdlib, where are my Batteries Included? PEP 428 even cites t.p.filepath as prior art, along with Unipath, which offers a method with similar protections.
I'm checking PEP 428's mailing list discussion, but I don't know how to find this amongst the fucktillion messages debating operator overloading. Maybe that's the answer: everyone who was tired of reading about operator overloading stopped thinking about this PEP.
numpy is extraordinarily useful! That's indisputable. But parts of its interface are vicious. For example: https://www.jessicayung.com/numpy-views-vs-copies-avoiding-costly-mistakes/
And people call nethack player-hostile!
Are there wrappers for numpy that place less priority on extreme conciseness and more on making mistakes hard?
Linux on the Desktop
These container-formats seem to be getting more popular as a way to distribute desktop applications.
A couple times a year I try to figure out what the deal is, but 😵.
Seems like one touted advantage is "sandboxing! Less risk to user?" but ... applications still need to be able to work with my files and input devices?
And Canonical has seemingly pigeonhole'd snaps as a Ubuntu-only thing, but Ubuntu already has a package manager?
and both snaps and flatpak still require root to install apps?
I do not grok. Explainers (oriented toward desktop use) or "don't worry about it; go with whatever the app's packaging maintainer likes" feedbacks solicited.
Today I learned that the Center for Disease Control and the World Health Organization don't believe there's a "black mold" that's unusually toxic.
It's still true that you generally don't want to breathe a ton of mold spores, some people have mold allergies, and you should minimize molds in environments for immunocompromised people, but there's not one color or species of mold that's a lot more dangerous than the others.
Have you ever tried to get the cover off of one of these incandescent-bulb-sized LED lamps?
It's a hilarious exercise for those of us who grew up thinking of light bulbs as the most fragile of things that would crack and implode if you sneezed wrong.
I have put this thing under the leg of a chair and sat on it and it barely cares.
Hey, if you're a person who likes to have serious thoughts about competitive sports and gender, I have found the 14 kiloword article for you: https://www.barbellmedicine.com/blog/shades-of-gray-sex-gender-and-fairness-in-sport/
That's it: Self-destructing posts are like the *opposite* of pinned-posts.
You pin a post when it has something you want all future visitors to see it when they look up your page.
You make a self-destructing post if it's okay that some people see it now, while it's timely, but that you don't want to leave a big pile of on the profile that introduces you.
For a long time I didn't get the appeal of the time-limited social media content (e.g. Snapchat, 24-hour Insta stories, etc). Why would you post anything to a network if you didn't want it to be referenceable forever?
I'm slowly coming around to it.
Sure, both the host and anyone with read access to your feed _could_ capture it and archive or redistribute it, so don't trick yourself into thinking those aren't still risks. But it filters the audience a bit (in some self-selecting way I probably don't understand too well), and it's a way to share things that don't accumulate on your profile page as it's seen by future visitors.
This is my sign according to https://www.merriam-webster.com/time-traveler
fae (xe/xyr): may i have your pronouns?
me (they/them): sure! they/them
fae (they/them): thanks :)
me ( / ): wait
After seeing this clip https://i.imgur.com/OZlTjrg.gifv
I went on a little exploration of triple pendulums last night.
There was a kinetic sculpture artist here in Oregon, Ken Patton, who did a lot of neat stuff, including rotation in more dimensions: https://www.youtube.com/watch?v=3Rgs4KTdl1o
A Mastodon instance for cats, the people who love them, and kindness in general. We strive to be a radically inclusive safe space. By creating an account, you agree to follow our CoC.