Scott Hanselman

Hanselminutes Podcast 161 - BBSs and Wildcat! from Mustang Software

May 13, '09 Comments [12] Posted in Podcast
Sponsored By

SmallWc4logo My one-hundred-and-sixty-first podcast is up. Scott chats with founders of Mustang Software (creators of Wildcat! BBS) Jim Harrer and Scott Hunter about the BBS era. We start at 300 baud and work our way up. Remember Hayes modems, v.32bis, Fidonet, Compuserve? This is the show for you.

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is a sponsor for this show!

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET and Windows Forms. Enjoy the versatility of our new-generation Reporting Tool. Dive into our online community. Visit www.telerik.com.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Switching my Windows 7 Boot Disk from D to C with BCDBoot rather than BCDEdit

May 7, '09 Comments [22] Posted in Musings
Sponsored By

Disclaimer: It's very likely that I have NO idea what I'm talking about. This is a blog, not a technical article or official anything. Listening to me may well kill your pet kitten and render both your computer and you personally unbootable. Run away in fear as this is all completely useless information.

I paved (reformatted and started over) my main machine, formerly named QUADPOWER, now QUADPOWER7 to use the new Windows 7 RC a few days ago. I went through the process, but wasn't really paying attention. I have a tendency to just Next>Next>Next>Finish my way through most wizards. This will likely be the death of me at some point.

Anyway, my system is a little non-standard and I had at some point a year ago switched hard drives around to make the faster one be my boot drive. I did this by changing the boot order in the BIOs.

Fast forward a bit, and today I wanted to format my DATA drive - my D: drive - and the format applet said "not so fast."

I opened up Disk Management and it showed me this...

clip_image001

Yikes! See how my D: drive is Disk 0 and is marked as System, but my C: drive is Disk 1 and marked as Boot? That means that the Boot Configuration Data (BCD) is on my D: drive. I checked my BIOs, and it turned out, in fact, that I had told it to boot of that drive. However, I'd installed Windows to the other drive and got myself into this situation:

  • Disk 0 - D: Drive with BCD
  • Disk 1 - C: Drive with C:\windows and other booty

I couldn't format D: because it was what I booted off of. Poop.

I searched around and found all sorts of hard and scary descriptions of how to fix this. Basically it boiled down to:

Approach 1: Nuclear Option. Wipe and Start Over.

Approach 2: Copy the Hidden/System Boot Manager and Boot Folder over to the C: drive and run a tool called BCDEdit to move things around in 12 short steps. ;)

This was a scary prospect for me, because from my point of view, while this was a fairly advanced operation, I just wanted to switch where the boot info comes from.

Turns out there is a new (profoundly advanced, you have been warned) command line tool called BCDBoot.

C:\windows\system32>bcdboot /?

Bcdboot - Bcd boot file creation and repair tool.

The bcdboot.exe command-line tool is used to copy critical boot files to the
system partition and to create a new system BCD store.

bcdboot <source> [/l <locale>] [/s <volume-letter>] [/v]
[/m [{OS Loader ID}]]

source Specifies the location of the windows system root.

/l Specifies an optional locale parameter to use when
initializing the BCD store. The default is US English.

/s Specifies an optional volume letter parameter to designate
the target system partition where boot environment files are

copied. The default is the system partition identified by
the firmware.

/v Enables verbose mode.

/m If an OS loader GUID is provided, this option merges the
given loader object with the system template to produce a
bootable entry. Otherwise, only global objects are merged.


Examples: bcdboot c:\windows /l en-us
bcdboot c:\windows /s h:
bcdboot c:\windows /m {d58d10c6-df53-11dc-878f-00064f4f4e08}

This means that I could type this from an Administrator Command Prompt:

bcdboot c:\windows /s c:

And BCDBoot would basically re-gen the BCD stuff I needed on the C: drive given what it knows about the C:\Windows install.

I ran it, and rebooted. I immediately went into the BIOS and changed the Boot Order so that my 300 GIG C: faster drive (the one I thought I was booting off of all the time) was my startup drive.

Now, Disk Management shows that C:\ is both System and Boot and all is right with the world.

image

More subtle awesomeness from Windows 7.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

ELMAH and Exception Driven Development FTW

May 5, '09 Comments [53] Posted in ASP.NET | ASP.NET MVC
Sponsored By

Jeff blogged last month about Exception-Driven Development. I've been using ELMAH for years and you should too. Having great instrumentation in your app is such a joy. I added ELMAH to NerdDinner and have learned all sorts of things. It's amazing that someone would care to hack a site about Nerds eating dinner, but they try.

This wasn't a hack, but a great bug found in my Nerd Dinner Mobile code that I wouldn't have thought to look for. Here I'm getting a NullReference Exception...why?

image

Well, here's the code:

private bool UserAgentIs(ControllerContext controllerContext, string userAgentToTest)
{
return (controllerContext.HttpContext.Request.UserAgent.IndexOf(userAgentToTest,
StringComparison.OrdinalIgnoreCase) > 0);
}

Of course, I'm breaking the "Law Suggestion of Demeter" with all that digging, but what's the real issue? I'm assuming that the request has a UserAgent string at all! Exactly as the YSOD that ELMAH "tivo'ed" for me above.

So I changed it to this. Yes, I know that this could all be on one line and really baroque, but I find a few more lines to be easier to read.

public bool UserAgentIs(ControllerContext controllerContext, string userAgentToTest)
{
string UA = controllerContext.HttpContext.Request.UserAgent;
if (string.IsNullOrEmpty(UA) == true)
return false;
return (UA.IndexOf(userAgentToTest, StringComparison.OrdinalIgnoreCase) > 0);
}

I likely would have never thought of this bug had I not had logs and instrumentation. A smart user could have told me, or I could have used a Unit Test Generator like Pex, OR I could have just used my head and thought of it first. ;) Assert your assumptions. I didn't, and I assumed, wrongy, UserAgent would be non-null.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 160 - JavaFX and the Web's Four Virtual Machines

May 5, '09 Comments [2] Posted in Javascript | Podcast
Sponsored By

joshua_marinacci My one-hundred-and-sixtieth podcast is up. In this episode Scott talks to Joshua Marinacci from Sun, a Staff Engineer working on JavaFX. JavaFX, along with Flash and Silverlight battle to be The VM for the Web. We chat about how JavaFX approaches things and muse on who will win the web.

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is a sponsor for this show!

Building quality software is never easy. It requires skills and imagination. We cannot promise to improve your skills, but when it comes to User Interface, we can provide the building blocks to take your application a step closer to your imagination. Explore the leading UI suites for ASP.NET and Windows Forms. Enjoy the versatility of our new-generation Reporting Tool. Dive into our online community. Visit www.telerik.com.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Don't Give Bile a Permalink - Finding Balance within The No Asshole Rule

April 29, '09 Comments [84] Posted in Musings
Sponsored By

I asked on Twitter today if it was "OK to be a dick as long as you were introspective about it?" I received a few responses, including one asking if I'd be more gender-neutral and pick a word like asshole instead. You can't please everyone. Forgive my language in this instance.

There's a lot of discussion on the Interweb right now about an individual in a technical community who used some imagery in a technical presentation at a technical conference that could be described as gender-insensitive. That's a Politically Correct way to say it. Another way to say it is that a guy used a porn metaphor and soft-core porn imagery in a technical presentation in front of a gender-mixed technical crowd.

Boiled down, the issue ultimately was not just about the images as it relates to gender, but rather that the images and the presentation metaphor was simply in poor taste. Certainly, taste in this context is subjective, but it's easier than you think to find the limits of good taste.

Dana Jones had this very erudite comment on a Rails mailing list:

Imagine a presentation about recruiting developers for your firm with the analogous presentation: "Big Game Hunting", replete with pictures of dead animals smilingly displayed by the hunters who killed them. Hunting is a perfectly legal sport and one which I personally have no objections to (just as I have no objections to porn), but do graphic images that will likely disturb at least *some* audience members really have a place?

What about a presentation about writing code on deadline: "Delivering Like a Birth Mom." Or how about graphic images of up-close breastfeeding in a talk titled "Nursing Your Projects Along."

These parallel theoretical presentations of Dana's brilliantly provide the boundaries of good taste vs. poor taste in this context. "I know it when I see it" is a truism. But with all subjective opinion, one man's norm is another's outlier.

That technical community is discussing the issue and working it out. One of the related posts by DHH, the creator of Ruby on Rails - but not the presenter in question - had an interesting post called "I'm an R-rated individual." It's basically a disclaimer/declaration that he's loud and proud and may offend. Some folks believe Rails.equal?(DHH) but that's of course, short-sighted.

This paragraph of David's post is excellent:

Blending like this isn't free. You're bound to upset, offend, or annoy people when you're not adding heavy layers of social sugarcoating. I choose to accept that trade because my personal upside from congruence is that I find more energy, more satisfaction, and more creativity when the bulls**t is stripped away.

A lot of people are talking about personal brand and "image management" right now, and it's easy to say, "oh, so-and-so is a jerk." and write them off. The reason that paragraph is so insightful is because DHH expresses two things. One, he consciously chooses his path. +1 Wisdom there. And Two, he realizes there are consequences...it "isn't free." +2 Introspection. Like a guy/gal or not, but give them credit for deciding to be someone. Feel bad if someone is a jerk and doesn't realize it. I thinking living consciously and unapologetically is to be commended.

DHH's path is not for everyone. It's not for me. I believe one should avoid being overtly offensive whenever possible and appropriate, public or private. I expend a some amount of effort being a consensus builder (perhaps because I'm an ENFJ and DHH is, I'm guessing, likely an ENTP) and I think one can be real without being rude. I encourage others to do the same.

However, it depends on what you feel strongly about and if what you feel strongly about outweighs what you believe others might feel. You need to be yourself, but you there ARE social norms, and others feelings, that should be considered.

@mstum on Twitter said: I'd rather have honest f-bombs than gentlemen hypocrites... Honest and direct people are so much easier to work with.

But can't one be an honest gentleman? Why is online (or offline) use of the F-word and general crassness somehow exemplary of "honesty?" If someone swears and slams their hand on a table in a business meeting I don't immediately think "Whew, finally an honest person!"

Being generally pleasant and helpful isn't sugarcoating, it's being pleasant and helpful.

@David_Ing said: Different worlds I guess. Reminds me of high school. Makes me feel old. Edgy douche is the new cool.

So where does it stop?

I had this conversation with Ade Miller on Twitter:

This may be a generation gap. I'm in my mid-30s and "social internet culture" for me doesn't automatically involve ending online arguments via reductio ad Hitlerum (Godwin's Law). Young people today (get off my lawn!) are largely more comfortable being unapologetically themselves online. I'm of a slightly older Internet generation that doesn't believe everyone is a unique snowflake and that if everyone behaves with a "this is me, like me or leave me alone" attitude then anarchy (ahem, or the internet) will emerge.

People believe strongly about some things and less strongly about others, and you'll never get everyone to agree. I certainly don't promote being a push-over. If something is an injustice, then, by all means speak up. There are some folks in the .NET community that people consider abrasive or have written off as jerks. But see it from their perspective! For them, there is a great injustice, or a number of them, and social norms be damned! I deeply respect this perspective.

For example, my wife is Black. If I post pictures of my wife on my blog, I risk alienating racists and folks against interracial marriage. However, that's a risk (hopefully small) that I'm willing to take, as I certainly feel strongly about it and I think I'm on the right side of history. I'm also a diabetic and I don't hide it. These are stands, small or large, that I'll take, as they are important to me.

You might knee-jerk and think that's a trite example. You might say "we're all too Politically Correct." This might be a true, but just because you want to avoid being Politically Correct doesn't mean you should email me and say, "Hey, how's your Black Wife? How's Diabetes sucking for you? Still blind?"

A question on code comments showed up on StackOverflow this week, and the most highly-voted answer included the F-word. An "Edit War" ensued, with members of the community switching a code sample back and forth between the actual F-word, and various other forms like F*ck, Frick, and Foolish.

I swear occasionally. I can appreciate the F-word as appropriate punctuation while simultaneously realizing its crassness. I don't typically swear in meetings. It's conceivable I would if I could find the right situation. Most everyone who speaks English realizes that the N-word is off limits. Americans also have other words that we Just Don't Use, although the British do. Using them in a meeting is certain death.

The point is that NOT using these words doesn't fundamentally make my life worse. DHH says:

"I find more energy, more satisfaction, and more creativity when the bulls**t is stripped away."

I respect that, and good for folks who agree. I respect everyone's right to say what they like.

If you're a nudist and you give your technical talks on C# naked, I likely won't be there to watch your talk. You may feel REALLY strongly about nudism, and I wish you well. You may believe in the legalization of drugs and prefer to give your technical presentations high, and I say, kudos, but I and others may not show.

There are some social norms, and you should know what they are and know how strongly you feel about them when you take your message to a larger audience. Know that there are consequences when what you value is broadcast in a larger context while promoting a technology. I've lost readers who have said I don't do enough deep technical content, or they find my "intensely personal" posts off-putting, but I'm conscious of my decisions and I feel strongly about the things I choose to discuss on my blog.

I respect DHH's perspective and others like him. Some are concerned that some edgy attitudes are preventing female programmers from embracing programming as a vocation. DHH says:

"You certainly have to be mindful when you're working near the edge of social conventions, but that doesn't for a second lead me to the conclusion that we should step away from all the edges. Finding exactly where the line goes — and then enjoying the performance from being right on it — requires a few steps over it here and there."

Again, another paragraph with layers. He knows where the edge is, enjoys dancing on the precipice jumping back. To dismiss him as merely loud and obnoxious is to do him (and people like him) a disservice.

I have set a level of what I consider reasonable professional conduct both online and offline. You should too. Know what THE edge is, know what YOUR edge is and know the effects of being near both. Decide what you feel strongly about and what you don't. Not everyone has the same norms, but everyone should know what the consequences are and measure them according to their own value system.

The advice that works for me is to avoid giving bile a permalink. Don't be a dick. If you are a dick, you don't get to complain when things go bad for you. There are consequences to all actions and they live on. They live on longer if you give them a permalink.

What do you think?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.