Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
chenge
@chenge
Member
NO. 4215 / 2012-10-25

上海
425 Topics / 1790 Replies
51 Followers
95 Following
339 Favorites
遇见,Ruby 2005,Elixir 2016, Go、V 2021
GitHub Public Repos
  • simple-ruby-guide-zh 30

    Ruby简明入门和提高

  • NTT 1

    Kenneth E. Iverson, Notation as a Tool of Thought 中文翻译 - 1979 ACM Turing Award Lecture

  • kerkour.com 0

    Code accompanying my blog https://kerkour.com

  • gatsby-starter-blog 0

    Gatsby starter for creating a blog

  • chenge-blog 0

  • cgblog 0

  • now-github-starter 0

    Starter project to demonstrate a project whose pull requests get automatically deployed

  • chenge.github.io 0

  • gatsby-starter-default 0

  • slate 0

    Beautiful static documentation for your API

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 用 Clojure 写的女性包包的导购网站 (轻拍) at May 06, 2013

    clojure 是不是副作用少,bug 会比较少?

  • 用 Clojure 写的女性包包的导购网站 (轻拍) at May 06, 2013

    用的什么框架,有介绍么?

  • Ruby 里面 &:name 是什么意思? at May 06, 2013

    &表示 proc,也就是会 tags 元素的 name 方法,结果是 array。

  • 我想建立一个单词列表的模型,怎么定义?请大家给些建议 at May 06, 2013

    text 本身是比较大的吧。还有一个就是每个单词一个记录,纵向就没有限制了。

  • 真想抽 codeschool 的主持人 at May 06, 2013

    我觉得老外不好的不要学。ruby 是红宝石。传播正面的东西比较好吧。

  • Update to ubuntu 13.04 at May 06, 2013

    ubuntu 本身有中文版吧,应该有输入方法。另外还有个合作的中文 kylin 版。

  • 用 Clojure 写的女性包包的导购网站 (轻拍) at May 06, 2013

    clojure 比 rails 的开发效率如何?可介绍下么?

  • 我想建立一个单词列表的模型,怎么定义?请大家给些建议 at May 06, 2013

    #3 楼 @xiaoxia1992 不要用什么 eclipse,直接用命令行和 irb 还有,你这个不是楼主的问题吧,是不是搞错了。

  • 我想建立一个单词列表的模型,怎么定义?请大家给些建议 at May 05, 2013

    #1 楼 @xiaoxia1992 没报错啊

  • 契约式编程 DbC 的价值 at May 05, 2013

    #12 楼 @Rei 确实不能查出那个 hash 错误。不限于类型检查,也可以包括值检查。

    #13 楼 @bhuztez Ada 对这个是如何支持的?有什么大的应用么?

  • 契约式编程 DbC 的价值 at May 05, 2013

    #6 楼 @Rei #8 楼 @Tony612 不是静态,是运行时检查,比如你前不久的参数错误 hash={}就很容易发现。

    我修改了下例子,可以去掉那个参数检查,对比下出错提示,看哪一个更容易。

    #4 楼 @iBachue 具体怎么写,还需要考虑。可考虑选择性地写先验。

  • 类似两个 hash 应怎样合并? at May 04, 2013
    h1 = { "a" => 100,"b"=> 11 }
    h2 = { "b" => 99, "c" => 23 }
    
    resu = h1.merge h2
    
    resu.each_key do |x| 
        resu[x] = []
        resu[x] << (h1[x] || 0)
        resu[x] << (h2[x] || 0)
    end
    
    p resu
    
  • Ruby 的类变量 at May 04, 2013

    @@好像实现不好,不太推荐用这个。

  • 契约式编程 DbC 的价值 at May 04, 2013

    #1 楼 @wushexu Design by Contract

  • 代码优化 at May 03, 2013

    topics = [topic,topic1,topic2] redirect_to params[:rt] if topics.any?{|x| x.nil?}

  • 求帮助!!! at May 02, 2013

    http://guides.rubyonrails.org/, 是不是这个

  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #22 楼 @zw963 http://ruby-china.org/topics/7952

  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #18 楼 @jiyinyiyong

    埃拉托斯特尼筛法

    range = function(start, count, exp){
      if (!exp) exp = function(x) {return x};
      return Array.apply(null, {length: count}).map(function(_, i){
        return exp(i) + start;
      });
    };
    
    Array.prototype.last = function(){
        return this.slice(-1)[0];
    };
    
    p = console.log;
    n = 120;
    primes = range(2,n-2);
    
    index = 0;
    while(Math.pow(primes[index],2) <= primes.last()){
        prime = primes[index];
        primes = primes.filter(function(ele){ 
                    return ele == prime || ele % prime != 0;
            });
        index++;
    }
    p(primes);
    
    
    
  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #18 楼 @jiyinyiyong 明白了,参考《good parts》一书。谢谢你的代码,很有启发性。

  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #16 楼 @jiyinyiyong MDN:Apply, Calls a function with a given this value and arguments provided as an array (or an array like object).

    那个参数是 json object, 可以当数组么?

  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #12 楼 @jiyinyiyong Array.apply(null, {length: m}), 这个怎么理解。 p(Math.max.apply(null, [14, 35, -7, 46, 98])), 不要 this 是不是好一点?

  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #12 楼 @jiyinyiyong 就是那个 apply 比较费解一点,别的都还好。

  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #8 楼 @jiyinyiyong chrome 中测试那个 p 会报错?你是用什么测试的?

  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #8 楼 @jiyinyiyong range 有没有更好读的写法?

  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #4 楼 @jiyinyiyong 要不你开个头,写两条,我也献丑一下。

  • 邀请:10 行令你朋友惊讶的 Javascript 代码 at May 01, 2013

    #2 楼 @jiyinyiyong 我是觉得 js 至少还是需要的,这个是很好的学习方式吧。

  • 学习 Rails 的一点看法 at April 30, 2013

    1000.times{读书,编码,思考}

  • Matz:代码如散文——来自《代码之美》 at April 30, 2013

    #1 楼 @ericguo 那个是某人总结的吧。网上有全文英文版。

  • 求助,super 引发的对象销毁问题。 at April 30, 2013

    uri 来自 url 参数,是不是你的 url 在变啊?

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