摘要:Array 1. 数组定义:有序列,可容纳任意元素, 下标由0开始 1 array = [1, 'Bob', 4.33, 'another string'] 2 puts array.first #=>1 3 p array.last #=>another string 4 p array[2] #
阅读全文
摘要:Part III Distributed Message Queues Part III breaks from this "traditional" approach of distributed computing and looks at distributed message queues.
阅读全文
摘要:Chapter4: Starfish (海星?)这样的例子有时间换linux的环境试一下吧 Starfish1 bills itself as “a utility to make distributed programming ridiculously easy.” I think that is
阅读全文
摘要:http://ruby-doc.org/stdlib-2.3.3/libdoc/optparse/rdoc/OptionParser.html#method-c-new 阅读lib的文档,做个笔记。OptionParser 这个类用于,在写一些command line工具的时候,设置命令行参数选项。
阅读全文
摘要:定义很简单:实例变量@开头,类变量@@开头 不同的子类都共享这个一个数值,包括子类的实例,都可以来修改这一个值。就理解成:不管自己还是子类的,什么函数都可以访问,也都可以改,改了之后也是大家共享。 实例变量不能被类实例方法访问。 1 class Test 2 @@class_var = 10 3 @
阅读全文
摘要:前言: 那么,互联网时代的C语言需要考虑哪些关键问题呢? 首先,并行与分布式支持。多核化和集群化是互联网时代的典型特征。作为一个互联网时代 的C语言,必须要让这门语言操作多核计算机与计算机集群如同操作单机一样容易。 其次,软件工程支持。工程规模不断扩大是产业发展的必然趋势。单机时代语言可以只关心问题
阅读全文
摘要:Part II Third-Party Frameworks and Libraries The first part of this book takes a deep dive into two main libraries: DRb and Rinda Chapter3: RingyDingy
阅读全文
摘要:Callbacks and Observers Callbacks and observers: They are a universal design pattern that allows a system to wait for another system or process to tel
阅读全文
摘要:Chapter2: Rinda Including 7 parts: "Hello World" the Rinda Way Understanding Tuples and TupleSpaces Callbacks and Observers Security with Rinda Renewi
阅读全文
摘要:着急用所以直接扒了一个C++算法翻译成了ruby…暂记
阅读全文
摘要:yield关键字我是这样理解,用它来占一个位置,先标记下这个地方将来要写代码的,等到调用的时候,再来编写具体的代码。有点像函数指针,或者C#里的委托,但其实并不太一样。 写测试接口的时候,每次的assert返回值不一样,但函数体大部分是相同的,只有参数不同。正好最近看到了yield,就熟悉一下用法,
阅读全文
摘要:Security Although DRb provide some security, they fall short of a full, comprehensive solution. This can make DRb less than desirable in a lot of real
阅读全文