Wednesday, June 30, 2010

Ascii Char/Decimal/Binary Converter

A very simple converter.
Now you can easily read binary :D
"There are only 10 types of people, Those who understand binary, and those who don't."

Download Executable
Download Source Code

Convert characters to decimal and binary ascii code representations, convert decimal numbers to binary numbers and characters of the corresponding ascii code, and convert binary numbers to decimal numbers and characters of the corresponding ascii codes:

Conversion from decimal to binary

Psuedo Code:

do
{
    bin = ((dec % 2 == 0) ? "0" : "1") + bin;
    dec /= 2;
} while (dec != 0);


C# Syntax:

private string DecToBin(long dec)
{
    string bin = string.Empty;
    string zero = "0";
    string one = "1";
    do
    {
            bin = string.Format("{0}{1}", ((dec % 2 == 0) ? zero : one), bin);
            dec /= 2;
    } while (dec != 0);

    return bin;
}

Sunday, June 27, 2010

Ubuntu under Windows: Use VirtualBox

I've been trying to install and setup Ubuntu 10.4 as a guest OS under Microsoft VPC 2007 on a Windows XP host, it's been a real hassle I have to say until I finally gave up and switched to Oracle VirtualBox instead. Everything went smooth afterwards on VirtualBox.

Presently, VirtualBox runs on Windows, Linux, Macintosh and OpenSolaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista, Windows 7), DOS/Windows 3.x, Linux (2.4 and 2.6), Solaris and OpenSolaris, and OpenBSD.