Google Unveils Code Search 212
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."
the one thing everyone will search (Score:5, Funny)
Re:the one thing everyone will search (Score:4, Funny)
if (gates == NULL)
gates = (HINF **) Hmalloc (sizeof (HINF *) * 10);
int_fast16_t reserved1;
Re: (Score:2)
My first thought was this [google.com]. I didn't think anyone actually used those in real life.
troubling searches (Score:2)
Re: (Score:3, Funny)
- Calendar.continuation_for_the_fucking_khtml_brows
Re:the one thing everyone will search (Score:4, Informative)
This could be abused by email spammers.
Search for: http://www.google.com/codesearch?q=%40 [google.com]
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.
Re: (Score:2, Interesting)
Re: (Score:2)
Re: (Score:2, Funny)
Re: (Score:2)
There must be one project with a bigger potty mouth than all the rest.
Don't forget confidential or proprietary (Score:2)
getting default passwords (Score:2)
This makes it easy to get the default password which can be exploited.
http://www.google.com/codesearch?q=%22default+pas
COBOL hasn't been topdog for a while (Score:2, Interesting)
As scary as that sounds.
Re:COBOL hasn't been topdog for a while (Score:5, Insightful)
Re:COBOL hasn't been topdog for a while (Score:4, Interesting)
"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.
COBOL via Google (Score:2)
37,500 results total. Not too bad for a "dead" language.
Re: (Score:3, Interesting)
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
Re: (Score:2)
Restricted Use Due to Copyrights (Score:5, Interesting)
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
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Looks like the "Any license" option disable license checking.
It should be replaced by these two options:
"Any free license bellow"
"Other licenses"
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
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."
Re: (Score:2)
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 differen
Thankfully... (Score:2)
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.
What's that I hear???? (Score:5, Funny)
Dang, this a neat tool.
Re: (Score:2, Insightful)
Re: (Score:3, Insightful)
Why? This makes it easier to check for plagiarism.
Re: (Score:3, Insightful)
Any smart code comparison would look for function by function matches to factor out trivial reordering, and would anyways operate o
Re: (Score:2)
Non-alphanumerics at last! (Score:4, Informative)
e.g. "@fopen file:.php"
Re: (Score:2, Informative)
Re: (Score:3, Informative)
Useful for including a file that might not be there, for example...
Re: (Score:2)
Re: (Score:2)
From the PHP manual entry on including files [php.net] (my example is too simple, and in fact this is where it came from):
How many (Score:2)
Awesome! (Score:2)
Now if only they'd add regex searching to normal google (unless it already has it and i'm missing it?)
mmmm regex
Useful to whom? (Score:5, 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 :)
Re:Useful to whom? (Score:4, 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 [google.com] 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.
Re: (Score:2)
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 ;)
Re: (Score:2)
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.
"Given enough eyeballs... (Score:3, Informative)
Well, it looks like that's not really the case: http://www.google.com/codesearch?hl=en&lr=&q=++%5
I hope this service will help improve code quality...
Re: (Score:2)
I never made that typo, and never saw it on other's code.
Impressive.
Re: (Score:2, Interesting)
No need to search for Cobol? (Score:5, Funny)
Well, that's one entire season of "Battlestar Galactica" rendered entirely pointless. Thanks a lot!
Re: (Score:2)
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.
A good start.. (Score:5, Insightful)
Re: (Score:3, Informative)
Re: (Score:2)
Why do people not read?
Not that useful (Score:2, Interesting)
Re: (Score:2)
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.
security hole search (Score:5, Insightful)
http://www.google.com/codesearch?hl=en&lr=&q=Wher
Re: (Score:2, Informative)
Bad call, Google. (Score:2)
(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 for
Re: (Score:2)
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 syst
searched for backdoor password (Score:5, Interesting)
The old saying is true . . . (Score:5, Funny)
Re: (Score:2)
Your Search (Score:4, Funny)
Re: (Score:2)
Some advice (Score:2)
For online services : Don't put up code that states explicitly, not for production [google.com] .
For users : Stay away from online services that put up code that states "not for production". :-)
cpan.org
...
twiki.org
osuosl.org
Re: (Score:2)
Re: (Score:2)
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* :-)
Doesn't seem to work too well (Score:2)
Proof (Score:5, Funny)
Well this answered a question for me... (Score:2)
Re: (Score:2, Interesting)
I did a brief survey on "I hate [X]", and got the following:
Looks like John McCarthy [paulgraham.com] wins.
Re: (Score:2)
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...
Thank goodness the SCO trial is almost over (Score:2)
SCO: You used our patented while loop over 4000 times in our code...
Oh crap! (Score:4, Funny)
Major flaw in the Basic category (Score:2)
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
Re: (Score:2)
-Rick
Re: (Score:2)
I'm one in 43,000. (Score:2)
Hmmm...what else should I search for... (Score:2)
I found orgasm code! (Score:4, Funny)
void Mammal::mate( Mammal& partner ) {
M_partner = partner.getId();
if( partner.getPartnerId() != M_id ) {
return;
}
if( M_gender == 0 ) {
partner.mate( *this );
return;
}
assert( M_gender == 1 );
int x = M_x, y = M_y;
switch( M_direction ) {
case EAST: x--; break;
case NORTH: y++; break;
case WEST: x++; break;
case SOUTH: y--; break;
}
if( !M_field->in( x, y ) ) return;
int cx = M_x, cy = M_y;
M_x = x;
M_y = y;
orgasm();
partner.orgasm();
Mammal* child;
child = new Mammal( *M_field, cx, cy, NEWBORNENERGY, *this, partner );
M_energy -= CHILDBIRTHENERGY;
M_population->add( *child );
printf( "MATE(%d,%d)->%d(%d) ", M_id, partner.getId(), child->getId(), child->getGeneration() );
partner.printState();
printGenotype();
printState();
child->printGenotype();
child->printState();/**/
}
void Mammal::orgasm() {
M_energy -= MATINGENERGY;
M_result = 1;
}
Moo (Score:3, Funny)
I little supprised and impressed. (Score:2)
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.
what if???? (Score:2)
I would guess that most COBOL is written in-house. (Score:2)
This is great: finding algorithms (Score:3, Interesting)
I can't find any of the software with my name on it that's on SourceForge, though.
Example Hunting Made Easier (Score:2)
Impressive (Score:2)
577,000 (Score:2)
K&R vs. Alii (Score:3, Interesting)
Re: (Score:2)
I would have tried it anyhow, considering that it was cited in the article summary.
(Sorry couldn't resist) :-)
Re: (Score:2)
Re:I like this search better - fucking funny as (Score:4, Funny)
LOL your search has now uncovered the hidden angst of a million programmers :
Re: (Score:2)
Re:I like this search better - fucking funny as (Score:5, Interesting)
/usr/src/linux/arch/sparc/kernel/ptrace.c
But I also stumbled upon this little gem in
* 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?
Re: (Score:2)
*sob*
Re: (Score:2)
They also missed D [digitalmars.com], which I hope will became more popular.
Re: (Score:2)
Maybe SCO can use it to find the millions of lines of misappropriated code that "got lost" in Blepp's suitcase?
Re: (Score:2)
Sorta like your post.
Re: (Score:2)
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.
Re: (Score:2)
You need to escape your spaces, it considers them separate regexes otherwise:
"//\ ric"
Re: (Score:2)