Scott Hanselman

.DOT COMMON - A Beat Poem by Scott Hanselman

July 31, '03 Comments [0] Posted in Gaming
Sponsored By

I woke up at 3am last night and wrote this Poem.  I will probably perform it at the LuvJonz at Ohm on Weds the 6th.


.DOT COMMON

We watch UPN's Fake life via a one way transmission
Oh, Those wacky girlfriends
But you are more than my friend, girl
You are my life, my wife, My only source of strife 

man and wife We fight

 But we make up, and that make-up is a wake up
Calling me to appreciate MY fate, MY life, MY wife
But Fake life calls again, this time it's a two way transmission 

UPN makes way for TCP/IP, U see I see the calls of the green screen and the..chat
You've got mail.
Maybe he's got mail, you don't.  Your male, yo' man, is on-line, on yo' time. 

The internet being a means to facilitate data transmission and exchange
At this rate he/I may be your ex ... change
Is not always for the better

slash slash, I want my HTTP-Stolen-time-back

But this Internet, this new network, isn't about you and me,
It's about me and everyone...but you' 

Xbox Live isn't Livin'
But I am Finding my Solace in the Start Menu
I'm aLive in Windows 95
The C drive affects our sex drive
Letters take my attention
Creates dissention increases contention 

Compete, take a back seat, you retreat in defeat
My computer has become my suitor
The internet my friend
We don't conjugate conjugally
We procreate minimally

And you, my mate, translate to a different state, that of
Roommate - correspondingly lightweight

Bringing together of gentle rank and file
attachments in this Global community

I'm closer to my DOT-PenPal's locale
Than friends
Shall Speak now or forever hold their peace
I'd never risk
This marriage
This earnest Endeavour
With who-so-what-ever
Till Death do us part ways
Death - The time when something ends
Our DOT com-mon law marriage

- Scott Hanselman ©2003

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

Portland Area .NET Users Group (PADNUG) - The After Party

July 31, '03 Comments [1] Posted in Musings
Sponsored By

Had a blast at the PADNUG meeting tonight.  The pizza delivery failed so we all went over to the Buffalo Gap, and enjoyed a buffet on the house.  Hung out with Rory Blyth, who is clever in person as well as in the blogosphere.  I mentioned I'd sold three Commodore 64s today (+Drives, Monitors, and a Koala Pad) and we talked about BBSes.  He also was a big BBS'er back in the day and I was completely shocked to hear that he'd heard of my little BBS...I noticed it's listed in the definitive source of BBS info, the PDX BBS List.  Either way, a bloody fine time.

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

Ridiculous MSN Messenger 6.0 Bug - anyone want to pass this on to the team?

July 31, '03 Comments [4] Posted in Web Services | Bugs
Sponsored By

Here's a particularly special bug, because this represents my FIRST experience with MSN Messenger 6.0, which I installed and my friend Adam's urging.  :)   That's Adam in the upper right corner.  What's that in the lower right corner you ask?  Well, that's not me, but a reverse image of my USB TV Tuner.  Apparently Messenger doesn't feel like enumerating the more than one video sources available on my system.  Be aware!

A picture named msn60camerabug.JPG

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

DPAPI and WindowsImpersonationContext and the one that got away...

July 29, '03 Comments [3] Posted in Web Services | ASP.NET | XML
Sponsored By

I’ve got a small C# Security Application that I’m writing an Editor for.  I was hoping to let the user run the application as whoever they choose to, and then use LogonUser to create a WindowsImpersonationContext and log them in as SOMEONE ELSE to do the DPAPI Encryption (because it will be that other use that will be decrypting the data.)

 

I’m using DPAPI with a User Store, not a Machine Store.  I’ve got a managed wrapper for DPAPI that works fine.  I’ve got a Managed “ImpersonateUser” function that returns a WindowsImpersonationContext and internally users LogonUser and also works fine.  

 

The psuedocode/gist is be basically:

 

Load App

            Do some stuff

            Load XML File

            Call ImpersonateUser (someotherguy) [succeeds and WindowsIdentity.GetCurrent().Name changes to reflect the change

            Call DPAPI to Encrypt Element Context (this works fine if I DON’T IMPERSONATE...)

                        ERROR: Win32 Marshal.GetLastWin32Error() reports “The System couldn’t find the file specified”

            Save File

            Call ImpersonationContext.Undo

Exit App

 

Apparently this is either utterly stupid of me, or noone has ever tried it.   All the doc on DPAPI is either highly theoretical “how it works internally” or very trivial “here’s how I used the Machine Store from ASP.NET  The doc on WindowsImpersonationContext is even worse.

 

Am I going to just make the user to a “RunAs” to launch my app? (which works fine, BTW)  It just would have been so nice to have a "Run As" menu item...thoughts anyone?

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

It's been one of those Old School Weeks

July 29, '03 Comments [2] Posted in Web Services | Bugs | Tools
Sponsored By

Sometimes a lot of "Old School" technology seems to pop up all at once.  It's Tuesday and already I've worked on two old school issues.  Here's what I told them and learned myself:

Viewing a PDF inside of Internet Explorer doesn't work when ActiveX is turned off in IE Security

From a user's point of view, there are two implementations of ActiveX technology in Internet Explorer: ActiveX Controls (created with an <object> tag in an HTML page) and ActiveX Documents (created when IE sees a mime/type that is handled by an registered application.)

When you open up a Word Document or a Adobe PDF and it appears INSIDE Internet Explorer that is an "ActiveX Document."   When you open up an HTML page that contains en <embed> or <object> tag that is an "ActiveX Control."

Both of these technologies, along with "Authenticode" (when a dialog pops up and warns you about downloading code, do you trust, etc.) are collectively, to the layman, "ActiveX."

When you turn off ActiveX in the IE Tools|Options|Security you are affecting ActiveX Documents as well.  If you click on a PDF and try to open it in IE, you'll likely get a blank page or a "broken window" graphic.  You'll be unable to View|Source because there is no HTML source to view!

Use of NEW on one line in Visual Basic 6 - as in "Dim oX as New Thing"

In VB6, what is the difference SPECIFICIALLY between: 

    Dim oCalcutta As FooBar
   Set oCalcutta = New FooBar

and

    Dim oCalcutta As New FooBar

 Is there a speed difference? (there doesn’t appear to be a major one) COM difference? (are internals handled differently?)

Turns out there is a difference.  (Thanks to Stephen Forte, Francesco Balena, Ralf Westphal, and especially Henrik Nielsen)

When you write code like this:

  Dim obj As New Class1
  obj.Method

Then each reference to a member such as:

  obj.Method

will be compiled to the following code (pseudo-code):

  If obj Is Nothing Then
    Set obj = New Class1
  End If
  obj.Method

This of course implies a certain performance hit – but I wouldn’t expect it to be in any way significant.

Much more important (in my opinion) is the difference in semantics (which follows from the above) between the two constructions:

  Dim obj As Class1
  Set obj = New Class1
  Set obj = Nothing
  obj.Method

and

  Dim obj As New Class1
  Set obj = Nothing
  obj.Method 

The first construction will result in a run-time error (Object variable or With block variable no set) and the second will not.

UPDATE: Some wisdom from Dan Appleman. "The reason [you're told] not to use [a Dim on one line] is that this can result in subtle bugs - especially during cleanup - when you are either accidentally recreating objects you think you cleaned up, or are referencing new objects when you accidentally cleared old ones."

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.