Thursday, October 19, 2006

IE 7 is now available for XP!  I've been using it now for a couple of months on both XP and Vista, and I think it's pretty solid.  This definitely brings IE back up to speed with modern browsers such as FireFox.  The only thing that bothers me is I can't set it up to automatically open a new tab when I type in an address.  I'm used to that behavior and I constantly clobber my tabs.  But, the streamlined interface, real tab support, and improved performance really make it good.  It really shines on Vista.

posted on Thursday, October 19, 2006 7:46:03 AM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
 Monday, October 16, 2006

We've been going through the unpacking process all weekend.  Becky did some final sweeping and stuff of the apartment and turned in the keys this morning, so we are officially "moved", although I'm sure we have weeks if not months of unpacking and organizing to do.

We originally had envisioned that it would be like Christmas, especially since we've been without these things for 2 months (wow, has it really been that long?).  As it turns out, it's like having Christmas with all presents that came from aunts/uncles.  Sometimes they're great, other times... well... it's the thought that counts.

Aside: Now, this is nothing against aunts and uncles.  I'm talking about people who love and care about you enough to give you a present.  It's just that sometimes, they're not up to speed on your interests, needs, or even age.  You're thankful for their thoughtfulness in giving, but the gift is a little "off".

For instance, sometimes you open a box and there's something you've been dying to have again (socks, underwear, your favorite blanket, etc.).  Other times, you open up a box to find the trash can... complete with all the trash that was in it prior to the move. "Hey! ... it's ... the trash can ... hmmm"

Anyway, it's an interesting experience.  I can't wait until we find the silverware.  We've been using baby spoons for just about everything.

posted on Monday, October 16, 2006 11:50:43 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Thursday, October 12, 2006

I just got back from our new place, and I couldn't be more excited.  Tomorrow, our stuff arrives and we move in.  I think the previous owners were down to the wire moving stuff out because they left alot of odd things like some clocks and their big movie screen.  They also didn't get around to vacuuming, which sucks (ha ha).

Anyway, I should be live on the net from there tomorrow since I've ensured that there is no interruption to that.  I hope to have a video tour of the place available by tomorrow evening.  Stay tuned!!!!  Mwah ha ha ha ha.

posted on Thursday, October 12, 2006 8:48:31 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Sunday, October 08, 2006

Those of you who actually visit my blog rather than just consuming my RSS feed may have noticed my new header images.  I couldn't decide which one to use, so I threw together a random image HttpHandler to serve up a random one for each request.  There are several solutions for this available, but I thought my simplistic approach might be useful to someone else.

I just named the images header-XXXX.jpg, where XXXX is a 4 digit number and threw them into a directory, and then created an .ashx file with the following content:

<%@ WebHandler Class="HeaderRotator" Language="C#" %>

using System;
using System.IO;

public class HeaderRotator : System.Web.IHttpHandler {

   static int _HighestHeader = 12;
   static Random _Rand = new Random();

   #region IHttpHandler Members

   public bool IsReusable {
      get { return true; }
   }

   public void ProcessRequest(System.Web.HttpContext context) {
      int next = _Rand.Next(_HighestHeader + 1);
     context.Response.WriteFile(context.Server.MapPath(string.Format("~/headers/header-{0:0000}.jpg", next)));
   }

   #endregion
}

And that's it. Then you just reference the .ashx file in the img tag and you get a random image every time.  The _HighestHeader number needs to reflect the highest-numbered header image.  There's lots of different ways to do that, but I felt that simplicity was important here.

I had a lot of fun creating the images.  Some of them were carefully crafted, while others were more or less "happy accidents". I'm open to more suggestions for a good "tag-line".

[UPDATE] A few of you wanted a way to see them all without wasting time fighting against statistics.  So, here's a link that will show them all.

posted on Sunday, October 08, 2006 12:23:34 PM (Pacific Standard Time, UTC-08:00)  #    Comments [8]
 Friday, October 06, 2006

With all the other language goodness we got in C# 2.0, the new ?? operator seems to have been completely overshadowed.  Those familiar with some other languages' boolean operators (like JavaScript or Ruby) that work with their notion of conditional expressions to provide a "short-circuit" operation that returns the value of the first choice that returns something "true".  C# has a more strict notion of boolean values, so cannot re-use it's boolean operators for such an operation.  But, now we have ??, which accomplishes just about the same thing for practical purposes.

?? returns the first operand that is not null.  Like || and &&, it is a short-circuit operator, so when you string it together it only evaluates until it reaches something not null.  While not as powerful as what JavaScript and Ruby provide (because types aren't dynamic), it can still simplify your code.

So, for instance if you were ever trying to provide a default output for "null" values, you could do something like:

string defaultOutput = "[Not provided]";
Console.WriteLine(name ?? defaultOutput);
Console.WriteLine(email ?? defaultOutput);

This is a simple application, but it can be used in lots of different ways, you can string it together to provide lots of different fallbacks.  It even works correctly with Nullable<T>!

How this was included without me knowing about it is a mystery. So, you might be thinking that I learned this from some internal source here at Microsoft.  Nope.  Miguel blogged about it, and had the same "how didn't I already know this" reaction that I did.

posted on Friday, October 06, 2006 8:16:10 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Thursday, October 05, 2006

Dad bundled up on a ski trip several years ago. Yup, it's that time of the year again, my dad's birthday.  This is his first birthday as a grandfather.  He's been incredibly supportive of our move even though its taken his granddaughter so far away, so I've tried really hard to keep he and mom "plugged in" with lots of video chats and such.

Here's a humorous picture of him all bundled up on a ski trip several years ago.

Thanks for always being so supportive, Dad.  I hope you have a wonderful day.

posted on Thursday, October 05, 2006 7:35:33 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Tuesday, October 03, 2006

I was walking down the halls today, and noticed a discarded bookshelf.  Since I didn't have one in my office, I thought it would make a nice addition.  I thought I should make sure it was up for grabs, so I poked my head into the nearest office and asked, "Hey, so do you know what's up with this bookshelf?"

Then, my eye caught the nameplate, and I realized that I was talking to none other than Lutz Roeder himself, creator of Reflector and other cool tools. At that point, having not prepared myself for such a meeting, I geeked out.  I don't exactly remember what I said or did after that, but I'm sure it wasn't pretty.

So, now I have Lutz's old bookshelf in my office.

[UPDATED] Added picture.

posted on Tuesday, October 03, 2006 1:21:14 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Sunday, October 01, 2006

I just upgraded my blog to dasBlog 1.9.  It has some great new features including having multiple "contributors", so who knows, maybe Becky will do a post now and again.  Let me know if something is amiss, and I'll deal with it.  Thanks Scott, Omar and team for what looks like a great release.

[UPDATE] Well, I seem to have clobbered my links and blogroll during the upgrade.  I have them backed up, but they were badly in need of updating anyway.  I'll try to get those back and updated soon.  Right now, I'm going to bed.

posted on Sunday, October 01, 2006 8:59:11 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]