Scott Hanselman

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

XBox Live v2

November 9, '03 Comments [2] Posted in Gaming | Africa
Sponsored By

I switched on the XBox yesterday for the first time in a few months and was greeted with the new XBox Live version 2 upgrade.  Sweet.  Then I was presented with my list of online friends. Zero.  I have no online XBox Friends.  Thought I did, but no. :) 

If you're on XBox Live, and you're reading this blog, we have at least that in common.  Clearly you are my friend, or a spy.  My XBox Live GamerTag is “Glucose”.  If you see me online, please do threaten to crush me in any XBox game.

P.S. As an aside, I was throughly disappointed in the XBox Music Mixer.  It promised to let me listen to my MP3s via a connection to my main server, as well as watch slide shows.  Well, it DOES do that, but it requires me to run a Wizard on my main server, I add my pictures, then it counts done from 5:00 minutes.  At this point, I'm expected to RUN down to my XBox and run the associated XBox Music Mixer wizard and TRANSFER (that's right, COPY) my pictures/music to the XBox's paltry 8 gig drive.  Not exactly something you want to do when your guests are over and dying to see your pictures of Malaysia or Zimbabwe. 

I can only assume the did it this way to keep XBox hackers from taking any real-time transfer capabilities and defeating them, thus introducing “XBox Napster.“ (which is basically what I wanted, XBox Napster within my own subnet.)

Regardless, this is Glucose signing off.  See you online!

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

StringBuilders vs. String Concatenation

November 8, '03 Comments [0] Posted in Programming
Sponsored By

Some folks have said (you've heard them in the halls), “Oh ya, you should NEVER use String Concatenation, dude, use StringBuilder...ALWAYS.  Totally.”

Rico weighs in on this, and he's right on (emphasis mine):

I tend to give advice like "Many users find Stringbuilders useful for their concatenation pattens, consider using them and measure to see if they help you".  Wussy but safe :)

Big string -> small appends
It's substantially likely that appends will fit in the slop and so they're fast, this is the best case (buffer size becomes double the string when it no longer fits so on average the slop is half the current string length) (if there are lots of small appends to a big string you win the most using stringbuilder)

Big string -> big appends
While the string is comparable in size (or smaller) to the appends stringbuilder won't save you much, if this continues to the point where the appends are small compared to the accumlated string you're in the good case

Small string -> big appends
bad case, string builder will just slow you down until enough slop has built up to hold those appends, you move to "big string big appends" as you append and finally to "big string small appends" if/when the buffer becomes collossal

Small string -> small appends
could be ok if you had a good idea how big your string was going to get and preallocated enough so that you have sufficient slop for the appends. You might be able to do better if you just concated all the small appends together in one operation.

It's very hard to say which is faster/smaller in general... it's all about the usage pattern. [Rico Mariani]

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

Measure twice, cut once...CLR Profiler 2.0

November 8, '03 Comments [0] Posted in Programming | Tools
Sponsored By

I see from Jan Gray's blog that the CLR Profiler (now 2.0) distribution has been updated.  You can  download CLR Profiler 2.0 here.  It just keeps getting better.  Kudos to Peter Sollich, the author.

We've just updated the CLRProfiler distribution. Once again, we're shipping both the source and the prebuilt binaries, and this time we're delighted to include a terrific ~100 page tutorial and reference manual written by the tool's author, Peter Sollich.

I think this new documentation greatly enhances the power and utility of the profiler by demonstrating how to use its features more effectively -- for example, how to diagnose a memory leak. [Jan Gray]

If you've been writing .NET code willy-nilly for the last few years and haven't profiled, try it.  There are lots of “for $” profilers out there, but this one (in previous versions) have helped us find memory leaks and all sorts of other weirdness. 

Also, familiarize yourself with Gregor Noriskin's article on MSDN: “Writing High-Performance Managed Applications : A Primer.”  He discusses the CLRProfiler and oodles of other good things.  His MSDN TV show on Code Optimization is also good.  Additionally Jan and Rico Mariani have a site up on GotDotNet dedicated to Managed Code Performance.

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.