然后我可以对数组中的列表循环调用该函数,输出每个函数的值,就像它是一个数字一样。
I could then iterate over the functions in the list, printing out the values for each as they were applied to a particular number. For instance, if I wrote the following snippet.
在每一个实例下,我运行一个简单的程序,测定循环调用一个方法10,000,000次所需的运行时间,我调用了同步和非同步两个版本,并比较了结果。
In each case, I ran a simple program that measured the run time of a loop calling a method 10,000,000 times, calling both a synchronized and an unsynchronized version, and compared the results.
当我们将循环转化为递归函数时,递归调用是函数所做的最后一件事情。
When we converted our loop to a recursive function, the recursive call was the last thing that the function did.
现在,可以调用这个方法并在循环的任意位置中断执行,这会捕获程序的状态。
You can now call this method and interrupt execution at any point of the loop, capturing the state of the program.
由于这个原因,在一个循环中使用太多函数调用不是个好主意。
For this reason, excessive function calls in a loop are generally a bad idea.
因此这种方法需要围绕该交互调用编写额外的循环代码,以备多次调用之需。
This approach, therefore, requires coding an extra loop around the interaction call just in case multiple calls are required.
循环中的最后一个调用,调用报告客户端,并告诉它将行值添加到表中。
The last call in the loop calls the report client and tells it to add your row values to the table.
在锁住信号量到释放信号量之间,要仔细考虑执行的代码量、执行的操作类型、发出的函数调用和循环次数。
After securing the lock, remain aware of the amount of code executed, the type of operations performed, the function calls made, and the amount of looping until releasing the lock.
这可以通过修改上述示例的循环来完成,以便调用活动直接调用外部服务,而不是调用事件处理程序。
This can be accomplished by modifying the loop of the example above so that the invoke activity invokes the external service immediately instead of invoking an event handler.
测试程序重复调用每种方法,使用一个大循环数,从而平均多次调用的时间衡量结果。
The test program calls each method repeatedly with a large loop count, averaging the time measurements over several calls.
优化应该主要针对程序中最经常运行的部分,尤其是被内部循环反复调用的函数。
The optimizations should be done on those parts of the program that are run the most, especially those methods which are called repeatedly by various inner loops that the program can have.
循环中应用程序负责反复调用解析器,直到文件结束。
It is the responsibility of the application to call the parser repetitively in a loop until the end of the document is reached.
要发送其余的商品,我们只需再重复一次循环即可,因为调用发送组件的活动在循环的开始处。
To ship the rest of the items, we just need to let the loop iterate again, since the activity that calls to the shipping component is at the start of the loop.
然后,for循环反复调用这个迭代器的. next方法,直到它遇到StopIteration异常为止。
The for loop then repeatedly calls the.next method of this iterator until it encounters a StopIteration exception.
Exporter类定义了两个方法:add(),接受要存储的对象,和exportAll(),循环通过已存储对象,以对每个对象调用export()。
The Exporter class defines two methods: add(), which accepts objects for storage, and exportAll(), which loops through the stored objects calling export() on each one.
unittest框架会在测试函数之间循环往复,先调用setUp、再测试函数、然后清除(tearDown)测试函数。
The unittest framework will cycle through the test functions, calling setUp, the test function, then tearDown for each test function.
主循环一直运行,直到用户关闭窗口,调用gtk_main _ quit时才结束。
The main loop runs until gtk_main_quit is called when the user closes the window.
在初始化两阶段提交循环之前,协调器调用Appl2的阶段0参与服务。
Before initiating the 2-phase-commit cycle, the coordinator calls the phase zero participant service of Appl2.
如果有多个响应,通过请求数组循环,为每一个调用dorpc函数。
If there are multiple requests, loop through the array of requests and call the doRpc function for each one.
在监视大量文件描述符时,如果在循环中调用poll ,poll所涉及的这些高成本的系统调用会严重影响总体性能。
If poll is called in a loop, these expensive system calls involved in polling can dramatically affect the overall performance when a large number of file descriptors are monitored.
在每一次循环中,receive方法会被调用。
在屏幕上显示窗口,应用程序调用gtk_main,激活主循环。
The window is displayed on the screen, and the application activates the main loop by calling gtk_main .
通常act方法包含一个无止境重复的循环,然后调用react(面向轻量级actor)或receive(面向仍然与其线程绑定的重量级actor)。
Typically, the act method contains a loop that will repeat forever and then calls either react (for a lightweight actor) or receive (for a heavyweight actor that remains bound to its thread).
它调用gtk_main _ quit例程以退出主循环。
It calls the gtk_main_quit routine that quits the main loop.
第三个for循环迭代通过调用string对象的lower方法返回的临时string。
The third for loop, however, iterates over a temporary string returned by a call to the string object's lower method.
它包含了一个嵌套的循环,该循环会调用exp 、cos以及sin,接下来是一个调用sin和sqrt的循环。
It contains a nested loop that calls exp , cos , and sin , followed by a loop that calls sin and SQRT .
这个Events树列出了所有的测试执行事件,比如脚本起始和终结、循环、调用、通知,或者结果。
The Events tree lists all test execution events, such as the script start and end, loop, invocation, message, or verdict.
内部循环将遍历每个媒体类型,然后调用callResource实用方法。
The inner loop goes through each media type and invokes the callResource utility method.
主循环进入无限循环,等候事件并调用回调,直到有人关闭窗口,调用 gtk_main_quit() 为止。
The main loop enters an indefinite loop, waiting for events and calling callbacks, until someone calls gtk_main_quit() by closing the window.
然后请注意,在循环体中,我使用callback来调用传递的参数函数对象。
Notice that then, in the body of the loop, I use callback to invoke the passed parameter function object.
应用推荐