ex1 and ex2 of machine learning course on coursera