Can anyone recommend exercises for learning a new language. For example, something like "implement a class with these methods", or implement a function that does this. Something that is realistic, should only take an hour or two to implement for a competent programmer, requires you to learn more complicated features of a language, yet I can finish before getting bored or frustrated?

Peter Norvig has a repo of such problems / solutions (he solves them in Python, and calls them "pytudes" = "python" + "etudes", although they should be solvable in any language) https://github.com/norvig/pytudes

Rosetta code also has a great selection of problems / solutions in various languages: http://rosettacode.org/wiki/Category:Programming_Tasks