Friday, January 18, 2008

How Does the Binary System Work: An Introduction

Before you start reading this article, I want you to take a trip back into your past when you were being taught the decimal system. Personally, when I was in elementary school (in the 70’s/80’s), teachers used to use a column system to teach us about numbers:

[Thousands] | [Hundreds] | [Tens] | [One]
1 2 3 4

The number 1234 is - 1 Thousands, 2 Hundreds, 3 Tens and 4 Ones.

A few years later, we learned about the composition of the decimal system in a more complex way.

Thousands became 10^3 (10*10*10)
Hundreds became 10^2 (10*10)

… and so on.

1234 then became:


(1*10^3)+(2*10^2)+(3*10^1)+(4*10^0))

As you already know, counting in decimals is done by using 10 digits, from 0 to 9. Each time we jump a “column” (from 9 to 10), we add 1 digit to our total and reset all subsequent numbers to 0 (999 becomes 1000). The binary system works exactly the same way, but instead of using digits that goes from 0 to 9, we keep things simple and only use 0’s and 1’s, just like computers do. But the question you are probably asking yourself now is why do computers only use 0’s and 1’s? The answer is simple: electronic circuits. Circuits that make the wheel inside your computer turn can only have 2 states, on and off. Since a computer is mostly made out of electronic circuitry, it is logical that it uses the binary system to send, receive or compute information.

How does the binary system work?

Let’s start with what a binary number looks like:

01001010

“What the heck does this mean, and how do I represent this in more familiar decimal format” you ask. First, you have to know that each digit of a binary number is based on 2 to the power of x (as opposed to the decimal system that is based on the number 10). Here is a quick and easy chart you should study before continuing:

2 to the power of 0 = 1 (2^0)
2 to the power of 1 = 2 (2^1)
2 to the power of 2 = 4 (2^2) or (2*2)
2 to the power of 3 = 8 (2^3) or (2*2*2)
2 to the power of 4 = 16 (2^4) or (etc.)
2 to the power of 5 = 32 (2^5)
2 to the power of 6 = 64 (2^6)
2 to the power of 7 = 128 (2^7)
2 to the power of 8 = 256 (2^8)

2 to the power of x = (2^x)

Ok, let’s apply this chart to the binary number I gave a few moments ago to get us the decimal equivalent. All digits that are 0 remain 0, and are only useful as position placeholders. All digits that are assigned a value of 1 have a decimal value that is equal to the power (2^x) of their position within the chart.

128 64 32 16 8 4 2 1
————————————–
0 1 0 0 1 0 1 0

01001010 = 64 + 8 + 2

which means that 01001010 = 74

Simple isn’t it?

Now let’s do the inverse. To convert 74 to binary, you’ll have to start by finding the biggest power of 2 that is valued less then 74. Finding this number is important because it will determine the positive value at the left of your binary number. In this case, it is 64.

Let’s put a 1 in the 2^6 (2*2*2*2*2*2 = 64) position.

01000000

After, take your initial decimal number, and subtract it by the value you just found out. 74 - 64 = 10. Now, let’s do the same procedure as before. What is the biggest power of 2 that is valued less then 10? It is 8.

Put a 1 in the 2^3 position ( 2*2*2 = 8 )

…and continue doing this until the total equals your initial decimal number.

01001010

Even numbers always finish with a 0 and odd ones end in 1. This is because the rightmost digit in a binary number can only have a decimal value of 0 or 1.

As a non-IT person, there’s no real reason why you should know about how to do this manually, except to sound smart in front of your peers. Most modern calculators (including the windows one) can also accomplish these operations quickly and painlessly.

So why bother with all this? The answer is simple: Because you’re a geek (or an aspiring one)!

Ctrl + Alt + Del: The History

Here’s a short video in which David Bradley, the original inventor of Ctrl + Alt + Del, explains why this particular combination of keys came into existence. He then goes on about how someone we all know very well helped popularize the command.

This keyboard combination was implemented by David Bradley, a designer of the original IBM PC. Bradley originally designed Control-Alt-Escape to trigger a soft reboot, but he found it was too easy to bump the left side of the keyboard and reboot the computer accidentally. He switched the key combination to Control-Alt-Delete, a combination impossible to press with just one hand.

HOW TO: Delete an Undeletable or Locked File

Have you ever run into a situation where you wanted to delete a file, but Windows simply wouldn’t allow you to do it? Personally, these things happen to me all the time, especially when I’m at a client’s house trying to get their machine clean of malware. Have you ever tried deleting a locked file using common windows commands? If so, then you’ll know that this is just not possible.

The main reason behind this is that the explorer.exe process locks files that are in use, effectively preventing you from deleting them. Usually, these files should not be touched, but sometimes, situations arise when you really need to erase some troublesome ones.

Fortunately, there are a few easy solutions to delete those files.

Solution #1: Kill explorer.exe

  • Open a command prompt
  • Navigate to the location where the locked file is
  • Press CTRL-ALT-DEL, click on “task manager”, select the Processes tab
  • Kill the explorer.exe process via the “End Process” button
  • Go back to the command prompt and delete the file
  • Bring up the task manager windows again
  • Select file->new task
  • Type explorer.exe in the “create new task” field
  • Press OK.

Solution #2: Use The Windows Recovery Console

Just stick your Windows CD in your CD tray, boot on it, and at the “Welcome to Setup” screen, press “R“. Once the recovery console has started, navigate to the location of your locked file, and delete it. Since WRC does not really start the system, the files will not be in use, and you will be able to delete them

Solution #3: Use unlocker

Unlocker is a very useful freeware that will allow you to unlock any files that are currently in use by Windows. You’ll know if this is happening if you are getting any of these messages when trying to delete a file:

  • Cannot delete file: Access is denied
  • There has been a sharing violation
  • The source or destination file may be in use
  • The file is in use by another program or user
  • Make sure the disk is not full or write-protected and that the file is not currently in use

Unlocker will make things right again for you.

You’ll notice that right after installing the software, a new option named “unlocker” will appear when right clicking any files or folders in Windows Explorer. To unlock a locked file, just right click it, select unlocker, and the unlocker software will start. Then, click “unlock all” and close the software. Now that your file is unlocked, just delete it in Windows Explorer, as you always do. This is much simpler than solution #1 or #2, isn’t it?

I hope these three solutions will help you get rid of those hard to delete files. If you’ve got any additional suggestions, the comment section is open for your comments!

HOW TO: Move Windows shares from one computer to another

While moving your Windows shares from one computer to another might seem pointless for most people, system administrators see great value in doing it efficiently. It is particularly useful in situations where we have to move data from an old server to new one, and we want our users to keep on accessing their files through the same virtual locations.

Let’s say you’ve got a brand new quad-core server running in your server room and need to move files from your old Windows 2000 box to the new machine. First, be sure to create the same file system structure as on your other server (C, D, E, etc.). Then, just move (or restore) your files to the new server, making sure that files and directory permissions are transferred along with them.

If there was a directory named d:\users in the old system, the user directory must also be restored in the same drive on the new server.

Now that you’ve moved your files, start the registry editor and follow these simple steps:

(Warning: Serious problems might occur if you modify the registry incorrectly by using the registry editor or another method. These problems might require that you reinstall your operating system. Microsoft or I cannot guarantee that these problems can be solved. Modify the registry at your own risk.)

  1. Navigate to HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ LanmanServer \ Shares.
  2. Select the “shares” key and click files -> export. Save this file to the location of your choice.
  3. Do the same with the “security” sub key.
  4. Copy both files to the new machine.
  5. Log in into the new server and double click on the registry files you’ve just created (NOTE: You will lose all previously configured shares on the new system).
  6. Reboot the server, and voilĂ , the new shares should be there.

Now, the only thing that remains to be done is to modify your login script to point to the new server instead of the old one.

So, if your script contained something like:

NET USE M: \\oldserver\VOLUME1 /YES

Just change \\oldserver to \\newserver and your users won’t even notice their data moved.

A Call for Help: Save Windows XP!

Alas, if things do not change, Windows XP may currently be enjoying its last few months of existence. Even if it still dominates the market (76%), Microsoft has decided to stop selling the product starting June 30. From this point, updates and support for the OS will slowly start to fall into Microsoft’s room for retired projects.

As we all know, many people still prefer XP over Vista, and the Euthanasia of the OS is far from pleasing everybody. Fortunately, a bunch of journalists from the InforWorld magazine have decided to take the matter in hand and launch an online petition to keep XP from disappearing into Limbo.

For the magazine and many, many other Windows users, XP remains at the top of the hill when it comes to performance and stability, so why force people to adopt the newer, performance-gobbling OS? Of course, we all know the answer to that question, but this is not the subject of this article.

If you are interested in signing this petition, head over to Infoworld.com. Do your moral duty and help our old friend XP. It’s the least we can do! He’s been doing a hell of a good job after all.

Vista SP1 performance - Will SP1 and Windows 2008 come out tomorrow?

Robert McLaws ran a performance test with the refresh of Vista SP1 RC which I blogged about yesterday. He compared the performance with a patched Vista RTM using PCMark Vantage. This benchmarking program leverages specific Windows features such as Windows Photo Gallery, Windows Media Player, etc.). McLaws run this benchmark on systems with Vista x86 and Vista x64. The results are quite interesting.

On the 64-bit machine, he measured a 15% performance increase and on the 32-bit computer 11%. Considering that there have already been a couple of patches that are supposed to improve performance, this is not too bad. He mentioned the machines (Dell XPs 410 / Samsung Q1 Ultra), but doesn’t say anything about their hardware equipment. I am pretty sure that you won’t see the same improvements on every PC. However, I think it is a hint that Vista SP1 might perform a little better than Vista RTM.

At the peril of being accused again as a Vista fan boy, I have to say that I had no performance issues with Vista so far. Of course, I am running it only on hardware that is powerful enough. That is, all my Vista machines have at least 2GB RAM. Only when I test it under VMware Workstation, I work with 1GB which is enough if you only run a tool or 2 simultaneously.

McLaws also seem to have information that Vista SP1 and Windows Server 2008 will go to RTM tomorrow. Peder linked to an article over at Bink.nu mentioning the same release date (Jan. 16). It was already published 11 days ago. I am still a bit skeptic, but it would certainly be great if Microsoft releases these two products earlier than planned.

Update: McLaws just removed the article. Was it because he mentioned the release dates?

15 must-have Firefox tricks

What good is a browser unless you can tweak it, hack it and bend it to your will? No good at all. The more you can hack it, the better it is.

And that means that Firefox must be a great browser. It's infinitely customizable, via editing a text file called userChrome.css, making changes via a command called about:config, and using free add-ons to extend the features of the browser.

In this article, with those techniques and others, I'll show you 15 great Firefox tricks, including how to build your own Firefox search engine, how to speed up your browsing, how to hack the interface and plenty more. So launch your favorite browser, and get ready for some great tricks.

Editor's note: If you use Internet Explorer 7 instead of Firefox, check out these 8 top tips for IE 7





15 must-have Firefox tricks



1. Build your own Firefox search engine

Want to power up Firefox's search box? It's easy to create your own search engine, so that you can rifle through any site from right within Firefox. Adding a search engine that has already been written, of course, is easy. Click the down arrow to the left of the search box, select "Manage Search Engines," then click the "Get more search engines" link at the bottom of the screen. From the Web site that appears, click the search engine you want to install, and you're done.

There are plenty of sites that don't have prebuilt search engines, though. No problem: It's easy to build your own search engine. First install the OpenSearchFox add-on. Then, when you're on a search site, right-click the search box and choose the Add OpenSearch plug-in. From the screen that appears (shown below), type in the name that you want to be associated with the search engine, add a description of the search engine and click Next. Then click Finish, and the site will be added as a search engine that you can choose like any other -- by clicking the arrow to the left of the search box and selecting the engine.

Building your own Firefox search engine.
Building your own Firefox search engine. (Click image to see larger view)

Note that as of this writing, OpenSearchFox doesn't work properly with Firefox v. 2.0.0.10 or 2.0.0.11, although it may be fixed as you read this. When you use the add-on in v. 2.0.0.1 or 2.0.0.11, you'll get an error message after you click Finish, although in some instances, even if you get the error message, the search engine will still be added.

2. Use keywords to speed up your searching

Don't want to go to the trouble of adding your search engine -- or you can't get OpenSearchFox to work properly? Here's another way to do an instant search. When you're at a site, right-click on its search box and select "Add a Keyword for this Search." Type in a name for it and an easy-to-remember shortcut (for example, hp for the Huffington Post blog site). Then click OK. Now, to search the site, go to the Address Bar, and type in your shortcut, followed by a search term, such as hp Clinton. You'll search the site, just as if you were there. Note that on occasion, the search won't work properly, but it will on most sites.





15 must-have Firefox tricks



Friday, January 11, 2008

I -SOBOT

Would you like a miniature humanoid robot to imitate all your daily activities?

Then here it is. The i-SOBOT is a toy robot that will perform all your commands and is able to react in unpredictable, yet amusing and interesting ways. Its abilities vary from carrying your beer can to shooting an arrow and even shooting a hand made bazooka at a pre-determined target. The amazing thing is its wonderful precision.

isobot

This 6.5 inch robot is a remote controlled one and also reacts to your programmed voice commands. The first time I saw the video, I laughed at this little thing i-sobot. It actually seems as if the robot is craving some attention and in order to get it will do anything that may normally embarrass any of us.

You may read additional specification or even view some official demos at their site. If you are looking to get one of these robots for yourself, it is available at Amazon for approximately $200.

USB Mouse - To monitor your typing speed



Hi every one, Typing can some times get very boring especially if you are working on a long document in your office. Now with this USB Mouse you can have some fun while typing. What you do is simply connect the Mouse to the USB port and start typing your document. The faster you type, the faster he pedals! The LCD display will show how fast you are typing it. Now you can find out who really is the fastest typer in your office! Amazing right ?