Monday, February 27, 2006

Belated Cross Country Ski Pics

These pictures are from the weekend before last when I went cross country skiing with Brenda, Marci, Suzette and Steve. We had a blast even though we were just tooling around the golf course at Homestead Resort. It was freak'n cold... about 9 degrees when we started out in the morning. And yet, by the end of the day, I had stripped down to nothing more than a t-shirt and was still sweating profusely. God I love being me :)

Winter In Utah

God bless winter in Utah. In the last 3 days, I have ridden my Harley all over Utah Valley, played a round of frisbee golf at Provo Bicentennial Park and rode my mountain bike through Provo Canyon. And all of this in FEBRUARY! It kind of makes me think twice about ever wanting to move back to Wisconsin.

Saturday, February 25, 2006

Desert Star Wars

I saw "Star Wars Episode MDCCLXXXIV - Sequel to the Prequels that were the Sequel" last night at the Desert Star theatre in Salt Lake. George Lucas, faced with declining revenue at Lucas Films and a poor public image, decides to hold a Star Wars convention in Salt Lake City (that's in Idaho right?) where he will unveil his next trilogy of films. What trilogy you ask? Well, even Mr. Lucas doesn't know... but he'll figure something out before the convention. Just then he stumbles across a screenplay written by one of his interns in the writing department.

The screenplay, written as a class project, fills in the gaps and plotholes between episodes 3 and 4 and, of course, ends with the violent, gory and long anticipated death of Jar Jar Binks. Problem solved! Add in a bunch of over-the-top special effects and ridiculous dialog and there shouldn't be any problem turning this class project screenplay into a new trilogy. The only problem is the timing. The new trilogy occurs between episodes 3 and 4. Episodes 4, 5, and 6 really should have been 7, 8 and 9. Unfortunately, it's too late to change them now. George decides to deem the new trilogy episodes 3 and 1/4, 3 and 5/8 and 3 and 7/16.

The real action of the story unfolds at the Salt Lake Star Wars convention where local Utah Star Wars fanatics (and one accidental trekkie) come to fawn over Mr Lucas and his fantasy world. As you might imagine, the intern is none to happy that Mr. Lucas stole his screenplay. Egged on by the mysterious evil emperor, he decides to take revenge on Mr. Lucas at the Salt Lake Star Wars convention. The intern, dressed as Darth Vader, kidnaps one of the convention attendees dressed as Queen Amidala and threatens to blow up the convention center with his "nu-cu-lar" device.

Will Queen Amidala be rescued by her friends, Luke, Leia and Obe Wan? Will George Lucas save the day or be exposed as a thief? You'll have to see it yourself to find out :) I love Desert Star. Most of their parodies (and this one is no exception) are kind of silly and over-the-top, but they are genuinely funny and just plain good fun.

Friday, February 24, 2006

I Can't Feel My Legs

I couldn't fight the urge anymore and rode my Harley in to work today. Yes, I rode the bike into work. In February. I know, I'm crazy :) It was a warm and wonderful 25 degrees for the 15 miles between my house in Spanish Fork and work in Provo. It should warm up to the low 50's by the afternoon and I expect that the ride home should be much more enjoyable.

Sunday, February 19, 2006

President's Day Music Picks

Here are my music picks for the weekend:
  • Matisyahu - King Without a Crown - Jewish Reggae. Gotta Love It. Master Fob, Chris, I think you would both dig this artist.
  • Daniel Powter - Bad Day - Love the video. Love the song. Holly, I think that you would like this one.
  • Erasure - A Little Respect - This song has a viral quality. I heard it in an episode of Scrubs and had to get it :) I'm warning you... don't listen to it.

Friday, February 17, 2006

Hearing Voices

Something that you have to account for in professional software development is that your software may be used by people with disabilities. Many government agencies will not purchase software that is not "508 compliant"; i.e. doesn't work well for users with disabilities. Blind computer users, for instance, use special programs that will read the text on the screen for them.

Fortunately, I don't have to write the software that reads the screen. I just need to make sure that the user interface that I design and code will work well with the screen readers. Unfortunately, it is really easy to overlook certain problems in the UI because the problems aren't visible just by looking at them. Instead you need to "listen" to the UI like a blind user would to figure out where the rough spots are.

I spent a good portion of yesterday tracking down one such bug in our address selection dialog. I installed JAWS to read the text on the screen for me as I navigated through the UI with my keyboard. It always amuses me to have my computer talk to me... although I think that it would get old really quick.

Have you ever wondered what it would sound like to send an email if you were blind? Listen to this audio clip if you would like to find out :)

Thursday, February 16, 2006

Lesbianism

I found this in the comments of someone's MySpace account and just about died laughing. Master Fob, I thought that you would particularly appreciate this :)

Monday, February 13, 2006

To My Dreamgirl Valentine

Here is a short video serenade (no barbershop, I promise) for my Dreamgirl on Valentines Day. Happy Valentines, Holly!

Sunday, February 12, 2006

Sundance


Holly and I went skiing this weekend at Sundance. Neither or us had ever been skiing before. Here are the pictures.

Tuesday, February 07, 2006

This Post Has No Inherent Purpose

This post has no inherent purpose. Rather, it serves the secondary purpose of displacing my last post, "I Feel Pretty, Oh So Pretty", from the top of my blog :) I thought the pictures were pretty funny at first, but now they are starting to disturb me a little bit.

I also noticed that none of my posts currently displaying on my front page, other than that one, have pictures of me. I wouldn't want someone incidently stumbling onto this page to get the wrong impression of me :) So, here is a picture from my snowshoeing trip last weekend to balance things out a little.

I Feel Pretty, Oh So Pretty

Don't ask...

OK, feel free to ask, just don't expect a good explanation.

Monday, February 06, 2006

Cheap Tricks in C++

I came across an interesting bit of C++ code today as I was helping a co-worker troubleshoot a compiler error that he encountered while attempting to upgrade the compiler that we use for our build process. Here is the code (which has been modified drastically for the sake of clarity):

template<class T>
void *AllocateGroup(IAllocator *pAlloc, int count)
{
  void *pData = pAlloc->Allocate(sizeof(T) *count);
  for( int i = 0; i < count; i++)
  {
    new(&((T*)pData)[i]) T();
  }
  return pData;
}

What really confused me was that we were calling 'new' but totally disregarding the result of the memory allocation done by new. It also confused me at first that we were both calling the IAllocator and using new. What was going on here? As far as I could tell we were leaking memory, except that when I examined the disassembly no 'call's were actually being made. I was confused.

T in this particular template instantiation was a MyObject. This is what the MyObject class looked like:

class MyObject
{
public:
  void *operator new(size_t size, void *p)
  {
    return ::operator new(size, p);
  }
}

The operator new had been overloaded to take a void pointer, but as far as I could tell it wasn't doing anything special with it. It was just passing it along to the global operator new. The breakthrough occurred when I realized that the global operator new does not take 2 parameters. That meant that we were overriding operator new somewhere. I did a search across the codebase and indeed found an override of operator new deep within the bowels of our toolkit. Here is what it looked like:

void *operator new(size_t size, void *p)
{
  return p;
}

What the hell? An operator new that does nothing other than return the parameter that was passed into it? And then, all of the sudden, things began to click into place. This operator new was designed specifically to do absolutely nothing. The original code in the template function actually did the memory allocation using the IAllocator and then was looping through each member of the array and forcing the constructor to be called by using this goofy no-op version of operator new.

I want to know who dreamt up this egregious hack. The funny thing is that there is a much simpler way to solve the problem with much less goofiness. If the MyObject class was modified to look like this:

class MyObject
{
public:
  void *operator new[](size_t size, IAllocator *pAlloc)
  {
    return pAlloc->Allocate(size);
  }
};

then the template function could be reduced to this much simpler and easier to understand block of code:

template<class T>
void *AllocateGroup(IAllocator *pAlloc, int count)
{
  return new(pAlloc) T[count];
}

Sunday, February 05, 2006

Music Spree

I went on a music shopping spree this weekend and picked up 4 new CD's at Best Buy on Friday night. I got:
  • Jack Johnson - In Between Dreams
  • Gavin DeGraw - Chariot
  • Jem - Finally Woken
  • Linkin Park - Meteora
Although I am happy with all my purchases, I would say that Meteora was my best buy. The sound of Linkin Park is best described as a mix between hard rock and rap. Their music tends to be a little angsty, but I've been in an angsty mood lately. They've got a beat that is addictive and I love the sampling that they do (particularly in "Lying From You" and "Nobody's Listening").

I was a little worried about the Gavin DeGraw CD. I like the songs that have been played on VH1 but I was worried that the rest of the album wouldn't be that good. I have been pleasantly surprised by the rest of the album and dig the alternate versions that come on the bonus CD.

I bought the Jem CD almost entirely on blind faith in Chris' reccomendation. After listening to the whole CD I realized that I've heard a number of the songs (or at least bits and pieces of them) before in various movies, commercials and TV shows. I particularly like the song, "They".

Tao Teh Ching

I finished reading the Tao Teh Ching this weekend while I was getting my oil changed at Expressway Lube in Spanish Fork. It could be that I just haven't attained a proper state of enlightenment but I wasn't all that impressed by the book. I felt like Lao Tzu spent as much time extolling the virtues of the Tao as he spent actually explaining the principles of the Tao.

I had an English professor in college that did the same thing. He spent half the semester talking about how much we were going to get out his class. He told us how previous students had told him that his class had changed their lives. I was excited at first. After all, if an English class could change my life for the better, then I wanted to be part of it. As the semester wore on, I began to have my doubts. If the professor was actually going to change my life before the semester ended he was going to have to eventually stop talking about how he was going to change my life and actually start teaching me something.

What I got out of the book was that the Tao was about leading a simple life and finding happiness in your everyday life. While I agree with this as a general principle, I felt like Lao Tzu took the concept too far. Here is a passage (#26) that particular disturbed me:
Therefore, the Sage, travelling all day,
Does not part with the baggage-wagon;
Though there may be gorgeous sights to see,
He stays at ease in his own home.
In my opinion, life is all about exploration and adventure and finding beauty and "gorgeous sights". To advocate not seeking "gorgeous sights" is like telling someone not to live.

Despite some general disagreement there were a number of passages in the book that I agreed with and enjoyed. Here are a couple of my favourites:

Passage #9
As for holding to fullness,
Far better were it to stop in time!

Keep on beating and sharpening a sword,
And the edge cannot be preserved for long.

Fill your house with gold and jade,
And it can no longer be guarded.

Set store by your riches and honour,
And you will only reap a crop of calamities.

Here is the Way of Heaven:
When you have done your work, retire!
Passage #11
Thirty spokes converge upon a single hub;
It is on the hole in the center that the use of the cart hinges.

We make a vessel from a lump of clay;
It is the empty space within the vessel that makes it useful.

We make doors and windows for a room;
But it is these empty spaces that make the room livable.

Thus, while the tangible has advantages,
It is the intangible that makes it useful.

Cleaning House

I didn't make any plans for today so that I could spend the day preparing my house for company later this week. About midway through the day it occurred to me why I hate cleaning so much. It's because I take about 3 hours worth of work and stetch it out over 8 hours. I get easily distracted and take lots of "breaks".

The ironic thing is that if I just worked nonstop for 3 hours I wouldn't have to set aside an entire day for cleaning. And if I didn't have to set aside an entire day for cleaning then I would probably do it more frequently. And if I cleaned more frequently it wouldn't even take 3 hours to do a thorough job of cleaning. Ah, if only I were a wiser man.

Saturday, February 04, 2006

Breakin' the Law

The law was thrice broken today on the Ohana Utah (minus Lisa) snowshoeing trip out to Stuart Falls.
  1. When we pulled onto the road that goes up to Sundance, there was a big flashing sign which read, "Chains, Snow Tires or 4 Wheel Drive is Required By Law". We kept on driving anyway.
  2. When we pulled into the parking lot above Aspen Grove we were in a U.S. Forest Service Fee Area. We didn't pay the fee*.
  3. About a half mile up the trail there were big warning signs prohibiting us from going any further on the trail under the penalty of a $1000 fine and 6 months in jail. We went anyway.
Breaking the law is cool :) The hike was awesome because there was no one else on the trail except for us. We were snowshoeing through deep, powdery, virgin snow... we deflowered the virgin snow.

* I have an annual pass but I just forgot to display it in the car before we left. We did have a ticket when we came back, but I just wrote my annual pass number on the ticket and dropped it into the pay box.

Friday, February 03, 2006

So Long Sallie Mae



Or in case you have trouble reading the small print:
Dear DANIEL L CHRISTENSEN,
Congratulations! This is your official notification that you have completely paid off the student loans starred(*) below.
Hurrah!

I actually made the final payment just before Christmas while I was in Hawaii. However, the "official notification" didn't arrive in the mail until today.

Thursday, February 02, 2006

A Poem That Doesn't Rhyme

I'm doubting my endurance.
Will I cross the finish line?
And even if I do,
Does the finish line care?