Charles ☕ Stanhope firstname.lastname@example.org
Software/hardware developer interested in programming languages, open platforms, art, diy, craft, music, making a living, learning, life etc. Trying hard to be part of the solution. See also http://charles.stanho.pe
Looks like Inkscape 0.92 has some potentially bad text rendering issues when reading files generated in prior revisions. Ouch! http://www.peppercarrot.com/en/article396/new-inkscape-0-92-breaks-your-previous-works-done-with-ink...
Looks like the LinuxConf Australia 2017 videos are already being posted to youtube: https://www.youtube.com/user/linuxconfau2017/videos
I've been unable to follow users on the datamost service. Whenever I try, I can't get past the "login" stage. It errors out with Firefox saying it can't connect to the server. I've been using the web interface and my account is on identi.ca. Anybody else have a similar problem?
TFW the Emacs major mode for the language you are programming in can't be customized to match corporate the style guide. #NerdWorldProblems
Wanted: tmux's ctrl-b z but for Emacs.
Show all 5 replies
I just learned a painful lesson about the behavior of os.path.join() in Python when it encounters an argument that begins with a "/"... Good thing I was working in a VM while I learned this lesson.
"If a component is an absolute path, all previous components are thrown away and joining continues from the absolute path component."
Just before that the docs say, "Join one or more path components intelligently." That's probably not the adverb I would select. Oh well... :)
Claes Wallin (韋嘉誠) shared this.Show all 6 replies
>> Charles ☕ Stanhope:
“I'm still puzzling over why that is a desirable default behavior for a function called join(). I'm sure the answer is in a mailing list archive or PEP.”
I found this email from 2012, discussing PEP 428:
“>> What's the use case for this behavior?
>> I'd much rather if joining an absolute path to a relative one fail and
>> reveal the potential bug....
>> >>> os.unlink(Path('myproj') / Path('/lib'))
>> Traceback (most recent call last):
>> File "", line 1, in
>> TypeError: absolute path can't be appended to a relative path
> In all honesty I followed os.path.join's behaviour here. I agree a
> ValueError (not TypeError) would be sensible too.
Please no -- this is a very important use case (for os.path.join, at least):
resolving a path from config/user/command line that can be given either absolute
or relative to a certain directory.
Right now it's as simple as join(default, path), and i'd prefer to keep this.
There is no bug here, it's working as designed. ”Look at it like this: For each component you add to the chain, it resolves the next path as if it was standing at the path so far and resolved the new component from there. (a sequence of `cd`s, if one could `cd` to a file)
It makes no sense for any component to start with a slash, even though I see how that might happen (e.g. git encourages you to make relative-absolute ignore paths, or it will apply the filter in every subdirectory).
Still, it's a good quirk to know about when validating user input.
@Clacke moved to quitter.se and microca.st I understand the behavior. I just think the function is misnamed. You just described it's operation as a series of 'cd' invocations. That's not a join operation. That's a 'virtual_cd_chain' or something. :)
But on top of that:
>>> os.path.join("path", ".",".",".")
Which is not what you would get with a series of 'cd' commands. So the function sort of works like you said, except when it doesn't. ;)
Anyway, all languages have their quirks, and it turns out that for most of my use cases, os.path.join() does not have desirable behavior. But that's okay because I was able to create a one line replacement that did what I needed it to do. I just have to remember to use it. :)
By the way, my use case is creating directories that hold the rootfs of a container or disk image. It's very natural to refer to "/etc" or the "/bin" of the destination rootfs and have the tool place things in their correct place relative to some starting directory in the host. In this situation, I wanted to "join" two paths to each other, so I reached for the os.path.join() function and learned a very valuable lesson. :)
SICP, but with Python: "This book is derived from the classic textbook Structure and Interpretation of Computer Programs by Abelson, Sussman, and Sussman. John Denero originally modified if for Python for the Fall 2011 semester. It is licensed under the Creative Commons Attribution-ShareAlike 3.0 license."
I skimmed through it. It succeeds by not being entirely faithful; it's adapted in ways that are much more appropriate to Python. But I think there are a lot of things (of value) which are lost in the transition... even if it does a great job of staying coherent. I guess that's pretty vague, but I think the minimalism of Lisp / Scheme gets you pretty far: the language is so strippe down that it's easy to get to the heart of what computing is.
One of the strongest things in SICP is that you eventually write several implementations of the language inside the language itself, and it looks just like the same language you were working in all along...
Charles ☕ Stanhope likes this.
This is probably a long shot, but do any of you fine pumpiverse people know of a feature phone (recent vintage) with tethering capability? Either WiFi tethering or USB tethering would be fine.
Elena ``of Valhalla'' likes this.
The top 15 places in the "Wiki Love Monuments 2016" are some wonderful photos: https://blog.wikimedia.org/2016/12/15/seventh-annual-wiki-loves-monuments/
Ice everywhere. I've been stuck at home for two days. Even the poor scrub jays have ice on their tail feathers. Fallen trees and tree llimbs abound. At least we still have power here. Called an arborist about my tree, but I still gotta go clear some limbs from the side walk. The temperatures are supposed to get quite above freezing today, so hopefully this will be the last of it for a bit.
Aaah! Christmas time in the Portland area!
Claes Wallin (韋嘉誠) likes this.I was outside when a neighbor's tree limb snapped off. Scared the poo out of me, and it was a small one. I don't know how I slept through the large one that snapped off my tree. My mother (who lives in a different part of town) is telling me she's been hearing booms, seeing flashes, and watching tree limbs catch on fire across power lines.
The people behind the Talos Secure Workstation give a grim summary of the state of libre hardware: "A Word on Lockdown".
Christopher Allan Webber likes this.
I would like an http header I could set to let sites know I reject DRM
James Dearing 🐲 shared this.
I haven't been making progress on my own Indie Web efforts, but I'm glad to see others still going strong: "Happy Third Birthday to the Homebrew Website Club!"
Alex Jordan likes this.
I hope we can shift attitudes like this:
“I’m also a very busy businessman and I don’t have time to fact-check everything that I put out there, especially when I don’t think it’s going out there for wide consumption.”
Says Eric Tucker, the man who helped start the rumor, and fake news stories, about "professional protesters" getting bused to anti-Trump rallies.
It's always been a bad idea to spread misinformation (regardless of how few people you are talking to), but in the age of social media, we all have much more responsibility to be careful about what we state as fact.
This is a fine example of everything wrong with proprietary hardware and software.
"For about $50, you can get a smartphone with a high-definition display, fast data service and, according to security contractors, a secret feature: a backdoor that sends all your text messages to China every 72 hours."
At a time when so much happens in video, the archive.org video library is a remarkable resource:
'On the campaign trail, President-elect Donald Trump had harsh words for the media in general and some individual journalists in particular, using words like “scum,” and “sleaze” to describe them. On several occasions, he said he intended to open up libel laws so he could sue journalists and outlets, and indeed he threatened lawsuits when critical stories were published.
Many of these speeches were broadcast at the time and are now available on the TV News Archive, searchable by closed captions–as are statements he made on a whole host of topics. We are hoping journalists and researchers will use this rich resource as they report on Trump. If there’s a question about what Trump has said about a particular topic, when, and where, we may just have the video clip.'