Archive for May, 2006

May 28 2006

Garmin Edge 205 GPS, MotionBased.com and Some Comments About Support for the Macintosh

Published by Mike Munhall under Biking, The Daily Grind

I bought a new toy yesterday: the Garmin Edge 205 GPS-enabled cycling computer. Because I decided to drop hockey during the summers to concentrate on biking, I thought it would be nice to own a cycling computer that was more accurate than my $20 cheapo and offered features that will allow me to track my training progress through the summer. I spotted the Edge 205 and Edge 305 in the local bike shop and decided that for the $100 difference, I could do without the heart rate monitor and cadence meter that the 305 offered. So, I purchased the 205 and left the shop to give a try.

The first thing I did, of course, was to learn the basic operation of the unit. I then mounted it on the stem of my mountain bike and went for a quick 30-minute ride. I can’t describe in words how awesome it was to watch all the items that the 205 was recording. No complaints about the unit. It’s fantastic.

The 205 comes with software to download the ride, analyze it, show it on a map, display graphs of pace, speed, distance, elevation, etc. This is where things got frustrating. To begin with, the software is not compatible with the Macintosh. There was no mention of this on the package, of course. Only in very small print on the back of the CD sleeve does it mention, “PC Only.” That was reason enough for me to return the unit. There was no way I was going to spend $275 for a GPS and not be able to view and save rides on the computer.

I still wanted to see wanted to see how the software worked, so before returning the 205 I decided to load the software on my work PC. And here is where I encountered my second problem with Garmin. The TrainingCenter software did not offer a way to view the ride superimposed on top of a map. Is it not reasonable to expect to be able to actually view a map within the software bundled with a GPS unit? Well, actually, you can. For another $115 you can purchase additional Garmin software that you can use to import maps into TrainingCenter. Screw that.

I supposed there must have been a way to export the rides in a manner that I could import them into some other program, perhaps Google maps. In fact, there may be something out there, but the extraordinarily thin TrainingCenter documentation certainly did not indicate so. Anyway, I did some Googling and found MotionBased.com, a web-based application that allows you to upload your GPS data for analysis, mapping and storage.

This site is hot. Although there is only partial support for the Macintosh at this time, there is enough support to get your data uploaded and use most of the features in the application. For the features that do not work in the Mac, I’ve found some interesting workarounds. Somewhere on the site they mention that they are working on full support for the Macintosh, and even better, that eventually FireFox will be the recommend browser, not IE. Joy. At the very least, MotionBased has recognized that the world is not comprised of only PC users using Internet Explorer.

MotionBased has two levels of service: free and pay. Of course I registered for the free service which has all the features I need. There are too many fun features of the site to mention. If you own one of the GPS units that MotionBased supports, its worth the time to try the application. My favorite features so far Dot Races (where you can replay separate rides on the same course to compare performance) and the export to Google Earth (which is now available in beta for OS X). It’s truly mind-boggling what you can do with web-based technology.

If I hadn’t stumbled across MotionBased.com, I would be returning the Garmin GPS today. The lack of support for the Macintosh, the poorly documented bundled software and the additional cash necessary to unlock the full potential of the software really pissed me off. Nevertheless, The Edge 205 is certainly a wonderful GPS, and MotionBased.com seems to be a better application than the bundled TrainingCenter anyway.

No responses yet

May 22 2006

Expand/Collapse Blocks Using CSS Display Property

Having to write code to different browsers and platforms is a pain in the arse. I am constantly finding myself having to write alternative versions of some JavaScript function to work with either Inetrnet Exploder or Netscrape. In some cases I have even written different versions of a function for the same browser on different platforms.

One particular problem we (the developers at CRS, my employer) have been struggling with is dynamically showing or hiding a block of HTML inside of either a <div> tag or a table row. Since our application is used primarily by PC users running Internet Explorer, we had been using something like this to dynamically expand and collapse blocks:

collapseexpande_bad.gif
[Download Snippet]

This works in Internet Explorer, but behaves strangely in most other browsers. I won’t get into the details of how each browser handles the code. What we want is a solution that works with all browsers. Right?

Right. I’m embarrassed that I dragged my feet for so long to fix this, writing stupid workarounds for browsers other than PC-IE. The problem in the code snippet above is not the JavaScript, but the block value used for the display property. For a block to expand and render properly, the value of the property should be set to an empty string in the JavaScript and in the HTML. Also, notice the difference in the style attribute of the div tag. The value of the display property is an empty string there as well, without quotes. Qualifying property values in inline styles is common but incorrect and will cause problems.

collapseexpande_ok.gif
[Download Snippet]

No responses yet

May 22 2006

The Dark Tower

Published by Mike Munhall under Books, The Daily Grind

I’m done. My journey to the Dark Tower with Roland, Eddie, Jake, Susannah and Oy is over. I reached the end of the seven volume epic at this afternoon at 4:02 p.m. while sitting on a rock in the shade at the Denver Botanic Gardens (ironically, for those that have read the books, not far from the rose garden). How long have I been reading these books? Has it really been two years since buddy Nate introduced me to Stephen King’s life work?

I’m not going to give a review of the books. That would be too much. I will say that I thoroughly enjoyed each book in the Dark Tower series even though there were a few parts of the story that could have been condensed (”and they walked through desert and walked and walked and walked and walked and…”). I’m not a big fan of Stephen King, nor do I particularly care for his writing style, but he does tell a good story. I may end up reading one or two more King books. One of the most interesting things about the series is how the story intertwines with other King novels outside of the series. That may be a reason for me to pick up another King book.

What now? Ummm… nothing. No reading for a couple days. I’m burned out and don’t want to think about it for a while.

No responses yet

May 21 2006

Drawn

Published by Mike Munhall under Chess, The Daily Grind

I was really hoping my first post related to a chess game against ZaBlanc would be glorifying a fantastic win, something I have never done against him. Instead, it's a post glorifying a fantastic game that resulted in a draw. Regardless of the players, this game was absolutely fascinating. Every position was agonizing to analyze and play and any bad move would have given the initiative to the other player. Neither player had an advantage materially throughout the game, and neither player had much positional advantage, either.

Drawn

I was playing white, ZaBlanc black. The game ended in the position in the diagram above. At this point, with white to move, king would move to f8 then black's queen to c8+. White's king would move out of check back to f7 and the position in the diagram would be repeated with Qe6+.

DrawnOne of the most fascinating aspects of the game was the fact that all the major and minor pieces on the board were captured leaving a only pawns — nearly all of them — on the board in nearly indentical structures. With one excpetion… the white pieces are slightly more advanced down the board than black's, and the opportunity for promotion is far greater.

As white, I had the initiative because of the slightly better pawn structure and I should have won the game. In fact, the analysis from ChessMaster 9000 showed that I blew a won game twice, the second one after ZaBlanc unknowingly gave me a second chance with a bad move. I promoted first and ZaBlanc promoted on the very next move. To keep the initiative in the game I needed to keep black's king in check, but I saw an opportunity to promote another pawn and left the king out of check, knowing that the initiative would shift (I thought only temporarily) to black. I never regained the initiative and black worked out a draw.

Nevertheless, neither white nor black can complain about the draw. The game was a blast and should probably be annotated and reviewed again later.

Here's the PGN:

[Event "Challenge"]
[Site "http://www.redhotpawn.com"]
[Date "2006.05.08"]
[Round "?"]
[White "BuckyKatt"]
[Black "ZaBlanc"]
[TimeControl "-"]
[Result "1/2-1/2"]

1.e4 c6 2.d4 d5 3.Nc3 dxe4 4.Nxe4 Nd7 5.Bd3 Ngf6 6.Nxf6+ Nxf6 7.Nf3 Bg4 8.h3 Bh5 9.Bg5 Bxf3 10.Qxf3 Qxd4 11.c3 Qe5+ 12.Qe3 Qxe3+ 13.Bxe3 Nd5 14.Bd4 Nf4 15.Be4 e6 16.Be5 Nd5 17.c4 Bb4+ 18.Ke2 Nb6 19.b3 0-0 20.Rhd1 Rad8 21.Rd3 Rxd3 22.Bxd3 f6 23.a3 Be7 24.Bc7 Nd7 25.b4 Bd8 26.Bxd8 Rxd8 27.Rd1 g6 28.f4 c5 29.Be4 Kf7 30.Bxb7 Ke7 31.Bc6 e5 32.g3 f5 33.b5 Nb6 34.Rxd8 Kxd8 35.Bd5 Nxd5 36.cxd5 e4 37.a4 Kd7 38.g4 c4 39.a5 fxg4 40.hxg4 h5 41.f5 gxf5 42.gxh5 f4 43.h6 f3+ 44.Kf2 c3 45.h7 c2 46.h8Q e3+47.Kxf3 c1Q 48.Qg7+ Kd6 49.b6 Qf1+ 50.Kxe3 Qe1+ 51.Kf4 Qf2+ 52.Kg5 Qg3+ 53.Kf6 Qe5+ 54.Kg6 Qe4+ 55.Kf6 Qe5+ 56.Kg6 Qe4+ 57.Kg5 Qxd5+ 58.Kg6 Qe4+ 59.Kf7 Qe6+ 60.Kf8 Qc8+ 61.Kf7 Qe6+ 1/2-1/2

No responses yet

May 20 2006

Spring 2006 Semester Grades

Published by Mike Munhall under The Daily Grind

A

Working on an undergraduate degree and working full time is tough. Nevertheless, I'm maintaining a 4.0 GPA. I earned an A in Precalculus Mathemetics this semester. Next up, Summer 2006 session: Calculus I.

No responses yet

May 13 2006

Office Prank

Published by Mike Munhall under The Daily Grind

A couple guys at the office and I took advantage of our project manager’s absense this week. Dan was in a training class for three days. When he returned, his cubicle and all of its contents was wrapped in 800 square feet of celophane and topped off with some shredded office paper.

Dan's Desk

Dan's Desk

We wrapped, quite literally, everything on his desk — pen, files, phone, mouse, monitor, everything. And most everything was individually wrapped for inconvenience.

Dan's Files

Dan's Phone

When Dan returned from the training class, he was quite surprised to find his work area in disarray.

Dan's Reaction

But in the end, everything was okay and there were was joy and laughter.

Dan's Okay

A sidenote… Dan lost three days of real work by being in training. He lost another half day cleaning up his cublicle. Then the entire company had a mandatory half day of training on Friday (another half day lost for Dan). Finally, Friday afternoon we had a massive water gun fight in the office. Dan opted out of the spontaneous activity, but wasn’t able to get any work done and left. I think he finally got frustrated with us on Friday afternoon. Bummer.

No responses yet

May 07 2006

ColdFusion Upgrade: 4.5 to MX 7.01

The last few months of my job has me focused on upgrading our ColdFusion web application servers from version 4.5 to 7.01. Skipping two full versions is a mighty leap, especially for the size of the application that is running on these systems.

We attempted an upgrade from version 4.5 to 6.1 about two years ago and it ended in spectacular failure — there were flames, loud crashes, screams, terror. That upgrade consisted of shutting down the application, upgrading ColdFusion, and turning restarting the application. That’s it. No testing, no planning, no analysis, and NO ROLLBACK PLAN.

What we experienced was scary. The JRun server would crash and restart itself after running anywhere from a few minutes to an hour or so. We were never able to identify the cause of the problem and we ended up having to shut down the entire system on a weekday afternoon to rebuild each ColdFusion server with the 4.5 version. What a nightmare. Our clients, needless to say, were not happy.

The circumstances surrounding the current upgrade attempt are much different. The business is under better managment, different lead developers (myself being one of them), and we are leveraging an Adobe Systems support plan which has benefited us with the support services of Steven Erat. Steven’s support was invaluable in overcoming our struggles with this upgrade, perhaps because it is his job to support us, or perhaps because he genuinely enjoys it. I would like think it’s because of the latter. Nevertheless, we couldn’t have done it w ithout his research and recommendations. I’m going to need to thank him once we deem the upgrade a success.

On with it, already… The big news is that we finally upgraded two servers last week with ColdFusion MX 7.01. The two servers are running in the cluster alongside eight ColdFusion 4.5 servers. Our plan is to upgrade two servers at a time until the entire system is running on 7.01.

I won’t get into the chronology of the events that got us to where we are now. Just know that it took a lot of work, a lot of people, and a ton of failure to finally get our application running in 7.01. Here’s a summary of what we found and how we fixed it.

1) URL.requestTimeout

We made several minor coding changes to our appliciation, but only one of note. In ColdFusion 4.5, the default timeout of page requests is overridden with a URL parameter (requestTimeout). Starting with version 6.1, the ability to control the timeout of page requests with the requestTimeout variable was removed (a good thing, from a security standpoint). Timeout is now controlled using the <cfsetting> tag. This was a problem for us since there are hundreds, if not thousands, of areas where we override the default timeout using the requestTimeout URL variable.

The solution to this problem was simple. We simply created a file that contains a condition that checks for the existence of url.requestTimeout and sets the requestTimeout attribute of the <cfsetting> tag if url.requestTimeout is found (the value of the attribute is set to the value of url.requestTimeout). That file is included in application.cfm if, and only if, the version of ColdFusion processing the request is 6.1 or higher. ColdFusion 4.5 cannot process the <cfsetting> tag, so the the ColdFusion version must be checked before including the file containing the <cfsetting> tag. This solutions allows the default page timeout to overridden using the url.requestTimeout variable in all versions of ColdFusion (4.5 or higher, anyway).

2) .jar File Locations

Our application is extended using Java. There are three .jar files that, for reasons that I won’t bother to explain, were placed in a subdirectory of the ColdFusion installation that we created and titled classes. We updated the classpath in ColdFusion adminstrator to point to each of the .jar files in the classes directory. This wasn’t a problem in ColdFusion 6.1, but in 7.01 we were having problems with one of the Java applications. After many hours of research, many hours on the phone with the vendor of the Java application, several failed attempts at workarounds (a wrapper class to the .jar, rewriting the ColdFusion interface to the .jar) and some conversations with Mike Dinnowitz of House of Fusion (HoF is a fair source of information for all things related to ColdFusion), another developer in our group found that all we needed to do was move all the .jar files to [CFusionMX7]/runtime/lib/ and remove the classpath entries to the .jar files. That resolved the problem.

Steven Erat confirmed this in an email and provided some additional information:

Regarding jar files, the standard location for additional jar files for a J2EE web application is WEB-INF/lib. While runtime/lib will work, that location has more visibility than is necessary.

Package visibility:
- runtime/lib: all server instances and all web applications
- runtime/servers/lib: same as above
- runtime/servers/<server>/lib: all web applications for just that instance
- runtime/servers/<server>/<webapp>/WEB-INF/lib: just that one web app on that one server instance

3) Sun JVM HotSpot Runtime Optimizer

I mentioned earlier that our original attempt at the upgrade from 4.5 to 6.1 two years ago ended in failure and rollback due to JRun repeatedly crashing and restarting. We experienced the same problem with the upgrade from 4.5 to 7.01 (although, this time we experienced the problem in our development envirnnment, not production).

90% of our time with Steven Erat was spent trying to identify why JRun was crashing and restarting. The tough part was that we were unable to reproduce the crash and didn’t have a clue how or when it would occur. Over the course of several weeks Steven had us logging every conceivable piece of the ColdFusion server. There were several paths that Steven took to try to identify the cause of the problem, all of them lead nowhere.

Finally, another developer and I noticed a pattern to the crashes and were able to reproduce the crash at will. On a hunch, Steven asked us to disable the HotSpot runtime optimizer by adding the -Xint switch to the JVM arguments in ColdFusion Administrator. We did as instructed, and our problems with JRun disappeared.

I am a little in the dark as to why turning off the HotSpot runtime optimizer works. It seems that Steven Erat was as well, although he has an excellent post that begins to shed some light on the topic.

Exception with <cfmail> Tag and Attachments

The issue we were having was an exception when trying to include an attachment in emails sent using the <cfmail> tag. We would see an error similar to this:

tried to access class javax.mail.internet.ContentDisposition from class coldfusion.mail.RFC2231Util

Well, remember the problem with the locations of the .jar files? Moving the .jar files to the [CFusionMX7]\runtime\lib problem fixed a problem with one of them. I then mentioned that Steven Erat provided to us the recommended (and standard) locations for .jar files. [CFusionMX7]\runtime\lib is not one of those locations. So, while our problem with the one of the Java applications was fixed by moving the .jar file to this directory, the problem with the <cfmail> tag was introduced by moving a different .jar file to the directory.

It was a simple case of conflicting classes with the same name; one of the .jar files that we moved to the [CFusionMX]\runtime\lib directory contained a class with the same name as a class that ColdFusion was trying to access.

The solution: put .jar files in the appropriate directories.

2 responses so far

May 03 2006

Four Reasons (and Counting) to Despise Shea Homes

Published by Mike Munhall under The Daily Grind

I try as hard as possible to avoid the use of the word hate. I try even harder to control the emotion. Right now, I am having a really hard time controlling my hatred of Shea Homes, and I'm just going to say it. I fucking hate Shea Homes, the liars that they are, and their unethical business practices.

Before Dorrie and I married, Dorrie bought a condo in Highlands Ranch, Colorado. At the time it was a good decision because she wanted to live near her sister (who also lives in Highlands Ranch), the property was a good investment, and it was close to her work. Shea Homes hyped up the place really well — great view, premium lot, little development around the property, yada, yada.

Shea Homes is a bunch of lying, unscrupulous sacks of shit. Here's why:

1) The Lot "Premium"

$5000 for this.Dorrie paid a lot of money for this condo. In fact, she paid an additional $5000 for the premium lot which promised a fantastic view of the park and, after the rest of the property was developed, a continued view of downtown. Bullshit. We knew before the place was purchased that the grocery store and adjacent businesses weren't going away, but Shea Homes was quick to promise that "the bank that will be built on the other side of the park will only be one story and you'll still have a view of downtown and the landscape around you." Yeah, right. The "one-story" bank is, technically, one story. Meaning, there is a single story for people to do their business. The actual edifice, however, is a full two stories and the damn clock tower adds an additional story to that. So much for the view. Way to spin it, Shea Homes. You got us on that one.

If you need to know the time, just give me a call. The clock shines through our windows at night. Can't miss it.

2) The "Park"

You call this a park?Ah. The park. Here's what the rest of that $5000 got us. A view of the "park", a tiny patch of concrete with some small trees, sandwiched between the "one-story" bank and the Blockbuster Video. Sure, the park itself is okay, but would you pay $5000 to be near it? Way to spin it Shea Homes. Here's five grand.

3) The "Pub"

Greast JointsWhen Shea Homes purchased the entire feckin' plot of land that is now known as Highlands Ranch, they must have decided to leave no subplot of land undeveloped. Naturally, one of Dorrie's concerns was what would be developed around the home where we were to live. On the other side of the "just-one-story" bank is a small plot for the new pub. That's right! A fantastic, friendly neighborhood pub within walking distance. Now that's something to be excited about. Well, unless Taco Bell and Long John Silver's starts selling booze, I think our pub is about to be a dream. Yeah. We're about to live next to a couple grease pits. That's certain to help our property value. Chalk another one up for Shea Homes. They have our money.  I'm sure it doesn't really matters to them

4) Shea Homes: "If It's Grass, We Will Pave It. If It's Not Grass, We Still Own It and Stay the Fuck Out."

Shea Homes Owns This

Developers can't help paving everything they can get their hands on and then selling it. I moved away from Dallas, Texas because of it. I thought that developers in Colorado were much more conscientious about that sort of thing, and I still think, for the most part, that is true. Shea Homes is the exception. And, if they don't pave it, they'll assemble a barbed wire fence around it, stick a big sign with their logo in front of it and threaten the most severe legal consequences for touching any of grass, dirt, trees, shrubs, wildlife or insects on the property. I can understand the necessity to maintain the property and prevent some yahoo from four-wheeling through it, but stamping everything with a logo and making fierce threats is a bit much. No points for Shea on this one, but they've proved themselves to be jackasses as much as they are asholes.

No responses yet