My home screen

There’s a trend on various networks to show off one’s home screen on their smart phones and / or tablets.

Never being one to miss an opportunity to follow the herd, here’s my iPhone’s home screen:


For good measure, here’s the second screen, because how can I get by with only two?


I love folders.

Hello, world

Obligatory “I’m still alive” post.

For microblogging, I’m on Twitter and ADN (

I’m not on Facebook1.

I’m on Google+ periodically.

There’s Tumblr, where I lurk a bit, mainly to find lurid pictures for a friend of mine. There is a LOT of porn on Tumblr.

You can also find me on Pinterest, where I am saving the world, one sarcastic card at a time.

I have a Flickr account because I killed my Instagram account (see above regarding Facebook). The Flickr account has fewer photos than vowels.

My LinkedIn profile is boring, but seeing that I’m always in the market for contract work in SQL Server consulting, it’s there if you want to click on it.

I think that’s all.

1. I realise that Facebook is no more or less evil than Google when it comes to privacy. Google knows more about me than I do. My reasons for deleting my Facebook account are, in retrospect, hypocritical. That said, I have a lot more time in my day2 now that it’s out of my workflow.

3. For similar reasons, I’ve stopped contributing to my StackExchange sites. I achieved my goal of reaching 10,000 reputation points on It was a major time sink, so it no longer features in my workflow.

Merging iOS Message databases: update

Success! Sort of …

Instead of the complicated method I described previously, I’ve gone manual, which is, yes, more complicated :-).

I started with the latest sms.db file from my new iPhone, and then editing SQLite scripts, incremented the ROWIDs by 30,000 for the message table, and 1000 for the others, so as to avoid collisions. I then ran the INSERT statements from the old sms.db file, with their original ROWIDs, so that they’d slot in before the newer stuff. There are significant gaps in the ROWIDs, but I don’t care about those because I can store two billion messages before I run out of numbers.

The iBackupBot restore was a success, albeit edge-of-my-seat stuff when I opened the Messages app and got a blank screen (it eventually opened up, but it took a while).

The biggest complication was the relationships between chats, handles and messages. I still don’t know what a handle is, but to be fair, I haven’t even looked at the table closely.

Because the chat table has a unique constraint on the [guid] field, which forced me to go manual, I had to map this value back to the old sms.db chat table, and this is where the “sort of” in my original statement comes from: some of the conversation threads (chats) were wrongly attributed to contacts, groups of contacts, and so on. This is due to my naïveté in understanding the data.

Second phase is to analyse the records more closely to see how handles and chats work exactly, and then use a different method to remove duplication.

So for all you people out there, I am using SQLiteAdmin, TextPad, and a lot of patience to manually match key fields between both databases.

2013-03-09 Edit: According to John Lehr, the handle_id is the link I should have deduplicated first, before doing the chat_id. Simple enough (though manual), so I’ll keep that in mind when I address this again.

Progress on Merging SMS databases

I ran into a bit of a snag with my original plan. I built the framework for parsing the SQL script, one statement at a time, and catered for statements that wrapped over more than one line. It took about two hours to get to the point where I was ready to parse the SQL statements.

Then I remembered why I’ve abandoned previous efforts to do this. Has anyone tried, with ease, to parse SQL in C# code? There’s a whole host of issues involved, which is why we usually go directly to the database using ADO.NET or something similar.

So I gave up with that line of thinking. Right now I’m investigating the Microsoft Synchronization framework, using System.Data.SQLite, to go directly to the database and not use the dump file. Hopefully, reading directly from the tables will make life easier.

Merging two iPhone SMS sqlite databases

Disclaimer: I haven’t actually done it, yet.

Last night I rediscovered my original iPhone SMS database from before I did a factory-reset on my phone. I had jailbroken my 3G ages ago, and ever since then, the carrier wasn’t updating properly, regardless of the SIM card I used or country I was in. So in 2011 I reset the phone, and continued from there.

In 2012 I tried to merge the two databases using some hacky code I threw together, and of course it didn’t work. The problem, as it turned out, was that the SMS database format had changed significantly between iOS 4 and iOS 5 to make allowances for iMessage, and I was trying to import an iOS 4 database back onto my phone using iBackupBot.

So the first order of business was to restore the old database to my old iPhone, so that I could upgrade it to the new format, which is now done.

Thus far, I’ve managed to dump both sqlite databases, using the same database structure, to SQL scripts. I’m going to use some C# to build classes to represent each table, build up a list of each class in memory from the files, then renumber the newer ID fields (I’ll just increment them with the highest value of the old database), so that there aren’t any unique constraint collisions (the problem I’m sitting with right now).

Having both of the (20MB in total) SMS databases in memory will also allow me to strip out the MMS attachments, because those messages won’t work on the new phone. I want to update some of the telephone numbers as well, so that I don’t have to sit with twenty message threads from the same person.

Then when I’m done cleaning up the data, I’ll write it out to the same database structure, rebuild the triggers, and then use iBackupBot to copy the new database file back over again.


It’s snowing today in Calgary. While this is expected for March, it was unexpected for me.

We moved here from Lloydminster last August, and after two-and-a-half years there, I thought we were used to heavy snow.

The good news is, the yard is much smaller, there is no driveway, and the front path is much smaller than in Lloydminster, so there’s less shovelling to be done.

I estimate 20cm has fallen so far, as of 13h20.

Some photos:

10h18 this morning
10h18 this morning
10h20 this morning, after the dog went out
10h20 this morning, after the dog went out
10h57 this morning, upstairs window
10h57 this morning, upstairs window
11h02 this morning
11h02 this morning
12h25 this afternoon, through the front door
12h25 this afternoon, through the front door
12h27 this afternoon, with the railing under some depth of snow
12h27 this afternoon, with the railing under some depth of snow
12h30 this afternoon, with the dog coming back, indicating it was time to move the snow
12h30 this afternoon, with the dog coming back, indicating it was time to move the snow
13h09 this afternoon, after I shovelled a pathway to the garage
13h09 this afternoon, after I shovelled a pathway to the garage