Archive for October, 2009

Reason #6,182 to hate Internet Explorer

The other day I wanted to make a <select /> element a little easier for my users to select multiple options.  My plan was to capture the mousedown event on the <select />, grab the target <option />, select it and then cancel the event.  All was well until I got around to testing in IE.

Guess What?  It turns out that IE doesn't do diddly with <option /> elements.  The event argument on mousedown, click, mouseup, mouseover, and any other mousing motion on a <select /> will have a srcElement property equal to the <select /> and not the <option /> LIKE EVERY OTHER BROWSER ON THE PLANET.

As a last ditch effort, I even tried to grab the element under the mouse cursor by trying "document.elementFromPoint(e.clientX, e.clientY)".  When I checked the value in the debugger, there sat the same <select /> element as before just mocking me. That's all I have.  Time to move on to more important problems. 

In summary, damn you IE and your non-standard ways.

Vado HD

The birth of my son Hudson has forced me to start taking more pictures and even get into video a bit.  I don't want to look back several years later and realize that I wished I had more media of my son.  After careful consideration, and a big thumbs up from Scott Hanselman, I decided on the Vado HD.  I've been very satisfied with this little device so far, so I thought I would share.

I knew the device was small, but I wasn't really prepared for how small it really is.  It's about the size of my iPhone but a little thicker.  It fits in my pocket quite nicely and takes video in 720p.  It has a built in usb connector and produces standard avi files that Windows 7 can view with the stock codecs.  It seems to perform well in low light.  Really, it's everything I wanted.

Here is a video I shot last night of Hudson at dusk in the kitchen with only overhead lights on. (via Facebook)

Here is a video I shot while rubbernecking a car fire after I had sat on the interstate for 30 minutes. (via YouTube)

(Apologies for the not-so-great cameraman skills.  I'm trying to get better.)

There is a newer model coming out which is about $75 more than the older model.  My link above is to the older model which is a steal at about $125 while it lasts.

Semantic Web

Over the years I've heard the phrase "semantic web" tossed around the Internet via blog posts, how-tos, and podcasts.  Even though I saw the phrase several hundred times, it just went right on by.  I mean, I know what the words say, but it actually hit home until the other day.  I was writing some angle brackets and all of a sudden I had an epiphany.

First, a quick definition of sematic courtesy of Wiktionary:

semantic: Of or relating to semantics or the meanings of words.

The application of this word to (x)html signifies defining meaning to your content. You see, (x)html is a document markup language.  It's grown over the years to accommodate changes in the web.   Some of the changes over the years have been good (like the new elements in html5) and some haven't been so good (the blink and marquee tags come to mind here). What we've been moving towards is a more clear separation of content(xhtml), design(css), and interaction(javascript).

The easiest way for me to explain semantic html is to talk about a few deprecated tags and their newer, more meaningful counterparts:

courtesy of Jesper Rønn-Jensen

courtesy of Jesper Rønn-Jensen

  • <b> is for bold.  Boldness is a visual characteristic, not a meaning. This element has been deprecated in favor of <strong>.  Even though strong is more verbose, it's easy to see in markup that this thing is important.  It's up to the designer to determine how strongness gets visualized.  It could be bold.  It could be red.  It could be red and bold.  Who cares?  Leave that to the designer. For the content creator, all that should matter is that it's important.
  • <i> is for italic.  Once again, italic is a visual style.  This element has been deprecated in favor of <em> or emphasize.  I guess emphasize is a little too long for the w3c, so I just imagine the full word is still there.  Emphasis bears more meaning than italicize.  The designer might want to emphasize you emphasis by making it 20pt comic sans with green text on a purple background.  Leave that to the designer.

You may be reading this with a "Well Duh" feeling, and that's fine.  What I'm saying isn't earth shattering.  This is just my reminder why I don't want to litter my markup with something silly like a "left" and "right" class.  If I start to want to go that direction, I just ask myself: "Self, why do you want that element floated to the right of the screen?"  Once I have that answer, I have a better class name that bears more meaning.

Pant Free Development

When my son Hudson was born, I took some time away from work to adjust to my new responsibilities.  My boss was nice enough to let me work from home for a couple of weeks following my leave so that I could ease back into the work routine.  That two weeks was the most productive and satisfying work I've had in quite some time. I may have actually even enjoyed work there for a day or so.

Auto dropping by the office

Auto dropping by the office

How was it productive and satisfying?

Being disconnected from the office physically is a magical thing.  Instead of the barrage of random phone calls and drop-by visitors I received emails.  Even though I was available via phone, most people tried to avoid calling me.  This resulted in my co-workers producing more clear and concise requests.  Those impromptu meetings invoked by phone calls and visitors really suck down productivity.  Once all of that was channeled into my inbox, I could choose when to be available and respond.

I like peace and quiet.  My lovely wife knew that I was serious about working from home so she made sure to leave me alone during the day.  The comfort and quiet was bliss compared to the normal rumblings of people in an office atmosphere.  I could actually hear myself think.  When I'm allowed to zone in on something I complete it faster and produce better work.

I borrowed a monitor from work to use at home.  Hello dual monitors!  This was my first experience with this, and I must say, it was everything Jeff Atwood promised. I didn't realize how much time I wasted during the day switching focus between visual studio, outlook, remote desktops, and browser windows.  I only had one extra monitor and my remote desktop contained my email, so I wasn't able to realize the full benefit there.  Regardless, I can see that developers need a minimum of two monitors; three would be ideal. Working back at the office with a single monitor is painful now that I've seen the light.

Hudson at Work

Hudson at Work

How was it enjoyable?

Being productive makes me happy.  Aside from that, there are many benefits I enjoyed while working from home.  I had all of the amenities my home offers and a fridge stocked full of food.  When I needed a break, I could step out of the office and socialize with my wife and play with my new baby.  Who wouldn't like that?

I have a 30ish mile commute into work that takes me though downtown Nashville.  Traffic in the morning isn't bad, but in the afternoon it sucks.  I have about a 45 minute drive in the morning and an hour or more in the afternoon.  Gas, Brake, Honk, Honk. So, imagine my delight when that 2 hours of my day just vanished.  A big part of my misery with work is my commute.  Without the drive, I was able to shift my sleep schedule forward by sleeping an extra hour in the morning and staying up an extra hour at night.  This made my non-work time more useful by giving me an extra 2 hours in the afternoon (+1 from commute and +1 from staying up late).

I wasn't bound by the normal standards a typical office environment requires, for instance, pants.  Everyday I worked at my desk in shorts a t-shirt and no shoes.  I mean, why not?  I'm always more comfy in less than business attire.  The more comfortable I am, the happier I am.  In fact, the home environment just made me feel more comfortable.  There is just something calming about being surrounded by your own stuff. Any day I can go without wearing pants is automatically a better day than most.