Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Hooopo
@hooopo
管理员
第 8 位会员 / 2011-10-28

[email protected]
nil
北京
160 篇帖子 / 3013 条回帖
360 关注者
0 正在关注
74 收藏
聪明的妖怪录下了唐僧的紧箍咒
打赏作者
GitHub Public Repos
  • oh-my-github-circles 47

    GitHub User Circle Generator Using GitHub Actions

  • hackernews-insight 21

    Hackernews Insight using TiDB Cloud

  • repo-track-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any repository to your da...

  • oh-my-github-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any github user to your d...

  • chatgpt-xiaoai 3

    小爱音箱集成LLM,SaaS 服务

  • repo-contributor-circles 1

    GitHub repo contributor circles generator.

  • ossinsight-x 1

    Automatically post trending repos to Twitter every day.

  • mi-service 1

    XiaoMi Cloud Service for mi.com

  • hooopo 0

  • streamlit-echarts-demo 0

    Demo for Streamlit ECharts component

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Ruby2.0 的第一个应用 at 2012年11月08日

    好玩吧 #5 楼 @metal 被你发现了?

  • Ruby2.0 的第一个应用 at 2012年11月08日

    #3 楼 @ywencn 不是吧 再试试

  • Ruby2.0 的第一个应用 at 2012年11月08日

    好玩吧

  • List to Regexp at 2012年11月07日

    #10 楼 @luikore 哇..

  • Run Ruby2.0 App On Heroku at 2012年11月06日

    #1 楼 @yorzi 我这里访问没报错~好奇怪?_?

  • 老赵同学的一道编程题 at 2012年11月06日

    #13 楼 @luikore 刚才用 Heroku 上的 Ruby2.0 跑了一下。。结果上面的应用运行不起来了~ http://blog.heroku.com/archives/2012/11/5/ruby-2-preview-on-heroku/

  • 老赵同学的一道编程题 at 2012年11月06日

    #10 楼 @luikore Ruby2.0?1.9 和 1.8 上都报错........

  • 这种类型的"Missing template "大家怎么处理 at 2012年11月06日

    #5 楼 @knwang 都说是 500 了..

  • List to Regexp at 2012年11月06日

    #4 楼 @quakewang 不是。哦,好像和高亮一样..

    #5 楼 @bhuztez 没说比 Trie 快,貌似提到正则更灵活,并且也不慢。 还有即使用 Perl 实现的 trie 和正则从算法复杂度是一样,正则引擎是 c 实现的,速度应该也会有差异。 所以我才想用实际数据测试一下:-)

  • List to Regexp at 2012年11月06日

    #2 楼 @luikore 我是看 http://book.douban.com/subject/6758780/ 这本书里讲他们用来处理关键字链接,就是有一组关键词对全文做 autolink,大概是blog.body.gsub(/(key1|key2...)/, "<a href='...'>\\1</a>")

    场景应该是关键词短,但数量多,文章长。

    据说他们从Regexp union -> Aho-Corasick算法的Trie树-> Perl 的Regexp::List

  • URL shortner at 2012年11月03日

    #2 楼 @jasl 碰撞没关系,find/uniq 的时候只起到一个索引作用,减少比较的范围

    PS.目测楼主生成的是 6 位字符串,crc32 生成的是 8 位,楼主的应该碰撞高一些才是。。

  • URL shortner at 2012年11月03日

    大量网址 find 和 uniq 用CRC32多好啊

  • /lib、/lib/**/ 两个路径有什么差别 at 2012年11月03日

    都不看文档哇....... http://ruby-doc.org/core-1.9.3/Dir.html#method-c-glob

    glob( pattern, [flags] ) {| filename | block } → nil

    Returns the filenames found by expanding pattern which is an Array of the patterns or the pattern String, either as an array or as parameters to the block. Note that this pattern is not a regexp (it’s closer to a shell glob). See File::fnmatch for the meaning of the flags parameter. Note that case sensitivity depends on your system (so File::FNM_CASEFOLD is ignored), as does the order in which the results are returned.

    *

    Matches any file. Can be restricted by other values in the glob. * will match all files; c* will match all files beginning with c; c will match all files ending with c; and *c will match all files that have c in them (including at the beginning or end). Equivalent to / .* /x in regexp. Note, this will not match Unix-like hidden files (dotfiles). In order to include those in the match results, you must use something like “{,.}”.

    **

    Matches directories recursively.

    ?

    Matches any one character. Equivalent to /.{1}/ in regexp.

    [set]

    Matches any one character in set. Behaves exactly like character sets in Regexp, including set negation ([^a-z]).

    {p,q}

    Matches either literal p or literal q. Matching literals may be more than one character in length. More than two literals may be specified. Equivalent to pattern alternation in regexp.

    \

    Escapes the next metacharacter. Note that this means you cannot use backslash in windows as part of a glob, i.e. Dir will not work use Dir instead

    Dir["config.?"]                     #=> ["config.h"]
    Dir.glob("config.?")                #=> ["config.h"]
    Dir.glob("*.[a-z][a-z]")            #=> ["main.rb"]
    Dir.glob("*.[^r]*")                 #=> ["config.h"]
    Dir.glob("*.{rb,h}")                #=> ["main.rb", "config.h"]
    Dir.glob("*")                       #=> ["config.h", "main.rb"]
    Dir.glob("*", File::FNM_DOTMATCH)   #=> [".", "..", "config.h", "main.rb"]
    
    rbfiles = File.join("**", "*.rb")
    Dir.glob(rbfiles)                   #=> ["main.rb",
                                        #    "lib/song.rb",
                                        #    "lib/song/karaoke.rb"]
    libdirs = File.join("**", "lib")
    Dir.glob(libdirs)                   #=> ["lib"]
    
    librbfiles = File.join("**", "lib", "**", "*.rb")
    Dir.glob(librbfiles)                #=> ["lib/song.rb",
                                        #    "lib/song/karaoke.rb"]
    
    librbfiles = File.join("**", "lib", "*.rb")
    Dir.glob(librbfiles)                #=> ["lib/song.rb"]
    
  • 解决可恶的双重提交问题 (jQuery) at 2012年11月03日

    太聪明了 #1 楼 @ywencn

  • [北京] 创业公司招聘志同道合的 RoR 高级工程师 at 2012年11月01日

    #7 楼 @ruuuby 2 年多了..

  • Happycasts: Chrome Devtools 贴心技巧总结 at 2012年10月31日

    现在怎么都流行视频了?文字版多好啊 啊啊

    android --just a seo test...

  • 国内编程语言统计 at 2012年10月31日

    有三种谎言:谎言,该死的谎言和统计

  • Hackers and Painters at 2012年10月31日

    好吧 那就是我脑补的...

  • Hackers and Painters at 2012年10月31日

    路过 楼主的头像表情像是坐在马桶上...........

  • Rails 4 台风即将来袭,请查看安全手册 at 2012年10月26日

    #19 楼 @quakewang referer 似乎不是问题,像 pjax 那样手动触发 ga 接口就可以:https://github.com/defunkt/jquery-pjax/blob/master/jquery.pjax.js#L257

    turbolink 可以在 page:change 事件里加,刚才查了一下 ga 也提供重载 referer 的接口:

    _gaq.push(['_setReferrerOverride', "referer_url"]);
     _gaq.push(['_trackPageview']);
    

    https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking?hl=en#_gat.GA_Tracker_._setReferrerOverride

  • Rails 4 台风即将来袭,请查看安全手册 at 2012年10月26日

    #19 楼 @quakewang 还真是的,是不是所有 ajax 请求都存在 referer 不正确这个问题?

  • Rails 4 台风即将来袭,请查看安全手册 at 2012年10月26日

    #17 楼 @quakewang referer 是设置的呀:https://github.com/rails/turbolinks/blob/master/lib/assets/javascripts/turbolinks.js.coffee#L23

    锚点也是有处理的:https://github.com/rails/turbolinks/blob/master/lib/assets/javascripts/turbolinks.js.coffee#L173

  • Rails 4 台风即将来袭,请查看安全手册 at 2012年10月26日

    #14 楼 @xds2000 turbolink 主要是减少 js 的重复执行时间,对于高配置的机器/高效率的浏览器来说,turbolink 带来的提升就越少。 turbolinks 的 readme 里把

    In any case, the benefit ranges from twice as fast on apps with little JS/CSS, to three times as fast in apps with lots of it.
    

    这句话链接到了 turblinks test 页面,但是和 turblinks_test 的结果不符合啊。。。这两倍是怎么算的?

    还有,这个测试没提到是否使用了 web server。。。如果没有的话也不合理,因为实际环境静态文件会有 expires 头,不会进行条件 GET,而这个测试环境每次请求都要进行一次条件 GET 吧?

  • 大家是怎么管理你们的 js 的? at 2012年10月25日

    #2 楼 @QueXuQ 这个问题很复杂。解决方案也很多。最简单的办法就是在浏览器 onload 事件完成后再触发你的函数。

    <script>
     function xx(){}
     document.onload = xx;
    </script>
    
  • 大家是怎么管理你们的 js 的? at 2012年10月25日

    没看懂

  • 擦,姐生气了,要学 ruby!自己改网站 at 2012年10月24日

    ...

  • 发现一个 clone PHP similar_text 的组件。 at 2012年10月23日

    phash 算法还可以计算非文本的相似度: http://rubylution.herokuapp.com/topics/15

  • nokogiri 如何解析这样的片段 at 2012年10月23日

    #1 楼 @ywencn 用 Nokogiri 很简单啊

  • 想请问下这次 RubyConfChina 的门票订购是不是用的快钱? at 2012年10月23日

    赞 OpenSource 的方式 !

  • 为什么要嵌套 Cache at 2012年10月22日

    #6 楼 @tumayun 未过期不能命中?没理解你说的过期和命中分别代表什么

  • 上一页
  • 1
  • 2
  • …
  • 71
  • 72
  • 73
  • 74
  • 75
  • …
  • 108
  • 109
  • 下一页
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English