The miscellaneous ramblings and thoughts of Dan G. Switzer, II

Tell MediaMonkey your files are on a new drive…

I recently replaced my system and in doing so, I the drive location of all my mp3s moved. Since I use Winamp to actually listen to my music on my PC and have always just relied on file locations for everything, moving my directories around is not a big deal. However, when I bought my iPod a while back, I started using MediaMonkey to track my library—mainly because it was the best tool I could find for syncing music to my iPod.

The problem with moving your music collection is that it can really cause problems with media managers—since they have their own storage mechanisms. While I could have just re-imported everything, I have some pretty complex libraries I use for synching to my iPod and didn't really want to lose that work. Since I knew MediaMonkey uses a SQLite database, I figured I could just easily update the database with my new locations.

Fortunately, I find this easy to follow guide on How to Tell MediaMonkey Your Files Are on a New Drive. The guide gives you complete steps on updating the database with the new drive information and even provides a tool you'd need to update the drive serial number in the database.

This works very well if all you've done is move the files from one drive to another (which was what I did.) Unfortunately, if you also re-arranged your files into a different subfolder architecture—you're going to have other issues. However, since all I did was move my main file from one drive to another, this guide worked extremely well for me and saved me a bunch of time from having to rebuild my sync preferences.

Finally upgraded my install of BlogCFC…

[UPDATED: Sunday, March 29, 2009 at 9:03:32 PM]

Well, I spent some time this afternoon upgrading my version of BlogCFC. This was a bit of a task, because I had fixed a number of issues I've come across in the past few years. However, Beyond Compare 3 made this task relatively painless—a bit time consuming, but painless. I was able to merge my version to BlogCFC v5.9.004 in just a couple of hours.

I really need to send Raymond my lastest merge since it does address a number of issues—a couple with the Administration section (regarding enclosures/images and I added a "Comments" tab to the "Entry Editor" pages) and a number of issues with the XML-RPC code (which seems to be pretty rock solid now—even allowing for editing of saved, but not published entries.)

Anyway, if you notice any problems with comments or any errors in general, please let me know.

Dream Theater's "Black Clouds & Silver Linings" releasing on June 23rd!

This is a few days old, but I just stumbled across it. Dream Theater's 10th studio album, Black Clouds & Silver Linings, is being released June 23, 2009. I really loved Systematic Chaos (although the title song was my least favorite on the album) and I've get recently gotten back into Train of Thought.

The album only consists of 6 songs, but I suspect it's a good 80 minutes of music:

  1. A Nightmare to Remember
  2. A Rite of Passage
  3. Wither
  4. The Shattered Fortress
  5. The Best of Times
  6. The Count of Tuscany


The album is being released on vinyl as well as a 3-disc Special Edition that will contain extra CDs—one, an instrumental remix of the album and two, a six song cover CD.

Managing JavaScript events/functions using "debouncing"

Yesterday I came across a very timely post by John Hann on Debouncing Javascript Methods. I say timing, because this was a problem I was just getting ready to solve again for umpteenth time—managing rapidly fired events in JavaScript.

I was working on some live search functionality for a page where I was searching DOM elements and populating a list of matching elements. Since this was a "live" search, I'm doing the update as the user types. The trick to this issue is that you don't really want to fire off the process each time the user presses a key, but instead you want to really fire it off when there's been a delay/pause to their typing. If you actually do the processing on each character, many of the calls you're making become quickly invalidating as the input changes so quickly that you end up making unnecessary calls. You'll also see a noticeable slow down in performance if your process is CPU intensive.

You can run into the same issue when dealing with AJAX operations. If you're just updating some portion of the screen based upon some user interaction, you really only want to fire off the AJAX call when the user is done interacting with the element.

This is where John's debounce solution comes into play.


Internet Explorer 8 issues with Compatibility View & EmulateIE7...

So, Internet Explorer 8 was just officially released. First off, I was really impressed with the download speeds. In the past downloading Day 0 releases from Microsoft have always been a bit problematic for me—because of the sheer volume of download requests. However, my download experience was very fast. Kudos Microsoft.

However, one of my main gripes from RC1 is still present—Compatibility view doesn't work consistently. If you're not aware, the following meta tag is supposed to force IE8 to run in Compatibility view:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

However, I'm still noticing issues that are inconsistent between adding this to the HTML and a user manually activating Compatibility View for a site.

The quickest way for me to illustrate this is to show you some screenshots.


Internet Explorer v8 to be released today (3/18/2009)

It appears Microsoft is releasing Internet Explorer 8 today at 12pm EDT/9am PDT. I guess I'll have some testing to do today, as I was still experiencing weird issues with the last IE8 candidate I had installed for beta testing.

I'm not sure where they will be posting the full edition at. Currently you can download the last beta (RC1) from their Internet Explorer beta page. I would imagine the full release will show up at http://www.microsoft.com/windows/internet-explorer/, but that's pure speculation on my part.

Looks like the official site for downloading IE8 is http://www.microsoft.com/ie8. Read more at Microsoft Announces Availability of Internet Explorer 8.

Faraday Suit + Tesla Coil = Emperor Palpatine & the Imperial March

This is pretty cool. A guy in a chain mail faraday suit plays the Imperial March with a tesla coil. In a nutshell, it's the visual of Emperor Palpatine shooting lighting bolts from his hands crossed with the actual sound of Imperial March.

I've been zapped too many times to even think about doing this, but it does look as cool as heck.

ColdFusion v8.0.1 Hot Fix 2 released in Oct 2008

Did you know that ColdFusion v8.0.1 Hot Fix 2 was released back in October of 2008? Yeah, me neither. Fortunately Andy Allan happened to notice that it was available. Not sure why Adobe has this so buried on their site—they don't even have it listed on their ColdFusion Hot Fixes page.

Kutiman's amazing ThruYOU album

I just came across an amazing use of You Tube. A man known as Kutiman put together an entire album of song made completely from You Tube videos. The end result is a pretty amazing funk/jazz/hip-hop/world fusion piece. I'm not sure how long it took for this guy to put together 7 full songs, but it's really amazing. At this point I'm so flabbergasted by how the songs were generated, I can't say how well the songs would stand completely on their own. However, it reminds me quite a bit of early Herbie Hancock (like Headhunters days) and Weather Report—so I definitely think it's something I would have listened to without knowing how the songs were put together.

Anyway, if you want to listen to the album all the way through, go directly to Kutiman's ThruYOU page—which will play the videos one after another. In the meantime, here's a sample:

The Web turns 20

While HTTP/HTML isn't quite 20 years old, Tim Berners-Lee first released his Information Management: A proposal dissertation in March 1989—which would later come into full fruition when he put together HTML over HTTP. Berners-Lee idea was simple, create a way to share information at CERN so that information wouldn't get lost with the high turnover. See, the average stay of scientist/researchers at CERN was just 2 years, so lots of ideas and projects would get lost when researchers would leave. He proposed a way for researches to store their documents online in a format that would be easily viewable by everyone.

Who would have thought this paper would have turned out to be what it is today.


Firefox v3.1 gets revamped to v3.5

It appears that Mozilla has decided to reversion 3.1 to 3.5 due to the sheer number changes that have been made. The current Firefox v3.1 Beta 3 is the last version that will be labeled v3.1. There's a 4th beta planned which will be label Firefox v3.5 Beta 4.

"The increase in version number is proposed due to the sheer volume of work which makes Shiretoko feel like much more than a small, incremental improvement over Firefox 3: TraceMonkey, video tag and player support, improvements to user controls over data privacy, significant improvements in the web layout and rendering platform, and much more," said Mozilla's Mike Beltzner in a blog post last week.

This is probably a good marketing idea and I do think there's enough changes in 3.1 to warrant a higher revision number. I suspect most people would have thought that v3.1 was a very minor upgrade, when in fact there's a lot of significant changes—even if most of them are behind the scene (such as TraceMonkey, Web worker thread support, improvements to the Gecko rendering engine, etc.)

Sirius shutting down 3rd party apps like StarPlayr…

This really irks me. Sirius has forced the guys at NiceMac to shut down their services and pull their applications from the web. I think I'm more irate by this announcement than when I head that they were getting rid of their free basic streaming service for members. In my opinion, they should offer some form of streaming to all customers. There are still too many situations where you can't get an antenna in place in order to listen to your radio. My office is in the basement and the streaming option is really the only decent solution. Every attempt to get an antenna working well in my house has been futile—I just end up with very flaky audio.

However, for the past 4 years or so (or whenever their streaming went online,) I've been very happily listening to their streaming service via the Internet. My only complaint was their native interface. Since I really only listen to talk radio, the 32Kbps stream is more than fine for me. I don't need a high quality stream—I just want an interface that doesn't make me keep clicking buttons to keep the stream open.

This is where 3rd party applications come in. For the longest time I was very happy with Tanner's original Sirius Yahoo! widget. As a matter of fact up until two weeks ago, I was still using the widget. However, when I was forced to move to Vista, I decided not to load the Yahoo! widgets engine (since I really only used it for the Sirius tuner) and instead installed StarPlayr. While not perfect (and many ways I prefer the simplistic interface of the Yahoo! widget) it makes online listen a breeze. Just start the app and listen away. No annoying pop-up windows, no having to re-login in every morning and most importantly no need to keep clicking a button to keep the stream alive.

Well, this morning when I loaded the application, I was sadden to see the following:


So, it looks like as of tomorrow the stream may stop. I'm hoping the application will continue to work. I hate to spend time hacking together a solution that works. I may also try loading up the Yahoo! widget in a VM to see if it's still working when Sirius goes online with their new service.

If anyone knows of any good Windows alternatives, let me know. If I find one, I'll try to share. I prefer something that works outside of the browser—since frequently restarts of my browsers are often required as a web developer. I want an application I can run in the background and keep enjoying programming like Howard Stern and the NFL Radio.

If Sirius continues to make it difficult to listen to their service, then I really won't have a need to continue using their services. I know there are plenty of other people who feel the same way. I've already seen a lot of people who are shutting down their service because Sirius is no longer offering the free stream. I know Sirius' finances are hurting and losing customers is the last thing they want to do.

Using jQuery to fix CFCHART's tooltip behavior

If you've ever tried using the "mouseover" tipStyle in <cfchart /> with an image, you may have noticed there are several issues with the JavaScript that the WebCharts3D engine generates:

  1. The position of the tooltips isn't always accurate--if you're got parent elements that are absolutely position from a relative element, the position is drastically mis-calculated
  2. If your chart happens to be on the right edge of the screen, the tooltips will push off to the right of the screen (both clipping content and creating horizontal scrollbars.)

Here we can see an example of the tooltip running off the screen:

CFCHART Tooltips run off screen

You can see the scrollbar and how the tip goes off the edge of the screen. Obviously, this isn't very usable. To fix the problem, we're going to have to override the native mouse handler functions. Unfortunately, this isn't particularly easy to fix because when the <cfchart /> is executed, it embeds an external call to a JavaScript file which looks something like:

<script language="javascript" src="/CFIDE/GraphData.cfm?graphCache=wc50&graphID=script.js"></script>

This makes overriding the functions a bit tricky. You can override the functions during the window.onload event, but what happens is you're loading your chart via AJAX? Plus, why load JS you have no intention on using?

The solution is to strip out the <script /> call. You can do this by wrapping your <cfchart /> call inside the <cfsavecontent /> tag. This will give you a string containing the HTML you'll need to embed in the page. You can then use a regular expression to strip the <script /> from the output before writing it to the output stream. What you end up with is some source code that looks like:

<cfsavecontent variable="sChartOutput">
     <!---// put your cfchart code here //--->
     <cfchart width="1" height="1" />
<!---// we need to output the chart, but remove the call for the external JS library //--->
<cfoutput>#reReplace(trim(sChartOutput), "<script[^>]+>
</script>", "", "all")#</cfoutput>

By using a regular expression we're able to completely remove the reference to external script that contains the mouse handlers. Now we've got to replace the functionality with code that actually works.

The WebCharts3D script file contains a number of functions, but there are only two functions that are actually used by the HTML generated: xx_set_visible() and xx_move_tag().

The xx_set_visible() function handles hiding/showing the tooltip and the xx_move_tag() function handles positioning the tooltip on the screen.

Since my site is already using jQuery, I'm going to leverage jQuery to handle the positioning of the tooltip. In the new code I'm going to:

  • Move the tooltip element (a <table /> tag) as a direct descendant to the <body /> tag. I do this to simplify positioning of the element—since we don't have to worry about positioning of any of the parent elements.
  • Set the tooltip element's visibility to "visible"—since it's hidden by default (once again we only need to do this the first time we view a tooltip.)
  • Calculate the edges of the screen (with some padding) to make sure my tooltip always stays in the viewport. We don't want our tooltip to ever be cropped or overlap off the screen. If the tooltip would run off the bottom of the page, we'll put the tooltip at the top of the page. If the tooltip would run off the right edge, we'll make sure it can't move any further than the very right edge of the screen (with some padding.)

So what does our code look like? Here it is:

<!---// we need to replace the WebCharts3D JS scripts with ones that actually work //--->
<script type="text/javascript">
// on first show, we need to move to the body
var __xx_set_visible = {};
function xx_set_visible(imgId, tipId, e, show){
    // get the table we're going to show
    var $tip = $("#" + tipId);
    if( !__xx_set_visible[tipId] ){
        // move to the body and make visible
        $tip.appendTo("body").css("visibility", "visible");
        __xx_set_visible[tipId] = true;
    $tip[show ? "show" : "hide"]();
    // make sure we place the tip in the correct location
    xx_move_tag(imgId, tipId, e);
function xx_move_tag(imgId, tipId, e){
    // get the table we're going to show
    var $tip = $("#" + tipId);
    // get the scroll offsets
    var scroll = {top: $(window).scrollTop(), left: $(window).scrollLeft()};
    // if we're IE we need to create the e.pageX/pageY events
    if( !e.pageY ){
        e.pageY = e.clientY + scroll.top;
        e.pageX = e.clientX + scroll.left;
    var pos = {top: e.pageY + 20, left: e.pageX + 10}; // add padding for cursor
    var tip = {width: $tip.outerWidth() + 10, height: $tip.outerHeight() + 10}; // add padding for edge
    var screen = {right: scroll.left + $("body").width(), bottom: scroll.top + $(window).height()};
    // if we're going to be off the screen, adjust the position
    if( pos.left + tip.width >
screen.right ){
        // don't move past most right of screen
        pos.left = screen.right - tip.width; // pos.left - tip.width || screen.right - tip.width - 10;
    if( pos.top + tip.height > screen.bottom ){
        // don't move past most right of screen
        pos.top = pos.top - tip.height - 15; // since we're moving tip above we need adjust for the original padding we add
    // position the

That's all there is to it! Now our tooltips will never run off the edge of the page! Here's the result of our new custom mouse handlers:

CHCART with fixed tooltip!

BlogCFC and Windows Live Writer 2009 issues with UTF-8

I just noticed an issue with BlogCFC and Live Writer 2009. If you read my blog at all, you may have noticed I use the em dash a ton. For some reason I'm drawn to using the em dashes and ellipses.

Anyway, I just noticed that Live Writer does not translate the em dash character to an HTML entity (&#8212;), but instead posts it as a character code. This would be all fine and dandy, but there seems to be an issue posting this character as UTF-8—which is the default character coding for Writer 2009.

The fix is to Blogs > Edit blog settings... > Advanced and changed the Character Set to "Western European (Windows): Windows-1252" from the "Default (UTF-8)" setting.


I'm not sure if this issue goes away if you use the HTML markup type, but I prefer the cleaner XHTML (and it works better with my BlogCFC modded XMLRPC script.

I'd prefer to keep using UTF-8, but until I can figure out how to fix the weird UTF-8 encoding issues, I'm sticking with this decoding.

Problems viewing CSS files in Aptana Eclipse Plug-in under Vista 64-bit

Last week I upgraded my dev system to a Dell Studio XPS-121M--which comes equipped with Windows Vista 64-bit. For the most part, I had no problems getting my software migrated over to the new box. However, for the first time I went to edit a CSS file this morning in Eclipse and was getting a blank screen.

I'm currently using the Aptana plug-in under Eclipse 3.3 (Europa) and thought something was wrong with my installation (since it was just a copy of the old directory.) After trying a number of things, I came across an open ticket at Aptana that indicates there's a problem with the Mozilla XUL support under Vista 64-bit.

The full Aptana Studio was based on Eclipse v3.2 up until Studio v1.3. If you are running an old version of Aptana Studio, you may run into the same issue under Windows Vista 64-bit editions.

To resolve the problem, two fixes mentioned in the ticket worked for me:

  1. Toggle to the "IE Preview" mode and back. Obviously this fix is a real PITA, but at least I knew I was on the right track.
  2. Disable the "Firefox Preview" mode (Preferences > Aptana > Editors > CSS > Preview > Uncheck Firefox.) When I first went to this preference, it didn't show either browser. I then unchecked the "Generate temporary files for browser previews", clicked "OK" and then closed all open CSS files. When I went back to the menu, the browsers were listed in the box again.

Since I don't use the Preview mode (although I suppose that might be handy at times) I just disabled the Firefox support. This seems to be working well for the time being.

The good news is this apparently is fixed in Eclipse v3.4 (Ganymede.) However, last week when I was trying to get things up and running I was having problems connecting to the Eclipse update site, so I'm still on v3.3 for the time being. I'll try upgrading again to v3.4 maybe this weekend.

In the meantime, hopefully this helps someone out.