When all you have is a hammer…

When I upload a photo to this blog, WordPress creates lower-resolution versions of the photo and stores them along with the original. It serves the lower-resolution photos if the browser window is too small so it can save bandwidth.

As an example, this photo:

is named IMG_0185.jpg. When I uploaded it, WordPress created files with names like IMG_0185-150x150.jpg and IMG_0185-1024x768.jpg for versions with those resolutions.

I wanted to get a list of all of the original photos in the library without the low-resolution variants and use exiftool to extract some information. It’s a fairly straightforward process.

Step 1: create a list of all the photos in the WordPress directory by using the Linux find command, like so:

find .

Step 2: use a regular expression to filter out all of the variants, all of which have a string of the form - followed by a number followed by x followed by a number followed by . and jpeg, jpg, or png. Easy enough:

find . | egrep -v '.*-[0-9]+x[0-9]+\.(jpe?g|png)'

Step 3: feed that result into exiftool, collect my information, and profit!

There was only one problem – exiftool processed every file in the directory, even the ones that weren’t in the output of Step 2.

I couldn’t figure out what was wrong – eventually, I realized that the output of find included a line with a single dot, meaning the current directory, and when exiftoolsaw it, it processed all the files in the current directory.

I spent quite a while trying to improve my regular expression to remove the line with the single dot before I realized there was a simple solution: add type -f to the find command so that it wouldn’t list directories; in particular, it wouldn’t create the line with the single dot and I wouldn’t have to filter it out so that exiftool wouldn’t get confused.

Regular expressions are a wonderful tool, but they’re not always the right tool for the job.

Overcoming the darkness

We planned to go to the JCC to work out this morning – we even got out of the house 30 minutes earlier than usual. And there wasn’t much traffic because school’s out for the summer.

We got to the corner of Los Gatos-Almaden Road and Los Gatos Boulevard – the traffic light was completely out. “That’s funny,” I thought to myself – usually the lights flash if there’s a problem. No one was coming and I was making a free right turn onto Los Gatos Boulevard, so I didn’t need to stop.

The next light was working fine, but the one after that was out. As was the light at Lark. And the ones on Lark. Everyone treated them as four-way stops – it was probably a quicker trip than usual.

Power was out at the JCC, too. During the pandemic, they had installed some fitness machines on the tennis courts and they haven’t yet removed them, so we used the stationary bicycles, which I was surprised to learn have human-powered electronics.

We took a different route home – one where all the signals worked.

The trouble with being at home…

…is that there are days when there isn’t much to write about, and today was one of them.

Sure, I could write about the news – there’s far too much to write about there – but I’m not going to add anything new to anyone’s understanding of what’s happening, so I’ll pass.

I did rate and categorize the photos I took the first evening we were in Madrid. In the process, I decided I liked the photo of the Congress of Deputies that I took on my iPhone more than the one I’d took on my Lumix and had already published. Here’s the one from the iPhone.

And here’s the one I took with the Lumix.

As I said, I didn’t have much to write about!

Recycling pays

Tonight was the Silicon Valley Storytellers anniversary meeting and Story Slam; our theme was “The Great Outdoors” and I was enticed into becoming one of the storytellers competing for three Amazon gift cards.

I wasn’t sure what I was going to use to build my story; I’ve never gone camping or pitched a tent. I finally decided to tell the story of my most recent outdoor experience – walking along the beach in Santa Cruz and wine tasting on the deck at Burrell School Winery, pretty much as I’d blogged it on Saturday.

We had six storytellers, telling stories ranging from camping in the Sahara Desert to nearly losing a tourist while seeing the Northern Lights in Fairbanks. There were tales of fires in the outback, car crashes in India, and what happens when young children are driven too fast on curvy roads in California.

I was surprised when my name was called as one of the winners; there wasn’t any real drama in my story, so I tried to make it funny, and I guess it worked!

My mustard seeds don’t pop

I made one of our pandemic favorites tonight, Slow Cooker Spiced Lentils with Veggies. It’s easy, tasty, and doesn’t heat up the kitchen too much.

The first step on the stovetop calls for heating vegetable oil (or ghee) on medium heat, then putting in black mustard seeds and waiting until they pop, 1–2 minutes.

My seeds don’t pop. I heat the pan on the induction cooktop at slightly over half power, wait until water dances, put in the oil, wait another minute for the oil to heat up. Then I put in the mustard seeds and cover the pan.

Two minutes later, nothing has happened; the oil is visibly hot and shaking, but there was no popping, and the lid of the pan is completely clean.

Could my seeds be stale? Do I need to heat my oil longer, or at a higher setting?

We like the finished product, even with unpopped seeds, but I’d like to do it the right way, at least once.

Any suggestions?