Thursday, October 9, 2008

Triathlon here I come

Watching Kevin finish the Ironman in Wisconsin and following Ken's Ironman have inspired me to train for a triathlon. I'm not crazy, so I won't be aiming for an Ironman. I'm going to train for a sprint triathlon. It should be about 1/2 mile swim, a 12 mile bike ride and a 3 mile run.

It's too late to train for one this season, so I'll have to wait until next year before I can enter a race. I'm trying to get a bunch of people to do it, so if you are interested, just let me know.

I started consistently running at the beginning of last summer and I have really been enjoying it. Right now, my typical run is about 3.5 miles and I usually go 3 or 4 times a week. I feel very comfortable running, so barring injury, I don't think the run will be a problem.

All my biking is in the city, running errands, grocery shopping, going to the farmers market and the occasional recreational ride on the Minuteman bikeway. Depending on the race course, the bike portion of the triathlon may be difficult for me. I will need to train on the bike to make sure I am ready for it.

I don't have a road bike at the moment. I have a nice mountain bike for off road use and a heavy-as-a-tank hybrid bike for city use. I will have to keep my eye on craigslist to see if I can pick up a decent bike. The idea of building a road bike, including the wheels, is appealing. It could be a nice project for the winter, but it would be an expensive project.

For me, the most difficult part of the triathlon will be the swim. I can keep myself from drowning, but I am not very good at doing the crawl. I have started training for the swim portion of the race and so far I am enjoying it. I think it will be nice to go swimming in the winter when the conditions aren't favorable to running.

My next post will be my goals for the triathlon.

Thursday, September 18, 2008

Linq2Sql Designer error: Unspecified Error on table rename

At work today, we hit an annoying little bug with the Linq2Sql DBML designer in VS 2008 SP1.

When trying to rename a table in the designer, the rename would fail with the message: Unspecified Error

I found this thread on the MSDN forums and tried moving all the includes inside of the namespace (what a strange bug/fix) but that did not work.

So here is our workaround:
  1. Open the DBML file in an editor, not the designer. (Right click on the .dbml file, select "open with" and choose the XML editor.)
  2. Find the table you want to change and change the name attribute of the type element.
  3. Save your change - Visual Studio will regenerate the designer code with the new name.

Hopefully, this will save you some time if you hit the same problem.

Thursday, July 3, 2008

CSA: Week 2

On Sunday we went and picked up the 2nd week of our CSA share. Again, we got more greens, radishes, strawberries and beets.


When we pick up our share we walk down a series of tables of vegetables and get to choose which ones we want. For example, last week we were able to choose one item of each type - so they have red beets, and orange beets, and round beets and cylindrical beets. You choose what you want and shove it in your bag. (We went with the cylindrical beets and radishes this time.)

Soon they will start distributing the shares in boxes. I think most of the distribution will be done beforehand and we choose a couple items to customize our share, rather than choosing every single item. Right now, with everyone choosing every item, it takes a little while to get your share.

The share pickup location is next to our favorite bakery and it seems that most people come in twos. One person waits in the line to pick up their CSA share and one person waits in the line to get bread. It reminded me of when I was as a child, being told of people waiting in line for bread in the former Soviet Union.
It is hard to see, but there are 2 lines here. On the left is the line for the CSA. On the right is the line for the bakery.

Tuesday, July 1, 2008

CSA: Week 1

We joined a CSA this year. If you don't know, CSA stands for Community Supported Agriculture. Essentially, you pay a farmer upfront for a share of the crops during the season. You get whatever is in season at that moment. It is a good way of supporting a local farmer and eating locally grown foods.

We joined the Stillmans Farm CSA. I don't think the farm is 100% organic, but they call it "Conscientiously Grown". We signed up for a half share.

We have only had 2 weeks of crops so far, but it has been very exciting for us, since we are food nerds. I thought I would post some pictures of what we are getting. Right now the selection is a bit limited because it is early in the season.

We got radishes, beets, strawberries, chard, spinach, arugula, lettuce and some greens that I don't recognize.

I was out of town last week, so Kate had to eat all of this herself!

Tuesday, June 3, 2008

Great resource: Rob Conery's MVC screencasts.

In the past couple days I found a great series of blog posts/screencasts. They are from Rob Conery and he is posting an attempt he is making step-by-step to implement a website using the ASP.Net MVC structure with Test Driven Development.

I found it very interesting to watch him go through this. It is quite a nice break from the typical Microsoft demos which seem to be a little more marketing and less real world experience.

It is also interesting to see him code something in a different way than I might and to see how things unfold. I guess you could call it one way pair programming.

Anyway, I would suggest checking it out. Here is a link to his first post in the series:
http://blog.wekeroad.com/mvc-storefront/mvc-storefront-part-1/

And here is the list of posts in the category he has set up in his blog. You'll have to navigate back in this list to find the earlier posts:
http://blog.wekeroad.com/mvc-storefront/

I think one of the most interesting ideas I've picked up from his posts so far is the way he is composing filters using the IQueryable<> interface. For example in his data access layer, he has a method called GetCategories() that returns IQueryable. Then instead of adding a separate method to get a category by an id number, like GetCategory(int id), he creates an extension method, .WithId(int id) that extends IQueryable so the full call looks something like:
Category c = dataLayer.GetCategories().WithId(4);

And, because LINQ only executes queries when needed and these filters are part of the expression tree, the filters are reflected in the actual query that hits the database. In this example only the category with id = 4 is pulled back -- the filtering is done at the query level.

It is a very interesting approach. It cleans up the LINQ code a bit and makes it quite readable. I'll have to fool around with the idea in my own code to see how I like it. You can see some of the filter code here.

If you have some time and you are interested in the ASP.Net MVC project and test driven development/design, I would highly suggest watching his videos.

Friday, May 9, 2008

Review: Enjoy Barcelona apartment: "The Amparo"

A couple weeks ago, we went to Spain on vacation. For the first week we rented "The Amparo" apartment from Enjoy Barcelona in the Barceloneta section of the city.

The week in Barcelona was a lot of fun, but our apartment was not what we thought it would be. The website lists the apartment with 3 stars - I think that is way too generous. Also, the pictures on their web site are a bit misleading.

The apartment was dirty, smelled of sewer gases and was quite a bit run down. The toilet top was broken. The bathroom sink and shower were very slow to drain. Floor tiles were popping up in the kitchen. The kitchen was not properly stocked with pots and pans. There were cigarette ashes in the silverware drawer. The sheets were clean, but the blankets smelled. In one room the curtains had fallen off the window and were shoved behind the door.

It was basically the same level of accommodation as a one star hotel or a hostel, maybe a little worse.

I think this apartment was overpriced for the condition it was in. It is quite unfortunate because the apartment is in a great location, and with a little work the place could be great.

I would not stay in this apartment again, and I don't think I would use Enjoy Barcelona again. Their employees were friendly, but I think they are misrepresenting this apartment.

One good thing that came out of the apartment was that every place we stayed in afterward seemed like luxury. ("These blankets don't smell like body odor! Wow, how fancy!")

Monday, April 21, 2008

Bad picture of Lance in the Boston Marathon

I went to the Boston Marathon today and I took this horrible picture of Lance Armstrong. You have to look really closely to find him. He was running in a pack of people and I couldn't pick him out in time to get a good photo.