Slashdot Mirror


Google Code Search Reveals Dark Corners

saccade.com writes, "The new Google Code Search isn't just for hackers sniffing for passwords. Jason Kottke and friends have discovered the new feature reveals all sorts of dark corners hidden in our code. And you thought nobody ever read your comments!" From the article: "Code search is a great resource for web developers and programmers, but like the making available of all previously unsearched bodies of information, it's given lots of flashlights to people interested in exploring dark corners."

297 comments

  1. google seems to inspire... by Beuno · · Score: 5, Interesting

    Google seems to inspire this kind of behaviour for some reason. The have been lots of websites like krugle who search a big db of code, and these things didn't come up until google launched this.

    1. Re:google seems to inspire... by Kangburra · · Score: 5, Funny

      I think their success comes from the simple interface, that despite varied functions retains sufficient uniformity to facilitate usefulness.

      Jeez, I must have swallowed a dictionary!

      --
      Common sense is not so common
    2. Re:google seems to inspire... by glarbl_blarbl · · Score: 1
      to facilitate usefulness.
      ITYM "to facilitate facility." Ah, english...
      --
      I use friend/foe to signal strong [dis]agreement instead of mod points. What else are f/f good for?
    3. Re:google seems to inspire... by Khuffie · · Score: 1

      I think it has more to do with the fact that barely anyone has heard of Krugle before this (I know I haven't) as Google's announcement gets way more publicity. That, combined with the fact that this behaviour was probably present and done with things like Krugle, but nobody thought to blog about it because heck, it's cool if you're using Google, it's the internet's poster child, but what the hell's Krugle?

    4. Re:google seems to inspire... by Anonymous Coward · · Score: 0
  2. Dark corners? by c0d3h4x0r · · Score: 5, Interesting
    --
    Moderator hint: a comment is neither "Flamebait" nor "Troll" if it is true.
    1. Re:Dark corners? by PlusFiveTroll · · Score: 4, Interesting

      Not suprising, about half the responces on the first page were about how bad IE (Internet Explorer) fucks things up!

      " but IE6's implementation fucks up the..."
      " // check for function objects (as usual, IE is fucked up)"

    2. Re:Dark corners? by Anonymous Coward · · Score: 0

      linux-2.4.33.3/include/asm-sparc64/system.h

      who would have thunk?

    3. Re:Dark corners? by -Brodalco- · · Score: 2, Funny
      --
      I regret spilling a glass of ginger ale on an achritect!
    4. Re:Dark corners? by Anonymous Coward · · Score: 0

      i have to say, i'm surprised (and delighted) by the frequency fuck appears *outside* of comments. makes for memorable variable names, i guess?

    5. Re:Dark corners? by TheViffer · · Score: 4, Interesting

      Indeed, Indeed, Indeed

      Just better not SCO know about this ..

      --
      -- Knowing too much can get you killed, but knowing who knows too much can make you rich.
    6. Re:Dark corners? by dp_wiz · · Score: 0

      A whole play-field for MS lawyers...

    7. Re:Dark corners? by sacx13 · · Score: 1

      Probaby they don't indexed the linux Kernel sources until now. There is a real fiesta . Just grep in linux source code: egrep -ir "( fuck)|( shit)" * Regards

    8. Re:Dark corners? by maxwell+demon · · Score: 4, Funny

      Beware of evil code!

      --
      The Tao of math: The numbers you can count are not the real numbers.
    9. Re:Dark corners? by Arancaytar · · Score: 1

      Or WTFs.

    10. Re:Dark corners? by Ceribia · · Score: 1

      "They say sunshine is the best disinfectant."

      For the common cold maybe, not the plague.

      --
      It has yet to be proven that intelligence has any survival value. Arthur C. Clarke (1917 - )
    11. Re:Dark corners? by remmelt · · Score: 2, Funny

      long fuck = 99;

      // I'd say.

    12. Re:Dark corners? by Jaseoldboss · · Score: 1
    13. Re:Dark corners? by ekimminau · · Score: 1
      --
      Armaments, 2-9-21 And Saint Attila raised the hand grenade up on high, saying, 'O Lord, bless this Thy hand grenade' N
    14. Re:Dark corners? by Anonymous Coward · · Score: 0

      Bleach works well, however.

      Side effects may include becoming dead.

      And people don't get real happy when you zero their work drive without warning them.

    15. Re:Dark corners? by inKubus · · Score: 2, Funny
      --
      Cool! Amazing Toys.
    16. Re: Dark corners? by Anonymous Coward · · Score: 0

      You used the phrase "more eyeballs" past its "use by" date. Please report to 6236S 6030W for reeducation.

    17. Re:Dark corners? by snuf23 · · Score: 1

      1337: def evil(self,user,anon=0):

      Good always loses because evil is 1337!

      --
      Sometimes my arms bend back.
  3. Dark corners? by FlyByPC · · Score: 4, Insightful

    "it's given lots of flashlights to people interested in exploring dark corners."

    They say sunshine is the best disinfectant. More eyeballs can fix problems as well as exploit them.

    --
    Paleotechnologist and connoisseur of pretty shiny things.
  4. Ahhhh... by dangitman · · Score: 2, Funny

    So that's where I left that rant about the inherent inferiority of asian people, and my treatise on how someday the aardvaarks will be the dominant form of life on earth (after they eat the asians).

    --
    ... and then they built the supercollider.
    1. Re:Ahhhh... by Anonymous Coward · · Score: 0

      I love how Asian people always seem to be the punchline in a lot of white jokes... it's as if "Asian" or adds some extra sort of humour. If the joke isn't funny without using "Asian", then it's racist.

    2. Re:Ahhhh... by WilliamSChips · · Score: 1

      Except that this joke is still not funny.

      --
      Please, for the good of Humanity, vote Obama.
  5. And the Ever Popular... by gambit3 · · Score: 5, Funny
    1. Re:And the Ever Popular... by Werkhaus · · Score: 5, Funny

      Whilst we're on the subject of /. memes...

    2. Re:And the Ever Popular... by Sinryc · · Score: 1

      And even Linux Sucks!

      --
      Yay, I have a sig.
    3. Re:And the Ever Popular... by 8ball629 · · Score: 1

      Synonymous to IE Sucks.

    4. Re:And the Ever Popular... by Anonymous Coward · · Score: 0
    5. Re:And the Ever Popular... by jkleid · · Score: 1

      Counts for various search strings:

      "Windows sucks": about 50 results
      "Linux sucks": about 50 results
      "Macs suck": about 20 results (some of these may be "emacs sucks" however)
      "bloody microsoft" 4 results
      "bloody Linux" 2 results
      "emacs sucks": 18 results
      "vi sucks" - did not match any documents

      Clearly Google Code Search is a highly objective source of information for winning (or losing) a variety of arguments.

    6. Re:And the Ever Popular... by MrWhitefolkz · · Score: 1

      Along the lines of "python sucks", there are 0 results for "ruby sucks"...
      And there are 0 hits for "rails sucks"...
      And plenty of results for "php sucks", "perl sucks", "c sucks", "c++ sucks"...
      Take it for what its worth, I don't even code. Just was curious.

    7. Re:And the Ever Popular... by nEoN+nOoDlE · · Score: 1

      from your link
      Windows Sucks. Unix Sucks. C Sucks.

      There's a guy who really hates his job.

      --
      Don't trust a bull's horn, a doberman's tooth, a runaway horse or me.
    8. Re:And the Ever Popular... by mcrbids · · Score: 1

      Don't forget the counterpart:

      Linux Sucks.

      Funny - they both return the same approximate number of results...

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
    9. Re:And the Ever Popular... by pchan- · · Score: 4, Interesting
    10. Re:And the Ever Popular... by Bueller_007 · · Score: 1

      Well, a quick search for "Linux sucks" reveals *exactly* the same number of hits as "Windows sucks".

      Unfortunately for Microsoft, it has also been discovered that their documentation "blows goats":
      http://google.com/codesearch?hl=en&lr=&q=%22blows+ goats%22&btnG=Search

      Apparently, so does some guy named Tim.

    11. Re:And the Ever Popular... by Jaruzel · · Score: 1

      Searched this comment thread... it seems no one had done a 'slashdot sucks'....

      So I did...

      http://google.com/codesearch?hl=en&lr=&q=%22slashd ot+sucks%22&btnG=Search

      -Jar.

      --
      Together, We Can Make Slashdot Better. I Do NOT Mod ACs. - Check Me Out
    12. Re:And the Ever Popular... by Opportunist · · Score: 3, Funny

      Not to forget Black Magic, Deep Magic and the ever popular Dead Chicken waving.

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    13. Re:And the Ever Popular... by hclyff · · Score: 1
      That code was probably wrote by BSD people...

      Interestingly enough, BSD sucks, and OpenBSD and FreeBSD both suck (says the people from the other BSD camp, of course).

    14. Re:And the Ever Popular... by student4ever · · Score: 1

      Very Very interestingly http://google.com/codesearch?hl=en&lr=&q=%22Linux+ sucks%22 - Both Windows and Linux gets the same number of matches around fifty!

    15. Re:And the Ever Popular... by Crayon+Kid · · Score: 1

      I cannot believe you'd forget goatse.cx.

      --
      i ate crayons when i was a kid and now i have two braincells and the blue ones taste nicer
    16. Re:And the Ever Popular... by Morphine007 · · Score: 1

      And I really love this one: i=i++

      hmm... apparently one of them is gtk ... it's all making sense now.

    17. Re:And the Ever Popular... by Anonymous Coward · · Score: 0

      Fuck Python, seems to give lots of relavant results. However Fuck Ruby, seems have more 'generic' fucking going on.

    18. Re:And the Ever Popular... by Anonymous Coward · · Score: 0

      Replace "windows sucks" with "linux sucks" "l4 sucks" or "unix sucks" "osx sucks" "irix sucks" "os/2 sucks" "dos sucks"...

      OTOH try "hurd sucks" and "mach sucks"

    19. Re:And the Ever Popular... by Anonymous Coward · · Score: 0
    20. Re:And the Ever Popular... by ehud42 · · Score: 1

      And I really love this one: i=i++

      *POP*

      Ow. My brain blew a fuse on that one. Please no wierd / dumb code before my morning coffee....

      --
      I'm in my right mind and I have the answer to everything!
    21. Re:And the Ever Popular... by neiljt · · Score: 1

      And I really love this one: i=i++

      The weirdest thing about this is that (arguably as a side-effect) it does what was (presumably) intended. Though I wouldn't care to comment on i=++i

    22. Re:And the Ever Popular... by CortoMaltese · · Score: 1

      Let's not forget that this should never happen.

    23. Re:And the Ever Popular... by Abcd1234 · · Score: 1

      This one always tickles me: &array[0].

    24. Re:And the Ever Popular... by Anonymous Coward · · Score: 0
      And I really love this one: i=i++


      Then you'll love this even more:

      pmessage(messages[i++], recipients[j], groups[j]);
      for (zz=0;zz<4000;zz++) {int i=i++;};

      According to Google, from bronco.final/tools/mess.c (how appropriate) at http://www.cs.cmu.edu/afs/cs.cmu.edu/usr/jch/netre k/code/bronco.final.tar.gz
    25. Re:And the Ever Popular... by Speare · · Score: 1

      No, it is undefined. Some compilers might do the post-increment at the end of the RHS before the assignment, and some compilers might do the post-increment at the end of the whole expression, after the assignment. An assignment as a whole is an expression, but some compilers may choose not to see it that way in the typical case for one reason or another.

      --
      [ .sig file not found ]
    26. Re:And the Ever Popular... by Anonymous Coward · · Score: 0
      This one always tickles me: &array[0].


      But that's the best way to use a std::vector as smart array.

    27. Re:And the Ever Popular... by ByteSlicer · · Score: 1

      Actually I sometimes use &array[0], even though I'm fully aware that it's the same as array.
      The reason is usually symmetry, i.e. when using other indexes of that array in the same line, or nearby in similar context. It's all about code readability, which makes it easier to find bugs and maintain the code.

    28. Re:And the Ever Popular... by neiljt · · Score: 1

      I do believe you are correct, sir. my_c=rusty++.

    29. Re:And the Ever Popular... by SnarfQuest · · Score: 1

      Other fun things to try

      "void main"

      "i=i--"

      "j=j++"

      "int main(char"

      "don't do this at home"

      --
      Who would win this election: Andrew Weiner vs Andrew Weiner's weiner.
    30. Re:And the Ever Popular... by Anonymous Coward · · Score: 0
    31. Re:And the Ever Popular... by jZnat · · Score: 1

      Or better yet, &\w+\[0\][^\[]

      --
      'Yes, firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
    32. Re:And the Ever Popular... by Opportunist · · Score: 1

      Do I look like I care?

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    33. Re:And the Ever Popular... by Schwarzchild · · Score: 1

      My favorite, so far, is "why this works". You see a lot of interesting pieces of code where someone doesn't know why something works. Even rms (Richard Stallman) has a comment in some header file where he makes that remark.

      --

      "sweet dreams are made of this..."

    34. Re:And the Ever Popular... by lgw · · Score: 1
      How is it undefined?
      i = i++
      The value of the RHS is the original value of i. The complier increments i, but returns it's original value. That original value is then assigned to i. Simple operator precedence rules forbid the compiler writer from waiting to increment i until after the assignment (although, of course, compiler bugs in corner cases are rampant). This expression is always either a bug or deliberate obfuscation.

      Speaking of compiler writers who don't bother to read the spec, it really annoys me that there are compilers that still choke on
      class foo
      {
        static const int buffSize = 256;
        char buff[buffSize];
      };
      Even Microsoft finally fixed this one. Get with it guys!
      --
      Socialism: a lie told by totalitarians and believed by fools.
    35. Re:And the Ever Popular... by rilian4 · · Score: 1

      I've seen a half-dozen or so times where I get a windows dialog box w/ text that says "You should not see this" or something similar. Always made me wonder...

      --

      ...quicker, easier, more seductive the darkside is...but more powerful, it is not.
    36. Re:And the Ever Popular... by lgw · · Score: 1

      Exactly! It's simply assumed by all that VI sucks, so why would you ever note it in a comment?

      --
      Socialism: a lie told by totalitarians and believed by fools.
    37. Re:And the Ever Popular... by HTH+NE1 · · Score: 1

      Expect it more in proprietary code where the compiler to use is strictly controlled, thereby ensuring a consistent result while also providing headaches for anyone who tries to steal the code and run it in a compiler that produces a different result.

      But then implementing the ideas in Reflections on Trusting Trust would be more effective, and wouldn't show up in a Google Code Search unless you knew specifically what to look for. (And if an employee has access to modify the company's compiler, that employee can hardcode job security for life.)

      --
      Oh, say does that Star-Spangled Banner entwine / The myrtle of Venus with Bacchus's vine?
    38. Re:And the Ever Popular... by Jehosephat2k · · Score: 1
    39. Re:And the Ever Popular... by RyuuzakiTetsuya · · Score: 1

      Chuck Norris.

      The first result is awesomely great.

      --
      Non impediti ratione cogitationus.
    40. Re:And the Ever Popular... by noidentity · · Score: 1

      That i=i++ search tops the incorrect memset usage one! Many layers to this one that make it funny... since the result is undefined, i could be left with any value. Actual implementations would likely either leave i with the same value or its value + 1.

    41. Re:And the Ever Popular... by andersbergh · · Score: 1
    42. Re:And the Ever Popular... by EvanED · · Score: 1
      How is it undefined?

      I shall quote the C++ standard, because that's what I have.

      Between the previous and next sequence point a scalar object shall have its stored value modified at most once by the evaluation of an expression.


      (ISO 14882:2003, clause 5.4)

      The above code prescribes two modifications; one from the ++ and one from the assignment.

      i = v[i++]; // the behavior is unspecified


      Here you would also think that the behavior should be specified completely: i++ has to be evaluated before the array index can be taken which has to be loaded before it can be stored in i, but this isn't necessarily the case.

      There are sequence points at function entry and exit, which don't apply here, and at the end of each statement.

      I'm pretty sure that my reading is right (if you (regular) Google this expression you'll get a number of hits saying it's undefined, including a couple on the C faq (in particular, 3.3), but I'm not exactly an expert, so if you can cite sources that say more than "well, it should be this way because if you think about it..." I'm open to being proved wrong.
    43. Re:And the Ever Popular... by lgw · · Score: 1

      Yep, the notes up front (took me a while to figure out what you meant by 5.4) are clear, despite being a load of crap. I was right only for overloaded operators, as they're really functions, so overloading '=' changes this behavior - what fun!

      --
      Socialism: a lie told by totalitarians and believed by fools.
    44. Re:And the Ever Popular... by Trayal · · Score: 0
  6. Old-school by FlyByPC · · Score: 4, Interesting

    Zork nostalgia, anyone?

    --
    Paleotechnologist and connoisseur of pretty shiny things.
    1. Re:Old-school by scarolan · · Score: 1

      More props to Zork:

      http://www.google.com/codesearch?q=xyzzy
      http://www.google.com/codesearch?q=%22hello+sailor %22

      And what's up with all the red-background links, anyway?

    2. Re:Old-school by AEton · · Score: 1

      Why have Zork when you can have Adventure?

      --
      We recently had heard in the office over one of the Yellow Machine that's made by Anthology Solutions.
    3. Re:Old-school by zotz · · Score: 1

      "Zork nostalgia, anyone?"

      That's just gruesome!

      all the best,

      drew
      http://www.nanowrimo.org/modules/newbb/viewtopic.p hp?topic_id=4146&forum=171&post_id=61131#forumpost 61131
      Come on over to NaNoWriMo and write and copyleft a novel in 30 days.

      --
      FreeMusicPush If you want to see more Free Music made, listen to Free
    4. Re:Old-school by maxwell+demon · · Score: 1

      Don't forget the question of all questions!

      --
      The Tao of math: The numbers you can count are not the real numbers.
  7. The corner files. by Anonymous Coward · · Score: 0

    "but like the making available of all previously unsearched bodies of information, it's given lots of flashlights to people interested in exploring dark corners."

    Mulder would have liked Google.

  8. Bloody Microsoft by RyatNrrd · · Score: 5, Funny
    1. Re:Bloody Microsoft by gardyloo · · Score: 1

      Only ten pages if you wimp out early :)

    2. Re:Bloody Microsoft by Neoncow · · Score: 1

      It's actually 37 pages if you keep clicking till the end ;)

    3. Re:Bloody Microsoft by paxmaniac · · Score: 1

      Unfortunately "Bloody Microsoft" is dwarfed by "Bloody Linux" by a whole order of magnitude. I like the third hit, personally.

    4. Re:Bloody Microsoft by Morphine007 · · Score: 1

      Actually I got 46000 hits for bloody linux and 400 for bloody microsoft.... Mind you, coders are very bitter people when functions don't work the way they think they should, and you'd expect to see more linux code online... still quite the difference though.

    5. Re:Bloody Microsoft by Jesterboy · · Score: 1

      Silly Morphine007... Everybody already knows Europeans don't like Microsoft!

    6. Re:Bloody Microsoft by LurkerXD · · Score: 1

      In a similar vein, "I hate Microsoft" returns 50 results, "Evil Empire" returns a solid 100.

  9. Ahh frustrated programmers by kypper · · Score: 2, Interesting
    1. Re:Ahh frustrated programmers by Scroatzilla · · Score: 1
  10. Fucks. by Anonymous Coward · · Score: 5, Interesting
    1. Re:Fucks. by utway · · Score: 1

      The #f*ck per source file for the C language is 0.003141593, the digits remind me of Pi.

    2. Re:Fucks. by hawkinspeter · · Score: 1
      --
      You're a temporary arrangement of matter sliding towards oblivion in a cold, uncaring universe
  11. This should never happen... by EvanED · · Score: 5, Funny

    This is a fairly amusing one.

    I like the memset search on that page too... scary. People need to run Lint or something. (Will Lint pick up that error?)

    1. Re:This should never happen... by TapeCutter · · Score: 2, Funny

      A different response to the impossible.

      And a few religious constatnts to ignite a flame war.

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
  12. Because someone had to by Broken+scope · · Score: 1
    --
    You mad
    1. Re:Because someone had to by Anonymous Coward · · Score: 0

      You could have atleast searched for porn.

      14000 > 200

  13. In Soviet Russia... by FlyByPC · · Score: 0, Redundant

    ...code searches *you*!

    --
    Paleotechnologist and connoisseur of pretty shiny things.
    1. Re:In Soviet Russia... by Opportunist · · Score: 1

      Happens in capitalist America too, so where's the joke?

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    2. Re:In Soviet Russia... by Some_Llama · · Score: 1

      I believe the link is what makes this tired joke work. It gives examples, using google code search, for the russian joke inserted into code by programmers...

      Man their right, when you explain a joke it drains all teh funny.

  14. I had to do it... by kypper · · Score: 3, Funny
    1. Re:I had to do it... by Enoxice · · Score: 1
      --
      Anyone else think the comments just weren't rendering right before they turned off ABP and saw ads?
    2. Re:I had to do it... by Anonymous Coward · · Score: 0

      It's better to search for the second part of the sentence, "are belong to us" gives funnier results. ;-)
      http://www.google.com/codesearch?q=%22are+belong+t o+us%22&btnG=Search+Code

  15. My favorite programmer qoute... by __aaclcg7560 · · Score: 1

    "I don't know what the problem was. But whatever it was, it's now fixed."

    1. Re:My favorite programmer qoute... by jfengel · · Score: 1

      That was me.

      Today.

  16. For the record by achurch · · Score: 4, Funny

    I was not drunk when I wrote this; that's just some immature coder making fun of me.

    Granted, being drunk is about the only valid excuse I could make for only initializing half of a doubly-linked list node . . .

    1. Re:For the record by BeeBeard · · Score: 2, Interesting

      Hehe...I read that and I was like "Who in the heck is Andy Church?" and "I've got to treat this guy to a pint!" You rock, Mr. Church.

    2. Re:For the record by Jedi+Alec · · Score: 1

      Is it a bad sign that I saw the code and didn't even need to look at the filename to recognize it? Still using the stable branch, but props for all the good(and in some cases, not so good) work :-)

      --

      People replying to my sig annoy me. That's why I change it all the time.
    3. Re:For the record by Anonymous Coward · · Score: 0

      In reading the article i was shocked to see my own code was mentoned under 'drunkard coding'.
      At some point i added this comment to my code. I of course have no recollection of this.
      "I am drunk and coding like I am the greatest coder of all time."

      I dont consider myself an acholic. but it would be nice if i was the greatest coder of all time.

      I'm so glad they didn't find some of the other comments i left in the code.

    4. Re:For the record by Goaway · · Score: 1

      This line is an instant classic, just so you know.

    5. Re:For the record by AndroSyn · · Score: 1

      As somebody else who codes an ircd, you're not alone in your drunken coding. I think its the only way one can willingly code ircd :P

  17. Do no evil. by c0d3r · · Score: 1

    Its my assesment that shining light on dark corners fits into the category of their "do no evil" motto.

  18. Wow. Just wow. by CaffeineAddict2001 · · Score: 1

    +"FIXME" +"sql injection"

    If you know it's a problem, why don't you fix it before you publish???

    1. Re:Wow. Just wow. by adamruck · · Score: 1

      That is very scarey and sad all at the same time.

      --
      Selling software wont make you money, selling a service will.
    2. Re:Wow. Just wow. by vindimy · · Score: 1

      if they knew how to fix it (or had time) they definitely would. at least give them thanks for pointing out an error.

    3. Re:Wow. Just wow. by Opportunist · · Score: 2, Interesting

      This is not sad, it's scary!

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    4. Re:Wow. Just wow. by badzilla · · Score: 1

      You can just believe they had a PHB telling them it had to go live NOW or else. What would you do.

      --
      "Don't belong. Never join. Think for yourself. Peace." V.Stone, Microsoft Corporation
    5. Re:Wow. Just wow. by ZorbaTHut · · Score: 1

      Not necessarily. My code is littered with TODOs and FIXMEs - things that should technically be changed, either for speed, cleanness, or correctness's sake. However, the first two aren't likely to break a program, and the latter I always put traps around so if the "incorrect" cases are tickled the program shuts down cleanly.

      Often, it turns out that the "incorrect" cases simply never get touched.

      Programmers, it turns out, have a limited amount of time available, and have to prioritize and decide what fixes are most important. Making perfect 100% bulletproof beautiful code is rarely worth the time unless you're getting paid by the hour and your employer has nothing better for you to do.

      --
      Breaking Into the Industry - A development log about starting a game studio.
  19. LOL by Anonymous Coward · · Score: 0

    http://google.com/codesearch?hl=en&lr=&q=bill+gate s&btnG=Search BILL GATES

    "This is a Bill Gates so use with discretion."

    "BOOL is tri-state according to Bill Gates."

    "/* Ask Bill Gates what this is all about. */"

  20. Your signature that very much is a signature by Anonymous Coward · · Score: 0

    About your signature: Your signature is very much a signature, whearas a painting of a pipe is very much not a pipe. If you had typed it by hand each post, that would be the spirit of the painting, but I do believe it is a signature, as when I reply I do not see it.

    1. Re:Your signature that very much is a signature by Anonymous Coward · · Score: 0

      About your lack of signature: Your lack of signature is very much a complete lack of signature, whearas a painting of a pipe is very much not a pipe. If you had typed it by hand each post, that would be the spirit of the painting, but I do believe it is a lack of signature, as when I reply I do not see it.

    2. Re:Your signature that very much is a signature by 4D6963 · · Score: 3, Informative

      You incult clod, if the GP said it it was because the GGP's sig is a reference to a painting of an apple that says "Ceci n'est pas une pomme" ("This is not an apple") because it's not an apple but really a painting. The GP was pointing that the GGP's sig was actually a signature although it claimed not to be one, and thus that it didn't fit the spirit of the painting it was refering to, and that it would have been more like the spirit of it if instead of having it to be an actual sig, it was something he pasted at the end of every of his posts to make it look like a sig. It would look like a sig, but it wouldn't be one.

      --
      You just got troll'd!
    3. Re:Your signature that very much is a signature by Speare · · Score: 2, Insightful

      I think you mean Magritte's "The Treason of Images" which has a label reading "Ceci n'est pas une pipe" under a picture of a tobacco pipe. Not sure where the apple came from...

      --
      [ .sig file not found ]
    4. Re:Your signature that very much is a signature by GTMoogle · · Score: 1
    5. Re:Your signature that very much is a signature by cecille · · Score: 1

      Not sure where the apple came from...

      Probably from Magritte's son of man painting, I'm guessing.

      http://en.wikipedia.org/wiki/Image:Magritte_TheSon OfMan.jpg

      --
      ...no two people are not on fire.
    6. Re:Your signature that very much is a signature by Poohsticks · · Score: 1
      --
      "The story so far: In the beginning the Universe was created. This has made a lot of people very angry and has been wide
    7. Re:Your signature that very much is a signature by 4D6963 · · Score: 1

      Ceci n'est pas une pomme. Worst is that you got modded up lol.

      --
      You just got troll'd!
  21. No fun! by Greyfox · · Score: 2, Interesting
    The vast majority of code along with wonderful comments is hidden behind corporate firewalls where the google search engine will never get at it. Which is probably just as well as I've no doubt that potential future employers would be searching that code if it were available and reading my sardonic comments about the drug habits of prior programmers, speculation as to the number of box tops they had to send in to obtain their degrees and gripes about how co-workers clearly did not read my warning about not changing function interfaces unless they really knew what they were doing, and they clearly did not know what they were doing as evidenced by the fact that they passed record counters as ints in one place and then used those ints as pointers in another place (And no, this was not some form of genius on their part, either.) Also: Run-on sentences.

    Instead potential employers (like me) can google your code and read those comments that you wrote in there. Don't worry though... I won't hold those against you.

    Anyway, "unless you really know what you're doing" and "smoking cracK" are also fun searchesa over there...

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    1. Re:No fun! by remembertomorrow · · Score: 1

      +1 duh

      --
      Registered Linux user #421033
    2. Re:No fun! by TheViffer · · Score: 1

      Duh

      --
      -- Knowing too much can get you killed, but knowing who knows too much can make you rich.
    3. Re:No fun! by nasch · · Score: 1
      Also: Run-on sentences.
      Sentence fragments. Damn good device. Used more later.
  22. The Bool Sheet by c0d3r · · Score: 1

    I recall a professor in college saying "George Bool put all of his theory on one page and they used to call it the bool sheet".

    1. Re:The Bool Sheet by Anonymous Coward · · Score: 0

      It sounds so much naughtier when you spell George Boole's name as a 4-letter word.

    2. Re:The Bool Sheet by Anonymous Coward · · Score: 0

      Is that really TRUE... or FALSE?

    3. Re:The Bool Sheet by VGPowerlord · · Score: 1

      Or FILENOTFOUND?

      If I could find the original post on TheDailyWTF about that one, I'd link to it.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
  23. Suicidal code... by chillieburger · · Score: 4, Funny
    1. Re:Suicidal code... by kypper · · Score: 1

      Won't somebody please think of the children?!?

  24. Suprised... by MoriaOrc · · Score: 1

    I didn't see these two in the article, or a quick check of the comments so far (as clearly they are the two most useful tools in a programmers arsenal):
    Magic and more magic

  25. It's not surprising that PHP is the leader. by Anonymous Coward · · Score: 0

    It's not suprising that PHP is the leader in that category.

    Of all the PHP developers I've met or known of, I can break them down into two groups. One is the talented developer who is stuck using PHP because some idiot manager told him or her to. This sort of a person would likely use the word "fuck" to describe the horrors they encounter daily while using PHP.

    The second type is the immature, know-it-all 13-year-old brat who read a PHP tutorial online, and now thinks he's a professional programmer. People like them lack the professionalism, and think it's "cool" to pepper their code with obscenities.

    1. Re:It's not surprising that PHP is the leader. by jpardey · · Score: 1

      Or, it could just be that there are a lot of cross platform web pages written in PHP, and every browser has its own "fuck"ing way of doing things, most of which mean a lot of time peicing together a kludge. PHP is nearly used only for websites, whearas Python and Perl are used for many other things. Javascript is client side, so there would not be a lot of comments, let alone comments with obscenities.

      --
      I have freaks! I did something right...
    2. Re:It's not surprising that PHP is the leader. by Anonymous Coward · · Score: 0

      Trollll----ing... good programmers always write "fuck." If I haven't written "fuck" once per fifty lines of code, I must not be enjoying myself!

      Yeesh. Go write your own slick localized open source content-driven language. Make sure you can knock off a fully functional program in ten seconds, too. And don't just say Perl.

    3. Re:It's not surprising that PHP is the leader. by Andrew+Kismet · · Score: 2, Insightful

      That and PHP is used for a lot of bulletin boards, forums, etc - the majority of those "fuck" counts would be on swearlist fliters hardcoded in.

    4. Re:It's not surprising that PHP is the leader. by jpardey · · Score: 1

      Yeah, true, there seem to be a lot of word lists, and that probably is the majority. Seems odd that they wouldn't be kept in a plaintext or database though.

      However, have you seen the comments complaining about how broken IE is?

      --
      I have freaks! I did something right...
    5. Re:It's not surprising that PHP is the leader. by Anonymous Coward · · Score: 0

      Go write your own slick localized open source content-driven language. Make sure you can knock off a fully functional program in ten seconds, too. And don't just say Perl.

      Why would I have to write my own, when the Python and Ruby developers have already done it for me?

    6. Re:It's not surprising that PHP is the leader. by Andrew+Kismet · · Score: 1

      How could I NOT see them? It's no wonder PHP hits the top so quickly with wordlists and anti-IE rants in the same place.
      Also, there's a tendancy to do silly things like put said wordlists in a .php document, or to pre-organize them into an array so that another PHP script can just include it directly.

  26. What code? by bendodge · · Score: 0

    Where exactly does all this code come from? Will this be much more useful than regular search, as most good code on the net is easy to find? Will this just shine a flashlight on junk?

    --
    The government can't save you.
  27. A subroutine worse than death! by SanityInAnarchy · · Score: 1
    --
    Don't thank God, thank a doctor!
    1. Re:A subroutine worse than death! by Morphine007 · · Score: 1

      No one should ever have to see this.

      ROFL!!!

      Not sure why... but I think that guy was a little frustrated ;-)

  28. Favorite by springbox · · Score: 4, Interesting

    This is my favorite from the article: The phrase "should be big enough" should never be seen alongside statically allocated arrays.

    1. Re:Favorite by dm97062 · · Score: 0
    2. Re:Favorite by Tony+Hoyle · · Score: 1

      Or dynamically allocated ones... it's either big enough or it isn't. If you're not sure then make sure your validation guarantees it.

  29. Southpark by flyingfsck · · Score: 1
    --
    Excuse me, but please get off my Pennisetum Clandestinum, eh!
  30. security holes by Anonymous Coward · · Score: 0

    I was surprised to see that 'security hole' brought up a neat collection of ... errr.. security holes.

  31. Kittens by sankyuu · · Score: 1

    Imagine if your boss found out what you think of kittens!

  32. X-files by flyingfsck · · Score: 1
    --
    Excuse me, but please get off my Pennisetum Clandestinum, eh!
  33. I wonder.. by technos · · Score: 4, Funny

    How long before SCO files a third amended counterbrief to IBM's second interrogary motion for relief claiming new evidence of infringement after one of their marketing boys tries 'Linux Santa Cruz Operation' after reading about Google Code in the WSJ?

    --
    .sig: Now legally binding!
  34. NDA search terms by Anonymous Coward · · Score: 0

    Fun search terms to use are "Non Disclosure Agreement"

    Good times, good times.

  35. Muslim coders swear less by flyingfsck · · Score: 1
    --
    Excuse me, but please get off my Pennisetum Clandestinum, eh!
  36. What dark corners? by 3seas · · Score: 1

    With all the flashlights I don't see any dark corners no more.

    But this won't help so much with bugs, as bugs usually show up in the running of code.

  37. Slightly off-topic by joe_cot · · Score: 1

    Search results coming out a bit strange. for example:
    \W((java)|(python)|(php)|(C(\+\+)?)|(asp)|(javascr ipt))\ ((sucks)|(stinks))\W 30,800 results
    \W((java)|(python)|(php)|(C(\+\+)?)|(asp)|(javascr ipt)|(asm))\ ((sucks)|(stinks))\W 50 results
    In other words, either they're cutting off their reg-exs for some reason (based on length, time for computation, etc), or my regular expressions are getting a bit rusty, or their reg-ex engine needs a bit of work -- I sorta want them to put the Code Search code on Code Search, just so I can do the Buffer search and see if it comes up.

  38. You are not expected... by slushdork · · Score: 4, Interesting
    My favorite: You are not expected to understand this

    See here for an explanation (from the horse's mouth, as it were...)

  39. How come I don't see this one? by bornyesterday · · Score: 1

    Dark corners? Of course, we can find them too

  40. Dark very dark by goldgriff · · Score: 1

    Luke ...

  41. IE vs. Firefox by RandomPrecision · · Score: 1

    Your search - "firefox sucks" - did not match any documents.
    Did you mean to search for "IE sucks"?

    Seriously though -
    Search: "IE sucks"
    Results 1 - 10 of about 30,200.
    Search: "firefox sucks"
    Your search - "firefox sucks" - did not match any documents.

    1. Re:IE vs. Firefox by zero_offset · · Score: 1

      Hardly a comparison, but "mozilla sucks" is good for six hits, and "gecko sucks" is good for two more. However, it can be proven that these results are not definitive: "html sucks" only turns up 50 hits, and there is absolutely no question that HTML sucks.

      --

      Slashdot quality declines as the number of hot grits posts decreases. - Provolt's Law, Apr-09-2005

  42. multiline mode by zobier · · Score: 1

    Would someone please let me know if they find out how to trigger multiline mode regex in Google Code Search. Ta.

    --
    Me lost me cookie at the disco.
  43. Whew! by rk · · Score: 1

    I thought there'd be a quiz later:

    you are not expected to understand this.
    1. Re:Whew! by maxwell+demon · · Score: 1

      That's called job security.

      --
      The Tao of math: The numbers you can count are not the real numbers.
  44. E-mails by shodai · · Score: 1

    At first, crawlers/bots/etc would search for plaintext emails, now that they can easily search mass quantities of code, wouldn't this make it easier for crawlers to find emails hidden in code also? I have little to no idea what i'm talking about, but this is a bad thing, right?

  45. Re:Slashdot lore? by Tablizer · · Score: 1

    You forgot goatse. Lots of goatse.

  46. ??? Profit! by slavelayer · · Score: 5, Funny

    1. Read Slashdot
    2. Search Google Code
    3. ???
    4. Profit!

    1. Re:??? Profit! by maxwell+demon · · Score: 1
      --
      The Tao of math: The numbers you can count are not the real numbers.
    2. Re:??? Profit! by IorDMUX · · Score: 1
      --
      >> Standing on head makes smile of frown, but rest of face also upside down.
    3. Re:??? Profit! by maxwell+demon · · Score: 1

      Now if I could find out how to make a successfull dypedef, I could profit as well! :-)

      --
      The Tao of math: The numbers you can count are not the real numbers.
  47. How come when I search for Linux source code... by The_Abortionist · · Score: 1, Funny

    Google shows me SCO source?

    --
    Linux violates 235 Microsoft patents.
  48. = instead of == by bleppie · · Score: 1

    Couple of bugs in there, one in mozilla/security...
    lang:c ^\s*if\s*\([^=\(\)]*\s=\s[^=\(\)]*\)

  49. Arrrgh! by Kuukai · · Score: 1

    My favorite group is programs that contain "Arrrgh!".

    The "lameness filter" totally ruined this post...

    --
    Sendou Wave Kick!!
  50. Watch your language please by Voice+of+Meson · · Score: 1

    bad_words = ['asshat', 'asshead', 'asshole', 'cunt', 'fuck', 'gook', 'nigger', 'shit'] # all in lower case .......

    raise ValidationError, ngettext("Watch your mouth! The word %s is not allowed here.",
            "Watch your mouth! The words %s are not allowed here.", plural) % \

    Ha! Assheads

    --
    Dammit! I had a good one.
  51. It's right... by laejoh · · Score: 0

    You can find a lot of dark corner's.

  52. Couldn't resist it!! by Rockgod · · Score: 1
    --
    A witty signature proves nothing
    1. Re:Couldn't resist it!! by Faylone · · Score: 1

      Your search - omg ponies/ - did not match any documents.
      Were you trying for this? Remember to use preview to check links!

    2. Re:Couldn't resist it!! by Rockgod · · Score: 1

      Sorry!! Actually I wanted to show this!! and btw I found out there are programmers who di hate Bill Gates

      --
      A witty signature proves nothing
    3. Re:Couldn't resist it!! by maxwell+demon · · Score: 1

      African or European?
      Of course with Google you can also find the Holy Grail!

      --
      The Tao of math: The numbers you can count are not the real numbers.
  53. You have been warned... by saccade.com · · Score: 1
    ...about 10,000 times..

    Interesting to note the Slashdot editor didn't run with my original headline: "Google Code Search Reveals the Evil of all Source"

  54. Don't forget this one. by Anonymous Coward · · Score: 0

    http://google.com/codesearch?q=%22solaris+sucks%22 &btnG=Search+Code

    ...although I can't find 'Fucking McNealy...'

  55. goto by ricardo_nz · · Score: 1

    goto Results 1 - 10 of about 939,000 ... not as bas as expected.

  56. memset( pointer, size, 0 ) - NO! by noidentity · · Score: 2, Interesting

    I have to say, the search for incorrect use of C's memset really cracked me up. One instance after another of code which doesn't do a thing!

    1. Re:memset( pointer, size, 0 ) - NO! by Anonymous Coward · · Score: 0

      I don't get it.

    2. Re:memset( pointer, size, 0 ) - NO! by maxwell+demon · · Score: 1

      MEMSET(3)                  Linux Programmer's Manual                 MEMSET(3)

      NAME
             memset - fill memory with a constant byte

      SYNOPSIS
             #include <string.h>

             void *memset(void *s, int c, size_t n);

      DESCRIPTION
             The  memset()  function  fills  the  first  n  bytes of the memory area
             pointed to by s with the constant byte c.

      RETURN VALUE
             The memset() function returns a pointer to the memory area s.

      CONFORMING TO
             SVID 3, 4.3BSD, ISO 9899

      SEE ALSO
             bzero(3), swab(3), wmemset(3)

      GNU                               1993-04-11                         MEMSET(3)

      --
      The Tao of math: The numbers you can count are not the real numbers.
  57. And you thought nobody ever read your comments! by Anonymous Coward · · Score: 0

    That was exactly what Microsoft developers thought.
    Remember when their stolen code surfaced? It was laced with "fuck", "shit", and other swear words.

    1. Re:And you thought nobody ever read your comments! by zero_offset · · Score: 2, Funny

      Horrors! Notify the Pope!

      --

      Slashdot quality declines as the number of hot grits posts decreases. - Provolt's Law, Apr-09-2005

    2. Re:And you thought nobody ever read your comments! by Anonymous Coward · · Score: 0
  58. malloc(strlen(\w\)); by tore · · Score: 2, Interesting

    These could be of special interest malloc(strlen(\w+));
    and these new char[strlen(\w+)];

    1. Re:malloc(strlen(\w\)); by Tony+Hoyle · · Score: 1

      The linux-atm and mozilla calendar ones are clearly wrong, some are actually correct.

  59. Do the Needful... by Anonymous Coward · · Score: 0
    1. Re:Do the Needful... by zero_offset · · Score: 1

      Ah yes, India's contribution to the English language. *sigh*

      --

      Slashdot quality declines as the number of hot grits posts decreases. - Provolt's Law, Apr-09-2005

  60. Regular expression search by whereiswaldo · · Score: 1

    I sure like the regular expression search! Too bad you can't search the whole WWW using regex's.
    I wonder how (or if) they guard against very cpu-hungry regular expression strings?

    1. Re:Regular expression search by Ant+P. · · Score: 1

      It probably just returns what it found after a certain amount of time. That'd also explain why you can get 10 pages of results some times, but keep clicking forward and it seems to quadruple.

  61. Let the holy wars begin: by XNormal · · Score: 2, Informative

    "python sucks": Results 1 - 10 of about 20. (0.02 seconds)

    "perl sucks": Results 1 - 10 of about 32,900. (0.01 seconds)

    --
    Stop worrying about the risks of nuclear power and start worrying about the risks of not using nuclear power.
    1. Re:Let the holy wars begin: by Aim+Here · · Score: 1

      "Windows sucks" Results 1 - 10 of about 103,000
      "Linux sucks" Results 1 - 10 of about 20
      "Unix sucks" Results 1 - 10 of about 70,900
      "Solaris sucks" Results 1 - 10 of about 81,400.

  62. It was hard to write... by s7uar7 · · Score: 2, Funny

    ...it should be hard to understand.

  63. Historic Peeps by HeroreV · · Score: 1

    It appears that several programmers like history. But not everyone loves Ben Franklin.
    http://google.com/codesearch?hl=en&lr=&q=%22ben+fr anklin%22&btnG=Search

  64. get yourself sued. by Anonymous Coward · · Score: 0

    search: "Copyright (c) 2006 Microsoft Corporation"

  65. My favourite... by MickDownUnder · · Score: 1

    audiofile-0.2.6/test/testaupv.c - 10 identical
    45: long fuck = 99;

    Awwww yea..... makes me want to go off and write some code right now.

  66. Goto isn't necessary evil (at least in C) by rbarreira · · Score: 2, Insightful

    Goto in C isn't necessarily evil... I've used it quite a lot of times to break from nested loops (like a "break", but a double/triple/... break, which doesn't exist in C but exists in Java for example).

    --

    The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    1. Re:Goto isn't necessary evil (at least in C) by The+Doyen · · Score: 1

      One way to break out of nested loops is with a boolean. I find I have to spend less time justifying the following than using a goto- to myself and others.

      bool bBreak = false;
      for(;;) {
            for(;;) {
                  for(;;) {
                        bBreak = true;
                  }
                  if(bBreak)
                        break;
            }
            if(bBreak)
                  break;
      }

      --
      Comedy is Tragedy that happens to others.
    2. Re:Goto isn't necessary evil (at least in C) by Anonymous Coward · · Score: 0

      On the other hand, using "for(;;)" is just shameful. Come on, at least use "while(1)" if you're going to do something like that.

    3. Re:Goto isn't necessary evil (at least in C) by Tony+Hoyle · · Score: 1

      eeeewww!!!

      I'm going to have to wash my eyes out after seeing that...

    4. Re:Goto isn't necessary evil (at least in C) by rbarreira · · Score: 1

      Arrgh, the usual answer... I have to say that I hate that solution, for two reasons:

      1) It's inefficient (an unnecessary variable and some additional instructions, versus a simple jump)
      2) It actually makes it harder to read and maintain the code

      Those reasons were probably also why Java's creators extended the break statement to allow it to break out of nested loops...

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
  67. Confirmed: Python is dead !!!1! by smurfsurf · · Score: 1

    There you have the proof. No one uses Python :-)

    1. Re:Confirmed: Python is dead !!!1! by TapeCutter · · Score: 1



      Heh, this is fun...

      "Python rocks" - 6 results, (one refering to "monty").

      "Pearl rocks" - 0 results.

      "love python" - 50 results, (some may refer to male anatomy)

      "love pearl" - 0 results, (no false positives that refer to female anatomy)

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    2. Re:Confirmed: Python is dead !!!1! by Daytona955i · · Score: 1

      While it still doesn't do better than python, it still helps if you spell perl correctly...
      "perl rocks" - 4 Results
      "love perl" - 50 Results

      Personally I do prefer python but I think perl still has a place. (Of course I'm still learning python, perhaps one day I will completely replace perl with python)

    3. Re:Confirmed: Python is dead !!!1! by TapeCutter · · Score: 1

      Doh!!!

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    4. Re:Confirmed: Python is dead !!!1! by Jesus_666 · · Score: 1

      Following the established love/rocks/sucks method of calculating which language gets the most praise...

      "love PHP" - 50 results
      "PHP rocks" - 8 results
      "PHP sucks" - 20 results

      Let's compare:
      50 + 6 - 20 = 36 net positive statements about Python
      50 + 4 - 32900 = -32846 net positive statements about Perl
      50 + 8 - 20 = 38 net positive statements about PHP

      The result is obvious: Nobody on Slashdot gives a damn about Ruby.

      --
      USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
  68. Is that chart trying to tell me something? by VValdo · · Score: 1

    There's something especially gratifying about this graph flipping us all the bird.

    W

    --
    -------------------
    This is my SIG. There are many like it, but this one is mine.
  69. gets() by Kistaro · · Score: 1

    Gentlemen (and women- both of you), I present to you: gets(). Much of it is in test code. Much of it is not. I cringe in horror.

    --
    Human? What makes y'all think I'm a human?
    1. Re:gets() by Anonymous Coward · · Score: 0

      Now *that* is horror: http://www.google.com/codesearch?hl=en&lr=&q=%5Cs% 2Bprintf%5C(%5B%5E%22.%2C%5D%2B%5C)&btnG=Search
      So we have "concept", who will write "proof"?

    2. Re:gets() by Tony+Hoyle · · Score: 1

      And the top one is in mysql.

      Nice wide open buffer overrun error there...

  70. "this is a hack" by cyclomedia · · Score: 1
    --
    If you don't risk failure you don't risk success.
  71. i'll say by the_last_rites · · Score: 1

    long fuck = 99;

    --
    Select SigText from Signatures where Len(SigText) > 120 Order By Len(SigText) desc
  72. search for "Oh Wait" by Anonymous Coward · · Score: 0

    hizzzlarious

  73. Interesting... by Anonymous Coward · · Score: 0

    Search for "you moron" and Google won't let you past page 2! It's like something in the 2nd page of the result set is screwing up the generated HTML.

    1. Re:Interesting... by zero_offset · · Score: 1

      That's odd, but I've seen "regular" Google searches get the page count dramatically wrong.
      Maybe code, for some reason, really throws off the estimate. Assuming it's an estimate.

      I can get to page 3, FWIW.

      --

      Slashdot quality declines as the number of hot grits posts decreases. - Provolt's Law, Apr-09-2005

  74. And quite a bit of Zork fans... by NeuroManson · · Score: 1

    http://www.google.com/codesearch?hl=en&lr=&q=%2B%2 2by+a+grue%22

    My favorite is:
        866: // You are surrounded by conditional-compilation code, all alike. // You are likely to be eaten by a Grue...
                        [Test]

    --
    Just because you can mod me down, doesn't mean you're right. Shoes for industry!
  75. Easter eggs! by Anonymous Coward · · Score: 0

    Be here

  76. explain memset bug? by teridon · · Score: 1

    Could someone explain why that memset code (setting last argument to 0) is a bug?

    --
    I hold it, that a little rebellion, now and then, is a good thing. -- Thomas Jefferson
    1. Re:explain memset bug? by Anonymous Coward · · Score: 0

      Yes, I was wondering the same thing. The useless blog calls it a "programming error", but I don't know why it is. No wonder people get their backs up over code, nobody actually offers constructive help - just criticism.

    2. Re:explain memset bug? by teridon · · Score: 1

      It was too early for me to be looking at man pages before, but now that I'm awake...

              memset (destination , datatocopy, numbytes);

      The last argument should be the number of bytes to copy from datatocopy into the destination. If numbytes == 0, then copy all bytes from datatocopy. i.e. if sizeof(datatocopy) is > sizeof(destination), you have an overflow which might be exploited.

      --
      I hold it, that a little rebellion, now and then, is a good thing. -- Thomas Jefferson
    3. Re:explain memset bug? by Anonymous Coward · · Score: 0
      If numbytes == 0, then copy all bytes from datatocopy.
      Where did that come from? (It's certainly not on my manpage.) Datatocopy is an int, of which the lowest 8 bits are used to fill numbytes of memory starting at the address destination.

      That search looked for examples of code that ran memset with numbytes == 0, which does nothing. Most of these examples are people wanting to zero out a structure/array, but writing "memset(mystruct, sizeof(mystruct), 0)" instead of "memset(mystruct, 0, sizeof(mystruct))", and hence not achieving anything.

    4. Re:explain memset bug? by CortoMaltese · · Score: 1
      You're mixing memset() and memcpy().

      memset(s, c, n) places character c into first n characters of s, and the programming error referred to is about mixing c and n with each other. The original search looks for n == 0, because it makes no sense, and is thus an indication of this mixup.

    5. Re:explain memset bug? by multipartmixed · · Score: 1

      Not only that, but a lot of those searches are cases where juvenile programmers want to empty-out a string. I guess they REALLY want to get it empty or something, I see this "error" a lot -- programmers who use

      memset(arr, 0, sizeof(arr))

      when

      *arr = 0

      would do.

      Clearly, this is only true when arr is treated as an ASCIZ string.

      --

      Do daemons dream of electric sleep()?
    6. Re:explain memset bug? by EvanED · · Score: 1
      The first AC in reply to teridon is correct.

      memset signature looks like this: memset(void *s, int c, size_t n). The semantics are that it copies the lower byte of c into all of the first n bytes starting at s. This is used to initialize structures (e.g. memset(&s, 0, sizeof(s)) ) and to zero out sensitive buffers after they're used (e.g. memset(password, 0, BUFLEN)).

      The problem with the code pointed to is that the last two parameters are swapped. memset(_, _, 0) is essentially a noop, and one that could lead to bugs, crashes, or security vulnerabilities.

      And to answer my own question, no warnings are generated by this bug:
      1. n01 ~/temp: cat memsetwarn.c
      #include <string.h>
       
      int main()
      {
              char b[255];
              void * l = memset(b, 2550, 0); //255);
              return l==0;
      }
      2. n01 ~/temp: gcc -W -Wall memsetwarn.c
      3. n01 ~/temp: lint memsetwarn.c
      4. n01 ~/temp: cc memsetwarn.c
      5. n01 ~/temp: which cc
      /opt/SUNWspro/bin/cc
      6. n01 ~/temp:
  77. Could be interesting... by zero_offset · · Score: 1

    debug only

    Although I imagine it was already posted in the earlier code search password discussion...

    --

    Slashdot quality declines as the number of hot grits posts decreases. - Provolt's Law, Apr-09-2005

  78. Philosophy by Anonymous Coward · · Score: 0
  79. *snicker* by Crayon+Kid · · Score: 1
    long fuck = 99;
    --
    i ate crayons when i was a kid and now i have two braincells and the blue ones taste nicer
  80. from the gold chains dept. by Anonymous Coward · · Score: 0
  81. Code cleaning. by suntac · · Score: 1

    Looking at some of the results that google code is returning I cannot understand how it is possible that some companies place internal code online. I am in favor of Open Source so I think companies should share more code but before you do so you might want to check some things. Like bulls*t comments from coders, passwords, private internal addresses etc etc..

    Those kinds of things should be sifted out of the code before making it available to the public. Looking at these results it looks like a lot of companies do not have a good policy for these kinds of things.

    Regards,
    Johan Louwers.

    --
    Regards, Johan Louwers.
    1. Re:Code cleaning. by Tony+Hoyle · · Score: 1

      Why? Most people don't care. Programmers are creative people and will write all sorts of colourful remarks. There's no language there that you won't hear walking down the street.

  82. \s+arghhh by Zaiff+Urgulbunger · · Score: 1

    \s+arghhh predictably appears in a lot of comments, but suprisingly is also a large number of variables/classes/identifier-of-some-kind!

  83. IDE Profanity Filtering by blueZhift · · Score: 1

    Heh! And we all thought nobody would ever see those snide comments we left in the code. Perhaps the next version of Visual Studio will include a profanity filter. Is there an Eclipse plugin for this? Sounds like a fun afternoon project!

  84. I actually use that comment... by StressGuy · · Score: 1

    I mean, I'm not a coder, I'm an engineer who can program somewhat. Thing is, I might have a construct that should be all-inclusive but I'll still put in a catch like that just in case something sneaks by that I didn't consider.

    Yes, I know, exception handlers...but it is possible to go overboard with those. If I can manage it, I like to see all my causes and effects accounted for.

    {which might just give me away as not being a professional programmer}

    --
    A goal is a dream with a deadline
  85. Re:That damn blogger revealed all sorts of bad *** by SirTalon42 · · Score: 1

    All the holes already existed, and were searchable using other code search engines. This blogger didn't magically create them.

  86. some confused programmers out there.. by uzusan · · Score: 1
    --
    Te audire no possum. Musa sapientum fixa est in aure.
  87. Alright, fess up. by farker+haiku · · Score: 1

    Which one of you all is Andy Church? And why does Andy Church drunk return 1000 results?

    --
    Your sig(k) has been stolen. There is a puff of smoke!
  88. Anyone want to fix some Y2K issues? by Anonymous Coward · · Score: 0

    I was hoping that this search would return no hits, but I wasn't surprised by how many people concatenate '19' with the value from tm_year. Hey, it's only 19106!

  89. shouldn't that be by Anonymous Coward · · Score: 0

    malloc(strlen + 1)?

  90. Exposed back doors? Not quite... by LionKimbro · · Score: 1
    So, their backdoor example shows:



                    261: this mean your backdoor password is "hxdef-rulez", backdoor will copy system
                    shell file (usually cmd.exe) to "hxdefá$.exe" to temp. Name of shared memory
                    will be "_.-=[Hacker Defender]=-._". Name of a service is "HackerDefender100",

    ...but then you actually look at the thing, and it's part of an example.



    Example:
    [Settings]
    Password=hxdef-rulez
    BackdoorShell=hxdefá$.exe
    FileMappingName=_.-=[Hacker Defender]=-._



    And then there's another, and I look it up, and it turns out to be a response to a reverse engineering challenge. It makes sense that they include the password of the computer that they're intentionally compromising, in the program.

    Another resolves the backdoor password to "BACK_DOOR_PASSWORD," which, searching the rest of the code for, has no definition. It's likely defined with a compile-time macro definition.

    There was one or two I saw where I think concern is legitimate, but it was by no means as impressive as the first impression leaves.
  91. coconuts by FoxDude0486 · · Score: 1

    Sorry had to... Read the first result: http://www.google.com/codesearch?q=coconuts

  92. Google Code Search Fun by uarch · · Score: 1

    For a couple minutes of code-search fun try searching some of your favorite TLAs & explitives. For example, search for "wtf" and feel the pain of a few devs.

  93. This could affect future job applicants by dptalia · · Score: 2, Insightful

    Just think - currently most large employers google an employee as well as checking the major social networking sites, to determine if there's something about the person they don't want. Now an employer could use google code search to measure an applicant's code writing ability/discression.

    --
    Genius is one percent inspiration and 99 percent perspiration, which is why engineers sometimes smell really bad.
  94. Code reuse by Marvin01 · · Score: 1

    Its good to see that those software engineering classes are paying off

  95. 141 000 Discordian programmers by Ceriel+Nosforit · · Score: 1
    --
    All rites reversed 2010
  96. sizeof(char) by CortoMaltese · · Score: 1

    And in the "know your language" category: sizeof(char).

    1. Re:sizeof(char) by orangesquid · · Score: 1

      On some very exotic platforms, sizeof(char) != 1. Not every machine is byte-addressed...

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
    2. Re:sizeof(char) by maxwell+demon · · Score: 1
      --
      The Tao of math: The numbers you can count are not the real numbers.
    3. Re:sizeof(char) by lgw · · Score: 1

      By definition, at least in C and C++, sizeof(char)==1. It just part of the spec: char represents the unit of addressability of memory, not an octet. Heck there were a lot of minicomputers with 9-bit chars, back in the day, which is why octal notation is so ingrained into C. Of course, not every compiler follows the spec, sadly enough.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    4. Re:sizeof(char) by orangesquid · · Score: 1

      Yes, standard c++ and standard C define a byte as the minimum addressable unit and sizeof(char)==1, but there are some non-standard compilers, especially on exotic platforms.
      Example: the CPU in an HP48 addresses 4-bit nibble, not bytes. The operating system handles pointers to nibbles, but a char needs at least 8 bits, so a pseudo-C compiler for that platform might have sizeof(char) ==2, and a special nibble type where sizeof(nibble) ==1. It's non-standard, but not everything out there is standard...

      --
      --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
    5. Re:sizeof(char) by lgw · · Score: 1

      I've speant the past couple of years fighting issues with code that has to compile across 7 compilers -- non-standard compilers are a pain in the ass. The C++ standard is quite clear that "sizeof(char), sizeof(signed
      char) and sizeof(unsigned char) are 1." It's a common mistake (including among compiler writers, apparantly) to assume that a char has anything to do with a byte. There's no idea of a "byte" in the standard. The whole idea of "char" is that it's the minimum addressable chunk of memory. Actual characters haven't fit in a char for most localizations for many years.

      In your example, the only right thing to do is to have sizeof(char)==1 and require multiple chars per displayed character - just like any other C++ faced with unicode, except your case would be easier as there won't be nibble-ordering issues. :)

      The minimum addressable size on a Cray (at least the old ones) is 128 bits, so sizeof(char)==sizeof(short)==sizeof(int)==1, which I suppose would simplify things a bit. And I'll be a happy man if I never see another idiot who assumes that sizeof(int) == sizeof(void*)!

      --
      Socialism: a lie told by totalitarians and believed by fools.
    6. Re:sizeof(char) by lgw · · Score: 1

      Bah, in addition to screwing up the formatting of that post, I was wrong about a byte: the C++ standard does define a byte in the model clause, and says that every byte must have its own address. However, a byte is not an octet, it's the size of a char. Interestingly, there's no requirement that a byte or char be exactly one memory address wide - it could be two or more, just not less than one.

      --
      Socialism: a lie told by totalitarians and believed by fools.
  97. My favorite so far.... by shaneh0 · · Score: 1

    My favorite query so far is "piece of shit"

    Lotsa Gems. Like this one from the first page of results: ;; #### this is a horrible piece of shit function that should ;; not exist. In FSF 19.30 this function has gotten three times ;; as long and has tons and tons of dumb shit checking ;; special-display-buffer-names and such crap. I absolutely ;; refuse to insert that Ebolification here. I wanted to delete ;; this function entirely but Mly bitched.

  98. My Favorite Comment by donnacha · · Score: 1

    I found my favorite comment in the source for ReiserFS:

    "I'm going to kill that BITCH!!

  99. and still by lixlpixel · · Score: 1
    i was pleasantly surprised that even if you don't specify anything regarding the use of your code, some people still reference the original source....

    http://www.google.com/codesearch?hl=en&lr=&q=phpar adise&btnG=Search

  100. Now what can we say by warrior_s · · Score: 1
  101. Re:That damn blogger revealed all sorts of bad *** by maxwell+demon · · Score: 1
    --
    The Tao of math: The numbers you can count are not the real numbers.
  102. Mod Parent Up by mad.frog · · Score: 1

    (Repeating for benefit of the excellent comment posting as AC)

    This one always tickles me: &array[0].

    But that's the best way to use a std::vector as smart array.

    1. Re:Mod Parent Up by Anonymous Coward · · Score: 0
      Nothing in the definition of C++ std::vector guarantees that the vector elements are held in contiguous memory sections (although every standard library I've seen does it that way). I generally test this by doing something like
      if (size_t(endpts.end() - endpts.begin()) != endpts.size()) {
      cout << "endpts are not contiguous" << endl;
      }
  103. MOD PARENT FUNNY by inKubus · · Score: 1

    Because... if you can't laugh, you can't live. Or Something

    --
    Cool! Amazing Toys.
  104. One more by bilgebag · · Score: 1
  105. Re:And the Ever Popular... PHP Sucks by alexfromspace · · Score: 1

    PHP Sucks

    http://google.com/codesearch?hl=en&lr=&q=%22php+su cks%22&btnG=Search

    Freaking fix the freaking array freaking implementation in the sucking PHP. Implement the freaking offset array and speed up my freaking apps 80%. I dont want to buy a freaking 16-way MIPS server because PHP crawls slower than a freaking turtle.

  106. Perhaps we can find Nina Reiser with this? by Anonymous Coward · · Score: 0

    Hey, it had to be said.

  107. And, of course, Slashdot favorites... by Jehosephat2k · · Score: 1
  108. Interesting translation by Jehosephat2k · · Score: 1

    Unfuckingbelievable for the German "Unglaublich" :)

  109. Anyone remember this... by Jehosephat2k · · Score: 1
    Hungarian notation!.

    Interesting comment:

    /* * Note: I *HATE* hungarian notation, it has to be the most idiotic thing * I've ever seen. So, you will note it is avoided other than in the function * declarations. "Gee, let's make our code totally hard to read and they'll * beg for GUI tools" * Bah! */

  110. More code secrets by Ken_g6 · · Score: 1

    I could write a book with this! The title? Secrets of Programming!

    --
    (T>t && O(n)--) == sqrt(666)
  111. My Boss by aquatone282 · · Score: 1
    --
    What?
  112. Debug Ponies? by nova_ostrich · · Score: 1

    I like how a bunch of those are just debug statements to see if that code is even run. I feel so bland just using "test".

    --
    It's scary being a Flash and Flex developer on Slashdot. You guys are unnaturally rabid.
  113. Dark corners! by Jesus_666 · · Score: 1
    --
    USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
  114. Did you know? by snuf23 · · Score: 1

    In French the word "pipe" is slang for blowjob.

    --
    Sometimes my arms bend back.
  115. Self assesment by eggsome · · Score: 1
    --
    If they made a movie of your life, would anybody buy a ticket?
  116. Re:What THE MAN doesn't want you to see. disallow\ by Anonymous Coward · · Score: 0

    At least you didn't whine like a little bitch again about being modded to hell.

    Maybe your account wouldn't be permanently fucked up from assholes modding you as a troll, if you'd stop trolling.

  117. merobase.com by codesmart · · Score: 1

    Oh you can also search on merobase.com and find lots of code and dark corners :-)