Slashdot Mirror


Searchable C/C++ DB surpasses 275 million lines

Sembiance writes "I've been working on a C/C++ source code search database for the past year. It has recently surpassed 275 million lines of searchable open source C/C++ code. The search engine is C/C++ syntax aware so you can search for specific elements such as functions, macros, classes, comments, etc. The site is built upon many open source products including: MySQL and Lucene for the database, CodeWorker to parse the code, PHP and Apache for the website and GeSHi for syntax highlighting. I'm currently looking for suggestions on what sort of 'interesting statistics' I could create from 275+ million lines of open source C/C++ code."

328 comments

  1. Some statistics to get you started by Anonymous Coward · · Score: 5, Funny
    I'm currently looking for suggestions on what sort of 'interesting statistics' I could create from 275+ million lines of open source C/C++ code.


    The following "interesting statistics" come to mind:

    • Percentage of functions named "deepThroat" (0%)
    • Number of comments mentioning a "girlfriend" (11) or "wife" (29) to "Natalie Portman" (41)
    • How many variables named "penis" are of type "long" versus type "short" (unknowable!)


    You gotta get the variables searchable. Most critical for that last statistic. Also, I'm too lazy to learn Lucene Query Parser Syntax, so the statistics for "Natalie Portman" may include references to "portman."
    1. Re:Some statistics to get you started by WWWWolf · · Score: 1
      How many variables named "penis" are of type "long" versus type "short" (unknowable!)

      Better to have that as "short" or even "void*", rather than "char"...

    2. Re:Some statistics to get you started by Anonymous Coward · · Score: 0

      My penis is a String.

  2. useful statistic by kunzy · · Score: 5, Funny

    the time from the frontpage acticle on /. to the death of your server?

    1. Re:useful statistic by Sembiance · · Score: 5, Funny

      Well, it's been about 2 minutes on slashdot... my site is already dead. So uhm... 2 minutes?

    2. Re:useful statistic by Anonymous Coward · · Score: 0

      You probably saying Fuck!

      Using a search of "Fuck"

      Well, so are these guys:

      void FuckUp 11 GSMP-0.0.6/Plugins/src/Factory.cc
      void MindFuckUrquan 22 uqm-0.4.0/src/sc2code/comm/talkpet/talkpet.c
      void OS_FreeFuckOver 6 bnserv-1.0.3/services/operserv.c
      void * OS_Thread_FuckOver 46 bnserv-1.0.3/services/operserv.c
      char * SolveFuckName 25 setedit/install/install.cc

      - Moomin

    3. Re:useful statistic by Guysmiley777 · · Score: 1

      Mmmm, it smells like burning.

      --
      Coding with assembly is like playing with Legos. Coding an application in assembly is like building a car with Legos.
    4. Re:useful statistic by Baricom · · Score: 4, Funny

      So uhm... 2 minutes?

      Sounds like you should have written it in C++ instead of a laggard language like PHP ;).

    5. Re:useful statistic by Rac3r5 · · Score: 1

      Hi Sembiance,

      Is your code able to interact with a compiler?
      Why I ask this is because sometimes when you are looking at some code and would like to implemnt it, it would be useful to run it through your parser and see how many warnings/errors it comes up with. Or maybe its overkill, but just a thought :)

    6. Re:useful statistic by Wikipedia · · Score: 0

      The backups work OK:
      The search, uhhhh, I dunno
      http://www.google.com/search?q=cache:http://csourc esearch.net/
      http://csourcesearch.net.nyud.net:8090/

      --
      P2P Anonymous Distributed Web Search: http://www.yacy.net/
  3. My vote is for... by Anonymous Coward · · Score: 5, Insightful

    How many lines consist of:
    }

    1. Re:My vote is for... by Forseti · · Score: 0

      You forgot the semicolon, that ain't gonna compile! ;-)

      --
      Delay is preferable to error. (Thomas Jefferson)
    2. Re:My vote is for... by Erioll · · Score: 1

      Most closing-statements require no semicolon. While things like class definitions, structs, etc, DO, "typical" programming blocks do NOT, like if, while, and switch blocks. Even functions don't terminate their blocks with a semicolon.

      So I'd suspect lines with purely "}" and whitespace would be quite a few.

    3. Re:My vote is for... by Anonymous Coward · · Score: 2, Funny

      Probably about as many lines consist of: {

    4. Re:My vote is for... by epiphani · · Score: 4, Interesting

      Same type of thing, but indenting styles. K&R vs. BSD, ect. I'm curious how that breaks up.

      (Partial to BSD style myself..)

      --
      .
    5. Re:My vote is for... by Forseti · · Score: 1

      Yeah, it was a joke, hence the ";-)" ...

      --
      Delay is preferable to error. (Thomas Jefferson)
    6. Re:My vote is for... by sparkes · · Score: 1

      That would be interesting but a bugger to search for

    7. Re:My vote is for... by buanzo · · Score: 1

      How many times the word "fuck" appears on comments. :P We've already done that on the linux kernel! :)

      --
      Buanzo Consulting - 15 Years of GNU/Linux experience, for you.
    8. Re:My vote is for... by mebollocks · · Score: 5, Funny

      I dunno, maybe you could find the algorithm on the net somewhere? ...if only there was some kinda searchable code database of some sort...

    9. Re:My vote is for... by Anonymous Coward · · Score: 0

      Not. { often occurs at the end of a line, such as a conditional test.

    10. Re:My vote is for... by Triple+Click · · Score: 2, Insightful

      Depends whether you do this:

      if (cond) {
      }

      or this:

      if (cond)
      {

      }

    11. Re:My vote is for... by Anonymous Coward · · Score: 2, Informative

      K&R!!
      ONLY K&R!!!!

      Seriously, I am a K&R maniac, which caused me to get quite irritated at one of my professors, who once wrote "confusing braces" on a programming assignment I handed in. (It was a little confusing, but because I was being clever and efficient, not because of my braces preferences.)
      I think the proportion of code written in K&R vs. The Incorrect Styles would be very interesting to see.

    12. Re:My vote is for... by joshdick · · Score: 1

      The GNU program indent could provide useful help, as that program converts C files from one style to another.

    13. Re:My vote is for... by baadger · · Score: 5, Interesting
      Theres an idea right there, how about some stats showing popularity of various coding conventions?

      • Variables: under_score vs. camelCase
      • Tabs vs. spaces
      • "if (cond) {" vs. "if (cond)\n{"
      • How many coders bother enclosing single conditionally executed statements with {}
      • How many coders bother producing comments directly before or after function definitions, describing function implementation?
      • Lines of comments to lines of code ratios
      • Number of functions to lines of code ratios for various projects?
      • Number of projects making use of global variables?
      • C, to C++, to C# (if your engine covers it) project ratio

      etc
    14. Re:My vote is for... by abigor · · Score: 1

      Just wait until you get an actual job - if you insist on using K&R anywhere I've ever worked, you'll get canned for not following the coding standard, assuming you actually read it. That goes double for Microsoft shops (of which I've only ever worked in one, back in 1999). I've never seen K&R in use outside of school.

    15. Re:My vote is for... by Anonymous Coward · · Score: 0

      .I.. oIo pJp ,i,, Giving you the finger! pIpp

    16. Re:My vote is for... by John+Courtland · · Score: 1

      I used BSD style for pretty much ever, weening myself on Dr Dobbs journals and Charles Petzold in my youth and not UNIX code... At my current job where we use K&R it took me a while to get used to it, and I will still CR+LF+{ instead of {+CR+LF to this day. Annoying.

      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    17. Re:My vote is for... by Anonymous Coward · · Score: 0
      Well, personally (not C++ but general programming):
      • Variables: under_score vs. camelCase
        Depends on the languages own naming conventions, usually I stick to them but I tend to use camcelCase because it looks prettier ^-^
      • Tabs vs. spaces
      • If I'm programming in an IDE which doesn't indent lines too far I'll probably use tabs because it's easier to fiddle with, but I prefer to use 2 spaces otherwise.
      • "if (cond) {" vs. "if (cond)\n{"
        "if (cond) {"
      • How many coders bother enclosing single conditionally executed statements with {}
        Nope
      • How many coders bother producing comments directly before or after function definitions, describing function implementation?
      • Depends. Normally I won't bother since I can understand my own coding without really getting confused or hunting through things. If I feel something needs documenting for debugging, future modification or if it's a complex function I probably will. Normally on the line straight after the function declaration, with a gap of one line before I write the actual code. When coding I also like to put noticablly sized comments with fancy surrounding ASCII art to split each section of the code up; global variable declaration, functions, commented out codes and\or testing section, etc.
      • Lines of comments to lines of code ratios
        Barely any really.

      I was gonna finish this post, but then I got high...
    18. Re:My vote is for... by Mr+Z · · Score: 1

      Depends on the languages own naming conventions, usually I stick to them but I tend to use camcelCase because it looks prettier

      Funny, I think naming_with_underscores is prettier personally. I feel like my head's being bounced around whenever I see a variable namedLikeThis.

      If I'm programming in an IDE which doesn't indent lines too far I'll probably use tabs because it's easier to fiddle with, but I prefer to use 2 spaces otherwise.

      I personally prefer 4 and expand tabs to spaces. I've had to work with too many tab-damaged programs to leave tabs in my source.

      "if (cond) {" vs. "if (cond)\n{"

      I have to go with "if (cond)\n{" with the brace lined up to the if. It works better with VI's indent operators < and >. Handy tip: Increase the indent level of a block of code by placing the cursor on *either* brace and press >%. Decrease with <%. Handy, huh? Now, what I'm curious about, is how many projects other than maybe Emacs and GCC use the FSF's crazy indentation scheme: (The dots are there to preserve the relative spacing.)

      . if (cond)
      . . {
      . . . . code...
      . . . . code...
      . . }
      . else
      . . {
      . . . . code...
      . . . . code...
      . . }

      All those indentation levels make the code look like a giant squiggle. :-)

      --Joe
    19. Re:My vote is for... by Heembo · · Score: 1

      I use a mixture of both - sometimes I want
      function
      {
      }
      for clarity, sometimes I want
      function {
      }
      for brevity. Why must I choose one?

      --
      Horns are really just a broken halo.
    20. Re:My vote is for... by phrotoma · · Score: 1

      Does the database track bugfixes to the available code? It would be interesting to correlate data on syntactical style against the "quality" of code. (Not to be taken literally, bugfixes per module of code could provide a crude baseline.) Perhaps certain schools of syntatical thought lend themselves to simpler code? Perhaps better coders tend towards a similar style? Surely an invitation for a flame war over semicolons but interesting nonetheless.

      --
      STANDARDS: The principles we use to reject other people's code.
    21. Re:My vote is for... by Anonymous Coward · · Score: 0

      Apparently, the brace was put on the same line as the signature to save space in the book.

    22. Re:My vote is for... by bondsbw · · Score: 0
      Number of lines like so:

      printf("Fatal Error 573: You should never see this message!");
      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    23. Re:My vote is for... by Anonymous Coward · · Score: 0

      Have you no backbone? Damn fence sitters!

    24. Re:My vote is for... by Anonymous Coward · · Score: 0

      I would like to see how many use "i" as a variable in for-loops

  4. Similarity checking by roguerez · · Score: 5, Funny

    Find similarities with stuff like SCO.

  5. Interesting stats by sparkes · · Score: 4, Interesting

    How many lines contain expletives?

    1. Re:Interesting stats by Anonymous Coward · · Score: 0

      +1

    2. Re:Interesting stats by moosesocks · · Score: 4, Informative

      How many lines contain expletives?

      for your reading pleasure.... the linux kernel fuck count

      --
      -- If you try to fail and succeed, which have you done? - Uli's moose
    3. Re:Interesting stats by Anonymous Coward · · Score: 0

      I suppose one could say that Linux has progressed from being predominantly shit to being mostly crap.

  6. SCO by cmburns69 · · Score: 2, Funny

    With all that code indexed, maybe we'll finally be able to figure out what the heck SCO's talking about.

    But then again, probably not...

    --
    Online Starcraft RPG? At
    Dietary fiber is like asynchronous IO-- Non-blocking!
  7. Wtf? by GeckoX · · Score: 1, Interesting

    What, you've created this wonderful piece of software and _now_ want to figure out what to do with it?

    Am I missing something here?

    --
    No Comment.
    1. Re:Wtf? by Anonymous Coward · · Score: 0

      And he spent a year on it, too. :)

    2. Re:Wtf? by Shimmer · · Score: 0, Troll

      That was pretty much my reaction too. Talk about a pointless project.

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    3. Re:Wtf? by Digital+Vomit · · Score: 2, Insightful
      What better reason than to create such a program other than "why not"?

      A person who is a true programmer in his soul doesn't ask himself "why". Oftentimes the sheer joy of creating something from nothing is enough.

      --
      Modern copyright is theft of culture from everyone and it retards the progress of the useful arts and sciences.
    4. Re:Wtf? by hotdiggitydawg · · Score: 1

      I think you just answered your own question - datamining for The Daily WTF...

    5. Re:Wtf? by Geoffreyerffoeg · · Score: 1

      Or as the saying goes: scientists ask "why?"; engineers ask "why not?".

  8. One word by OverlordQ · · Score: 1

    . . . well program, sloccount. Of course, do some research and tweak the paramaters to get a reasonably accurate result though.

    --
    Your hair look like poop, Bob! - Wanker.
  9. Statistics: by duckpoopy · · Score: 5, Interesting

    1. Lines per function
    2. Comment / command ratio
    3. Number of curse word variable names

    --
    word.
    1. Re:Statistics: by gronofer · · Score: 2, Insightful

      4. The number of times the wheel has been reinvented.

    2. Re:Statistics: by Anonymous Coward · · Score: 3, Informative

      From the stats page if you cannot get to it...

      Overall Stats
      Number of Packages: 10,931
      Total Number of Files: 1,151,819
      Total Lines of Code (No comments, no blank lines): 283,119,081
      Total of All Lines: 420,355,464
      Total Number of Functions: 7,782,468
      Total Number of Functions Called: 69,500,700
      Total Number of Macros: 9,947,564
      Total Number of Classes: 209,361
      Total Number of Comments: 38,125,107
      Total Number of Structures: 554,178
      Total Number of Unions: 19,687
      Total Number of Includes: 5,904,187

    3. Re:Statistics: by manJerk · · Score: 1


      would be interesting to see how many memory leaks are in all those lines of code...

      --
      -Boycot shampoo! demand real poo!
    4. Re:Statistics: by Anonymous Coward · · Score: 0
      Holy crap! 38,125,107 comments?
      What kind of programmer are you?
      Oh wait, open-source. You don't HAVE to upkeep this as part of your job!

      :D

    5. Re:Statistics: by lcs · · Score: 1
      Total Number of Functions: 7,782,468
      Total Number of Macros: 9,947,564
      Ouch.
    6. Re:Statistics: by AdamWeeden · · Score: 1

      Well if we compile them in Windows, all of them. ;)

      --
      I was quoted out of context in my autobiography...
    7. Re:Statistics: by maxwell+demon · · Score: 2, Funny
      Total Number of Functions: 7,782,468
      Total Number of Functions Called: 69,500,700

      So the code calls 61,718,232 functions which don't even exist?

      But maybe they just meant "Total Number of Function Calls" :-)
      --
      The Tao of math: The numbers you can count are not the real numbers.
    8. Re:Statistics: by dkleinsc · · Score: 1

      Some other real suggestions of useful statistics:
      1. Maximum brace nesting level for each function (might be difficult, but a good metric for determining the complexity of a function)
      2. Percentages of control structures that are while, for, switch, if, etc.
      3. Number of embedded constants that aren't 0 or 1
      4. Count of references to each function/constant within in a single project

      --
      I am officially gone from /. Long live http://www.soylentnews.com/
    9. Re:Statistics: by bob_jordan · · Score: 1

      4. How many lines belong to SCO.
      5. ?
      6. Profit

      Bob.

      (where 5 is a pretty good chance of getting counter-sued out of existance by IBM when the answer is some { and a few less }.)

    10. Re:Statistics: by ThE_DoOmSmItH · · Score: 0

      you forgot everyone's favourite command... "GOTO" ... that would be a interesting statistic to see, if people actually still use goto :)

      TDS

      --
      -TubaMan / ThE_DoOmSmItH
    11. Re:Statistics: by NewWorldDan · · Score: 1

      I'd like to see the code broken down (and searchable) by license type. BSD vs. GPL vs. Public Domain vs. Other?

    12. Re:Statistics: by sglane81 · · Score: 1

      Total Lines of Code (No comments, no blank lines): 283,119,081
      Total of All Lines: 420,355,464


      Seems to me almost half the code in there was written in Whitespace.

      --
      This is the Internet. You can say "fuck" here. - AC
    13. Re:Statistics: by Sembiance · · Score: 2, Informative

      You can see the license type broken down here:

      http://csourcesearch.net/license/

      You can also click on any of those licenses and then on that page choose to only search for code found in that license.

    14. Re:Statistics: by Mr+Z · · Score: 1

      They're probably counting all the #defines, not just the parameterized ones. So crap like "#define DEBUG" probably counts towards the total.

    15. Re:Statistics: by thornist · · Score: 1

      What about calls to external libraries. I realise there's a lot of code in there, so a lot of the libraries will be covered too, but there'll surely be calls out into the operating system and so forth.

    16. Re:Statistics: by maxwell+demon · · Score: 1

      Well, if it really indices all important C/C++ OSS projects then it should also index glibc (covers all standard C functions), gcc including libstdc++ (covers all standard C++ functions), Linux (covers Posix calls and of course Linux specific calls), X, gtk, gnome, KDE (together cover most GUI stuff) and Wine (covers a lot of the Windows APIs).

      --
      The Tao of math: The numbers you can count are not the real numbers.
  10. ratio by FreeBSDbigot · · Score: 5, Funny

    ... of "foo" to "bar."

    --
    Orange whip? Orange whip? Three orange whips.
    1. Re:ratio by c_forq · · Score: 1

      It should be "fu" (FUBAR: Fucked Up Beyond All Recognition), but it is funny nonetheless (if I had mod points I would of modded you up funny instead of posting this).

      --
      Computers allow humans to make mistakes at the fastest speeds known, with the possible exception of tequila and handguns
    2. Re:ratio by snol · · Score: 1

      And yet people always use "foo" as the throwaway identifier. Maybe most coders have an aversion to two-letter names for some reason.

    3. Re:ratio by Sexy+Commando · · Score: 1

      Uh... See this.

    4. Re:ratio by MaynardJanKeymeulen · · Score: 1

      You must be new here:
      when referencing to the movie which made it famous, you could say fubar,
      but in programming, and that's what this article is about, one uses foo bar

      --
      "The day Microsoft makes a product that doesn't suck is the day they make a vacuum cleaner."
    5. Re:ratio by TheGatekeeper · · Score: 1
      --
      'The staff in the hand of a wizard may be more than a prop for age,' -Hamá, the doorward
    6. Re:ratio by ahem · · Score: 4, Funny

      From google:

      Search -- foo -> Results 1 - 10 of about 26,600,000 for foo. (0.06 seconds)
      Search -- bar -> Results 1 - 10 of about 385,000,000 for bar [definition]. (0.16 seconds)
      Search -- foo bar -> Results 1 - 10 of about 7,900,000 for foo bar. (0.12 seconds)

      'bar' wins. This intuitively makes sense, as who would want to go to the 'foo' for a drink, or eat an 'energy foo'? Could you imagine a lawyer being 'dis-fooed'?

      --
      Not A Sig
    7. Re:ratio by sh0dan · · Score: 1
      It should be "fu" [...] (if I had mod points I would of modded you up funny instead of posting this).
      If I had mod points I would have... oh nevermind... joke's on you. ;)
    8. Re:ratio by c_forq · · Score: 1

      I wasn't referring to the movie, but the actual military jargon. See SNAFU, TARFUN, and FUBAR in a slang dictionary.

      --
      Computers allow humans to make mistakes at the fastest speeds known, with the possible exception of tequila and handguns
    9. Re:ratio by kernelfoobar · · Score: 1

      Quit making fun of my NAME!

      --
      Here we go again!
    10. Re:ratio by karnal · · Score: 1

      Linus hates you.

      --
      Karnal
    11. Re:ratio by circusboy · · Score: 1

      I recall this making it famous first, but then again, as acronyms go, it's been around for some time...

      --
      -- it's ridiculous how many people misspell ridiculous... (damn, damn, damn...)
    12. Re:ratio by Anonymous Coward · · Score: 0

      Could you imagine a lawyer being 'dis-fooed'?

      No, but I can image a lawyer being 'fish-fooed'.

    13. Re:ratio by pclminion · · Score: 1
      Assuming Google indexes about 10 billion pages, we can compute the conditional probability of Bar given Foo, i.e. P(Bar|Foo):

      P(Bar|Foo) = P(Bar,Foo)/P(Foo) = C(Bar,Foo)/C(Foo) = 7.9e6/2.66e7 = 0.297.

      Relatively high, actually.

  11. 275+ million lines by four2five · · Score: 1, Funny

    How about the % of them that would work on a lady in a bar? line 53256 "Hey pretty lady, are you an astronaut because your ass looks out of this world" ....oh....not those kinds of lines....*sigh* and I thought I was so close

    --
    -or so you'd think
    1. Re:275+ million lines by hritcu · · Score: 1

      line 53256 "Hey pretty lady, are you an astronaut because your ass looks out of this world"

      Knowing that there are not so many women writing (or *sigh* reading) open source I think it is very unlikely that adding such line to your source code will get you anywhere. You could try though, and of course tell us what happend :)

      --
      If you don't fail at least 90 percent of the time, you're not aiming high enough. (Alan Kay)
    2. Re:275+ million lines by gstoddart · · Score: 2, Funny
      How about the % of them that would work on a lady in a bar? line 53256 "Hey pretty lady, are you an astronaut because your ass looks out of this world" ....oh....not those kinds of lines....*sigh* and I thought I was so close

      No, no, no.

      You do not use lines 1..N on the same lady until it works. It's not like breaking encryption -- you don't get to try all the possible keys.

      I have friends who have done this, and they swear it's a percentage game. Choose one line you like, and try it on women 1..N until it does work, or you get tired of getting told to sod off. Apparently, with the right combination of variables, any line can be verified to work under some circumstances.

      Truthfully, I don't know how anyone can set out with the knowledge they're going to get told to drop dead 70-100 times/night, but I guess if you can live with that kind of failure rate on an ongoing basis, you'll eventually get the success rate you wanted.

      Now go forth young geek, and attempt to multiply. ;-)
      --
      Lost at C:>. Found at C.
    3. Re:275+ million lines by four2five · · Score: 1

      "Truthfully, I don't know how anyone can set out with the knowledge they're going to get told to drop dead 70-100 times/night, but I guess if you can live with that kind of failure rate on an ongoing basis, you'll eventually get the success rate you wanted." This is simply the brute force method of reproduction ;) Great post, I'd mod your's up if I had any points right now.

      --
      -or so you'd think
    4. Re:275+ million lines by kn0tw0rk · · Score: 1

      Its not the fact you use a 'line' multiple times, but the fact you try talking to 1..N ladies until you succeed.

      For those with the rejection proof ego that can go and do this, I say good luck to you.

      --
      See my art -> http://herbevore.deviantart.com
  12. Suggestion by lbmouse · · Score: 5, Funny

    "I'm currently looking for suggestions..."

    How about a new server?

  13. Slashdot Block by Yerase · · Score: 3, Interesting
    I love the GeShi page, how it blocks everything from Slashdot. Setup a site to advertise a product, then restrict people from using it....
    URLs on this server linked by slashdot.org will be refused. Permission is given to slashdot to mirror content as necessary for the purpose of providing its users access to the information on the site. Slashdot should not attempt to bypass the referer block. Use of the google cache page for the site is acceptable as long as the page(s) concerned have no more than 1 image.
    1. Re:Slashdot Block by lowrydr310 · · Score: 2, Insightful
      This policy is employed for the sole purpose of avoiding a huge bandwidth bill that I would have to pay out of my own pocket. Anyone who would like this restriction to go away is more than welcome to send me bucketloads of cash.

      If you don't want to pay a big bandwidth bill then don't run a webserver.

    2. Re:Slashdot Block by Anonymous Coward · · Score: 0

      Ok, everybody get ready to open the GeShi page in a seperate window...
      Paste the address now.
      Get ready to press enter..... 5... 4... 3... 2... 1... and press.

      Anyone still seeing the site is to press 'Refresh' as required.

      Their fault for trying to tell me what site I'm not allowed to visit if I want to visit theirs.

    3. Re:Slashdot Block by wampus · · Score: 2, Interesting

      Thats why I use Cacheout. Its a Firefox extension that adds a context menu item to coralize any link. Bypass the restriction AND not kill the site, all at the same time.

    4. Re:Slashdot Block by Anonymous Coward · · Score: 0

      Wow...sounds like someone actually RTFA.

      You must be new here.

    5. Re:Slashdot Block by Anonymous Coward · · Score: 0

      Yeah, no kidding. His first step should have been to not post to /. if he was so concerned about outlaying money.

    6. Re:Slashdot Block by b4k3d+b34nz · · Score: 2, Insightful

      Why would anybody WANT to pay a big bandwidth bill? It's called being smart so that he doesn't get the shaft when he has to pay his utilities this month.

      --
      Grammar Lesson: you're is a contraction of "you are"; your means you possess something; yore means days gone by.
    7. Re:Slashdot Block by teslar · · Score: 1
      Wow...sounds like someone actually RTFA.
      You must be new here.
      You on the other hand must be a veteran. The link the parent is talking about is not TFA ;)
    8. Re:Slashdot Block by Anonymous+Brave+Guy · · Score: 1
      If you don't want to pay a big bandwidth bill then don't run a webserver.

      If you want access to a web server, don't run a system that's known to give the provider big bandwidth bills.

      At the end of the the day, they don't owe you anything, and anything they offer you is a courtesy, not an obligation. If you don't like that, please feel free to go create and finance your own WWW.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    9. Re:Slashdot Block by gstoddart · · Score: 2, Insightful
      This policy is employed for the sole purpose of avoiding a huge bandwidth bill that I would have to pay out of my own pocket. Anyone who would like this restriction to go away is more than welcome to send me bucketloads of cash.

      If you don't want to pay a big bandwidth bill then don't run a webserver.

      That's a little harsh don't you think?

      It's one thing to run a site and have reasonable expectations of having "enough" bandwidth for your projected traffic, and it's another thing to pay for a slashdotting on an ongoing basis.

      This person has decided they don't really want to be linked from Slashdot.

      It's hardly an all-or-nothing thing ... for my personal web-site, the several gigs of traffic I'm allowed per month are more than adequate. But I'm sure as hell not going to pay extra to have enough on the off-beat chance that everyone in the world suddenly wants to see my site.
      --
      Lost at C:>. Found at C.
    10. Re:Slashdot Block by Kjella · · Score: 2, Informative

      If you don't want to pay a big bandwidth bill then don't run a webserver.

      For every problem, there is a solution that is simple, elegant and wrong. In every other market, the more demand there is, the higher the price/revenue/profit. Web servers are pretty much the only place where you lose more money the more popular you are (e-commerce sites and such not included). If so many people want the content, they can find a way to share it. Even then they're getting a bloody good deal, if you ask me. What exactly are you complaining about, that they aren't generous *enough*? Blocking slashdottings is a small price to pay compared to turning it into a [ad] pile [ad] of [ad] advertisements or subscription site. That is what you do if you "don't want a big bandwidth bill".

      --
      Live today, because you never know what tomorrow brings
    11. Re:Slashdot Block by radu124 · · Score: 1

      This is like having a party and wanting people to come over, but not too many of them because you don't want to give away too much beer.

      Some would rather have a big party even if they are left broke and some won't.

      If I really had something to show to the world, and hopefully someday I will, I'll invite Slashdot to come by.

    12. Re:Slashdot Block by gstoddart · · Score: 1
      This is like having a party and wanting people to come over, but not too many of them because you don't want to give away too much beer.

      No, it's like having a party, but being very firm that's not some "intergalactic kegger" for everyone to come by because you bought a case of beer, not enough for a frat party.

      Providing beer to a small handful of friends is one thing, providing it for everyone who crashes the party is another.
      --
      Lost at C:>. Found at C.
    13. Re:Slashdot Block by Karora · · Score: 1
      Setup a site to advertise a product, then restrict people from using it....

      Similar to the main linked site, GeShi is the product of a very smart young coder (who I happen to employ) and who does not have the funds to pay for bandwidth. He doesn't advertise on the site, and GeShi is GPL and something he did for fun in his spare time.

      I'll see if we can get it onto some better bandwidth / equipment for him so he can cope with Slashdot in the future, but it's not going to happen during this event.

      --

      ...heellpppp! I've been captured by little green penguins!
    14. Re:Slashdot Block by PhiRatE · · Score: 1

      Actually the issue isn't so much bandwidth, I put the block in place years ago when hundreds of gigabytes would have been a problem, it's not a problem anymore. The issue is one of processing power. Most sites hosted on Exorsus are PHP based and utilise a database to some degree or another. Apache is more than capable of delivering the number of hits required but on a general basis, it is more than likely that the system would overload and interrupt other users sites, email etc.

      In the end, on a free system like Exorsus, it comes down to most utility. It does not serve a good purpose to interrupt all the rest of the system users' functions in order to cater to an occasional spike, especially since there are plenty of mechanisms for helping out servers, such as coralize, which will both avoid the slashdot restriction on the site and avoid placing unnecessary load on my system.

      --
      You can't win a fight.
    15. Re:Slashdot Block by kula.shinoda · · Score: 1

      I get hosted there by my cousin, who graciously grants me space and bandwidth for free. He blocks slashdot because he doesn't charge any money for his hosting.

      I'm very grateful for his hosting, and if you were running a small OSS project for free (note, I make _no_ money from it, even though I have been offered), you'd be grateful for free hosting too. Making slashdotters hide their referrers is a small price to pay.

      --
      Real men don't write sigs
    16. Re:Slashdot Block by Anonymous Coward · · Score: 0

      I see that his project uses GPL.

      Why can't he just put his project on Sourceforge and get all the bandwith and CPU power he needs?

    17. Re:Slashdot Block by lowrydr310 · · Score: 1
      Blocking slashdottings is a small price to pay compared to turning it into a [ad] pile [ad] of [ad] advertisements or subscription site. That is what you do if you "don't want a big bandwidth bill".

      That's a very good point that I overlooked. I didn't see the original site because of the slashdot block and I was too lazy to manually type it in. If there are no ads (and he's paying out of pocket) then good for him and everyone who regularly visits his site.

  14. Of course.. by Anonymous Coward · · Score: 0

    how many lines contain the word 'fcuk'

    d'oh!

  15. Choice of db? by Anonymous Coward · · Score: 4, Interesting

    So, this is not a flame, but I'm curious about your choice of dbs.
    I've used mysql for some small projects, but generally it does handle
    millions of rows (although the upper limit on rows can be patched with
    some additional behaviors). So, for big dbs, I use postgresql.

    How did you decide to use mysql? (Was it that the project started,
    and grew, or did you know it would handle large numbers of rows
    from the start)?

    Just curious. This is probably going to be viewed as a flame by many
    (particularly those who don't really use dbs very much, but use them
    enough to have strong opinions).

    1. Re:Choice of db? by Anonymous Coward · · Score: 1, Interesting

      Tell that to the 23 million row table I'm currently playing with - no tweaking or patching needed. What version of MySQL have you tried "large" databases with (23 million rows isn't large)

    2. Re:Choice of db? by Sembiance · · Score: 4, Informative

      I've used MySQL in the past for some projects at work, where the number of rows were several hundred million and ran with no problems so I knew it was capable of large row numbers.

      I initially used their FULLTEXT indexing as well, but it dies a horrible death with a large number of rows or search terms. (The developers that live in #mysql on Freenode confirmed this)

      So I had to hand off searching to Lucene, which worried me a great deal (being java) but as folks tell me 'Java is not slow'.
      They are right, Java is very fast at handling the searching and I've been very impressed.
      Most searches in the Java database only take one or two seconds.
      The MySQL query/join for additional info take another 4 or 5 seconds.

      Most searches take about 8 seconds to come up, even under no load.

      I simply don't have enough RAM to keep the necessary MySQL indexes in RAM and use index only queries.

    3. Re:Choice of db? by Anonymous Coward · · Score: 0

      So... why is the server dead?

      Web server?
      Database?
      Search engine?
      None of the above?

    4. Re:Choice of db? by Sembiance · · Score: 1

      Well the server didn't actually die.
      I had a limit of 125 connections for Apache, and that was reached and stayed maxxed for several hours.

      The site did respond to requests, searches, etc. it was just very slow due to high load on the box:
      18:38:29 up 97 days, 9:21, 1 user, load average: 27.49, 21.31, 28.03

      It was in the 40+ range earlier :)

  16. And then... by guaigean · · Score: 1, Troll

    Stay tuned for our reaching 280 million lines, followed by 285, 290, 295, and 300. Expect a new Slashdot post soon, as we need to advertise!

    --
    Microsoft Sucks, F/OSS Rocks. I get mod points now right?
    1. Re:And then... by Sembiance · · Score: 5, Interesting

      Advertise? No, I'm just a single coder doing this for fun and hope that some people will find it useful.

    2. Re:And then... by guaigean · · Score: 2, Funny

      My apologies then. As a regular Slashdotter it is forbidden for me to RTFA.

      --
      Microsoft Sucks, F/OSS Rocks. I get mod points now right?
    3. Re:And then... by Anonymous Coward · · Score: 0

      Thanks, dude!!!

      I can throw away many stupid/bloated books and set the homepage in my browser to about:blank again (instead of google for searching code snippets).

      You made my life easier!

    4. Re:And then... by Anonymous Coward · · Score: 2, Funny

      I'm just a single coder

      -1, Redundant

      This is Slashdot, of course we're all single.

    5. Re:And then... by chris_eineke · · Score: 1

      My hat's off to you. Great work.

      --
      "All you have to do is be fragile and grateful. So stay the underdog." Chuck Palahniuk, Choke
  17. Just a couple... by nexxuz · · Score: 0

    Most frequently searched items, number of searches per min. (or after /. per sec.)

    --
    I love random hex numbers! Just like this one, 09f911029d74e35bd84156c5635688c0.
  18. Just Like The Linux Kernel Problem by jack_csk · · Score: 0, Redundant
  19. Statistics TM (c) by chunews · · Score: 5, Interesting
    It would be interesting to see the number of different copyright notices contained within all that source code, and then to present the notices in groups, like GPL GPL2, etc..

    Also, I would really like to find "patient 0" for sourcecode. For example, is there a common library or utility function (perhaps Hex2Ascii?) that *everybody* uses? Well, who wrote it first?

    And in a similar vein, who are the "top 5-10-100" authors of open source code by use, reuse, KLOC, etc.. Not of too much use unless I were awarding the Nobel prize for programming, or perhaps creating a list of individuals for the RIAA to sue, after their done with their other useless lawsuits. :)

  20. Interesting Statistics by iso-cop · · Score: 5, Interesting

    In the software engineering world, people will be interested in all sorts of code metrics such as cyclomatic complexity, operator/operand counts, lines of code per module, and such as well as object oriented metrics for the C++ code (depth of inheritance, for example). If you can marry these sorts of metrics with defect data (bugs) for each of the modules then you have a useful data repository for predicting defects in source code. Keeping around different versions of modules changed is also valuable here. If you can gather information on how long it took to produce the module and how long it took to correct defects in the module you are getting even better. If you make it easy to reuse the C and C++ modules...even better.

    1. Re:Interesting Statistics by julesh · · Score: 1

      In the software engineering world, people will be interested in all sorts of code metrics such as cyclomatic complexity, operator/operand counts, lines of code per module, and such as well as object oriented metrics for the C++ code (depth of inheritance, for example).

      Nah. What we really want to know is, which open source project has the most obscenities in its comments?

    2. Re:Interesting Statistics by Andreas(R) · · Score: 1
      In the software engineering world, people will be interested in all sorts of code metrics such as cyclomatic complexity, operator/operand counts, lines of code per module, and such as well as object oriented metrics for the C++ code (depth of inheritance, for example).


      As part of an empirical study, I've used CCCC , to measure the software evolution of software (how metrics for SW architecture evolves over time). This tool supports McCabe's cyclomatic complecity, LOC, Henry-Kafura information flow metric, module coupling etc. The purpose can be to detect software decay, architecural mismatch etc. However, to study software evolution, one needs access to all the versions of the software, which this site does not provide (yet).

      Lehman did the first studies on software evolution, proposing several laws for the field.

    3. Re:Interesting Statistics by Anonymous Coward · · Score: 0
  21. Size doesn't matter by Peteresch · · Score: 1

    It's the quality of the search results that counts.

    1. Re:Size doesn't matter by kmartshopper · · Score: 3, Funny
      It's the quality of the search results that counts.
      Yeah, keep telling yourself that...
  22. Amazon style statistics by tod_miller · · Score: 4, Interesting

    I was very impressed with Amazon, who for each book say which phrases and words were particularly unique to that book. (reminds me of that google game where try try and get any two words with only 1 hit).

    So show code with coloured background to the lines, from green to red, green being 'normal every day boiler plate' code, red would mean this code must be more specialised, or written by some half-wit l33t h4x0r at least.

    I forgot what they called it, but they had 3/4 visible stats based on the semantics of the stuff, probably more under the 'hood (omg lol).

    word. Oh some adhesion stats would rock!

    please type the word in this image: adhesion
    random letters - if you are visually impaired, please email us at pater@slashdot.org

    --
    #hostfile 0.0.0.0 primidi.com 0.0.0.0 www.primidi.com 0.0.0.0 radio.weblogs.com
    1. Re:Amazon style statistics by 3770 · · Score: 1


      That was harder than I thought:

      perpetuum fellatio, 922 hits
      perpetuum chives, 84 hits
      perpetuum snail, 190

      922 people were able to fit perpeetum and fellatio on the same page. 84 people wrote about perpetuum and chives and 190 about perpetuum and snail.

      perpetuum napalm, 2190
      perpetuum booger, 487
      perpetuum spleen, 518
      perpetuum ninja, 931

      Man...

      --
      The Internet is full. Go Away!!!
    2. Re:Amazon style statistics by RobbieGee · · Score: 1

      "Results 1 - 10 of about 3,460,000 for revolutionizing technology."

      Hm, this is going to be harder than I thought...

      --
      If you get this, we're 10 of a kind.
    3. Re:Amazon style statistics by Anonymous Coward · · Score: 0

      senile zooarcheologist. Well, at least until Google hits this page...

  23. Re:Are you proud of 275 million lines of code? by sparkes · · Score: 1

    Write 'I must read at least the post before I comment' 275 million times and when you are finished you can use slashdot again.

  24. Pro Words by SpinJaunt · · Score: 1

    Obviously we geeks really want to know is, how many "F" & "S" profanity words there are, amongst other useful and descriptive comments.

    --
    /. is good for you.
  25. Several basic stats by Anonymous Coward · · Score: 0

    Number of non-comment, non-blank lines
    Number/percentage of each C/C++ control structure (if, switch, variable assignment, etc.)
    Average size of functions in lines and min/max.

  26. The basics and more by PetriBORG · · Score: 2, Insightful
    Start with the basics, and then move on..
    1. Whitespace to code ratio
    2. Counts for each of the dirty 7
    3. Line counts that just contained () or {} or []
    4. A list of projects the code is from
    5. And then more interestingly, I'd like to run some sort of program on it to find similarities in code, to see how much one code base overlaps with another. It would be interesting to see if OSS actually does share code between projects or if its all NIH (not invented here).
    --
    Pete/Petri "damn, my chainsaw is clogged with 1's and 0's again." --clyde
    1. Re:The basics and more by Sembiance · · Score: 1

      You can see the list of projects this code is from here:
      http://csourcesearch.net/package/

  27. Hit Refresh by everphilski · · Score: 4, Informative

    Just hit refresh and the webserver won't get the HTTP_REFERRER (granted you'll have to manually delete the text file he serves you)

    -everphilski-

    1. Re:Hit Refresh by sglane81 · · Score: 2, Funny

      Actually, if you click refresh on a page from a link, it will resend the referrer as well. Most browsers do this. One more thing, you spelled HTTP_REFERRER correctly, which is wrong :) It's spelled HTTP_REFERER, only has one R. Reverse grammar nazi FTW?

      --
      This is the Internet. You can say "fuck" here. - AC
    2. Re:Hit Refresh by FuzzyBad-Mofo · · Score: 1

      You can also disable the Referer header in Mozilla-based browsers by a setting in about:config. I'll leave the merits of doing so to the reader.

    3. Re:Hit Refresh by Anonymous Coward · · Score: 0
      HTTP_REFERER, only has one R

      Well three if you really want to be pedantic.

    4. Re:Hit Refresh by RobertLTux · · Score: 1

      or for extra Pedantic Points the second group of the character R is a single R (as are the other two groups) or the only character in the sequence that is doubled is the T (the second and third characters)

      --
      Any person using FTFY or editing my postings agrees to a US$50.00 charge
  28. interesting stat by bsdluvr · · Score: 3, Funny

    1) randomly select 2000 lines of code
    2) compile
    3) execute
    4) ???????
    5) PROFIT!

    1. Re:interesting stat by gnud · · Score: 1

      I think Step 4 should be "Rewrite into a ground-breaking application, that will for decades be known as the epitome of usefullness and good engineering. Sell to highest bidder."

  29. What? Millions of code? by bogaboga · · Score: 0

    As a programmer myself, though not that serious, the greatest number of lines of code I have written is 13,671 in a VB application processing costs for chemical analysis in a lab. This makes me wonder...How can one write over 200 million lines of code? How does one debug the beast? Believe me, even 1 million lines of code is a lot of code. How long does this thing take to compile? There are so many questions that just leave me to respect these programmers.

    1. Re:What? Millions of code? by Anonymous Coward · · Score: 0

      It's not all written by one guy.

      In case you weren't being serious, "heh". +0.1 funny.

    2. Re:What? Millions of code? by tgd · · Score: 4, Informative

      Its a searchable database OF code from other products, containing 275 million lines you can search across.

      Its not a searchable database written in 275 million lines of code.

    3. Re:What? Millions of code? by Anonymous Coward · · Score: 0

      This is a database of many multi-purpose code sections. This is not a single application.

    4. Re:What? Millions of code? by masklinn · · Score: 1

      Whoa, not only you didn't RTFA (well, that's slashdot so it's ok) but you didn't even read the headline?

      --
      "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
    5. Re:What? Millions of code? by Anonymous Coward · · Score: 0

      The main problem you have is that VB takes a lot less lines to code the same.
      For example:
      On VB you do: 'msgbox "I don't read the posts"'
      On C++ yo do:
      main
      (
      int
      argc
      ,
      char
      *
      *
      argv
      )
      {
      etc..
      etc..

      I hope you get the picture.

    6. Re:What? Millions of code? by Shimmer · · Score: 1

      This project didn't write the 275 million lines of code, they collected code written by others.

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    7. Re:What? Millions of code? by Quiet_Desperation · · Score: 1
      That's why I moved on to higher level stuff like VB, or RealBasic now that VB has been sucked into the .Net singularity. I don't write 3D games or supercomuter simulations of galactic collisions. Most of what I write is toolware or interfaces to my own hardware designs- very GUI oriented stuff that needs to go from idea to working application in, like, one day. But I still get the "serious coders" asking "why aren't you doing that in C?" Or the message board trolls with "Dur! You couldn't write a FPS in RB! Dur!" Yeah, no shit, Sherlock.

      At this point, I just laugh at them and put dirt in their hair.

    8. Re:What? Millions of code? by Anonymous Coward · · Score: 0

      I think you're confused.

      This is not a single software product. It is a collection of many OSS projects who's contents have have been indexed by a search engine. Hence the huge line count.

    9. Re:What? Millions of code? by Anonymous Coward · · Score: 0

      What kind of questions are you asking on message boards that gets people to make fun of you? By asking, you demonstrate that you don't in fact know it all. Maybe you should heed their advice. Stay away from toy languages like C, C++, Java, and Python. Use FoxPro.

    10. Re:What? Millions of code? by Quiet_Desperation · · Score: 1
      Wow. You really were looking for someone to dump on today, weren't you?

      I meant trolls who go to RB message boards and troll about RB. I'm not asking any questions at all.

      Toy languages? Huh? Every language has its place and use. That's all I say.

    11. Re:What? Millions of code? by SamSim · · Score: 1

      So it's a searchable database written in 275 million lines of database!

  30. Three or Four? by sycodon · · Score: 1

    So that's what...3 or 4 programs worth?

    --
    When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
  31. Woman by chris_mahan · · Score: 2, Funny

    I'd like to know whether the word "woman" appears anywhere, and if so, in what projects.

    Eh.

    --

    "Piter, too, is dead."

  32. Unfortunately by aztektum · · Score: 1

    All the code was just /.'ed into oblivion. Time to start from the beginning all over again. :(

    --
    :: aztek ::
    No sig for you!!
  33. Measurements I have made by derek_farn · · Score: 4, Insightful
    Source code usage measurements contain many surprises (ie, developers don't always write what people think they do). Some statistics I have collected, on a smaller code base, are available here. The source of the tools used to exract much of the data (at least for those tables and figure I produced) is available here (C only at the moment).

    Being able to search so much source is also very useful. I was involved in a discussion a while back about the frequency of use of bessel functions in programs (I claimed rare). The handful of uses returned from your database helped back up my argument (dare I say prove it).

    Keep up the good work!

    1. Re:Measurements I have made by Stealth+Potato · · Score: 1

      You numbered the sections starting at negative five?

      You, sir, are a geek among geeks. I salute you.

    2. Re:Measurements I have made by sir99 · · Score: 1

      Is there a reason why the caption of Figure 0.19 is mirrored, upside down, and has its period in the right margin? That's some right fancy formatting you've got in that document! (only half-joking)

      --
      The ocean parts and the meteors come down
      Laid out in amber, baby.
    3. Re:Measurements I have made by derek_farn · · Score: 1
      Period in the right margin! Thanks for reporting the typo (it should be in the expected place).

      The text (available via this page) asks readers to estimate the relative brightness of various squares. Not wanting people to get the answer by simply reading the caption (many people can read upside down writing relatively easily) I mirrored it as well making it upside down (who said modern books were dumbing down for their readers ;-).

    4. Re:Measurements I have made by sir99 · · Score: 1

      At first I thought it was a dead pixel, can't have that! But I see your point, literally and figuratively ;). I had to use a mirror to read it myself. Even if one draws a thick line of constant color between the two squares, it still looks like the line is a smooth gradient between different intensities.

      --
      The ocean parts and the meteors come down
      Laid out in amber, baby.
  34. Sounds kind of like the PMD scoreboard... by tcopeland · · Score: 4, Interesting

    ...that is, a static analysis of a bunch of Java SourceForge projects. It does unused code and duplicate code detection... sometimes it finds some interesting things.

    PMD home page is here, book site is here.

    1. Re:Sounds kind of like the PMD scoreboard... by gcooke · · Score: 1

      There's a company called Headway Software, makes a tool called reView (...I think it has a different name now) that generates UML-like diagrams of source code annotated with a buttload of metrics. I'd love to see the reView tool run against this C/C++ database and the resulting trees stored for perusal.

      Metrics are going to be a key adjunct to this database. All the metrics tools like reView, PMD, Parasoft's tools, etc. produce would be useful.

      Even more useful would be pattern metrics -- CheckStyle and PMD can recognize some common design patterns and one of them (PMD?) has the ability to be extended with custom pattern recognizers. With a database this big, it should be feasible to produce proof substantiating the claim to bestness of just about any practice.

    2. Re:Sounds kind of like the PMD scoreboard... by tcopeland · · Score: 1

      Yup, both Checkstyle and PMD can be extended by writing custom rules. I think with Checkstyle you can use regexp's quite cleanly, while with PMD you can use XPath. There's some discussion of PMD XPath examples in this CodeSnipers interview.

  35. Statistics? by Anonymous Coward · · Score: 0

    "I'm currently looking for suggestions on what sort of 'interesting statistics' I could create from 275+ million lines of open source C/C++ code."

    The obvious statistic would be: how many of these are copyrighted by CSO?

  36. cout "why bother" by micromuncher · · Score: 1

    I'm currious, when people are looking for code, what do they do as a first resort? Maybe this should be a poll. Me, I'm a bit funny...
    1) look in my library (books)
    2) do a deja search
    3) ask smarter people than me
    4) do a web search (usually on specific sites)

    --
    /\/\icro/\/\uncher
  37. Find all buffer overflows please by G4from128k · · Score: 1

    I can only hope that this database has good metadata on which code fragments contain/don't contain various common species of exploits (buffer overflow, stack overflow, mal-formed input vulnerabilities, etc.). It would be nice to know which code fragments have all the needed input/size checking needed to be safe for exposure to the outside world and which are "for internal use only."

    --
    Two wrongs don't make a right, but three lefts do.
  38. the obvious answer by BushCheney08 · · Score: 0, Flamebait

    The most obvious statistic is "how many of these lines were stolen from SCO?"

    --
    Be a real patriot: Question authority. Think for yourself. Formulate your own conclusions.
    1. Re:the obvious answer by iapetus · · Score: 1

      275 million, but I'm not telling you which ones.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
  39. Interesting statistic... by programic · · Score: 1

    How about the number of lines marked up with "TODO"?

    --
    -- yawn. --
  40. Koders dot com by Anonymous Coward · · Score: 0

    Searching 225,816,744 lines of code...

  41. interesting stats .. by torpor · · Score: 1

    .. how many times the same code appears with different function names (i.e. how plagued by NIH are you)? .. how many times the same function_name() appears with different code? .. how much of the code fails to compile?

    --
    ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
  42. How about... by Hrvat · · Score: 1

    What is the most common controlling variable name in a for loop?

    --
    TANSTAAFL
  43. Most important search term by Boom11 · · Score: 0

    The most important search term would be "functionality", ie. show me functions which do this or that.
    Without the ability to find the needle, the big hay-stack you have collected will only give you huge bandwidth bills, and give us with very little that cannot be found elsewhere.

  44. Not working well -- TRY AGAIN LATER by putko · · Score: 1

    It is hosed.

    I tried searching. Here's what I got:

    XML Parsing Error: junk after document element Location: http://csourcesearch.net/performSearch.php?type=Fu nctionTypeReturned&search=(&ignoredRandomNumber=11 33805159922.7798 Line Number 2, Column 1:Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '127.0.0.1' (4) in /home/csourcesearch.net/include/php/GraphXML.php on line 309
      ^

    --
    http://www.thebricktestament.com/the_law/when_to_s tone_your_children/dt21_18a.html
  45. Please check for this: comma in brackets in C++ by Animats · · Score: 5, Interesting
    C++, for historical reasons dating back to C, has wierd semantics for commas in brackets. The operator precedence for commas is different inside of "()" and "[]".

    So tab(i,j) is a function call with two arguments. But tab[i,j] is an invocation of the "comma operator", then a function call with one argument. The default "comma operator" ignores the first argument and returns the second. It once had some uses in C macros.

    I've argued with the C++ committee about this. If "operator[]" had the same syntax as "operator()", we could have support for multidimensional arrays in C++. But there's a concern that somewhere, someone might have code that depends on the current semantics of the comma operator inside square brackets.

    This new archive offers the opportunity to eliminate that possibility. So, do this search: Find, in non-comment standard C++ code, any occurences of a comma operator within square brackets. Eliminate any where there are parentheses within the square brackets enclosing the comma. Can you find any? In any production code? In any open-source project? Anywhere?

    1. Re:Please check for this: comma in brackets in C++ by Vorondil28 · · Score: 3, Insightful

      I've argued with the C++ committee about this. If "operator[]" had the same syntax as "operator()", we could have support for multidimensional arrays in C++.

      I'm no C++ expert, but isn't int array[row][col] a multidimensional array?

      --
      This sig rocks the casbah.
    2. Re:Please check for this: comma in brackets in C++ by Animats · · Score: 1
      I'm no C++ expert, but isn't int array[row][col] a multidimensional array?

      No, it's an array of pointers to an array of elements, which is not quite the same thing.

      Arrays with multiple subscripts have many uses. Sparse array implementations, for example. People implement this now with code that looks like

      tab(i,j) = 1;

      This is valid C++, and with the right overloads, it compiles and runs, but it looks wierd.

    3. Re:Please check for this: comma in brackets in C++ by chris+macura · · Score: 4, Informative

      Yes, they are.

      But from an OOP standpoint, it's impossible to create a datastructure that "knows" you're using the [] operator twice. So if you overload the [] operator in an array structure, to get multi-dimensional arrays, you have to nest single dimensions arrays, which is almost always inefficient because the rows (or columns, depending on whether you're row major, or column major) are lying around the RAM (depending on where they were allocated) , rather than a continous chunk like with C.

      In other words, you can't do something like this in C++:

      class SmartArray {
        public:
          SmartArray(int height, int width);

          int operator(const int &x, const int &y) const;

          // ...
      };

      ...

      SmartArray a(5, 5);

      a[12, 13];

    4. Re:Please check for this: comma in brackets in C++ by milgr · · Score: 2, Informative
      The grandparent got it correct. C does support multidimensional arrays. I suspect that C++ does too.

      To validate, I pulled out my copy of K&R 2nd edition (Actually a copy I once rescued from a trash bin, and my copy is only "Based on Draft-Proposed ANSI C"). In section 5.9 Pointers vs. Multi-dimensional Arrays it points out,

      Newcomers to C are sometimes confused about the difference between a two-dimensional array and an array of pointers, such as name in the example above. Given the definitions
      int a[10][20];
      int *b[10];
      then a[3][4] and b[3][4] are both syntatctically legal references to a single int. But a is a true two-dimensional array: 200 int-sided locations have been set aside, and the conventional rectangular subscript calculation 20xrow+col is used to find the element a[row,col]. For b, however the definition only allocates 10 pointers and does not initialize them; initialization must be done explicitly, either statically or with code.
      --
      Where law ends, tyranny begins -- William Pitt
    5. Re:Please check for this: comma in brackets in C++ by Anonymous Coward · · Score: 0

      It once had some uses in C macros.

      What are you talking about? The main use of the , operator was and still is in for-loops. No wonder they ignored you.

    6. Re:Please check for this: comma in brackets in C++ by Anonymous Coward · · Score: 0

      But there's a concern that somewhere, someone might have code that depends on the current semantics of the comma operator inside square brackets.

      I'd say go ahead and break it. People shouldn't do that. It's confusing and a good example of operator overloading at its worst.

    7. Re:Please check for this: comma in brackets in C++ by Jesus+2.0 · · Score: 1

      The default "comma operator" ignores the first argument and returns the second.

      I don't believe that that's true.

      I believe that it executes the first, executes the second, and returns the result of having executed the second.

    8. Re:Please check for this: comma in brackets in C++ by unsinged+int · · Score: 1

      You're correct, but that's not what the original post is saying. The only way to provide a sparse-matrix class in C++ is with member functions. You can't do it by overloading [] to accept two arguments, e.g. array[2,4]. You have to use a member function, making it look like array.get(2,4), or perhaps overloading () for array(2,4). There's no way to write a matrix class that uses square brackets for indexing more than one dimension.

    9. Re:Please check for this: comma in brackets in C++ by tehshen · · Score: 1

      The default "comma operator" ignores the first argument and returns the second.

      Not quite, it executes all arguments, and returns the final argument. i++, j++; increments both i and j, and returns j+1.

      --
      Guy asked me for a quarter for a cup of coffee. So I bit him.
    10. Re:Please check for this: comma in brackets in C++ by Animats · · Score: 1
      Those are built-in C arrays. That mechanism is a C special case, and applies only to built-in arrays. It doesn't generalize well to C++ objects. Try to use <vector> to handle multidimensional arrays and you'll see what I mean. You can declare

      vector<vector<float> >

      but you'll get an array of arrays, not a 2D array.

    11. Re:Please check for this: comma in brackets in C++ by Articuno · · Score: 1

      Not quite, j++ changes j to j+1 but returns the old value, not the new one (just being -Wall --pedantic :-)

      --
      So Long and Thanks for All the Fish!
    12. Re:Please check for this: comma in brackets in C++ by torokun · · Score: 1

      why can't you just overload the comma operator, build up the arguments into a single datatype, and pass it to the indexing function? This kind of stuff is done a lot for fast matrix multiplication and similar things.

    13. Re:Please check for this: comma in brackets in C++ by The+boojum · · Score: 3, Interesting
      I was just going to point this out. I even hacked up a simple example to show it:
      struct location {
          int dimension, coordinates[ 20 ];
          location( int first_coordinate ) : dimension( 1 ) {
              coordinates[ 0 ] = first_coordinate;
          }
          location &operator,( int const right ) {
              coordinates[ dimension++ ] = right;
              return *this;
          }
      };
      struct array {
          int matrix[ 100 ][ 100 ];
          int &operator[]( location const &right ) {
              return matrix[ right.coordinates[ 1 ] ][ right.coordinates[ 0 ] ];
          }
      };
      int main( int argc, char **argv ) {
          array blah;
          blah[ 5, 5 ] = 10;
      }
      Proof of concept and it doesn't really do anything, but it compiles just fine. I don't see a problem here. A real implementation would probably do some clever stuff so that the optimizer can optimize away the intermediate data structure.
    14. Re:Please check for this: comma in brackets in C++ by spongman · · Score: 1
      No, it's an array of pointers to an array of elements
      This is the default definition of operator [], but you could easily overload it to do something else.

      for example, you could easily write a set of templates such that array[row][col]=3 would result in array.set(row,col,3) and still maintain type-safety and efficiency.

    15. Re:Please check for this: comma in brackets in C++ by NoOneInParticular · · Score: 1
      Bollocks:

      class SmartArray {
      class SmartArrayProxy {
      SmartArray& data;
      int row;
      double operator[](int col); /* now we have row and col and can do our smart stuff */
      };

      SmartArrayProxy operator[](int idx);
      };
    16. Re:Please check for this: comma in brackets in C++ by NoOneInParticular · · Score: 1

      Not true, check my previous post. With that, you can simply use a[i][j] as usual, and have your sparse operations as if it was a single function.

    17. Re:Please check for this: comma in brackets in C++ by hikerhat · · Score: 2, Funny
      Well, the obscureness of the comma operator is used by C++ recruiters who thinks they are really "clever", and in "clever" C/C++ puzzles on usenet. If you took it away, how would you hire C++ programmers and how would you have fun on usenet?

      Also, C++ programmers are getting really old, and they don't handle change very well.

    18. Re:Please check for this: comma in brackets in C++ by Old+Wolf · · Score: 3, Insightful

      You can do exactly that -- just write a(12,13) instead of a[12,13].
      This is a great counterexample to the GP. Changing the meaning
      of the comma within square brackets would gain NOTHING and would
      mean every existing compiler is now wrong.

      The existing C array type is bad enough as it is, why make it
      even more unwieldy by introducing a new variant? C++ is already
      on the right track: discourage C arrays, and encourage container
      classes that have things like bounds checking and automatic
      memory allocation.

    19. Re:Please check for this: comma in brackets in C++ by demo · · Score: 1

      Well, the point is to use the same indexing mechanism with a multidimensional (and/or sparse) array.

      When dealing with vectors and other containers, "operator[]" provides a clear syntax for access.

      Of course, it is mostly syntactic sugar, but it is _nice_ syntactic sugar.

      --
      ---
    20. Re:Please check for this: comma in brackets in C++ by tehshen · · Score: 1

      I meant that. You know I meant that.

      --
      Guy asked me for a quarter for a cup of coffee. So I bit him.
    21. Re:Please check for this: comma in brackets in C++ by chris+macura · · Score: 2, Insightful

      That's the whole point of the complaint. Inconsistentcy between [] and ().

    22. Re:Please check for this: comma in brackets in C++ by Geoffreyerffoeg · · Score: 1

      const int &x, const int &y

      This is wasteful. You're not avoiding copying, you're copying a pointer. On most systems an int and a pointer are the same size. On all systems the size difference is so small that you should start saving space by making it a short. Besides, directly passing by value gives you a local copy to mess with (for stuff like while (*a++)).

      Anyway, back on topic. You've always been able to do multidimensional array syntax in C++ classes:

      class SmartArray {
        public:
          int getElement(int row, int col);

          class SmartArrayHelper {
            private:
              int row;
              SmartArray* array;
            public:
              int operator[](int col) {
                return array->getElement(row, col);
              }
            friend class SmartArray;
          };

          SmartArrayHelper operator[](int row) {
            SmartArrayHelper h={row, this};
            return h;
          }
        private: ...
      };

      This follows C multidimensional array semantics: if a is the array, a[x][y] is the element at (x, y), and a[x] is a valid object (whose type you can ignore, e.g., by templates) such that applying [y] to it yields the right element. a[x,y] still returns a[y], as it always did ("this is a feature, not a bug").

      If you're picky about the commas, try this:

      #define [ +brackets(
      #define ] )
      struct brackets {
        int row, col;
        brackets(int row, int col) {row=r; col=c;}
      };

      template <class T>
      T operator+(T array[][], brackets b) {
        return array[b.row][b.col];
      }

      I haven't tested the #defines, but they should work. (This turns a[x, y] into a+brackets(x, y).) Overload operator+ for all classes you like, and overload the brackets constructor if you want other than two dimensions (and keep track of the dimensions, and throw stuff if the dimensions are wrong).

    23. Re:Please check for this: comma in brackets in C++ by Articuno · · Score: 1

      Yeah, I knew (i think... :-)
      But I couldn't resist to repeat the "pattern" of your post ^_^;;;

      --
      So Long and Thanks for All the Fish!
    24. Re:Please check for this: comma in brackets in C++ by Anonymous Coward · · Score: 0

      You could do something like this:

      double **a= new double * [n];
      a[0]=new double[m*n];
      for(int i=1;in;i++)
          a[i]=a[i-1]+m;

      But you still have to write
      a[i][j];
      instead of
      a[i,j];

      And you have to free the memory at the end or in destructor:
      delete [] a[0];
      delete [] a;

    25. Re:Please check for this: comma in brackets in C++ by Anonymous Coward · · Score: 0

      I doubt you've looked very hard or argued with the C++ committee (unless you count trolling comp.std.c++) because here is an obvious counterexample:

      http://www.boost.org/doc/html/lambda/le_in_details .html#lambda.lambda_expressions_for_control_struct ures

    26. Re:Please check for this: comma in brackets in C++ by Anonymous Coward · · Score: 0
      If "operator[]" had the same syntax as "operator()", we could have support for multidimensional arrays in C++.

      While, as others have pointed out, there is a perfectly functional workaround for this (and of course the native multidimentional arrays), this would be very cool. While the workaround works, it's really ugly and annoying.

      Find, in non-comment standard C++ code, any occurences of a comma operator within square brackets. Eliminate any where there are parentheses within the square brackets enclosing the comma.

      Not quite enough:
      #define F(X) X,3
      #define G(X,Y) (X[Y])
      G(a,F(b));
      Of course, F() is a very evil macro.
    27. Re:Please check for this: comma in brackets in C++ by ozzee · · Score: 1

      You don't even need a proxy for this. class SmartArray { double * operator[](int idx); };

    28. Re:Please check for this: comma in brackets in C++ by Anonymous Coward · · Score: 0

      In C# that's referred to as a jagged array. I like the term.

    29. Re:Please check for this: comma in brackets in C++ by NoOneInParticular · · Score: 1

      Yours will work fine when you are dealing with a simple matrix stored in contiguous memory. The proxy is necessary if you want to cater for triangular matrices, diagonal matrices, and/or sparse matrices, and only want to store the (possibly) non-zero numbers.

    30. Re:Please check for this: comma in brackets in C++ by Old+Wolf · · Score: 1

      That's the whole point of the complaint. Inconsistentcy between [] and ().

      Well, a comma is the comma operator everywhere, except when it's a separator in a list (specifically: argument-list, formal-parameter-list, initializer-list).

      Perhaps it would have been better originally to use a different symbol for the comma operator from the list separator. But it's too late now, as both usages are very widespread.

      Currently there's no such thing as an "array index list", because C++ does not have true multi-dimensional arrays. If we were to add the index-list syntax I think it would just add to the confusion (most casual programmers already have enough trouble with the interaction between arrays and pointers as it is, without adding complication).

      Note: Although the OP was suggesting the array index list only in the context of UDT operator[] functions. But it follows from this that the syntax would also be usable with actual arrays, otherwise we would need context-sensitivity to parse x[a,b] and IMHO that would be a big mistake.

    31. Re:Please check for this: comma in brackets in C++ by Old+Wolf · · Score: 1

      Sorry, something I forgot to mention in my initial post:

      But from an OOP standpoint, it's impossible to create a datastructure that "knows" you're using the [] operator twice. So if you overload the [] operator in an array structure, to get multi-dimensional arrays, you have to nest single dimensions arrays, which is almost always inefficient

      This is crap. Here's a quick example (without bounds-checking, exception-safety, or const-correctless, for the sake of clearly illustrating my point):

      #include <iostream>

      struct SmartArray
      {
                      SmartArray(int rows, int cols)
                                      : rows(rows), cols(cols), mem( new int[rows * cols] ) {}
                      ~SmartArray() { delete [] mem; }

                      int &operator()(int y, int x) { return mem[y * cols + x]; }
                      int *operator[](int y) { return &mem[y * cols]; }

      private:
                      int rows, cols, *mem;
      };

      int main()
      {
                      SmartArray sa(2, 4);
                      sa(1, 2) = 12;
                      std::cout << "sa[1,2] is " << sa[1][2] << std::endl;
      }

      You can even generalise this to any number of dimensions by
      using a template with the number of dimensions as a parameter,
      and a helper class instead of "int *" as the return type of
      operator[] .

  46. Yet another source code search engine? by Anonymous Coward · · Score: 1, Insightful

    Source code search engines have been extremely helpful for me. I prefer www.koders.com, but there are quite a few other decent ones out there. What does this engine has to offer that the others don't? It seems like this one doesn't index code repositories but only indexes files local to the server. Neither does it allow you to click on words in the code and search for them. I also sorely miss bookmark friendly URL:s and free text queries. On the positive side, I note that your search engine is totally free from ads! Very nice! Although I wouldn't mind having to look at a few ads (which I might even click on) because running a search engine is expensive and a good source code search engine is a very useful service. I sincerly hope that we will see some upgrades of the site.

    1. Re:Yet another source code search engine? by Sembiance · · Score: 2, Interesting

      I just did it for fun, and hopefully some people might get some use out of it.

      This engine understands the code at a C/C++ syntax level, unlike koders.com so you can better search for what your after (comments, functions, macros, classes, etc).

      Also this engine DOES allow you to click on words in the code, but only includes and function or macro calls.

      There are several things that are not that great about my site, it's a little slow, doesn't support free text searching nor variable searching, and you can't copy search URL's for pasting (uses XMLHttp and form POST's).

      But it's just me doing this thing, and I have limited time and most importantly limited money/hardware.

      My wish is for google to do their own but index a LOT more code and have it be fast and friendly :)

      They certainly have the resources to do it and would be a great tool for coders to use. Maybe this will help fill a gap in the mean time :)

  47. best_idea_ever by l33t-gu3lph1t3 · · Score: 3, Insightful

    charge for a premium service that allows Computer Science and Software Engineering profs to perform a somewhat intelligent search of the code to see just how much of their students' code is lifted off the 'net ;)

    --
    ------- "From bored to fanboy in 3.8 asian girls" ----------
    1. Re:best_idea_ever by Philodoxx · · Score: 1

      Why would you need to compare it against a database? There are already free programs that can do a pretty good job of comparing one submission against all the others. If a cheater in a large class copied code from the net, there's a good chance that somebody in the class copied it from the same resource.

      Plus schools are cash strapped enough as it is, they don't need something else draining their coffers.

      --
      Oh, a lesson in history from Mr. I'm my own grandpa.
  48. Statistical artificial program by yttrium · · Score: 1

    Use statistics to construct what an "average" program looks like, and see what it does. :)

  49. Function by ninthwave · · Score: 1

    Compare functions looking for library routines that need to be created.
    Look for common code structures that are not in libraries to create more libraries.

    More libraries.

    --
    I was thinking of the immortal words of Socrates, who said: "I drank what?" - Chris Knight (Val Kilmer)- Real Genius
  50. Search for this bug by ibpooks · · Score: 1

    if( something = something ) ...

    1. Re:Search for this bug by maxwell+demon · · Score: 0

      Well, given that assigning something to itself is a no-op (unless it's a volatile or an user-defined type with overloaded assignment operator with non-standard semantics, and unless something is an uninitialized variable causing undefined behaviour on read), this is just a verbose way to write "if (something) ...", while "(if something == something)" would (under equivalent conditions) just be a complicated way to write "if (true) ..."

      --
      The Tao of math: The numbers you can count are not the real numbers.
  51. Does it compile? by Anonymous Coward · · Score: 0

    I wonder if the entire code-base complies... and if so, what comes out? Windows Vista, or some Linux/BSD merge?

  52. See also: Codase.com by kriegsman · · Score: 2, Informative

    See also Codase.com, another "Source Code Search Engine", which lets you search by method names, class names, variable names, free text, etc..

    -Mark

  53. interesting statistics by Ylleks · · Score: 0

    "I'm currently looking for suggestions on what sort of 'interesting statistics' I could create from 275+ million lines of open source C/C++ code."

    That one's easy. Just tell us how many bugs are hidden in the code, and give us a code/bug ratio.

  54. Koders.com by knipknap · · Score: 2, Informative

    Don't know, koders.com supports a lot more languages and also lets you narrow your search to specific licenses. The few extra lines of code just don't seem too do it, especially because such measures highly depend on the chosen method.

  55. grep++ by Doc+Ruby · · Score: 1

    I'm surprised that Perl's CPAN archive doesn't have structured searching at smaller granularity than module name or freeform metadata. Maybe once the archives let us find code by content, we'll get version control databases that store each line in a record, each block as references in a separate table, maybe even referential integrity of variables as foreign keys. I'd love my editor to pull code from DB storage, padding whitespace only in the presentation layer per my preferences.

    I'd really love to see datamining techniques for factoring, optimizing and profiling code. Not to mention the enforcement efficiencies for source license "due diligence" comparisons beyond grep. It's bizarre that programs are still so united with a hierarchical directory filesystem that scopes are enforced per-file, while class scopes have only lexical (not purely structural or referential) implementation. Relational math is rigorous enough that its direct combination with a compiler ought to produce even more revolutions than it would with an editor.

    --

    --
    make install -not war

  56. Markov Chains. by GuruBuckaroo · · Score: 1

    Run the whole shebang through a Markov Chain analyzer, then have it generate some new code. Hell, ought to work as well as anything else put out these days...

    --
    Poor means hoping the toothache goes away.
  57. Can it tell... by pulse2600 · · Score: 1

    ...How many libraries of Congress would all this code occupy?

  58. Interesting statistics by thisisauniqueid · · Score: 1

    You could calculate the percentage overlap between the 275 million lines of code and SCO's source code. For additional interest, you could plot that percentage as a function of time. You should see it go up right before every major new SCO filing.

  59. Re:Are you proud of 275 million lines of code? by Anonymous Coward · · Score: 0

    He said 275 million lines of searchable code... not the length of his search program. Maybe you should read the post instead...

  60. How about a potential buffer overflow index? by raddan · · Score: 4, Informative

    You can start by seeing how often people use gets(), strcpy(), strcat(), etc... Look for all the fun little common mistakes that people make.

    1. Re:How about a potential buffer overflow index? by Anonymous Coward · · Score: 0

      I use strcat all over the place. I know the length of the strings. No really, I do, it's a closed system.

  61. stats we'd like to see... by digitaldc · · Score: 4, Funny

    -# of non-numerical constants
    -# of ( ),{ },\ /,#,; characters in code
    -time spent debugging/compiling
    -total hours spent in production
    -gallons of coffee consumed
    -hours of daylight seen
    -# of relationships destroyed

    --
    He who knows best knows how little he knows. - Thomas Jefferson
    1. Re:stats we'd like to see... by dascandy · · Score: 1

      Non-numerical numerical constants:

      0xCAFE
      0xBABE
      0xDEAD
      0xC0DE
      0xBEEF
      0xFADE
      0xDEAF
      0xBEAD

  62. Code Styles by ionrock · · Score: 5, Interesting

    I would love to see if different code styles could be analyzed to see how many peopel use what sort of syntax style. There is camelCase and under_scores but it seems possible to find more complicated trends that might allow reviews to statistically determine what practices really help to make code better.

  63. A reality check by Monte · · Score: 1

    As an old Big Iron grognard asked me many years ago...

    "What prints your paycheck?"

  64. Recycling code by ZachPruckowski · · Score: 1

    How much of this open-source code DB is reusable? Are most of the lines things that have limited applications, or are most of them more general? I mean, if you have 275 million lines, but 175 million lines are code designed to solve one specific problem and can't be easily cross-applied, then it isn't as useful as the statement implies.

    That said, congrats on the milestone, and looking forward to hearing of more!

  65. Need to watch those stats by Quiet_Desperation · · Score: 2, Funny

    For example, "Lines of code" / "Lines of commenting" will always produce "Inf"

  66. Evolution data server and courier imap by llamalicious · · Score: 1

    I think the developers of eds are mad at courier

    Search: function names containing shit
    type: void
    name: courier_imap_is_a_piece_of_shit
    line: 17
    file: evolution-data-server-1.2.3/camel/providers/imap4/ camel-imap4-summary.c

    1. Re:Evolution data server and courier imap by kalislashdot · · Score: 1

      I love Courier, what else is there? UW? The maildir format is pretty awesome.

  67. Re:cout "why bother" by Vorondil28 · · Score: 1

    You forgot: "5) Ask CowboyNeal".
     
    :)

    --
    This sig rocks the casbah.
  68. histogram of C reserved words by jab · · Score: 5, Interesting

    I'd love to see how one of my programs (stats below) compares
    to the, uh, national average.

       1222 if
        638 return
        482 static
        413 for
        399 int
        217 const
        201 else
        194 void
        128 char
        115 case
        112 break
         55 default
         43 sizeof
         37 do
         35 switch
         27 enum
         24 struct
         23 while
         15 float
         14 typedef
         10 auto
          7 unsigned
          6 extern
          1 long

    1. Re:histogram of C reserved words by maxwell+demon · · Score: 1

      35 switch, but 55 default? Do you have switches with more than one default case, or did I miss another use of that keyword?

      --
      The Tao of math: The numbers you can count are not the real numbers.
    2. Re:histogram of C reserved words by AnalystX · · Score: 1

      The poster can answer this for certain, but I wonder if his histogram doesn't include reserved words found in comments. It seems to me that the word "default" would be found a lot in comments to describe the default value being assigned to a variable.

    3. Re:histogram of C reserved words by plabtfall · · Score: 5, Funny

      Yeah, me too:

          2431 int
          1802 goto

    4. Re:histogram of C reserved words by Anonymous Coward · · Score: 0

      It's odd that you have more 'do's than 'while's no? I would think that you would have at least as many 'while's as 'do's, and usually then some.

  69. was it /.ed by duke12aw · · Score: 1

    was the server /.ed or does he just need a new one?

    --
    As an american High School student, I'd like to officially apologize for my generation.
    1. Re:was it /.ed by Sembiance · · Score: 1

      Before the slashdot article I was getting about 4 or 5 visitors an hour.

      Since it's been slashdotted my server is maxxed serving 125 requests at a time, according to server-status about 10 requests/second.

      I imagine the traffic will die down in a few days, and settle into something more sane, hopefully something my poor little celeron server can handle :)

  70. I have to ask by Anonymous Coward · · Score: 0

    Why be an a**hole? The guy is wanting to offer a nice product, but can not afford the bandwidth hit of a /.. Now, you try to bypass his request (but you were wrong). I mean, why not instead, do a coral link or a google cache link like he asks? After all, he is providing useful code.

  71. or "// FIXME" by StandardDeviant · · Score: 4, Funny

    (subject says it all ;))

  72. Statistics to search for by Anonymous Coward · · Score: 0

    How about searching for functions that don't check their parameters for overflow?

  73. Finally! by Locke2005 · · Score: 1

    Now SCO will finally be able to find all the code that was stolen from them!

    --
    I've abandoned my search for truth; now I'm just looking for some useful delusions.
  74. Comments by Daedala · · Score: 1

    I'm dying to know... What percentage of the code is commentary?

    And are there any haiku?

    --
    What I say does not represent the views of my employers, my friends, my cats, or myself.
  75. Or similarities between different projects by Jamie+Lokier · · Score: 1

    Including those with incompatible licenses.

    Related: having found similar code sections, follow trends in them over time. Find where two programs copied the same code, but one has failed to implement what might be a bug fix or improvement in another, by looking at changes to the code over time.

  76. "Nobody will see this" by Short+Circuit · · Score: 1

    I'd like to see a comment search for "Nobody will see this".

    Unfortunately, the site's running so slow, I guess nobody will.

  77. The stat I want to see: by Samedi1971 · · Score: 1

    How many GOTOs are in there?

    I actually came across one recently. It was a real surprise considering the rest of the code was decently written. And it was pretty simple to remove.

    1. Re:The stat I want to see: by pclminion · · Score: 1
      I actually came across one recently. It was a real surprise considering the rest of the code was decently written.

      Perhaps this implies that the use of goto in that instance was justified. If somebody is skilled and produced quality code, maybe your FIRST choice should not be to second-guess them. Let me guess, you had to introduce a redundant test or extra variable to remove the goto? Is the resulting code REALLY any clearer than it previously was?

  78. Is there a good bubble sort in there somewhere? by jbx · · Score: 1

    ... because every time I profile my code, it seems I end up spending a lot of time in my bubble sorts. In all that code, surely someone took the time to write a really fast bubble sort, right?

    --
    (sig) The last bug isn't fixed until the last user is dead. (/sig)
  79. the known answer by __aaitqo8496 · · Score: 1

    select count(*) from sourcecode where comments > 0
    0 row(s) returned

    plagerism at its finest

    mod -1 lame

  80. Caching Mechanism by hgfischer · · Score: 1

    Implement a caching mechanism for the more used search results. This cache would be invalidated when you add more code.

    Show a few lines in the search results after and before the searched text.

    Is the search case-sensitive or not? Maybe just adding a option like this on the search results can be helpful (eg.: include names on Windose platform are insensitive).

    Implement statistics for:
      - most/less used function name
      - most used word in comments
      - most used dirty word

    Count the lines of "dense" code. I mean do not include empty lines and lines that only have comments or a just a opening/closing brace.

  81. don't complain about getting ./ed... by Anonymous Coward · · Score: 1, Insightful

    ... like this guy's site is right now, when YOU submitted the story about your site! If you're not prepared for slashdot traffic, don't submit the story.

  82. Don't mess around, learn from NLP folks by Xofer+D · · Score: 4, Insightful

    This is a good opportunity to build complex statistics about the C++ grammar actually used in context. Learn from the NLP people! Parse the whole thing, and start finding common subtrees in the grammar used. Look at common lexical entries between subtrees, so we can make a tool that can help recognize errors by comparing against commonly used C++ grammar fragments. Or do function completion based on what kind of function you look like you're writing. See if you can do alignment with similar languages and do statistical source translation. If you keep information about comments used (and maybe apply some real NLP), you might even have a shot at automatically classifying functions based on their form, and documenting them with simple comments.

    If that's too hard, try finding all n-grams instead, at least under some length. That's a lot more useful than just individual tokens or strings.

    With a lot of data, you can do very cool things. Don't mess around with string frequency counting. C++ is simple compared to English, do something interesting.

    --
    The Signal/Noise ratio can be improved in two ways. Remaining silent is the OTHER way.
    1. Re:Don't mess around, learn from NLP folks by Anonymous Coward · · Score: 0
      Yeah, and then sometime next year, the following will happen:
      #include <stdio.h>
      int main (int argc,
      Suddenly a dialog pops up. It's the paperclip.

      @: It looks like you're writing "Hello, world" program in the C language. Would you like to finish the program and compile it for you?
      Me: Sure!
      @: Tada. Hello, world!
      Me: Wow. That rocks. Can you do the halting problem too?
      @: Are you trying to make me go away? o_O
      Me: Ooops. You caught me...

    2. Re:Don't mess around, learn from NLP folks by justins · · Score: 1
      If that's too hard, try finding all n-grams [wikipedia.org] instead

      Tom Cruise can help!
      --
      Now before I get modded down, I be to remind whoever might read this that what I am saying is FACT. - bogaboga
  83. This rocks by Borg_5x8 · · Score: 1

    Less time wasted on google searching down the examples I need to check.. someone is my new hero.

  84. Find the most common :) by brys · · Score: 1

    Find most common functions so they can be moved to the kernel ;))))

  85. That's easy: search for known security holes by CodeShark · · Score: 1
    that permit things like buffer overflows, etc.

    Though I don't develop much in C++ currently, and haven't had the time to do anything Linux wise in years, I would love to have an identified location for security-bug free algorithms, etc. that I could use if I need to do more C++ work in the future.

    --
    ...Open Source isn't the only answer -- but it's almost always a better value than the alternatives...
  86. GPL by ramrom · · Score: 1

    The Code copied from here should be GPL ed. Damn the viral nature

  87. There is boost? by Cyberax · · Score: 1

    This index doesn't even contain Boost (http://www.boost.org/) and Loki libraries!

    It can't be called 'comprehensive' after that...

    1. Re:There is boost? by vawjr · · Score: 1

      more likely it's an indication of how few people actually know about boost (a recent topic of conversation on the boost EMail echos).

  88. How about by Anonymous Coward · · Score: 0

    number of lines that contain both "should" and "probably"

  89. penis by ToddFFW · · Score: 0

    only one reference to penis is 275 million lines of code??? whew thank god they didn't index my code.

  90. Percentage... by Anonymous Coward · · Score: 0

    ... of lines claimed by SCO.

  91. ...barely the lobby. by C10H14N2 · · Score: 1

    Consider, a page is 45 lines, an average book is 350 pages @ about 2" thick (ergo, about 15-16k books), a stack is roughly 12' wide by 6 shelves, double sided (864 books) and a row is about six stacks long (72' / 5,184 books). So, in a compactus, about 432sq/ft, to the 2,100,000sq/ft of the Madison building alone. The total linear capacity is 540 miles. Using the above assumptions, that's about 205 million books, so if printed, this repository would take up roughly 1/13,000th of the space. Imagine if your house is 2500sq/ft, the equivalent displacement would be a five-inch square. Would you even notice?

    Gawd, I'm bored.

  92. Cyclomatic complexity... by xquark · · Score: 1

    would be a nice feature to have, both average and per project/module basis.

    --
    Arash Partow's Philosophy: Be a person who knows what they don't know, and not a person who doesn't know.
  93. TODOs by mrshoe · · Score: 2, Interesting

    Counting the number of "TODO"s and "XXX"s in "production" open source code could be interesting.

    --
    There are two types of people in this world: those that categorize other people and those that don't.
  94. Statistical mistakes? by LukeWink · · Score: 1

    Maybe you could see how many times certain C faux pas exist. Things like the use of gets(), fflush(stdin), void main(), etc.

  95. Oooo great ideas by Sembiance · · Score: 1

    Thanks for all the comments, there are some great statistic ideas here.

    It will take a while to generate all the stats, potentially months.
    Once they are finished I'll post the results somewhere.

    In the mean time I hope some people find the site useful.
    I didn't do it to make money or anything, I just want to help out other coders :)

  96. Isn't Lucene written in Java? by samuel4242 · · Score: 1

    Can't the C/C++ folks write a decent indexing package? Or does Java really rule?

  97. Oh You Open Source Guys Are In For It Now! by Petersko · · Score: 1

    I'm gonna search for comments containing combinations of the words "Stolen" "From" and "SCO", and blackmail you all to keep the results quiet.

  98. Works with Firefox by everphilski · · Score: 1

    guess Firefox isn't standard compliant then (there goes my karma from the grandparent post :) )

    -everphilski-

  99. Predictive input statistics by Dracolytch · · Score: 1

    I would like to see some character frequency/pattern information so that we might be able to create baselines for predictive input tools while programming. This would be a good step forward for things such as programming by voice, or other alternative input tools such as dasher.

    ~D

    --
    This sig has been enciphered with a one-time pad. It could say almost anything.
  100. How about messiest code base? by oncebitten · · Score: 1

    just search for:
    #if 0
    XXX
    FIXME

  101. A tool for SCO by joshaidan · · Score: 1

    A useful tool could be a list all open source programs that contain the string: for(i = 0; i *; i++). Then we will know which programs violate SCO patents. Brian.

  102. Amazing by Donkey5555 · · Score: 1

    Wow, thats amazing! You must have upwards of 3 or 4 functions in that thing.

  103. Generate yet more code by DCFC · · Score: 1

    What you want is Markov chains. For any given statement you can easily construct the set of statmenets that follow it, together with their number. We will observe that given for There are a lot of branches to the tree, with (i =0; being very common and // Woo woo being quite rare. We can easily generate more code by picking statements at random, but in proportion to their observed frequency. But we can do better. Given pairs of statements, we can generate a table where given the pair of statements for( i=0; we know the probability of i != This because we're dealing with pairs from a large set, the branching will be quite low, ie it will be much more constrained, and thus a lot more like the original code. This is analagous to being able to say in English, given "Space, the" we mostly get "final" as the most probable next symbol, and now we have "the final", the next word wmay be|"frontier" but given that "Space" is not being thought about any more, we might have "cut". Text generated like this is quite like English, and if you include punctuation, can generate things that are as grammatically correct as many people's posting. It can be quite funny. I have used it to merge Terry Pratchett and Microsoft marketing blurb, and certainly the MS stuff improves... Same applies to C++. It will take a little experimentation to find out the best length for the chain, but assuming that the input code is syntactically correct, so the output will often compile. Quite what it will do is another question, but this sort of chain is rather like how people learn. If you listen to babies, they start off making random noises, then they make sounds that have very roughly the same frequency of ocurrence as their parents language, then they burble in things that sound like English, but clearly are not. Their "singing" at 18 month is usually quite free of real words, but they've heard "twinkle twinlke little star" so often that the chain of "twinnle twinnle lipple sarr" is carved into their neural net. Given that the spec here is for "useful" I propose this as an AI test.

    --
    Dominic Connor,Quant Headhunter
  104. Google desktop as backend by kalenj · · Score: 1

    Might be sweet to hook your source code into a google desktop index and then deliver the google desktop search results through your web interface. Leverage the power of their search speed and reliability. --Kalen

  105. That GeSHi guy is a bit of a dick. by Anonymous Coward · · Score: 0
    I can understand wanting to avoid a slashdotting, but he's a dick about it.

    Read this.
    http://exorsus.net/slashdot.txt
    • URLs on this server linked by slashdot.org will be refused. Permission is
      given to slashdot to mirror content as necessary for the purpose of
      providing its users access to the information on the site. Slashdot should
      not attempt to bypass the referer block. Use of the google cache page for
      the site is acceptable as long as the page(s) concerned have no more than 1
      image.

      This policy is employed for the sole purpose of avoiding a huge bandwidth
      bill that I would have to pay out of my own pocket. Anyone who would like
      this restriction to go away is more than welcome to send me bucketloads of
      cash.


    Fuck you buddy. Protect your own interests as you need to, but don't be a cocksmith about it.
    1. Re:That GeSHi guy is a bit of a dick. by Anonymous Coward · · Score: 0

      THe message was not set up by the "GeSHI guy". It was set up by the server administrator.

  106. To bad the site is down by Anonymous Coward · · Score: 0

    That Apache web server is just wonderful!

  107. HACK, TODO, BUG & FIXME by Pete+Brubaker · · Score: 2, Interesting

    I recently did a search on some of our codebase here at work to see how many times the above keywords remained in shipping code. I was a little surprised to see how many cases there were in our code. I think sometimes, maybe even most of the time we as programmers over use these words.

    Pete

    --
    What's a sig? Pete Brubaker
  108. how about... by Connie_Lingus · · Score: 1

    ...how many comments contain the letters JSB??

    I can still remember my 1000 level C course where an example of "poor commentting" was presented where the only comment was /* RIP jsb */

    --
    never bring a twinkie to a food fight.
  109. 10 auto by Khashishi · · Score: 1

    jab must be one of the 133t coders who knows what this qualifier does

    AFAIK, it means it isn't static, so it should be cleaned off the stack when the scope ends.

  110. Which Dirty Seven would that be? by Stavr0 · · Score: 1
    • fscanf()
    • gets()
    • scanf()
    • sprintf()
    • strcat()
    • strcpy()
    • vsprintf()

    ... oh... the other dirty seven.

  111. Stats by Twon · · Score: 1

    Number of gotos per project would probably be amusing.

  112. Proposed workaround doesn't work by Animats · · Score: 3, Informative
    Yes, that compiles and runs, but it doesn't do what you think it does. Put in some debug print to see what's actually happening, which is this:

    • "5,5" is evaluated using the built-in definition of ",", returning "5". The no-conversion built-in operator comma has higher priority than the conversion sequence involving a conversion to "location", then the use of the overloaded comma operator. So the built-in comma operator is used. See the discussion in the C++ ARM, section 13.2, "Argument matching": which says "consider an exact match better than any conversion".
    • "5" is converted to type "location" by the constructor for "location", resulting in a "location" object with "dimension=1" and "coordinates[0]=5".
    • This "location" object is passed to "operator[]", which then accesses "coordinates[1]", an uninitialized value, which it then uses as a subscript, returning a reference to a arbitrary memory location. So, instead of returning "&blah.matrix[5][5]", it returns "&blah.matrix[???][5]". The example program seems to run in VC++ only because that part of memory happens to be 0 at startup, so this returns "&blah.matrix[0][5]". In other circumstances, it might cause a crash.
    • "10" is stored into the wrong location of "blah",or outside it, due to the bad reference generated above.. This is where the buffer overflow occurs.

    You can force the conversion with

    blah[ location(5), 5] = 10;

    but that's not useful except to see what's happening.

    You can't overload the built-in operators for built-in types. So overloading, outside of an object, "operator,(int, int)" won't work either.

    Hence the need for a straightforward solution.

    1. Re:Proposed workaround doesn't work by torokun · · Score: 1


      This is where C++ gets fun. ;)

      Interesting comment. I think, though, that in real life you're not calling with static built-in types like '5'. You're calling with results of other operations or variables, so it doesn't really have to be a problem...

      You just disallow the types that don't work. Maybe you have to construct some objects that seem like a lot of overhead sometimes, but you can end up with a natural syntax...

  113. Project similarites by dagar · · Score: 1

    It would be interested to see what projects share same/similar chunks of code. This could be used to move similar code into libraries where things are redundant.

  114. Dead Dead Deadsky by Uosdwis · · Score: 1

    What are the conditional compiles? Are they being used or abused?

    #if GCC_1_8 or #if DEBUG vs #if 0
    #FOREVER for(;;) vs #INC (x) x++

    How much #define hell is there in codebases (ever see a VxWorks BSP?)
      - hardware specific defines in C verses base classes and inheritence in C++
      - #def that can be retouched at run time or used as constant without using const
      - how many #ifdefs #undefs with other included code #define again burried.
      - symbol replacement

    Or how about casting! how much was done implicitly or explicitly? And could it have been avoided.

  115. Re:useful statistic: parent: -1 troll by Baricom · · Score: 3, Funny

    That "woosh" sound you hear is the wink emoticon zooming over your head, joke in tow.

    I know PHP is a great web language and that it probably isn't the cause of the slowdown. Heck, even Yahoo! uses it these days.

    I was attempting (unsuccessfully, it seems) to make fun of the purists who insist that robust web applications must run on something compiled in order to reach acceptable performance under high load.

  116. Dangerous function calls? by generic · · Score: 1

    like strcpy, vprintf, strcat, scanf would be interesting. It would be a basic buffer overflow fuzzer.

    --
    Microsoft aggravates my tourettes syndrome.
  117. and auto? by YesIAmAScript · · Score: 1

    I know it's a legimate keyword. There's also absolutely no reason to use it. It's the default in the only place where it is even valid.

    It'd be like typing "unsigned long int" instead of "unsigned long".

    I call BS on this. No reasonable code uses "auto" nearly as many times as typedef.

    --
    http://lkml.org/lkml/2005/8/20/95
  118. Switches with fall through versus ever case sepera by Anonymous Coward · · Score: 0

    I, and I'm sure not the only one, tend to use switch statements specifically for the fall through, and a series of if-else-ifs when I don't need fall-through. I'd like to know how many times a switch statement contains fall through, versus how many times each case has a seperate break. The ratio of case statements to break statements would be interesting as well.

  119. AJAX? by RavenChild · · Score: 0

    Perhaps the Slashdotting of this site might be a good reason for the administrator to create an AJAX interface. That way the server would not have to process so many pages and focus on queries.

    1. Re:AJAX? by Sembiance · · Score: 1

      The site is AJAX :)

      It also uses XSLT to transform the received XML into the search results.

  120. 275 million lines of C+ -- bah! by gru3hunt3r · · Score: 1

    275 million lines of C .. so what is that roughly translated to?
    probably about 27,500,000,000 lines of quick basic?
    or roughly 10 lines of Perl.

  121. How about - by Anonymous Coward · · Score: 0

    The number of comments that include the string(s) "magic", "magically", "Then a miracle occurs...", "[You|We] keep using that word; I do not think it means what you think it means." or "This is not the code you are looking for, move along." - ?

  122. libtool by Wikipedia · · Score: 0
    You might be interested in this:
    http://www.advogato.org/article/85.html
    which links to the open-source metrics:
    http://orbiten.org/ofss/01.html
    which is dead but is still on the archive:
    http://orbiten.org/ofss/01.html">The link doesn't work!@!#@!@@!

    Here is the first table Table 1: Top 10 authors ranked by contribution of code Author % of total free software foundation, inc 11.231 sun microsystems, inc 1.848 the regents of the university of california 1.359 gordon matzigkeit 1.216 paul houle 1.042 thomas g. lane 0.782 the massachusetts institute of technology 0.762 ulrich drepper 0.559 lyle johnson 0.528 peter miller 0.525

    Table 1: Top 10 authors ranked by contribution of code Author % of total free software foundation, inc 11.231 sun microsystems, inc 1.848 the regents of the university of california 1.359 gordon matzigkeit 1.216 paul houle 1.042 thomas g. lane 0.782 the massachusetts institute of technology0.762 ulrich drepper 0.559 lyle johnson 0.528 peter miller 0.525 more...
    --
    P2P Anonymous Distributed Web Search: http://www.yacy.net/
  123. Re:histogram of C reserved words - well, B .... by ignavus · · Score: 2, Informative

    auto is a throwback to B days (the language immediately before C). B had no data types (no int, float, double, etc) but did have storage types: auto, static, and extrn.

    auto was necessary in B for local variables, as a plain variable name by itself was a valid expression statement (as it is in C), not a declaration (IIRC).

    1. foo() { auto bar; ... }
    2. foo() { static bar; ... }
    3. foo() { extrn bar; ... }
    4. foo() { bar; ... }

    All mean something different in B: the first three instances of bar are declarations, the fourth is an expression statement (and if I remember my B correctly, it is invalid as the first statement of foo(), because bar hasn't been declared one of auto, static, or extrn yet in this function).

    In C, auto is completely redundant. Except, perhaps, in comments.

    Ah, B. The days when programmers were programmers and data was data, and you could perform any operation you liked on any variable. Want to divide a pointer to a string by 3? Go ahead. Self-disciplined programmers don't need training wheels. Just a choice between auto, static and extrn.

    --
    I am anarch of all I survey.
  124. Group functions by usage by jerometremblay · · Score: 1
    What I would like is something like

    "people who used functionX also used functionY".

    It would bring to light what libraries are often used together.

    • Users of Library 1 might learn of the existence of Library 2.
    • If you notice a lot of clustering between different libraries, it might be a good idea to make a new library that combines the needed functionalities.
    • etc.


    Stats using bayesian filters like spam filters would be incredibly cool. Especially if the source code is somewhat parsed for what it means and not only used textually.

  125. Statistics for change in licenses.. by carlmenezes · · Score: 1

    how many times have the licenses changed?

    also, maybe stuff like code overlap between projects?

    --
    Find a job you like and you will never work a day in your life.
  126. GOTOs by srchestnut · · Score: 1

    1) Number of GOTO statements 2) Number of comments that match (nearly) exactly the code they explain ex: string name; //name 3) Phone Numbers

  127. correction - thanks by jab · · Score: 1

    Thanks for all the sanity checks! The very simple lex program I whipped
    up to extract reserved words was way too simple. First, a variable like
    "automobile" was causing a false positive for "auto". Second, I had
    only run on .c files, and not .h files which explains the lack of
    typedefs. Finally, while I remembered to strip the comments, I'd forgotten
    to take care of quotations thus getting false positives from things like
    char *foo = "By default run on auto pilot"; Fixing all this gives much
    saner results.

        950 if
        626 return
        482 static
        331 for
        272 const
        269 void
        213 else
        132 char
        113 case
        112 break
         89 typedef
         82 extern
         44 int
         43 sizeof
         41 enum
         39 struct
         35 switch
         31 default
         23 while
         11 unsigned
          5 float
          3 signed
          2 short
          1 long
          1 double
          1 do

  128. Wow... How's this for a comment by Anonymous Coward · · Score: 0

    // we like profanity in open source software, please read the following words carefully: // fuck, pussy, dick, sperm, motherfucker // // hope our source code will now be censored by all governments that suck.

  129. AAGHH! by Civil_Disobedient · · Score: 1

    # "if (cond) {" vs. "if (cond)\n{"

    I'm all for coding readability, but placing a function's open bracket on a new line is so fucking irritating and unnecessary. /pet peeve

    1. Re:AAGHH! by GlassHeart · · Score: 1
      Funny how geeks are adamant that nobody should tell them how to dress (or, in extreme cases, how to smell), yet be very irritated by an equally insignificant stylistic choice. Where the "{" is placed, in almost every usual case, is irrelevant to the readability of the code.

      I would suggest reserving your indignation at something that actually makes code less readable. Having pet peeves of this sort threatens to win the battle but lose the war.

    2. Re:AAGHH! by skink1100 · · Score: 1

      Wrong, sir, wrong!

      Putting the opening { on a newline makes it much easier to visually match code blocks, especially when nested a few layers deep. What's wrong with a little extra effort for readability? True, function is more important than form, but I get really sick of trying to make sense of people's crappy code.

      S

    3. Re:AAGHH! by Drawkcab · · Score: 1

      What does putting the open bracket on a new line do for matching code blocks that indenting doesn't? Personally I find the code more readable if people don't waste lines on open brackets, because that just makes it that much more likely that you'll have to scroll down to see the end bracket.

    4. Re:AAGHH! by cyclomedia · · Score: 1

      i'm the opposite, i just cant get my head around the practise of missing out the \n... I find it easier to match code blocks not just by indentation but also by matching the pairs of { and }, so if one is missing i find it hard to read.

      --
      If you don't risk failure you don't risk success.
  130. Codase is much better with 250M of C/C++/JAVA code by Anonymous Coward · · Score: 1, Informative

    http://www.codase.com/ a new search engine, seems to have better user interface and performance. It also has a smart query search system to deal with complex queries,
    quoted from their website:
    "For the first time, to find relevant code, developers can simply type into a search box about the same code as they do in their daily development work. The Codase smart query system processes the input and then builds an internal query to feed into the search engine. Through this free style format, complex combinations of multiple search terms can be easily entered. For example, to find any main method that contains variable t and function calls of thread.start() and println, this query can be used: main() { var t; thread.start(); println; }",

    http://www.codase.com/search/smart?join=main()+%7B var+t%3B+thread.start()%3B+println%3B+%7D&scope=jo in%2Fjoin&lang=*&project=

  131. Mining Software Repositories by MrClean · · Score: 1

    Great Work!!!

    FYI - there is a whole community of researchers that are interested in studying such large software repositories

    http://msr.uwaterloo.ca/

    (International Workshop on Mining Software Repositories)

    May be you can write something and submit it over there or at least advertise your data set to that community.

  132. Automatic program generation by mal0rd · · Score: 1

    This would become really useful if it could save people ever having to write anything programmed before. Say I want to factor a number. So I write a couple test cases:

    8 -> [2,2,2]
    9 -> [3,3]
    12 -> [4,3]

    and then I can use your database to find all the functions that will succesfully pass my test. If it got good it could even combine functions until it got something working. This would be the holy grail of IDE's - write unit tests, click search, polish up - done. The tricky part here is how to efficently search all those functions.

    The first step should be to allow searching by argument types, side effects and global access, and returns values. Then add the test cases.

    Hopefully someday.

    -- Devin Bayer

  133. Re:useful statistic: parent: -1 troll by Anonymous Coward · · Score: 0

    Yeah. Unless he uses PHP as the database engine, it has nothing to do with it.

    Probably Lucene's fault.

  134. compression by Anonymous Coward · · Score: 0

    What 500,000 line library would be the most beneficial to the corpus? Beneficial means the ability to reduce the complexity/size of the resulting corpus. You can think of this as a compression problem.

    for example, if:

            int a[MAX]
            sum = 0;
            for (i=0; iMAX; ++i)
                    sum += a[i]

    occurred in enough of the source, we could reduce this to:

            int a[MAX];
            sum = r0 (a, MAX);

    thus simplifying the code. As a follow on project, write a cron job to submit patches to all the authors of the code in question to use said library, and upload the library to sourceforge.

  135. Re:useful statistic: parent: -1 troll by lachlan76 · · Score: 1

    While I admit that PHP isn't the source of the slowdown, I'd hardly consider it the ideal web language. Too many problems with scoping, function naming, etc., etc.

    Or perhaps it's just my tastes. I personally prefer not to have to worry about using a variable which is in another code block.

  136. Does SCO know about this ? by Anonymous Coward · · Score: 0

    How many lines did IBM illegally contribute to Linux ;-)

  137. Nice but what about licensing ? by Anonymous Coward · · Score: 0

    I don't want to be an asshole but what about putting the license of the displayed code ?
    IMHO the actual display looks like this is public domain snippets

  138. Take a Look at CCCC by SwashbucklingCowboy · · Score: 1

    The C and C++ Code Counter, http://cccc.sourceforge.net/, has some interesting statistics that could be generated on a per project basis. Perhaps you could encorporate the stats from that project.