My current infatuation with cycling

I have a confession to make. I’ve been obsessed with bikes lately. I’ve spent hours researching various types of bikes, different brands, etc.

I loved riding my bike when I was a kid. I have many fond memories of bicycles: riding my tricycle, then upgrading to a BMX bike with training wheels, then having the training wheels finally taken off, upgrading to a full-sized bike, getting my first nice “bike-store/non-department-store” bike, taking my bike to college with me and riding around Cleveland, etc.

I’ve lived without a bike for about six years now–so what triggered my current infatuation with bicycles? I went out to Portland, Oregon recently for a business trip and loved how there were so many cyclists. I also stopped by Seattle during that trip and noticed there were a lot of cyclists there too. It made me wish that I could live in a place where I could (safely) commute to work by bike and easily go on recreational rides on the weekends.

Unfortunately, NYC is not a great place for cycling unless you’re hard-core (which I am not). While drivers in NYC are not as bad as Boston, there are a lot more of them and they tend to drive faster. Another factor is that public transportation is so good in NYC that unless you really want to cycle for the sake of cycling, there is no efficiency benefit in cycling to work. I can get from my apartment in Astoria to my office near Times Square in 30 minutes, door to door. It would probably take at least as long to make that commute on bike. $81 for unlimited monthly subway pass vs. biking+getting sweaty+risk of getting in an accident for no time savings? It’s just not worth cycling to work in NYC.

Now for other cities like Seattle and Boston, it’s a different story. Boston is a very good city for commuting by bike, primarily for one reason: public transportation in Boston SUCKS. Three examples: 1) The first company I worked for was located near Lechmere Station on the green line. I lived on Marlborough St. and Mass Ave. in Back Bay, just 3 blocks from the Hynes Convention Center station, also on the green line. The distance is less than 2 miles. Most people would think that would be a short commute, right? It took on average 30-40 minutes door to door. Why? Because the Green line SUCKS! I tried biking to work once and it only took 12 minutes. 2) The second company I worked for was located in Watertown, Massachusetts. I lived in Union Square in Somerville. I had to take 2 buses to get to work; average commute was 50 minutes, but if a bus didn’t show for some reason or something else went screwy with the bus system, it could take up to 1.5 hours. The bike commute would have been about 30 minutes. 3) The third company I worked for was located near Kendall Station and I still lived in Union Square in Somerville. The distance is about 2 miles. There were two buses that ran between those two points but they stop running at around 7pm, so if I ever had to stay at the office late or went out with coworkers, I had to walk home! Again, the bike commute would have been about 12-15 minutes.

When I was just in Seattle for a couple of days, it seemed pretty similar to Boston in that the city was pretty small (maybe sprawls a little more) and public transportation was not very good. Yes, their light rail is coming online this summer but that only benefits the small percentage of people who live along that line.

I love the idea of more people commuting by bike: it’s good for the environment and would help Americans lose weight and be more fit. I wish NYC would shut down half of Manhattan’s streets and avenues to make them bike/pedestrian only. I wish Americans would let go of their obsession with building up their mini-castles in sterile suburbia and choose to live closer together.

The practical reality is that it’s not worthwhile for me to get a bike while I live in NYC. However, when I move, one of the first things I’ll do is buy a bike! Fortunately, I’ve already done the research… it’ll be either a Brompton or a Bike Friday Tikit. :)

Best Red Velvet Cupcakes in New York

The wife and I are on a quest to find the best red velvet cupcakes in New York City. Or to be more accurate, we’re looking for one that’s better than the red velvet cupcake at Bakeway NYC in Astoria.

The most famous cupcake place in New York, Magnolia Bakery in the West Village, is WAY overrated. Almost every New Yorker I’ve discussed this with agrees that it’s overrated.

On a friend’s recommendation, we tried Two Little Red Hens in the Upper East Side. While the frosting was pretty amazing, the cake itself was not as good as Bakeway’s. I think there are two camps of cupcake aficionados: frosting and cake. The most important part of the cupcake to me is the cake, so according to my tastes, Two Little Red Hens falls short of Bakeway.

I just tried Crumbs for the first time today. Some of their cupcakes *looked* really delicious (Oreo cupcakes?!?!). Maybe their other cupcakes are better but their red velvet was extremely disappointing. Cake was not as rich and flavorful as Bakeway and frosting was not interesting at all. Plus it was $3.75 for one cupcake!

We went to Buttercup a long time ago and remember enjoying their cupcakes but we need to go back there.

For now, Bakeway NYC in Astoria is the reigning king of red velvet cupcakes in New York City.

jQuery and ASP .NET MVC: browser issues

While I’m learning Ruby on Rails during my personal free time, at work, I’m spending some time trying to ramp up on the new ASP .NET MVC framework. It might not be a good idea to try to learn two languages and frameworks at the same time but it’s tough because for personal projects, I feel like Ruby on Rails is more useful to me.

In any case, I’ve wasted a few hours trying to figure out why my jQuery AJAX method call works in IE but not in Firefox. Isn’t that the whole point of using a library like jQuery (to not have to worry about browser differences)?

In any case, after some smart Google searching, I found this post which indicated that I needed to pass in an empty value for the data parameter in the ajax method call, even if there are no query parameters:

http://encosia.com/2008/06/05/3-mistakes-to-avoid-when-using-jquery-with-aspnet-ajax/
http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/

Since most ASP .NET MVC applications will implement a REST-style URL with no query parameters, the jQuery method call made to the controller which returns the JSON object should always have a data parameter of “{}”.

Learning Ruby on Rails

As you might have guessed from my last post, I’ve finally gotten my ass in gear and am trying to learn Ruby on Rails. It’s a little rough trying to do this on Windows; it really seems like most of the serious Ruby developers are on Mac OS X. I’d prefer to be on Mac OS X but the only Mac I currently own is an old Powerbook G4 running OS X 10.3. Anyway, Windows will have to do. Netbeans actually seems to be a decent IDE for Ruby on Rails development.

I bought the Agile Web Development with Rails (Second Edition) book a couple of years ago; unfortunately, it’s based on Rails 1.x. There seems to have been a lot of changes in Rails 2.x. Scaffolding is one of the changes that beginners will run into immediately if they’re using an old book/tutorial, which this guy blogs about here:

http://davidlynch.org/blog/2008/01/rails-20-scaffolding/

This blog post is a pretty good rundown of the new features of Rails 2.x:

http://weblog.rubyonrails.org/2007/12/7/rails-2-0-it-s-done

My first “hello world” type app is going to be a simple personal library management application. Building basic CRUD functionality should be pretty straight forward, but I’m going to work on adding a feature where the user can just type in the ISBN or ASIN (Amazon.com unique product identifier), which will connect to the Amazon Associates Web Service to get other details such as author, description, publication date, etc. and fill it in automatically.

MySQL 5.1 with Rails 2.3/Ruby 1.8.6 on Windows doesn’t work

The title says it all. I wish Ruby on Rails wasn’t so difficult to get set up on Windows. It sounds like most Ruby on Rails developers are Mac OS X or Linux users.

I was just trying to get a basic app set up with MySQL 5.1, Rails 2.3 and Ruby 1.8.6 and got this error when trying to run rake db:migrate:

rake aborted!
undefined method `each’ for #

I found an answer here:

http://www.nabble.com/rake-aborted!-undefined-method-%60each%27-for–%3CMysql:-td20760472.html

Looks like most people uninstalled MySQL 5.1 and went back to 5.0. People also seemed to have better luck with Postgresql.