December 19, 2006

Simple ZIP/Postal code validation

Simple javascript function to validate 5 digit US ZIP Code and Canadian Postal code format.

US ZIP Codes in the format "NNNNN".
Canadian Postal Codes in the format "LNL NLN".

Returns true if valid, false if not. This example needs the id of the ZIP/Postal Code field to be named "zipcode".

function validZip() {
   var zip = document.getElementById('zipcode').value;
   var zipRegExp = /(^\d{5}$)|(^\D{1}\d{1}\D{1}\s\d{1}\D{1}\d{1}$)/;
   return zipRegExp.test(zip);

October 3, 2006

Filtering directories from cfdirectory in ColdFusion

The examples tell you just to loop over the query returned by cfdirectory but it is much faster to do a subquery and use it instead.

<cfdirectory action="list" directory="C:\" name="treebase" recurse="yes">

<cfquery dbtype="query" name="treebaseFiltered">
SELECT Name, Directory
FROM treebase
WHERE Type = 'Dir'

September 26, 2006

Does anyone check content before posting it anymore?

Here we have a large company website, a tutorial on embedding swf files into browsers, and a guy with a t-shirt with two unicorns getting it on. Though not completely unrelated since the page is about embedding objects.

Adobe - Developer Center : JavaScript Flash Player Detection and Embedding with SWFObject

September 20, 2006

iTunes and Remote Desktop

iTunes 7 crashes with an error "0x666d743f" when using Remote Desktop on Windows XP.

The easy workaround I have found is to disable the sounds in the Remote Desktop settings before connecting. Apparently there are some other reported driver issues with this version of iTunes as well.

August 15, 2006

Check this out. It's a slick interface for checking your internet connetion speeds.

June 14, 2006

Watch the World Cup in ASCII

Watch the World Cup in ASCII

Simply fire up a command prompt and type “telnet 2006” and you’ll find a live “video” stream from 10 minutes before kick-off (or should that be boot-up?).
Clearly this is what the internet was invented for! We look forward to a version of Wimbledon that resembles Pong.

June 12, 2006

ColdfusionMX7 on Fedora Core 4

First this is insane, and many you you will rightfully say I am out of my mind for suggesting this a solution to installing ColdfusionMX7 on a Fedora Core 4 box, but nevertheless its the solution that seemed to work for me.

Here we go.

I'm assuming that you have installed FC4 with the apache web server from the FC4 distro and then have run yum update to update your server before moving forward. So if you haven't done so now.

Once your all up to date and you can start and stop apache succesfully (which should work out of the box) then get the CFMX7 install binary and run it.

Accept all the defaults and go ahead and configure coldfusion but don't tell it to use apache. Have it install it's built in web server.

Before you do what the end of the install script says to this.

First insure that your local hosts file is setup correctly. If CF can't access things via localhost it gets really confused. I tell you this because I host several virtual sites on my web server and had already set up interfaces for them and things went haywire until I corrected the hosts file.

Go ahead and start the coldfuison server, tail the /opt/coldfusionmx7/logs/cfserver.log file to ensure that there weren't any error's starting the coldfusion server. Go ahead and login to the administrator website and make sure everything looks good.

once that's done edit the /opt/coldfusionmx7/runtime/servers/coldfusion/SERVER-INF/jrun.xml file.

-Go to the section labeld "This is the build in Jrun Web Server
-Set the "deactivated" section to "true"
-Go to the section that starts out "This service is for communicating with native (IIS, Apache..
-Set the "deactivated section to "false"

-Restart Coldfusion and make sure there are no errors.

-Start apache with service httpd start

now both CF and apache should be running but not working together yet. This is more just an exercise to show that both can be started before integrating them.

next use this command to run the cf connector on apache.

from the /opt/coldfusionmx7/runtime/bin/ directory

./wsconfig -ws apache -dir /etc/httpd/conf -bin /usr/sbin/httpd -script /etc/init.d/httpd -coldfusion

It should give you and error when it tries do restart the apache server. and typically speaking issuing a

service httpd start or restart

should fail with NO ERROR MESSAGES. None in the log files and none from the console. This is were I was totally stumped.

If you edit the /etc/httpd/conf/httpd.conf file it should look like this for the connector information:

# JRun Settings
LoadModule jrun_module "/opt/coldfusionmx7/runtime/lib/wsconfig/1/"

JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ssl false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore "/opt/coldfusionmx7/runtime/lib/wsconfig/1/" JRunConfig Bootstrap
#JRunConfig Errorurl optionally redirect to this URL on errors
AddHandler jrun-handler .cfm .cfc .cfml .jsp .jws

This is where the craziness starts...

-Change the selinux settings to start running in permissive mode.



I know that sounds insane and I've never never never had to reboot a linux box after installing a piece of software...but unless you reboot the server...apache never tells you what the errors are. Once you reboot the server either apache will just start and you'll be all good...OR it will give you an error about permisions. If it's a SELinux problem...just do a google on the error and you'll see how to use chcon to fix the security context.

If things still aren't working a netstat -a and insure that port's 2920 and 51011 are being listened on. if they aren't then there is something wrong with cf.

Anyway...that's my experience...I only wish i had rebooted the server once apache didn't return errors upon failing sooner. I hope this helps...I have not verified this information in any's just what it took for me to get it working in my environment.


May 5, 2006

Temperature Data Archive

This site contains files of daily average temperatures for 157 U.S. and 167 international cities. The files are updated on a regular basis and contain data from January 1, 1995 to present.

Temperature Data Archive

March 23, 2006

Inside Scientology/Dianetics

After watching the South Park "trapped in the closet" episode I remembered I saved this link a while back. Inside Scientology/Dianetics

March 22, 2006

Macromedia - APSB06-03: Flash Player Update to Address Security Vulnerabilities

Adobe recommends all Flash Player and earlier users upgrade to the new version, which can be downloaded from the Player Download Center. For customers that cannot upgrade to Flash Player 8, please refer to the Flash Player 7 update TechNote.

March 17, 2006 - Home

Galleon is a free open source media server for TiVo which allows you to enjoy many kinds of content and interactive applications right on your TV. The server runs on your home computer and organizes your media collection so that they can be viewed on your home network. Galleon also brings Internet content and applications to your TV.

March 15, 2006

In2TV - now you can watch "V" on demand.

I'm not sure if it has every old episode of "V", but just the fact that it has any of them is pretty freakin sweet.

You have to install some b.s. aol plugin that will probably root-kit your computer. But it's worth it. Maybe. It probably means it's only going to work on IE 6, but I'm too lazy to test it.

March 8, 2006

Awstats log file config for Apache 2

LogFormat="%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""

This will allow the OS and browser lists in awstats to work with Apache 2 log files.

February 13, 2006

Take the Beef Quiz.

I normally don't post projects I'm working on, but if you score 100% on this quiz you can get a $4 off coupon on some quality beef. You may even learn something.

For those of you that live in areas that sell Sterling Silver. Take the Beef Quiz.

For those of you that live in areas that sell AngusPride. Take the Angus Quiz.

You can take it more than once. I haven't seen anyone get them all right the first time. Hell it even tells you the answers if you get them wrong.

February 1, 2006

Four Pontiac Grand Am 16" factory 3 spoke rims wheels

Google Base: Four Pontiac Grand Am 16" factory 3 spoke rims wheels

I have four factory 3-spoke rims from a 1997 Pontiac Grand Am that have been in storage for years. There are tires on the rims and still have a little tread life left. These rims are in great shape.

Asking $300 for all four if you come and get them. They are selling for $100 a piece on eBay plus shipping.

January 23, 2006

Top 10 Chuck Norris Facts

  1. Chuck Norris' tears cure cancer. Too bad he has never cried. Ever.
  2. Chuck Norris does not sleep. He waits.
  3. Chuck Norris is currently suing NBC, claiming Law and Order are trademarked names for his left and right legs.
  4. The chief export of Chuck Norris is pain.
  5. If you can see Chuck Norris, he can see you. If you can't see Chuck Norris, you may be only seconds away from death.
  6. Chuck Norris has counted to infinity. Twice.
  7. Chuck Norris does not hunt because the word hunting implies the probability of failure. Chuck Norris goes killing.
  8. Chuck Norris' blood type is AK+. Ass-Kicking Positive. It is compatible only with heavy construction equipment, tanks, and fighter jets.
  9. Chuck Norris is 1/8th Cherokee. This has nothing to do with ancestry, the man ate a fucking Indian.
  10. In fine print on the last page of the Guinness Book of World Records it notes that all world records are held by Chuck Norris, and those listed in the book are simply the closest anyone else has ever gotten.

January 16, 2006

Bonsai Kitten: Dedicated to preserving the long lost art of body modification.

Aww! Who wouldn't want a kitty in a box? Haha, this is getting passed around again so I thought I'd post it to cut down on the email from animal rights activits.

Snopes Link

read more | digg story

January 10, 2006

JavaScript + CSS = Nice Picture Display

Nice piece of JavaScript and CSS to display a picture in response to a click on a thumbnail. More attractive than just popping up a window or loading the picture raw in the browser. Instead the whole page is shaded down and the image is loaded in the center of the page.

read more | digg story

January 5, 2006

Hi-res version of Falling Sand Java Game

Highly addictive Zen-Garden-like game where you control flow of sand, water, salt, and oil by drawing walls, plants, sprouts, cera (wax).

read more | digg story