dans.blog


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

Steve Stevens Flamenco A Go-Go

I was talking w/someone recently about guitar work and he brought about Flamenco style music. This immeditately made me remember Steve Stevens excellent Flamenco/Rock album called Flamenco A Go-Go.

This album is a really great intrumental album with lots of influences from around the world. A did a quick You Tube search and came across the video for Dementia. While this song is probably the most traditional sounding songs on the album, it's still a very tasteful piece.

Steve Stevens - Dementia (Live)

more…


Free Windows MD5 Checksum Application

I downloaded the ColdFusion v7.0.2 Updater this morning. Since I've had some problems recently with downloading CF updates from Adobe.com, I decided I'd verify the MD5 checksum. This made me realize I didn't have a good Windows application for verify the MD5 checksum. After searching Google for a few minutes, I came across a very small (97k) application called MD Checker v2.20.

Using the program is very straightforward—just unzip to a directory and run the md5.exe executable. No installation required. To compare a checksum against a file's checksum, select the "Verify an MD5 checksum" (which is the default option.) Next, copy the MD5 checksum into your clipboard and click the "Paste" button—this will put the MD5 checksum value to verify against in an uneditable control. To verify the checksum of a file, click the "Browse" button and find the file on your hard drive and click the "Open" button. The application will then report the checksum found in either a green (if the values match) or red (if the values differ) box.

This program is very straightforward and best of all, it's free.


New and Improved--now built with LylaCaptcha!

In order to try and prevent the spamming issues, I finally had to do something I didn't want to do—and that's implement a Captcha process to the comments.

When you wish to post a comment, you'll now be required to fill in the text you see in the image right below the comment box. This is to help ensure that it's a real person entering in the comment and not just a spam bot. If this doesn't help with the problem, the next step will be either to require a valid e-mail (in which you'll have to go through a verify process the first time you post) or I'll start approving all comments manually. I really hope I don't have to turn off commenting altogether, but I'm tired of deleting 20-30 spam messages a day.

For those of you wondering, I used LylaCaptcha for my captcha needs, which worked on really well. I was going to type up a "how-to", as the documents on the LylaCaptcha site aren't as straightforward as they could be. Once you figure out what you need to do, it's very straightforward, but I found I had to really do a lot through trial an error. Anyway, the reason I'm not doing a write-up is Brian Rinaldi already wrote what I ended up doing in a blog post titled Adding Open-Source LylaCaptcha to BlogCFC.

more…


A ColdFusion UDF For Dynamically Loading Java Classes

UPDATE:
2007-09-21
I just noticed today that the createClass() function below was an old version of the actual code I'm using, so I've updated the code with the latest version.

I've been working on modifying some ColdFusion based web services for XStandard originally written by Ben Nadel. One of the things the original code didn't support was the Spell Checker support feature built-in to XStandard.

After doing some searching, it appeared the Jazzy Spell Checker Java API would fill my needs nicely. It's based on the algorithms in aspell and it can use both dictionary and phonetic files to help with spelling suggestions and it returns all the information required by XStandard (position of word and suggested spellings.) The only "disadvantage" of Jazzy is that it does come "ready-to-use" with CFMX—you need to write a wrapper class for easy use w/ColdFusion. (More on that to come in a later post.)

more…


MSSQL 2k Stored Procedure for Pagination...

A while back I found a stored procedure that someone was using to create pagination resultsets in SQL Server 2000. While the stored procedure was nice, it didn't allow for the "DISTINCT" keyword—which is necessary for some of my queries. There were also a few other issues I didn't like about the stored procedure, so I re-wrote the stored procedure pretty much from scratch.

In order to support the "DISTINCT" keyword, I had to change the inner query to use a derived table. Since this provides a little more overhead, I added a bit parameter "@Distinct" which inserts the "DISTINCT" keyword into the query and uses the derived table.

Also, on the initial page of results, I simply use the TOP keyword. The previous stored proc used an inner query, which did a TOP 0—which means the code did nothing.

more…


Protecting your HTML pages from Spam Harvester Bots

Today I was reading a post on a message list and someone mentioned they were using a function to generate their mailto: links using HTML entities instead of the ASCII characters in order to prevent spam harvesters from snagging the e-mail address. The problem with this method, is it would be pretty easy for a harvester to re-encode the HTML entities back into the correct ASCII characters.

This got me think that the best method would involve using JavaScript to write out the link. In order for a spam harvester bot to parse out the e-mail address, they'd have to understand the context of the page. This means they'd either have to actually parse the page into a DOM object and parse the DOM, or they'd have to specifically knowledge of the function and reverse engineer the links to the function. Either method is probably more than what most harvesting bots are going to use (although this could always change.)

So, I spent a few minutes and whipped up the following code. The spamProtector() JS function takes in an array of ASCII character codes, which will be used to generate the mailto: links. I obfuscated the document.write() statement by breaking the string into chunks in order to throw off any parsers looking for certain strings.

more…


It's amazing what you can do w/some Coke & Menthos...

What happens when you combine 200 liters of Diet Coke and over 500 Mentos mints? It's amazing and completely insane. Watch the video


License Free Photo Resource - everystockphoto

I think I've seen this link before, but there's a great site for license free images called everystockphoto. They currently have over 268,000 free images for download. Definitely worth checking out if you're doing a project on the cheap and need some images to use.

On a related note, iStockphoto is site were you can get very inexpensive photos (from $1 to $5 per image, based on the resolution you want.) The great thing about this site is if you're a photographer, you can sell your pictures on this site. A acquaintance of mine, Todd Smith of SaturatedPixels has been selling his works there for a couple of years. Check out his iStockphoto portfolio.


Steelers Receive Super Bowl Rings

The Steelers' Super Bowl rings were given to the players yesterday. Pretty cool design. I was a bit surprised that the ring included all 5 trophies in the background, as Dan Rooney has been very stout in his opinion that he wanted to keep this win separate from the wins in the 70s. However, I found this quote from Jerome Bettis that I think sums things up nicely:

It was Bettis who convinced Dan Rooney to include the team's four previous Super Bowl victories as part of the franchise's fifth ring, and why it has five Lombardi Trophies in diamonds on the face.

"He didn't want the other championships to overshadow this one,'' Bettis said. "I wanted to let him know that it was important that the other ones be involved because we had to live under that shadow. Now instead of us being separated, we're part of that family.

"As a player walking by those four trophies every day, I wanted to include those into this. It's part of the history and we're part of it. We wanted to feel part of it."

Here are the pictures:

more…


Worst Rendition of the Nation Anthem, Ever...

Has this guy even heard the Nation Anthem before? I'm sure the guy was nervous and all, but as a Police Officer in the United States of America, you should at least know how to sing the Nation Anthem. This guy makes Rosanne Barr sound like she should be on American Idol.

Listen to the worst rendition of the Nation Anthem, ever.


Sony Should Embrace Homebrew Flash-based Applications

I own a Sony Playstation Portable (PSP). It's a great handheld gaming device—blows away everything else I've seen. However, the one big battle that PSP owners have had w/Sony is wanting to run "homebrew" applications (these are unsigned applications written by users for the PSP and not officially released software.) The original firmware 1.2 had some holes in it that allowed you to pretty easily bypass the mechanisms Sony built-in to allow only signed content to play.

Every since hackers figured out a way to hack the PSP's firmware, it's been a battle between Sony and the hackers. Sony releases a new firmware that fixes the holes and hackers try to figure out another way to bypass the Sony security mechanism to only allow signed content to play.

Each time Sony releases a new firmware, they've generally added some new functionality to the unit. The original PSP firmware didn't include a browser—which was added in the 2.0 release (I believe.) Anyway, Sony tries to entice users to upgrade by offering new features and even having newer games force a user to upgrade. Some hackers are living on old firmware just so they can continue to run their "homebrew" applications.

more…


Being Thankful for Being Hot & Cranky

Leave it to something like the Air Conditioning (AC) going out to really realize how lucky and sometimes spoiled most of us are. Here in Central Ohio, we've had the hottest 3 days we've had in a long while—certainly the hottest 3 day stretch I can recall for May in this area. It was 88 degrees on Saturday and it's been in the 90s the past Sunday through Tuesday. Today's expected to be 89 degrees, with a high probability of T-storms—which at least should cool things off. If 90 degrees doesn't sound hot to you, also consider that we Ohioans put up w/very high humidity levels as well. Heck, the last few nights it's still been in the 80s at 11:00 o'clock.

Anyway, all these hot weather brings me to my point. Having your AC go out during a heat spell really makes you realize just how lucky you are to have modern amenities. Too many times in my day-to-day life I forget just how lucky I truly am and spend time concentrating on issues, while most of the world would love having only that to worry about—when they're struggling with surviving.

Anyway, it's times like this, when a luxury amenity I've come to take for granted goes away, that I really understand just how fortunate I am to be living in this day and age. I really appreciate all my parents did for me to put me in the opportunity to succeed in life.

more…


ICU4J's TimeZone Ids Mapped To Windows Timezones

Ok, I've been working on trying to optimize some code recently. One of the huge bottlenecks in the application is the conversion of date/times to local user times. All date/times are stored in GMT in the database and are converted to user local when displayed.

We've been using a database table to do lookups/conversions of the date/times to make sure they display correctly depending on the user's region and whether or not they are in a daylight savings time. We're using custom data tables—which we have to maintain—not to mention it runs pretty slow on large recordsets.

In order to speed things up, I've been looking at using IBM's ICU4J's TimeZone class. Paul Hastings has written some nice little ColdFusion wrapper CFCs for this class. So far in my testing, under load the Java class performs about 10x more efficient that the db lookup code.

more…


CFHTTP "Connection Failures" issues with Gzip

I've been playing around with Port80's Gzip compression filter, httpZip, on my development server and realized I was having a problems with CFHTTP calls. A quick search on Google pulled up a blog post by Steven Erat titled Workaround for CFHTTP and Compressed HTTP Response from IIS.

My problem differed slightly in that the very first request to a URL (via a CFHTTP request) works fine, but subsequent hits return a "Connection Failure" error. Unfortunately Steven's suggestion didn't work for me, but after some playing around with syntax I was able to come up with some solutions that do work:

  1. When configuring httpZip, set up all compressed mime types to exclude anything with the header "ColdFusion" and "CFSCHEDULE". This will fix the issue with any default CFHTTP calls (Schedule Tasks, CFCACHE, or CFHTTP calls where no "user agent" is specified) If you're manually setting the "user agent" in the CFHTTP call, see one of the following solutions.
  2. NOTE:
    After some more testing, it appears CFMX 7 reports the user agent string of "CFSCHEDULE" and not "ColdFusion". This means you should also add the "CFSCHEDULE" string along with the string "ColdFusion" to your MIME type exceptions list.
  3. Pass in a <cfhttpparam type="header" name="Accept-Encoding" value="*" />. For some reason Steve's suggestion did not work for my setup, but passing in the asterisks value did work. Including this header information prevented me from getting the "Connection Failure" message again.
  4. The last method is to add custom header to the page serving up content, which tells the httpZip ISAPI filter to ignore compressing the request: <cfheader name="httpZip" value="no-compression" />. You could use this technique and have all your CFML pages look for the custom header labelled "Gzip-Disabled". If the custom header exists and is set to "true", you then could execute the CFHEADER tag to tell the ISAPI filter not to compress the page. This would give you the ability to dynamic control the compression of httpZip from within your code.
  5. NOTE:
    You could pass in the httpZip to your initial call and just pass that value back to the CFHEADER output stream, but that opens your page up to be controlled from an outside source. I prefer to just allow the compression to be enabled or disabled on request.


The future is here: Web 2.1

There's a new Web in town—Web v2.1! A new article over at Something Awful gives a humorous, yet insightful, look at the buzz phrase "Web 2.0".

Web 2.1 is the new standard for web sites and applications in the blogosphere collective information age. It is scaleable and easy to use, as well as being user friendly and designed with the end user in mind. In order to be Web 2.1 compliant, you must follow these guidelines:

  • If it comes to a rest on the floor for less than five seconds, you can eat it
  • No means no
  • Don't expose it to bright lights, get it wet, or feed it after midnight
  • Data is the next Intel Inside
  • If the kick returner signals for a fair catch but drops the ball, the other team can attempt to recover it