Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
lingjie fan
@flingjie
Member
NO. 12242 / 2014-03-25

[email protected]
上海
14 Topics / 23 Replies
2 Followers
0 Following
5 Favorites
GitHub Public Repos
  • LinguaMate 0

  • trafilatura 0

    Python & Command-line tool to gather text and metadata on the Web: Crawling, scraping, extraction...

  • tiny-grpo 0

    Minimal hackable GRPO implementation

  • developer-content 0

    Collection of Developer content for exploring, learning, and building in the Solana ecosystem.

  • lambdaclass_hacking_le... 0

    LambdaClass Hobby Club, hacking learning path handbook. The journey starts here!

  • FutureDiary 0

  • tfhe-rs 0

    TFHE-rs: A Pure Rust implementation of the TFHE Scheme for Boolean and Integer Arithmetics Over E...

  • AI-Projects-for-Health... 0

    This repository is included artificial intelligence, machine learning, data science, computer vis...

  • MindSearch 0

    🔍 An LLM-based Multi-agent Framework of Web Search Engine (like Perplexity.ai Pro and SearchGPT)

  • awesome-indie-hacker-t... 0

    独立开发/出海开发相关技术栈及工具收录 / Find the best tools for indie hackers here

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • [上海][2014年7月20日] 2014 年 7 月 周末聚会 (需报名) at July 12, 2014

    报名

  • [世界杯完美装 B 指南] at June 15, 2014

    传说中的胸器!

  • [上海][2014年6月17日] 周中聚会 at June 09, 2014

    必须去😃

  • 通过 Amazon S3 使用 google at June 03, 2014

    最近访问特别慢,比以前

  • [求助] 有段代码不太理解,求高手指点 at May 28, 2014

    @neverlandxy_naix @dddd1919 多谢!

    搞清楚了,在 Blog 中初始化的

      ...
      def new_post(*args)
        post_source.call(*args).tap do |p|
          p.blog = self
        end
      end
      def post_source
        @post_source ||= Post.public_method(:new)
      end
      ...
    end
    

    还有个疑问,上面的 blog.add_entry(self) 没有@符号? 是不是这里使用的不是实例变量,而是一个方法?

  • Ruby 的机器学习例子 at May 19, 2014

    分享下一本免费书《Clever Algorithms》,书中涉及了很多智能算法,例子用 ruby 实现,http://www.cleveralgorithms.com/nature-inspired/index.html, 不过,个人觉得机器学习还是用 python 和 R 比较方便。

  • 技术熟悉度与城市居住者 at May 08, 2014

    积累中的人飘过...

  • <Ruby 元编程>思维导图 1 at May 06, 2014

    @Peter 已附上 @kewin 使用 XMind http://www.xmind.net/ @subway 是的,我自己也不太满意,无奈暂时还没有更好的灵感。 源文件已附上,求改进美化

  • <Ruby 元编程> 思维导图 4 (代码块) at May 06, 2014

    @chenge 3 我觉得是迭代字符串,不知这个描述是否准确? 5 我也是在查找块资料是发现的。这里再参考别人的代码对比下

    # 1.9之前
    current = "2012"
    1.upto(10) do |i|
      current = i
      succ = current + 1
      print "#{current}, #{succ}"
    end
    print current #=> 10
    
    # 1.9以后
    current = "2012"
    1.upto(10) do |i ;current|
      current = i
      succ = current + 1
      print "#{current}, #{succ}"
    end
    puts current #=> 2012
    
    

    Block variable scope in Ruby is pretty intuitive – especially for those of us who are familiar with similar functionality in JavaScript. The newer block-local functionality in Ruby 1.9 is nice, but it’s only going to be useful in some niche scenarios. I would rather use more descriptive variable names to avoid overriding variables by accident. 原文http://www.jacopretorius.net/2012/01/block-variable-scope-in-ruby.html

  • <Ruby 元编程> 思维导图 4 (代码块) at May 05, 2014

    @chenge 谢谢,我也觉得块是最酷的特性之一,另外,新补充了块的使用,欢迎指点

  • <Ruby 元编程>思维导图 3 (方法) at May 05, 2014

    @sjzg001 本章重点不是 ruby 中方法的一般特性和使用,主要讲有关代码重构的技术。通过 ruby 的特性消除重复代码,使代码简洁,遵循 DRY(Don‘t repeat yourself) 原则,提高可维护性。

  • <Ruby 元编程>思维导图 3 (方法) at May 05, 2014

    @sjzg001 自觉对本章内容理解把握的不够透彻,自身复制粘贴了部分内容,可能没把重点和思路表达清楚。不知哪里困扰在何处,哪里不懂?请反馈以求共同进步

  • <Ruby 元编程> 思维导图 4 (代码块) at May 05, 2014

    @sunday35034 thx,已修正。

  • <Ruby 元编程>思维导图 3 (方法) at May 05, 2014

    @alixiaomiao 多谢指正,笔误 method_mission 已修改,模块不存在实例,但其中定义的方法也叫实例方法吧

  • <Ruby 元编程>思维导图 1 at May 04, 2014

    是的,鱼骨头,只是这条鱼太胖了😓

  • <Ruby 元编程>思维导图 2 (对象模型) at May 04, 2014

    @hntee 我用的是 xmind

  • 再回顾一遍 Ruby Gotchas at April 30, 2014

    mark,谢分享

  • Ruby 中的 clone 和 dup 比较 at April 30, 2014

    谢赞 ^_^ @leozwa 多谢补充,学习了 @realwol 只是将学习过程中的一些问题分享下

  • [上海][2014年4月27日] 2014 年 4 月 周末聚会 (需报名) at April 23, 2014

    @lazy 方式是很多,都要靠时间积累才有明显成效。现在有空还去跑跑步,其他的都持续不了多久,贵在坚持!是不是程序员都有懒惰的天性

  • Ruby 实现的简易推荐系统 (译) at March 28, 2014

    看到过一个叫 nlpir 的东东,用于中文分词的

  • Ruby 实现的简易推荐系统 (译) at March 27, 2014

    不久前在 hacker news 上看到原文,这么快就看到译文了,good job!

  • 技术货: 讲讲 Ruby 中纯数据结构 ( Struct 与 OpenStruct ) at March 25, 2014

    Struct , OpenStruct, Hash 各自适用场合 Use Struct if 1.you need a data container and fields are fixed and known beforehand (i.e. at time of writing of the code), 2.you need a structured Hash key, 3.you want to quickly define a class with a few fields, 4.you need to detect errors caused by misspelled field names.

    Use OpenStruct if 1.the number of fields is fixed at runtime but varies frequently during development time (this is often the case for objects that should hold the result of command line option parsing), 2.you need a mock or a want to quickly have objects at hand which can be filled via usual attribute setters and getters. You might want to replaced with a proper class (or Struct) later — with explicit attribute declarations via attr_accessor and relatives.

    Use Hash if 1.the number of fields is unknown at coding time, 2.there is a potentially unlimited number of fields (e.g. when reading key values from a file as is often the case for script based text processing). 原文http://blog.rubybestpractices.com/posts/rklemme/017-Struct.html

  • 技术货: 讲讲 Ruby 中纯数据结构 ( Struct 与 OpenStruct ) at March 25, 2014

    good job, 多谢分享! c 中的 Struct 比较简单,不支持方法,Struct 更像是 C++ 中的 struct

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