Author Archives: qsf

Mac tip of the day: OCR

I remember one of the features that first attracted me to the Mac, back around the turn of the millennium, was its pervasive support for PDFs.

On Windows, I’d had to install cumbersome Adobe software to convert certain formats into PDF documents. On the Mac, any app that could print could create PDFs without the need for other software: it was there in the Print dialog. (Pervasive PDF support came partly from the fact that the graphical system for the NeXT computer had used Display Postscript, and OS X incorporated a kind of ‘Display PDF’.)

Well, another technology that’s becoming pretty pervasive in the Apple world is OCR: the thing that can recognise text in images and turn it into regular text. When travelling recently, I discovered that I didn’t need to use things like Google Translate so often: if I just pointed my iPhone camera at, say, a Dutch street sign I didn’t understand, it recognised there was some text on it, and by clicking the little text-selection box I then had ‘Translate’ as one of the options.

This automatic OCR is built into Preview on the Mac, too. I was writing a few paragraphs in a comment on website recently, and the browser suddenly became unresponsive and I could neither continue editing nor do anything else with the page. Closing it was my only option, but I didn’t want to lose all my typing.

So I first did the old Shift-Cmd-4 — a keyboard shortcut nearly as old as the Mac itself — to screenshot part of the window, and then in Preview I could select, copy and paste my text elsewhere. Nice, accurate and quick!

I shook Elon Musk warmly by the hand…

 

I shook Elon Musk warmly by the hand and told him I had enjoyed his talk about rockets.  That was more than twenty years ago, when we were both speaking at the same event. (Doesn’t that sound impressive?)  He was talking about future space tourism.  I was talking about creating IT for the developing world. (Doesn’t that sound virtuous?)

I would, of course, completely refuse to shake his hand now.  That’s partly because of, and partly despite, what’s happened since.

Alongside his discussion of space exploration — of which, as a broad generalisation, I am a fan — he also mentioned he was investing in a company that produced electric cars.  He was suggesting that they might one day actually be a really viable alternative to petrol-powered ones, although at the time the likelihood of my ever affording such a vehicle seemed roughly the same as my ever going in one of his rockets.

And yet, only a decade or so after that event, we bought our first electric car to replace our diesel Golf, and have never looked back.  And a little over four years ago, by shaking our piggy-bank very hard, we bought one of his Tesla Model 3s, which not long afterwards became the best-selling car in Europe.  Note that I didn’t say the best selling EV… there have been several months where it was literally the best-selling of all cars.  Nowadays Tesla models still regularly hit the top-10 lists even now they have a lot more EV competition, and despite the key Tesla numbers now being split between the Model 3 and the newer and more popular Model Y.

So Elon Musk, in my eyes, built up a huge store of credit, because I believe he has single-handedly done more than any other living person to combat climate change.  That’s quite a bank balance.

Though he neither founded Tesla nor designed the cars himself, his perseverance, vision, and willingness to spend his cash where others weren’t, has dragged an entire industry, mostly kicking and screaming, into a far better place, both technologically and for the planet.  I remember the shock of traditional car dealers in 2016, trying hard to sell a few more cars at discounts to fill their next quarter’s quota, when it was announced that quarter of a million people had put down a deposit for the recently-announced Model 3: a car they had never even seen.   It took that kind of major eathquake to rattle the enormous global inertia of the fossil-burning world and to kick investment in battery-production up to a whole new level.   I won’t pretend Musk was doing all of this for purely selfless reasons, or that he did it entirely on his own, but many thousands of Greta Thunbergs combined could not dream of having such an impact.  He changed the world.

Now, it also soon became apparent that Musk wasn’t, let’s say, an entirely reliable figure!  It’s funny now, looking back, to think my main criticism of him used to be his inability to hit his unrealistic deadlines, and the number of his announced products that never saw the light of day at all.  There are drivers now on their third or fourth Tesla who still can’t get the ‘Full Self-Driving’ feature they paid for with their first!

But since then, it won’t have escaped your notice that almost every day’s news has included some new and bigger reason to doubt, dislike, ridicule or fear him, and even the significant amount of slack I was willing to cut him has long since been exhausted.

But here’s the thing.  My Tesla is still an annoyingly wonderful car.  

It’s not perfect, of course. I bought the Model 3 after having tested several other cars, knowing that it was really too big for European roads, and that it was pretty foolish to buy any car that doesn’t have a hatchback, especially if you regularly transport things like dogs and outboard motors.    There wasn’t a dealer close to me. And I knew that, say, the Polestar 2, a similar price at the time, was a more sensible shape and probably much better mechanically.  (It’s basically a Volvo, after all.)  

But I also knew that Teslas had by far the best software, the best battery-management, and the best charging network, all substantially as a result of the headstart his investment gave them.  I wasn’t buying just a car, I realised, I was buying into an ecosystem.  So far, I’ve never regretted that choice.

What I didn’t know at the time was that the car would continue to get better during my ownership, as a result of those regular software updates which arrive every month or two.  Here are a couple of examples:

1. Lights

When I bought it, I was sad that the Model 3 didn’t have those smart matrix headlights some other expensive cars were getting.  Certain Audis, for example, would dim the sections of the headlight beam that were pointing at oncoming cars, to stop them dazzling other drivers. Ah well, I thought.  You can’t have everything.  

And then, about three years later, a software update turned them on.

Eh? What? I didn’t even know I had the hardware; I thought they were ordinary headlights!  

But no, the possibility of individual LED control was built-in, and so after I had already clocked up more than 20,000 miles, the car got a new feature. For free. Which works really well. And it’s smarter than many other systems because it’s based on the computer’s model of surrounding vehicles, rather than just on the detection of headlights, so it will try to avoid blinding cars in front of you in the same lane too, whose drivers might otherwise be dazzled in the rear-view mirror. And I’ve seen it do the same for cyclists.

Many of the visible updates are small and incremental. But this was a really nice big present, and completely unexpected.

2. Brakes

Just before Christmas, I was reversing off a shop’s forecourt into a side-road.   I pulled out promptly, turning as I did so, because I needed to get into a gap in the traffic.  At the same time, a woman who had been pushing her bike along the pavement suddenly turned it out and crossed the road right behind me.  I had no way of knowing she would do that — I was already moving but she was looking the other way — and, though I wasn’t going very fast, it could have been a very bad morning for both of us. I’m pretty sure she would at least have gone to hospital with a broken leg.

But the car saw her, and reacted much quicker than I could, slamming on the brakes so hard that I thought I had hit something solid.  I worked out what had happened (and later verified it on the car’s automatic camera recordings).  Meanwhile, the cyclist walked merrily across and then cycled off, unaware of her really quite narrow escape.  Perhaps she was wearing headphones.

Only a few months ago, a software update introduced an enhancement to the emergency braking which tracks the trajectory of surrounding objects and pedestrians, and works out not just whether they are right in your path, but whether they will be when you get there. I suspect it was probably that which allowed her to walk away oblivious and unharmed.  But it wasn’t part of the car when I purchased it, and it didn’t cost me a penny.

So yes, I do love this car, and especially the associated ecosystem.  It cost us a lot of money, and it’s depreciated a significant amount since then, but it’s been completely reliable so far and the running costs have been very low.  For all of these reasons, I expect to keep it a long time.  

Which is good, because, since the US election, in which one member of our household voted, I don’t think I’ll be allowed to buy another Tesla in future unless something pretty drastic changes!

Hopefully we can keep this one long enough for some of the competition to catch up a bit more.   There’s now a really good choice of other vehicles, and their battery management is getting a great deal better.   Personally, I think the local Kia dealer would be my first point of call if I had to change.  But a lot of them are more expensive than Teslas now, and have neither the same charging capabilites nor such good and regular software updates.

Still, Elon set the bar high, and Tesla keeps providing the competitive stick driving much of the rest of the industry forward in the hope of those “Could this be a Tesla-beater?” reviews. So I have high hopes for the future.  

In the meantime, we feel a bit better from having one of these stickers in the window!

 

Per Capita

My friend Rupert posted today on Mastodon:

‘It would really help if every time a news article mentioned an amount of money that a country was spending on something, they also gave the cost per person. We are very bad at the scale of large numbers, and a little “50p per person” or “£158 per person” would help us all to grasp the significance of things.

It’s common practice when reporting on taxes and borrowing, but rare for spending. But these are two sides of the same thing, surely?’

I thoroughly agree.

For me, by far the most interesting figure about, say, the NHS annual budget, is that it’s roughly £2600 per person. Or that each person in our house is paying something like £1000 for HS2.

And when we decide we want to double the NHS budget, or cut HS2, or whatever, multiplying those by the number of people in the house suggests the kind of influence it might have on our household taxation.

And of course, Boris’s big Brexit Bus lie:

would have rather lost its impact if it had made the equivalent claim: “We each send the EU about 70p a day”.

(Not forgetting, of course, that the real number was about half that.)

 

SatNav of the future?

Galileo satellite in orbit.

I always love it when the more theoretical aspects of physics, so often the exclusive realm of mathematicians and those studying the origins of the universe, have a direct impact on our daily lives. 

Take the GPS system, for example, which has so many challenges that it really shouldn’t work at all, as far as I can see.   Quite apart from the very clever software and signal-processing needed to allow a weak radio signal, from a satellite tens of thousands of miles above you, to be diluted over a substantial chunk of the earth’s surface, and distorted by the ionosphere, and compromised by the weather, yet still be picked up by a small battery-powered device in your pocket when you’re sitting inside a moving metal box surrounded by lots of other noisy electrical signals… quite apart from all that, there’s another problem… and it involves Einstein.  

Did you know you were using his Theories of Relativity whenever your satnav tells you how far it is to the next junction?    I’ve always found this very pleasing.

GPS depends on being able to make very accurate time measurements, and the issue is that the satellites are travelling very fast, which means that time itself runs at a different rate for them than it does for the those of us down below driving round the M25. Their atomic clocks run more slowly than an equivalent on Earth.  But a bigger effect comes from the fact they’re in a lower gravitational field, which causes them to run faster!  Pleasingly, this means that both Special and General Relativity need to be taken into account by the GPS system, in order to work out these differences and stop a gradual drift, which would be visible over time on your satnav map and might make you think you were on the wrong road.  Thanks for sorting that out, Albert!

However, for all the magic of GPS, it has its limitations, as you’ll know if you’re driving through a long tunnel, or between skyscrapers on the streets of Manhattan.  And the delicacy of the GPS signal also means that it can easily be interfered with by, for example, an enemy on a battlefield. When the GPS signal is lost, navigation systems have to fall back on ready-reckoning using accelerometers and distance measurements to try and guess where you are.  This is a process as old as navigation itself, but it is very fallible, because your knowledge of your current position is based on your position a little while before, and any errors in that process get magnified the further you go. The accuracy of accelerometers has greatly improved over time and become less dependent on things like the bearings of spinning gyroscopes, but it’s still a problem.  

This is why a lot of people are awfully excited about the recent experiments with Quantum Positioning, which may offer a much more accurate way to do this in the future (and I would guess may be useful long before quantum computing!)  Once again, theoretical physics may help us find out where we are.  It may be rather a long time before you have this mounted on your dashboard, but perhaps not so long until it’s in ships, submarines and aircraft.

So how do you use quantum mechanics to work out your position?  (Or, more precisely, your acceleration, from which changes in position can be derived?)

Fortunately, there’s a really excellent video by Ben Miles explaining the basics.  Nicely done.

Code Review

It’s easy for those of us who passed their UK driving test a long time ago to forget that the Highway Code is not a static document: it is updated from time to time and old drivers need to know about the changes as well as young ones.

For example, I didn’t know about all these changes in 2022, mostly to do with the interactions between different types of road users: drivers, cyclists, pedestrians and horse riders. Did you? They’re quite important.

Yesterday

I liked this Beatles tribute, reposted on Mastodon but, it appears, written originally by one Sunni Freyer in the late 90s:

YESTERDAY

Yesterday,
All those backups seemed a waste of pay.
Now my database has gone away.
Oh I believe in yesterday.

Suddenly,
There’s not half the files there used to be,
And there’s a milestone hanging over me
The system crashed so suddenly.

  I pushed something wrong
  What it was I could not say.
  Now all my data’s gone
  and I long for yesterday-ay-ay-ay.

Yesterday,
The need for back-ups seemed so far away.
I knew my data was all here to stay,
Now I believe in yesterday.

Poets of Matter

Ask any of the chaps, and they’ll tell you.

“Q?”, they’ll say, “Why, he’s a vigorous young buck, springing lightly from one adventure to the next!”

So you might be surprised to hear that, not only am I actually old enough to have a nephew who is himself a father, but that he’s also well established in his career as a design engineer, to the extent that he’s recently published a rather nice little book on the topic.  

If you’re thinking about engineering as a career, or a degree course, or an apprenticeship, then you may have some idea of the kind of exams you’ll need to pass and the things you’ll need to know.  But what might your life actually be like?    Are you basing your expectations simply on the splendid pictures of Isambard Kingdom Brunel standing beside enormous anchor chains?  Because if so, you might need a little bit of updating.

Poets of matter.

James talks about the inspirations and the frustrations, the hard work and the sense of achievement, the old skills and the new tools that might be associated with the noble pursuit of engineering in the modern age. It’s a great guide to what might lie ahead of you if you do decide to go down this path, and the mental attitudes that will help you prepare for it and get the most out of it.  I’m biased, of course, but I thought it was very nicely done.

Recommended for anybody you know currently contemplating their future careers.  

Go on, buy ’em a copy!

 

 

Train-ing data

I very seldom use the railways in the UK any more, though I did make two short one-way train journeys in 2023. The first was to collect our campervan from the dealer, and the second was when Rose, Tilly and I took our inflatable kayak from the little station at Bures one stop up the line to Sudbury, and then paddled back down the River Stour to where we’d left the car in the station car park.  That was fun.  They do have their uses for one-way journeys.

But I don’t think I went on a train at all in 2024. (Oh, actually, wait a sec… none in the UK: there were a couple of trips on the Athens metro.)   I do quite like trains as a theoretical concept, and use them when I’m in other parts of the world, but the reality here in the UK is that, unless you’re unfortunate enough to live in London, driving is generally much more comfortable, more reliable, usually quicker, and always much cheaper than going by rail, so there are very few circumstances when I’d choose to go by train.  Even the obvious advantage that you can read on the train is now significantly diminished by having Audible in my car.

And before anyone points out the green credentials of rail travel, it’s less clear-cut than you might think. This page suggests that even if you include all the CO2 used in manufacture, the carbon footprint of two people travelling in an EV will work out at 90g/person/mile; very similar to the 80g/person/mile of a standard-class UK train seat, and way better than a first-class seat.  If there are more than two of you in the car, you can feel especially virtuous, as well as saving lots of money. This UK government report suggests that EVs and trains have broadly the same emissions if there are only 1.6 people in the car.

There was a brief period in the past when I worked in London for a few weeks, but I quickly realised that life is not a rehearsal, you only go around once, and spending any significant part of one’s all-too-limited time on a commuter train was sheer madness!  But I’ve found that as long I only use the railways for unusual trips at off-peak periods, or on holidays, I can maintain a nostalgic fondness for them.  (And if you’re ever able to take all that money you save over the years by not going on trains and blow it all on one ticket on the Orient Express to Venice, I can definitely recommend the experience!)

All of which is a rather long introduction to the fact that I do still find this live train map from SignalBox to be rather pleasing!  You can sit comfortably at home, picture all those trains rushing in around the country, and feel some sympathy (or perhaps schadenfreude!) for those whose icons are not green.

Another AI cautionary tale

In one of my YouTube videos, I talk about how I’ve wired up my solar/battery system to ensure the energy in my home battery isn’t ever used to charge my car (which has a much bigger battery, so doing this doesn’t normally make sense), while still allowing the car to be charged using any excess solar power.

I had a query from somebody who was confused about how it worked, so I did my best to answer, and we went to and fro in what became a decent-length conversation.  He has a similar inverter to me, but had some fundamental misunderstandings about how it worked.  

At first, I assumed this was because he had different goals: he lives in another part of the world where there’s a lot more sun and a much less reliable electricity supply, for example.  But no, it turned out he wanted to do the same thing as me, but was convinced it wouldn’t work the way I had described it.

It turned out, in the end, that the source of his confusion was that he had asked four different LLMs (ChatGPT, Claude, Perplexity, and Grok) about how to configure the system, and they had all agreed that ‘battery power is never used to power loads on the “Grid” port’, which is actually incorrect.

What persuaded him, in the end, that my description was right, and that all four LLMs were wrong?

He read the manual.

W. Heath Robinson

We have some Heath Robinson cartoons which we still very much enjoy, but for which no longer have the wall space, and so have given them away.

I thought, though, that other Status-Q readers might enjoy them too. (Click for larger versions.)

Plucky Attempt To Rescue A Family Overtaken By The Tide

Some Occasions When A Gentleman Is Not Expected To Give Up His Seat To A Lady

A Surprise Packet For The Cat Burglar

Christmas Classics

The oral tradition has long been an important part of preserving human culture, and it is perhaps especially at this time of year that we’re conscious of works of music and literature that have been handed down through the ages.

While I was showering this morning, for example, I found myself singing a cheerful seasonal song which my brain had kindly preserved for me, almost intact, for more than half a century, but I just couldn’t remember the first line.  It was only as I was towelling myself down, that it came back to me.

Christmas, Christmas, in Smurfing Land

Anyone else grow up in the 70s?

Misplaced trust

This might be a little technical for some readers, but don’t worry, it’s not actually the technical detail that’s important…

On my home server, I run about half a dozen services that I need to access via a web browser, so they’re all behind a Caddy reverse proxy which connects me to the right one, depending on the name I use in my browser: ‘homeassistant’, ‘unifi’, ‘searxng’, ‘octoprint’ etc. (All of these names are aliases for the same machine.)

One of these services is Nextcloud, which has user accounts, and I was thinking it would be handy if I could use those accounts to authorise access to the other services. Can I allow someone to use my web search frontend only if they have an account on my Nextcloud server, for example?

I thought I’d try out an AI system to see if it could speed up this process, because they’re often good at this kind of thing – Google Gemini, in this case. And, to my delight, it gave me pages of detailed instructions.

It knew that Nextcloud supports the OpenID Connect system, told me how to set it up, and then how to use the oidc directive in the Caddy configuration file to connect the two, so that Caddy could ask Nextcloud whether the user should be allowed in. It gave me nice examples of oidc actually in use, and the parameters you’d need to configure when using it to talk to the Nextcloud instance.

“Great!”, I thought, and grabbed a coffee, went upstairs to my machine, and started typing code to try it out. And it was then that I discovered…

Caddy doesn’t actually have an oidc directive.

© Copyright Quentin Stafford-Fraser