• Specialize. It's way easier for an in-demand specialist to find work and also it's much easier to answer who you'd like to work for once you've got a narrower focus.
• If you're applying for a job that's posted internet, you're already behind the curve. Build a network. Make sure that you know other programmers and that they know you're looking for a job. If you know specific companies you want to work for, make an effort to meet people at those companies.
The two points interact because if you specialize, you tend to get to know the other specialists in your field. I've done a lot of audio software in C++ and did that in my last job. Even before working there I knew a bunch of the other people that did C++ audio software and one of them did an intro for me that got me the job. This wasn't even theoretical -- I actually had filled out the online job form a few weeks prior and gotten the, "This position has already been filled." mail. When I used a personal intro instead I had an interview inside of a week and they wanted to know how quickly I could start.