Solving a Mess

If Tom’s Hardware is to be believed, we will lose Windows 7 Starter/Home Basic/Home Premium/Business/Enterprise/Ultimate mess. Instead we will have Windows 8, Windows 8 Enterprise and Windows 8 Professional.

I do not know about you, but I do feel this is MUCH better. Until they start adding new releases…

[2012-03-03: Having three editions for Windows 8 was too good to be true. It seems that there are plans for 8 different versions (not including ARM). I am sure that everybody will be thankful to Microsoft for being forced to read various comparisons only to find later that some critical feature is not supported in selected edition. I can hardly wait…]

[2012-04-17: There might be some hope for Microsoft. It seems that count will stop at two (and few extras).]

IsRunning

In quite a lot of code I see following check for whether thread is running or not:

public bool IsRunning {
    get {
        return (this.Thread != null)
               && (this.Thread.ThreadState == ThreadState.Running);
    }
}

This code has big chance of working except in one quite often used case - if you have Sleep() inside of your code. Once that enters your main thread loop, you cannot count on your thread being in Running state all of the time. And Sleep() might not even be in your code (e.g. it might be in some external library).

Better check would be:

public bool IsRunning {
    get {
        return (this.Thread != null)
               && ((this.Thread.ThreadState == ThreadState.Running)
               || (this.Thread.ThreadState == ThreadState.WaitSleepJoin));
    }
}

P.S. If you like to mess with IsBackground thread property, also check for ThreadState.Background.

WinDays 2012

Illustration

I will hold a presentation on WinDays 2012.

This year theme will be .NET Micro Framework. Although this platform works very close to hardware, I will try to avoid too much electrical engineering theory and just show what can be done with it in practice.

All examples will be shown on Netduino Plus, probably cheapest way to start working with .NET Micro Framework these days.

[2012-02-29: Unfortunatelly, I will not attend. My stay in USA got prolonged and, due to certain limits of physics, I cannot be at two places at same time. :(]

Canon SX230 Communication Error

After taking a lot of pictures in Washington Aquarium, came time to transfer them from Canon PowerShot SX230 HS camera to laptop. And then I was greeted with “Communication Error” displayed on camera’s screen. I tried multiple cables, tried resetting everything, every wiggling motion that I knew, but to no avail.

Quick search on Internet gave hint that this happens when there is too much pictures on camera. I connected SD card directly to computer, deleted some old pictures, reconnected camera and, like magic, it was working again. Happy ending.

For the sake of it, I cannot grasp why idiots who made camera’s firmware thought having 3000 pictures on camera that accepts SDXC cards should be a problem. 16 GB is not even biggest card there is and it was half full. How can you make camera fail on something that should be it’s basic operation?

Even worse they found it necessary to hide such error behind obscure message like “Communication Error”. Which part of that message has any connection to number of files? Only connection what-so-ever was in manual where, as sole source of this message, they said “Images could not be transferred to the computer or printed due to the large amount of images (aprox. 1000) stored on the memory card.” If this is sole source of error, how about giving “Too much files” message. Or “Sorry, but our product is shit if you actually want to transfer images”. Either message would do.

Or, dare I say it, they could fix their broken product…

VHD Attach 3.10

First version of VHD Attach was written in .NET Framework 3.5 SP1. I figured that since Windows 7 comes with it, it has WCF and it is new, there was no reason not to use it.

Just to prove me wrong there came ThinPC. It comes without any .NET Framework and only version that can be installed is 4.0. Yep, that is one that breaks backward compatibility with 3.0 and 3.5. Well, this version is now written in .NET Framework 2.0.

Those who need to create virtual disks had that feature in 3.0x but only for dynamic disks. With this version you can create fixed disks also.

Some GUI refreshing was in order but do not expect anything revolutionary. It is just an evolution, baby.

Download is available from within application or from these pages.