Show newer

Is hilarious mistake in Python design. Thanks @elfprince13.

```python
def x():
e = None
while e is None:
try: print(input("? "))
except Exception as e: print(repr(e))

x()
```

Result:
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in x
UnboundLocalError: local variable 'e' referenced before assignment
```

Thomas Dickerson  
@shriramk seems like a good thread to port over this doozy from Twitter. “here's possibly the worst Python scoping rule I've ever seen.” Try for ...

@science_quotes@c.im @freemo Okay but what's the volume of Lake Superior?

R. A. Dehi boosted

#introductions

Hey, I'm Windell Oskay!

My background is in atomic physics. I co-founded, with Lenore Edman mastodon.social/@lenore1, Evil Mad Scientist ( evilmadscientist.com ), where I design the hardware and software of the AxiDraw pen plotters. Past projects include BristleBots, WaterColorBot, CandyFab.

Latest project, with co-author Eric Schlaepfer mastodon.social/@tubetime, is Open Circuits ( opencircuitsbook.com ), a coffee-table book photographic tour inside electronic components.

@deshipu Wasn't a serious suggestion, just an exploration of the difficulty of the problem. I appreciate the effort you spent to explain the ideas very much!

R. A. Dehi boosted

@science_quotes@c.im @freemo For engineering, is pretty valuable to know that the speed of sound (in air, near STP) is between 100 and 1000 m/s. Among other things, you know that if you compute an expected velocity for something of hundreds of meters per second, you need to think about taking aerodynamics and human safety into account that you wouldn't at lower velocities.

If you don't remember if is closer to 300 or to 400 m/s, sure, you can look that up. But knowing the order of magnitude of *every* potentially relevant phenomenon is fundamental to knowing which ones you can disregard.

R. A. Dehi boosted

@samplereality Twitter was written in Ruby at first too, but Ruby wastes 99.9% of your CPU and 90% of your RAM, so rewrote it in Scala years ago to make the costs much less enormous.

@science_quotes@c.im @freemo For engineering, is pretty valuable to know that the speed of sound (in air, near STP) is between 100 and 1000 m/s. Among other things, you know that if you compute an expected velocity for something of hundreds of meters per second, you need to think about taking aerodynamics and human safety into account that you wouldn't at lower velocities.

If you don't remember if is closer to 300 or to 400 m/s, sure, you can look that up. But knowing the order of magnitude of *every* potentially relevant phenomenon is fundamental to knowing which ones you can disregard.

@deshipu Sadly true. Suppose you could commit them to Git with GPG-signed tags or something, which is easy for others to replicate with the full history; wouldn't be as transient but then there's no identity other than the (transient!) GPG key.

R. A. Dehi boosted

@deshipu Hmm, maybe it did work after all.

The archive.org snapshot of the Mastodon thread page does include various posts on the thread. Load progressively, but they load from archive.org and not fosstodon.org. Even the images in the posts load when I click through them.

But the images have URLs like web.archive.org/web/2022112116. Note that the timestamp embedded in the URL is 16:38:24, while the timestamp in the URL of the original page is 16:22. This suggests that archive.org is archiving the image successfully, but only when my browser loads the archived page and requests the image. The archival only works if I go and click on all the things in the thread that need to be archived!

My initial suspicion, however, was that archive.org only archived the Mastodon SPA and not the posts, and the SPA was requesting the posts at view time *from the original Mastodon server*. And that would have been a completely unsuccessful archival; upon viewing years later, it could have even included new information added by a malicious Mastodon server at that time. Is not so.

Should have known @brewsterkahle's team was pretty on the ball when it comes to archiving Mastodon since they even run their own instance.

@deshipu Hmm, maybe it did work after all.

The archive.org snapshot of the Mastodon thread page does include various posts on the thread. Load progressively, but they load from archive.org and not fosstodon.org. Even the images in the posts load when I click through them.

But the images have URLs like web.archive.org/web/2022112116. Note that the timestamp embedded in the URL is 16:38:24, while the timestamp in the URL of the original page is 16:22. This suggests that archive.org is archiving the image successfully, but only when my browser loads the archived page and requests the image. The archival only works if I go and click on all the things in the thread that need to be archived!

My initial suspicion, however, was that archive.org only archived the Mastodon SPA and not the posts, and the SPA was requesting the posts at view time *from the original Mastodon server*. And that would have been a completely unsuccessful archival; upon viewing years later, it could have even included new information added by a malicious Mastodon server at that time. Is not so.

Should have known @brewsterkahle's team was pretty on the ball when it comes to archiving Mastodon since they even run their own instance.

@deshipu Don't agree. Those aren't among the goals of the "programming patterns" movement. End-user comprehensibility isn't on their roadmap and never has been. Is an attempt at building something else by the same name.

@deshipu Maybe you could at least post the license on your blog? A link to a nonexistent Mastodon post might not be very convincing evidence of a license a month from now, and think this didn't work: web.archive.org/web/2022112116

@deshipu The "programming patterns" in the Portland Pattern Repository are not a pattern language in that sense; they are invisible to users and so fail to enable the "architect" to delegate design decisions to end users. And they do not form a coherent "pattern language".

perl.plover.com/yak/design/

@deshipu By the way, are these drawings under a CC license? Are fantastic.

@deshipu Some of these, including this one, sound like "design patterns" in Alexander's original conception: a language shared by users and designers that enables them to discuss a design.

Just as can imagine a non-architect saying, "Could we use some Ceiling Height Variation here?", I can imagine a non-programmer saying, "Could we add an Informal Notation space here?"

R. A. Dehi boosted

Journalist @adamdavidson on moving to Mastodon: "I think we got lazy as a field and we let Mark Zuckerberg, Jack Dorsey, and, god help us, Elon Musk and their staff decide all these major journalistic questions."
themarkup.org/newsletter/hello

R. A. Dehi boosted

I find it frustrating how user research about how normies prefer algo timelines is floated without acknowledging that it so far has always led to outrage-driven hellholes like Twitter or Facebook.

I don’t want to take it away from anyone just b/c I don’t like it, but if you don’t have a plan for this, I’m ok with the 99% scrolling thru TikTok & arguing with their racist uncles on Facebook about made up news—while this stays a tiny nerd hole.

My adrenal system is tired of outrage baiting.

@samplereality Well, it might be a more conservative estimate to say that Ruby wastes 99.7% of your CPU.

R. A. Dehi boosted

I've now installed a "RT @" filter so Twitter retweets don't show up in my home feed (shakes fist at clouds)

@scottjenson I've signed up for GitLab using an email from a domain that certainly never "signed up" itself. I assume that still works.

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.