« September 2006 | Main | November 2006 »

October 16, 2006

How to identify what's really running as SVCHOST.EXE on XP+

So, you're still using Windows XP and not the new Task Manager running in Vista which displays Services with meaningful names... ()

Instead you're looking at something like this in the Process tab of the Windows Task Manager:

You're wondering, like I often have: "What is this SVCHOST.EXE and why is it [fill in the blank]?"

FYI: SVCHOST.EXE is generic computer application that runs "background" computer processes. If that doesn't make any sense, just think of it as an application that helps make your computer run. Services don't directly have user interfaces -- they just run in the background, normally quiet and hopefully out of the way, but performing often critical functions that keep your computer running -- things like making your Internet connection work.

I've had plenty of occasions where a "SVCHOST.EXE" is using far too much CPU, causing my machine to slow to a crawl. Clearly a problem. But, how do I know which service is causing the problem? Elementary! (And no, you don't need to download any additional tools -- these should be available on your XP+ machine already).

Go to a Command Prompt and type:

TASKLIST /SVC /FI "IMAGENAME EQ SVCHOST.EXE"

The output looks like this:

Here's how to read it -- for each SVCHOST.EXE that is running on your machine, the PID (or process ID) is listed along with the named services running under that process. On my machine, you'll see a number of services are actually all running under the same process. Process ID 364 I see using the task manager, is currently utilizing 82 threads which explains how all of those services are actually running under the same process (and interestingly enough, it's also consuming 91MB of RAM right now).

If there's a particular SVCHOST process you're interested in, you can extend the command line easily:

TASKLIST /SVC /FI "IMAGENAME EQ SVCHOST.EXE" /FI "PID EQ ###"

Where the highlighted ### represent the process ID (PID) you specifically want. In the case above, I might have done this:

TASKLIST /SVC /FI "IMAGENAME EQ SVCHOST.EXE" /FI "PID EQ 364"

to see what services were running within the SVCHOST instance that is consuming so much memory and so many threads.

To do a final match up of the somewhat cryptic service name to something more meaningful, you'll need to go to the service browser in Windows. An easy way to get there when running XP is to click the Start menu, right click on "My Computer", and select "Manage". This opens the "Computer Management" application. On the left side you'll see a variety of locations, but in this case, you'll need the last one, "Services and Applications"

Expand that (use the +), and click on the first item, "Services".

Now comes the tricky part. You'll need to use some intuition and logic to try to match the human readable name of the service with Windows' name of the service. For example, one of the named services in the list on my computer was PID 700, BthServ. I looked through the lists of names and the most likely service was "Bluetooth Support Service." I double clicked on the entry which shows the properties for that service:

Ah ha! In this case, the "Service Name" exactly matches what I was looking for: BthServ. For further confirmation, you should double check the "Path to Executable" if you want to be more certain you've found the right service. What you want to see there is that the executable that is being run is "svchost.exe". In this case, it is. So, PID 700 is the Bluetooth Support Service. (And oddly, I don't know why I have any bluetooth support on my PC running!).

There are plenty of good sites that explain better what each service does and why you should be ABSOLUTELY careful about what you do with starting/stopping/etc services. But hopefully you now can at least more easily locate which services are masquerading as SVCHOST.EXE ....

Oh -- and if you want to just quickly list all of the running services on your machine, regardless of whether they are running in SVCHOST.EXE, just type this:

TASKLIST /SVC

This will show the all of the services without filtering them (the /FI command line switch does the filtering). If there's a N/A in the column, it's not a service (and I can't get a filter to work that removes the N/A entries...?). If you want to know more about how the services are grouped under various SVCHOST.EXE instances, go here.

Predicting failure ..., or knowing when to quit.

For an interesting read on Scott Adams' (Dilbert) approach on knowing when to quit check this out. Ignore the comments though! Seriously! People with far too much free time seem to have turned the blog comments into a full-rambling-discussion board.

To emphasize one point Scott made, it's extremely important to have that last "10%" be extremely excited about your product. Sure, the 10% may not necessarily be statistically accurate, but the idea is very important. If you don't have a truly impassioned user base for your product or service, there's a good chance it will fail. The other 90% don't matter initially -- whether they like it or not (eventually you'll need them though unless the 10% meets your goals). You need a small group, the 10%, to drive your product, help "advertise it", and much more.

Of course, getting those 10% impassioned users doesn't guarantee a success. Very little does. Without them though, .... Think about how many restaurant food chains started as a tiny place, with no goals of growing any bigger. Locals flocked to it and got excited, which got more people, and slowly the tiny restaurant grew from one location to several to many to ....

I was at an Internet startup company back in 2000 for a total of 3 months. I saw the writing on the wall when the Chief Technical Officer announced a new direction for the product company: "I'm known for taking a company, turning it on it's head and creating a whole new direction overnight...." Or some such bunk like that he said far too frequently. He decided to do this while I was there (much to my dismay). Instead of sticking with the product I had thought I was helping to build, we retargted our audience to be significantly smaller and also to a very unlikely set of adopters. That was month 2 into my long career there. By month 3 I had left (thankfully!). The company and all intellectual property was acquired a month after I left -- it was acquired for the staff, not for the product itself. He made the absolutely STUPID choice to go after a group of people, that for so many reasons, wouldn't fit our product:

  • It wasn't going to be compelling (we stripped features left and right so that we could release something)
  • It was not going to run on the computers they likely owned (we were suddenly writing Windows software for a group of users who, if they used computers at all, had Macs)
  • The users didn't need our software -- they had long standing workflows that weren't going to change to our new system without a significant gain.
  • Not a single user would adopt our technology without some sponsorship or kickback. You can't buy an impassioned user.
  • The number of total possible users dropped from literally 100's of millions to many thousands.
  • They wouldn't want to use it. (see point 1)

Ironically, if we had stuck with the original plan (the reason I had joined in the first place), we should have made it. There are plenty of web sites now 6 years later that finally do the things we had started in 2000. I was one of the lucky ones who saw the writing on the wall and left before the fall.

October 15, 2006

Software versioning gone MAD!

When did it become acceptable to consistenly release products under the guise of any of the following terms:

  • Beta
  • Release Candidate
  • Preview
  • Test
  • Developer Preview
  • Sneak Peek
  • Public demo
  • Launch Preview
  • Or any version number less than 1.0?
  • (Or combinations of the above)

What others have you encountered? Or great examples of this problem ...?

Songbird, the be-all cross-platform mash-up music player, digital jukebox, etc. (yawn!) is a product that seems to be suffering from this versionitis.

The Songbird 0.2 Developer Preview Release Cadidate 3! What a mouthful! What does that really mean? Version 0.2? No one should download a version 0.2 of any software application and expect it do anything useful. That's how software is versioned. It's well accepted in the software industry.

Unfortunately, I couldn't find any explanation from the download link that explained what I should expect in a version 0.2 Developer Preview RC3 release. If, as software developers, web site creators, etc, you don't set expectations, and people have a negative experience, it's VERY easy for your users to abandon your product for good. A negative first impression can lead to a long term negative impression of your product/company/etc.

In looking at their web site though, it's clear that much of the application is functional. So, they need to do one of two things:

  • clear up the version and who should really download this application (is this really only for developers?)
  • version it appropriately

Maybe take a more agile approach to development and set some realistic accomplishable goals and release a fully supported, non-beta version. For Songbird in particular, maybe trim a couple of features for a version 1.0 release! Keep the quality bar HIGH though! But please, don't confuse poor unsuspecting users with these terms and web site where the product looks nearly complete if it really isn't.

To be clear, I'm fine with beta products. It's one thing to release a beta/preview right before a release, but there should be limited period of time where the "beta" name is stamped and allowed. Your users need to understand the ramifications though of what it means to install or use your beta products very clearly. Especially if data loss is possible, even if the data loss is a "simple" upgrade from a final beta to the real product. Treat beta users with respect as they are your likely champions. If you wipe out their data, intentionally or unintentionally, you may lose a customer for life.

(And since operating systems are a very different beast from the 99.9% of applications most people encounter, my suggestions are still true -- although the period in which a product can be in beta may need to be longer).

October 14, 2006

Defcon from Introversion Software (UK)

It was suggested that I take a look at a new game Defcon from Introversion Software by a friend from work. I've played it once against the AI and lost miserably.

That being said, it is an interesting (albeit extremely morbid) game. The controls, while a bit touchy, are easy enough to learn and there aren't thousands of keyboard combinations that must be memorized in order to be even mildly proficient (and there is no "resource management" as is common in many real time strategy games). On my 1900x1200 screen, the game looks amazing (maybe even astonishing). The style is so simple, yet effective:

The game is set during the cold war. The premise, well, kill everyone else with nuclear weapons before they kill you. As I said, a bit morbid. A haunting music plays in the background setting the tone for a drama that can only end badly. The clock ticks down, stepping through the various Defcon states (ironically, Defcon is a United States term yet a UK company created the product!), various rules of engagement take place, from being able to place missle sites, airbases, to deploying military ships. As Defcon 1 approaches, signifying the ability to launch nuclear weapons, ships begin to skirmish, and submarines move stealthily into position. Defcon 1 hits and launches of nuclear weapons are detected:

Surface to air missles can destroy many incoming warheads, but some may penetrate the defenses. Reports of the number of causalties are displayed (along with updates to the score). There are no mobile nuclear missle trucks to manage in this game. Although they would be an interesting addition to the game, they aren't necessary as the game is still interesting. Defcon plays at either "real time" or accelerated time. I noticed I played it at 2-times normal and felt comfortable with the speed of the game (maybe I would have done better if I slowed it down though!).

As I said, the first game I played, after going through the tutorial, I lost. But I think the computer cheated at least once:

Note the location of the battleship. Normally, ships don't travel on land.... Could it be that there are some bugs in Defcon?

If you're curious as to what the full screen looks like (at HIGH resolution), I've included a couple full screen images (click on the image for a full size image):

I'll likely try it a couple of more times before it either gets shelved or purchased. If Introversion Software creates some 'mods' for it, I might be slightly more inclined to buy (other planets, space aliens, etc.).

You can download the 59MB demo here. It's $17.50 in the US for a direct download.

October 13, 2006

Friendly Reminder: Backup your data!

When is the last time you backed-up your digital photos, videos, music, documents, ...? One of my backup drives failed yesterday. Dead (doesn't even spin!) It could have been just as easily my main drive which I know I backup regularly to a secondary drive (not just a separate partition).

Older reminder to backup and more detail of my strategies.

October 12, 2006

Utah.

Tagging, circa 1881-1984:

Simple XAML Font Viewer

Admittedly, I forgot why I started writing this tiny program, so, before I put it to rest (or remember what my original goal was), I thought I'd post what little code I had for a tiny font viewer.

What's interesting about this code?

  1. The tooltip is styled. Actually, very plainly as a matter of fact, demonstrating how the pop-up can not only change dramatically, but also how it can be free of any bounds entirely (henc the see-thru look).
  2. I demonstrated how a DataTemplate can actually refer to itself (by binding the Tooltip to the current item's DataTemplate).
  3. It shows how you can bind to some simple sources without a line of code (only XAML) using CollectionViewSource.
  4. It also might help you to understand that when you bind to something like a listbox (or anything really), the Binding source doesn't go away -- it's just some visual's layered on top. So, here: <TextBlock FontFamily="{Binding}"> . Sure, this looks strange, but what it's doing is for each Font, it's using the FontFamily object and setting it to the FontFamily of the TextBlock. By using a "naked" binding reference, it's referring directly to the object being bound rather than specifying any named properties (using the Path syntax)
  5. It's also easy to write a fancy list box. Imagine how long this would take to do in Win32!

If you have XAMLPad installed (which if you have the .NET 3.0 SDK you do!), you can copy this XAML and try it.

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Height="508" Width="504"

>

<Page.Resources>

<CollectionViewSource Source="{x:Static Fonts.SystemFontFamilies}" x:Key="FontList" />

<Style TargetType="{x:Type ToolTip}">

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="{x:Type ToolTip}">

<Border >

<ContentPresenter />

</Border>

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

<DataTemplate DataType="{x:Type FontFamily}">

<WrapPanel>

<StackPanel x:Name="MyVisual">

<TextBlock Text="{Binding Source}" x:Name="MyTextName" />

<TextBlock FontFamily="{Binding}">

abcdefghijklmnopqrstuvwxyz

</TextBlock>

<TextBlock FontFamily="{Binding}">

ABCDEFGHIJKLMNOPQRSTUVWXYZ

</TextBlock>

<TextBlock FontFamily="{Binding}">

1234567890

</TextBlock>

<TextBlock FontFamily="{Binding}">

!@#$%^&*()_+-=[]{}\|;:'",./><?

</TextBlock>

<StackPanel.ToolTip>

<Viewbox Width="500" Height="200">

<Label HorizontalAlignment="Left">

<Binding />

</Label>

</Viewbox>

</StackPanel.ToolTip>

</StackPanel>

</WrapPanel>

</DataTemplate>

</Page.Resources>

<Grid>

<Grid.RowDefinitions >

<RowDefinition Height="Auto" />

<RowDefinition />

</Grid.RowDefinitions>

<Label Content="Fonts" Grid.Row="0" />

<ListBox Grid.Row="1" Margin="6" ItemsSource="{Binding}" DataContext="{DynamicResource FontList}" />

</Grid>

</Page>

October 10, 2006

A new type of town: Lily Valley

This isn't technical at all -- so if you're wanting tech -- wait for another post.

Interesting post about a new community being built in Mississipi (USA -- near the Gulf of Mexico) which is intended to be a new type of town.

I wonder how often new "towns" are actually created these days? Townships likely grow and change, but how often a new town from scratch?

In any case, the town, "Lily Valley" will be a mix of typical town elements, including residences, commercial businesses, and "cultural elements." The effort reminds me of the many ongoing products to "revitalize" various areas of major cities by putting everything people need within a reasonable distance in a pleasant environment. The town design is primarily coming from the Frank Lloyd Wright School of Architecture.

Read more about the town here.

October 6, 2006

Reading in the moonlight ...

According to this Nasa article, some people can't read under the moonlight. Tonight being a nearly clear night here at the WiredPrairie, and a full moon, my wife and I both decided to try and see whether we could read under the moonlight. Either we don't understand the test it proposes in the article, or we both possess the ability as we could both easily read in the moonlight at a reasonable distance.

3. Moonlight won't let you read. Open a book beneath the full moon. At first glance, the page seems bright enough. Yet when you try to make out the words, you can't. Moreover, if you stare too long at a word it might fade away. Moonlight not only blurs your vision but also makes a little blind spot. (Another note: As with all things human, there are exceptions. Some people have extra-sensitive cones or an extra helping of rods that do allow them to read in the brightest moonlight.)

Anyone ever try it? What happened?

October 3, 2006

Borland "Turbos" are now available...

Borland, per an earlier announcement, has made available "Explorer" editions of their products: Delphi, C++, Delphi for .NET, and C# here. The explorer edition is free -- yet for some reason, you're only allowed one per machine. With that limitation, I haven't decided which one I'd rather try.... (Borland? Hello? Why only one?!)

Update:

Turbo Delphi for .NET

With Turbo™ Delphi® for .NET, you can develop powerful desktop and web applications in Delphi for WinForms, VCL.NET, and ASP.NET Produce 100% PE Verifiable .NET assemblies and have access to the entire .NET Framework 1.1 Class Library. You can build .NET Web Services, .NET remoting servers and clients, and components for WinForms, VCL.NET and ASP.NET. Code faster with refactorings, live templates, code completion, code insight and block completion. And with the customizable and extendable environment for build-your-own and third party components and IDE add-ons you have everything you need to start real .NET development today!

I can narrow down my choices. I'm not going back to .NET 1.1. (Borland?! Hello?! Why not 2.0?). That eliminates Turbo Delphi for .NET and Turbo C#.

If you're thinking about doing Windows .NET development and want a free option, try the Microsoft Visual Studio Express Editions instead. Download them here.

October 2, 2006

WPF LOB Feedback

Rob Relyea asked recently for feedback regarding needs for LOB applications.

Some of my feedback is here (and Rob, if you're reading this, contact me directly at work for more information about any of these!):

  • Performance is important. Application visuals shouldn't get in the way of getting a job done. I'm certainly not suggesting that LOB applications should look boring! By no means! Instead, I want these visual features to impact typical LOB workflow scenarios minimally.
  • Workstation - it's fair to say that some businesses will upgrade their machines next year after Vista and WPF releases, however historically few will do it because of Vista or WPF. So, Microsoft's workstation recommendations must remain grounded in reality at all times. Many businesses lag behind consumers in their hardware upgrade cycles simply because the demand isn't there. If the LOB applications are functioning well enough on existing hardware, it's a hard sell often to convince an IT purchaser to upgrade hardware. If of course, a software application written in WPF can actually save measurable time of a users, that might convince an otherwise stingy IT budgeteer :) that new workstations are needed.
  • Expression suites and Cider: None of these WPF tools are up to the Microsoft typical quality bar for development experience. In all honestly, I'd rate them at a VB 3 or lower experience for visual designer experience. The code behind and schema of course are awesome, but for a typical enterprise or LOB application developer, they desperately need good UI tools to develop reasonable applications. It's very easy, almost too easy, to create a WPF application that is uglier than the mid-late 90's web sites that looking back were simply AWFUL. With some effort, it is possible to make a reasonable application -- but it's not as easy as it should be.
  • Data Entry controls - Where are the standards that developers have come to expect? We're tired of buying third party controls that often work reasonably well, but are harder to support, don't quite have the features we need, and are bloated bigger than what we'd like. Some of the basic features that are missing in WPF 1.0 include an autocomplete text entry field; a data entry grid; a date-time-calendar style field; a calendar; a charting control (ideally one that can make Office 2007 style charts!); a rich editor that can save HTML and not the venerable RTF who's time has passed; a fully supported graph panel (like Kevin's here/here); Office 2007 like controls/menus/etc (normally not a big fan of copying, but there's some really great innovation there that Microsoft should encourage duplication by providing a great implementation); masked text fields (although I wouldn't use them, I just know lots of developers like them); validating/warning editing fields that like many data entry web pages can visually show fields with problems; and I'm sure there are others that I'll run into but even more important is the last point I make below.
  • Terminal Services / down-level XP Remote Desktop support - Many companies are using terminal servers or virtualized machines to provide access to applications across an enterprise. WPF applications should not be penalized for running in this environment. Make TS (and Citrix too!) support first class to XP/2003 and Vista consuming clients of a remote session.
  • Tools - In the past couple of years, Microsoft has excelled at communication and providing tools at early stages so developers could learn about upcoming technologies. Awesome! The tools though I'm referring to here are the little things. Today for example, I wanted to create a Vista ready icon. Sure there are a number of 3rd party applications who sell Vista ready icon tools -- but all I need is a way to take a PNG and convert it to a ICO format that works on Vista and XP. Not a full blown editor -- I own Photoshop and don't want an editor. There's others that I've run into -- but I can't recall them right now ....
  • XAML/WPF -  During the period where developers/designers will encounter XAML and hard-core WPF -- I'd stress that the more REALISTIC samples/demos/applications that Microsoft can provide the better. The best however would be to provide as many ways though of simplifying the developer experience rather than just providing lots of sample code. WPF is still more like C/C++ and Win32 than C# and WinForms in terms of base complexity. New classes, etc. I suppose one should consider the "My" namepsace of VB and consider whether WPF could use some of those same simplifications.
  • Think Out of the Box - this is the hardest to describe, yet the most important I think as a platform for the future: Thinking outside of the box. If we rest on the standard data entry fields and techniques of the last 20 years, has WPF really changed the way people see computers? The more that Microsoft (and other companies of course) can show that WPF provides a platform that can provide truly innovative application experiences (from consumer to LOB) the better off the ISV industry will be. We're at a crossroads in technology. The next generation of Windows applications can take us where no one was expecting -- making computers a smarter part of our day rather than just being a tool no different than the phone that sits on your desk or a calculator (even some of the best office phones really are still quite stupid and require the user to perform far too many cumbersome and unintuitive tasks).  I'm excited to be part of this wave. But, we must ride it carefully or risk being eaten by the sharks! :)

All for now. Hope this helps.

How to know when your Animation completes and ...

The AnimationTimeline classes in the Windows Presentation Foundation such as DoubleAnimation and ColorAnimation all have a common event Completed. I often use completed to know when an animation I have started in code has finished. If there's only one animation which is often the case, I can easily map the animation Completed event to the animated UIElement logically. However, if I start multiple animations using BeginAnimation, the Completed event unfortunately does not provide any information as to the control that was animated. (Bummer!)

Instead, the Completed event's "sender" is the timeline's Clock. The second parameter to the event is EventArgs, which of course doesn't contain any useful data. So, how might you connect the Clock to the actual target UIElement? There are a couple of ways actually, and I'll present one of them here.

My example uses a DoubleAnimation. Here's the code before:

DoubleAnimation anim = new DoubleAnimation();
anim.Duration = new Duration(TimeSpan.FromSeconds(0.5));
anim.To = 0.1;
anim.FillBehavior = FillBehavior.Stop;
anim.Completed += new EventHandler(AnimationCompleted);

myControl.BeginAnimation(UIElement.OpacityProperty, anim);

Unfortunately, there's no way to tie the PointAnimation instance (anim) to the UIElement, myControl. So, in a typical simple object oriented solution, I created a new derived class, PointAnimationPlus:

DoubleAnimationPlus anim = new DoubleAnimationPlus();
anim.Duration = new Duration(TimeSpan.FromSeconds(0.5));
anim.To = 0.1;
anim.FillBehavior = FillBehavior.Stop;
anim.Completed += new EventHandler(AnimationCompleted);
anim.TargetElement = myControl;

myControl.BeginAnimation(UIElement.OpacityProperty, anim);

Here's my implementation of DoubleAnimationPlus:

internal class DoubleAnimationPlus : DoubleAnimation
{
private UIElement _target;

public UIElement TargetElement
{
get { return _target; }
set { _target = value; }
}

protected override Freezable CreateInstanceCore()
{
DoubleAnimationPlus p = new DoubleAnimationPlus();
p.TargetElement = this.TargetElement;
return p;
}
}

static void AnimationCompleted(object sender, EventArgs e)
{
Clock c = sender as Clock;
DoubleAnimationPlus anim = c.Timeline as DoubleAnimationPlus;

if (anim != null)
{
if (anim.TargetElement != null)
{
Console.WriteLine("DoubleAnimation TargetElement is set!");
}
}
}

As you can see, very simple. The only real trick is that you must override the method CreateInstanceCore. Since an animation is a Freezable object, when the animation completes, a Clone (or CloneCurrentValue) is made (which eventually creates a new instance of the DoubleAnimationPlus class). In my simple implementation, my code creates a new instance of the DoubleAnimationPlus class and then copies the reference to the TargetElement. If you try this code and neglect to override the CreateInstanceCore, you'll immediately note that TargetElement property isn't set in the Completed event -- that's because you didn't actually create an instance properly (and copy the new values).

That's all there is. The other method I considered was to use dependency properties -- but I wanted the explicitness of this technique for now.

Help support my web site by searching and buying through Amazon.com (in assocation with Amazon.com).