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

Tony Levin kicks ass...

For some reason I was in the mood to listen to the first Liquid Tension Experiment album today. Tony Levin is such a fabulous bass player. He really has such a unique and distinct sound—I just love the way he approaches the bass. The LTE albums are both great, but I prefer the first album.

Anyway, for those of you who don't know much about Tony, he's played with just about everyone under the sun—from John Lennon to King Crimson. He appeared on a majority of Peter Gabriel's albums as well.

Some of my work favorite by Levin is on the Bozzio Levin Stevens albums—which consist of Terry Bozzio, Steve Stevens and of course Tony Levin. I highly recommend getting these two albums:


Commodore - Don't Call It A Comeback...

Apparently Commodore, yes that Commodore, has got a new line products coming out. They've already got some portable media players on the market, and they're getting ready to release three new products: the Commodore Multimedia Tower, the Commodore MediaBox and the Commodore Navigator.

TIP: Query Analyzer - Selective Query Results

I've been using the Query Analyzer that comes with Microsoft SQL Server 2000 since it was first released and just discovered this trick today.

TIP: Query Analyzer - Selective Query Results
If you ever wish to run just a subset or portion of a query, highlight the portion of your query you want results for and click the "Execute Query" button (or hitting [F5].) Query Analyzer will then run just the portion of SQL code that's selected and display the results in the Results Grid.

This works great if you want to see what a query is doing without the where clause, or perhaps to see the results of an inner select statement. In the past I was always copying these to a new window to run. No more!


Problems with CFINCLUDE & UTF-8 files...

I was talking with a friend this afternoon and we were discussing an issue his client was having. They were using the <cfinclude> tag to read in a UTF-8 file to display some "cached" data but were having a problems. It turns out that any actual UTF-8 encoded characters were not displaying correctly, because the included files were written with <cffile>, which does not write a BOM (Byte Order Mark) when saving UTF-8 data.

Fortunately, Tim Blair had already run into this problem and come up with a solution for writing UTF-8 files that have a BOM. I've taken his code and wrapped it up into a UDF:

function fileWriteUT8(sFilePath, sInput){
    // declare jWrite object
    var jWriter = "";
    // create the file stream
    var jFile = createobject("java", "java.io.File").init(sFilePath);
    var jStream = createobject("java", "java.io.FileOutputStream").init(jFile);
    // output the UTF-8 BOM byte by byte directly to the stream
    jStream.write(239); // 0xEF
    jStream.write(187); // 0xBB
    jStream.write(191); // 0xBF
    // create the UTF-8 file writer and write the file contents
    jWriter = createobject("java", "java.io.OutputStreamWriter");
    jWriter.init(jStream, "UTF-8");
    // flush the output, clean up and close

    return true;


Photo Album Updated!

The photo album has been updated!

The following photo albums have been added:


The ring...

My digital camera didn't take a very good picture of the ring, so I had to try and clean it up a bit. Anyway, here's the best picture I could get of it. Click the picture for a larger view.

I'm engaged!

I proposed to Jenn tonight.

I was originally going to do it on New Years Eve—which would have been the 3rd Anniversary of the first time I told her I loved her. I then decided I wanted to do it before we go to her parents for the Holiday, so I was thinking about Christmas Eve. Last night I decided I wanted to do something with just the two of us, something a little more memorable.

So, I decided to take Jenn to Mills of Clifton Gorge—where they do a huge Christmas Lights display every year.


Compare prices with a picture phone with SCANBUY

I was watching the local news last night when they did a quick blurb on a mobile phone service called SCANBUY. This company looks to have been around for a while and I can't understand why the idea hasn't been talked about more.

The basic concept behind the SCANBUY service is that you run an application (via your wireless carrier) on your picture phone. When you're at a major retail store, you can take a picture of the bar code of the product. SCANBUY will then report back the pricing of that item at other local area stores. That way you know if the asking price is in par with other stores in the area.

This is a really great idea that will hopefully catch on. It's on available on a limited number of phones right now. In addition to the software being available for your phone, you wireless carrier must also provide the service. In my case, they list the Motorola v710 phone as being supported, but Verizon doesn't currently offer the service—which sucks.


New Version of Fiddler HTTP Debugging Proxy Available - Critical Security Update

I just noticed that there's a new version of Eric Lawrence's Fiddler HTTP debugging proxy available. This update claims to be critical security update and it's recommended you update immeditately.

For those of you who don't know, Fiddler is a great way tool for monitoring the HTTP traffic on your box. If you're doing any kind of RPC (web services, Flash remoting, AJAX) over HTTP, then this application is a must have.

Here's what's in the new version:


BufferOverflowException when invoking ByteArrayOutputStream.toString() on large arrays in CFMX 6.1

I'm working on project that involves us transferring large XML files between a client application and the server. In order to increase bandwidth efficiency, we're using gzip on the XML data to shrink the file size down. This works great as we're seeing about an 80% shrink in file size.

However, I was running into a problem trying to expand the GZIP file on the server. I wanted to expand the file directly to a string in memory—avoiding writing the file to disk. By using a ByteArrayOutputStream I read in the GZIP file using the java.io.FileInputStream and java.util.zip.GZIPInputStream. I then used the toString() method on the ByteArrayOutputStream to convert the OutputStream into a string ColdFusion could use.

On files under 10MBs, I wasn't having a problem but on some really large files I was getting a strange java.nio.BufferOverflowException error when trying to convert the OutputStream to a string. Turns out there appears to be some kind of threshold between CFMX and Java.


Firefox - Upgrade JavaScript Console Extension

Jim Rutherford over at Digital Media Minute blogged about a next generation JavaScript console which is a Firefox v1.5 extension called Console².

This extension adds a lot of necessary functions to the Firefox JavaScript Console window (which is renamed "Error Console") such as: sorting errors, filtering errors by type (CSS, JS, XML) and you can even search over the errors.

One tip, the "Clear" button isn't on the toolbar by default. To add it you'll need to right-click the toolbar and choose "Customize". Not sure why they didn't add the "Clear" button by default—seems like a button that's absolutely necessary. I know it's a button I use pretty much any time I have the JavaScript console open.

Cool Firefox Extension - foXpose

The Viamatic foXpose plug-in is an extension for Firefox v1.5 that will show all your open tabs in single window with thumbnail previews of the window.I've seen this blogged about a lot recently, but finally tried it out based upon an IM from Cameron Childress.

I was worried that the plug-in would be too CPU intensive, but it does really seem to negatively affect my performance in Firefox. Plus, it's really slick being able to see thumbnails of all my open tabs.

You can activate foXpose by either pressing [CTRL]+[SHIFT]+[X] or by clicking the pane icon in the lower-right hand corner of the window.

Possible Buffer Overflow Bug in Firefox v1.5

John Dowdell posted about a possible buffer overflow bug in Firefox v1.5.

I'm not sure why you wouldn't cap the document.title object at 256 or 1024 characters. There's really no reason why you should be able to dump that many chars into that property anyway.

So, if you find Firefox v1.5 is crashing everytime you start the application, try deleting your history.dat. Actually, I'd recommend renaming it to history.bak that way you don't lose everything if it doesn't fix the problem.

TIP: Adding "Command Prompt Here" Context Menu

I often find myself needing to open up a command line on a specific directory. Since Windows Explorer is almost always open on my machine while I'm developing, it makes perfect since that I'd want to use Windows Explorer to open up a command line prompt in a specific directory via the context menu. How can you do this you ask? You edit the registry.

This is not a new tip. It's been around since Windows 95. There's even been a Microsoft PowerToy that does this for every version of Windows, but essentially all it does is create some registry entries for you. I prefer manually editing the registry, as I then have complete control over how I want the listing to appear.

  1. Open regedit
  2. Navigate to HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell
  3. Create a new key called command prompt
  4. Your default value should be Command Prompt Here
  5. Create a new key called commandunder the command prompt key
  6. Your default value should be cmd.exe /k pushd %L


A FPS Shooter Example Using Firefox v1.5 Without Plug-ins!

I caught this on Blogzilla. If you have Firefox v1.5, this is very cool. The <canvas> tag looks pretty slick, but since only Firefox supports it, I can't see much use for it right now.

New in Firefox 1.5 is support of the <canvas> tag, which is a new HTML element that can be used to draw graphics using JavaScript. It's not SVG, even though it overlaps functionality with SVG.

Rafael Robayna has created a simple painter demo. A little more detailed is the first-person shooter demonstration.

While both are a little slow and not so smooth, it's still cool to see something like this is possible.

More on <canvas> tag:
Mozilla Developer entry for Canvas
Mozilla Wiki entry for Canvas