Master the Firefox search engine bar with keyboard shortcuts

July 9th, 2009 Eric 2 comments
Firefox Search Bar

Firefox search bar

I think the search bar is fantastic feature of Firefox.  However, I have found that pointing and clicking to change search engines is a real pain.  I’ll show you how you can switch search engines with lightning speed using some simple keyboard shortcuts.

Highlight the search bar

You can highlight the search bar by pressing Cmd-K (Mac)  or Ctrl-K (Win).  Once it’s highlighted type your search terms and hit Enter to perform the search with the selected search engine.

Change search engines

A simple way to change the search engine is to press Cmd-Up/Cmd-Down (Mac) or Ctrl-Up/Ctrl-Down (Win).  This will change the search engine icon to the left of the search field.  It’s quick but it’s sometimes hard to tell what the search engine is just by the icon.  Sure, after a while you’ll remember which is which but I’m not a huge fan.  This is where the next shortcut comes in handy.

Change search engines the lazy and efficient way

If you’d rather do a find-as-you-type style search over the search engines you can press Opt-Up/Opt-Down (Mac) or  Alt-Up/Alt-Down (Win).  This will pop up the list of search engines as if you’d clicked on the search engine icon with the mouse.  Now type the first letter of the search engine you want to change to and it will automatically be highlighted.  If you have more than one search engine that begins with the same first letter just keep pressing the same letter key until you’ve highlighted the one you want.  Press Enter to select and engine.

firefox search bar expanded list

Search bar with engine list expanded

Reordering search engines. keep most used at the top and least used at the bottom.

It might be helpful to keep your most used search engines at the top of the list for easier navigation.  To reorder the search engine list, click on the search engine icon to expose the drop-down list (or use one of the keyboard shortcuts described above).  Click on Manage Search Engines.  Drag the engines around to arrange them as you like.

Wordpress note

I’m using the Advanced TinyMCE editor in Wordpress and Cmd-K is either bound to some action inside the editor or simply doesn’t work when your cursor is inside the editor field.  Press Tab to change the focus and then press Cmd-K to activate the search bar field.



Ant copy and move directories recursively (without ant-contrib)

July 6th, 2009 Eric No comments

As a corollary to the recent post I made about trying to recursively moving or copying directories with Ant, this post shows you how to do so without the use of the third-party ant-contrib library. The trick is understanding Ant’s wildcard syntax used in the type, which can be rather confusing.

Previously, I was trying to move a directory and all of its contents recursively to another directory using the following target

 
<target name="move.dirs">
 
    <move todir="backups">
        <fileset dir="." includes="*incremental*"/>
    </move>
 
</target>

The result was a non-recursive copy of the first level of directories with ‘incremental’ in the directory name. The only way I could accomplish a deep copy or move at the time was to use ant-contrib’s task to iterate over all files recursively. As I discovered after playing with my original script (above) a bit more, this is unnecessary.

By modifying the wildcard syntax in my original target I am able get what I want.

 
<target name="move.dir">
 
        <move todir="backups">
            <fileset dir="." includes="**/*incremental*/"/>
        </move>
 
</target>

So, the additional ‘**/’ at the beginning and a trailing ‘/’ at the end of the includes attribute value is all that is necessary. All directories (and their contents) with ‘incremental’ in the name will be moved to a directory called ‘backups/’. The same will work for the task. I won’t go into the details about how this syntax works but you can read about it here.

Related Post: Move or copy a set of directories using Ant

Categories: Code Tags: , , , ,

Gmail adds drag and drop labels

July 1st, 2009 Eric No comments
Gmail drag-and-drop labels

Gmail drag-and-drop labels

Today the Gmail team quietly made a minor change in its interface with respect to labels.  The label panel moved to a more permanent position below the Inbox and Sent Mail “folders” and above Contacts and Tasks.  The list of labels has also been shortened, allowing a user to drag and drop more frequently used labels in and out of the list.  Emails can now be dragged and dropped on top of labels like a more traditional thick client email system such as Outlook or Thunderbird.

I first noticed something suspicious today when my label list, normally on the right side of the interface thanks to a Gmail Labs tweak, moved to the left side.  After trying several times to move it back to the right side I gave up.  I figured there was a glitch or a bug or they simply disabled the tweak.  When I checked my mail tonight I got a very helpful bubble that explained the changes.  This may give some insight into how the team phased the change in to the interface, disabling the tweak first, then rolling out the update.  I’m intrigued by their update model.

5 Questions to Ask When Negotiating Car Maintenance

June 27th, 2009 Eric No comments

This morning I took our newest car, a 2007 Hyundai Santa Fe, to the mechanic for an oil change. And, of course, when I got the call from the mechanic a couple of hours later there was that awkward moment of silence after they eek out a pleasant, but forced, greeting, and before they rattle off the laundry list things that need attention. This time, most of the items in the list were 30K mile maintenance things that are necessary in order to keep the warranty on the car valid (i.e. transmission fluid flush, air filter, etc.). All of this totaled about $360, which I’m borderline OK with. I’m a believer in spending money to do routine maintenance upfront rather than waiting until it’s too late when the cost of repairs exceeds the cost of maintenance.

But the list didn’t end there. I didn’t expect to hear that I needed new tires. And oh yeah, I should also realign the tires to extend the life of the tires that I have. After all the car is just shy of 30K miles (most tires should last at least 50K miles). The tires still have good tread everywhere except the inside (where I can’t easily see, of course). Why did they not notice the misalignment before now? I was told this could’ve been caused by an event in the last three thousand miles or so that threw the alignment out of whack, causing the tires to wear unevenly on the inside. My wife tells me she may or may not have hit a curb recently. Financially it’s not possible for me to do all of the routine maintenance AND get new tires right now. So, time to start asking questions.

I argued very politely with the salesperson for 10 or 15 minutes about whether or not it’s crucial that I get new tires. An alignment would cost $90 and give me another three to four thousand miles on my existing tires. When I pressed for as much information as I could I found out a couple of interesting bits. Are the tires in dire need of replacement today? Would I pass a state inspection?   The answer, of course, is that they’re fine probably for another three to four thousand miles.

While inquiring about tire prices I found out that tire alignment is included for free when you buy new tires. When I pointed out that I could drive the tires closer to their end-of-life and get a free tire alignment when I buy new tires there was a three or four second pause on the other line. “GOTCHA! “, I thought to myself. Here is where I believe I caught them trying to make a little extra money off of me. I like this shop a lot and they’ve been working on my cars for almost 10 years now. I’ve never felt like I was getting screwed until now. Granted, I’m not dealing with the usual salesperson who I feel is very honest with me. This person is younger, newer, and I can tell he doesn’t quite grasp customer loyalty yet.

This is a prime example of why it is so important to haggle with salespeople when it comes to things about which you’re not an expert. It pays to spend that extra time, whether it’s 15 minutes or multiple phone calls that might exceed an hour, to get all the information straight in your head before committing to repairs. More often than not you will feel pressured by a salesperson to do something you’re not financially comfortable doing at that moment over the phone. This is especially true with repairs, where you need your car, washing machine, or air conditioner fixed as soon as possible to return life to normal. And service salespersons know this. So, before you agree to just get it taken care of, be sure you know what you’re getting and whether or not you actually need it now.

Here are 5 questions that you should ask yourself or the car shop before agreeing to repairs:

  1. Is it absolutely necessary right now? How much longer could you wait before the part in question will break? Sometimes you can simply let a part break before actually fixing it.
  2. Would waiting cost more in the long run? If you wait on the repair, what’s the potential risk for more damage? Could it lead to breaking an even more expensive part? Sometimes the cheapest maintenance can actually prevent damage to some of the most expensive parts.
  3. Are some services included for free when you replace a part? As I found out, tire alignment is included with new tires. So it doesn’t make sense to pay for it now when I know that I’m going to have to buy new tires soon anyways.
  4. How long is the warranty on their work? This can depend on the service but it’s always good to know.
  5. Can they cut a percentage off of the price?  When the price tag is large it never hurts to ask. Always wait until they’ve quoted you a final price before you play this card. Use your customer loyalty (if relevant) as evidence that your continued patronage is worth a small discount.

What else would you ask your mechanic or salesperson?

Update: The salesperson called back to let me know my car was done. He also let me know that he talked with his manager about my concern that I was never notified of a problem with the alignment before now. They are supposedly going to work to get the cost of tires down as close to cost as they can. It pays to ask questions : )

Categories: Financial Tags:

Move or copy a set of directories using Ant

June 23rd, 2009 Eric No comments

I’m often baffled by the way some tasks work in Ant. Today, I needed to move a set of directories to another directory based on a <fileset> wildcard expression. My first, seemingly intuitive attempt was to use the <move> task and specify a <fileset> with an includes expression. Let’s suppose I want to move a set of incremental backup directories that all have the keyword “incremental” in the name:

backup-incremental1
backup-incremental2
backup-incremental3

It seems intuitive to use the following Ant move task to move these directories into another directory called backups/

<target name="move.dirs">
    <mkdir dir="backups"/>
 
    <move todir="backups">
        <fileset dir="." includes="*incremental*"/>
    </move>
</target>

For some reason this only copies the root directory without recursively copying its contents. Ant gives a message that looks like the following:

[move] Moved 3 empty directories to 3 empty directories under Sandbox/ant/backups

After going through several iterations (emphatically gesturing at the monitor along the way) I finally realized that the core <move> and <copy> Ant tasks cannot do this. At least, not that I could figure out. Instead, you have to use the ant-contrib library’s <foreach> element to iterate over each directory and call a separate target that will actually move the directory:

<target name="move.dirs">
    <mkdir dir="backups"/>
 
    <foreach param="dir" target="move.inc.backups">
        <path>
            <fileset dir=".">
                <include name="*incremental*"/>
            </fileset>
        </path>
    </foreach>
</target>
 
<target name="move.inc.backups">
    <move todir="backups" file="$dir"/>
</target>

Why is this so? I’m still trying to figure out if there are any vanilla Ant solutions to this problem. I will be sure to post what I find in the future. For now I will just accept this as another one of many quirks in Ant. I love Ant for its simplicity and the ability to cobble together scripts quickly to automate tasks. But on the other hand, sometimes Ant lacks the intuitive nature of scripting languages like python or ruby.

If you have any alternatives to the method I presented here, please feel free to post them in the comments.

Update: To move or copy directories recursively without ant-contrib see this more recent post Ant copy and move directories recursively without ant-contrib

Categories: Code Tags: , ,