The Wayback machine takes me back to a day I’ll never forget

This evening, I stumbled across a review of the Internet circa 1996. It’s quite hilarious, as is the author’s blog; however, after seeing the aforementioned blog, I can’t help being reminded of the phrase, "Those in glass houses shouldn’t throw stones."

The article reminded me once again of the Wayback Machine, an archive of old web pages that makes Google look boring. I thought about looking back to some of my old web sites, including Marzie’s Toolbox, a web site which at one point sported a rather popular web-based POP3 and FTP client.

Poking around, I read the Sept 25 2001 entry, and was reminded of what I had written on this web site just after Sept 11, 2001.

I would like to extend my condolences to the casualties of the World Trade Center and Pentagon terrorist attacks, and extend thanks to the many heroic and dedicated men and women who comprise the emergency crews and fellow citizens who have pulled together in this time of crisis.

Working just twelve city blocks from the World Trade Center, passing through it every day on my way to work, and having friends and family who work in and around the area, this tragedy was felt in many ways. I’ll never forget the scene of the WTC, which is in plain view from the street outside my building; I’ll never forget the sight of the second plane crashing into the building, which I was eyewitness to while talking on the cell phone with a friend who works on the 103rd floor of the WTC – a gentleman who was lucky enough to wake up late and didn’t get into the office yet (he’s lucky to be alive and home this evening). Sadly, many thousands of others will not be so lucky.

Walking through the dust-strewn streets of downtown Manhattan, the scene was surreal. Normally noisy and bustling with traffic, the streets were crowded with melancholy pedestrians, and the only traffic was from emergency vehicles. One man was offering $500 for any passing car to drive him to Boston. Two women came out with gallons of water in a shopping cart, which they offered free to passers-by. When I asked her why she’s doing this, she responded, "It’s the only thing I could think of to do to help."

Personally, I’m glad I donated blood (for the first time) on Monday morning; if they’d let me donate again today, I would. I’ve been calling the local police precinct for hours to see if they need volunteers; I can’t even get someone there to answer the phone.

If you live in the New York area, please visit your local hospital to donate blood – it is sorely needed. If you’re a medical or emergency specialist, you can donate your time, which is desperately needed to relieve the thousands of exhausted emergency personnel already on site.

In reflection of all this, there are three things I’m glad for: I’m glad I’m alive, I’m glad I contributed what I could, and I’m glad to be an American. My flag flaps proudly in the wind outside my front door this evening, and it will never come down. If they march down the streets to burn it, they’ll have to burn me with it."

I forgot about that guy and his $500 offer; I did not forget about the ladies offering water to passers-by. One thing I remember today (and didn’t mention in the above text) is the following.

While walking across town, trying to get to the east side of Manhattan — my plan was to walk across the Brooklyn Bridge and as far south as I could, eventually hooking up with my brother, who worked in Brooklyn and would hopefully be able to drive me the rest of the way home — I finally got through to my mother on my cell phone. (My mom was the first person to call me that morning, telling me that the World Trade Center was on fire.)

My mom and I had a brief conversation, and as we were talking, I was looking around at people who were trying desperately to get in touch with their loved ones. I yelled out, "Does anyone need to get a message to someone?" A few people walked over to me. They gave messages and phone numbers to my mother, who made some calls after we hung up to pass the messages along.

In light of everything that was going on that day, it was the least I could do.

CSS Friendly ASP.Net Adapter updates to GridView, DetailsView, and FormView

If you’ve used the CSS Friendly ASP.Net Control Adapters in the past, you may want to check out change set 9278, which included a number of improvements to the GridView, DetailsView, and FormView controls.

From the check-in notes:

– Major rewrites of GridView, DetailsView, and FormView walkthroughs
– FormView and DetailsView now use PagerTemplate when it exists
– FormView, DetailsView, and GridView properly position pager based on PagerPosition and Visibile properties
– Implemented GridView’s DataControlRowType.Pager instead of hard-coded CSS class (non-breaking change)

The new test “walkthru” pages are quite useful. You can now set the control options and see the results of the change immediately without having to modify the code in the ASPX file. Implementing the test pages this way made it much easier to evaluate if the control adapters were doing what they were supposed to do.

Naming CSS properties, HTML properties… and fighting five-year olds

It started innocently enough when I stumbled across a blog post over at PoshCSS, How many CSS Properties can you name in 7 minutes? Curious, I took the test.

That took me to another test: How many HTML elements you can name in five minutes? I took that test, too.

This in turn took me to the most important test: How many five year olds could you take in a fight?

Granted, that’s about 20 minutes wasted, but it sure is fun to know that a 37-year old with some martial arts experience can take on 23 five-year-olds. It was also depressing to put myself in the “36-55” age bracket.

Falling back in sync with development

I’ve been falling a bit out of sync with what’s going on in the development world lately, so to catch up I went to the web site for one of my favorite frameworks: Castle Project. Scrolling down their home page to the News & Events section, I read this:

Hey, that Brian is me! Thanks, Hammett! That little effort has since been supplanted by the far-superior online Castle API, but it was nice to see my effort was appreciated. Castle truly is a fantastic project, and the guys who work on it are among the smartest developers I’ve come across. I can only hope to reach their level of ability. However, to get there I need to exercise my development muscle more — something I haven’t done lately, because my responsibilities at my full-time job have changed to mostly systems infrastructure work. However, that may be changing soon, as my employment situation may be changing soon… but more on that, soon…

A simple asp:Repeater replacement for simple needs

How many times have you had to parse through a collection of objects, outputting nothing more than a comma-delimited list of items in the result set. Typically, you’ll do this:

<asp :repeater runat="server">
	<itemtemplate>Eval("Name")</itemtemplate>
	<separatortemplate>, </separatortemplate>
</asp>

If you were parsing a list of states, it might look like this:

Alabama, Alaska, Arizona, Arkansas

There’s an easier way to handle these simple needs: create a CollectionToString() method. This method would accept an IEnumerable and, using reflection, read a property and return a delimited string. Of course, you choose the property and delimiter.

Note that we have two versions of this method: one which accepts an IEnumerable, the other which accepts an object. This is done to avoid the necessary typecasting in your code, since Eval() returns everything as an object.

public static string CollectionToString(IEnumerable collection, string property, string delimiter)
{
	IEnumerator enumerator = collection.GetEnumerator();
	if (enumerator == null || enumerator.MoveNext() == false)
		return String.Empty;

	Type type = enumerator.Current.GetType();
	PropertyInfo propInfo = type.GetProperty(property);
	if (propInfo == null)
		throw new Exception(String.Format("Property '{0}' not found in collection", property));

	StringBuilder output = new StringBuilder();
	output.Append(propInfo.GetValue(enumerator.Current, null).ToString());

	while (enumerator.MoveNext())
	{
		output.Append(delimiter);
		output.Append(propInfo.GetValue(enumerator.Current, null).ToString());
	}

	return output.ToString();
}

public static string CollectionToString(object collection, string property, string delimiter)
{
	return CollectionToString(collection as IEnumerable, property, delimiter);
}

This method — which I typically apply to a StringHelper class whose namespace is added to my web.config (more on that another day) — can replace the Repeater code above as follows.

<!-- you must first expose the collection to the ASPX page as a public property -->
< %= StringHelper.CollectionToString("ListOfStates", "Name", ", ") %>

A similar method could be added to a helper class in Castle MonoRail to do the same without using foreach loops in your view.

A day in the life (of me)

While trying to reduce the number of unread items in Google Reader to a sub-200 number, I came across AgileJoe‘s post, “Curious, What does your day look like?

Well, here’s my typical day:

  • 5:00AM: Wake up! I sleep with my alarm clock under my pillow so as to not wake up anyone else in the house.
  • 5:45AM: Showered and dressed (I get my stuff ready the night before to avoid turning on lights and making too much noise), I get in my car and drive to work.
  • ~7:00AM: Arrive at work. (Yes, the drive takes between 60 and 75 minutes.)
  • 7:00AM to 4:00PM: Work work work (I rarely get out at my scheduled 3:00PM).
  • 4:00PM: Drive home, hoping for the best.
  • 5:30PM: Get home (usually 60-90 minutes getting home) and spend time with my family.
  • 6:30PM: Dinner!
  • 7:30PM: Give my daughter a bath (I refuse to let anyone else do it whenever I’m home).
  • 8:30PM: Daughter gets ready for bed, and I read her books, tell her a story, sing her a song, and turn out the lights.
  • by 9:30PM: Finally able to settle down and do my own thing, which usually entails working on CSFBL, doing some side work, or playing a little World of Warcraft.
  • 11:00PM (or so): Go to bed. Rarely earlier, sometimes later (like last night, when I went to bed at 11:45PM).

And yes, your math is correct: I get between 5 and 6 hours sleep a night.

Goodbye, old friend

It was the first day of spring, 1994, when I adopted you into my family. For the next thirteen years, we were there for each other through good times and bad. Through it all, you never complained; all you wanted was to be accepted as part of the family — and in every way, you were just that.

Of course, I’m talking about my dog, Thea. To say she was a good dog is an understatement. She epitomized what a best friend is: loyal, reliable, unwavering in her commitment. She was in all ways a people dog: she was a bully around other dogs, and adored every human who crossed her path. She was a healthy, happy, active, youthful dog for a long time. Even when she was 11 years old, people would think she was a puppy.

Everything changed a year ago, when her health started to deteriorate quickly—the result of a degenerative spinal disorder. We knew then that it was a matter of time, and on October 4, 2007, that time came to an end.

Putting down a dog that is a part of your life for so long is hard; hard enough for me that I’ve rewritten this blog post three times in the past week trying to get it right. Words can’t describe what it’s like to hold your beloved family dog’s paw in your hand, petting her ears, in her final moments. I wish it ended some way other than it did, but I’m glad it ended how it did; she was comfortable, with the person she loved most. It’s hard saying goodbye; instead, I’ll say, “until we meet again.”

Thanks for everything, old friend. You’ll be missed.

Thea, my dog
Thea DeMarzo, Jan 13 1994—Oct 4, 2007

Continue reading

Verizon, where’s the customer service?

When I got home last night, I found out that I have no phone service. I did the usual — unplugged all phones, made sure everything was on the hook, checked for a dial tone using an old analog phone — and there was still no dial tone. Calling my home phone number from a cell phone resulted in ring, ring, ring… Time to call Verizon support.

After a few misdirections through the automated call screening process, I finally spoke to a human being who was able to resolve the problem. I was told a technician would come out between 2PM and 6PM the next day to troubleshoot.

The next day (which is the day I’m writing this), I received a voice mail message at a little before 2PM. It was an automated message that said something akin to this…

Hello, George… We are confirming your appointment today between 2PM and 6PM at xxyy Carlton Blvd…

Two things concerned me about this message. First, my name is Brian, not George. Second, I don’t live on Carlton Blvd (which is a block away from where I live). Sensing problems, I called Verizon to get some clarification. Continue reading

Set initial input focus the easy (JavaScript) way

I wanted a simple way to set the input focus on a web page. The use case I wanted was this:

<input ... class="focus" />

All I want to do is add the focus class to a form field. To get this to work, I whipped up a little JavaScript (using Prototype):

function setDefaultFocus()
{
	var focus = $$(".focus");
	if ( focus.length > 0 )
	{
		focus[0].focus();
	}
}
Event.observe(window, 'load', setDefaultFocus);

The result: After your page finishes loading, the first element found with the focus class will be given the focus. Done!