dont-reinvent-the-wheel

Generic List Extensions in C#

I am writing a few extensions to mimic the map and reduce functions in Lisp. public delegate R ReduceFunction<T,R>(T t, R previous); public delegate void TransformFunction<T>(T t, params object[] args); public static R Reduce<T,R>(this List<T> list, ReduceFunction<T,R> r, R initial) { var aggregate = initial; foreach(var t in...

Is There A C# Library Containing Types Such As Telephone Number, Address, Zip etc.?

Almost everyone needs simple types such as these (tel. number, credit card, uri, email address) - is there a C# library available to save everyone having to re-invent the wheel? ...

When should you re-invent the wheel?

Over the years, I've developed a bunch of re-usable code which I recently bundled up into a web application framework. Not only did I incorporate many open source solutions (smarty templating system, tinymce editor, prototype-scriptaculous libraries), but I also added my own custom-built features like CMS generation tools, social network...

Where can I find UML diagrams (instead of reinventing the wheel)?

I am currently trying to draw a set of UML diagrams to represent products, offers, orders, deliveries and payments. These diagrams have probably been invented by a million developers before me. Are there any efforts to standardize the modeling of such common things? Or even the modeling of specific domains (for example car-manufactur...

Useful databases around web

As Tim Berners-Lee told at TED, there's lots of hidden data. What useful free databases or APIs you know around web? For example: European Union's VAT number validator Team Cymru's IP Address to ASN/country mapping PhishTank API against phishing Akismet against spam (free for personal use) IMDB database dumps Wikipedia database dumps U...

How far would you go to avoid reinventing the wheel?

It's pretty cliche that reinventing the wheel is evil. Of course, if there's a good canned solution, I agree. The question, though, is how far to you go to avoid reinventing the wheel when there is no optimal existing wheel? Here are some cases: The existing wheel is in a different language than you're using or want to use. You'd h...

Custom convenience functions/methods

Convenience functions are functions that perform a specific task, independant of the program, code or whatever that called it. Here's an example in PHP: function currentDateTime(){ list($micro, $Unixtime) = explode(" ",microtime()); $sec= $micro + date("s", $Unixtime); $sec = mb_ereg_replace(sprintf('%d', $sec), "", ($micro + dat...

Am I crazy to recreate a tiny garbage collection system inside my functions?

I have some (C++) functions each containing several calls creating similar arrays of the same basic type on the heap. At various points in these functions, I may need to throw an exception. Keeping track of which arrays have been deleted is a pain, and quite error prone, so I was thinking about just adding the array pointers to a Set<Arr...

Worst example of you duplicating existing functionality?

I've certainly done this : written a load of code to do some operation, then discovered that the language already had that functionality built in. An early case i remember is writing a function to reverse a string in VB6, then stumbling across StrReverse a week later. What's your worst example of this? ...

Getting index from value in JavaScript

Is there a function/method to retrieve the index of an item in an array from its value in JavaScript? In other words I'm looking for the JavaScript equivalent for the Python .index() lists method: >>> ['stackoverflow','serverfault','meta','superuser'].index('meta') 2 Does the wheel already exist or have I to reinvent it? ...

Is there a built-in way to replace the text of a link in a LinkLabel and have the other links automatically adjust so they stay on the same text?

In other words, if I have: var ll = new LinkLabel(); ll.Text = "Some links go here."; ll.Links.Add(0, 4); // Some ll.Links.Add(11, 2); // go Is there any method I can call to replace the text of the "Some" link with something else while keeping the "go" link the same. I only want to know if there is a built-in method. This is not h...

Encoding minimum characters in POST request: is it safe or not?

I came across an approach to encode just the following 4 characters in the POST parameter's value: # ; & +. What problems can it cause, if any? Personally I dislike such hacks. The reason why I'm asking about this one is that I have an argument with its inventor. Update. To clarify, this question is about encoding parameters in the POS...

Benefits of migrating my work to a new web development framework?

When I first started programming with PHP, I was ignorant of other php frameworks (like code igniter, cake php, etc...). So I fell into the trap of re-inventing wheels, which had the benefit of being "fun" and "educational". Overtime, I discovered other open source products that I found useful, like smarty templating engine, jquery lib...

Is there already a known algorithm that does the same as mine? Geolocation/people proximities

I am writing my Bachelor thesis about a Dynamic Carpooling service. It uses air-to-air distances, as I could not find resources to have a system using maps and routings. I am interested to know if there already exists an algorithm that does the same as mine. I know that my algorithm is very simple. I just would like to know if I have re...

Avoid reinventing the wheel, mental process you use to force yourself not to rewrite existing code.

Need help here, I'm a coder who has always felt the weight of a tremendously strong force pushing him to reinvent the wheel. It was so strong that I was nearly trying to reinvent jQuery lately [Note] and this really made me think. I read also these well written articles, but they don't give any practical suggestions to follow in order...

Should one remake the project which can possibly use an Open source project?

I have a friend, he needs to build a booking system for hotel. Now there are two aspects I got from this thread - http://www.webmasterworld.com/ecommerce/3548668.htm# You have to search around but there are good quality open-source projects out there. Of course to get all the specifics you'd need to do some custom coding in...

Technical interviews and reinventing the wheel

Hi all. So I just finished an interview with a major software company for an internship (I am an undergrad). I had some weird experiences during the interview, so I thought I had share them here and ask for feedback. I was interviewed on-campus so there was no telephonic round. Before the interview began, we were given a choice of a p...

Best way to share features in Rails without reinvent the wheel

I begin with some examples that's better, when I plan a rails app I'd like to have: a SettingsController (to store system preferences, eg disqus id,..) with a model and some views a my custom template a login system (Devise) which is teh best practise to keep this components updated separatly? and indipendent from the new customized ...

HTML5/Flash component to play Apple's segmented video streams?

What you can recommend out of HTML5 (JS) and Flash components/libraries to play iPhone/iPad-compatible video stream inside web page on conventional browsers? I've checked for FlowPlayer, unfortunatelly it seems not able to work with Apple's segmenter (the one, that cuts video in 10 second .ts fragments, and gives out a playlist). ...

Actionscript equivalent of Python's class "set"

In Python, there is a class called "set". I realize that similar functionality could be implemented in AS by a Dictionary where only the keys matter. But it seems that this should be a built-in type for ActionScript. Unfortunately, it's nearly impossible to search for. Before I go off and code up my own "set" class, does it already exis...