The ampersand identifies the parameter as the holder of a code block.
该符号将参数识别为代码块的持有者。
Ruby calls the code block in braces, passing in a continuation object.
Ruby调用花括号中的代码块,同时传递一个延续对象。
The method takes a string parameter, enclosed in quotes, and a code block.
该方法具有一个使用引号括起来的字符串参数和一个代码块。
The controller can specify a code block for each type the controller expects.
控制器可以为控制器期望的每个类型指定一个代码块。
The next line starts a code block that dictates what happens when each client connects.
下一行开始一个代码块,规定当每个客户端连接时要做的事情。
Consult the next section for the code block that sets each frame when the mouse is down.
参考下一节中的代码块,它会在鼠标按下时设置各帧。
That code block does nothing but increment the value of the local variable and return it.
代码段做的事就是增加本地变量的值并返回。
Comments in the code block above indicate the points at which these actions are performed.
代码块上的注释指明了在哪里这些操作会被执行。
In cases where synchronization is necessary, the synchronized code block should be minimized.
在有必要进行同步的场合下,应该尽量缩小同步代码块。
Think of a closure as a code block that you can use as an argument, with special scoping rules.
闭包可被视作一个遵循特别作用域规则且可以用作参数的代码块。
The method executes the code block using the instance_eval method, one of the built-in methods in Ruby.
使用instance_eval方法可使该方法执行代码块,这是Ruby中的内置方法之一。
The Groovy version of filter() is findAll(), which accepts a code block specifying your filter criteria.
Groovy版本的filter()是findAll(),它可接受一个指明过滤条件的代码块。
Within the code block, the delegate keyword refers to the instance of the class you are adding methods to.
在代码块中,delegate关键字指向您将要向其中添加方法的类的实例。
This synchronized code block acquires the lock associated with the customer class object before it executes.
同步的代码块在执行之前需要与客户类对象相关的锁。
The longer a synchronized code block requires for execution, the longer other threads wait to enter that block.
同步代码块所需的执行时间越长,其他线程等待进入该代码块的时间就越长。
The volume code block in Listing 5 computes the cubic volume of a rectangular solid using the well-known formula.
清单5中的volume代码块使用常用公式计算长方体的体积。
A wants method executes the corresponding code block if the method name matches the type in the HTTP Accept header.
如果方法名称与HTTPAccept头中的类型匹配,wants方法执行对应的代码块。
A code block is simply a block of code that returns a value, and if no value is returned then a NULL object is returned.
代码块就是将返回一个值的一组代码,如果没有返回值,那么会返回一个NULL对象。
Note that I used the general phrase code block, which can refer not only to entire methods, but even to blocks within a method.
注意,我在这里使用了一个一般性短语 “代码块(code block)”,这不仅仅可以指完整的方法,还可以指一个方法中的块。
It is crucial to accurately identify which code block truly needs to be synchronized and to synchronize as little as possible.
准确地识别哪些代码真正需要同步并尽可能少地进行同步,这非常重要。
Thus, you can iterate over a collection quite easily using the each method in conjunction with a code block, as shown in Listing 1.
这样,您可以使用each方法和代码块在集合中轻松迭代,如清单1所示。
This listing illustrates an internal iterator (also known as a push iterator because it pushes each element in turn to the code block).
该清单展示了内部迭代器(也称为push迭代器,因为它将每个元素依次推到代码块中)。
Code block: it allows you to format text as code blocks. Simple select the text and format it by clicking the "code block" ToolBar button.
代码块:这个编辑器允许你把文本格式化为代码块,只要简单地选中文本,然后点击“代码块”按钮来进行格式化即可。
The RSpec descriptions go in a describe method, and you pass in the name of the class under test and a code block that has the actual spec.
describe方法提供了RSpec描述,您将传入测试类的名称和包含实际规范的代码块。
The second code block (lines 6-7) just passes the root element of the document off to the recursive modification method I'll get to in a moment.
第二个代码块(第6 -7行)只是将文档的根元素传递给我马上要谈到的递归修改方法。
One solution is to prepare a CDATA section, as in Listing 3, for the code block and just paste into that so that you don't need further escaping.
一种解决方案是使用CDATA部分,如清单3 所示,将代码直接粘贴到这个代码块,这样就不需要进行进一步的转义了。
In the first code block I looked at all the binding templates referenced by the business service and found the one which had a URL type of "HTTP".
我在第一个代码块中查看业务服务引用的所有绑定模板,并找到具有“http”url类型的绑定模板。
The method takes a parameter, specifying the length of the timeout, and a code block, specifying which content to rebuild when the content expires.
此方法接受参数,用来指定超时的时长,它还接受一个代码块,用来指定当内容过期时哪些内容需要重建。
You can use the latter two where the one function or element given as the argument is the only feature in the code block that might not be supported.
如果作为参数给出的函数或者元素是代码块中惟一可能不受支持的特性,可选择后两种形式。
In others, the side-effects can cause serious threading issues or race conditions (where multiple threads compete for the execution of a code block).
而在其他情况下,副作用可能造成严重的线程问题或争用情况(此时多个线程竞争执行一个代码块)。
应用推荐