Story of a Pitched Battle With a Massive IE/Flash Memory Leak

This is a short(ish) story of an epic battle between a team of web application developers and IE 7. We were developing a pretty large IE-only application that used a few Flex-based components to provide data visualization capabilities. We were making good progress until well into the testing cycle, when one of the testers came back with a report of IE crashing on a regular basis while using the Flex components. Uh-oh.

I took a closer look at the issue and initially was not able to replicate the issue. The tester sent me some screenshots showing more details of the crash, including a screenshot showing memory usage. System memory was high, but not outrageous. Still, I suspected a memory leak.

The XHTML2 vs HTML5 war is finally over

It appears that the long time battle between XHTML2 and HTML5 has come to a conclusion, and HTML5 has won. Actually, HTML5 has been ahead for some time, but the w3c finally officially announced the ending of XHTML2 standards development. For a good introduction to the issue, take a look at Wired’s overview of the announcement.

Adobe previews Thermo for creating RIAs

Adobe today introduced a new tool called Thermo. I recommend that you take a look at their demo.

From what I see, Thermo is a tool that helps to integrate the visual design process in more tightly with creating Flash/Flex-based Rich Internet Applications. If you take a look at the demo, you will see how it can import artwork and use that as a template for creating a Flex-based application. From what I see of this application, this is really what the visual design feature of Flex Builder really should have been, and this also looks to be very suitable for quick semi-functional prototypes. The workflow looks like it will work well as well: Visual designers can use Thermo to start off the application, then Web developers can work with the same project in Flex Builder to add in the structure, additional functionality, and server integration.

The keyboard and mouse as input devices

I just ran across a couple of interesting articles about keyboard vs mouse input:
http://hci-matters.com/blog/?p=8 and the followup:
http://hci-matters.com/blog/?p=9

The idea is that we should really be using more of the keyboard to be productive, but only for tasks which can be qualified as discrete, such as managing documents, launching applications, and working with text. I definitely agree with the premise. We have long had keyboard shortcuts, part of the problem is how to associate the shortcut with an action: there are so many, memorizing them is impossible. As an aside, f-keys are the absolute worst way to implement shortcuts as there is no mnemonic to help with the association, and no consistency save the F1 key for help (why not just label it “help”).

Playing with AS3 – An example MP3 player component

I have finally gotten around to playing with AS3, and I decided to pick the Sound object as one to play with. In the end, I ended up creating a simple music playback “component” that uses a whole number of AS3 features. I am including the example here along with the source. Enjoy! Note: error handling is not yet very robust, but it still shows numerous aspects of AS3 in use. Requires Flash Player 9.

Grrrr… WordPress is munging the object and embed tags. The example can be seen here for the moment.

An Algorithm for Finding Common Elements Across Data Sets

I was recently working on a search algorithm for a Flash piece I am working on, and the way the algorithm worked involved doing separate searches for each keyword from an index that I had created, recording the number of occurrences for each keyword, then finding out which elements were common between each of the keywords. I came up with an algorithm to do this operation linearly, that is it only has to do one pass through the data which means that it scales well for large data sets. The gist is that if you have three sets of data, then any data element needs to appear three times in the search for it to be common across the data sets. As such, all that is needed is a tally kept of how many times each data element appears and anything that has a tally of three is part of the intersection of the data sets.

Note: this only works if there are no duplicated elements in each data set, which fortunately is not too hard a condition to impose.

Here is some code representing the algorithm:

A Potential Solution to the Eolas Flash Woes – The Object Replacement Method

There are a number of solutions out there for the limitation that Microsoft just put into place to deal with the Microsoft-Eolas plug-in patent dispute. The ones that I have seen (e.g: Flashobject) are nice but involve changing how you publish your Flash files and embed them into the HTML. I was thinking, it is possible to rewrite the HTML on the fly with JavaScript, so what if we just loop through all the Object tags within the Document Object Model, and replace the HTML? It could be done with one function call, and would not affect how you put the <object> and <embed> tags on the page.

The experiment that I tried does exactly that: it loops through all the <object> tags, and just replaces the HTML with exactly the same HTML. This makes IE think that the HTML is dynamically placed on the page, even though it started as just straight HTML.

It’s official, I’m an author!

Just a little bit of shameless self-promotion: my book is just about to hit store shelves!

book cover

I’m the dude on the left, and my co-author on the right is Jeff Berg.

Man, that is a long process (probably about 1 year total from contract to publication). Prepurchase now! Buy them as Christmas presents, birthday presents, Bar Mitzvah presents, even chew-toys for your dogs! (Discounts for bulk purchases for 5 dogs or more). They also work great as monitor supports (about 3 inches per book). If you reeeeeeeeeeally want, you can even read it yourself and learn how to script with ActionScript 2.0 and Flash 8 (perish the thought)!

A couple of useful Firefox extensions

I have come across a couple of really useful Firefox extensions aside from the excellent web developer extension which I wanted to share with the community.

The first is called View Rendered Source Chart, which renders the HTML source in a way that is very easy to visually see the nesting.

The second is one called View Formatted Source, and not only shows your HTML source in a way where you can collapse nested tags, but when set to inline mode, shows you the major divisions within your document, and clicking on “source” for that division brings up just the HTML for that division. Finally, mousing over tags in the source view shows you what styles currently apply to that tag, and where in the CSS file the styles are located.

A Divergence of Web Applications From the Browser?

Disclaimer: this piece (as well as this blog in general) is personal opinion and not endorsed by or representative of my employer.

I just came back from a conference where I was presenting on Web 2.0. A related discussion around Microsoft’s foray into the Rich Internet Application space ensued, and as part of that discussion, I was sent a link to an interesting Information Week article that talks directly to our discussion. The article talks about MS and Eclipse-based development environments for web applications, and one quote in the article demonstrated one of my major concerns perfectly: