The Stochastic Game

Ramblings of General Geekery

Some more contacts love

There’s been a lot of improvement in communications in the past few years, from better services to brand new ones, but I still feel like contact management is lagging behind. I mean, isn’t it important to be able to find how to contact somebody in the first place?

Here are a few things I think could be better.

People have a lot of email addresses

With all the storage space provided by modern email services, and philosophies like GMail’s that advocate not deleting your email, you may have pretty old messages in your account. For instance, mine goes back to 1999 (and sometimes I wish I had thought about keeping my email before then because it’s fun to read those old conversations). This means some of your friends and coworkers may have changed jobs and personal email providers a few times. Some of my contacts have up to a dozen email addresses, actually.

Yahoo! Mail and GMail offer a dynamic list of email addresses where you can add as many as you want for a person, which is good, but Live Mail only gives you a static list of “home”, “work”, “IM” and “other”, which sucks. GMail lets you describe each address as “home”, “work” or “other”, but suprisingly doesn’t let you define custom descriptions. Yahoo! Mail doesn’t have descriptions so you have to guess which goes where.

One thing missing in all 3 services, and that I strongly wished existed, is the ability to tag specific addresses as “deprecated”: if one of your friends isn’t using that old AOL address anymore, you don’t want it ever suggested to you when you compose a  new message. However, you still want this address to be in the system for when you search old conversations with that contact.

Identity Profiles

Going beyond all this, I sometimes wish email providers would evolve from the old contact model of “name/email/address/notes” probably defined in the early days of Lotus Notes or something. The same way OpenID or InfoCard have “identity profiles”, each with its own set of contact information (name, email, address, website, etc.), contact management could also feature such profiles.

“Work” and “Home” profiles would be the most obvious ones, and would let the user tie together a set of previously unrelated information: right now, contacts may have email addresses for work and home, and IM nicknames for work and home, but they’re in separate lists, with no way to tie them together. Besides, as far as I can tell, no email provider even offers the ability to tag an IM nickname as being for “work” or “home” anyway.

The identity profile paradigm could then be used in powerful ways by client applications. For instance, the “work” profile would be the first suggestion on weekdays between 9am and 5pm, but the “home” profile would take over on week-ends and week-day evenings.

Don’t notify, just change

You probably know how much of a pain it is to notify everyone you know that you have a new email address, home address, and/or phone number. In this age of feeds and automatic updates, it’s weird that there’s no fancy technology with a hard to pronounce name that would do just that. Still, several people like Douglas Purdy or Tim Bray have been thinking about something like the following for a year or two now (that’s a lot in internet age!), on which I expand a bit.

The idea would be to use something like the hCard standard, a combine it with some RSS or PubSubHubbub magic: people who want to contact you would pull or get pushed your information instead of storing a completely different (and possibly out-of-date) version in their address book. Since the information is defined by you (via your email provider, your own server, or some 3rd party like for OpenID), it’s always up to date. You only have to change it once in one place and everybody else uses the updated version from then on.

It would especially be awesome if that kind of technology was used by governments, banks, ISPs, phone and cable operators, and all those guys that you always have to write to whenever you move.

Also, if coupled with identity profiles, you could have scenarios where somebody going away on holidays would update his information by making his “on the move” profile the main one, and all the other ones (especially the “work” one) disabled temporarily. If the whole system is correctly designed, this would let us avoid those awful “Sorry, I’m in Hawaii until next month” emails, because the client application would already know all this before you send anything. It would also ideally work not only with email but other protocols as well (IM, etc.).

Clever guy needed

That’s pretty much it. Now I just need a clever guy to make this happen because, well, like most programmers, I’m lazy. Besides, somebody probably had all those ideas and more, already. Still, I’d like my GMail inbox to get better.


Fun with jQuery: the vertical “Coda” slider

Update: my personal website has, since this article, been redesigned and does not feature this technique anymore. The demo page is still available however. It was broken for a while, but should be working again now.

I recently published the new version of my personal website and you’ll have no problem figuring out that I had some fun with jQuery. Probably a bit too much fun, actually, but hey, a personal website is supposed to be just usable enough that you can contact the owner without hassle.

My first approach to the website was a mix of good practices and totally blasphemous process:

  • I wanted a simple website that only lists ways to get in touch with me (Facebook, LinkedIn, and all that social web stuff), and ways to follow what I’m doing online (my blogs, twitter updates, and all that other social web stuff). It would additionally have a contact form so that people could send me a quick message without any extra steps.
  • I also wanted a website with some funky jQuery shit going on. I wanted to learn the API along with vanilla Javascript.

After some research about what jQuery can and cannot do, and a few sketches on my trusted notebook, I came up with a totally revolutionary (in the post-Web 2.0/post-iPhone 21st century definition of the term1) idea: the vertical “Coda” slider!

This UI pattern has been popularized by Panic’s website for their Coda software. It features a panel in which pages slide in and out when you click on their title, displayed in some kind of list or menu bar. There’s a nice tutorial on “jQuery for designers that explains how to reimplement it. The only difference is that I wanted the pages to slide in and out vertically instead of horizontally. You may point out that the aformentioned tutorial features an option to do just that, but it’s not quite the way I wanted. I want it to look like a standard page until you click one of the navigation links, which is when it goes “shwoop” and you go “wow I did not expect that!”.

No need to go through a lengthy tutorial, as you can probably figure how it works by just looking at the code, but still, to make it easier on you I created a “demo” version of the page with placeholder content and none of the other bouncy crap going on. Go check it out if you want to steal some of it, although I still have a couple of little quirks to fix, especially with window resizing.


  1. Which means “not very revolutionary”. ↩︎


Some similarities between Apple and Steve Jackson Games

Apple is company whose boss is a guy named Steve who is, by reputation, quite charismatic but also a real asshole when it comes to working with him and using his intellectual property. Their main product gives them only a small fraction of the market, and its core of devoted fans can be loyal up to a rather fanatical point. This product is always set against the more popular product, which is seen as outdated, inferior, over-marketed, and riddled with product updates that break compatibility with silly new features. Flamewars about which product is better are frequent. Apple’s product supposedly covers everything you may need, although fans still usually spend large amounts of money to get add-ons and accessories. However, the other product is still the dominant one by far, and most beginners start with it. Ironically, Apple’s most successful product is a small and fun “side” product. It has seen several iterations and lots of additional products are available.

Steve Jackson Games is company whose boss is a guy named Steve who is, by reputation, quite charismatic but also a real asshole when it comes to working with him and using his intellectual property. Their main product gives them only a small fraction of the market, and its core of devoted fans can be loyal up to a rather fanatical point. This product is always set against the more popular product, which is seen as outdated, inferior, over-marketed, and riddled with product updates that break compatibility with silly new features. Flamewars about which product is better are frequent. Steve Jackson Games’ product supposedly covers everything you may need, although fans still usually spend large amounts of money to get add-ons and accessories. However, the other product is still the dominant one by far, and most beginners start with it. Ironically, Steve Jackson Games’ most successful product is a small and fun “side” product. It has seen several iterations and lots of additional products are available.


Experimental IronCow branches

I created 2 experimental branches for future versions of IronCow.

  • IronCow Mobile” is a branch that adds support for the .NET Compact Framework. Thanks to jwboer for the initial patch.
  • IronCow Local Search” is a branch that adds local search for tasks. We basically cache all the tasks in memory, and handle search queries locally, instead of sending a request to the RTM server and parsing the response markup. The lexical analysis and AST building of the search query is a bit dodgy, as I can’t get a proper tool like ANTLR to work with RTM’s search grammar (probably me doing something wrong), but it’s not too much of a problem right now since search queries tend to be quite short, and we already are significantly faster than a web request.

Check them out!


Target the .NET Compact Framework using Visual Studio Express

Microsoft only supports Visual Studio Professional for developing Windows Mobile applications and, more generally, code based on the .NET Compact Framework. You get nice things like application deployment and emulators and remote debugging and all. But if you just want to compile something against the .NET Compact Framework, for example to check that you’re using supported methods and classes, you can do that with Visual Studio Express.

Create a project in Visual Studio Express and open it in a text editor. In the first “<PropertyGroup>” node, add the following at the end:

   1: <NoStdLib>true</NoStdLib>

This will tell MSBuild to not include mscorlib.dll automatically, so we can make it use the Compact Framework’s version.

Next, re-open the project in Visual Studio Express, delete all the system references (System.dll, System.Xml.dll, System.Data.dll, etc.), and re-add them, only this time use the Compact Framework’s assemblies. You’ll have to directly browse to those DLLs, as they probably won’t show up in the default dialog.

Now rebuild you application. It should build against the Compact Framework. You can test that by adding an instruction that’s unsupported, like for example “Thread.Sleep(TimeSpan)”.


Migrating to Google Apps

Migrating from a regular public Google account (GMail, etc.) to a Google Apps account seems to be a hot topic among geeks. Lots of people did it and posted their experience on their blog, which is often helpful for the next ones to try it. Since I recently migrated my account too, I thought I’d share this here. The important difference is that most people only post how they migrate their email. I tried to post about a lot more than that, including how to migrate contacts and groups and filters and quick links and documents and all that. I also wrote a complete “pros & cons” section up front so you can check whether Google Apps is for you.

Pros and Cons

Pros

  • You can administer your domain using Google’s control panel. All the users in your group (probably your family, or some kind of circle of friends) have a common ground to communicate on (chat integrated in mail, calendars, documents sharing, etc.). Scott Hanselman has a few pros & cons on that subject in his article about migrating his whole family to Google Apps, and the follow-up article . Note that these articles are outdated in a few places (some things have been fixed, some methods of backup/transfer don’t work anymore, some pros/cons are not valid anymore).
  • Your integrated GMail chat will now make you appear online as “username@domain.com” instead of “username@gmail.com“. This is way better if you want maximum portability of your identity, but want to keep the practicality of GMail’s integrated chat.
  • If you ever need to, you can upgrade some accounts to paid “Premier” accounts to get more space, reliability and support.

Cons

  • Not all Google services are available in Google Apps. For example, Google Reader or Picasa or Google Maps are not included in Google Apps, and you would end up having to login using your public GMail account. This means that whatever links you see at the top (“Mail”, “Calendar”, “Documents”, etc.) will take you to the wrong application (the public one instead of your Google Apps one). Also, your beloved iGoogle homepage will only work in the “public Google” space, so you won’t be able to make it work with your Google Apps things. Instead, in Google Apps, you’ll have the lame and ugly “Partner Homepage”.
  • As mentioned in the previous point, Google still hasn’t fixed the whole Google Accounts debacle. Namely, your regular public account will still be needed to log into non-Apps places like Google Reader, Picasa, Google Maps, etc. You can’t use your Google Apps account for this, which results in a slightly schizophrenic user experience. The cookies seem to use different tokens, though, so you can transparently be logged in to Google Apps and public Google services using the same browser.
  • Your chat history won’t be migrated, nor will be your chat buddies (for this you’ll have to re-invite people to chat with you at your new “username@domain.com” address).

The Procedure

If you’ve decided that Google Apps is still for you, then this is how you can migrate your regular Google account (GMail, GCal, etc.) to Google Apps.

First Steps

  1. Create a free Google Apps account.
    1. If the main (administrator) account you created is not going to be your actual migrated user account, create that account.
    2. In “Domain Settings”, check “Automatically add new Google services” and “Turn on new features”, so that you’re as close as possible to the actual GMail’s features. This is how you can get GMail Labs, which we’ll use for the migration. You may also want to check “Enable SSL”, for added security.
  2. Get a second browser, because we’re going to go back and forth between GMail and Google Apps. Sure, Google seems to now support being logged into both kinds of account at the same time, so you could do it with one browser without needing to login/logout all the time, but those pages look an awful lot like each other and if you’re using one browser it would be easy to get mixed up. With a second browser, you have an added difference that helps in not doing things in the wrong place. If you’re using a non-standard browser like Firefox or Opera, you can use the standard one (IE or Safari). If not, now’s a good time to get Firefox and join the cool kids. Alternatively, if you have 2 screens, you could use 2 browser windows on each one. That works too.

Migrate your email

  1. If you previously already had a Google Apps account and were forwarding your custom domain’s email to GMail, stop the forwarding now.
  2. Start forwarding your GMail to Google Apps. This will ensure that any email arriving during the migration will end up in Google Apps instead. You do that by going into “Settings” > “Forwarding and POP/IMAP”. Set it to delete the copy in GMail, as you don’t want to have duplicates of all your messages.
  3. Migrate your filters
    1. Enable the “Import/Export Filters” feature in GMail Labs. Go to “Settings” > “Filters”, select all your filters and click “Export”.
    2. Enable the “Import/Export Filters” in Google Apps Labs. Go to “Settings” > “Filters” and import the file you just created. This will create all the labels you’re using in your filters.
  4. Migrate your labels
    1. Create manually any label that wasn’t created using the filters. Note those down, because we’re going to have to reassign those labels manually too (the other labels will be assigned automatically by the filters as email messages are imported).
  5. Migrate your contacts
    1. Go to your GMail’s Contacts and click “Export”. Choose “Everyone (All Contacts)”, and “Google’s CSV format”.
    2. Go to your Google Apps’ Contacts and click “Import”. Choose the file you just created and check the results.
    3. Even though we’re using Google’s own CSV format, for some reason it messed up some of my contacts, those with many email addresses. They would end up with 2 or 3 email addresses all concatenated together with a semi-colon separator. I had to then cut the appended addresses and put them back in their own slot. This means some of your filters or searches may not work (if they’re trying to match against one of those messed up addresses) so you may have to go through your contact list and check your contacts. Also, see the note later in the “Migrate your messages” step.
    4. If you want to preserve your contacts groups, it’s a bit more painful. You need to export each group separately to a CSV file, and import it by choosing “Also add these new contacts to [new group…]”. Don’t worry, it will reuse already imported contacts – you won’t end up with duplicates. However, if you have lots of groups, it can take a while to do that. Also, the popup you get to fill the new group name is pretty crappy and will mess up any non-english character you enter. You can go back to those groups and fix their names later.
  6. Migrate your messages. For this, you have 2 options: the simple way, or the complex way.
    1. The simple way is to use GMail Backup. Just like the complex way below, GMail Backup (as of this writing) won’t migrate your Chat history. However, it should be as simple as pressing 2 buttons (one to backup your GMail account, one to restore it to your Google Apps’ inbox). I haven’t used it so I don’t know how well it works, or how long it takes, though.
    2. A slightly more complex version of the simple way (yeah, I know, it doesn’t make much sense) is to use the imapsync solution designed by Tyler Ham.
    3. The complex way uses Google’s own mail fetcher. There are a few valid reasons for it, but there are caveats too:
      1. Pros
        1. You won’t get slapped for uploading too much to your Google Apps account.
        2. Google will take care of everything, and you can turn off your computer in the meantime. This also means you don’t care about unexpected interruptions like your computer crashing, your internet connexion getting weird, or your ex-girlfriend setting your room on fire.
      2. Cons
        1. It’s called the “complex way” because you’ll need to sort some of your messages again. All messages pulled by the mail fetcher will be sorted automatically by your filters, but you may need to do some additional sorting for those messages that are exceptions. In my case, that was actually a good thing, as it forced me to make my filters more efficient, made me get rid of junk messages I somehow missed, and more generally cleaned up my account.
        2. It can take a week or so to transfer everything, depending on how many messages you have. Yes. A week. I myself had roughly 52000 emails taking 2.6Gb, and it took 6 days for Google to pull everything in.
        3. You won’t be able to access your GMail account through POP during this time (IMAP is fine, though).
      3. If you think you’re up to it here’s how it works:
        1. In your GMail account, go to “Settings” > “Forwarding and POP/IMAP”.
        2. Enable POP for all messages, even those already downloaded. At this point, if you were using POP access before, you may want to stop for a while, otherwise your tool may re-download all your messages over again. Now, if you use POP access for some reason, there’s a good chance you want to make it point to your Google Apps’ account now, so it shouldn’t be too problematic.
        3. In Google Apps’ mail, go to “Settings”, “Accounts” and add a POP account for your original GMail account. Google will start pulling all your messages to put them in your new Google Apps inbox, and you can monitor the progress by clicking on “View history”. Don’t worry if you see Google telling you there’s only, like, a couple hundred messages left in GMail, it’s just confused. It will discover new messages as it goes along. The main thing you should be looking for is whether it keeps pulling 200 messages every 30 minutes or so. Additionally, you may want to use one of the options, like archive all messages automatically, or label them all with some label of your choice.
        4. While your old email comes in, check the Spam folder every day. You’ll see that Google Apps flags some of that email as spam, and you’ll have to teach him that it’s not. Almost all the time, however, those false positives would be from contacts that got messed up during the “Migrate your contacts” step, so it’s another way of figuring out which ones need fixing.
        5. Unfortunately, your Chat history won’t get migrated this way. Maybe Google will one day expose Chats as an IMAP folder we can then migrate, or someone will find a way to get that from the Jabber server or something.
  7. Migrate your quick links, if you’re using that GMail Labs feature. You have to do that manually, unfortunately.
    1. Click on each quick link in your GMail account, copy the search box’s text.
    2. Go to your Google Apps’ inbox, paste the search query in the search box, and click “Create quick link”.

Migrate your documents

For some reason, Google refuses to change the ownership of documents from a “@gmail.com” user to a “@yourdomain.com” user, even if you configured your Google Apps domain so that users can share documents freely with other domains. So we have to move them by hand. Good thing somebody wrote a script for that already:

  1. Download all your documents to your disk.
  2. Re-upload them to your Google Apps’ account.
  3. You may have to reconfigure the sharing of your documents.

Migrate your calendars

  1. For your main calendar, in your regular Google Calendar, go to “Settings” > “Export Calendars” and save the file to disk. In Google Apps, import that file in “Settings” > “Import Calendar”.
  2. For the other calendars, do this:
    1. In your regular Google Calendar, go to “Settings”, “Calendars”, and click on each one of them.
    2. Look at the calendar address line and copy the Calendar ID.
    3. In Google Apps, paste that ID in the “add a friend’s calendar” text box.
  3. Some calendars require some kind of authentication (like your Facebook Events calendar), so you may have to go back to the source and get the calendar’s address again.
  4. If you previously had a Google Apps email address, go to Google Accounts and check that you didn’t add it as an alternate email address tied to your regular GMail account. This is how you might have gotten invitations to events sent to your own domain address in your Google Calendar. Now that you’re using the “real” Google Apps calendar, you don’t need this anymore.

Google Sync and other stuff

  1. If you have a smartphone and you’re using Google Sync, update the login parameters by replacing your old GMail address with the new custom domain one.
  2. If you have Firefox extensions that have your login information, update those as well.
  3. Same thing goes for any desktop notifier you may have.

Finish migrating your messages

  1. If you were using Google’s mail fetcher for migrating your messages, you need to do a few things after it’s done.
    1. When your email has been successfully migrated to your Google Apps inbox, setup Thunderbird with an IMAP access for both your old GMail account and your new Google Apps one. You can use another client if you want but that’s what I used.
    2. For each label that was not automatically re-applied through a filter, do the following:
      1. Create the label in Google Apps if it didn’t exist already.
      2. Go into that label’s folder in Thunderbird, in your old GMail account.
      3. Copy all the messages into the corresponding label folder in your Google Apps account. This won’t duplicate your messages. Instead, it will apply that label. This is a simple way to reapply labels to messages. However, the read/unread status of those messages may get lost.

Current bugs and issues

This is a list of the current big issues in the migration process.

  • Export and import of contacts, even using Google’s CSV format, is broken between public and Apps GMail. Contacts with a lot of email addresses (more than 3 or 4, apparently) have half their addresses ending up concatenated at destination.
  • Export and import of contacts doesn’t support contact groups information.
  • Importing a contact list into a new group opens a popup text box where the user enters the name of that new group. That text box messes up non-english characters.
  • No export/import of Quick Links.
  • No way to change ownership of documents from the “gmail.com” domain to a custom domain.

Labels and quick links work together

I just realized that the 2 GMail Labs experiments “Go to label” and “Quick links” work together, which makes quick links all the more useful. So say you have 2 labels named “Newsletters” and “Notifications”, and one quick link named “ALT.NET” (which finds all the posts from the ALT.NET mailing list). If you summon the “go to label” popup and start typing “n”, it will show all three:

Now, you ask, when should you use a label, and when should you use a quick link?

The main difference is that quick links are only search queries, whereas labels can be both search queries (a filter that automatically assigns that label) or manually maintained containers. If you need the latter, that’s a no brainer. If, however, what you want can be expressed with a search query, you need to choose between labels and quick links.

My method, so far, is based on 2 criteria: complexity and scalability.

  • Make a quick link if the search query is simple, and make a filter if it is complex. Typically, finding out all the emails from a specific mailing list is as simple as typing “list:altdotnet” in the search box, so this calls for a quick link. On the other hand, finding the receipts from some company that also sends you various newsletters and announcements can be a bit more complex, so I would make that a filter. The reason for this is that if the search query is complex, there’s a good chance it’s not complex enough. There’s a good chance some emails won’t get caught, because you didn’t think about all the cases or somehow an exceptional case shows up in your inbox. When this happens, you can still tag that message manually and keep going.
  • Make a quick link if similar types of containers exist. For example, “ALT.NET” finds all the mail from a specific mailing list. There could be dozen of similar containers if I’m subscribed to a dozen of other mailing lists. I don’t want to clutter my email organisation with dozens of such labels, so I go for a quick link. My labels tend to be generic concepts that won’t scale up much: “Newsletters”, “MailingLists”, “Receipts”, some labels for my different internet identities and/or email accounts, and some GTD-ish labels (“FollowUp”, “Hold”).

I hope this helps.


Sync multiple Google Calendars with your iPhone

If you have an iPhone, or any other smartphone for that matter, you will probably by now have set up Google Sync with it so you can synchronize your contacts and calendar.

However, if you’re a bit hasty and follow the simple tutorial that Google provides, you will end up synchronizing  only your main calendar with your phone. It’s easy to miss the fact you can actually synchronize up to 5 (at the time of this writing) calendars. If you go back to Google Sync from your device, you should then be able to select which calendars you wish to synced. This is especially useful if you want to sync your Remember The Milk tasks or your Facebook events.

Note

To get Remember The Milk tasks in your calendar, go here.

To get Facebook events in your calendar, go to your events page, and click “Export Events”, at the top of the page. You’ll get an URL that you can then import in Google Calendar or any other calendar application.


Conditional operator fun

A good friend of mine sent me this little “gotcha” a few days ago, so I thought I’d share:

#include <iostream>

#include <string>
void main() {
int a = 0;
int* ptrA = &a;
const int b = 1 ;

const int& refA1 = (ptrA ? *ptrA : 1);
const int& refA2 = (ptrA ? *ptrA : b);

std::cout << refA1 << std::endl;
std::cout << refA2 << std::endl;

a = 42;

std::cout << refA1 << std::endl;
std::cout << refA2 << std::endl;
}

This prints:

0

0

0

0

Turns out I didn’t really know how the “?” operator figures out its overall return type because most of the time I use it with class pointers or strings or something not as complicated as integers with values of 0 or 1 or even (crazy!) 42.

In this case, the “?” operator looks at an “int” and a “const int” and figures, hey, I should really make all this a “const int”! And what better way to make a “const int” out of an “int”? Well, copy it somewhere safe, of course! So you end up with constant copies of “a”. You can print out the addresses of all the variables to see how “refA1” and “refA2” point to new places.

If you remove the “const” from “b”’s declaration, the “?” operator then looks at two integers, makes “refA2” reference “a”’s address directly, and you end up with the following output:

0
0
0
42

Conclusion: watch out when initializing a variable that could either be a constant (earth’s gravity) or a user tweakable value (gravity on the space station in level 3 of your game).