Friday, February 20, 2009

HOW TO Windows: Add a "Delete Folder Contents" command to the right-click menu.

cmd /c "cd /d %1 && del /s /q *.*

(Note: this how-to requires you to edit your registry. You should ALWAYS back-up your registry before editing it. Don't complain at me if Windows stops working because you added or deleted the wrong key and can't fix it.)

1. Open the registry editor (type "regedit" in the Search box or the Start|Run box). Navigate to HKEY_CLASSES_ROOT\Directory\shell.

2. Right-click on shell and add a new key. Label it "Delete Folder Contents".


Now right-click on Delete Folder Contents and add a new key, labeling that key "Command".


3. Double-click on (Default) in the right-hand pane and type cmd /c "cd /d %1 && del /s /q *.* .


That's it. Now, when you right click on any folder, you'll see that "Delete Folder Contents" has been added to the context menu. Clicking on it will delete every file and folder in that directory.

Thursday, February 19, 2009

HOW TO Notepad: Auto-Timestamp a Text File.

.LOG

This is a useful little trick if you regularly use a simple notepad file to keep a list, like a "to-do" file, or a personal diary.

1. Open a new notepad file. Type .LOG, then enter one carriage return (hit the Enter or Return key).

2. Save, name and close the file.

3. Now reopen the file. You'll see that notepad has automatically inserted a time/date stamp.

Notepad will once again place a time/date stamp at the bottom of the text file every time the file is reopened, as long as .LOG remains at the head of the file. You can type any information you wish after the time/date stamp; after you save, close and reopen the file, a new time/date stamp will be inserted at the bottom of the page.

Wednesday, February 18, 2009

HOW TO HACK: Prevent an elevator from stopping at any floor except your destination.


The Close Door Button and Your Destination's Button

This is a trick left over from the days of swanky hotels when a bellhop would use it to prevent a V.I.P. from having to share an elevator with a commoner. By holding down your destination and the close door button at the same time, you'll prevent the elevator from stopping on any other floor. You'll find this trick works on most name brand elevators (including Otis and Dover) though it can be turned off by the building engineer. Still, you may find this trick extremely helpful at noon when you're trying to leave the building for lunch.

Tuesday, February 17, 2009

HOW TO Excel: Cut a list of variable length cells into two pieces.


=LEFT(x,LEN(x)-y) (see this post)

- and -

=RIGHT(x,LEN(x)-LEN(z)) OR =MID(x,FIND("w",x),99)

The first formula will produce the first half of the broken text string. x is the cell containing the full text to be broken. y is the number of characters in the text you want to be in the second column.

If you've applied this formula and not made any manual changes on any lines, then the first of the other two formulas should work perfectly. x is still the cell containing the full text to be broken. z is the cell in which you placed the previous formula. This formula essentially says "return a number of characters from the right equal to the first cell minus the second cell."

If you needed to make some manual changes to the previous formula because a few of the lines didn't come out exactly the way you wanted, then you may need to use the second formula. In this case, x means . . . exactly what it meant before. But w is the first character in the text where the break should occur. (Note that this obviously means that all text lines should contain a specific character where the break should occur, and that character should only occur once in each line; or at least it should be the first occurrence of the character in that line. Otherwise, you'll return errors.) This formula says "Find w in the first cell. Then, return that character and up to 98 more after it."

Example: let's return to our list of movies from the hard drive. As you'll see, the first formula has been entered into Column B, producing our list of movies without the extension. (To see how to do this, visit this post.)

Because this formula worked well for our tiny list, the first of the two latter formulas should work just fine. By applying it in the C column, we can see that the formula has correctly subtracted the text in Column B from Column A. (Note that I added "-1" to my version of the formula - I did this to remove the stray space that would have appeared before "(1984)", since we cut that space out of Column B.)

But what if this didn't work? What if you had problems with the first formula because (for example) the lengths of a few of your extensions were different, and you had to fix those few lines manually? In that, case, you could try using the second formula. It does work just fine here - I only use it as a second option because it's a little more complicated and it has the character requirement mentioned earlier. Here you can see I've applied this formula to Column D.

Perfect. Now if I copy and paste these formulas down through my list . . .

Column A has been successfully broken into B and C (or D).

Monday, February 16, 2009

HOW TO DOS: Make a list of files in a directory.


DIR >file.txt

file will be the name of the text file containing your list of files. And yes, the list of files will include this file, so you may want to delete it from the list if and when you begin editing it.

(Note: if you were not intimidated away by the word "DOS", you probably already know how to reach a DOS prompt in Windows. But in case you don't, click on the Start button (and then click "Run" if you're in Windows 98 or XP) and in the search box type CMD. When you're done using DOS, type exit to close the DOS window.)

1. Using drive prompts and the cd command, navigate to the directory where your files are located. (Again, if you're unfamiliar with DOS, here is a list of DOS commands. To change drives, type c:, where c is the drive letter where you want to navigate. To change directories, type cd directory, where directory is the name of the file folder. You may need to use this latter command multiple times to reach your target folder.)

2. Type the above code. You'll notice that nothing appears to happen; that's because the DIR command, which would normally produce a directory listing on the screen, is instead outputting to the text file you specified. (Incidentally, if you have a printer on LPT1, you can use DIR >PRN to send your directory listing to the printer.)


3. You can now open a text editor like Notepad, or an Office suite program like Word or Excel, to view, change and print the contents of this file.

Saturday, February 14, 2009

How to get a job in a rough economy.


break every rule you've ever been taught about job-hunting.


(disclaimer: If you're here looking for the short bursts of code and computer help I usually offer, rest assured they'll return on Monday. I'm reserving Saturdays for a more philosophical (and verbose) "How To" and Sundays for a wrap-up of interesting "How To"s I found in other peoples' blogs.)

All of the advice you tend to get when job-hunting appears to be of the "try not to piss off a potential employer on your way to impressing them" variety. Suit, white shirt, tie. Polished shoes. Resume one or two pages, on watermarked paper. Arrive five minutes early to your interview. And for Godssake, don't do or say anything controversial.

This is generally awful advice for landing a job, but when times are tough, it's practically a guarantee for failure. The people giving this advice forget that hundreds of millions of people are following the same advice at the same time. That means that, if you're one of ten people up for a job, then you're one of ten forgettable drones all acting the same way. If you're remembered for anything, it will probably be that you were so nervous about saying or doing the wrong thing during the interview that you looked like you needed to throw up the whole time.

So, if you haven't had a lot of luck in your job hunt, then it's time to break out of that mold and become the only one in ten that your potential future employer remembers. And to do that, you'll have to break every rule you've ever been taught about how you should dress or act for an interview.

This isn't to say you should throw away all logic and sensibility and act like a cretin; rather, treat your interview like a date instead of an interview. Dress and act like a slightly more professional version of yourself, but don't drown yourself out. If you hate wearing ties, don't wear a tie. If you're a HUGE fan of Star Trek, and you've got a Star Trek pin, then wear the damned thing. Relax and enjoy the interview, as though you were at the other side of a table at a nice restaurant with an attractive date. Lean back in your chair. Smile. Give your interviewer honest and interesting answers to her questions, even if you think the answer might not be "interview-worthy". Be totally honest. Make her laugh. Surprise her, even shock her. As long as you're being yourself, feel free to do it.

This will accomplish a number of things. First, if you're being honest from the beginning then your interviewer will never trap you in a lie. Second, being yourself will make you more relaxed, which will in turn give you more confidence. Third, you'll stand out memorably from the other nine people who acted and responded woodenly throughout their interviews. And finally, and perhaps most importantly, your interviewer will realize that you're a fun and interesting person. Think about it: if you had to choose between two people of equal qualifications with whom you would have to spend eight hours a day in an office, would you rather pick the relaxed, fun, interesting one; or the one who clearly memorized every line of The Jobhunter's Bible?

Here are a few more tips, related to my above point, that will help you land your perfect job:

1. Negotiate from a strong position. That is, don't job hunt while you're out of a job and desperately in need of one. If you do. then you'll say and do stupid things during your interview out of pure fear. It'll also prevent you from trusting your instincts and making honest judgments about whether you should really be working for this employer.

2. Be willing to walk away. Just as on a date, you're not just there to impress her. She's there to impress you. If she or the job or the company is not impressing you, then feel free to politely tell your interviewer that you're not interested and thank her for her time. Remember that you'll ultimately be spending a third of your day at this job with these people; better to go a few extra days jobless than spend a year or two in a job you loathe.

3. Before you even contact the company, spend an hour learning about them. Find something, or several things, about that company that excites you. Feel free to mention those things in your cover letter and in your interview.

4. Extend your relaxed approach to the cover letter on your resume. Once again, you'll want to use basic common sense, but personalize your cover letter to make it sound like you wrote it yourself instead of copying it out of a job hunting manual. In particular, you should never, never, NEVER use the same cover letter for two different jobs. Don't even use one as a template for another. Delete after printing.

5. Design a second resume, something that shows off your strongest skill set. If you love Excel, design a multi-page spreadsheet; if you love PowerPoint, design a presentation. Here's a fantastic example. If you're in contact with an employer by email, include it with your standard resume and cover letter. Otherwise, find out her email during your interview and email it to her afterward.

6. Meet the receptionist. While you're waiting for your interview, find out her name and chat her up. When you see her again on your second interview, talk to her like you've become old friends. At the very least, she'll have nice things to say about you to other people in the office, including your interviewer, and she might be able to give you a heads-up on your competition. Moreover, it will give your interviewer a chance to see your interpersonal skills in action and compare them to your skills during the interview, so even if you fumble during the interview she'll attribute that fumble to nerves.

7. Humanize yourself. There's an old farmer's joke about how you can't eat a chicken once you've named it - the same goes for rejecting a job applicant. During the interview, find something you and the interviewer have in common. If you have kids, find a way to mention them. Make yourself more than just another faceless applicant, and your interviewer will have a hard time simply dismissing you.

8. After every interview, however it goes, send a thank you email. Again, personalize it, but be warm and gracious. Remember that you'll be judged on your email skills when you send it, so spend as much time proofing that email as you would a cover letter or resume. But above all, be as friendly and engaging as you were in the interview. Make sure you can't be forgotten.

9. If you get called back for a second or third interview, remember the things you were told in the previous interviews and reference them, ESPECIALLY the personal things. If your interviewer mentioned that her daughter was sick, ask about her daughter at the next interview. If you're told that your next interview will be by phone because the interviewer has just had a baby, offer congratulations at the next interview. These little considerations will let an interviewer know that you're cognizant of other people's lives and needs, which is a strong sign of a team player.

10. Finally, remember that even in a rough economy people are still hiring. You may need to lower your standards or expectations slightly (only slightly), but if you're a strong candidate and you keep hunting you WILL find a dream job. Believe in yourself, and eventually the right interviewer will believe in you.

Friday, February 13, 2009

HOW TO Windows: Create an invisible folder.


shell32.dll
and alt-0160

(note: In their infinite wisdom, Vista creates a thin grey border around invisible icons on the Desktop so you don't lose them permanently, and it identifies the icon in Explorer in "Tiles" mode. Otherwise, the icon is entirely invisible in Vista. [My examples were created on the Vista Desktop, so you'll see the border throughout.] In Vista, your best bet is to keep an invisible folder off your Desktop, perhaps in My Documents. In either Vista or XP, the only way you'll know the folder exists is that it leaves a blank line where the folder should be in Explorer.)

1. Create a new folder (or select an existing folder you want to make invisible).


2. Go into the folder's Properties and change the folder icon. The default icon set will be shell32.dll. Scroll through those icons until you find these blanks. Select one and click "Ok".


The folder should now look like this:


3. Now rename the folder. With the old folder name highlighted, hold down alt and type 0160. A blank character will be the new folder name.

After clicking away from the folder, it will now be invisible.

Thursday, February 12, 2009

HOW TO iTunes: Enable half-star ratings. (Windows)


<key>allow-half-stars</key>
<data>
dHJ1ZQ==
</data>


1. Close iTunes.

2. Insert the above code into the iTunesPrefs.xml file, which (unless you've got something weird going on) should be located in
C:\Documents and Settings\[username]\Application Data\Apple Computer\iTunes (in Windows XP) or C:\Users\[username]\AppData\Roaming\Apple Computer\iTunes (in Windows Vista).

(Super-double-Important: You should back up any live xml file before you edit it like this. If you don't, and you screw something up, you have only yourself to blame.)

Insert the code here (do a search for <key>User Preferences</key>):


3. Save and close the xml file, and reopen iTunes. You should now be able to adjust the ratings on your files by half-stars by clicking and dragging each rating.

Wednesday, February 11, 2009

HOW TO Excel: Cut the last [x] characters from every cell in a list.


=LEFT(x,LEN(x)-y)

x is the cell where the information you want to trim is stored. y is the number of characters you want to trim. In plain English: "Take what's in the first cell; then, starting from the Left, return a number of characters equal to the entire length of that cell minus y."


Example: Let's say you've imported a list of movies from your hard drive.

But all you want is the names of the movies - you don't want the year or the .avi. That's 11 characters (1 space, 1 open paren, a four-digit year, 1 close paren, and ".avi"). By entering =LEFT(A1,LEN(A1)-11) into B1, you'll get this:


Then Copy and Paste the formula in B1 all the way down your list to complete the change.