Six squared & five squared

微信扫一扫,分享到朋友圈

Six squared & five squared

Today

Today, April 29, in 1993, I boarded a plane at Gatwick in the morning, and alighted late afternoon at Stapleton Airport in Denver. From there I rented a car and drove down to Colorado Springs and my new job at TurboPower Software. I’d never been to Colorado before. This was 25 years ago today. I was a mere stripling, having just turned 36 years of age.

Visa and entry stamp

I’d left my job at Deutsche Bank the previous Friday and had driven up to my parents the following morning to drop off my Volvo 1800S. They were going to look after it , until I returned some 2 or 3 years later (no, I wasn’t planning on staying in the US too long). That same morning, unbeknownst to me as I drove up the A1, the IRA exploded a 1000kg truck bomb in Bishopsgate , just 100 yards away from my ex-offices, killing one person and injuring 44 others, and wiping out a mediaeval church and the photography shop where my camera (a going -away present) had been purchased. If I’d have still been employed at the bank, I would have been at work: the team were doing some hardware/networking changes on the trading floor over the weekend and were safely evacuated before it went off (there was a one hour warning).

So, an inauspicious start to my time in the US.

But this post is not really about that, but about the fallibility of memory. You see, for the longest time I thought I’d actually flown to Colorado and my new life on Sunday 25th, the day before my dad’s birthday. I’d remembered correctly that the bomb blast had happened on a Saturday, therefore it must have happened on the 17th. But as I see now on Wikipedia, that is wrong. My memory of the time is faulty.

The fallibility of memory came up again just this week. Recently, I’ve been slowly going through the domains and websites I own and manage in order to make them secure. It involves a bunch of work, even on a static site, but this last week, I had a go at securing a blog site I manage. In other words, a server-side website.

Hoo boy. The initial stuff wasn’t too bad, but then I ran into an issue. Windows Live Writer (ah, joy!) writes out a full URL starting with the HTTP:// protocol part when you add an image. Every single one of those posts on the site had images, and when I turned on HTTPS, they all caused security errors and “disappeared”. To solve it, the job would have been to go to every single one of the posts in the underlying database and fix the URLs in the posts’ markup.

But then something niggled at the back of my mind: I’d done something like this before on this blog. I’d had to change a bunch (all?) of the posts here to fix some markup issue. But what? I did a search through all the .sql files I had on my drive: maybe I’d saved something from my use of SQL Server Management Studio (SSMS). Nope, nothing. Visions of having to write some C# code floated through my mind.

I then did some research via Google, and came across this on StackOverflow :

UPDATE [dbo].xxx
  SET [Value] = REPLACE([Value], '123', 'ABC')
  WHERE [Id] = 7

I dutifully tried it in SSMS and it failed. The field I was using it on ( [PostBody] ) was too large. Now this triggered another thought: I seem to remember this from last time and I had to copy the field somewhere else (?) or cast it somehow. Then I found something like this, again on StackOverflow:

UPDATE [dbo].xxx 
  SET [Value] = CAST(REPLACE(CAST([Value] as NVarChar(MAX)), 'ABC', '123') AS NText)
  WHERE [Id] = 7

In other words, a double cast, with a REPLACE in between. And that worked; the WHERE clause wasn’t needed either. A couple of other similar tricks with some SQL code in SSMS, and I was done “fixing” the markup of the blog posts.

I suppose there are two things at play here. First is that, either I’m getting too old and my memory is just getting too frail, or, more likely, like pretty much everyone, I now rely on the internet plus Google to find out stuff and/or remember stuff that I don’t use every day (or week, or month). (We do this all the time at home: we’re watching something and suddenly remember that actor being in something else we’d watched last year, what was it now?) In my business, there is after all that modern day adage of “If I don’t know how to do X in code, I can always Google it”. As programmers, it seems to me we are more wanted for our analytical skills in designing and coding, rather than our ability to retain arcane knowledge.

Second is that it’s time to make sure I continue adding to the knowledge on the internet. Hence I have a new year’s resolution at the start of my 26th year here in the US to post more on my blog. I’ve let things slide a bit. I’m not promising hard topics well explained all the time, but a whole slew of subjects, some to do with code and algorithms (see how I slipped some of that in this one?), some that deal with technology, some not. Welcome.

微信扫一扫,分享到朋友圈

Six squared & five squared

Jeff Bezos' Blue Origin rocket successfully lifts off and lands back on the ground in textb...

上一篇

Archiveis: simple Python wrapper for the archive.is capturing service

下一篇

你也可能喜欢

Six squared & five squared

长按储存图像,分享给朋友