Are you talking hobby projects just done for fun or real projects with a marketable product in mind? In the case of fun-type projects I have often spent many tens of hours before I realised they wouldn't work. Marketable products are a totally different ball of wax, my most expensive was about $500k and five years of work before throwing in the towel.