I'd be slightly wary of the pennies in the can method - there have been several threads on here where the Littlies have been frightened out of their little bodies with it all....
 
 
The way I trained Harry to stop barking was to take one of his favourite Kong Squeaker Balls, and hide it about my person (like a magician!! 

). 
 When he started barking at an 'inappropriate' time, I would give one long squeezy squeak on it (like it was in it's death-throes) and he would stop in his tracks and immediately come to find it - all barking forgotten 
 
 
It might be the wrong way to teach him - but it certainly worked! Good luck! Sally + Harry x