October 2005 - Posts - Jon Galloway

October 2005 - Posts

Firefox Web Developer Extension Beta 0.9.9

I recently upgraded to Firefox 1.5 B2. It's been working great, except the Web Developer Extension stopped working - it showed it was installed, but the toolbar and menu item were disabled. Fortunately, Chris just released a new beta of the Web Developer Extension that works great with Firefox 1.5 and has a ton of new features to boot . Yippee!

Web Developer Beta 0.9.9 - a preview release of the next version of the Web Developer extension - is now publicly available. This release is for testing purposes only - for a fully supported version of the extension or localized builds please see the latest official release.
Note: If you are upgrading from a previous version it is strongly recommended that you uninstall the extension and restart the browser before installing the beta release.
Posted by Jon Galloway | with no comments

[link] Connection String generation Visual Studio macro

Cool connection string generator macro from John Conwell :

Speaking of useful macros, this is one I've used for a a few years and thought might be usefull.  It calls the ADODB Data Link Properties dialog (shown below).  After you go through the dialog picking your data source, database, and connection settings, it dumps out the connection string for your configuration into code window where your cursor is located.

Public Sub ConnectionStringWizard() < /SPAN >

     Dim args() As Object
     Dim linkType As System.Type = System.Type.GetTypeFromProgID("DataLinks")
     Dim linkObj As Object = System.Activator.CreateInstance(linkType)
     Dim conType As System.Type = System.Type.GetTypeFromProgID("ADODB.Connection")
     Dim conObj As Object = System.Activator.CreateInstance(conType)

conObj = linkType.InvokeMember("PromptNew", System.Reflection.BindingFlags.InvokeMethod,
Nothing, linkObj, args)
     If conObj Is Nothing = False Then
          Dim constring As String = conObj.GetType().InvokeMember("ConnectionString", System.Reflection.BindingFlags.GetProperty, Nothing, conObj, args).ToString()
          Dim textSelection As TextSelection = DTE.ActiveDocument.Selection()
          Dim edit As EditPoint = textSelection.TopPoint.CreateEditPoint()
          edit.Insert("""" & constring & """")
     End If
End Sub

Source: John Conwell - Connection String generation Visual Studio macro


Posted by Jon Galloway | with no comments

[wish] Microsoft P2P download system

Visual Studio 2005, .NET Framework 2.0, and SQL Server 2005 release to MSDN today, and so of course MSDN downloads got hit pretty hard this morning. After a shaky start, the download speeds appear to be picking up.

Still, it seems like a lot of wasted bandwidth on Microsoft's part. 2.8GB x 100,000 = some huge number. It would be great if they had a P2P download system so that popular downloads required less bandwidth from Microsoft's datacenters, not more.

Unfortunately right now, if you talk about P2P download systems like BitTorrent, people figure you're either (1) a high volume pirate, or (2) an open source zealot. The point is, though, that P2P download systems just make good sense from a technical point of view, both for the distributor and the consumer.

I'd like to see a professional alternative to BitTorrent proposed by Microsoft. It should support security, policy, DRM, etc. - it should be like WMA is to MP3. Waiting too long on something like this will make BT the de facto standard. I'd like to see MSDN ISO downloads use something like BT - you could elect to download direct from server, or could get better speed if you elect to use "cooperative download". Now, granted, file distribution doesn't necessarily have to include the DRM if you're handling security at the file level - product keys, media licenses, etc. However, if DRM isn't built into a system from the start it's very tough to add it in later (digital music is an example there).

Maybe Avalanche from MS Research will will fill this void. There was some buzz about it back in the April - June timeframe, and a short article in InfoWorld. No word about it since then, though (see "Whatever happened to Microsoft Avalanche?" on Channel9).

Posted by Jon Galloway | with no comments

[tool] MozBackup - copy your Firefox profiles

I'm setting up a new dev computer and used MozBackup to migrate all my Firefox extensions. It goes better than that - it also supports copying the extension settings, saved passwords, history, and a bunch of other stuff[1]. It was kind of spooky when I restored it on my new computer and (since I'm using the SessionSaver extension) seeing all my tabs restored exactly like the old computer.

[1] It also supports Thunderbird, but I don't use that.

Posted by Jon Galloway | with no comments

GMail: "oops...the system was unable to perform your operation"

I've been using GMail as my primary e-mail for the past month, and it's worked pretty well. Searching e-mail is nice, the tagging features are helpful (for instance, I added a tag for a client which automatically includes every e-mail which contains contains their domain name), and it integrates well with the Google personalized desktop.


Last week I wasn't able to access my e-mail for most of an afternoon. I kept getting a Javascript popup that said:

"oops...the system was unable to perform your operation"

I checked with friends via chat, and they were able to get their GMail just fine - it was just my account. I tried other browsers, cleared cookies, even tried other computers; same message. Searches revealed others who'd had the same problem, but no solutions which worked for me.

This was a problem, since my e-mail contained conference call numbers, important project information, etc.

GMail does provide a POP interface, so I'll probably run an e-mail client to keep a local e-mail copy in case this happens again. I'm posting this in case someone has come up with a solution to this problem and to recommend an offline e-mail backup (which is just good sense, anyways, in case the internet connection goes down).

Posted by Jon Galloway | 318 comment(s)
Filed under:

The hidden feature in Media Center 2005 UR2

MCE 2005 Update Rollup 2 includes support for DVD changers. "But", you say, "I don't own a DVD changer." Yeah, me neither. What's cool is that you can very easily use this feature on DVD image files stored on your hard drive.

Sean Alexander shows how:
HowTo: Enable "My DVDs" in Media Center 2005 "Emerald" Update

Posted by Jon Galloway | with no comments
Filed under:

//TODONT: Use a Windows Service just to run a scheduled process

A common requirement in business application is a scheduled process - call a webservice, process the data, and FTP the results to a business partner, for instance. Developers kick around possible solutions - BizTalk's overkill, DTS won't handle it well, what to do?

Invariably, someone suggests a Windows Service with a timer. Just as invariably, when you try to talk them out of it, they'll condescendingly tell you that Windows Services are easy to write in .NET. "Trust me, it's not hard - we'll write a simple service with a timer which will do a simple time check..."

A Windows Service is the wrong solution to scheduling one-off custom processes. The right solution for scheduling simple processes is the Windows Task Scheduler.

Let's look at what Windows Services are designed for. From the Windows Help documentation:

A program, routine, or process that performs a specific system function to support other programs, particularly at a low (close to the hardware) level. When services are provided over a network, they can be published in Active Directory, facilitating service-centric administration and usage. Some examples of services are the Security Accounts Manager service, File Replication service, and Routing and Remote Access service.

Web servers qualify as services, databases qualify as services, and the above Windows system features qualify as services. The Task Scheduler qualifies as a service. Possibly, custom server applications may qualify as a service if it needs to run round the clock and is written with the greatest sobriety, responsibility, and respect. Your scheduled file FTP doesn't qualify as a service.

A Windows Service which runs a timer needs to run Automatically, which means it will start up before you can log onto the machine and churn away until the machine is shut down. If they hang or have a slow memory leak, they'll continue to be a drag on the system until the service is restarted (or they crash the machine). I can't tell how many times I've heard the following in production meetings: "The cause of the outage was the WhamoInhouse Service. The resolution was to restart the service." Or, worse, application servers need to be restarted regularly because they're hosting poorly written services, but the IT shop blames the operating system.

Windows Services do offer sophisticated Recovery actions (on first, second, and subsequent failures you can specify that a program to be executed, or that the service or computer be restarted), but they're geared towards hard failures of the executable rather than business process failures, and they don't respond to things like memory leaks or hanging network connections. They offer absolutely no scheduling, because services are designed to run all the time. On the other hand, Windows Scheduled Tasks have advanced scheduling features which can be accessed administratively. If the business requirements for my scheduled FTP task change two years down the road so the FTP should happen twice a day every Monday, Wednesday, and Friday, the change can be made by an administrator. The task schedule has been tested across leap years, daylight savings time, and clock changes; most custom timer routines I've seen haven't.

Scheduled console applications are easier to design, build, test, deploy, and install - especially compared to a professional service which can run reliably for weeks end. This wouldn't by itself be a compelling argument if a Windows Service were the right solution by other criteria, but since it's not, this is another nail in the coffin. Consider, then, that your extra time spent building a service is wasted development time. Maybe fun "I am a bigtime coder now" development time, but not of any business value.

Scheduled console applications are easier to run in an ad hoc manner when necessary. Let's say the webservice vendor calls three hours after our process ran to inform us that he had a data corruption problem which has been corrected and we should re-run our process. In the case of a Windows Service with a timer, we'd be scratching our heads; with our console application we can run it manually whenever we want.

Finally, running separate Windows Services with their own timers is just plain inefficient with server resources. Ignore for the second the fact that we're hogging CPU and memory space 24/7 for a process that runs occasionally; multiple independant timers which check the time every few seconds is dumb.

If I kept writing Windows Services with timers, eventually I'd start to think about writing a single host system with a timer. Then I'd want to add in some more advanced scheduling features; perhaps even some logging. Eventually, I'd have a Windows Service that handles scheduling of child processes, and if I devoted years to enhancements and testing, I'd eventually arrive at... the Windows Task Scheduler.

If you're writing a Windows Service that runs a timer, you should re-evaluate your solution.

Posted by Jon Galloway | 51 comment(s)
Filed under: ,

Yet another command line parsing system

First Mike has linked to a command line parser library for .NET called Param.NET. Then Roy proposeda better command line parsing class which is attribute based. So, now's the time to mention a command line parameter class that worked well for me recently.

I used another arguments parser from Code Project, "C#/.NET Command Line Arguments Parser ". I like it because it works like the ASP.NET querystring parser - it handles the parsing (quoted strings, different delimiter styles) and exposes a string dictionary with the results.

I use a GetSettings accessor that reads the default from the app.config file, but allows overrides via command line. I like this approach because settings are their standard location (app.config), and any config setting can be overriden via command line without an attribute change and a recompile.

private static int Main(string[] args)
    Processor processor1 = 
new Processor(args);
return processor1.Process();
private Arguments arguments;

public Processor(string[] args)
this.arguments = new Arguments(args);

public Process()

private string GetSetting(string key)
string setting = string.Empty;
if (this.arguments[key] != null)
        setting = 
        setting = ConfigurationSettings.AppSettings.Get(key);
if (setting == null)
return string.Empty;
return setting;
Posted by Jon Galloway | with no comments
Filed under:

Transparency on DRM and Windows Mobile upgrades

I've really appreciated a few recent posts from Microsoft developers on the practical reasons behind some frustrating restrictions on Microsoft products - DRM and the inability to upgrade some Windows Mobile 2003 devices to Windows Mobile 5.

First, Peter Rosser discusses DRM as both a Microsoft employee and a consumer of digital media.

...Microsoft makes a big, inviting target for lawsuits if we even appear to be soft on protecting copy protected content.... There's more to this than most people realize, though.  Not only do companies like Microsoft and Apple have to guard against lawsuits, etc., but they have to make the studios and other content producers happy enough with the DRM solutions that they will go *farther* and give us more content in more flexible ways.  Do you think that Comcast, DirecTV or EchoStar would agree to attach a digital tuner to a PC that can decode their signal without an ironclad guarantee that the content would not just end up on the net?  They are terrified of that prospect... and with (arguably) good reason.  DRM is what we need to open up PC-based solutions for all of our content.

I know there are a lot of folks out there who vociferously oppose DRM on principal.  The "information should be free" crowd argues on the principal that you cannot own information, and content is just information.  That isn't reality, though, and the courts and laws agree that people who create content can sell it.  I won't pontificate further on that, but leave with a parting piece of information relating to the prior paragraph: if the "no DRM" crowd wins, we won't have lots of content with no DRM suddenly... what we'll have is broadcasters and content creators that won't have any reason to share their content.  Hollywood will release it's next generation of DVD replacements, this time with something less laughable than CSS protection, and that'll be it.  No PC viewing of digital content, just analog.  Depressing to me...

Source: DRM in MCE Rollup 2

Next, Mike Calligaro explains why upgrades aren't offered for some Windows Mobile devices, even though the hardware and operating system can support it:
Why Can't I Upgrade 
They Why Do You Get To Upgrade? (quote: We don't call it "dogfood" because it tastes good)

Posted by Jon Galloway | with no comments
Filed under:

[link] Riya - Photo search with face recognition

I've been looking for this exact product for a few years now:

Riya is a free photo search service built around facial recognition. Sure, they support searching based on who's in the picture, but they've taken it further than that by treating the faces as people with identities and e-mail addresses. If I upload a picture of you, it'll show up in your searches[1]. That's cool!

This looks like social software that actually makes sense.

I've been wanting basic facial recognition in photo management software for a while. I played around with libface for a bit, but doing this thing right takes much more than a weekend hobby project. I'm glad these guys are doing it right.

Any bets on who buys these guys our for bazillions of Web 2.0 bux (W2B)?

[1] Subject to user defined permissions, of course. It looks like the linkage is at the e-mail level rather than at the facial level, which would be kind of creepy.

Posted by Jon Galloway | with no comments
Filed under: ,
More Posts Next page »