在清单9中,定义了一个没有参数的简单函数。
In Listing 9, I define a simple function that takes no parameters.
为何?简单函数促进代码重用。
表达式闭包是定义简单函数的一种便捷方式,用来模仿lambda符号。
Expression closures are a shorthand method of defining simple functions that mimics lambda notation.
函数matrix 、array和dim是用于设置向量的维的简单函数。
The functions matrix , array , and dim are simply convenience functions for setting the dimensions of a vector.
简单函数更易于测试,特别是当它们只做一件事,只为一个目的服务时。
Small functions are easier to test, especially when they do one thing and serve one purpose.
为何?简单函数更易于测试,特别是当它们只做一件事,只为一个目的服务时。
Why? Small functions are easier to test, especially when they do one thing and serve one purpose.
现在,您可以定义一个简单函数,其用途只是告诉您它所拥有的参数数量并显示这些参数,如清单1所示。
Now you can define a simple function to do nothing more than tell you how many parameters it has and display them as shown in Listing 1.
业务事务很像是调用应用程序的简单函数,但是它们可能是作为自己的事务的上下文所包含的复合函数来实现的。
Business transactions might seem like a simple function to the invoking application, but they might be implemented as composite functions covered by their own transactional context.
这个简单函数创建了一个表格节点,然后循环访问书的列表并为每本书创建一行,为每个数据元素分配一个单元格。
This simple function creates a table node, then iterates through the book list and creates a row for each book, with a cell for each data element.
当解析器读写大型文件(特别是文本格式的大型文件)时,并不能达到其读取较小的文件或计算简单函数时的性能。
They don't work as well with reading large files, particularly in text format, as they do with reading much smaller files or calculating simple functions.
只需使用exit_msg这样的简单函数和几个逻辑操作符,这个脚本就可以简化成更漂亮更容易理解的程序,见清单14。
By using a simple function like exit_msg and a few logical operators, the script could be condensed into the better-looking and easier-to-understand program shown in Listing 14.
正如在第一篇文章中看到的,py . test和nose都支持编写为简单函数的测试,这会大大简化python测试的编写。
As you saw in the first article, both py.test and nose have made tests in Python vastly easier to write by supporting tests that are written as simple functions, like.
在这个例子中的屏蔽使用Optim内部的一个简单函数(substring),但是仅当这些文件带有关系表时才可以使用完整的屏蔽功能。
The masking in this case is using one of the simpler functions within Optim (substring), but the entire set of masking functionality is available for these files just as it is with relational tables.
本例只存储字符串数据,所以您可以简单地将之附加到一个较长的字符串后面,并调用Calculator Handler中的一个简单函数,然后该函数可以将之解析出来。
This example is only storing string data, so arguably you can simply append it to a longer string and call a simple function in the CalculatorHandler, which in turn can parse it out.
这个简单的函数接受任何变量,并将它显示在屏幕上。
This simple function takes in any variable and displays it to the screen.
不过,虽然我认为预定的索引很酷,但这个简单的函数并没有费心去实现它。
However, even though I recognize the coolness of predictive indexing, my simple function does not bother implementing it.
不幸的是,没有按名称排列的简单的函数清单,文档是按主题排列的。
Unfortunately, there is no simple listing of functions by name; instead the document is arranged by topic.
接下来,创建一个简单的函数来阻止搜索表单表现得像典型的表单那样。
Next, create a simple function that prevents your search form from acting like a typical form.
通过简单的函数调用和流程代理程序,交易服务允许一个游戏去把流程代理程序和电子商务存储提供的控制集成到游戏环境中。
The commerce service allows a game to integrate the content and control provided by the e-commerce store into the game environment through simple function calls and the Process Broker.
这就告诉我们,对室外温度来说,时间的简单线性函数是一个非常不好的模型。
This tells us that a simple linear function of time is an extremely bad model for outside temperature.
这些特性中很多只是简单的工具函数;几乎所有特性原则上都可以在轻便的代码中完成,但有很多是特别难的。
Many of these features are simple utility functions; almost all of them could in principle be done in portable code, but many of them would be exceedingly difficult.
它还添加了第五种类型——结果树片段,但在简单的扩展函数中很少用到。
It also adds a fifth result-tree fragment type, but that rarely comes into play in simple extension functions.
该函数简单检查地址可能是在用户空间,而不是内核。
This function simply checks that the address is likely in user space, not in the kernel.
为了测试这个简单的函数,还需要添加另外两个PHP文件。
To test this simple function, you need to add two more PHP files to the mix.
在大多数情况下,简单的测试函数对测试代码来说已经足够了。
In most cases, simple test functions are more than adequate for testing code.
如果使用JSON,只需调用一个简单的函数,就可以获得经过格式化的数据,可以直接使用了。
With JSON, you call a simple function and get your data, formatted and ready for use.
但是实际上,可以用很简单的包装器函数轻松地实现基于继承的MRO。
In point of fact, you can perfectly easily implement inheritance-based MROs with a minimal wrapper functions.
现在可以创建一个简单的搜索函数,它可以接收搜索项,输出VXML以列出搜索结果。
Now, you can put together a simple search function that will take a search term and output the VXML required to list the results found.
就CFS部分而言,调度函数非常简单。
The scheduling function is quite simple when it comes to the CFS portion.
因为如果不注册该函数,它只是可供包含它的本php页面或其他php页面调用的简单php函数。
Because if you don't register the function, it is a simple PHP function that is available only to this PHP page or other PHP pages that include this one.
应用推荐