Archive for February, 2008

Better Looking in Person

Monday, February 25th, 2008

One of my favorite places to go to lunch is a Mexican joint called Efrain’s II. It is delicious and dirt cheap. An added bonus is that one of the nicest auto detailers in Boulder is in the same parking lot. So, on nice days there is usually a nice car or two out front. This past friday there were two — a Maserati Quatroporte and an Audi R8.

This was the first R8 that I have seen, and I have to say that in person the car is very sexy. From the photos, I didn’t think that I liked the blade behind the doors. This car was gold and the blade was left carbon fiber. It looked great. (Gold? Yeah, I know that the Audi site doesn’t list gold as a color option. Apparently if you can afford an R8, you can also afford a paint job.)

Was the R8 the best looking car I have seen at Bing’s?  Not by a long shot.

Site Fixed, maybe?

Saturday, February 23rd, 2008

Okay. I finally got around to getting things working on my blog. My new site uses Wordpress MU to manage my blog and a couple for friends and families — as opposed to just having a separate Wordpress installation for each person.

It took me a while to get around to fixing my mod_rewrite rules to redirect my old urls to my new urls. Hopefully it works.

RubyQuiz 136 : ID3 Tags

Tuesday, February 5th, 2008

A while back I decided to take on some of the problems from RubyQuiz.  The first one that I picked was the ID3 tags quiz.  My first attempt read in the entire mp3 to get just the last 128 bytes. 

It worked, but really rubbed me the wrong way.  I spent quite a bit of time trying to figure out how to seek to just the bit of  the file that I wanted to read in.  Unfortunately, I didn’t have much luck because I hadn’t used the more low level file IO functions.  In the end, I had to resort to the RubyQuiz solution to figure that out — but it was truly the last resort.  (So what exactly was my input…)

Here is the core of the code:

  # This is the heart of the code for reading the id3 tags.  id3 tags are stored
  #
in the last 128 bytes of the file.
  def read_id3
   
    # When writing this code, this is what caused me the most trouble. 
    #
I didn’t want to have to read in the entire mp3 to get the last 128 bytes.
    #
I knew what I was tring to accomplish, but just couldn’t nail down the .
    #  seek(offset,IO::SEEK_END) on my own.  I ended up finding
    # that code (more or less) on the ruby quiz page — not from lack of

    # searching though.
    offset = -128
    @mp3_file.seek(offset,IO::SEEK_END)
    unparsed_data = @mp3_file.read

   
    # This code is pretty straight forward, after you look at the info on how id3
    #  tags are stored.
    tag, @title, @artist, @album, @year, @comment, genre_index =
               unparsed_data.unpack(’A3A30A30A30A4A30C’)
    @year = @year.to_i
    @genre = @genres[genre_index]
   
  end

The rest of the code, genres file, test code, and a test mp3 are included in the attached zip file.  Do you use autotest?

ID3 Tags Project

Maintenance Schedules

Sunday, February 3rd, 2008

Today I was trying to figure out what car work I need to do in the near future, and realized electronic copies of my 03 WRX and 04 Jeep Liberty maintenance schedules would be useful.

The WRX one is not exactly what subaru recommends.  There are a number of maintenance tasks I prefer to do more frequently (i.e. changing spark plugs, and transmission fluids). 

WRX Maintenance Schedule (pdf)

Jeep Maintenance Schedule (pdf)

You really shouldn’t use these — you should check the manufacturers website and use the official schedules.