For tasks that execute code in a loop, it is common to check for interruption only once per loop iteration.
对于执行一个循环中的代码的任务,通常只需为每一个循环迭代检查一次中断。
The loop in this sequence diagram USES a Boolean test to verify if the loop sequence should be run.
如果循环序列应该运行,这个序列图的循环使用一个布尔测试确认。
The advantages of adding a loop are that the loop is visible, and that you can control the rate of iterations through the loop if needed.
添加一个循环的好处在于循环是可见的,并且如果需要的话您可以通过循环控制迭代的速率。
Remember also that each iteration through the loop wastes time, so rather than working through the same loop a number of times, try to perform all the actions in one pass through the loop.
还要记住的是,在循环中,每次反复都是在浪费时间,因此不要多次使用相同的循环,而是要尽量在一个循环中执行所有的操作。
The loop I used here should be a minor defect, because any decent Just-in-time (JIT) compiler will perform loop unrolling, which lessens the impact.
这里使用的循环应该算是一个缺陷,但是影响不大,因为所有即时(JIT)编译器都会执行循环展开,这会降低循环的影响。
Some memory leaks occur due to program errors in which infinite loop in the application code allocates new objects and adds them to a data structure accessible from outside the program loop scope.
有些内存泄漏是由于程序错误发生的,在存在此类错误的情况下,应用程序代码中的无限循环会分配新的对象,并将其添加到可从程序循环范围外面访问的数据结构中。
The reasonable approach is to do the basic flow once, do a loop once, and then do a loop a second time.
最合理的方法是做一遍基本流程,一遍循环流程,然后再做一遍循环流程。
And what's this little loop say to do? This little loop says I'm going to write a function or procedures that takes in two messages.
这个小循环是做什么的,这个小的循环是,我要写一个函数或者过程来接受两条消息。
Your code should (almost) never have multiple nested loops (a loop inside a loop inside a loop). Most of the code written today should use Hashtables, simple lists and singly nested loops.
在编写代码时应尽量避免嵌套循环,目前大多数代码都是使用了哈希表、简单链表和单循环。
A while loop is a loop that repeats the included activities while some condition is satisfied.
一个while循环在满足一些条件的情况下,将重复所包含的活动。
You can place a print statement within the loop to verify that data indeed exists at each element in the foreach loop.
可以在循环中放一个print语句,检验在foreach循环中每个元素中是否确实存在数据。
A while loop will rarely include the number of iterations — unless it is a for loop in disguise.
while循环很少包含迭代次数——除非它是一个伪装的for循环。
That's why the main test method in Listing 1 USES a while loop instead of a new for loop.
这就是为什么清单1中的main测试方法使用while循环而不是一个新的for循环。
But if someone doesn't understand what a loop or a numeric operation does, the place to explain it isn't next to each loop, but in an "about loops" or "about operations" section of the book.
但是如果某人不知道一个循环或者一个数值运算是做什么的,注释的位置并不在这个循环或者运算的旁边,而是在本书的“about loops”或“aboutoperations”章节。
Most of the time, we just slap Iterator inside a for() loop or enhanced for() loop and move on, so to speak.
可以这么说,大部分时间我们只是将Iterator 随意放到for()循环或加强 for() 循环中,然后就继续其他操作了。
To summarize: use the enhanced for loop by default, but consider a hand-written counted loop for performance-critical ArrayList iteration.
结论:优先采用改进for循环,但在性能要求苛刻的ArrayList迭代中,考虑采用手写计数循环。
For a while loop, however, this means the code in the else clause is executed once, after the loop is terminated (see the pseudocode shown in Listing 7).
但是对于while循环,这意味着在循环终止后,else子句中的代码被执行一次(参见清单7中的伪代码)。
In this loop, a new PatientRecord is returned each time the loop is executed.
在该循环中,一个新的PatientRecord在每次执行循环时返回。
If you clicked + to expand a while loop, the editor showed just the contents of the while loop.
如果单击+以展开while循环,编辑器仅显示while循环的内容。
The main function creates a Glib event loop, gets a connection to the session bus, and integrates the D-BUS event handling into the Glib event loop.
main函数创建一个Glib事件循环,获得会话总线的一个连接,并将D -BUS事件处理集成到Glib事件循环之中。
It contains a nested loop that calls exp , cos , and sin , followed by a loop that calls sin and SQRT .
它包含了一个嵌套的循环,该循环会调用exp 、cos以及sin,接下来是一个调用sin和sqrt的循环。
Next, set up your test to loop through all of the data. The easiest way to do this is by adding a loop.
下一步,设置您的测试循环测试所有数据。
Some models are decomposed into multiple levels, such as a While loop within a local subprocess, within a While loop.
有些模型被分解为多个级别,例如While循环中的局部子流程中的While循环。
At the end of the day, you can implement the exact same program using a while loop that you can using a for loop, it's just your code is going to look slightly different.
最终,你可以执行这个程序,再使用for循环的地方使用while循环,这只是使你的代码看起来稍微有点不同。
Figure 6 shows a while loop (manufacturing loop) that iterates over each order, selecting the correct manufacturing plant and submitting each order to the selected manufacturing plant.
图6显示了一个while循环(ManufacturingLoop),迭代每个订单,选择正确的生产厂家并且将每个订单提交给所选的生产厂商。
The continue and break statements are used inside a while loop to continue with the next pass through the loop or break out of the loop, respectively.
continue和break语句分别用于在 while循环中继续下一次循环或中断循环。
So first time through the loop, the answer is a. Second time it-sorry, as it enters the loop, at the time it enter exits a the answer is a.
当第一次完成循环的时候,答案是a,第二次,对不起,在第一次进入循环的时候,答案就是。
The basic syntax of a for loop is shown in Listing 1, which also demonstrates how to use continue and break statements within a for loop.
清单1中显示了for循环的基本语法,还演示了如何在for循环中使用continue和break语句。
In cases where a break combination is part of an alternative or a loop, then only the alternative or loop is exited.
在这种情况下,跳转组合是变体或者循环的一部分,然后只是变体或循环被退出。
In cases where a break combination is part of an alternative or a loop, then only the alternative or loop is exited.
在这种情况下,跳转组合是变体或者循环的一部分,然后只是变体或循环被退出。
应用推荐