Archive for March, 2010

What e-mail provider do developers use?

Monday, March 22nd, 2010

As does happen from time to time, I got an e-mail today where everyone on a list’s e-mail address was visible, rather than being BCC’d. I don’t want to beat the company up about it, because it’s an unfortunate fact of life that that kind of thing does occasionally happen due to simple human error, and they sent out an apology straight away.

Anyway, the interesting thing about this mail was that it was to developers who scrobble music to last.fm. That means it is not a general public sort of list – typically one person from each organization what has some software which can scrobble, and also most importantly, these are very technical people who are almost certainly all computer experts, who’s opinions on technical things are probably quite illuminating.

Now, normally I wouldn’t have looked twice at the actual addresses, but they had actually put them in the body of the e-mail, so I had no choice but to scroll through them all to get to the text. What struck me about this list of 312 e-mail addresses was there seemed to be quite a lot of gmail addresses. So many that I decided to do some analysis. What I discovered was that 117 e-mail addresses were gmail or goolemail. That’s 37% of developers using google for their e-mail. The next highest was yahoo at 1.6%. That’s quite a commanding lead for google.

Now, I use Google Apps for my e-mail, so although my e-mail address is at milliesoft.co.uk, my mail is actually handled by Google. I wondered how many of the rest of the developers fell in to that category, so there was only one thing for it. I wrote a script to do a lookup on the MX record for each domain to see who actually ran e-mail for the rest of the addresses. The findings were that 47 domains in the list are actually google apps domains. That means that for my sample of developers, we have the following e-mail providers (anyone with <1% share is on the “Others” box).

Provider Accounts Percentage
Gmail 117 37.5%
Google Apps 47 15%
Yahoo 5 1.6%
gmx.net 4 1.2%
Hotmail 4 1.2%
Others 135 43%

Answer:

More than half  of  the developers use Google as their e-mail provider – nearly 30 times more than the next contender, Yahoo.

According to wikipedia, gmail has 146 million users, hotmail has 343 million, and yahoo mail has 266 million users, so developers certainly buck that trend.

Code based dialogs in media center

Wednesday, March 10th, 2010

I’ve written a few posts on how to implement dialog boxes in media center (Adding a version checker and Simpler popup dialog). They are both great examples of how to trigger a dialog box in mcml. Suppose though you want to do it all from within code, not within mcml. Why would you want to do that? Well, for one it means not having any AddIn calls in your mcml, and AddIn calls mean you can’t use the mcml preview tool – which significantly hampers development. For this example, I’m going to repeat the Adding a version checker example, but all in code.

So, to trigger a dialog from your code, the first thing you need to do is to build some buttons;

ArrayListDataSet dialogButtons = new ArrayListDataSet();
dialogButtons.Add("Download Now");
dialogButtons.Add("Remind me later");
dialogButtons.Add("Ignore");

This adds 3 buttons to the dialog. Obviously add as many or as few as you like. The next thing you need to do is to add the call to open the dialog;

String dialogText="There is a new version available";
String dialogTitle="New Version";
Microsoft.MediaCenter.Hosting.AddInHost.Current
.MediaCenterEnvironment.Dialog(dialogText
, "dialogTitle, dialogButtons, 30, true, null
, new Microsoft.MediaCenter.DialogClosedCallback(versionCallback));

This will open a dialog as a modal dialog with a timeout of 30 seconds. When it is closed, the method versionCallback will be called, so now we need to write that method;

public void versionCallback(Microsoft.MediaCenter.DialogResult result)
{
    if (result.ToString() == "100")
    {
        InstallNewVersion();
    }
    if (result.ToString() == "101")
    {
        RemindLater();
    }
    if (result.ToString() == "102")
    {
        IgnoreNewVersion();
    }
}

And obviously fill in the appropriate actions for each method.

Finally, you may want to block this dialog from triggering when you are in the debugger (since it won’t work), so put an if statement round it to stop it running in debug mode;

#if(!DEBUG)
   String dialogText="There is a new version available";
   String dialogTitle="New Version";
   Microsoft.MediaCenter.Hosting.AddInHost.Current
.MediaCenterEnvironment.Dialog(dialogText
  , "dialogTitle, dialogButtons, 30, true, null
  , new Microsoft.MediaCenter.DialogClosedCallback(versionCallback));
#endif

And that’s it – an mcml dialog operated entirely from your code.