Cheaper Windows

Illustration

Next version of Windows will be cheaper. At least that is how I understand it after Windows 8 engineering team brought us nice DVD playback guide.

DVD playback has it’s cost. And that cost was shared among all versions of Windows. Microsoft stated that $2 will get you MPEG-2 decoder. And frankly that is probably everything you need since PCM codec is available on every DVD for your stereo. Since Dolby codec is nice thing to have, let’s say that it costs additional $2 (Microsoft didn’t state cost).

My expectation is that next version of Windows will cost $4 less than Windows 7. If you are among those Windows users with lot of legacy MPEG-2 based media, you can upgrade your Windows for $5 (additional $1 is for covering distribution cost). I think that everybody wins!

And I am taking bets.

Who really thinks that Windows will be cheaper and that you will be able to buy DVD playback option for $5?

Quick, Hide It

Illustration

Last half of year I live in a hotel. I do not have my workbench here nor do I have extensive electronics part collection but I do have some basic equipment. And I do use it.

Pictured here is last thing that I made - voltage and current monitor. It has one input, three outputs, display and two switches (that I forgot to order). On bottom there is an PIC, sense and LED resistors. Pretty simple SMD board (45x72 mm) as it goes.

What it does? Basically it just displays voltage, current or power on it’s display for selected input or output.

Once I assembled it, I left it turned on for a while, pressing button here and there. Ok, since buttons are missing, pressing is probably not the correct word for what I was doing, but you get the drift. There is nothing like long-term abuse to bring code bugs out.

As I was leaving for work, I took one last glance at device, stopped, powered it off and hid it in the drawer. Call me crazy but I haven’t dared to leave it on like that for cleaning lady to see.

Somehow I think that she would only see some clock-like device with some wires coming out and numbers that change. Even more innocent-looking things were misidentified.

How Annoying Can You Get?

Most of my electronics is geared toward micro-controllers. And there my undisputed champion is Microchip PIC. They are cheap, full of options and readily available. And development environment is not too bad.

When I say not too bad, I think of MPLAB 8 IDE. Kind of old fella but it gets job done. I did try a beta of their flagship MPLAB X but we never clicked. It didn’t help that it would not load my projects either.

Since I was just starting new project it seemed like a good time to finally get newest and greatest IDE. So I went to their download page and I was greeted by total of 2:30 minutes of video with voice narrative.

I am not sure whether problem lies in me but stealing my speakers for something like download of a tool is ANNOYING. And, of course, some idiot decided to LOOP the video. Probably the same idiot who though that putting stop control was too much work. I though that kind of annoying behavior was reserved for porn sites but Microchip never ceases to amaze me.

Only image that gives me any peace is seeing manager whose idea this was in tenth circle of hell listening to these instructions over and over again. Well at least looping comes handy.

Get a Float From RandomNumberGenerator

Standard Random class works perfectly fine most of time. However, on bigger sample, you will see some non-random tendencies. Much better random source is RandomNumberGenerator.

Unfortunately RandomNumberGenerator does not actually return random numbers. It returns random bytes. It is our duty to change those random bytes to single double value ranging from 0 to 1 (as from NextDouble function).

Idea is to get 4 random bytes and to convert them to unsigned integer (negative numbers are so passé). If that number was to be in 0 to 1 range it would be enough to divide it by UInt32.MaxValue. Since we need result to be less than 1, we have slightly larger divisor:

private RandomNumberGenerator Rnd;

private double GetRandom() {
    if (this.Rnd == null) { this.Rnd = RandomNumberGenerator.Create(); }
    var bytes = new byte[4];
    this.Rnd.GetBytes(bytes);
    var number = BitConverter.ToUInt32(bytes, 0);
    return number / (UInt32.MaxValue + 1.0);
}

* Drive

It seems to me that Internet drives are everywhere.

For a while we had DropBox as undisputed king of remotely synchronized files. When it prove successful, we got bunch of others, among which SugarSync seemed like most serious contender.

This week things got interesting with Microsoft introducing SkyDrive. And today we got Google onboard with Google Drive.

Only company missing action is Amazon. Yes, they have their drive also but they are missing half-decent sync client.

With so many heavyweight players around, things are bound to get interesting soon. :)