Slashdot Mirror


Google Unveils Code Search

derek_farn writes, "Google now has a page that supports source code searching. I hope they extend it to be more programming-language aware (e.g., search for identifiers and functions) like the specialist code search sites (Krugle, Koders, and Codease), who probably now have very worried investors. I don't see any option to search for Cobol. I guess there is not a lot of Cobol source available on the Internet, even although there is supposed to be more Cobol source in existence than any other language (perhaps that statement is not true in the noughties)." From the Cnet.com article: "Google engineers, many of whom participate in open-source projects, already use these code searching capabilities internally. Since it is a Google Labs project, the company is not yet seeking to monetize searches through ads."

212 comments

  1. the one thing everyone will search by J3r3miah · · Score: 5, Funny
    --
    God is real unless declared as int
    1. Re:the one thing everyone will search by kripkenstein · · Score: 3, Funny

      A search for "bill gates" turned up these tidbits:

      if (gates == NULL) /* eat this, Billy-boy */
      gates = (HINF **) Hmalloc (sizeof (HINF *) * 10);


      int_fast16_t reserved1; /* Ask Bill Gates what this is all about. */

    2. Re:the one thing everyone will search by kjart · · Score: 1

      My first thought was this. I didn't think anyone actually used those in real life.

    3. Re:the one thing everyone will search by shreevatsa · · Score: 1
    4. Re:the one thing everyone will search by Anonymous Coward · · Score: 0

      Where ever you find wankers, you find wankstains.

      How childish are we?

    5. Re:the one thing everyone will search by mr_tommy · · Score: 2, Funny

      Hilarious- the pains that writers have to code for browsers!

      - Calendar.continuation_for_the_fucking_khtml_browse r = function() {
      // check for function objects (as usual, IE is fucked up)

    6. Re:the one thing everyone will search by Anonymous Coward · · Score: 0

      I liked this one from kawa/gnu/expr/LocalDeclaration.java. It so... zen.

      import gnu.mapping.Binding;
      import kawa.standard.Scheme; // fuck

    7. Re:the one thing everyone will search by Anonymous Coward · · Score: 4, Informative

      You can also find some unfunny stuff too!

      This could be abused by email spammers.
      Search for: http://www.google.com/codesearch?q=%40

      This reveals a lot of email addresses in code.
      It's giving the spammers email addresses on a plate. (within a geek targeted audience)
      That's definitely not funny but scary.

    8. Re:the one thing everyone will search by dema · · Score: 0, Offtopic

      Hahaha I was just about to post this. Fuck you!

    9. Re:the one thing everyone will search by groovelator · · Score: 2, Funny
    10. Re:the one thing everyone will search by SnprBoB86 · · Score: 1

      This is BEGGING for a competition! Google, I have a feature request: group-by project and occurance counts.

      There must be one project with a bigger potty mouth than all the rest.

      --
      http://brandonbloom.name
    11. Re:the one thing everyone will search by Neil+Hodges · · Score: 1

      Just like Google; search for any one (or sometimes more) word and they'll have something.

    12. Re:the one thing everyone will search by Anonymous Coward · · Score: 0

      I especially like this one!

    13. Re:the one thing everyone will search by Barryke · · Score: 1
      Hilarious- the pains that writers have to code for browsers!
      I like this one: IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'>";
      --
      Hivemind harvest in progress..
    14. Re:the one thing everyone will search by nschubach · · Score: 2, Interesting
      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    15. Re:the one thing everyone will search by alx5000 · · Score: 1

      Unless it's a bunch of Joe Sixpacks who's doing the programming, I bet they have some sort of spam filter. Real Geeks [TM] won't be taken down with a mere %40 google search ^^

      --
      My 0.02 cents
    16. Re:the one thing everyone will search by alx5000 · · Score: 1

      I'm sorry, but

      Email-Simple-FromHandle-0.011/lib/Email/Sim ple/FromHandle.pm

          13: # We are liberal in what we accept.
              # But then, so is a six dollar whore.
              # At least, that's what Casey tells me.

      --
      My 0.02 cents
    17. Re:the one thing everyone will search by iluvcapra · · Score: 1

      You bastard.

      --
      Don't blame me, I voted for Baltar.
    18. Re:the one thing everyone will search by Anonymous Coward · · Score: 0
    19. Re:the one thing everyone will search by Anonymous Coward · · Score: 0

      Let me be the first one to say this:

      It pleased me to see google succeed 3 years ago....now I can't wait to see them crash and burn.

    20. Re:the one thing everyone will search by julesh · · Score: 1

      I started getting spam to the address I put in code I write back in '99 or thereabouts. These days, I get spam to addresses I've never published (and which don't seem to have been randomly guessed, either). My belief is that spammers are using malware to crawl through people's personal files for addresses to send to these days. So there's almost nothing you can do to stop them getting your address now.

    21. Re:the one thing everyone will search by julesh · · Score: 1

      Strange. The first thing I thought of was this one.

    22. Re:the one thing everyone will search by Espectr0 · · Score: 1

      Hah, look at this:

      var IE_IS_A_FUCKING_SHIT = '>';
                          if (HTMLArea.is_ie) {
                                          td.unselectable = "on";
                                          IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'>";
                          }

    23. Re:the one thing everyone will search by Espectr0 · · Score: 1

      Look what is found in emacs:

      emacs-18.59/lisp/doctor.el - 9 identical

            693: (doctor-put-meaning dicks 'sexnoun)
                      (doctor-put-meaning cunt 'sexnoun)
                      (doctor-put-meaning cunts 'sexnoun)
                      (doctor-put-meaning prostitute 'sexnoun)

    24. Re:the one thing everyone will search by Pollardito · · Score: 1

      you misspelled foo (which is half as popular as bar, 1,480,000 to 2,950,000)

    25. Re:the one thing everyone will search by Anonymous Coward · · Score: 0

      I did that once in SunSolve and showed the output to our account rep .... Wanna watch Sun engineers scramble? :)

  2. COBOL hasn't been topdog for a while by BadAnalogyGuy · · Score: 2, Interesting

    VB has been the language with the most LOC since the early-mid 90's.

    As scary as that sounds.

    1. Re:COBOL hasn't been topdog for a while by doti · · Score: 4, Insightful

      It's true that not a lot of people write COBOL today, but the submiter was talking about legacy code. No wonder they're not on the Internet: not only they are from a pre-Internet era, but the vast majority of it is from corporations that keep their code very closed.

      --
      factor 966971: 966971
    2. Re:COBOL hasn't been topdog for a while by BadAnalogyGuy · · Score: 0, Redundant

      Total lines of code evar champion: VB.

      It passed "legacy language" COBOL back in the 90's.

    3. Re:COBOL hasn't been topdog for a while by Anonymous Coward · · Score: 0

      "evar" is not evidence. Prove your statement or shut up.

    4. Re:COBOL hasn't been topdog for a while by plopez · · Score: 2, Interesting

      Well... if we want to quibble... :)

      Basic was intended as a teaching language and so the language incorporated lots of syntax and ideas from the 2 major languages of the time: COBOL and FORTRAN.

      BASIC eventually begat that idiot bastard child 'Visual Basic' and syntacticly hasn't changed much since. So you could say that there is a lot of COBOL in 'Visual Basic'. Sure, it became object focused and now OO, but it still resembles COBOL. So COBOL lives on, as Visual Basic. It will not die :)

      And while I am on the soap box :) .....

      So much of the code I have seen is just COBOL in drag. Java, VB, C++, C# etc. just COBOL programs in drag. Most people have not really changed their mindset since COBOL.

      Case in point:
      I showed my boss who is supposed to be an OO programmer how to abstract out a data access layer so that the layer knows nothing about the request sent to it or the exact DB structure and the requesting class knew nothing of the database. I used a few of the nicer features of C# and .Net.

      My boss, supposedly a programmer didn't 'get it'. The upshot beign we ended up writing one class per DB table (as opposed to one table manager class total) and the results could have been quicker and easier in COBOL.

      I will now step down off the soap box.

      --
      putting the 'B' in LGBTQ+
    5. Re:COBOL hasn't been topdog for a while by jonadab · · Score: 1

      > It's true that not a lot of people write COBOL today, but the
      > submiter was talking about legacy code. No wonder they're not
      > on the Internet: not only they are from a pre-Internet era,
      > but the vast majority of it is from corporations that keep
      > their code very closed.

      The amount of COBOL code out there has also been greatly exaggerated.

      Almost all COBOL code in existence is 25+ years old, but at this point there is more new code written *every year* than the TOTAL amount of 25-year-old code still in use. (There's a lot of ten-year-old code still in use, of course, but these days most of that is not COBOL.) Sure, a lot of the outfits that were using computers 25 years ago still have some of their old code kicking around, but in terms of computer usage "a lot" back then did not mean the same thing as "a lot" now.

      And anyway, the main reason there was so much COBOL code out there in the first place is because it *takes* so much code to *do* anything in COBOL. (I actually had a COBOL class in college. My first program, which was basically Hello World, was most of two pages when printed. Part of that is the fifty lines or so of up-front overhead attached to every program, but a lot of it was due to the inherent verbosity of the language. You can't print anything out without storing it in a variable. You can't store anything in a variable without declaring it, not once but twice, and its "picture" format. And so on.) A thousand lines of COBOL is roughly equivalent to a hundred lines or so of C, ten lines of decent maintainable Perl, or one line of Perl golfed down beyond all recognition.

      Anyway, what I was going to say is that Perl has had search.cpan.org for a while, but it'd be nice to have comparable functionality for other languages, so one hopes they'll keep working on this.

      --
      Cut that out, or I will ship you to Norilsk in a box.
    6. Re:COBOL hasn't been topdog for a while by nschubach · · Score: 1

      I like this little diagram for language relationship:
      http://www.levenez.com/lang/history.html

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    7. Re:COBOL hasn't been topdog for a while by locoluis · · Score: 3, Interesting

      True. And if there's any COBOL code on the Internet, it can be found using the following search terms:

      "IDENTIFICATION DIVISION" "DATA DIVISION" DISPLAY PROGRAM-ID SECTION

      No need for Google to develop a special search for what look less like a computer program and more like a plain text file.

    8. Re:COBOL hasn't been topdog for a while by iggymanz · · Score: 1

      cool but there is a mistake, they have Object Pascal in 1985 being a predecessor to Turbo Pascal. Not true, although there was an oo version of Turbo Pascal for which that might be true. TP came out in 1983.

    9. Re:COBOL hasn't been topdog for a while by jskline · · Score: 1

      This isn't really true either since Pascal or Object Pascal; aka Delphi isn't showing up in there either. This is definitely post-internet code and fortunately I know many a place to find code lib's not to mention all the lines of code I did for years that are still on boxes of floppies and CD's. I think they need to really allow a more complete search and rather not limit it to what they *feel* is relavent.

      --
      All content in this message is copyright (c) 2008. All rights reserved. RIAA is prohibited here.
  3. http://koders.com/ by Anonymous Coward · · Score: 0, Redundant

    not to undermine the Google's work but in the meantime you may as well try this one

    http://koders.com/

    1. Re:http://koders.com/ by kafka47 · · Score: 1

      I would have tried it anyhow, considering that it was cited in the article summary.

      (Sorry couldn't resist) :-)

      /K

    2. Re:http://koders.com/ by Anonymous Coward · · Score: 0

      ...one step further i didn't even RTFSummary

    3. Re:http://koders.com/ by tcopeland · · Score: 1

      The folks at Koders have been nice enough to give RubyForge a little Javascripty thing that integrates nicely into the regular GForge user interface so that folks can search the RubyForge CVS repositories. I've talked with them a couple of times and they seem like nice folks.

    4. Re:http://koders.com/ by thzinc · · Score: 1

      The owner of the company actually is a pretty nice guy. I had a chance to meet with him on a couple of different occassions. He was rather knowledgeable too.

      It's refreshing to find that not every company is led by someone with their head in their ass.

  4. Restricted Use Due to Copyrights by eldavojohn · · Score: 5, Interesting

    I made a simple search for "fade file:.js" in order to find a javascript function that would fade a div or table or anything really (I know scriptaculous offers this already, just curious as to what's out there). I found something but the header of the file read:

    All Code herein is Copyright 2005 Match.com
    Do not copy, reproduce, reuse or sell any code herein
    without the express, written consent of Match.com.
    For information contact webmaster@match.com.
    All Rights Reserved.

    Which is expected. However, that means this tool isn't useful for finding a method or function or class I can use and then using it ... it seems to be restricted to one of two uses. If I'm looking for code that does natural language parsing, I could hope a comment somewhere contains NLP as a description of what's going on. Or, I could look for libraries out there with methods and then search for those methods to see how other people used them to get an idea of how they work. The vast majority of this code seems to be just web development front-end code at least from the few searches I've done. Too bad, that's a very small part of programming.

    --
    My work here is dung.
    1. Re:Restricted Use Due to Copyrights by Aladrin · · Score: 1

      You could always just search for code under the license you want. Instead of all code.

      --
      "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
    2. Re:Restricted Use Due to Copyrights by doti · · Score: 1

      But you can study the code, and try to apply the general idea to your own code.

      --
      factor 966971: 966971
    3. Re:Restricted Use Due to Copyrights by doti · · Score: 1

      But wait, aren't all those licenses listed in the combobox free (as in open source) licenses?

      --
      factor 966971: 966971
    4. Re:Restricted Use Due to Copyrights by Martz · · Score: 1

      Try the Fade Anything Technique (FAT)!
      http://www.axentric.com/aside/fat/

    5. Re:Restricted Use Due to Copyrights by CastrTroy · · Score: 1

      I'm not sure how well licenses/copyright work on Javascript. Anything that you release in Javascript on the internet is basically open source. Sure you can tell people not to use it, but it's there for them to read, and use your ideas to make their own software. If they want to make something similar, they can change it just enough to look different, or they can take single functions, which aren't really that complicated, and change them just a little to look like their own code that was developed without even looking at the other code. That's why i don't get all these companies who place massive amounts of web application logic into Javascript. They are basically telling all their competitors exactly how their applications work.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    6. Re:Restricted Use Due to Copyrights by Sparr0 · · Score: 1

      Yes. Why would you want to search for non-Free code? You couldn't do anything with it.

    7. Re:Restricted Use Due to Copyrights by Sparr0 · · Score: 1

      First, "its easy to break this law and not get caught" is not a good reason to break it. If you start the next MySpace and someone ends up able to prove that you ripped off their code (and yes, its possible to do so), youre going to be hurting to the tune of a large fraction of your net worth.

      Second, maybe some companies dont care if the logic is out there. I know it's optimistic, but this is the essence of open source. "Here is our code. It does something cool."

    8. Re:Restricted Use Due to Copyrights by doti · · Score: 1

      But eldavojohn found non-free code with it.

      Looks like the "Any license" option disable license checking.
      It should be replaced by these two options:
      "Any free license bellow"
      "Other licenses"

      --
      factor 966971: 966971
    9. Re:Restricted Use Due to Copyrights by swillden · · Score: 1

      Sure you can tell people not to use it, but it's there for them to read, and use your ideas to make their own software.

      Which is legal, BTW. Copyright doesn't cover your ideas, just your code.

      If they want to make something similar, they can change it just enough to look different, or they can take single functions, which aren't really that complicated, and change them just a little to look like their own code that was developed without even looking at the other code.

      Perhaps. Making it look different enough is harder than you think.

      That's why i don't get all these companies who place massive amounts of web application logic into Javascript. They are basically telling all their competitors exactly how their applications work.

      And notice how much it hurts them.

      Secret source is overrated.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    10. Re:Restricted Use Due to Copyrights by crystalattice · · Score: 1

      Just out of curiosity, if you don't copy the code directly but use it as a algorithmic template to create your own code, i.e. it gives you the idea you need to make your code work, why not search for non-Free code? Sure, the code itself is copyrighted/patented/whatever, but you're not using the code, just the ideas in it.

      --
      Free Programming BookLearn to program
    11. Re:Restricted Use Due to Copyrights by TheSpoom · · Score: 1

      You can't legally take a work and change it just enough to be unrecognizable then call it your own. That's creating a derivative work and is still infringing copyright if you don't have the permission of the copyright holder. What you can do is create your own that does the same thing from scratch and/or with components you have permission to use.

      And anyone who places huge amounts of business logic in client-side code isn't thinking about their application's design well enough. Certain things need to be done client-side like Flash and AJAXy special effects but when any large amount of processing needs to be done it should be done server-side with few exceptions.

      --
      It's better to vote for what you want and not get it than to vote for what you don't want and get it.
      - E. Debs
    12. Re:Restricted Use Due to Copyrights by swillden · · Score: 1

      Did you mean to reply to someone else?

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  5. Thankfully... by nate+nice · · Score: 1

    ...I can forget RegEx's now.

    But honestly, this might have some bells and whistles but I don't see myself getting rid of my regular expression searches any time soon.

    --
    "If you are a dreamer, a wisher, a liar, A hope-er, a pray-er, a magic bean buyer ..."
    1. Re:Thankfully... by h2g2bob · · Score: 1

      Ah, but it DOES uses RegEx

      No need for the m// and spaces should be escaped to avoid it looking in lots of places.

      Click "Advanced search" and it says "Find results with the regular expression...". Admittedly, I'd like to use regex for all my google searches (not just code), but I think that may be a bit much to ask, even from Google.

      I also like the search by license, but it would be nice to have a search for "Any OSI-certified code".

  6. What's that I hear???? by bluelip · · Score: 5, Funny

    It's the sound of millions of CS majors cheering!!!!

    Dang, this a neat tool.

    --

    Yep, I never spell check.
    More incorrect spellings can be found he
    1. Re:What's that I hear???? by bluelip · · Score: 2, Insightful

      _OR_, the sound of thousands of Profs moaning.....

      --

      Yep, I never spell check.
      More incorrect spellings can be found he
    2. Re:What's that I hear???? by Gospodin · · Score: 3, Insightful

      Why? This makes it easier to check for plagiarism.

      --
      ...following the principles of Heisenburger's Uncertain Cat...
    3. Re:What's that I hear???? by Gemini_25_RB · · Score: 1

      I disagree. In my experience, it is harder to detect and prove plagiarism in code than in written language (like an essay). This is because it is very easy to copy short segments of code and change a variable name, maybe move some code around, and then claim it as your own. It is even easier when you are told a specific objective, because then all of the code will look somewhat similar, and (unabashedly opinion) it is harder to dinstinguish coding styles than it is to distinguish writing styles.

    4. Re:What's that I hear???? by SpinyNorman · · Score: 2, Insightful

      Not really, you can just tokenize the code, removing the issue of white space, comments and formatting completely, and just treat identifiers as a token type vs even looking at the name - then you're just doing a pure structural comparison of the code. Plenty of other things you could do too to normalize the code and factor out any trivial rewritings (changing parenthesis, etc).

      Any smart code comparison would look for function by function matches to factor out trivial reordering, and would anyways operate on a diff-like basic looking for changes rather than a yes/no match.

      Net result is that a smart code compare tool would not be fooled in the slightest if you completely reformatted the code, changed all the identifiers and comments, reordered all the functions, and even rewrote a few pieces for good measure - it'd still show a 95% match with the original, which for anything more than a trivial fucntion would be almost certain proof that id had been copied.

      Ben

    5. Re:What's that I hear???? by Cid+Highwind · · Score: 1

      That technique might be helpful if you're looking for plagarism of published software or independent-study projects, but it's going to be about useless for finding out who is cheating on something like a CS 101 project. When the day's assignment is "write a java class that performs the following operations and implements interface CS101TestClass2", any student's code is going to be a 90%+ match with any other student's code.

      --
      0 1 - just my two bits
    6. Re:What's that I hear???? by IpalindromeI · · Score: 1

      Sure, but that's not really the professor's problem. Classes are provided for the benefit of the student. If the student wants to blow through the class without learning anything, why not let them? They're paying for it, after all. Once they get a job and their employer finds out they don't know anything, it will catch up with them. A wise employer would be giving some type of practical test as part of the interview anyway, not basing their decision on grades.

      --

      --
      Promoting critical thinking since 1994.
  7. Non-alphanumerics at last! by maccallr · · Score: 4, Informative

    At last we can use regexps and search on all the important characters between the alphanumerics! For example the prefixed '@' in PHP - very hard to figure out what this is, without reading the reference cover to cover. Now at least we can search the codebase and hope to see some useful comments preceding it, or figure out from context what's going on.

    e.g. "@fopen file:.php"

    1. Re:Non-alphanumerics at last! by serialdogma · · Score: 2, Informative

      The @ prefix in PHP just stops it from printing an error message if something goes tits-up.

    2. Re:Non-alphanumerics at last! by fruey · · Score: 2, Informative

      Not only stops it from printing an error, but ignores the error and carries on parsing the rest of the code.

      Useful for including a file that might not be there, for example...

      --
      Conversion Rate Optimisation French / English consultant
    3. Re:Non-alphanumerics at last! by Anonymous Coward · · Score: 0

      What, like "@echo off"?
      (no, I'm not admitting to knowing that).

    4. Re:Non-alphanumerics at last! by CastrTroy · · Score: 1

      But like the original poster stated, it's not very obvious what it does from just looking at it, without comments stating that we are ignoring any errors produced. I mean, it's basically a hack so you don't have to write a try-catch with an empty catch statement. It's the PHP equivalent of VB's On Error GOTO Next. Why would you write code that's that unclear, when you have another way to write the code that makes it much more clear of what's actually going on? Why would you write code that just ignores errors, and does nothing about them, assuming your application won't crash later on because the error occured? I'm sure all the PHP gurus understand what it's for and all it's implications, but somebody new to the language might miss something like that when looking at code. I don't think that ignoring errors is something that good developers do.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    5. Re:Non-alphanumerics at last! by Dragonslicer · · Score: 1

      Just to clarify, I think you meant "executing" instead of "parsing". If there's a parse error in the file, none of it is ever executed, including any execution-time changes you make to PHP's error handling. Your example is also a terrible use of error suppression. Most of the time's I've seen people use @ for error suppression have been because the programmer is too lazy, stupid, or ignorant to check for expected failures. In your example, using file_exists() before trying to include the file would be much better, since you won't end up with problems that are difficult to find because you've hidden the error message. The only legitimate uses for error suppression I've found are for functions that generate error messages even on expected failures, with no possibility of knowing ahead of time that the function will fail (socket connection timing out is the first example that comes to mind).

    6. Re:Non-alphanumerics at last! by fruey · · Score: 1

      From the PHP manual entry on including files (my example is too simple, and in fact this is where it came from):

      My experience is you can use an if-statement to verify if the script was included (I havn't tested this on remote includes, there might be non-standard-404 pages that makes it impossible to verify you got the right page)
      Example:
      // ignore the notice and evaluate the return value of the script, if any.
      if(@include(dirname(__FILE__)."/foo.php"))
      echo "foo.php included";
      else
      echo "failed to include foo.php";

      So if you need to see if the include might have worked (and not forgetting cases where testing if a file exists doesn't mean it can be included) then this type of construct might be useful. I use it to try to include a specific header file based on URL attributes, otherwise include a generic replacement file.

      You are of course correct in saying that code should try not to be lazy, and ignoring errors is a Bad Thing. Sometimes you can find use for that, and in my case above I hope this is OK (feel free to post an alternative, I'd be happy to include it in my code).

      You are also correct that parsing was the wrong term. The syntax is parsed, and then the execution begins which can throw errors. So it's not a question of parsing. My apologies.

      --
      Conversion Rate Optimisation French / English consultant
    7. Re:Non-alphanumerics at last! by maccallr · · Score: 1

      Just to clarify my original point... try searching for '@' in the PHP online manual, you'll get no matches (it filters out all non-alphanumeric characters I suppose). (If you knew to search for the phrase "at sign" it will actually bring back useful hits.)

      Now at least Google lets us search for special characters in code (hopefully they can extend this to reference manuals soon).

    8. Re:Non-alphanumerics at last! by heinousjay · · Score: 1

      So you advocate writing comments that explain what the code is doing in terms of the language? Are you the guy who sat in my cubicle two jobs back and wrote:

      int a = 1; // assign 1 to a

      --
      Slashdot - where whining about luck is the new way to make the world you want.
    9. Re:Non-alphanumerics at last! by EigenHombre · · Score: 1

      I too would love to be able to use regexps for normal searches -- but it does make me wonder how they implemented (indexed) this, given that the space of all possible regexp's has got to be much larger than that of a finite sequence of keywords.

      --
      EOT
    10. Re:Non-alphanumerics at last! by maccallr · · Score: 1

      Good point, I don't think they can do any indexing, but they can search a relatively small corpus in parallel over a stupidly large number of machines.

    11. Re:Non-alphanumerics at last! by kv9 · · Score: 1

      Just to clarify my original point... try searching for '@' in the PHP online manual, you'll get no matches

      http://php.net/@

  8. I like this search better - fucking funny as by Anonymous Coward · · Score: 0
    1. Re:I like this search better - fucking funny as by kafka47 · · Score: 3, Funny

      LOL your search has now uncovered the hidden angst of a million programmers :

      ($backend && $backend->isa("Acme::Scurvy::Whoreson::BilgeRat::B ackend::$params{language}")) ||
      die("For fuck's sake, the fucking backend's fucked");

      /K

    2. Re:I like this search better - fucking funny as by radarsat1 · · Score: 1

      For some giggles, I highly recommended the following: /usr/src/linux# grep -iR fuck .

    3. Re:I like this search better - fucking funny as by tkittel · · Score: 5, Interesting

      I agree, it is rather funny. My favourite is so far:

      /usr/src/linux/arch/sparc/kernel/ptrace.c: /* Fuck me gently with a chainsaw... */

      But I also stumbled upon this little gem in /usr/src/linux/net/core/netfilter.c:

      /* netfilter.c: look after the filters for various protocols.
      * Heavily influenced by the old firewall.c by David Bonn and Alan Cox.
      *
      * Thanks to Rob `CmdrTaco' Malda for not influencing this code in any
      * way.
      *

      Anyone knows if there is a story behind this comment? Is it a private joke on taco, or did he piss them off?

  9. How many by jfinke · · Score: 1

    Open Source projects that you know are written in COBOL? I don't know of any. It is a lot of legacy code. There is very few new projects being started in COBOL.

    1. Re:How many by RuneSpyder · · Score: 1

      The only COBOL program written from scratch was the first one.

    2. Re:How many by mykdavies · · Score: 1

      You'd think so wouldn't you? This page has links including COBOL XML parsers as well as CGI- and RPC- interfaces.

      There's even funded university research (watch out for popunders) going on into COBOL - check out the research lab!

      --
      The world has changed and we all have become metal men.
    3. Re:How many by jfinke · · Score: 1

      Yeah, but those projects have got to be miniscule when you compare them to all of the opensource C, C++, java, perl, php, python, ruby, language du jour that is out there... I have got to think less than 1%. Hell, I just checked Freshmeat.net and there is no category for software programmed in COBOL. And they even have LISP, REXX, BASIC, and ADA.

  10. Awesome! by MrP-(at+work) · · Score: 1

    This is pretty cool.. i hate trying to search code on normal google, it usually filters out most of the search characters and you end up with nothing useful.

    Now if only they'd add regex searching to normal google (unless it already has it and i'm missing it?)

    mmmm regex

    --
    [an error occurred while processing this directive]
  11. Useful to whom? by kjart · · Score: 4, Interesting

    Whenever I search for something code related on the web it's usually because I want to know how to do something. In such cases I dont really know what the code itself would be (i.e. the reason why I'm searching) so this wouldn't help at all. I suppose if you were looking for specific code it could be useful, but why would you be doing that? That would likely be your own code, so wouldn't a simple grep be easier?

    I'm sure I'm missing something here - Google doesn't (usually) release useless new products :)

    1. Re:Useful to whom? by admdrew · · Score: 3, Insightful

      If you're unaware of how to do something from a design standpoint, you're right that viewing code is not necessarily going to help. This tool, however, works great for more specific issues related to syntax, etc. I've already used this to see examples of ItemTemplate in C#. A simple search on regular google yields examples, but it also returns a lot of crap.

      When considering TMTOWTDI, looking at other code similiar to yours can be very helpful, and (for me, at least) can help break out of a code writers block when I've been working with a particular chunk of code for too long.

    2. Re:Useful to whom? by dextromulous · · Score: 1

      For instance: yesterday I was trying to figure out if sigfillset() and sigaction() would allow me to catch all possible signals sent to a process... I forgot I could have used a code search utility to get examples (searching the www was getting me nowhere.)

      At any rate, I just ended up using a debugger and solved my problem, but the question still lingered... and now I might actually find out the answer :-)

      --
      There are two types of people in the world: those who divide people into two types and those who don't.
    3. Re:Useful to whom? by dextromulous · · Score: 1

      ... And in less than the time it took me to write this post, I found my answer thanks to a code search engine (the way I was using those functions was doing exactly the opposite of what I wanted!)

      --
      There are two types of people in the world: those who divide people into two types and those who don't.
    4. Re:Useful to whom? by kjart · · Score: 1

      Yeah, that's a good point I suppose. I guess if you're looking for implementations of specific classes/functions/whatever, it could be handy. It could be a double-edged sword though: I've picked up several bad habbits in the past looking at coworkers code (not to mention what I've likely passed on!) - looking over the shoulders of random people on the web may not be a good thing ;)

    5. Re:Useful to whom? by CCFreak2K · · Score: 1

      It's probably a Google solution looking for a problem. It seems to me like a really neat tool, but someone has to think of ways to use it.

      --
      "Beware of he who would deny you access to information, for in his heart he dreams himself your master."
    6. Re:Useful to whom? by xTantrum · · Score: 1

      To really use google code properly and pinpoint what your looking for, you'd need to put some regualr expressions in the query box it would seem. One reason to learn reg ex.

      --
      $action = empty(PHP) ? backToC() : unset(PHP) ; "when the concrete cases are understood, the abstractions are readily
    7. Re:Useful to whom? by swillden · · Score: 1

      I found my answer thanks to a code search engine (the way I was using those functions was doing exactly the opposite of what I wanted!

      Another option I often find to be very helpful is to look at the implementation of the functions. Even if the source for the platform you're working on isn't available, looking at the source to another conforming implementation of the same API can help.

      Of course, this all presumes that the man pages didn't give you what you needed in the first place.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    8. Re:Useful to whom? by zobier · · Score: 1
      Whenever I search for something code related on the web it's usually because I want to know how to do something. In such cases I dont really know what the code itself would be (i.e. the reason why I'm searching) so this wouldn't help at all.
      Hopefully code comments will help with this somewhat.

      I'm sure I'm missing something here - Google doesn't (usually) release useless new products :)
      Are you for serious?
      --
      Me lost me cookie at the disco.
    9. Re:Useful to whom? by xycadium · · Score: 1

      I did a search for a single, common statement and found that I can use it to learn better (hopefully) coding techniques. I'm an ameteur, somewhat newbie so seeing many other ways of doing the same code is a big thing for me. In a matter of moments I've already seen a few better ways I could implement past and current coding projects.

  12. "Given enough eyeballs... by bloblu · · Score: 3, Informative

    all bugs are shallow."

    Well, it looks like that's not really the case: http://www.google.com/codesearch?hl=en&lr=&q=++%5C sif%5C(%5B%5E)%5D*%5C)%3B+license%3Agpl+lang%3Ac%2 B%2B&btnG=Search

    I hope this service will help improve code quality...

    1. Re:"Given enough eyeballs... by doti · · Score: 1

      That's surprising to me.
      I never made that typo, and never saw it on other's code.

      Impressive.

      --
      factor 966971: 966971
    2. Re:"Given enough eyeballs... by ggvaidya · · Score: 2, Interesting

      Some of those are a hack around the VC 6 "for loop doesn't scope as per ANSI" bug. This forum post explains when its used.

  13. No need to search for Cobol? by krell · · Score: 5, Funny

    "I don't see any option to search for Cobol."

    Well, that's one entire season of "Battlestar Galactica" rendered entirely pointless. Thanks a lot!

    --
    Where were you when the voynix came?
    1. Re:No need to search for Cobol? by Blakey+Rat · · Score: 1

      Why do submissions start so promisingly, with people who seem intelligent and informed, and then turn into some kind of weird rant about how much COBOL code is on the Internet-- as if that mattered in some way?

      Story submitters: It's a given now that Slashdot basically has no editing what-so-ever, so please self-edit a bit before hitting go. Thank you.

  14. uses some form of regexp by cyclomedia · · Score: 1

    i sign my code changes in projects with "// cyc" or "// ric".. so naturally i tried those (and came up with sod all, naturally)... but the latter will also return

    "// a long bit of text written by eric smith "

    searching for

    "//.ric"

    on the other hand gets closer matches to what i intended

    --
    If you don't risk failure you don't risk success.
    1. Re:uses some form of regexp by 19thNervousBreakdown · · Score: 1

      You need to escape your spaces, it considers them separate regexes otherwise:

      "//\ ric"

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
  15. A good start.. by sfraggle · · Score: 5, Insightful

    It's a good start. They really need to start searching Subversion/CVS repositories as well. One of the most obvious things that they seem to have missed is to index all the Sourceforge downloads.

    --
    were you expecting to see a sig here? perhaps you'd rather see the inside of an ambulance!
    1. Re:A good start.. by Slurfer · · Score: 3, Informative

      According to the help / FAQ page, they are searching cvs & subversion repositories.

    2. Re:A good start.. by Dan+Berlin · · Score: 1

      Uh, it does index Subversion and CVS repos.
      Why do people not read?

    3. Re:A good start.. by mclipsco · · Score: 1

      yeah, because their emails weren't getting through to Gmail.

      --
      Take off every 'SIG'!!
  16. Wow what a crappy summary by p3d0 · · Score: 0, Offtopic

    I would just like to burn a few karma to say that is the most disjointed, stream-of-consciousness summary I have seen in some time. There's one tiny little terse sentence announding the existence of the new search functionality, and somehow it manages do do so without even what kind of "code" we're talking about. Then the rants begin. The remainder of the paragraph has an average of one parenthetical remark per sentence, including two in a single sentence; and fully two-thirds of the rant is complaining about the lack of Cobol, of all things.
    Phew, I feel better.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    1. Re:Wow what a crappy summary by kafka47 · · Score: 1

      Sorta like your post.

      /K

    2. Re:Wow what a crappy summary by jlarocco · · Score: 1

      What the hell are you talking about? The GP is right, that summary sucked. If I wanted to suffer through reading summaries written by 12 year olds, I would just read digg.

  17. Not that useful by fellm · · Score: 2, Interesting

    As a programmer who needs to solve a problem I need a place to find answers to the problem I am solving. Searching for a code won't do it because I am looking for an answer and not how to code it. To find answers I use Omgili - it is a vertical search engine that search ten of thousands of forums and millions of discussions. Usually someone already asked my question and hopefully it has an answer. It is highly recommended for troubleshooting and specific problems/questions.

    1. Re:Not that useful by 19thNervousBreakdown · · Score: 1

      Thanks! I've already found that searching newsgroups usually finds better results than a web search, and have always wished forums were searched better. I'll check this out, let's hope it does better than Google.

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
  18. security hole search by Sub+Zero+992 · · Score: 5, Insightful
    --
    They who would give up an essential liberty for temporary security, deserve neither liberty or security - Ben Franklin
    1. Re:security hole search by RalphSleigh · · Score: 2, Informative

      Mmmmm, SQL injection for the world to see. Good Call.

      --
      Come as you are, do what you must, be who you will.
    2. Re:security hole search by soliptic · · Score: 1

      F**k me, that's massive.

      You (google) have just given me (everyone) a whole list of vulnerable projects - follow that up with a google search for some identifying feature of the project in the final output ("Powered by BadlyCodedProject v1.01" or whatever) and then a simple bit of "?id=1;%20DROP%20TABLE" url munging and the consequences.... phew...

      I suppose on the bright side it also provides a quick way for you to audit OSS tools you were considering using, and if exploitation of these poorly coded systems explodes overnight, it might give an incentive for them to be fixed up all the quicker.

    3. Re:security hole search by julesh · · Score: 1

      You could easily do this yourself for any project you were considering using -- it's a simple application of find + grep. What google has added is the capability of running that search across *all* projects.

    4. Re:security hole search by otherniceman · · Score: 1

      And some people need to make sure that robots.txt is correctly configured so that it doesn't go indexing files with their database username and passwords http://www.google.com/codesearch?q=+file:wp-config .php+username&sa=N

  19. What, no Haskell? by DieNadel · · Score: 0, Offtopic

    This functional language is so interesting, there should be more talk about it.

    --
    Utinam logica falsa tuam philosophiam totam suffodiant!
    1. Re:What, no Haskell? by tygerstripes · · Score: 1
      Oh believe me, I've tried. To the whiny chorus of "Where's the curly brackets?"

      *sob*

      --
      Meta will eat itself
    2. Re:What, no Haskell? by doti · · Score: 1

      Haskell is nice indeed. I have read about it, but not used it yet.

      They also missed D, which I hope will became more popular.

      --
      factor 966971: 966971
    3. Re:What, no Haskell? by novitk · · Score: 1

      Haskell is available on http://krugle.com/.

    4. Re:What, no Haskell? by IpalindromeI · · Score: 1

      Actually, you can use braces and semicolons if you want to.

      --

      --
      Promoting critical thinking since 1994.
  20. SCO to sue Gooooogle? by Anonymous Coward · · Score: 0

    Will SCO be suing as their "copyrighted" code is now going to be available via Goooogle?

    1. Re:SCO to sue Gooooogle? by tomhudson · · Score: 1

      Maybe SCO can use it to find the millions of lines of misappropriated code that "got lost" in Blepp's suitcase?

  21. The old saying is true . . . by scottennis · · Score: 4, Funny

    Good programmers write good code. Great programmers find it on Google!

    1. Re:The old saying is true . . . by CastrTroy · · Score: 1

      This really is kind of true. Most of the people I know use Google Groups as a way to find a lot of code. There's no point spending a hour trying to write something, or figure out some obscure feature of your programming language when you can just search Google Groups and find the answer in 5 minutes.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  22. Your Search by mazarin5 · · Score: 3, Funny

    Your search 10 print "boobs" 20 goto 10 returned no results. Try searching again using fewer terms.

    --
    Fnord.
    1. Re:Your Search by z0idberg · · Score: 1

      so does "10 print "boob" 20 goto 10" work then?

  23. Google is not the first to do this by Aditi.Tuteja · · Score: 0, Redundant

    Google is not the first to unveil a code search service. Previously, Famous book publisher O'Reilly launched a beta of its Code Search service last month that allows users to search a combined 2.6 million lines of code published in its books.

    1. Re:Google is not the first to do this by Slurfer · · Score: 1

      And presumably the three sites that the article's summary links to also provided a similar service, prior to Google's announcement....

      I'm obviously in the minority since I bothered to read the whole summary. Its not easy to read admittedly, but the links are relativly easy to spot ;-)

  24. Some advice by kafka47 · · Score: 1

    For online services : Don't put up code that states explicitly, not for production .

    For users : Stay away from online services that put up code that states "not for production". :-)

    cpan.org
    twiki.org
    osuosl.org
    ...

    /K

    1. Re:Some advice by syrion · · Score: 1

      Well, CPAN is very useful. You just check the code you're intending to include in your program to see if it says something like "this code is beta!" before you actually, you know, include it. There are a great number of "experimental" and "beta" perl modules on there--some, like B::CC, are mentioned in Programming Perl--but there are also some very useful, mature modules. Don't warn people off it; it's one of perl's best features.

    2. Re:Some advice by kafka47 · · Score: 1

      I think I was sort of going for humour, but I can see how it might have been misconstrued.

      Perl on the other hand. Now that is funny! *duck* :-)

      /K

  25. Doesn't seem to work too well by Salsaman · · Score: 1

    I searched for some of my own code from sourceforge CVS, and it couldn't locate it.

    1. Re:Doesn't seem to work too well by dstrupl · · Score: 1

      I have to agree. I have tried to search for my name in some files. Found it in one and not in another one in the same folder (?). Also they don't recognize the license. They still need to work on this IMHO.

  26. Nothing new... by Barts_706 · · Score: 0, Redundant

    ...just look at this :

    http://www.koders.com/

  27. Google Unveils Search Code by Marvin01 · · Score: 1

    Ok, I read that headline wrong and though that Google had finally lost its mind completely...

  28. Google has also unvelived MashSearch by cpatil · · Score: 1

    Check out MashSearch.com

  29. http://www.omgili.com - is much more useful by spale · · Score: 1

    Anyone who is a coder knows that when it comes to solving a problem looking through someone else's code without knowing what to look for won't help you. Omgili is a discussion search engine that covers millions of questions and answers. Whenever I have a question about how to do something I search Omgili for answers - very good search engine!

    1. Re:http://www.omgili.com - is much more useful by BillyBlaze · · Score: 1

      Hmm, you created an account just to make that comment, which links to that website three times. Don't you just love the smell of astroturf in the morning?

  30. Proof by jmv · · Score: 4, Funny
    1. Re:Proof by ginbot462 · · Score: 1

      That's because they were just borrowing it.

      --
      Atlas Shrugged : Thematic Story :: Battlefield Earth : Organized Religion
  31. Well this answered a question for me... by jimstapleton · · Score: 1

    I know I'm not alone in my most hated language

    --
    34486853790
    Connection too slow for X forwarding? Try "ssh -CX user@host"
    1. Re:Well this answered a question for me... by Roger_Wilco · · Score: 2, Interesting

      I did a brief survey on "I hate [X]", and got the following:

      perl 9
      java 20
      c 8000
      c++ 11
      c# 1
      lisp 0
      scheme 0
      elisp 0
      fortran 3

      Looks like John McCarthy wins.

    2. Re:Well this answered a question for me... by bogado · · Score: 1

      I hate perl : 9 results
      I hate C++ : 11 results
      I hate C : about 8000 results (?)
      I hate Python : 7 results

      It seems that the most hated language is 'C'. Well at least by the people who force them self to use it, witch may be a good measure...

      --
      []'s Victor Bogado da Silva Lins

      ^[:wq

    3. Re:Well this answered a question for me... by nschubach · · Score: 1
      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
  32. Optimized away by Waffle+Iron · · Score: 1
    I guess there is not a lot of Cobol source available on the Internet, even although there is supposed to be more Cobol source in existence than any other language

    Well, once the search database factored out all of the boilerplate declarations, there was pretty much nothing left to store.

  33. Thank goodness the SCO trial is almost over by acomj · · Score: 1

    If sco had this to search through linux.. Just imagine..

    SCO: You used our patented while loop over 4000 times in our code...

  34. Oh crap! by sparkyng · · Score: 4, Funny

    I hope my CS professor doesn't find this until the semester is over.

    1. Re:Oh crap! by sgt+scrub · · Score: 1

      Arn't you one of Cmdr Taco's students?

      --
      Having to work for a living is the root of all evil.
  35. Major flaw in the Basic category by RingDev · · Score: 1

    The search apparently lumps everything with the word "basic" in the title together. QBasic, Visual Basic, VB.Net, etc...

    While the non-visual and Visual Basic merges aren't that bad, putting VB.Net into that category is a major headache. VB.Net is syntactically similar to VB6, but is fully object oriented and is coded in just like C#. So looking for VB.Net samples in the Basic category returns a lot of VB6 code solutions that may look syntactically correct, but are far from the best practices.

    -Rick

    --
    "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    1. Re:Major flaw in the Basic category by Anonymous Coward · · Score: 0

      I agree completely. Complete lack of foresight on the part of the egineers putting this together. Say what you will about VB6, VBScript or VB.NET, some of us have to use those languages on a daily basis for work, school, hobby.

      You would think people with any kind of degree would recognize the differences between the platforms each form of basic is built on, scripting, runtime or other. Personally, I think this shows a lot of ignorance and malice towards the language as a whole on Google.

    2. Re:Major flaw in the Basic category by RingDev · · Score: 1

      There are numerous "I want this language" posts in the groups discussions, it sounds like the do have some plans for future modifications: http://groups.google.com/group/Google-Code-Search/ browse_frm/thread/a6755aa4f8d95ced/758fc4d324e98c3 9#758fc4d324e98c39

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
  36. Did anybody read by houghi · · Score: 1

    Google Unveils Search Code? I was thinking they opend up.

    --
    Don't fight for your country, if your country does not fight for you.
  37. I'm one in 43,000. by Big+Nothing · · Score: 1

    ...and I thought I was the only one being this clever and humorous in my source code...

    --
    SIG: TAKE OFF EVERY 'CAPTAIN'!!
  38. Bad call, Google. by captnitro · · Score: 1

    This entire project is either a very good or very bad idea.

    (1) Automated searching for security vulnerabilities.
    (2) A lot of that code is copyrighted. Which yes, it's transmitted over the Intarwebs regularly, but now it's just a little easier.

    I'm not saying it's not a *cool* idea, but from the looks of the Slashdotters trying out this new power, I'm not sure Google thought this all the way through. (1) is great when your code runs a web service and nobody sees it but your team or organization. (2) I can foresee a lot of CS kids using this to find that magic snippet to complete Problem Set 13, and/or a lot of copyrighted code finding its way into private projects.

    Just sayin'.

  39. Hmmm...what else should I search for... by kafka47 · · Score: 1

    Oh, how about this?

  40. I found orgasm code! by Jugalator · · Score: 3, Funny

    This is just too funny :-)

    void Mammal::mate( Mammal& partner ) { /* potential mating partner */
            M_partner = partner.getId(); /*printf( "." ); fflush( stdout );/**/ /* mating must be mutual */
            if( partner.getPartnerId() != M_id ) { /*M_wait += 15;/**/
                    return;
            } /*printf( "+" ); fflush( stdout );/**/ /* this is male object */
            if( M_gender == 0 ) { /* perform breeding in female object */
                    partner.mate( *this );
                    return;
            } /* this is female object */
            assert( M_gender == 1 ); /* current position */
            int x = M_x, y = M_y; /* behind position */
            switch( M_direction ) {
                    case EAST: x--; break;
                    case NORTH: y++; break;
                    case WEST: x++; break;
                    case SOUTH: y--; break;
            } /* back to field wall */
            if( !M_field->in( x, y ) ) return; /* newborn's position */
            int cx = M_x, cy = M_y; /* move mother backward */
            M_x = x;
            M_y = y; /* conception */
            orgasm();
            partner.orgasm();
            Mammal* child;
            child = new Mammal( *M_field, cx, cy, NEWBORNENERGY, *this, partner ); /*printf( "CHILD%d ", child );/**/ /* birth */
            M_energy -= CHILDBIRTHENERGY;
            M_population->add( *child );

            printf( "MATE(%d,%d)->%d(%d) ", M_id, partner.getId(), child->getId(), child->getGeneration() ); /* partner.printGenotype();
            partner.printState();
            printGenotype();
            printState();
            child->printGenotype();
            child->printState();/**/
    }

    void Mammal::orgasm() {
            M_energy -= MATINGENERGY;
            M_result = 1;
    }

    --
    Beware: In C++, your friends can see your privates!
    1. Re:I found orgasm code! by dedazo · · Score: 1

      Hey! That might be a leak of the original SimLife for Windows, circa 1998 or so. When mating, the animals would go "OH LA LA!!", and so you'd know you had a new little transmogrified Chickadillo or an Armacken ready to be put to work consuming resources. That Mammal::orgasm() call looks like just the thing =)

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
    2. Re:I found orgasm code! by Cow+Jones · · Score: 1

      void Mammal::mate( Mammal& partner ) {
      ...
      Ooooh! So that's how this mating business works! My teacher tried to explain it to me a few years ago, but she must have been using the wrong subclasses (Bee::mate and Bird::mate).

      Thank you, kind sir, you have made a poor geek's life a lot easier.

      --

      Ah, arrogance and stupidity, all in the same package. How efficient of you. -- Londo Mollari
  41. Bad moderation (Re:Your Search) by Anonymous Coward · · Score: 0

    That was funny, not troll-y.

  42. Another thing a *few* will search for... by Anonymous Coward · · Score: 0

    If you are going to search for that you might as well search for this.

  43. Moo by Chacham · · Score: 3, Funny

    I just searched for "20 GOTO 10". Oh my. I don't know if that is funny or sad.

  44. I little supprised and impressed. by 3seas · · Score: 1

    Google found a word in a source code archive on my site. The others did not.

    I think google is the only one using regular expression patten matching from the users end.
    Hint: completely clear the field or at least delete any end character when doing a different search as some non-printable characters might remain and give you bad results.

  45. hehehe by wolff000 · · Score: 1

    ALL YOUR CODE ARE BELONG TO GOOGLE! I just couldn't resist. I hope those other code search engines have a backup plan cause Google is taking them head on.

    --
    WTF?
  46. link? n/t by Kalak · · Score: 1

    no really lameness filter, there is no point in text in this message....

    --
    I am, and always will be, an idiot. Karma: Coma (mostly effected by .hack)
    1. Re:link? n/t by IpalindromeI · · Score: 1
      --

      --
      Promoting critical thinking since 1994.
  47. what if???? by scharkalvin · · Score: 1

    Just imagine if SCO had access to this a few years ago!

  48. COBOL applications are still being written by Hyperhaplo · · Score: 1

    Large mainframe (ZOS / OS390) systems are still written in COBOL (or COBOL generators like DELTA).
    Yes, I work for one of several organisations that still has mainframes (and still will in 10 years time). It happens to be the best language for the tasks we have.

    Some stats...
    We run 97% of our transactions on the mainframe and 3% on the midrange (Java, webMethods, WebSphere, etc). At this time they both cost about the same to run. The difference is that the mainframe is processing _millions_ of transactions, the midrange isn't.

    Until such time as newer languages can compete at the mainframe level we will continue to have new applications written in COBOL.

    However, all of these projects are for (as far as I know) government departments and you won't see the source anywhere outside their mainframes. For those who want to be scared: our current systems interface with each other and the web in much the same way as the new "cool" technologies do. Google "CICS web interface" for more information. They do update the COBOL language too. It has changed since 1959 and is actually acceptable for the tasks it is currently used for in the mainframe world. Can't wait for the COBOL plugin for Eclipse.

    This tool is going to be exceptionly useful for the code that is on the net.. regardless of what it is. Although.. searching for JCL right now is interesting enough as it is :)

    --
    You have a sick, twisted mind. Please subscribe me to your newsletter.
    1. Re:COBOL applications are still being written by RKBA · · Score: 1

      I thought the COBOL "MOVE CORRESPONDING" statement was pretty awesome when I learned COBOL back in the seventies. :-)

  49. MOD PARENT UP! by Anonymous Coward · · Score: 0

    Truly useful idea that deserves mod points.

  50. I would guess that most COBOL is written in-house. by Richard+Steiner · · Score: 1

    Because of that, it's probably considered proprietary information, so you aren't going to see it released to the public. I suspect a lot of it is fairly company-specific, anyway, and may be of little use outside its original context.

    --
    Mainframe/UNIX Bit Twiddler and long time Windows/Linux Hobbyist.
    The Theorem Theorem: If If, Then Then.
  51. This is great: finding algorithms by chroma · · Score: 2, Interesting
    I just had a need for this very thing. I've been looking for an implementation of the Minkowski sum in Java. And Google had it. So if you need to implement a particular algorithm that someone else might have already implemented, this is the way to find it.

    I can't find any of the software with my name on it that's on SourceForge, though.

    --

    Your design to a real part online: Big Blue Saw
  52. The Linux Scheduler by Plutonite · · Score: 1

    During a short period when we were supposed to modify the 2.4.X linux short term scheduler, we found functions that had no body, took no arguments, and were used as comments.

    I have been wondering about them until today.

  53. troubling searches by commodoresloat · · Score: 1

    This one gets over 32,000 hits. Then there's 41,000 for this one.....

    1. Re:troubling searches by element-o.p. · · Score: 1

      Yeah, but some of those hits were for strings containing the substring "fix me", such as "prefix meta" or "fix memory leak". There are only seven thousand hits for " fix me ": http://www.google.com/codesearch?hl=en&lr=&q=%22+f ix+me+%22&btnG=Search

      Granted, "fix memory leak" still contains the spirit of "fix me", however :)

      --
      MCSE? No, sir...I don't do Windows. Yes, I am an idealist. What's your point?
    2. Re:troubling searches by nschubach · · Score: 1

      RegEx returns a few more relevant hits for "fix me" using /W (non-word, gets those tabs and such)
      http://www.google.com/codesearch?hl=en&lr=&q=%5CWf ix%5Csme%5CW&btnG=Search

      Though, this search gives a few "fixes" for that memory leak issue:
      http://www.google.com/codesearch?hl=en&lr=&q=%5CWc ause%5Csa%5Csmemory%5Csleak%5CW&btnG=Search

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
  54. Example Hunting Made Easier by blueZhift · · Score: 1

    Wow, this is great! One of the things I use Google for most during the day is hunting for example code whenever I'm trying to use something new to me. This code search should make that a lot easier now. With that in mind, I'll have to be more mindful of posting my own code examples in a searchable format!

  55. Don't forget confidential or proprietary by russellh · · Score: 1
    --
    must... stay... awake...
  56. Delphi by Anonymous Coward · · Score: 0

    I am sad to not see Delphi as an option.

  57. COBOL via Google by Kadin2048 · · Score: 1

    Just in case anyone else was interested in what you get by searching that, results 1-2 are part of the COBOL language reference from IBM, but after that you get into sample code pretty quickly. (And if you wanted to add one more language to the list that you can write "Hello, world!" in, here you go.)

    37,500 results total. Not too bad for a "dead" language.

    --
    "Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
  58. Impressive by harmonica · · Score: 1

    Code I have on my site in some ZIP file has obviously been downloaded, unpacked and indexed. Not that this process would be so hard, especially for Google with all of its technology in place, but my site isn't anywhere near important (and code is not in CVS and it's not on Sourceforge or one of the other repositories) and they have all of my little tools crawled and the snippets they show are very insightful for the searcher. A job well done.

  59. 577,000 by mypalmike · · Score: 1

    That's the number of times it found the word "hack".

    --
    There are 0x40000000 types of people: those who understand 32-bit IEEE 754 floating point, and those who don't.
    1. Re:577,000 by xTantrum · · Score: 1

      always interesting to see coders who reference slashdot in some way.

      --
      $action = empty(PHP) ? backToC() : unset(PHP) ; "when the concrete cases are understood, the abstractions are readily
  60. getting default passwords by EqualSlash · · Score: 1

    Some programmers put the default password in sourcecode and Most lazy users never change the default password.
    This makes it easy to get the default password which can be exploited.
    http://www.google.com/codesearch?q=%22default+pass word+is%22

  61. another funny search by Anonymous Coward · · Score: 0
  62. All of us programmers, for one! by Anonymous Coward · · Score: 0

    I want to know how to do something. In such cases I dont really know what the code itself would be (i.e. the reason why I'm searching) so this wouldn't help at all. I suppose if you were looking for specific code it could be useful, but why would you be doing that?

    The fact that Google engineers are using it internally is a good sign. They've written one or two programs, you know. :-)

    It's great if you know what library to use. For example, let's say I know I want to use a QCheckTableItem. The API docs are OK, but not great. The Qt docs have examples for many things, but not everything (and I'm not sure if there's an example for this or not; it's not linked from that page).

    So I type "QCheckTableItem" in the box, hit return, and presto, I've got 200 examples of this class being used in real-life code. Since I'm using Python, I can add "lang:py" to only see Python code -- something that's hard to do with a normal Google search, and impossible with the Qt examples (which are all C++).

    If you don't even know what function/class/module you need, it's less useful, granted. Perhaps this will finally convince some people to comment their code. I'm so sick of programmers writing code without documentation. (Yeah yeah, you claim it's "self-documenting" but you also use variable names that look like your cat walked across the keyboard. crlWdLn, my ass.)

  63. Another interesting search by dedazo · · Score: 1
    --
    Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
  64. Google Unveils Code Search by __aahgmr7717 · · Score: 1

    I also vote for including Component Pascal (Oberon) in the Google code search. There is an international communitiy of users who could benefit from this.

  65. unvelived ?? by mclipsco · · Score: 1

    I don't think this word means what you think it means...much less, anything.

    --
    Take off every 'SIG'!!
  66. Even You Google? by Anonymous Coward · · Score: 0

    I'm in iran and as a developer I was very interested in this new feature but this is what I see tring to open the Page!

    We're sorry, but Code Search is not available in your country.

    now come on! why ! well I think that's obvious.

  67. Excellent-- it can differentiate '.NET' from 'net' by Kazoo+the+Clown · · Score: 1

    Wish the regular Google could do that...

  68. What? No Pascal? by Kazoo+the+Clown · · Score: 1

    Philistines...

  69. Selling it to companies by complexmath · · Score: 1

    Companies can already purchase a Google search engine for their internal documents and such. It seems a natural extension for it to be good at searching source code as well.

  70. Lords of Kobol, help us. by johnBurkey · · Score: 1

    We are searching for the lost tribe of humanity.

  71. SCO Court case by bernywork · · Score: 1

    Holy shit!

    If only SCO had their hands on this, they could have saved themselves a butt load of cash when they found out earlier that their case was a sham!

    --
    Curiosity was framed; ignorance killed the cat. -- Author unknown
  72. Could there possibly be 1 million coders by moterizer · · Score: 1

    ... still using "GOTO"?
    ahref=http://www.google.com/codesearch?hl=en&lr=&q =gotorel=url2html-1642http://www.google.com/codese arch?hl=en&lr=&q=goto>

  73. K&R vs. Alii by zobier · · Score: 2, Interesting

    Indent style searches: K&R about 5,900,000 Alli (Actually, this is a bit broken! Anyone worked out how to enable multiline mode?) about 11,100,000

    --
    Me lost me cookie at the disco.
  74. gonzui by Pelekh · · Score: 1

    This news is being discussed at Slashdot Japan and they say Google uses http://gonzui.sourceforge.net/ software developed in Japan.

  75. I prefer koders... by Ithorian+guy · · Score: 1

    I prefer using , which has several more languages to search for (including COBOL), but of course, the code on koders is only code that has been submited to the site, which would give Google's code search an upper hand.

    --
    Jeff K. is my homeboy.
  76. Sony lyrics by aarku · · Score: 1

    Always fun to search for: http://www.google.com/codesearch?hl=en&lr=&q=%22i+ am+the+walrus%22&btnG=Search Someone dial the RIAA hotline!

  77. There's a demon in the internet! by argent · · Score: 1
    http://google.com/codesearch?hl=en&lr=&q=%22+666+% 22+-665+-667&btnG=Search

    Some of the adjacent comments are amusing... or maybe scary... I wonder how much security code can be bypassed by a parameter of 666.
    # include <linux/posix_types.h> /* no, really, i hate you to death */
     
      * STOP : if set to 666 then the library will stop
      * (this is useful if you are using BUGS in a Thread)
     
    /// ExactLog2sub1 - This function solves for (Val == (1 << (N-1))-1)
    /// and returns N. It returns 666 if Val is not 2^n -1 for some n.
     
              enum { ROOT_MAGIC_COOKIE = 666 };
     
      BTW, for writing this hack I got personal congratulations from Dennis
      Ritchie and Bjarne Stroustrup sent me a bunch of flowers and asked me
      to participate in the standardization committee for C-- v.6.0 as
      responsible for the new Tab-Overriding-Operator and Scope-Sensitive-
      Comments ... but this makes my situation even worse ;-)
     
    /* 666 indicates demise of this object */
              db->parent.type = 666;
  78. Googlewhacks? by Anonymous Coward · · Score: 0

    A whole new set of googlewhacks!

    Try: hacked polygot