Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Software IT Technology

Public Code Repositories? 43

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?
This discussion has been archived. No new comments can be posted.

Public Code Repositories?

Comments Filter:
  • Google (Score:5, Informative)

    by DeadSea ( 69598 ) on Friday March 28, 2003 @09:24PM (#5620326) Homepage Journal
    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 [gjt.org]

    Perl hackers will probably recommend CPAN [cpan.org]

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

    • 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.
  • by ewhenn ( 647989 ) on Friday March 28, 2003 @09:25PM (#5620334)
    www.planetsourcecode.com

    Might be something there.
    • Code is proprietary (Score:3, Informative)

      by Webmonger ( 24302 )
      You aren't allowed to redistribute code you get from planetsourcecode.com, which is a shame.
      • 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 sour
        • 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"
        • 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?
  • Good idea! (Score:1, Funny)

    by Anonymous Coward

    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.

    • by froseph ( 549853 )
      > 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

  • Freshmeat has lots of little open source projects.

    Lots.
  • Bob Stout's Snippets (Score:3, Informative)

    by JabberWokky ( 19442 ) <slashdot.com@timewarp.org> on Friday March 28, 2003 @09:42PM (#5620400) Homepage Journal
    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)

  • by freshmkr ( 132808 ) on Friday March 28, 2003 @09:48PM (#5620418) Homepage
    Off topic, but you may find this resource useful:

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

    --Tom

  • by Webmonger ( 24302 ) on Friday March 28, 2003 @09:56PM (#5620447) Homepage
    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? :-)
  • by Spudley ( 171066 ) on Friday March 28, 2003 @09:58PM (#5620459) Homepage Journal
    Where is the best online repository/library of common and reusable code snippets?

    The US Patent Office. :-/
  • boost.org (Score:5, Informative)

    by blackcoot ( 124938 ) on Friday March 28, 2003 @10:29PM (#5620551)
    boost.org [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).
    • 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
      • 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.
  • Perl and Java... (Score:5, Informative)

    by Xunker ( 6905 ) on Friday March 28, 2003 @10:35PM (#5620572) Homepage Journal
    I'm a Perlie and since it opened I've found Perlmonks [perlmonks.org] 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 [javajunkies.org] 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 [everydevel.com] which is why they look so much alike.
  • by Gefd ( 562296 )
    If your interested in games or not, both FlipCode.com [flipcode.com] and GameDev.net [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
  • For Perl... (Score:3, Informative)

    by merlyn ( 9918 ) on Friday March 28, 2003 @10:55PM (#5620627) Homepage Journal
    The answer is obviously the CPAN [cpan.org].

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

  • Cheater!!!!!!!

  • If I understand your problem, this is a search/sort.
    Have you read your knuth lately?
    • 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.
  • It's only the index system of course...
  • I work mostly with Java but that isn't to say the Forums [sun.com] on Sun's [sun.com] 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 [sun.com] 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.
  • by Chacham ( 981 )
    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.
  • ... 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/ [bsdg.org]

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

    • 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.
  • netlib [netlib.org]
  • This site [nec.com] (C.S. only directory [nec.com]) 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.

  • What of Algorithm repositories like this one [sunysb.edu]? 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.

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

Get hold of portable property. -- Charles Dickens, "Great Expectations"

Working...