I was having some issues with Firefox 3.6, and I noticed while doing a backup that there was a file called urlclassifier3.sqlite in the backup that was rather large.

Having once worked on both writing marginal almost-malware-adware, and also writing things that dealt with same, I wanted to make sure it wasn’t some kind of ad-targeting thing that was installed along with an extension or something.

I came across the article Make Firefox Faster by Vacuuming Your Database and it explains a bit about why this file exists, why it grows, and a way to potentially solve issues by opening up the Firefox Error Console and executing this command:

Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsPIPlacesDatabase).DBConnection.executeSimpleSQL("VACUUM");

This is hinting to me that browsers are getting way too complicated. I mean, as someone who has developed web applications since NCSA Mosaic was the only browser, it’s been readily apparent how this thing that was designed to show brochures on the nets has grown through a series of hacks to include scripting and a DOM to allow one to write “applications” using the browser.

The browser sucks for this. A lot. HTTP wasn’t designed to do half of what it does, the stuff that makes up a browser is like a crazy house of cards, and I’m going to stop right there and save this rant for another post.

With Google Chrome 2.0 comes extensions.

My very favorite firefox extension is firebug. It’s the one I really couldn’t live without. It’d be like trying to mountain climb with only only twenty feet of rope. Painful and unnecessary.

Chrome is the up and comer with excellent performance and seamless google integration. What would it take for me to dump my tried and true mozilla browser for the new kid on the block? At the very minimum a ported or trumped firebug equivalent.

If firebug were a commercial product I imagine there would be much more of a chance for a straight port. I’m sure the revenue generating (directly or indirectly) toolbars will get ported with ease. But firebug? Maybe what’s more likely is a firebug inspired chrome specific extension. If that happens it’ll either fall short or kick firebugs ass.

I’m sure I’m not the only web developer that feels this way. While we may not make up a significant market share in terms of raw numbers it’s because we bit twiddlers are constantly remaking the internet that I think this is an important hurdle for chrome to overcome in it’s quest for world domination relevancy. Like the human body the internet completely regenerates itself every seven years or so, and it’s we web monkeys, not the voodoo super magic of biology that is responsible for this evolution one Console/DOM/Debugger/Cookie/Net panel use at a time.

From a platform development perspective it’s a fairly cut and dry real world test. Will Chrome pass the firebug challenge? Maybe by the time you read this they have already. Maybe not.

When using the Entity Framework if you want to mess with your entities before they persist to the database one popular way to do it is to hook into SavingChanges from the OnContextCreated method of your Entities ObjectContext like so:

public partial class SomethingEntities
{
partial void OnContextCreated()
{
this.SavingChanges += new EventHandler(OnSavingChanges);
}

public void OnSavingChanges(object sender, System.EventArgs e)
{
//Do stuff
}
}

I was trying to do exactly this but was having a problem. The gosh darn thing wouldn’t fucking fire. In fact, none of the constructors on my Entities ObjectContext were firing. My controls were dancing around all over the place selecting and updating data but nay a constructor to be called.

My EntityDataSource looked like this:

<asp:EntityDataSource ID=”DataSource” ConnectionString=”name=SomethingEntities” DefaultContainerName=”SomethingEntities”
EnableDelete=”True” EnableInsert=”True” EnableUpdate=”True” EntitySetName=”EntityName” runat=”server” />

I was using both the ConnectionString and the DefaultContainerName property as initialization parameters to get the DataSource going. Turns out this wasn’t the right thing to do because when configured this way the DataSource never got my Entities ObjectContext to fire its constructors. I got it to work after some head scratching by changing it to:

<asp:EntityDataSource ID=”DataSource” ContextTypeName=”Namespace.SomethingEntities”
EnableDelete=”True” EnableInsert=”True” EnableUpdate=”True” EntitySetName=”EntityName” runat=”server” />

By using the ContextTypeName property instead of the ConnectionString and DefaultContainerName properties everything seemed to work. A constructor on my Entities ObjectContext was called which in turn called OnContextCreated which hooked up my SavingChanges method which now gets called when it should before changes are persisted to the database.

Problem solved.

I’m cleaning up the some craptastic code and I come across this gem.

    if (isRegistered)
    {
        //not registered
        message.MessageDefinition = MessageDefinitions.Confirmation;
    }
    else
    {
        //registered before (email exists in the database)
        message.MessageDefinition = MessageDefinitions.ConfirmationExistingUser;
    }

Fun times! I wonder why this code is buggy and constantly breaks.