Scott Hanselman

Svchost.exe Sucks CPU and Rebulding the WMI/WBEM Repository

October 30, 2005 Comment on this post [5] Posted in Musings
Sponsored By

Lately I've been seeing one particular svchost.exe sucking CPU. There always a number of in-proc running inside of each of the many svchost (Service Host) instances. Using ProcEx, I figured out the PID of the specific instance. Then, I right clicked within ProcEx, hit Properties, and under the Threads tab noticed that wbemcore.dll was working REALLY hard.

Crap, time to re-schmutz WMI's repository. So, I stop WMI from the command line with :

net stop winmgmt

Then I deleted the Repository directory in c:\windows\system32\wbem\ then started again with

net start winmgmt

Then I re-stored/compiled all the .mof (Managed Object Format) files with a batch file containing this one line:

for %%i in (*.mof,*.mfl) do Mofcomp.exe %%i

Now I'm back in business.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Gaming at 16 by 10 on a Widescreen LCD

October 28, 2005 Comment on this post [12] Posted in Gaming
Sponsored By

I just couldn't help myself. When I found a series of "stackable coupons" for Dell.com that made the UltraSharp 2005FPW 20.1" WideScreen LCD only $394.94, including shipping, I had to act. Let me tell you, while it's a 16:10 ratio (not 16:9) you wouldn't believe the widescreen gaming joy. DVDs look nice also. The monitor also pivots and lets be see a complete 8"x14" sheet of paper within Word which makes writing prose, for me, very enjoyable.

GuildWars

Gw009

Half-Life 2 Lost Coast

D2_lostcoast0006

Now playing: Kanye West - Gone (Featuring Consequence & Cam'ron)

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Does a Type Implement an Interface?

October 28, 2005 Comment on this post [9] Posted in NDoc
Sponsored By

There was an interesting discussion on a mailing list I'm on recently, where a fellow asked: "Given a Type object representing a given class, how do you determine if that class implements a specific interface?"

To be clear, he's not asking how to do:

(C#)
if (myType is IWhateverable) { ... }

He has an object of type System.Type and he wants to see if that type is IWhateverable. He could do this:

(VB)
If myType.GetInterface("MyClass.IWhateverable") IsNot Nothing Then

But he feels, perhaps rightfully so, that the string literal stuck in there is distasteful.

One fellow said, why not run through the interfances with a helper function:

(VB)
Function IsImplemented(objectType As Type, intefaceType As Type) As Boolean
    For Each thisInterface As Type in objectType.GetInterfaces
        If thisInterface Is interfacetype Then
            Return True
        Next
    Next
End Function

The next said, why not:

(C#)
if (typeof(IWhateverable).IsAssignableFrom(myType)) { ... }

Which isn't bad, but the semantics of IsAssignableFrom are a little more "inclusive" than you might want. From MSDN:

"Returns true if the c parameter and the current Type represent the same type, or if the current Type is in the inheritance hierarchy of c, or if the current Type is an interface that c supports." 

I suggested this, which is his original idea with the string literal coming from elsewhere:

(C#)
if (myType.GetInterface(typeof(IWhateverable).FullName) { ... }

However, it's a shame there isn't a built in:

(C#)
if (myFooInstance.IsImplementationOf(typeof(IWhateverable))) { ... }

Which, arguably, would just do what the IsImplemented definition at the top of this post would do internally! :)

UPDATE: Wesner says I'm using IsAssignableFrom wrong. Yes, I think I reversed the semantics there. Fixed. It's still up in the air if it's more correct or faster as he implies it may be. Check the comments for the ongoing thread.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Infoworld SOA Executive Forum

October 25, 2005 Comment on this post [0] Posted in Programming
Sponsored By

I'll be at the Infoworld SOA Executive Forum November 7-8 in NYC. I'll be on two panels:

November 7th 3:30pm - 4:30pm - Technology: A Developer's-Eye View of the Services Infrastructure
Development is different in an SOA environment; this session explains how and why, and what the implications are for enterprise development management.

  • Moderated by Jon Udell, Lead Analyst, InfoWorld
  • Jim Culbert, VP, Engineering, Avicon Group, Inc.
  • Peter Yared, Founder & CEO, Active Grid, Inc.
  • Scott Hanselman, Chief Architect, Corillian
  • Tim Ewald, Architect, Mindreef Software
  • Furrukh Khan, Director of Technology, Collaborative for Applied Software Technology, Ohio State University

Tim'll be there, so that's cool as sparks always fly when we are chatting about angle brackets. There's some pretty interesting folks on the panel, including the former CTO of Sun's Liberty Initiative so expect some good technical fun.

November 8th 10:45am - 11:30am - SOA Application Case Studies (presentation)
In a pair of case studies from banking and health care, two practicioners roll up their sleeves and show you how they've used SOA in mission-critical situations.

  • Moderated by Jon Udell, Lead Analyst, InfoWorld
  • Scott Hanselman, Chief Architect, Corillian
  • Furrukh Khan, Dir of Technology, Collaborative for Applied Software Technology, Ohio State University

Furrukh and I were mentioned separately in a recent Infoworld article as examples of SOA in practice. We'll be presenting our thoughts on WS-* and our solutions during a second breakout on the 8th.

 

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Getting Email updates of ComputerZen.com

October 21, 2005 Comment on this post [0] Posted in Musings
Sponsored By

You may not being into the whole RSS Aggregator thing.

Some of you have asked me how you can have new posts to ComputerZen.com emailed to you.

If you WOULD like new posts emailed to you, you can using FeedBlitz. It's free, there's no spam, and you'll only get new posts posted by me.

Click Feedblitzbadge to subscribe to ComputerZen.com posts via email.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

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