My new favorite Zen koan

 Not quite as catchy as others, but I really like it.

Today is gone.
Yesterday will be back tomorrow.

Source: Tom Hollander’s blog : The dogfood cube appears to be down

What’s a koan, you ask? Or, more to the point, what is it doing in my vocabulary? SoaP, of course.

What else do you need to know? How the snakes get on the plane, what the snakes do once they’re on the plane, who puts the snakes on the plane, who is trying to get the snakes off the plane…This is not for you to ponder. There are snakes on the plane. End of fucking story.

In fact, during the two or three days that precedes my phone call with the studio, I become obsessed with the concept. Not as a movie. But as a sort of philosophy. Somnewhere in between “Cest la vie”, “Whattya gonna do?” and “Shit happens” falls my new zen koan “Snakes on a Plane”.

WIFE: “Honey you stepped in dog poop again. “
ME: “Snakes on a Plane…”
DOCTOR: “Your cholesterol is 290. Perhaps you want to mix in a walk once in a while.”
ME: “Snakes on a Plane…”
WIFE: “Honey while you were on your cholesterol walk you stepped in dog poop again.”

You get the picture.


Making and applying a theme for your ASP.NET 2.0 site

You start out with your existing site – it has the controls you want, but not the “look and feel” (layout, colors, etc.)

You decide you want to have all the pages adopt a theme.  Ok, so no one really thinks like that.  You decide all the pages should have some common look-and-feel to them (text coloring, formatting, whatever).

The 2 things you’re most likely (IMHO) to use in the themes support are:

  1. Skins
  2. CSS stylesheets

(Yeah, I know, “CSS stylesheets” goes right after “ATM machine” and “Sahara Desert”)

First, we decide we want some CSS so we can do some formatting, set the background color, whatever.

Right-clicking on our solution node (The C:\…\WebSite1\ node) you can add a theme folder by selecting that type of ASP.NET folder to add:


Once doing so, you get to pick the name of this gorgeous new theme:

Since I have all the creativity of an uncooked S’more, I’m going with Foo

So, we have a theme, but nothing actually in it.  Since our goal is CSS, let’s add a new item

In the resulting dialog, the default is already StyleSheet, and I lazily accept the default for StyleSheet.css to be the name:

Our new CSS file opens up with an empty body tag waiting for our muse to strike:

Since I actually happen to indeed want these changes to be scoped to the body, I place my cursor after the opening bracket and hit enter.

A few things happen:

  1. The autoformatter apparently prefers MSFT-style (opening brace on its own line) over the template’s K&R style (opening brace at end of existing line) and as such, it moves the opening brace even though my intent was just to open an empty line between the 2 braces.
  2. Very nicely, the cursor is indented 4 spaces for me already.  I had spent enough time in Perl to get used to 3 spaces, but I’ve had enough 4-spaces-and-tabs-are-fully-evil Kool-Aid to be cool with this now.
  3. Since VS’s web support is all spiffy and CSS-aware (hey, it’s a CSS file, it should be), I get an Intellisense list of options for what to define here.

Since my goals are 1) centering and 2) change coloring I first go for the text-align.  After typing “te” it’s the one selected:


Since it’s already selected to what I want, I now just hit “:” to get over to the value I want to assign:

Now I can just arrow-down once (to select “center”) and hit enter:


I’m a little surprised it doesn’t enter a ; for me, but no biggie, I put one in and hit enter to get to my next setting:

This time I want background-color which is already in the viewable portion of the list, so I just arrow down a few times to get to it:

Hitting : (since what I want is selected) shows the list of options:


Since it catches my eye, I go with Fuchsia (hey, it’s fun to say, like guacamole).  This time I arrow down to it, and rather than hitting Enter (which I now know won’t put the ; in for me), I go ahead and type “;” instead to finish the line.

You get the point by now, so I finish it up with a RGB color for the text (yes, just color, not font-color, text-color or foreground-color) so our final likely-to-be-ugly CSS:

Mostly to prove a point, at this stage I go ahead and hit F5 to save, build the site, and run it under the debugger.  The first effect is that since the web.config doesn’t currently have it enabled, I get the prompt asking me if I want to enable it in the web.config

Since this post is getting kind of long already, I go ahead without debugging (“Run without debugging”).  Of course, the resulting page doesn’t look any different:

As many of you have no doubt already surmised, adding a theme to a solution doesn’t actually mean it automatically applies to anything.

While we could edit the individual pages and tell them to each use this Foo theme, that wouldn’t be overly useful for me, so I want to go ahead and set it solution-(site-)wide.  To do so, you edit your app’s web.config and specify <pages theme=”Foo” /> as part of the system.web section.

You may have noticed no web.config file listed in solution explorer – that’s just reflecting that we haven’t changed it yet – it’s still present on disk.  To get it to show up as part of the solution, we just need to “add existing item”:


Now it shows up in our solution:

Now we double-click on it to open it:

Not a lot to look at there, but we know what we want to add, so I first create an opening system.web tag (unfortunately here, the Intellisense is busted, but I know from example what I need to put in):

Now I hit enter and put in the pages tag:

Now I can hit Control-F5 (since I just want to run, not debug) to get the site to run again:


So, now the CSS is being applied, so we’re half-way home.  Now we just want to have a “skin” for the label control.  A “skin” is a (IMHO, silly) name for a default set of properties for controls.  Since the controls (in this case, labels) that I’ve already added to the site don’t specify anything besides text, they don’t have a “look and feel” about them just yet.

As others have noted, the easy way of creating a skin is to just create (in a throw-away page, or an existing page, or whatever) a control with the look-and-feel that you want, then copy it over to the .skin file and remove the id attribute (yes, that last part is very important) and any other attributes you don’t want overridden (in our case, the text attribute, since we want each label’s text to be what it is, not specified by the skin).

So I ma
ke a throw-away page and put a label in it:

So far, so good.  I hit F4 to pull up the Properties dialog so I can decide what I want to set:

Changing a random bunch of things:

Now my label still says “Label” but in a very odd way:

Well, whatever, I have the “skin” that I want for my labels.  I switch over to the “Source” view of the page to check out my asp:Label tag:

I copy the part of the source I care about (the asp:Label) for creating the skin file:

Now to create my new skin file:

This creates a skin file with the default contents:

Now we just add in the selected text of the asp:Label control from our throwaway page and remove the ID and text attributes (see above for explanation).  Obviously, now that we have our skin file created, we can delete the throwaway page as well.

Now we hit Control-F5 to run the site again and we see that both our CSS and the skins are both in effect:

Whoops – the border on the label was so ridiculously big that it covered up the normal text that was already there.  Just for a quick sanity check, I remove the BorderWidth attribute from the skin (since it’s so ridiculously large) and re-run to show the original text is still there.

There – I hope this (very simple) intro into creating a theme for your ASP.NET 2.0 app has been helpful.  It’s likely full of far too many screen shots, but you can blame OneNote and Windows Live Writer for making it far too easy for me to do this 🙂

Our online support needs to suck less

Josh stuck it out and used just our web interfaces to try and get a hotfix.  I can confirm that the phone-based support is pretty quick, but given what he went through, I’m glad I just went ahead and picked up the phone back then.

260 Minutes: Success!!! VS Launches, VB.NET projects are now more performant, and there are other side-effects I can see. 

Source: How hard is it to get a hot fix from Microsoft? It’s not easy online.

Shock and Awe – good customer service from BellSouth (yes, *that* BellSouth)

The background was that on our last phone bill we noticed $3.30 in local calls in what I now know as the “expanded calling area” (parts of Chapel Hill, Durham, etc).  BellSouth couldn’t tell us which calls they were in particular, but could take off the “expanded calling area” so those calls wouldn’t be allowed again. 

Microsoft Kid


Since we let the kids (both Sarah and Barrett) play with the phone a lot, it’s nice to have a limit on what they can do.  Since we didn’t have a long-distance carrier on the line, we didn’t think we had to worry about this at all.  Hopefully now, we actually won’t.

Dear Mr. Manning,

Thank you for contacting BellSouth regarding 919.867.5309.

I have initiated an order to remove the expanded calling area on your
line.  This should be effective by midnight tonight.  You should still
be able to call your local areas free of charge.  If you have any
problems, or this doesn’t solve the problem, please let me know, and we
can place a long distance block on your line.

Lisa Fuller
BellSouth Online Customer Care

Working on Windows

Now as I said, I know that everyone hates Microsoft. And a tech. support guy who has to deal with problems all day is the least likely person in the world to think otherwise. But an hour on the phone and he blamed every single pointless test he was doing on instability in Windows when it was fucking Dell hardware that was broken here.

But I decided not to lose my temper. So in a level voice, I explained that I was on the development team that works on Windows and while it might be form of catharsis for him to diss Windows for an hour for a problem that was not due to Windows, it was not fun for me and I just couldn’t take it anymore. I asked to talk to his supervisor or some other tech, so I could move the business along and get back to a more productive state with my Dell laptop, without having the product I worked on insulted in the process.

Ribbons are your friends

Even in our office, I got some people asking me about the O12 changes that they had heard about third-hand.  Since my own usage hadn’t seen any significant changes, I’m glad to see Jensen clearing the air and making it clear that a very small think (default minimization behavior) is all that’s being changed. 

Reality Check

So, to help set the record straight, here are the facts at the center of the hubbub:

  • As long as the Ribbon has existed, it has included the ability to minimize it; in fact, this capability was present in the very first design review we ever had. If you have Beta 2, you can press CTRL+F1 or double-click the selected tab to see this for yourself.
  • In Beta 2 the minimize state isn’t saved, and the Ribbon expands anytime you use a command with the mouse or keyboard.
  • We improved the minimize feature in the upcoming Beta 2 Technical Refresh by making the minimize state persistent; after you use a command, it returns to its minimized state.

That’s it! That’s really the sum total of the change that netted articles like “Microsoft cutting the Ribbon from Office 2007” and “Another New User Interface for Office 2007.”

Source: Jensen Harris: An Office User Interface Blog : Reality Check

Try to avoid having BOOL function parameters

If you’re making an object model or library interface of any kind, please make sure to keep this in mind.  It’s very difficult to get this one wrong, unfortunately, because when you’re designing the object model (or adding the bool param), the meaning is blatantly obvious in your own head. It can be difficult to remember that the consumers of your API won’t have the same mental mindset you do when you’re designing it, even if that seems obvious when stated as such.

Generally speaking, I believe that you should try to avoid giving functions a boolean parameter (BOOL, bool, etc.) unless the meaning of that boolean parameter is blatantly obvious.

Source: The Old New Thing : Try to avoid having BOOL function parameters