For the switch it's a pull down resistor, read about it here at Lady Ada wonderfull Arduino tutorial site
http://www.ladyada.net/learn/arduino/