摘要: 在 R12B 中,构造和匹配二进制型最自然的方式比前版中的要快得多。你可用如下简单的代码来构造一个二进制型:这么写(在 R12B 中)/求别这么写(在 R12B 之前的版本中)my_list_to_binary(List) -> my_list_to_binary(List, >).my_list_... 阅读全文
posted @ 2015-08-18 13:55 bigwhite 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1 puts "hello world" 2 3 "Hello, Ruby.".index("Ruby.") 4 5 x = 0 6 puts "bigwhite" while (x = x + 1) r14 puts "value is #{r} less" if x < r15 puts... 阅读全文
posted @ 2015-03-14 23:14 bigwhite 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2015-01-26 23:39 bigwhite 阅读(112) 评论(0) 推荐(0) 编辑
摘要: -module(demo).-compile(export_all).foo() -> receive after 100000 -> io:format("ok~n") end.main() -> register(name1, spawn(fun()... 阅读全文
posted @ 2015-01-23 22:26 bigwhite 阅读(291) 评论(0) 推荐(0) 编辑