07 2017 档案
erlang尾递归练习
摘要:1 %%计算链表长度尾递归实现 2 lez(N) -> lez(N, 0). 3 4 lez([], Acc) -> Acc; 5 lez([_ | T], Acc) -> lez(T, Acc + 1). 6 %% 将某个元素重复n次返回一个链表 dulicate(0,_) ->[]; dulic 阅读全文
posted @ 2017-07-27 14:04 c3tc3tc3t 阅读(459) 评论(0) 推荐(0)
elixir中的truth和true
摘要:在elixir中, true 就是true 或者是:true 是一个原子 atom, 在其他语言中的true,这里叫做truth, 只要你不是false,nil ,就是truth, 当然 false和nil也是原子 所以说elixir中Boolean operators 是针对true a or b 阅读全文
posted @ 2017-07-26 23:51 c3tc3tc3t 阅读(861) 评论(0) 推荐(0)
Rails 中 mattr_accessor 一处文档错误
摘要:http://xiewenwei.github.io/blog/2015/01/11/mattr-accessor-in-ruby-on-rails-activesupport/ 阅读全文
posted @ 2017-07-18 15:23 c3tc3tc3t 阅读(322) 评论(0) 推荐(0)
Class and Instance Variables In Ruby
摘要:https://github.com/unixc3t/mydoc/blob/master/blog/caiv.md 阅读全文
posted @ 2017-07-18 15:05 c3tc3tc3t 阅读(135) 评论(0) 推荐(0)
《Crafting Rails 4 Applications》的笔记-第28页
摘要:进行邮件测试,你需要在dummy目录下的虚拟程序添加一个配置 In your config/enviroments/test.rb, by default you should have the line config.action_mailer.delivery_method = :test fr 阅读全文
posted @ 2017-07-05 15:25 c3tc3tc3t 阅读(136) 评论(0) 推荐(0)