Here's a url incase you haven't hit Google yet.
From personal experience on the contract issue i would say be specific and get the client to be specific about what they want done. If nothing has been put down (or nothing specific) it's really easy for the client to just say no thanks and leave you high and dry. It also leaves holes for the client to sneak in additional work, under the heading of "It's part of what i wanted".
First, solve the problem. Then, write the code.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
When asking for assistance give as much information about the problem as possible