OSH Park Just Got Bigger

Illustration

Last few years it got really easy to have your PCB manufactured in small quantities. All manufacturers shared similar price but each had its own peculiarities.

I find it very sad that one such manufacturer, BatchPCB, is closing its doors. It is not that I used them often. It is not that they were anything special. It is not even that they were cheap(er). It is just that I liked the choice.

Good news is that they were taken over by OSH Park. BatchPCB users can expect lower prices on smaller than 20 cm2 boards, they can expect ENIG finish (aka “gold”), and they can expect free shipping within USA.

Dream purple.

Dual Boot Windows 8 in Different Time Zones

Illustration

I spend my life in two time zones - CET and PST/PDT. Coincidentally I also have Windows 8 dual boot. I thought that it would be nice if each installation ran in its own time zone. I mean, how hard can it be?

I knew about RealTimeIsUniversal registry flag from a while back. I knew about some dangers involved with setting it. I knew why it is not UTC by default. I even knew that Microsoft does not really encourage use of that flag. But it seemed so perfect match for what I wanted to do - keep BIOS clock in UTC so that each Windows installation can have its own clock. If that meant that twice a year at 2 AM I would need to deal with broken system, so be it.

I carefully set flag in registry for both systems, rebooted, and went into despair mode. Using this flag caused whatever was local time on last shutdown to be used as UTC time on next boot. Every startup was bringing me further and further into past. It took me a while to find reason for it.

One benefit that Windows Time service provides is syncing back running clock value to BIOS on Windows shutdown. Since those two clocks are independent of one another and running clock is almost sure to be more accurate, this is something that you would expect and want. Unfortunately Windows Time service doesn’t care for RealTimeIsUniversal flag and thus it (incorrectly) writes local time. On next Windows startup that value is used (correctly) as UTC time.

One solution was to disable Windows Time Service and deal with another NTP client but I decided against it. I actually liked Windows Time service and its features, least of which is fully functioning SNTP server hidden deep inside. I simply decided that living in single time-zone would work just fine.

Difficult question is whether this behavior (or lack thereof) is a bug. I would argue yes.

I am aware that I used “feature” that was most likely someone’s pet project and never properly supported by Microsoft. I am aware that burden of compatibility with previous Windows versions will mean that UTC can never be default clock. I am aware that BIOS will show weird time that might confuse users. But I don’t care.

Any user that would like to have UTC time in a CMOS is not a sort of user that would be confused by BIOS time mismatch. It is most probably user that swears at Windows every time they boot Linux distribution of their choice. Or it is Windows dual boot user sick of Windows adjusting daylight saving for each instance separately.

And I don’t care that RealTimeIsUniversal is not supported. What is Microsoft waiting for? It is year 2013 and UTC has been with us for a long time now.

I don’t even care that kernel behaves correctly and it is Windows Time service at fault. Both components are part of Windows and they should work correctly together. We are not in world of legacy Linux distributions where Install All would fail with bunch of errors and developers blaming each other for using unsupported library. If Windows had one advantage it is integration of various parts in a single system. Don’t sell me that “component owner” story.

Will this get ever fixed? I doubt it. There is not enough people needing it and most of them are just used to current behavior anyhow. While this feature would bring harmony into Universe, 99.9% of Windows users wouldn’t even think about turning it on. Only way this will get implemented is if it becomes somebody’s pet project once more. And even then only to break once more in more distant version.

Consider this whole post as a grumbling of someone in need. :)

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. :)