Wednesday, May 31, 2006

Productivity in Java vs. Rails

I am far more productive when writing Rails code than when writing Java. I just realized that one of the reasons for my lower productivity in Java is the need to recompile every time a make a change to a page on the site. In the 15 seconds or so it takes to recompile and redeploy to Tomcat, I get bored and am apt to go check my new favorite news site, popurls, or my RSS feeds, or (less likely) post to my blog. Suddenly those 15 seconds have become 5 minutes. And this happens many times throughout the day.

With Rails, I make a change, refresh my browser, and there it is. On to the next step.

Wednesday, May 24, 2006

HTTP Authorization with Apache/FastCGI

It took me forever to figure this one out, but if you want HTTP Authentication to work with Apache 2 and mod_fastcgi, you need this in your apache conf file:

FastCgiConfig -pass-header Authorization

FastCGI doesn't pass the Authorization header by default for some reason.

Tuesday, May 23, 2006

Processes, Threads, and Ruby

While researching the best way to handle calling an external program from Ruby (and capturing stdout & stderr), I came across this post, which is a good review of how processes and threads work:

http://www.ruby-forum.com/topic/65155#75363

I still haven't figured out exactly how I'm going to do this, but I'll post it here when I figure it out. Ruby has a few different ways of opening and communicating with processes, but all seem to be lacking in some way or another. IO.popen lets you write to the process' stdin, and read from its stdout, but you can't get stderr without jumping through serious hoops (like redirecting stderr to a file and then reading the file...ugh). Open3.popen3 (brilliant naming) gives you stdin, stdout, and stderr, but the subprocess runs as a grandchild, so there seems to be no way to wait for it to finish.

Sunday, April 30, 2006

Database War Stories

There's an interesting series of posts over at O'Reilly Radar. Tim O'Reilly asked people how they were using databases in their "Web 2.0" applications (although I think the Web 2.0 part of it is for the most part irrelevant). The responses so far have made for interesting reading. So far we've heard from Second Life, Bloglines and Memeorandum, Flickr, NASA World Wind, and craigslist. One of the lessons learned is that with a high-traffic site, at some point you have to break your database up so that the "hot" data is spread across a number of boxes. This got me thinking. It should be possible to build a tool that analyzes your database usage and, given a number of slave boxes to configure as it sees fit, automatically configures masters and slaves and distributes your data across those boxes as necessary. This would not be a one-time only process either; it would continue to monitor usage and performance and adjust accordingly. Certainly not an easy task, but should be doable.

Tuesday, April 25, 2006

Bad UI in iTunes

I use iTunes both on a Mac and Windows. In OS X, Command-H hides an app, something I do so often I just do it without thinking. However, in iTunes on Windows, Control-H (aka backspace) deletes whatever object you're on, with no undo. I just deleted a playlist I had spent a long time working on and I see no way to get it back.

Why don't I at least have the option to undo? Terrible UI. Surprising that Apple of all companies made such a basic mistake.

Tuesday, April 18, 2006

Windows #2





Windows #2

Originally uploaded by bgreenlee.


Just discovered that you can blog your photos directly from Flickr, so I thought I'd test it out. Gives me an excuse to post something anyway...it's been way too long.

This is a photo of a building along the Embarcadero in San Francisco. I put up another shot from a different angle as I couldn't decide which I liked better. This one probably, but let me know what you think.

Wednesday, March 15, 2006

Amazon's new S3 Storage Service

Amazon just launched a new service, S3 - Simple Storage Service. It is a web service that allows you to store as much data as you like, with file sizes up to 5GB, and you just pay for the storage you use and the data transferred. Rates are very reasonable, too -- $0.15/GB/month of storage, and $0.20/GB in data transferred.

This is pretty interesting. It gives developers the ability to create applications requiring significant storage space without having to make a huge upfront investment in equipment and expertise. Want to write your own Flickr? Go for it. Granted, it's risky relying on a third party for a core part of your business, but you only need them until you get your million users and can get enough funding to build your own storage backend.

Google is apparently working on their own storage backend, Google Drive. It will be interesting to see how this plays out. Nothing but good news for aspiring entrepreneurs, though.

via TechCrunch