Tuesday, May 23, 2006

I thought some others might find this useful.

I have been baffled for a few days why certain actions in an experimental Rails app would work fine in dev mode, and then give me mysterious HTTP 500 errors when deployed.  The Rails logs would tell me everything was just fine and there was no problem. But, there they were in Fiddler... status 500.  I haven't figured out how to get ahold of the Apache logs from my host yet, so they couldn't help me.

I finally set up Apache with FastCGI myself so I could attempt to duplicate the problem.  It was immediately apparent.  The Apache log was complaining about invalid headers in the FastCGI communication.  I was using "puts" to write out to the console when running in dev mode in order to quickly debug what was going on.  This works fine when using the Webrick standalone server, but FastCGI on Apache evidently uses stdout to do the communication between it and the fastcgi processes, and writing to stdout screws up that communication and Apache reports HTTP 500, even though Rails thinks everything's A-OK.

The lovely thing about Ruby is that I was able to fix it by redefining puts to do nothing.  Ideally, you ought to use the logging mechanisms, and I will.  But that made a great short-term fix.

posted on Tuesday, May 23, 2006 11:59:36 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]

Scott Hanselman pointed out a service that I am sure to get tons of use out of in the next few months.  ThanksNo.com is a polite-as-possible way to remind your friends and family that you really don't want to get all those forwarded emails, jokes, or other "non-personal" emails from them.  It does a good job of pointing out why you don't want them, which is often hard to explain.  Visit for yourself to see what I mean.  You pretty much reply to the email with a short message and the link, and hopefully the flood of "non-personal" email from people you know will cease.

This has been a huge problem for me.  I get all kinds of emails from friends and family with dozens of people copied, and with very little, if any, value.  In the past, I've dealt with them by just silently archiving them for fear that any email explaining that I didn't want that kind of email would be misinterpreted.  (Actually, maybe this blog post will do the trick.)

<Begin SoapBox>

Now all we need is a similar service for what I refer to as "corporate spam".  Why bother having any kind of intranet at all if you're going to send out 3 emails a day to every employee full of useless or redundant information?  I can understand getting the information by default, but at least let me opt-out of all but the most important emails.

And another thing.  What's will marking every email as "high importance"?  It has lost all meaning when you get an email at work marked urgent, you open it up quickly to find out what action you need to set aside all of your important work for only to find out that there is a bake sale next week.

<End Soapbox>

posted on Tuesday, May 23, 2006 9:24:23 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Friday, May 12, 2006

During the last PDC, I drooled over the announcements regarding C# 3 and LINQ.  Now we are one step closer. Yesterday, they released a new preview of those features that bind against the current version of the framework.

Skeptical language junkies* should take a gander at Don Box's latest post that attempts to explain what the big deal is. I agree with some of the people saying that the syntax really gets in the way (and I feel that way even more after spending alot of time in Ruby lately).  They need to add a language feature that indicates whether you want the lambda or the expression, then you can fall back on type inference to keep the typing to a minimum.

Overall, I couldn't be more giddy about the way integrated query works, and being able to get your hands dirty with it now is really awesome.  We're already working with data in this way in our APIs at work, so I've been able to experiment with the language and library features directly with some of our data and it's an absolute dream.  They should not wait for the next version of the framework to give us a go-live license for this.

Now, this kind of thinking needs to be applied to the web stack and MS could have a compelling alternative to Rails.

* That is, language junkies who are skeptical, not junkies of skeptical languages.

posted on Friday, May 12, 2006 11:38:07 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Tuesday, May 09, 2006

I've updated my blog's tagline (at least temporarily) to celebrate.  Halo 3 was just officially announced.  Hop over to bungie.net and check out the trailer, or download it from the XBox Live marketplace.

I simply can't wait.  I'm going to pour all my energy into building a time machine so I can travel ahead to 2007.

posted on Tuesday, May 09, 2006 1:31:41 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Wednesday, May 03, 2006

I figured out how to draw historical track log data from my tracking app onto the Virtual Earth control.  It's a pretty early implementation, but it works really well.  I'm generating transparent PNG images on the fly and using them as the content of a well-placed pushpin. Here's a screenshot:

Don't be confused.  If you've played with the VE API, you may think I'm creating a pushpin for each datapoint.  I'm not. I'm creating one image and overlaying it on the map.

Once you figure out how to take the latitude/longitude to pixel translation to the server-side, it's fairly straightforward.  The hardest part about it is geting transparent PNG images to render properly in IE.  Hilariously, my workaround currently breaks the functionality in anything other than IE.  Just stupid.

Anyway, now I have to resolve a few little issues as well as "tile" my overlays much like the virtual earth image tiles.  That should fix some of my performance problems.

[UPDATE] OOPS! Something I changed last night broke the tracker position.  Not sure where the problem is, but rest assured that I AM at work today, and not still at home.

posted on Wednesday, May 03, 2006 8:05:29 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
 Tuesday, May 02, 2006

I developed some spiffy new features last night for my GPS tracking app around MySQL's sweet spatial data extensions.  When I finished late last night, I was going to deploy the app to my hosting provider and discovered that they are currently running an older version of MySQL that does not include these features. Doh!

Anyway, I've gotten alot of cool ideas from friends for what I should do with the data.  I have in mind a service with a scope much broader than tracking my position.  More on that when I get some more of it working and get it on a real server.

posted on Tuesday, May 02, 2006 11:08:05 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Monday, May 01, 2006

I've been loving my new phone.  In an effort to fully exploit and justify my unlimited data plan, I've been dreaming up applications for it.  My latest one is something I've always wanted to do.

I hooked up a bluetooth GPS and capture my position.  Every 10 seconds or so, I send the logged data to a server.  I then have a spiffy Rails app set up to display my current location on a Virtual Earth map.  The page uses AJAX to poll the server every 10 seconds or so to update my position on the map.

I've got lots of ideas for how to mine and visualize the data, as well as provide nifty tools for my friends and family to track my location, as well as hooking the data up to my Flickr uploader (rewritten now in just about 20 lines of Ruby code) to automatically geo-tag my photos when I upload them.  I've got lots of cool things I plan to do with it while we're on vacation this summer.

I'll have live demos for the public available soon.  Some of my friends have been playing with it already as I debug it. For everyone else, here's a shot:

If you're a friend of mine and want to play with the live version, lemme know and I'll shoot you the temporary link.  Most of the time, it's pretty boring because I'm at work, but hold on to you hat when I start going somewhere.

posted on Monday, May 01, 2006 11:51:45 AM (Pacific Standard Time, UTC-08:00)  #    Comments [4]
 Friday, April 21, 2006

It's my buddy Peter's birthday today.  He's finally as old as me again.  Here he is holding Jenna for the first time, which I'm glad he got to do.

Happy Birthday, man.

posted on Friday, April 21, 2006 5:17:39 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]