Scott Hanselman

.NET Rocks! - PDC Edition

November 14, '03 Comments [0] Posted in PDC | ASP.NET | Speaking
Sponsored By

Looks like the pictures and audio from the .NET Rocks Show at PDC are up.  Here's the scoop from Carl Franklin:

If you want to hear me being witty, heh, look elsewhere.  Otherwise, check out the show.  I get a few good one-liners in. :)

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

Getting Session State in HttpHandlers (ASHX files)

November 12, '03 Comments [2] Posted in ASP.NET | HttpHandler
Sponsored By

A reminder to myself and others, when you want to get access to your Session State from an ASHX or HttpHandler, you need to implement IReadOnlySessionState:

<% @ webhandler language="C#" class="DownloadHandler" %>

using System;
using System.Web;
using System.Web.SessionState;

public class DownloadHandler : IHttpHandler, IReadOnlySessionState
{
   public bool IsReusable { get { return true; } }
  
   public void ProcessRequest(HttpContext ctx)
   {
       ctx.Response.Write(ctx.Session["fred"]);
   }
}

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

But what price my soul?

November 11, '03 Comments [8] Posted in PDC | Speaking | NUnit
Sponsored By

Yes, it compiled.  It worked even.  Not only did it work, but it completely meets the client's requirements.  But somehow when I look at those particular lines of code (16 lines, in this case, with DataGridGirl's help) I wonder about the ramifications of this horrible algorithm on my immortal soul.

If you know me, or maybe even if you don't, you know that it has been said I have an overdeveloped sense of smell.  Specifically, Code Smell.  Often it's a gift and has served me well.  Other times it's a crushing weight as the schedule looms and I just have to buck and, well, write some crap.  (Of course, if it is totally with in spec, performance, it works, QA, etc, it's not crap, but you know.)

So my question to you, fair readers and fellow codesmith's, how bad do you feel when the pattern doesn't quite fit or that nested foreach/foreach/foreach nested a bit to deep? 

When do you know to let go? Some might say, “when it passes the NUnit Test!”  Others, who look at coding as much an art form as science might disagree.

I noticed a number of folks, from Don Box to Doug Purdy, at the PDC making GREAT PAINS to let the audience know that “this or that particular line of code is an abomination! Look away, look away from these alpha bits that hold all our pride and all our shame.”  I had to say I agreed with their evaluations.

What to do when you've built a great monument, but there's bird poop at the top that you're responsible for.  Does it take away from the accomplishment?

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

Looking for Photos of .NET Rocks at PDC

November 9, '03 Comments [0] Posted in PDC | Speaking
Sponsored By

If you have any GOOD photos of the .NET Rocks panel at PDC, please email them to me.

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

Emancipation...

November 9, '03 Comments [1] Posted in Musings | Tools
Sponsored By

Freed!  Free from the tyrany of the Alternate Data Stream!  If you've ever run ETrust's Anti-Virus solution and then decided to switch to another solution, you probably have a crapload of alternate data streams on your system...one for EVERY FILE.  Oy.  I've always wanted to get rid of them and never had a simple utility (or the interest to write one). 

  • Streams, a command-line utility that enumerates NTFS alternate data streams, now takes an option to delete the streams that it finds.
  • Another major Process Explorer update on the heels of v7.0 brings a slew of enhancements in addition to a more menu options: only non-zero CPU usage is displayed (you'll wonder why Task Manager doesn't do this), replace Task Manager with a new option, see interrupt and DPC time, view context switch counts, look inside .NET processes, configure highlight colors, view CPU usage in a color-coded tray icon, and much more.
  • This significant Autoruns update introduces the ability to easily delete auto-start items, a toolbar, better refresh, and more accurate path information
  • [from Sam Gentile]

Also, check out Autoruns.  You'll be suprised how much crap is set to run at startup on your system.

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.