DC Motor Control

So on the Arduino tutorial page for DC motor control (http://playground.arduino.cc/Main/DCMotorControl) it says that the schematic is wrong and says I should ask here. I guess my question is simple: how exactly would you do it? I would normally just hook up the motor, battery, and an output pin to the transistor and run with it. This, I assume, won't control the speed, and that's what the potentiometer is for. Pointing in the right direction would be appreciated!

In this tutorial, the transistor and diode are connected correctly: http://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors

However, you should never try to use the Arduino to power a motor. Use a separate power source for the motor and connect the Arduino and motor power source grounds together. I've written to Adafruit and asked them to correct their tutorial.