Category Archives: Annoyances

Webdev Tip: ALWAYS Put the Record ID *in* the Edit Form

I started out this morning happy with my web host. They’d sent me an alert about disk usage that allowed me to catch an error that would have filled up all the available space on my VPS and taken down this site and several others, and I was able to fix it before that happened. That changed as I discovered what had actually set it up, as revealed by another, more pressing issue.

Background

A few months ago, my VPS did lock up, because I’d set up backups on a new site and forgot to add a cleanup script. Tech support brought the server back online, I cleared out the backups, and I copied the script over from this site.

But this site’s cleanup script stopped running, and it reached 90% usage. The script was there, but the cron job was somehow pointing to the other script. I figured I must have messed it up at the time, made sure it was correct now, and moved on.

Discovery

Later this afternoon, though, I discovered that a test blog I set up last week was pointing to the wrong site. That seemed really weird. I looked in the control panel and it was very neatly pointing to the other site’s folder. How does that happen?

Then I remembered: A few days ago, I’d reconfigured several sites to upgrade them to PHP 7.2. I’d opened them in multiple tabs to I could get them all at once. And I had this sinking feeling.

Sure enough: DreamHost’s control panel doesn’t put the form state in the page. As far as I can tell, the ID of the record you’re editing is stored in the session somewhere, which is fine if you only ever have one page open at a time, but if you open two pages, it gets confused.

That’s what probably happened a few days ago: I opened two forms, saved them both, and the settings for one site got written to the other. And it’s probably what happened a few months back with the cron jobs: I opened one to edit, the other for reference, and it overwrote the wrong one.

As near as I can tell it’s just the one site that got messed up, which is a relief. Even better that it’s the test site and not, say, this one. But I’m still waiting for the fixed config change to take effect.

Lesson

Always, always put the record ID for an edit form in the form. People will open multiple records in different tabs or windows, to compare them or just to speed up their workflow.

If you store it in session, or in a cookie, or anywhere else, you run a good chance of saving the data into the wrong record.

Long-Form Twitter: WHY OH WHY?

Twitter is suited for short statements and back-and-forth conversation.

It’s terrible for anything long-form.

Long Twitter threads* and images filled with text remind me of the old tech support days when users would paste screen shots of error messages into Microsoft Word documents and email me the document. It was a terrible tool for the job, but it was the one they knew.

Once you get past two or three tweets (doesn’t matter whether they’re 140 characters or 280, it’s the structure that matters), your ideas will hang together better and be better understood if you write an actual article somewhere. Sadly, Twitter has trained people to stay in Twitter instead of going outside to read the %#$ article**, because you won’t be able to get back to where you were in your timeline, and besides, that’s just too long to read right now.

And that would require you to have, like a blog or something, and what sort of weirdo has one of those? 🙄

So people use what they know, and we get screenshots of long paragraphs that are awful for accessibility. And we get 40-tweet threads that people only see fragments of and take bits out of context. And they’ll reply to tweet #5 complaining about something that’s addressed in tweet #12, but they didn’t see it, because that was hidden behind the “read more” link, and how long does this thread go, anyway? (Scroll bars solved this problem decades ago.) And we get links to articles that people don’t read, but they reply to them anyway — or rather they reply to what they assume was in them.

Which I suppose is what we had in the old days, I mean “nobody reads the articles” was a joke on Slashdot 20 years ago. But it’s still frustrating.

Update: I realized I don’t see this so much on Mastodon. I wonder if that’s one of the ways the culture is different, or if I just happen to not be following anyone who writes/boosts long threads on a regular basis, or if 500-character posts give people enough room to breathe that they don’t feel like they’re already writing a long chain, so why worry about keeping the number of posts down, what’s the difference between 10 tweets and 15?

*To clarify, I’m talking about long threads that are effectively one piece of writing, not a series of “oh, and another thing” follow-ups, live-tweeting as things come up, actual conversations, etc.

**This part is true of Facebook as well.

GPS Navigation Options We Need

GPS navigation options we need:

  • I know how to get to the freeway from home.
  • I know how to get home from the freeway.
  • Don’t send me down someone else’s narrow residential streets just to save two minutes.

If I’m trying to get somewhere other than home after work, I’ll use GPS to get an idea of the time remaining and the fastest route. Since I’d rather avoid the freeway during rush hour, it keeps trying to send me on these zigzag paths through residential neighborhoods to avoid backed-up arteries or just avoid busy intersections. I used to follow those routes, but after a while I started noticing other cars ahead of me that were clearly doing the same thing. It’s not just one car being added to that lumpy narrow road with lots of driveways, stop signs, kids on bikes and people taking out the trash. It’s a lot of cars. And of course we’re following the same apps drawing from the same data, so we’re all taking the same side streets, not spread out among all of them.

If there’s a big difference, that’s one thing, but for two or three minutes? What’s the point?

Of course the avigation app seems so testy when I decline to be part of the problem, and it has to keep recalculating…

The Lesser Evil of Selfie Sticks

I’ve known about portrait distance for a while, and often thought that was a downside of using fixed-lens phone cameras for portraits. To frame someone’s face in a phone you have to either zoom (losing detail) or hold it close enough that the viewing angles distort the face. I prefer using my phone for long shots and using a camera with an optical zoom for portraits.

Unexpected consequence: Selfies are now a major source of young people’s self-image…which is distorted, leading them to feel worse about themselves and even seek out plastic surgery.

The researchers looked specifically at selfies taken from 12 inches away — a common distance for someone snapping a selfie without the assistance of a selfie stick. In a selfie taken from that distance, men’s noses appear 30 percent wider and women’s noses appear 29 percent wider than they actually are.

I think we can all agree that selfie sticks are a lesser evil than unnecessary cosmetic surgery!

Update: From the Facebook comments, here’s a link to a series of portraits taken at distances ranging from 2 meters down to 20 cm, demonstrating how different your face looks at each distance.