Sorry for Windows 8

Illustration

It seems that Windows 8.1 will be a free upgrade for all Windows 8 users. I know quite a few people who might be thinking that hell is nearing freezing point. :)

Jury is still out in regards to what exactly Windows 8.1 brings but in all likeness it will be to Windows 8 what Windows 7 were to Vista. There might be few minor internal features but I suspect that most of work will be done on customer facing front.

My wishes include combined search for Apps/Settings/Files, booting directly in desktop mode, and removing hot-spot from upper-left corner. Yes, I am easy to please. :)

Asus N56VJ

Illustration

Since my old HP 6730b died I had to get myself a new notebook. I had a few really simple requirements: 15" screen, full HD resolution, i7 processor, and a possibility to replace DVD for second hard disk. As you can see, I was looking for a workhorse, not a ultrabook.

Asus N56VJ comes pretty close with Intel i7-3630QM, 8 GB of RAM (2x 4 GB), and a 15.4" full HD screen. Graphics side is covered with nVidia GeForce GT 635M when you play and on-board Intel card for basic tasks. It also came with 1 TB hard drive, unfortunately only at 5400 rpm. First thing I upgraded was drive and Windows 8 now boot in less than 10 seconds. This machine has lot of performance potential and it is not afraid to use it. Only thing I found missing was a TPM chip.

From looks alone this is probably the best laptop I have ever owned. Body is made of good quality plastic (visible on bottom) but with almost all user-visible surfaces covered with aluminium. While it will be a bit cool to touch at first, it heats really quickly and looks are beautiful. All user-accessible electronics (e.g. RAM, HDD) are accessible behind single (sadly non-captive) screw. And did I mention that it looks great?

I am not fan of chiclet keyboards but I got used to this one really quickly. It has nice feel and key react even when you hit just one corner. Layout is full 102 keys and most of keys are where you would expect them. Annoyingly this is not true for Page Up/Down, Home and End keys but it is hard to lay blame on Asus. For some reason all manufacturers try to keep them at most unsuitable place.

Cursor keys on this laptop also suffer bad placement combined with their slightly smaller size. Since they are not separated from other keys it is really easy to miss a column and press numerical keys instead. At least keyboard is backlit thus you can always visually double-check where your fingers go.

Keyboard backlight is nice, has three levels and some driver issues. When you boot your computer you will have keyboard backlit for few seconds, only to turn off when you are faced with login screen. So you will need to enter your password in the dark. After logon, keyboard will light-up again. It would also be nice if CapsLock and NumLock had activity LED integrated into a key but it is rare to find laptops that have such an obvious feature (e.g. HP nx9030).

Real sore point for this laptop is its touchpad. First, it is a bit too big and as such you cannot really type without ever touching it and thus making occasional mouse movements. Its stylish flat appearance will also not last. In less than a week you will notice it dipping (~1 mm) on side of left button. And yes, it is a permanent change. Two hand operation (one hand doing clicking and other one doing moving mouse pointer) is almost impossible. You see touchpad is touch-sensitive even on its buttons and thus you will cause all kinds of unwanted movements.

Just to annoy you more, occasionally touchpad will stop responding at all. For a second or two nothing would happen and then it would go alive once more. It is not unlike waking wireless mouse after not using it for a long time. It is impossible to use this laptop without external mouse for any prolonged time.

Another downer for me was customer service. Maybe I was an HP man too long, but I am saddened by lack of Service manual. If I ever need to open this machine (e.g. to clean a fan) it will be messy work based of trial and failure.

I find it very strange that Asus doesn’t offer a caddy for secondary drive although this laptop is quite capable of supporting it. There are third-party caddies around but customer support opinion is “… and we suggest you not to do this, it will break the warranty.”

This is a good laptop for someone who wants a workhorse. I can only hope that Asus will improve its customer service and feed their trackpad designer to dogs.

[2014-10-17: After having it for 18 months, battery has lost a lot of capacity. While new battery had 57200 mWh, now I it reports only 15,960 mWh. This is biggest capacity drop I had with any laptop. And yes, computer turns off randomly when battery gets under 50%.]

[2014-12-26: I got myself a replacement battery. I simply didn’t see point in getting original one at three times the cost considering its lousy lifetime.]

Console Mouse Input in C#

Few days ago I read a blog post about reading console input. It was quite straight-forward explanation and I wondered how difficult would it be to have this done in C#. Well, not really hard at all.

First step is to setup our console. We enable mouse input and we disable quick edit mode:

var handle = NativeMethods.GetStdHandle(NativeMethods.STD_INPUT_HANDLE);

int mode = 0;
if (!(NativeMethods.GetConsoleMode(handle, ref mode))) { throw new Win32Exception(); }

mode |= NativeMethods.ENABLE_MOUSE_INPUT;
mode &= ~NativeMethods.ENABLE_QUICK_EDIT_MODE;
mode |= NativeMethods.ENABLE_EXTENDED_FLAGS;

if (!(NativeMethods.SetConsoleMode(handle, mode))) { throw new Win32Exception(); }

All is left to do next is a simple loop that will check for new input:

while (true) {
    if (!(NativeMethods.ReadConsoleInput(handle, ref record, 1, ref recordLen))) { throw new Win32Exception(); }
    switch (record.EventType) {
        case NativeMethods.MOUSE_EVENT:
            //do something
            break;

        case NativeMethods.KEY_EVENT:
            if (record.KeyEvent.wVirtualKeyCode == (int)ConsoleKey.Escape) { return; }
            break;
    }
}

Check out example program.

PS: Expanding program to handle other key events should be relatively easy since all structures are already in place. Check console reference for more details.

PPS: I really hate C unions. :)

Immediate Window and Visual Studio Hosting Process

Illustration

When you are debugging in Visual Studio it might be really hard to tell whether you are using Visual Studio hosting process or not. Yes, there are subtle differences but nothing that would affect anybody developing full-trust desktop applications. Unless you are fan of Immediate window (Debug -> Windows -> Immediate).

I personally adore that little window. When you hit a break-point you can use it to view whatever expression your heart desires, all with variables as they are during runtime. If you notice error (or you deliberately want to have it) in one of your values you just write myVar = 42 and value is there. Complexity of what you can do has no limit.

You can use this window even if application is not running. Just write whatever expression you want (e.g. ? 4 + 2) and you will get your result. Unless you have compile error and Visual Studio hosting process is disabled.

Among a few documented usages there is mention of design-time expression evaluation. It simply states that, in absence of hosting process, any evaluation (even simple addition) will trigger starting executable. This is not really something to worry about because it is done seamlessly. Unless you happen to have compile-error.

If you love immediate window, don’t uncheck Visual Studio hosting process debug option. Otherwise you will lose Immediate’s window functionality when you need it the most.

No More Triple-double

Illustration

After seven years of www.medo64.com I decided to follow fashion and drop www. I was pleasantly surprised how easy it was.

Since these pages are WordPress-based, first step was simply changing WordPress and Site address. Since I do want all www.medo64.com requests to be redirected, I decided to adjust .htaccess file. For any request with domain other than current one, it will do simple redirect:

RewriteCond %{HTTP_HOST} !^jmedved\.com$ [NC]
RewriteRule ^(.*)$ http://jmedved.com%{REQUEST_URI} [R=301,L]

And that was it. Frankly, I am still shocked how easy everything went.

[2013-08-18: I went back to www.medo64.com; it just looks better to me.]