alfred 谷歌搜索代码_Google代码搜索-现在您可以搜索“浴室代码墙”

本文探讨了Google代码搜索的功能,包括语言检测的可能方法、相关性数据的调优需求,以及如何通过高级搜索技巧来筛选特定类型的代码。作者指出,尽管Google代码搜索能查找代码库,但在确定权威源代码位置方面还有待加强。此外,文章还提醒读者注意使用robots.txt阻止搜索引擎抓取不希望公开的代码。
摘要由CSDN通过智能技术生成
alfred 谷歌搜索代码

alfred 谷歌搜索代码

Everyone is agog about Google searching code.

每个人都对Google搜索代码感到不快

I find the language detection stuff to be really interesting. Are they using heuristics or just the file extension to figure out what language the code is? Probably extensions, but it'd be clever if they also used code keywords to guess.

我发现语言检测的东西真的很有趣。 他们是使用启发式方法还是仅使用文件扩展名来确定代码是什么语言? 可能是扩展名,但是如果他们也使用代码关键字进行猜测,那将是明智的选择。

One point that I think should be addressed by a future version is tuning of relevance data. If you search for DasBlog (not a really valid code search), you'll find folks that reference DasBlog libraries, and source inside ZIP files, but not the ACTUAL source at the ACTUAL location. It'd be nice to see them understand where the authoritative source of source is.

我认为将来的版本应该解决的一点是调整相关性数据。 如果您搜索DasBlog (不是真正有效的代码搜索),则会发现引用DasBlog库的人员,并且在ZIP文件中提供源代码,而在ACTUAL位置找不到ACTUAL源。 很高兴看到他们了解权威来源在哪里。

A few advanced tricks are:

一些高级技巧是:

  • Restrict search to "C"-based languages

    将搜索限制为基于“ C”的语言
    • lang:^(c|c#|c\+\+)$

      lang:^(c | c#| c \ + \ +)$

  • Avoid GPLed code

    避免使用GPL代码
    • -license:gpl

      -许可证:gpl

You can also include Google Code Search on your own side as a GDATA (~GoogleRSS) feed.  However, you can't restrict code searches by site using site: which is a bummer and limits its usefulness. I'd like to be able to have folks search for source on my blog.

您也可以自己将Google代码搜索作为GDATA(〜GoogleRSS)供稿添加。 但是,您不能使用site:限制按站点进行的代码搜索,这实在令人讨厌,并限制了其用途。 我希望能够让人们在我的博客上搜索来源。

Be sure to read their Google Code Search FAQ if you want to block them (robots.txt) from crawling your code.

如果您要阻止他们(robots.txt)抓取您的代码,请务必阅读其Google代码搜索常见问题解答

翻译自: https://www.hanselman.com/blog/google-code-search-now-you-can-search-the-bathroom-wall-of-code

alfred 谷歌搜索代码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值