Text this: Least squares data fitting with applications