Archive for December, 2003

Ghost Soldiers

Tuesday, December 30th, 2003

About two years ago I bought my Dad a book for Christmas called Ghost Soldiers by Hampton Sides. I’d heard good things about the book and since I’ve always been interested in World War II history I decided to buy a copy for myself at the same time. I tucked it in my book case and finally got around to reading it a few months ago.

In the initial phase of World War II the Japanese Army launched an invasion of the Philippines. The American and British forces abandoned there were forced to make a stand against an overwhelming army, without hope of reinforcement, resupply or even evacuation. For those that survived, the next few years brought torture, starvation and suffering. The captured soldiers endured an agonizing march to the various Japanese prison camps, a march which came to be known as the Bataan Death March.

A few years after the march, those that survived the torture and starvation were left with a new dilemna. The Allied armies had landed in the Philippines and were quickly pushing the Japanese forces back. The tables had turned and the Japanese army was facing a similar situation that the prisoners faced years earlier. The prisoners could only wonder what the retreating Japanese forces would do with them? In a few camps, near the front, orders had already been given and were carried out to execute all the prisoners.

The Allied forces heard rumors of the executions and had to quickly develop a plan to handle the situation. Ghost Soldiers relates the story of “121 hand selected troops from the elite U.S. Army 6th Ranger Battalion”, sent behind enemy lines to liberate a prison camp near Cabanatuan. In addition to giving a minute by minute account of the mission, the book also tells the story of the 513 allied POW’s imprisoned near Cabanatuan, some of whom were the last survivors of the Bataan Death March.

Once I started reading the book I honestly found it hard to put down. The author was excellent at telling the story of the imprisoned soldiers and their would be rescuers. Using first hand accounts the author painted a vivid picture of the suffereing prisoners and their anxious rescuers. I recommend it not only because it’s well written but because story of the sacrifice and suffering of these men is one that should never be forgotten. I think the author said it best:

“It was often said after the war that all the men of Bataan could well expect to go to heaven because they’d already served their time in hell. These men suffered enough for a hundred lifetimes, and no one in this country should be allowed to forget it.”

Coldfusion MX 6.1 Upgrade Continued

Sunday, December 28th, 2003

I’ve been procrastinating finishing my upgrade entry because one of the problems I ran into was a little troublesome to fix. If I was smart I would have made the upgrade entry immediatlely after I fixed it, while the problem and solution was fresh in my mind. Now that a few weeks have passed I can’t recall all the details so you’re going to get a watered down explanation of what I did.

Basically, after the upgrade, all credit card processing on our site went down. Fortunately it’s not something we use a lot on our site but it was still important to have fixed. I isolated the problem to the COM object we were calling to do the processing. Basically we just initialize the object with the server name, port number, credit card information, etc and the object connects to the credit card server and takes care of the rest. After the upgrade, the code that set the port number was throwing a mysterious error. Something like “VT_22 unsupported” or something along those lines. I discovered that MX seems to have a problem with passing integer arguments to COM objects. Passing something like: MyObject.ServerName(”someserver.somedomain.com”); would work fine. However, MyObject.ServerPort(5555); would throw the error. I checked around the Macromedia forums and only found a few vague references to the problem but no solutions. Finally I came across a page that described a way to create a Java stub for a COM object. Basically creating a java class that will interface with the COM object. So instead of calling the COM object directly within the code you call the Java object. Information on how do this can be found here.

The original code looked something like this:

<cfobject type=”com” action=”create” class=”MyComObject.Foo” name=”MyComObject”>

using the java stub it looked something like this:

<cfobject type=”java” action=”create” class=”MyComObject.Foo” name=”MyComObject”>

Fortunately the credit card processing was contained in a custom tag so I only had to modify the one line in the custom tag, after I created the java stub of course, to have everything working. Incidentally the next day I came across a “” that from reading the description appears to solve the problem. However, the hotfix was released the day before I created my java stub and I didn’t find it until after the problem was resolved. I haven’t applied the hotfix or tested it to see if the COM objects work with integers. However, if you’re having this problem I would definitely try the hotfix first before creating the stub since you shouldn’t have to modify your code and it’s probably much simpler than creating the stub.

The last nagging problem we’ve had with the upgrade is mysterious “null null” errors. Quite a descriptive error isn’t it? We’ve isolated a few of the causes to improperly used date functions (such as creating a date with 0 for the month, apparently this worked in 5.0 but now causes a null null error in MX). However, we’re getting the error seemingly at random in a few pages that don’t use any date functions. I suspect it has something to do with cookies since clearing the cookies on the client has solved SOME of the errors. I still haven’t been able to erradicate the error completely. It’s difficult since the error isn’t descriptive at all, null null gives me no clues about what’s causing the problems. The line number the error is reported on is also wrong (a few null null errors have been reported on blank lines or lines that are only comments). Debugging the error is truly like searching for a needle in a hay stack.

Even with the problems I had with the upgrade I’m still impressed with a few of the additions to MX. I wrote my first application the other day using a a cfc. Being able to remove the business logic from the display code made for a much cleaner implementation which I expect will utlimately make it easier to maintain and scale. Now if I can get the rest of my team to use it correctly we’ll be in good shape.

Happy Holidays

Sunday, December 28th, 2003

The holiday season is nearly half over, I can hardly believe it. Christmas was good and its been nice to have a break from work and things. Although by Christmas day I was starting to get a little bored. I finally decided to upgrade the server to Redhat 9.0 since its end of life cycle is good until the end of April. This gives me a little more time to decide what I want to do with the server and of course actually doing it.

The upgrade was straight forward, didn’t run into any snags, but it didn’t take very long either. I decided I would eventually like to migrate the system to Debian, and since I haven’t worked with it at all I’ve spent a few days playing around with it. Overall I’m impressed. It’s a solid distribution and has some very nice features (apt-get and dselect to name a few). I’ve gone through the install process a couple of times just to get accustomed to it. I’ve been doing the testing on an old HP desktop machine that was sitting around. I named the system “kenny” since my other production system is named “cartman.” One might wonder why I chose Kenny and not Stan or Kyle…well I figure this is an old slow machine and eventually I’ll take it down, or kill it. Those familiar with Southpark will understand why the name is appropriate for a temporary system.

Anyway, I hope to have all my services up and running on kenny that I have on cartman. Then I plan to take cartman down and let kenny handle all the services for the domains while I rebuild cartman with debian. There’s a couple of things I want to do with the installation. I want to use exim as my smtp with qpopper as the pop server. I’d also like to have both use MySQL for authentication and mail handling. I’ve read a little about this and it seems like an excellent way to handle mail for virtual domains. Unfortunately the Debian packages don’t appear to have mysql versions for either, so I’ll have to compile them from source. I found a little bit of information on this and it doesn’t appear to be too difficult.

As I was thinking about the mail setup I was a little curious how ISP’s handle the authentication setup. Obviously they have to handle virtual domains but they also seem to use one authentication system (username and password for email and ftp, etc is the same). If anyone has tips on how to do this I’d be interested.

I also need to research using software RAID on Debain (I’m planning to use the “Woody” distribution, so I’ll probably install the bf24 flavor since the 2.4+ kernel supports RAID). Setting RAID up on Redhat was cake but I’m not as confident with Debian.

The mail setup is really the only major difference I plan to have between the current setup and the Debian setup. At least that I can think of. I’m sure when it comes time to do it I’ll think of a few more. Oh, one thing I need to find out, is how to export a list of debian packages installed on a system and use that list to build another system. I’m sure there’s a fairly simple way to do it I just haven’t come across it. That should make the upgrade go fairly smooth. If I can setup the kenny system very close to how I want cartman setup I should be able to export the package list on kenny and use the list on cartman to have it install all the packages I need. The only thing left is migrating the configuration settings and data.

I’m not in any rush to get the upgrade done. I think I’ll use the rest of the holiday break to catch up on some weblog entries I’ve been meaning to write. I’ve read a couple books over the last few months that I’ve been meaning to write about and there’s a couple other things I’ve been meaning to mention. With that said, there should be a few new entries coming over the next week.

P.S. Remember those glasses I lost over the Thanksgiving holiday? Yeah, I found them two weeks ago.

Anniversary

Monday, December 22nd, 2003

I was just looking over my weblog and I realized today is my one year anniversary. Hopefully the next year will bring more entries and improvements. In addition to the weblog I’d like to start developing a general home page with links to my weblog, photo gallery, etc. Then again, maybe that’s being a little too ambitious considering I spend 8 hours a day doing web development and design already. I know, I know, those of you who know me are saying, “he really needs to get a girl” and as usual, you’re probably right. Anyway, on with next year.

ColdFusion MX 6.1 Upgrade

Monday, December 15th, 2003

As I mentioned earlier I upgraded our server at work to ColdFusion MX a few weeks ago. It went alright, not exactly a painless process but for the most part I think we’ve resolved the problems that occurred as a result of the upgrade.

Before I did the upgrade I documented all the ColdFusion Administrator settings. This came in very handy because the passwords for all the datasources were dropped. I had to go in and enter passwords for all the datasources, not a big deal but it could’ve of been if I had upgraded and didn’t know what one of them was. For some reason I’m still having problems with the datasource passwords but it’s more of an inconvenience so I haven’t researched it. Basically anytime I change a datasource I have to reenter the password. For instance, say I want to add “insert” capability to a datasource. I click on the datasource in the Administrator, check the “insert” box and click “Submit” and suddenly I have a datasource that won’t verify. I go back in, type in the password, click submit and all is well. I’m not sure why it updates the password when I haven’t modified it but that seems to be what it’s doing; updating it to the wrong password of all things. Like I said, more of an annoyance than a real problem.

Also with the datasources I had to change all of our MySQL ODBC datasources to JDBC. I’m not sure why but the ODBC datasources were returing empty query results. I copied a few of the queries into a MySQL terminal and got results. The datasources verified fine so I was sure it wasn’t a connection issue. Rather than try and figure out why this was happening I just upgraded to the JDBC driver that comes with MX, that seemed to solve the problem.

One pesky little problem (feature?) I discovered a while after the upgrade was the change of the “encoding” to UTF-8. In 5.0 I believe the default encoding was IS0-8859-1, in MX it’s UTF-8. The problem is UTF-8 is much more limited than IS0-8859-1. So any page that included directed quotes, m dashes and similar characters appeared with question marks where the characters were. There’s a few portions of our site where the content is entered by the communications staff which means they basically copy what they’ve typed in Microsoft Word and paste it into a form which is submitted to the database. Word uses the ISO-8859-1 character set so you can end up with quite a few question marks scattered in the content. I figured the easiest thing to do was change MX to use ISO-8859-1 as the default encoding. Not as simple as you might think. Initially I just looked for the setting in the Administrator, but didn’t find anything. Eventually I found a tip that indicated including -Dfile.encoding=iso_8859_1 in the JVM Arguments in the Administrator under the “Server Settings > Java and JVM” page would solve the problem, it didn’t (although I didn’t notice it corrected the problem on a few pages). I found another tip that said to modify the %MX_Root%/lib/neo-runtime.xml file and add:
<var name=”defaultCharset”>
     <string>ISO-8859-1</string>
</var>
within the <struct type=”coldfusion.server.ConfigMap”>
tag. That seemed to solve almost all of the problems except for a few. The few remaining were on pages that pulled content from the database. Long story short, you need to add this: useUnicode=true&characterEncoding=iso-8859-1 to your JDBC connection string for your datasource if you plan to use ISO-8859-1 with the datasource. That’s quite a few changes just to get back to the default encoding that was used by ColdFusion 5.0.

There’s still a few other problems (more serious) we had but this entry is getting to be a little lengthy so I’ll save them for another time (actually I’m tired and I just want to go to bed).

UPDATE: To read about the rest of the upgrade go here.

MAX 2003 Pics

Tuesday, December 2nd, 2003

As I promised earlier, here are some pictures from the MAX 2003 conference. Oh, and if anyone from Macromedia (who cares) comes across this, I have a couple recommendations that would make for a better conference. First more power ports. The WiFi access was nice but finding a power outlet to recharge the laptop was a little challenging at times. A greater WiFi area would have been nice also. A couple of the presentation rooms were close enough to the hotspots to get access but many were not.

Like I said earlier I really enjoyed the conference. I learned a lotta great stuff and I’m planning on attending next year. I even upgraded the server to Coldfusion MX 6.1 (not a painless upgrade, but I’ll save that story for another time).

Mozilla vs IE and Safari (tip: Using System Default Mail Program with Mozilla)

Tuesday, December 2nd, 2003

When I got my powerbook I switched from using Internet Explorer to Safari solely because Safari had tabs and IE didn’t. I was happy with Safari but then heard rumors it suffers from a memory leak. I decided to continue using Safari, once again, solely because of the tabs. At about this time I got my new x86 laptop at work with Windows XP which means I was back to IE (at work anyway). Honestly it drove me nuts opening a new window for every page I wanted to view. Not too mention when you open 3 or 4 windows of the same program in XP they scrunch together as one on the task bar, making it cumbersome to navigate between them.

A guy I work with recommended Mozilla and when I realized it had tabs I was sold. I installed it on both my Powerbook and Dell D600 and have never gone back or felt the need to try anything else. The only thing that’s been annoying me is when I click on mailto links, it tries to open the Mozilla mail program (composer). I’ve searched the “Preferences” window repeatedly for a setting to “Use the system default mail program”. Tonight I finally decided to search Mozilla’s site, figuring at least a few other people have found this annoying. Sure enough I found the solution. Now my web browsing world is perfect.

Mozilla also comes with a built-in Javascript Debugger, very nice for a web developer. Also, since I’ve started doing full time web development I’ve gained a greater loathing for IE. The behaviour amazes and disgust me at times.

For example, today I was tweaking a page for a new site I was working on. Basically I copied a template from another of our sites and proceeded to change the graphics, menus, etc. On the top of the page there was a logo graphic 90 pixels tall, to the right was another graphic that was 70 pixels tall and another below it 20 pixels tall (all with borders=”0″). It looked fine in Mozilla, but when I checked it in IE I was stunned when I loaded the page and noticed the logo graphic had a gap on the top and bottom. I checked the other two graphics closely and they appeared to stretch from top to bottom with no gaps. I double and triple checked the graphic dimensions and img tags with no luck. I loaded the site I took the code from and everything appeared fine. I switched the graphics with those from the site that was working and the gap was still there. The code was almost exactly the same except for one thing. The site that was working used javascript for the top right image (70 pixel one) to automatically select a random picture when the page was loaded. The code looked something like this:

<script language=”JavaScript” type=”text/javascript”>

var random = Math.round(Math.random()*(4-1))+1;
document.write(’<img src=”/images/top_images/image’ + random + ‘.jpg” width=”469″ height=”70″ border=”0″/>’);

</script>

However on the new site I only had a single graphic so there was no need to use the javascript I just replaced it with:

<img src=”/images/top_image.jpg” width=”469″ height=”70″ border=”0″/>

No problem right? Not with IE. Since that was the only code difference I could see, I replaced the img tag with the following javascript:

<script language=”JavaScript” type=”text/javascript”>

document.write(’<img src=”/images/top_image.jpg” width=”469″ height=”70″ border=”0″/>’);

</script>

Reloaded the page, and suddenly the gap disappears, all is well with IE again. Strange and utterly annoying. How much time did I waste trying to figure out what was going on? TOO MUCH!!

Out of Sight

Monday, December 1st, 2003

I’ve lost my glasses. Damn.

UPDATE: 12/8/2003 I found them.