Slashdot Mirror


Public Code Repositories?

dubious9 asks: "Today I was refactoring a parser of mine to use a better implementation of a string searching algorithm. I went to the internet trying to find a good code repository where I might have a chance to find an implementation of a good algorithm, but a cursory glance turned out no clear winners. SourceForge was the best that I could find. Where is the best online repository/library of common and reusable code snippets?" We've tackled this subject a once or twice over the years, is SourceForge really the best answer or are there other options?

43 comments

  1. Google by DeadSea · · Score: 4, Informative
    A general search of the internet is bound to turn up algorithms that some random develper has posted but which are in now code archive. Furthermore, individual sites with code repositories generally aren't as good at searching.

    If your google search doesn't turn up any relavent hits, then going for the repositories might be a good idea, but which repository you turn to is likely to be language dependant. Depending on the subject matter you might even do well by picking up a book.

    I know java best, so I'll give my favorite Java repository: The Giant Java Tree

    Perl hackers will probably recommend CPAN

    I'm sure you will get an different site from each developer on Slashdot.

  2. Your might want to try.. by ewhenn · · Score: 5, Informative

    www.planetsourcecode.com

    Might be something there.

  3. Good idea! by Anonymous Coward · · Score: 1, Funny

    We've tackled this subject a once or twice over the years...

    ... but just for the sake of completeness we decided to cover it again.

    1. Re:Good idea! by froseph · · Score: 2, Funny
      > We've tackled this subject a once or twice over the years...
      >... but just for the sake of completeness we decided to cover it again.

      At least they know its a repost :P

  4. Freshmeat by Apreche · · Score: 1

    Freshmeat has lots of little open source projects.

    Lots.

    --
    The GeekNights podcast is going strong. Listen!
  5. Bob Stout's Snippets by JabberWokky · · Score: 2, Informative
    Many years ago, Bob Stout's Snippet's was a great resource. I think I got the name right. That, together with Ralf Brown's interrupt list, was a great resource for the PC coder.

    --
    Evan (going by memory, no time to Google to check)

    --
    "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    1. Re:Bob Stout's Snippets by Anonymous Coward · · Score: 0

      I too can vouch for Bob Stout's Snippets.

      He's a good guy and can be found at
      http://www.snippets.org/

  6. String match algorithm reference by freshmkr · · Score: 4, Informative
    Off topic, but you may find this resource useful:

    http://www-igm.univ-mlv.fr/~lecroq/string/index.ht ml

    --Tom

    1. Re:String match algorithm reference by oobar · · Score: 2, Informative

      That's a pretty neat site, very thorough.

      Another potentially useful one is the Dictionary of Algorithms and Data Structures (DADS). A query of "String search" returns about 33 hits.

  7. Code is proprietary by Webmonger · · Score: 2, Informative

    You aren't allowed to redistribute code you get from planetsourcecode.com, which is a shame.

    1. Re:Code is proprietary by Rick+the+Red · · Score: 1

      Not only that, "User further attests that no submitted content is subject to any license (such as the GPL Open Source License) that would infringe on any of the rights granted to other parties in this contract." Now, can anyone please tell me how posting GPL code would infringe on the rights of PlanetSourceCode's readers? AFAIK it only infringes on their policy of forbidding readers from redistributing source code, which I believe exists to protect those who post the code. If the poster wishes to allow source re-distribution, why not let them? I think the clue comes from their Windows-centric origins. 'If billg hates the GPL, then we do, too!'

      --
      If all this should have a reason, we would be the last to know.
    2. Re:Code is proprietary by isorox · · Score: 1

      It depends, one view is "you can do whatever you want", another view is "you can do whatever you want as long as you dont stop other people doing the same"

    3. Re:Code is proprietary by budgenator · · Score: 1

      The basic problem is that if the snipit is GPLed then the whole thing is. If you just want a small chunk to steal to paste into a larger work that basicaly comercial in nature and you want to profit off its distrabution then GPL kills you, you're better off with a BSD style liciense.

      Sounds like what they realy want is for people to just throw it out there for anybody to use/abuse as they see fit. That's actualy not that uncommon, went was the last time you saw some realy unique javaScript?

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
  8. We should make our own! by Webmonger · · Score: 3, Funny

    We can make our own source code repository. Yeah, that's it. We'll call it codesource.org, and we can use MySQL and PHP to run it. Anyone know where I can find some source code to get started? :-)

    1. Re:We should make our own! by zerOnIne · · Score: 1

      try here? ... ok, so it's on Postgres, not MySQL, but hey :)

      --
      09
  9. Every algorithm ever written now under one roof by Spudley · · Score: 4, Funny

    Where is the best online repository/library of common and reusable code snippets?

    The US Patent Office. :-/

    --
    (Spudley Strikes Again!)
  10. boost.org by blackcoot · · Score: 4, Informative

    boost.org seems to have some pretty neat stuff; however, i've never used thier stuff...

    fwiw (and moderately on topic), clr ("introduction to algorithms", but i suppose with the new edition that should be clrp...) has a boatload of string searching algorithms in it, including (i *think* -- i haven't flipped through much more than the graph section recently) the knuth-morris-pratt algorithm. i've generally found their pseudo-code to be reasonably readable (certainly more so than 90+% of the freely available code that i've tried to read).

    1. Re:boost.org by zerOnIne · · Score: 1

      i just checked my bookshelf, and the 2nd edition is CLRS ... regardless, it *is* a great reference to general algorithms and the like ... the pseudocode is pretty general, enough to make porting into a real language a reasonable task for nearly anything in there

      --
      09
    2. Re:boost.org by blackcoot · · Score: 1

      too many text books all merging into one --- i still have patterson & hennessy stuck in my head (which must explain the p)

      also, fwiw, "algorithms in c" (i think the book is called -- i'm not sure, it's sitting on my shelf at home) has a bunch of string searching stuff.

    3. Re:boost.org by zerOnIne · · Score: 1

      the blue one by sedgewick? ... yeah, another good reference ... these two books basically make up a good core to any CS library :)

      --
      09
    4. Re:boost.org by blackcoot · · Score: 1

      i lied -- i was thinking of "practical algorithms for programmers" by binstock & rex.

  11. Hey, that's a thought... by TheSHAD0W · · Score: 1

    Google has been expanding into the specialized search arena -- how 'bout a code-specific search page?

    Google's spiders could look into archive files, determine the type of code included, parse documentation files and even determine what sort of license said code was under.

    1. Re:Hey, that's a thought... by Steven+Blanchley · · Score: 0

      I think it's safe to say there would be a huge amount of overhead involved in looking into archive files, even with a good method of determining which archive files contain code and which do not. There might also be legality problems if the license type was misidentified. Would indeed be nice, though.

    2. Re:Hey, that's a thought... by TheSHAD0W · · Score: 1

      Google already does this in the case of PDF files; I don't think zip/rar/tgz would be a huge stretch.

      Heck, Google could even monitor CVS sites...

  12. Perl and Java... by Xunker · · Score: 5, Informative

    I'm a Perlie and since it opened I've found Perlmonks totally invaluable -- their Q/A section actually has questions that I would ask if wasn't so beyond asking for help.

    On that thread, My java-esque friends tell me Java Junkies is equally good if you're of the Bean persuation.

    Both sites are, in case you didn't guess, based on the Everything Content Engine which is why they look so much alike.

    --
    Hilary Rosen's speech was about her love of money and her desire to roll around naked in a pile of money.
  13. Code snippets & Examples by Gefd · · Score: 2, Interesting

    If your interested in games or not, both FlipCode.com and GameDev.net have alot of reference material for common algorithms.
    They aren't exactly repositories as such, but there is alot of code snippets deposited in various sections throughout both sites.

    - Gef

  14. For Perl... by merlyn · · Score: 2, Informative
    The answer is obviously the CPAN.

    Other open-source languages, looking on the CPAN with some sense of jealousy, are slowly creating similar structures. The Freepan factors out the code that runs the CPAN into a generic tool. Feel free to contribute to the Freepan project if you can.

  15. Dont peak.... by floydman · · Score: 1

    Cheater!!!!!!!

    --
    The lunatic is in my head
  16. Knuth by peripatetic_bum · · Score: 1

    If I understand your problem, this is a search/sort.
    Have you read your knuth lately?

    --

    Sigs are dangerous coy things

  17. Google is good... by podperson · · Score: 1

    It's only the index system of course...

  18. Freshmeat + SF + Google! by Thornae · · Score: 1, Informative

    Okay. Check out the linked articles, yes, but also search SourceForge, Freshmeat and Google Advanced Search for what you're after.

    Between these three, with a bit of intelligent searching, you should be able to find something related.

    If you can't, your project is esoteric enough that you'll need to be looking thru' Google Groups and other such weird equivalents.

    Enjoy,

    --
    |>
    Here be Dragons
  19. Java Forums by hnoon · · Score: 1

    I work mostly with Java but that isn't to say the Forums on Sun's site can't be helpful for a C programmer. They are categorized so if you wanted to, you could limit your search to the Algorithms forum for example. The search engine is actually pretty good. If all else fails, post a question and you should get a reply pretty quick.

  20. hmmm by Anonymous Coward · · Score: 0

    I though VA linux/OSDN used to have a site like this, that got shutdown a couple years ago. I never looked at it, and i think it was more javascript oriented.

  21. Moo by Chacham · · Score: 1

    I am interested in the very same thing. With part of the website donated to solutions, and then list the various languages or libraries that it is done in. There is no reason to reinvent the wheel in every language gone to. And then there's the issue of taking the time to making it better.

    I am very much interested in such a project should anyone want to work on it.

  22. mod parent up by 286 · · Score: 1

    Knuth's books are great...
    if you can afford them and hack the math. ;-P
    I have picked up some good algorithms from the ASM web site too,
    but mostly by fumbling around and filing ideas for later.

  23. Back in the day .. by rasjani · · Score: 1
    ... when TurboPascal ruled the land and people writing c code where considered nomads, there was SWAG, SourceWareArchivalGroup or something. This was neat little program that had literally thousands of codesnippets extracted from many many places like fidonet and usenet groups and direct postings.

    I think the actual data is still available at @ http://www.bsdg.org/swag/

    It would be really really neat if someone with time and/or talent would pull up similar compilation for "modern" languages. Or maybe even make similar thing with pseudocode.

    --
    yush
    1. Re:Back in the day .. by Moeses · · Score: 1

      Maybe it's because my first programming experiences were with Pascal, but I consider Pascal itself to be very close to pseudocode readable for those that don't know the language. A pascal implementation should be fairly easy to adapt to another language.

  24. Netlib by superid · · Score: 1
  25. Computer Science Research Search Site by frosencrantz · · Score: 2, Interesting
    This site (C.S. only directory) is a great resource for finding Computer Science papers (it covers science papers of all types) Source code is sometimes available or available by asking. You might find a paper that helps you decide how to code something yourself.

    Once you find a paper that is close to what you want there are ways to surf to similar/related papers.

  26. Lucene by Anonymous Coward · · Score: 0

    You might be looking for this:

    http://jakarta.apache.org/lucene/docs/index.html

  27. Algorithm Repository by CaptCanuk · · Score: 1

    What of Algorithm repositories like this one? This is probably a more useful resource as it emphasizes more on the algorithm itself and allows you to see the algorithm implemented in various languages.

    --
    ---- The geek shall inherit the Earth.
  28. freepan.org by Anonymous Coward · · Score: 0

    A friend of mine(brian) started just that: a language transparent cpan.. you can find it at http://www.freepan.org i'm shure he'l be more than happy to be slashsdotted;)

  29. DaDS by Battalion · · Score: 1

    http://www.nist.gov/dads/