That Sneaky .NET 3.5 External RuleSet Toolkit Sample

by Donn Felker 30. September 2008 08:07

This is a quick note to those of you who are trying to access the External RuleSet Toolkit Sample in this download on MSDN.

The .NET 3.5 External RuleSet Toolkit sample is a Workflow Rules Engine Sample that shows you how to externalize the Workflow's Rule engine for your own evil, errr, I mean good.

 

Sneaky Sneaky

Well, let me in on a little secret.... The sample is... sort of... well... hidden from you.

Its not in the WF samples, its in the WCF samples. Seriously, WTF?

Check it out:

image

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET

Resizing a VHD and a Volume

by Donn Felker 26. September 2008 10:47

I ran into a problem today.... I wanted to install SP1 for Visual Studio 2008 on my virtual pc instance today. I started the install and got an error stating I did not have enough space on my drive to do so. I was about a gig short. This is on a VPC too... NO BUENO mi amigos.

NO bueno at all.

After trying a bunch of tools and different methods, I finally got something to work and I'm going to document it here.

 

Tools You'll Need To Do The Job

Install all of these prior to starting the resize.

VHD Resizer - This bad little mama-jama will take your VHD file and add space to it. Essentially, it creates a new VHD, and then copies  over your files onto the new VHD file.

  1. VHDMount - This is a component that is part of the Virtual Server 2005 download. Be sure to ONLY install this as you wont need all the Virtual Server mumbo jumbo. See the image below.

 vhdMount 

3. diskpart.exe - A little Microsoft Utility that allows you do more than the regular disk management GUI. All kinds of goodness in here. The only downfall is that it is a command line utility.

 

How To Get The Job Done

Important note: This process will take up to an hour if not MORE to complete. So give yourself some time.


Normally if you need space you can add another partition and create a new drive on that partition. However, for reasons of upgrades for a previously installed app (VS2008) I need more space on C, therefore I need to resize my hard drive.

1. Resize the VHD with VHDResizer.

  • Open VHDResizer.
  • The application will ask you for the VHD you want to resize. Select that drive and then select a destination location.
  • Now select the "New Size" as shown below. In this case I've decided to bump up from 16 GB to 25 GB.
  • Click "Resize". Now go get lunch. This will take awhile.

image

 

2. "Plug in" the vhd as a new mount point.

We need to plug this VHD into our host machine so we can operate on it.

F:\VPC\Base>"C:\Program Files\Microsoft Virtual Server\Vhdmount\vhdmount.exe" /p
XPSP2_VS2K8_SQL05_BASE_25GB.vhd

 

The results will look like this:

The specified Virtual Hard Disk (VHD) is being plugged in using the default Undo
Disk option. Use /c to commit or /d to discard the changes to the mounted disk.

The Virtual Hard Disk is successfully plugged in as a virtual disk device.

 

3. Run diskpart and expand the volume

Fire up diskpart:

F:\VPC\Base>diskpart

Microsoft DiskPart version 5.1.3565

Copyright (C) 1999-2003 Microsoft Corporation.
On computer: DONNF-PC

 

Find which volume you need to expand. In this case my volume was "Volume 4".

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     E   OFFICE12     CDFS   DVD-ROM      253 MB
  Volume 1     D   New Volume   NTFS   Partition     75 GB  Healthy
  Volume 2     C   OSDisk       NTFS   Partition    112 GB  Healthy    System
  Volume 3     F   FreeAgent D  NTFS   Partition    233 GB  Healthy
  Volume 4     G                NTFS   Partition     16 GB  Healthy

 

Select the volume so that you can work with it.

DISKPART> select volume 4

Volume 4 is the selected volume.

 

Extend the volume using the extend key word

DISKPART> extend

DiskPart successfully extended the volume.

 

The disk has now been extended. We now need to view the volumes size, so run a list volume again.

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     E   OFFICE12     CDFS   DVD-ROM      253 MB
  Volume 1     D   New Volume   NTFS   Partition     75 GB  Healthy
  Volume 2     C   OSDisk       NTFS   Partition    112 GB  Healthy    System
  Volume 3     F   FreeAgent D  NTFS   Partition    233 GB  Healthy
  Volume 4     G                NTFS   Partition     25 GB  Healthy

 

We see that the new size is 25 GB.  It worked. Cool.

 

4. "Unplugging" the Disk

At this point we are almost done. We just need to unplug the disk from our machine. We will use VHDMount for this again.

Run the following command:

F:\VPC\Base>"C:\Program Files\Microsoft Virtual Server\Vhdmount\vhdmount.exe" /u /c XPSP2_VS2K8_SQL05_BASE_25GB.vhd

Virtual disk device(s) successfully unplugged.

Merging Undo Disk(s) to parent disk(s). This may take some time.

Undo Disk(s) successfully merged.

When vhdmount mounts the disk it creates an undo disk that houses all of the changes that are done during the mount. Then, before unmounting the disk we have to tell VHDMount if we would like those changes committed or deleted. The /c switch commits those changes. These changes are merged into the disk. The /u switch unplugs the disk from the machine (unmounts it).

 

5. DONE

We are done. Fire up virtual PC and create a new virtual machine (vmc file) through the wizard and connect to the machine. You will now have a larger C drive.

 

Enjoy. :)

 

Update: When I tried to do this again an hour later on another VHD I received an error stating that VHDMount was not a valid Win32 application. WTF? I had to uninstall and reinstall VHDMount for it to work again.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Virtual PC

New Digs

by Donn Felker 24. September 2008 03:18

Jason Bock posted this awhile back - but I thought I'd post it for my subscribers. It's been hectic with a new kiddo and all kinds of stuff going on so I'm just getting around to posting this now.

 

I have joined ...

magenic

 

Background info: I recently moved to Minneapolis to explore other opportunities and to live in a city that I've adorned for years. Having moved up here is one the best things I've ever done. I absolutely love this place and the seasons. For some reason when I tell that to the locals they look at me like I have 3 heads. Oh well. Grass is always greener I guess. Some people hate the winters, some love them. I'm someone who loves snow. After being in Phoenix for nearly 10 years, snow and cold is a thing of beauty.

I was working for a few other shops/clients independently in MPLS wasn't really working out that well so I looking around to see what the city had to offer. I didn't have to look far to find a premier partner that I've been following for some time, Magenic. Some of you may know of the company, it houses quite a few MVP's and genuinely brilliant people. They speak throughout the country at various events and I can honestly say that I've seen a few of their presentations and I was impressed. I'm very honored to be part of this team and I  look forward to the interesting years ahead.

If you'd like to learn more about Magenic, click here.

 

Other Magenic Bloggers:

 

I'm sure there are other blogger's on our team, I just have not met them yet. So if you're one of them, let me know and I'll add you to the list.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Misc

Unit Testing - It's not what most of you think ...

by Donn Felker 19. September 2008 08:37

Unit Testing

Purpose: To test an individual unit of code to ensure that it is working properly.

This is where the most confusion lies, so I'm going to focus the majority of the beginning series on this area. Possibly to the effect of a few posts.

Normally you'll hear a developer say "I have unit tests for this" but in reality the tests are actually integration tests. 

At a very basic level integration testing is the combining of two units that have already been tested into a component where the interface between them is tested. In this sense a component is an aggregate of more than one unit.

Basically - if you're code has outside dependencies, and you're testing the main calling interface (maybe a method), you are probably testing the entire stack beneath the method, in turn testing how the code integrates together. AKA: Integration testing. A full post on integration tests is coming soon...

The trouble comes with understanding how to test individual units of code without testing their dependencies. Code that has tight coupling suffers from problematic testing and is very brittle and challenging to change.

Here is an example snippet of a system via a diagram for reference:

image

At a high level, here's how the application works:

image

Lets look at some legacy code that every single one of us have written at some point in our lives. This will be the code that we are trying to test. This code is located inside of the "CustomerService" shown above.

        public void SaveCustomer(Customer customer)
        {
            customer.EditDate = DateTime.Now;
            var repository = new CustomerRepository();
            repository.Update(customer);
        }

 

Can you write a unit test for this?  No. (Well, that's not 100% true. You can, kind of. But you'd have to be using a tool like TypeMock to do so - which in this exact example would be cheating in regards to OOP in this instance. More on this at a later time.) In this case - to ensure a unit test was secured around this code you'd have to do the following:

  1. New up an instance of Customer Service
  2. Create a customer
  3. Ensure the CustomerRespository Works (who knows what that means, maybe you didn't write it)
  4. Be sure that everything the customer repository touches in the "Update" method works as well (again, who knows what it does, maybe you're not the developer who wrote it)

The code for the above would look something like this:

        [Test]
        public void UpdateCustomeShouldCallUpdateOnResponsitory_Legacy()
        {
            CustomerRepository repository = new CustomerRepository();
            CustomerService service = new CustomerService(repository);
            Customer customer = new Customer();
            service.SaveCustomer(customer);
        }

 

At this point you've already introduced too many dependencies into your code. If any of these outside dependencies break - our test breaks. In this case our outside dependency is the CustomerRepository. These outside dependencies could be a network connection, a file, a database, a web service, anything. Those are all things we mare NOT trying to test. We're trying to TEST one unit of code, the update call on the repository. I'm wanting to make sure that the customer repositories "update" method gets called with the customer inside of it. I don't actually want the repository code to be called thought. I just want to know that it was called. That's all I care about. I'll write another test to ensure that the value of the customer's edit date was updated properly at a later time. I'll write more tests to ensure that the customer repository works the way it should.

 

How can we fix this?

We can test this unit of code if we follow some basic OOP principles. Mainly dependency injection.

Here's the code refactored. It is far from perfect, but this code will allow you to test in isolation of outside dependencies:

public class CustomerService : ICustomerService
{
    private ICustomerRepository customerRepository;

    public CustomerService(ICustomerRepository customerRepository)
    {
        this.customerRepository = customerRepository;
    }
    public void SaveCustomer(ICustomer customer)
    {
        customer.EditDate = DateTime.Now;
        customerRepository.Update(customer);
    }
}
In this case we can inject our dependencies (customer repository and customer) as interfaces. In the test through the use of a mocking framework we can then mock out and stub our calls to the customer repository and call expectations on them. The test would look like this:
    [TestFixture]
    public class CustomerServiceTests
    {
        MockRepository mockery = new MockRepository();
        private ICustomerRepository customerRepositoryMock;
        private CustomerService customerService;
        private ICustomer customerStub;

        [SetUp]
        public void Setup()
        {
            customerStub = mockery.Stub<ICustomer>();
            customerRepositoryMock = mockery.DynamicMock<ICustomerRepository>();
        }


        [Test]
        public void UpdateCustomerShouldCallUpdateOnRepository()
        {
            With.Mocks(mockery)
            .Expecting(delegate
            {
                Expect.Call(delegate { customerRepositoryMock.Update(null); })
                .IgnoreArguments().Repeat.AtLeastOnce();
            })
            .Verify(delegate
            {
                customerService = new CustomerService(customerRepositoryMock);
                customerService.SaveCustomer(customerStub);
            });
        }
    }

At this point we're only testing one unit of operation, therefore this is a "unit test".

Testing code that is similar to the legacy code shown above is not going to be a unit test. If you were to wrap a test around the legacy code you would be creating an integration test.

It will "look" like a unit test but what its doing is actually integration testing. This is because you would be inferring that all the other pieces of the code are going work as expected.

This is not necessary true. Trust me ,I've been down this road.

 

Problems arise when you begin to make these assumptions about your dependencies. In my experience I've had the following happen:

  • The database is down - TEST FAILS
  • The database is in an unknown state - TEST FAILS
  • The network is down - TEST FAILS
  • The file is not available - TEST FAILS
  • The file is locked - TEST FAILS
  • The file is read only - TEST FAILS
  • The SMTP Server is not up and running - TEST FAILS
  • The web service is not responding - TEST FAILS

 

All of these instances also bring up good problematic areas that you should test for. Utilizing proper OOP and Unit tests will allow you to simulate these events so that you can code for them in your application.

 

 

Review

 

What we are not doing here:

  • We are not testing the whole stack from top to bottom.
  • We are not testing two classes together.

 

What we are doing here:

  • Testing one logical piece of code.
  • Executing a Unit Test.

 

Popular Testing Frameworks:

Popular Mocking Frameworks:

 

Recommended Reading:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

TDD | Testing

Testing For Developers Series

by Donn Felker 19. September 2008 08:25

Over the next few weeks I'm going to cover some topics will help alleviate the pain of understanding the difference between different tests in application development.

The series will consist of the following articles:

Disclaimer: I've had to explain this so many times that I figured I might as well type it out on my blog and send people the link to save myself time and to give friends a place to bookmark for reference. Also, these topics carry quite the heavy controversial and opinionated crowd - to the point where some people have vastly different opinions on what each of these topics actually mean (and some people WILL disagree with me and I'm ok with that). These are my opinions that I have gleaned from my years in the field utilizing various testing methodologies.

As a developer, when you're first getting into testing your code via a testing framework you will start to notice that testing terms are thrown around like they're ingredients in code soup. Unit, integration, functional, acceptance, regression, load, etc... WHOA, hold the phone buddy. What the ...?!?! Confusion sets in immediately. You probably have an idea of "what" you want to do but you're not sure of the actual name for it.

A lot of time developers will say "yeah, there are unit tests backing it up" when in fact those unit tests are actually  repeatable "integration tests". This is completely fine if this is what they meant to do. But unfortunately they don't know what they are saying and they're probably confusing themselves as well as their peers. I'm hoping this series will act as a reference for some people who are just getting started in testing from a developer standpoint. By no means is this a be-all/end-all series for testing, it is just meant as a springboard for developers just getting started. Testing (TDD in general) has a huge learning curve as it requires quite the paradigm shift to get started. This series will be refined as I find ways to improve it and it will be updated throughout time.

The end goal of this series is to help newcomers to the testing world identify the differences between the types of testing. I will also provide some examples of how to test in each of these scenarios (some more than others) and I will provide information about some of the tools that you can use in each of the testing categories.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

TDD | Testing

Custom Google Maps Geocode Powershell CmdLet

by Donn Felker 18. September 2008 09:43

This may look like a repeat... well.. because it is... BUT.. you cannot find the old post. Why? Because, well ... it no longer exists. My old host decided to accidentally delete my account. Yeah. Oops. After that nightmare, I've moved to a new host where the grass is greener, the hippies wear deodorant and well ... wait ... never mind... onto the good stuff...Here's the old post, reposted again.

---------------------------------

Ok, I admit ... I have a fascination with maps. Why? Who knows. I just love knowing where I'm at, where I'm going, not being lost, etc etc etc. Last year I wrote a C# class that would connect to Google Maps and return the latitude and longitude of an address by utilizing the Google Maps API. Get that class

Awhile back I also wrote about the complexity of our industry and about how staying up to speed is quite difficult. Jeffrey Snover (PowerShel/Windows Management Architect) commented on that post and recommend learning PowerShell. I completely agree with what he said. However - I've only scratched the surface of PowerShell and its capabilities and just recently I picked up a copy of Bruce Payettes "Windows PowerShell in Action". So far, its a great book. I'll post a review when I'm done. But as I was reading I got into thinking about how I would like to Geocode addresses from the command line in certain instances. A custom PowerShell cmdlet was in fashion. 

 

The Get-GoogleGeocode CmdLet

At that point, the Get-GoogleGeocode cmdlet was born. I took my code from the C# Google Maps Geocoding class I wrote, added a new property "Address" (which is what I needed to store the address the user supplied) as a simple string and then wrapped it in a cmdlet. 

The result? An awesome cmdlet. 

The cmdlet will take your Google Maps API Key and a list of addresses and it will Geocode them for you. Very simple, yet very powerful. 

Lets take a look at what it can do: 

Examples

 

Note: My Google Maps API key has been hidden in the examples below ... SO YOU DONT STEAL IT! ;)

 

Script Explanation

Click the pictures for full resolution images.

 

 

Example 1:  Gets  the longitude and latitude for one single address and outputs it to the screen.

ps1

PS C:\Development\DF.PowerShell.Cmdlets\bin\Release> Get-GoogleGeocode -apiKey <YourAPIKeyGoesHere> -addresses "2203 E. Empire St. Bloomington, IL 61704"

Address Latitude Longitude
------- -------- ---------
2203 E. Empire St. Bloomington, IL 6... 40.488283 -88.945315

 

Example 2:  Gets the longitude and latitude for multiple addresses and outputs them to the screen. 

ps2

PS C:\Development\DF.PowerShell.Cmdlets\bin\Release> Get-GoogleGeocode -apiKey <YourAPIKeyGoesHere> -addresses "2203 E. Empire St. Bloomington, IL 61704", "8300 Norman Center Dr., Suite 950 Bloomington, MN 55437"

Address Latitude Longitude
------- -------- ---------
2203 E. Empire St. Bloomington, IL 6... 40.488283 -88.945315
8300 Norman Center Dr., Suite 950 Bl... 44.853079 -93.352194

 

Example 3:  (I think this is the REALLY cool one) Opens a file, reads each line and gets the longitude and latitude for each address in the file.

ps3

PS C:\Development\DF.PowerShell.Cmdlets\bin\Release> Get-Content c:\temp\MicrosoftOffices.txt | Foreach-Object {Get-Goog
leGeocode -apikey <YourAPIKeyGoesHere> -addresses $_ }

Address Latitude Longitude
------- -------- ---------
2203 E. Empire St. Bloomington, IL 6... 40.488283 -88.945315
77 W. Wacker Dr., Suite 2300 Chicago... 41.886499 -87.630526
3025 Highland Pkwy., Suite 300 Downe... 41.831445 -88.010731
500 E. 96th St., Suite 460 Indianapo... 39.928171 -86.150754
N19 W24133 Riverwood Dr., Suite 150 ... 43.056940 -88.229463
4601 Westtown Parkway, Suite 136 Wes... 41.610376 -93.711712
10801 Mastin Blvd., Suite 620 Overla... 38.932978 -94.702328
8300 Norman Center Dr., Suite 950 Bl... 44.853079 -93.352194
3 City Place Dr., Suite 1100 St. Lou... 38.670381 -90.433552
13815 FNB Parkway Omaha NE 68154 41.266103 -96.130733

 

Script HELP

If you ever forget about how to run this command, I have included the help files as well. 

Access help by typing: Get-Help Get-GoogleGeocode. This will give you very basic help. For detailed or full help type: Get-Help Get-GoogleGeocode -detailed or  Get-Help Get-GoogleGeocode -full

To use this script, execute the command Get-GoogleGeocode and supply a api key and a list of addresses separated by a comma. 

From help:

PS C:\Development\DF.PowerShell.Cmdlets\bin\Release> get-help get-googlegeocode
NAME
    Get-GoogleGeocode
SYNOPSIS
    This cmdlet will return the latitude and longitude of the addresses that are passed into the cmdlet.
SYNTAX
    Get-GoogleGeocode -ApiKey <String> -Addresses <String[]> [<CommonParameters>]
DETAILED DESCRIPTION
    This cmdlet will return the latitude and longitude of the addresses that are passed into the cmdlet. The apikey is
    required for this to work. Also, you may encounter proxy issues if you require a proxy for access to the internet.
    This cmdlet utilizes the System.Net.WebClient class to access the internet. This cmdlet will connect with the Googl
    e Maps API, ask for the geocoding information and then return it.
    You will need a Google Maps API Key for this. Sign up for one here: http://code.google.com/apis/maps/
    If the latitude and longitude are both ZEROS, this means the address could not be geocoded.
RELATED LINKS
REMARKS
    For more information, type: "get-help Get-GoogleGeocode -detailed".
    For technical information, type: "get-help Get-GoogleGeocode -full".

 

How to Install

Start powershell and navigate to the Release directory run the "install.ps1" script from the command line. It should look like this when you run it: 

install

 

How to uninstall?

Run the uninstall.ps1 script. Running that script should result in something that resembles this:  

uninstall

 

Downloads

C# Solution & Binaries: DF.PowerShell.zip (44.51 kb)

Note: Text File with Addresses from Example 3 is included in solution download.


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | PowerShell

Book Review: Be Prepared

by Donn Felker 18. September 2008 04:17

cover_dadnbaby Be Prepared - A Practical Handbook For New Dads

Being a new dad is sort of like anything else in life that you've never done before. Its confusing, its hard, its fun, its rewarding and well, its just plain hard to figure out. Babies are like computer viruses that always adapt. You have to figure out how to keep them within their sandbox before they get out and destroy everything. Before you can confine them to their sandbox, you have to figure out exactly how and what you need to do that. When it comes to babies, simple tasks can be quite daunting to a new dad. Some of these tasks are:

- How to Change  Diaper

- How to hold a baby

- How to decipher the different screams

- How to know how to "swaddle" them.

- What to look out for in your hormonal significant other after birth.

- etc, etc, etc.

 

The problem with most "daddy" books is that, well, um ... they SUCK. Real Bad. I'm not joking, try reading one. They make you want to puke or gouge your eyeballs with a turkey baster. Typical daddy books and other new baby books are instant cures for insomnia in my opinion. You get 5 pages into the book and they're talking about all the happiness in the world. Yeah. Right. Sure.

They are full of typical puppy dogs and ice cream nonsense.

I need a book that's for MEN. Plain and simple.

About two months ago while shopping for some baby gear at baby consignment shop I saw this half priced book store next to the baby shop. We decided to visit it and low and behold, I found the holy grail of daddy books.

"Be Prepared - A Practical Handbook For New Dads"

The image shown above is actually the cover image of the book.

 

You're probably wondering ...

Why this book is "SOOOOOO MUCH BETTTERRRRRR" than other daddy books?????

Well, lets be honest, it just is. But my opinion is just that - an opinion. Lets help you identify your own opinion and in this case an example is 10x better than reading boring lame-o text.

Upon cracking open this golden nugget of information goodness you're set up with a nice mental image of what the rest of this book will be like ...

Page-1 (source: beprepared.net):

samples_willnwont1

 

Page 2:

samples_willnwont2

 

 

One word for this.

AWESOME.

 

Finally a book that tells it like it is. A real-deal-holyfield approach to daddy books. I don't want a book that sugar coats everything for me. I want the book to explain exactly how life with a baby should be and will be. Be Prepared is that book. Hands down, this IS the book for new dads. If your significant other is asking you to read a daddy book, get this one. It will save your life, probably your babies life and it will help your relationship. :)

The Book provides tips and tricks all the way up to 1 year old. It covers it all.

- How to soothe a baby (and cool tricks I never thought of)

- How to change diapers

- How to bath the baby (at different stages too)

- How to deal with a hormonal woman

- How to read sports illustrated to the baby (get your sports and your kid bonding time at once!)

- How to take a baby camping

- How to handle crazy relatives who want to hold the baby, but you don't trust them

... and a TON more. This is only a grain of salt compared to the shaker of awesome-ness in this book. Literally, this small book is PACKED with goodness. It's so good I'm going to go buy a couple and give them to my friends who are going to be new dads.

The web site (www.beprepared.net) has all kinds of goodness too.

To view more sample pages check it out here: http://www.beprepared.net/sample.html 

 

If you're tired of reading nonsense baby books that your significant other has given you (not that they're full of bad content - just mind numbingly boring) then pick this book up.

 

Disclaimer: No, I did not get paid to write this. I honestly feel this is the best daddy book out there. Period.

Currently rated 1.0 by 1 people

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Misc | Book Review

My 2009 Browser Forecast

by Donn Felker 17. September 2008 03:37

The data backing this up is purely from reading on the web and just following a "gut" feeling. Just from following people on Twitter you can see how much hype this thing is getting. Check it out. This is how I see 2009 panning out for our browser market:  

image


Notes:I'm not trying to offend anyone by calling them turtlenecks or francois or booger eaters. It is, what it is. We're dorks! Thats the way we roll. :) 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Why Windows Task Manager Sucks

by Donn Felker 17. September 2008 03:12

It never fails... I'll boot up, start a program, walk away, log back into my PC and all of a sudden the disk light on my laptop or desktop is lit up like a Christmas tree for the next 10 minutes. The computer is rendered useless until its done "working". I can't do anything at this point but wait. A WASTE OF MY FLIPPING TIME.

The Problem With Task Manager

The problem is: I can't do anything while the disk is tripping on a couple of tabs of electric ecstasy ... opening task manager shows me... WELL... nothing. Task Manager says not a single process is utilizing CPU, and not a single process is over utilizing memory. Then I look at Disk I/O (which is presented in Read/Write/Other fashion) and It provides no valuable information at quick glance.

565234 Reads

88723412 Writes

WTF!?!

What I Want

When I look at task manager I want to see what tasks are my computer doing and what affects do each of these issues present. Right now I can only determine if something is a memory hog, or a CPU hog. I may see that SVCHOST.exe is running at 79% CPU utilization, but what the hell is running under the svchost context?!?!! Since svchost is a general host process name for services that from DLL's, I can't determine WHO is causing my pain.

So please tell me... Mr. Task Manager. WHO THE @#%! is spinning my disk. THAT IS WHAT I WANT TO KNOW.

You would think that after hmm.... 13 or so years of Windows OS's, Microsoft would have implemented this functionality. Its fairly rudimentary and actually VERY helpful in troubleshooting.

 

What I Did About  It

Fortunately this exact problem is something that other companies have recognized and have since developed an application I use regularly. Since I recently set up my PC I forgot to load this tool and I decided to write about it.

<Disclaimer>No, I'm not getting paid to write this about this product.</Disclaimer>

When I want to see what is going on in my PC I use Anvir's Task Manager Free Portable App (download link on the bottom). I bring it with me on my portable drive and flash sticks. Being a consultant who works on many machines, servers, or VPC's its nice to see what's going on.

Anvir has many features, but the one feature that I use it for the most is the "Disk Load". It shows exactly what is utilizing your disk and at what rate. You can sort on this column, therefore when your disk is playing Twinkle Twinkle Little Staryou can see what is causing it.

Here's a screen shot of what I'm talking about: (Click for larger)

image

I can now look at what is causing my disk to spin (as long as I can get AnVir open)! Anvir also allows me to see the processes under the svchost as well as look at startup items, processes, services, etc. It has a much more interactive and feature rich set of tools that you can use to help diagnose your troubles.

I've written about portable apps before - and I'll say it again - the nice part about this being a portable application is that I can use it on anyone's machine without having to install a thing. That's a thing of beauty. I can log into my mothers machine via SharedView and utilize it on her machine to see what her issues may be. Or even have her run it and tell me what she sees. Instead of seeing "svchost" I can now navigate to the service that svchost is working with. FINALLY.

I realize this may not be the BEST tool for this type of use, and if you have one that you feel is better, please leave a comment.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Misc | Productivity | Tools

Restoring a Dell Inspiron 6400 To Factory

by Donn Felker 17. September 2008 02:41

Last night I needed to wipe a machine of mine clean - back to factory settings. On the 6400 series there is a D partition that has all of the factory settings. It even has a little utility called "PCRestore.exe" that looks VERY promising.

However, if you double click it it will ask if you would like to reformat. Of course, you say "yes" and then it starts and then you get a brilliant dialog error.

I don't have a screen shot of it, but basically, its an error box that has the error icon (big red circle with an X in it) and an OK button. No error text. Click "OK" and the thing shuts down.

*Smacks forehead on table*

Crap. Great. What do I do now? This is not the most intuitive process in the world.

So how do you restore it back to factory defaults?

(This is mainly here for my own personal notes, but hopefully someone else finds this through the magic of the "internets").

If you look on the web you will find a ton of info instructing you to:

  1. Reboot
  2. When the "Dell" logo shows up on reboot while the BIOS is being read hit CTRL + F11 over and over and over.

Yeah. Sure. Didn't work. I tried it, literally 20 times. Maybe I'm an idiot, who knows ... but take it from me... on my PC it did not work.

The real way is to do the following (I could be a little off on this exact location of the settings, but you get the idea):

  1. Start > Programs > Accessories
  2. System Restore
  3. Restore back to factory settings

Run that and like magic, it will reboot into the restore image and in about 10 minutes your computer will be back to factory default. Schweet.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Misc

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Donn Felker

Senior Consultant
MCTS
ScrumMaster
Agile Practitioner

About Me | Books I Recommend

Gotta Pay The Bills


Tag cloud

    Popular Posts

    RecentComments

    Comment RSS

    Calendar

    <<  December 2008  >>
    MoTuWeThFrSaSu
    24252627282930
    1234567
    891011121314
    15161718192021
    22232425262728
    2930311234

    View posts in large calendar