Stuck in a rut of 12 losses in their past 15 games, the Giants got an infusion of positive energy from a pregame home run derby before their win over the Padres on Saturday.