I recommend dancing.  Reading fiction also often works for me.

kj is right, I've been programming for almost 15 years now and
frustration is a frequent companion.

> I've been programming for over 20 years and I *still* feel like that
> sometimes.  While I can't say what way is definitively best to deal
> with it, I tend to take a five or ten minute walk when I get to
> feeling like that.  Often, by time that that's done, I've got a fresh
> idea for how to approach the problem, or I've thought of something I
> may be missing.