Elias Howe invented the sewing machine in 1845. He had the idea of a machine with a needle which would go through a piece of cloth but he couldn't figure out exactly how to make it work. He first tried using a needle that was pointed at both ends, with an eye in the middle, but it was a failure. Then one night he dreamt he was taken prisoner by a group of natives. They were dancing around him with spears. As he saw them move around him, he noticed that their spears all had holes near their tips.
When he woke up he realized that the dream had brought the soulution to his problem. By locating a hole at the tip of the needle, the thread could be caught after it went through cloth thus making his machine operable.
He changed his design to incorporate his dream idea and found that it worked!