Archive for July, 2005

Making Your ColdFusion and Java Applications More Platform Independent (Part III)

Making Your ColdFusion and Java Applications More Platform Independent (Part III)

Two years ago (has it really been that long?!), I made a couple of posts about how to make your ColdFusion and Java applications more platform independent. The first post covered the importance of case consistency, and the second talked about not hard-coding path separators since they are different on different platforms. Well, all this time later, I actually have a third piece of advice: don’t hard-code new line characters.

I’m switching my development environment over from OS X to Windows (I haven’t used Windows consistently in many years, so I figured it was time to give it a try again), and while trying to get MXNA running locally, I came across a bug that I’d never seen in development (on OS X) or on production (Linux). The problem was this line of code:

<cfset blArray = listToArray(blacklist, chr(10))/>

The code is trying to convert a line-separated list into an array. On OS X and Linux, it works fine since the new line character is "line feed", or chr(10), or \n, but on Windows, the code didn’t work because a new line is "line feed" and "carriage return", or chr(10) & chr(13), or \n and \r. So rather than ever having to worry about this again, I used a little Java trick to make the code run in any environment. Now it looks like this:

<cfset blArray = listToArray(blacklist, createObject("java", "java.lang.System").getProperty("line.separator"))/>

Even with a language like Java (and hence, ColdFusion), if you want your code to be truly platform independent, it takes a little work. The good news is that once that was fixed, MXNA was up and running in my development environment perfectly.

My New Mobile Office

I recently moved into a new house in San Francisco which is perfect in all respects except one: it doesn’t have an additional room for me to use as an office. This is the first time in my entire life that I haven’t had a room completely set aside for working, so I’m being forced to adapt. My solution has been to put together a mobile office, or a collection of everything I need to work wherever in my house I can find a flat surface and a little peace and quiet.

Continue reading…

History Management in RIAs

I’ve been doing a lot of experimentation with RIAs recently. First, Mike Chambers and I experimented with integrating Flash and Ajax. Then, I did some work to support deep linking in both Flash and Ajax applications. The next challenge was history management.

History management refers to the ability for users to navigate backward and forward using their browsers’ integrated history buttons. We’ve all been doing this for as long as we’ve been browsing the web. In fact, it’s something most of us take for granted, and even depend on (I know I do).

The problem with history management is that it is not always compatible with Rich Internet Applications. One of the distinguishing features of RIAs is that they eliminate the need for total page refreshes by loading data in the background and updating only portions of page. In most cases, this is done without creating a new entry in the browser’s history table, which means you can’t use your browsers’ forward and back buttons to navigate an RIA. Typically, clicking the back button will take you back to the page you were on before visiting the RIA, regardless of how much you had been interacting with the RIA in the meantime.

Flex automatically addresses this issue using a hidden frame which invisibly creates entries in the browsers’ history table as users navigate a Flex application. It’s a very seamless and elegant approach which seems to work quite well, so I decided to borrow some of the same concepts and apply them to MXNA’s Category Click Feed Report.

The Category Click Feed Report has become our sandbox for RIA experimentation. In the latest build, I added some initial support for history management. To see it in action, go to the report, click around on the categories and feeds, then use your browsers’ back and forward buttons to navigate through your history. If all goes according to plan, you should get the best of both the RIA and standard web interface worlds.

The technique I’m using is slightly different than the one Flex uses. Since Flex only needs to worry about history mangement in Flash, it loads a piece of Flash content in a hidden frame which is able to communicate with the main SWF. MXNA, on the other hand, is a combination of both Flash and JavaScript/HTML, so I needed a more generic approach. The technique I settled on (at least for this first, very experimental version) is basically an Ajax history manager which I’ve extended with the Flash / JavaScript Integration Kit so that it talks to Flash, as well. It seems to work fine on all the browsers I have sitting around me (Firefox, Safari, and IE), but it hasn’t gone through a thorough QA cycle. If you find any issues, please let me know. And if you want the code, it’s all availble by viewing the source of the page (and the Flash chart). None of it is obfuscated, so you’re welcome to it.

Future Proofing Your Flash Content

Now that Flash Player 8 is in public beta, if you’re a tester, you are going to start noticing something annoying. As you surf the web, dutifully fulfilling your responsibilities as a public Flash Player beta tester, you will occasionally come across a site which will tell you don’t have the right version of the Flash Player installed, and in some cases, you may even be told that you don’t have a new enough version of the Flash Player installed. Naturally, you will be confused because your Flash Player version is, in fact, the newest of the new, and is nothing short of bleeding-edge Flash Player technology. The problem is that the site’s Flash Player detection scripts are most likely hard-coded for what was once the newest version of the Flash Player.

If this describes your site, check out Mike William’s article on the Macromedia Developer Center entitled Future-Proofing Flash Player Detection Scripts. Mike not only discusses the issue of expiring detection kits, but also provides a new, very robust detection solution that fixes the future-proofing problem and other common version detection mistakes.

Macromedia Product RSS Feeds Restored

A little over a year ago, the Macromedia Developer Relations team introduced the Macromedia Product RSS feeds to help our community keep up with product updates, security bulletins, tech notes, and Developer Center articles. We took them down for about a week as we began migrating community services from the old server to the new Macromedia weblogs server. I’ve been getting several emails a day from people wondering what happened to the feeds, so I decided my priority for the day was to get them fully migrated (it wasn’t just a matter of copying the files over — we also switched to a new system for generating and maintaining them). Anyway, I got it all done, so all the product feeds should be working again. Please let me know if you notice anything screwy.

The Macromedia Developer Relations podcast gets added to iTunes

Finally. The Macromedia Developer Relations podcast is now available in iTunes. Go to Podcasts > Technology > Developers. To learn more about iTunes support for podcasts, see Apple’s podcast homepage.

How many people out there listen to podcasts? Do you iTunes, or something else? (I’m wavering back and forth between iTunes and Shrook right now.) And what podcasts do you listen to regularly? I’m flying to New York tomorrow for Flashforward, so I’d like to stock up on some podcasts for the flight.

markme is Going Down Temporarily

If you’ve been following Macromedia weblogs for longer than the last few months, you know that we used our own domain ( before migrating to We haven’t fully completed the migration, though. We still have several weblogs to move over, as well as the Macromedia Product RSS Feeds. We need to bring down for a few hours today as part of some unexpected maintenance, so if you still count on resources on the domain, they will be unavailable for a little while today. We’ll let you know when the server is back up.