What is the biggest library/tool/framework/etc you wrote only to discover that it is freely available or already exists somewhere?
I implemented ActiveRecord in PHP 4 back in 2005.
Rails was pretty new, and I didn't even know it existed. I also wasn't aware of an active record implementation in PHP, so I went ahead and implemented it myself.
Recently I ported my website to Python and after a few months of work, I discovered that I'd basically reimplemented Django... (not the whole thing obviously, not in a few months, but it was heading in that direction)
Pretty much everything i've tried to do in Java there's been a free and (usually) better wheel already made.
Well, I know people, that wrote an interpreted C-like language compiler/interpreter, and later on extended it with most of the C++ features, even templates and so.
I know people who tried to re-invent a "programming questions" web site into a chat forum for trading war stories.
Whilst doing my cs final project I had never heard of an orm so I spent ages (about 3 hours in student land) trying to write a mapping module.
Frameworks. Over the years, I've created several frameworks for text user interfaces, GUIs, web applications.
I once wrote a user-defined function in Oracle to capitalise the first letter of every word in a text string. I even called it F_INITCAP.
A javascript getElementById
method that surfed the DOM searching all the id attributes....
I am coding up my own blog ... that has to be the top of the "Most Reinvented Wheel".
I ever wrote a smtp server and found I can got many free implementations of smtp server after three months.
It happened twice with me.
along with the releaseof vs2005 and .net 2.0, we heavily used Datasets and Datareaders. I wrote two-way mapper with the help of Attributes, that mapped a Datarow to an entity object and Datatable into IList vice versa. Later when we learned about Linq2Sql I found that Linq2Sql mapping was also done the same way as I used to do.
In the second case, I wrote a logging module which was then superseded by Log4Net.
But sometimes I feel one should try to re-invent the wheel so that you learn from it. I'm often in situation where I'm hunting for interesting problems that I want to solve them to improve on my skills, knowledge and understanding of given technology or platform.
While in classic-asp days, you had to maintain the state of your forms manually, I once thought I'll write my own utility to persist the form-state across post-backs [at that time there was no term as 'postback'], I gave up this idea along with the first release of asp.net.
A full-text search engine.
Years later I've read about the inner workings of full-text search engines, realizing I had essentially re-invented them all over (Boolean queries, fuzzy search, proximity,...)
Every now and then I fall upon an old software project of mine, realizing most of it was just wheel-reinventing. Things that took me weeks could now be done in hours, using of-the-shelf open-source software components (that existed at the time...)
I'm too lazy to reinvent anything.
Although before we were able to get jQuery into our application at work, I reinvented quite a bit of that javascript.