Hopefully my answer to your other comment makes sense. If not, let me know!
(I do programming, trading, consulting).
EDIT: Thought of one more thing... Immersive environments also help. Blocking out what's around me and escaping to, say, the top of a volcano or Mount Hood or Yosemite, increases my focus, esp. for deep work