Wednesday, December 31, 2008

When You Say 500GB, You Mean…?

While working on my new laptop (a post is forthcoming…), I installed a new hard drive in a bay adapter. I got the 500GB Western Digital Scorpio Blue (5400 RPM, SATA 3Gb/s transfer rate, 8MB buffer) for $115 at Amazon.

I mounted the drive into the adapter, plugged it in, created a partition, formatted it – and was left with 465MB of free space.

My first thought was WTF?! Where did 35GB go? I checked the HD’s property page, and the Vista “partition tax” (amount of disk space the OS uses to manage the partitions file allocation table etc.) is 104MB. While stiff, it didn’t account for the entire lost space.
500gbIt all stems from the little scam HD makers run on us:
Every little kid who ever handled any computer equipment knows that storage units are measured in powers 0f 2. 1024 bytes per KB, 1024KB per MB, 1024MB per GB, 1024GB per TB etc. HD manufacturers, on the other hand, use 10-base numbers (1000).

Thus 500GB for Western Digital is actually 500 * 1000 * 1000 * 1000 bytes. Divide that number by 1024 * 1024 * 1024 and you get 465.66.
So, whenever you purchase an HD, look at the promised capacity, and subtract 7% (multiply it by 0.9313 == 1000^3/1024^3) to get the actual capacity. And then subtract whatever “partition tax” your OS levies (for which the manufacturers cannot be blamed).

I wrote about this scam before (see item 1), but it seems like the lawsuit against Seagate did not deter anyone. At the bottom of the product page, WD provides some @$$-covering lingo:

As used for storage capacity, one megabyte (MB) = one million bytes, one gigabyte (GB) = one billion bytes, and one terabyte (TB) = one trillion bytes. Total accessible capacity varies depending on operating environment. As used for buffer or cache, one megabyte (MB) = 1,048,576 bytes. As used for transfer rate or interface, megabyte per second (MB/s) = one million bytes per second, megabit per second (Mb/s) = one million bits per second, and gigabit per second (Gb/s) = one billion bits per second.

Dear Western digital: the fact that you spell out your scam, does not absolve you. Why not just sell a 465GB HD instead?

My only question to WD is: next time I purchase any of your drives, can I pay you 93 cents on the dollar?

PS: this post was written in 30 minutes. Each minute contained 52 seconds… :)

Monday, December 29, 2008

Microsoft Product Code Tracker

I've been following Mary Jo Foley's Inside Microsoft blog (and earlier, her column), for years now. She has enough sources in Redmond, and enough knowledge about Microsoft, to call some of their moves well in advance.

Last month at PDC, I was overwhelmed by the number of technologies, products, frameworks, initiatives, etc. that were announced. Mary Jo's latest column attempts to put some order to the mess, by including a Code Tracker document, spelling out the code names, meaning and projected release date of each technology:
Can't keep Midori straight from MinSafe? Unsure how Red Dog, Cosmos and Zurich fit in Microsoft's cloud OS picture?

Tracking Microsoft's myriad codenames is an (almost) full-time occupation. And Mary Jo Foley knows that better than anyone, as she spends many of her waking hours tracking down the latest names in the hopes of being able to better keep tabs on what's coming next from the Redmondians.
Here's a link to the helpful PDF file (I copied it to my SkyDrive, just to save you the need to register to ZDNet to get it).

Saturday, December 27, 2008

Surf Privately

The new generation of browsers provides a way to surf in private. The browser makes sure your browsing history is not saved to local disk, nor will any cookies or offline files retained when you’re done. This can be useful when using someone else’s machine, or at an internet cafe. While some surfers jokingly call it “porn mode”, try thinking about the amount of information you leave behind when browsing to your bank account, or online email.

In this post, I’ll explain how to use private browsing in your browser of choice, and how to enable it by default. I’ll finish with a tip that will allow you to browse in private whenever you’re on the road.

The browsers I’ll cover are Firefox (version 3.1 beta 2), Google Chrome (v 1), and IE8 (beta 2). Current generation browsers still do not support this feature, and I found it compelling enough to get me to upgrade.

  1. IE8
    Mode name: InPrivate
    inprivateHow to start it: select “Private Browsing” from the “Safety” menu, or click Ctrl+Shift+P. This opens a new window
    How to enable it by default: right-click the icon you use to lunch IE. In the “Shortcut” tab, add the string “ -private” to the target field, and click “Ok”:
    inprivate2From now on, IE will always start in InPrivate mode.
    Learn more about it: type about:inprivate into the address bar

  2. Chrome
    Mode name: Incognito
    incognitoHow to start it: select “New Incognito Window” from the wrench menu, or click Ctrl+Shift+N. This opens a new window
    How to enable it by default: right-click the icon you use to lunch Chrome. In the “Shortcut” tab, add the string “ --incognito” to the target field, and click “Ok”:
    incognito2Learn more about it: here

  3. Firefox
    Mode name: Private Browsing
    privatebrowsingHow to start it: select “Private Browsing” from the “Tools” menu. This will close all your open tabs and reopen the window. When you’re done, uncheck “Private Browsing” and your tabs will be restored
    How to enable it by default: Firefox does not provide a command-line parameter. Instead, type “about:config” into the address bar, and click Enter. Click the “I’ll be careful, I promise!” button. Type “Private” into the filter field, and change the value of browser.privatebrowsing.autostart to “true” by double-clicking it:
    privatebrowsing2 Learn more about it: type about:privatebrowsing into the address bar

Note: private browsing does not mean the server side cannot collect information about you – it just protects the client side (to protect the server side, read How to hide your IP). Also notice, that if you’re prompted to save a password while in private browsing mode, just say NO. The browser will retain passwords that it’s told to save, regardless of the mode.

And a final tip (good for IE8 and Chrome only): remember those 2 shortcuts we’ve altered, to start in private mode by default? Copy those shortcuts to your USB drive. When next you find yourself using a stranger’s machine, just start the browser from those icons. Chances are that the browsers are installed in the same directories on every machine (and if not – such as in the case of 64 bit operating systems, that install to “Program Files (x86)”), just alter the path to fit.

Saturday, December 20, 2008

Gadget Review - Belkin Conserve Surge Protector

I have several devices that keep sucking electricity, even when they’re off. I’m sure you all have several devices around the house that have a standby mode (little test: turn off the lights, and count how many LED lights do you see around your place).

Living in California, with all the planned and unplanned electricity black outs and brown-outs, using a surge protector is a must, unless you want to stare at a smoldering heap of plastic, after a nasty lightning storm. So all the devices in my living room are plugged into one big surge protector.

There are some devices (like my cable modem and wireless router) that I want to stay constantly on, so turning off the entire surge protector when I leave my living room. On the other hand, constantly plugging and unplugging devices is not really comfortable.

Along comes the Belkin Conserve surge protector. It has a remote control, allowing you to turn 6 of its sockets on/off with one click. The other 2 sockets remain on even when the others are turned off. It’ll cost you $30 on Amazon.

I’m waiting for the bigger model to drop in price – it has 10 sockets, and a cable protector - so I can attach the rest of the devices in my place. You can have more than one in the house – the remote has a code in the back allowing you to choose which surge protector it controls.

I've been using it for a week now, and it works like a charm. I installed my remote next to the door, and I just click it off when I leave the apartment. I give the Belkin Conserve 4 stars, since the remote is a bit plasticky and toyish (although it’s essentially one big button).

How to Resize a VMWare Virtual Disk

My trusty Win 2003 VMWare machine, which I use for testing server side technologies, just ran out of space. I didn’t feel like adding another virtual disk, or reinstalling stuff. So I started searching for a way to increase the size of the disk.

After several hours of reading articles and searching forum posts, each solving one piece of the puzzle, I collected enough clues to solve the issue.

There are 2 parts to resizing your virtual disk:

  1. Resize the actual disk. That can be achieved by creating a new virtual disk and copying the contents from the old one. But no one, including VMWare, promises that would work. But VMWare supplies a utility called VMWare-VDiskManager that gets the job done quite well. It comes as part of VMWare Server or Workstation.
  2. Increasing the size of the main partition to use the newly available space. All articles recommend using a 3rd party partition management software.
    I have a copy of Norton Partition Magic, but it’s limited to client operating systems – no luck with my Win 2003. Other partition management software for “servers” is quite costly (I’m using “servers” because it seems like these applications are crippled on purpose, to allow vendors to charge more for a server version. There’s absolutely no difference between NTFS of Windows XP and 2003).

    I then tried using DISKPART – the built in Microsoft tool, available in XP and higher. The problem is, DISKPART does not allow resizing the boot partition.

    After some research, I found 2 open source partition management utilities that do the work with minimal hassle.

Here it is then, the step-by-step guide to increasing my VDisk from 10GB to 15GB:

  1. Backup – I can’t stress it enough: backup you VMWare before trying anything. The following actions are irreversible, and potentially damaging.
  2. Shut down the OS in the virtual machine, stop the virtual machine and make sure all snapshots are saved.
  3. Open a CMD window, and CD to C:\Program Files\VMware\VMware Workstation.
  4. Run the following command, substitute 15GB with whatever size you want, and the path with the path to your VDisk file:
    vmware-vdiskmanager.exe -x 15GB "f:\My Virtual Machines\Win2003-R2\Win2003.vmdk".
  5. Go and drink a cup of coffee – this command may take a while to execute (it took 20-25 minutes to complete in my case).
  6. Download the freeware Partition Logic, in either floppy disk image (.img file), or CD image (.iso).
  7. In VMWare Workstation, select the floppy disk device, and select to have the device connected at startup, and pointing to the image you just downloaded.
    vmware floppy
    Similarly, you can use a CD image – just make sure your VM is configured to boot from the CD.
  8. Start up the machine, and you’ll get into the main screen of Partition Logic. Select your partition and resize it. You’ll have to manually type the size, in MB, cylinders, or sectors. just type the maximum number in either.
    Partition Logic
    Wait for the operation to finish successfully.
  9. Reboot the machine. You may be required to restart it again (Windows will “discover a new device” and ask for a restart).

Et voila! A new, larger disk, waiting for you to fill it up…

PS: the second software you can use, instead of Partition Logic, is called GParted - it looks better, but the end results are the same.

Thursday, December 18, 2008

Back to Basics

Like many computer enthusiasts, I started my programming career learning BASIC. I was 11 and my community center offered "programming lessons". I was into electronics at the time, and was well on my way to complete my first radio, when I peeked into the adjacent class one day, and saw a device that had more buttons than the device I was tinkering with.
It was love at first sight.

The first computer I learned to program on was an 8-bit, 32Kb RAM BBC model B. The language was BASIC. My first program was the BASIC version of the quintessential "Hello World" program:
20 GOTO 10
The program filled the screen with endless lines of text (at least until you hit the "break" button) and my heart with joy.

Fast forward 2 years. My parents get me my first computer, an Apple IIc. All their friends advise against it - they claim it's too much to spend on a toy. I spend years taking AppleSoft BASIC to the limits, breaking some of its rules along the way (if you've ever developed in AppleSoft, I'm sure you're familiar with the peek and poke commands), before graduating to PASCAL. The Apple also introduced me to the mouse (well before a PC had one) and the concept of a mobile computer (while not truly a laptop - it lacked a battery - the IIc had a small, foldable screen, and a laptop factor).

At high school, I dabbled a little in GW-BASIC and MS-BASIC - but the magic was gone. It was time to move on to C.

Years later, a surprise revisit: Visual BASIC. It was the best and easiest way to get into internet programming. With easy-to-design clients, VBScript on the server side, ADO to simplify data access... Until today I use VB 6 to slap together fast mockups that are actually functional.

My language of choice now is C#. Yes, VB.Net is there, but it's not the same anymore. Fully object oriented, and the use of goto is frowned upon (although if you ever developed a compiler, you realize it still has its moments). And then, just the other day, I got a link to a new Microsoft project called Small Basic.

The idea behind the project is to create a language and IDE that would introduce a new generation of kids (and kids at heart) to the joy of programming (and pay attention to the fact I'm not saying "developing": development is work, programming is fun). It's easy and simplified on one hand, actually borrowing turtle graphics from LOGO. On the other hand, it provides a deep set of features, such as multimedia capabilities, graphics, access to Flickr, and other innovative packages.

Most of all, I like the IDE. It's simple, clean, and with the best text completion implementation I've ever seen:
Above you can see my Small BASIC "Hello World", and the text completion "wheel" in action.
The IDE depends on .Net Framework 3.5 and the download is 4MB (in this day and age of bloatware, a miracle in itself). You can find it here. Currently it's at version 0.2.

I really hope that this tool will introduce a new generation to the wonders of programming. As for me, I'm falling in love again...

Sunday, December 14, 2008

Eating Like a Geek

I've yet to write a restaurant review. Truth to tell, I'm not a food connoisseur - I'm more of an omnivore, doing my best to avoid just fast food - an uphill battle, in some corners of the US - and sea food (my motto: anything that lives in the ocean, should stay in the ocean).

But when I heard that uWink is opening a branch near me (through this Wired article), I had to go and check it out.

uWink was created by Nolan Bushnell (famous for creating Atari), and it's a geek heaven: you order and interact through a touchscreen (hiding a Mac Mini). You can choose from several menus (regular, pastas, chef's recommendations etc.) or drinks. You also pay through the terminal, and prove your age - for alcoholic beverages purchase - by swiping your driver's license.

While your food is being prepared, you are encouraged to play a game on the screen - solo, or against your fellow eaters. The games are fun and engaging, so I discourage bringing a date to this restaurant, unless you want to sit with 2 monitors between you smile.

In fact, your only interaction with a human being, is when you are seated and walked through using the system, and when your food is served. Regardless of the limited interaction, the computer system will recommend a 15% tip at the end (but would allow you to dial it down or skip it - I wonder if it saves your name in its DB under "cheap" if you do smile).

But the feature I liked was the ability to "configure" certain dishes. I chose a burger and had tens of options: how will it be cooked, sides (I highly recommend the sweet potatoes fries), toppings, sauces, buns, cheeses... Millions of possible combinations. Same for the drinks and cocktails.
Prices are reasonable, and the atmosphere is nice, considering it's a huge space full of tables with touchscreens.

Currently, uWink has only 3 branches - 2 in LA and one in Mountain View. Hopefully, they'll open more. This unprofessional restaurant critic gives uWink 2 thumbs up.

PS: About the only regret I have about uWink's location, is that it replaces a Californian Bar & Grill that I liked. I hope they just moved and didn't go bankrupt.

Wednesday, December 3, 2008

Vista SP2 Beta Available

Microsoft just announced that the beta for SP2 for Vista and Windows 2008 will become available to MSDN subscribers on Thursday (they call it CPP = Customer Preview Program).

The installer will include the SP for both operating systems, as well as all previous updates since SP1.

Amongst the new features you can find:
  • Better Wi-Fi connectivity (as well as a new Wi-Fi connection wizard called WCN = Windows Connect Now)
  • Support for non-Intel CPUs (Like the 64bit VIA)
  • Support for Bluetooth 2.1 (including BT stereo etc.)
  • Support for a new file system called exFAT (sounds like a diet plan to me smile) for Flash memory devices
  • Hyper-V support for better virtualization
  • An improved installer that can remove software and restore the macine to pre-SP2 state
Read this for a full list, including download sizes and installation instructions. Noticeably missing are any promisses of performance iimprovements. For that you'd have to wait for Windows 7, I guess wink.

Microsoft would like everyone to install and test the beta as soon as possible, and start sending them feedback. Rumor has it that the proposed release date is April '09.