Switching Quickly Between Windows

Here’s another shortcut that everyone should learn. It’s a godsend if you’re switching repeatedly back and forth between two windows, and useful even if you aren’t.

1: Alt-Tab
Pressing Alt-Tab will allow you to switch windows to the most recently used window. If you continue to hold down Alt after releasing the Tab key, the window switcher will remain open and allow you to select any other window as well.
If that sounds confusing, try it out, and it will become clear immediately. (Mac OS X users: Use Command-Tab instead of Alt-Tab.)
The behavior of Alt-Tab is actually a lot more complex than it looks–if you’re interested in the details, see the Wikipedia article. But the main thing you should remember is that it lets you easily toggle between two windows. Next time you have to copy and paste text several times between windows, try pressing Alt-Tab instead of clicking each of the windows in turn, and keep your hands off the mouse!


2: Similar Shortcuts
On Windows Vista and 7, Windows-Tab (the Windows key is often labeled with a flag icon) will do roughly the same thing, but display a fancy Rolodex-style preview of the window. On earlier versions of Windows, pressing Windows-Tab will select each program on the taskbar in turn; you can press Enter to select one.
Alt-Tab is really handy in keyboard macros, which I’ll probably write an article about later on.

A Little Refreshment: Reloading the Current Page

If a website has changed, you often don’t see the changes right away. A few sites, such as Facebook, do dynamically update the website, which usually makes this tip unnecessary. However, occasionally Facebook and similar websites do fail to update, and most websites will still need manual refreshing. Here’s what to do if you suspect the website on your screen isn’t the most recent version.

1: Refreshing a Page
The Refresh button has been moved all over the screen by many major browsers lately. It’s usually either next to the Back and Forward buttons or at the end of the address bar. Here are screenshots for Chrome and Firefox.

To reload the page, just click the button. Most of the time this will load the most recent copy of the page with no problems.

2: Really Refreshing a Page
Sometimes your browser thinks it’s smarter than you, and when you push Refresh it just loads a copy from your computer’s cache. (The cache stores copies of frequently accessed Web resources on your computer so that pages can be loaded more quickly.) So even after you’ve pushed Refresh, you may not actually have the site’s most recent version.

If you’re suspicious that you still don’t have the latest version of a site, simply hold down the Ctrl key while hitting Refresh. This will disallow loading from the cache and force a full copy of the page to be downloaded from the Web. (A few browsers use Shift instead, so if it still doesn’t work it can’t hurt to try that as well.)

3: Keyboard Shortcuts
I’m a big fan of keyboard shortcuts. I use Refresh several times a day, so I get really annoyed by having to try to click the button every time I need it, especially since it’s in different places in different browsers. So the handy shortcut for Refresh is F5. (This also works in combination with Ctrl; see section 2.)

If you don’t like F5 for whatever reason, a few browsers also accept Control-R.

4: Refreshing Other Stuff
The refresh concept (and the F5 keyboard shortcut) also works for folders on your computer. If you save a new file in a folder, for example, but currently have a window open showing that folder, the folder may not display the new file. Pressing F5 will tell it to look for files again, thus showing your new file. If your desktop isn’t displaying changes, you can use this trick there too: click anywhere on the desktop, then press F5.

Soren “scorchgeek” Bjornstad

If you have found an error or notable omission in this tip, please leave a comment or email me: webmaster@thetechnicalgeekery.com.

Copyright 2011 Soren Bjornstad.
Verbatim copying and redistribution of part or all of this article
is permitted, provided this notice is preserved.

Two Shortcuts for Working with Files

Ever opened up a really, really long list of folders and hunted through the list trying to find a folder or file? Or maybe the same thing happened on your desktop–you know the name of what you’re looking for, but you can’t see it. Here’s a better way.

Tip 1: Jump to a File or Folder by Typing its Name
This trick is so simple you’ll probably be surprised you never knew about it. If you know the name of a file or folder located in the folder you’re currently browsing, but you can’t see it, simply click once on any file or folder you can see, then start typing the name of the folder. You’ll be moved to the folder as you type. (Don’t stop typing for more than a second or so, or the search will start over.)
This works in a File –> Open dialog box, in a Windows Explorer/Finder/Nautilus window, or on your desktop, in all operating systems.
Tip 2: Rename a File Quickly
Renaming a file can be a little bit annoying sometimes, especially if you have to rename quite a few files. You can right-click it and choose Rename, or you can click twice slowly on the name of the file. Either way, the process requires some clicking, and if you’re renaming a bunch of files you have to keep switching between the keyboard and the mouse.
Instead, just select the file and press F2.
Soren “scorchgeek” Bjornstad
If you have found an error or notable omission in this tip, please leave a comment or email me: webmaster@thetechnicalgeekery.com.
Copyright 2011 Soren Bjornstad.
Verbatim copying and redistribution of part or all of this article
is permitted, provided this notice is preserved.

How Computers Count, and How You Can Do Cool Stuff With The Same Techniques

(I’ll get to that intriguing image later, don’t worry. I can’t put an image in the middle of my post, apparently.)

This is part one of an eventual series explaining a bit about how computers work internally. In this article, you will learn how to count to very high numbers on your fingers, and how to easily compact six yes/no values (do I need to bring x, y, and/or z home with me today?) into a single number for easy remembering. You’ll also learn how this relates to the way computers work.

Hack 1: Counting to 1023 on your fingers
Ever needed to keep a quick tally of something but didn’t have any paper handy? Counting on your fingers is a really easy way, but it’s limited by the fact that we only have ten fingers (well, most of us, anyway). You could get clever and count to five on your right hand, then raise one of the fingers on your left hand to represent five. But even that system only gets you up to thirty.

The way I can get to 1023 (which is certainly more than you will ever need) is by using the binary number system instead of our usual (decimal) numbers. Here’s a brief explanation of it, if you’ve never seen it:

In decimal, the second place represents ten of the first place. In other words, in the number 13, the 1 has ten times the value of the three. If we didn’t know how the system worked, we could interpret the value of 13 by multiplying the 1 by ten, and the 3 by one, and adding them together: (1 * 10) + (3 * 1) = 10 + 3 = 13. Each new place multiplies the value of the previous place by ten, so we have the hundreds (10 * 10) place, then the thousands place, and so on.

In the binary system, the second place represents two of the first place. So the binary number 10 can be converted to a more familiar decimal by multiplying the twos place by two, and the ones place by one: (1 * 2) + (0 * 1) = 2 + 0 = 2. Each new place doubles the value of the previous place.

More concisely, the values of the places in the two systems are:
Decimal: thousands, hundreds, tens, ones
Binary: eights, fours, twos, ones

Obviously, binary is a lot less compact, since it only has two possible values for each place, 0 and 1. However, it has some great advantages as well: The 0 and 1 can just as easily represent off and on, which gives it the potential to work for both of these tricks.

To count to 1023 on your fingers, use your rightmost finger as the ones place, and keep working on up. That little picture at the top of this post shows the values that you would assign each finger (obviously you probably won’t have the diagram when you need to use this method, but each finger is just twice the value of the one before it, so you can calculate it in your head fairly easily).

To count to, say, four, start by raising the 1 finger. Then lower it and raise the 2 finger. Then raise the 1 finger again. Then put down both the 2 and 1 fingers and raise the 4 finger. Obviously, this process can be continued indefinitely.

Hack 2: Storing Multiple Numbers in One Number, or How To Know What Classes You Have Homework In
I have a problem: During a typical day at school, I forget what classes I need to bring books home for. This results in wasting time at my locker (which is bad when I have a bus to catch) while I try to read my planner and see what I wrote down. And of course I can also forget to write something down thinking I’m sure to remember it.

I tried to solve this by spending a few moments reading my planner and thinking over everything I was supposed to do before I left my last class. But I often forgot in the few minutes between there and my locker. Then I had an idea.

I have six classes that I might need to keep track of. I have more than six fingers. So I assigned a finger to each class (in the order that I go to them during the day). If you add up the numbers for those fingers using the diagram, you’ll get a unique number representing that permutation. A single number is a heck of a lot easier to memorize than yes/no values for six pieces of information. You can even use some fancy mnemonic system (like the Major System) if you need to remember the number for a while.

Of course, the entire system is useless if you can’t convert the number back into the information you were trying to memorize. But that’s easy enough.

1. Find the highest power of two that is less than the number you memorized (for instance, if my number is 58, the qualifying number is 32, as the next one, 64, is too high).
2. Raise the finger representing that number, and subtract the number from your memorized number.
3. Repeat until you hit 0.
4. Use the arrangement of fingers to reproduce the original information.

Does this seem awfully complicated? Yes, it does. How about an example?

My classes are:
World Lit
U.S. History

Each of these gets a number, starting from the top.
Calculus (32)
World Lit (16)
U.S. History (8)
Speech (4)
German (2)
Physics (1)

Today I had homework in calculus, world lit, history, and German. So 32 + 16 + 8 + 2 = 58. 58 is “sushi” in my mnemonic system, so that’s all I have to remember to know what books I need. Of course, I can start with 32 after my first class (or, preferably, 0, if I don’t have any homework) and add to it as the day progresses, to keep a running total.

When I need to know what books I need to bring, I take 58, raise my left thumb (which represents 32), then subtract 32 from 58, leaving me with 26. Then I raise my right thumb and subtract 16, leaving me with 10. And so on. The math only takes a few seconds.

Naturally, mine is not the only application of this system. There could be numerous more situations like it, and maybe you can think of one.

What The Heck This Has To Do With Computers
This article is only partly about a few silly (though occasionally useful, at least to me) tricks–it’s a computer newsletter, and needs to be at least tangentially related.

Binary is the system that a computer uses internally to represent numbers (and everything else). If you wrote a program that simply counted up to infinity (or rather, until the computer ran out of memory), it would internally do something almost exactly like my finger-counting process, the only difference being that the changes are electrical charges moving on a microscopic scale rather than fingers. (Adding and manipulating those numbers is quite another matter, and while it’s quite interesting, it’s not well-suited for an easy-reading newsletter.)

As for the other hack, it relates to a common programming trick. When you define an integer to store a number (if it’s been too long since algebra, an integer is a positive or negative number with no decimal places), the computer sets aside a certain number of binary bits, typically 32, to store the number. (A bit is either a 0 or a 1, a single binary digit; a binary 1 would be one bit, while a binary 1010 would be four bits.) This way, it can store any number between 0 and 2147483647. (Lost in the technical talk? Jump down to the next paragraph.)

All this is to say that if you store a value of 1 (which uses only one binary bit), you’re using thirty-two times the amount of memory that you need to. That doesn’t sound particularly significant, but when you start storing thousands or millions of pieces of information in a database or other file, you want to conserve as much space as possible.

So instead you can use a method similar to what I described above. The computer uses a different process involving binary numbers and Boolean logic, which is technical enough that I’ll spare you from it, but the basic idea is the same–pack a bunch of different numbers (or, in my case, yes/no situations represented by ones and zeroes) into a single number.

(Phew! I’ll have something a bit simpler for you next week, but I hope you learned something from this.)

Soren “scorchgeek” Bjornstad

If you have found an error or notable omission in this tip, please leave a comment or email me: webmaster@thetechnicalgeekery.com.

Copyright 2011 Soren Bjornstad.
Verbatim copying and redistribution of part or all of this article
is permitted, provided this notice is preserved.