Switches and variable resistors