在本例中,我用下面所示的代码使这条直线围绕动画的中心旋转。
In this case, I rotate the line around the center of the movie with the code shown below.
为什么呢?因为该代码块指定了在测试正确的情况下,我将进行的一系列操作。
Why? Because that block identifies a set of things that I'm going to do if the test is true.
在本例中,我使用PHP代码创建了一系列标记—一个标记用于表格中的一个页面。
In this case, I use the PHP code to create a series of tags-one for each page in the table.
我在脚本元素的代码生成主题中对此进行了说明。
I describe this in the Code generation for scripting elements topic.
出于完整性起见,我在代码中包含了设置这个特性,但是更普遍的是将它设置成一个JVM命令行参数。
I included setting this property in the code for completeness, but it would more commonly be set as a JVM command-line parameter.
这里的区别是,在使用位置增加代码让我有了灵活性。
The difference here is that by adding the code at the point of use, I gain flexibility.
在本文中,我通过示例代码解释了概念。
Throughout the article, I provided sample code to illustrate concepts.
不幸的是,抽象是有漏洞的:例如,在我的ZIP代码验证器中,本想使用正则表达式执行检测。
Unfortunately, the abstraction is leaky: in my ZIP code validator, for example, I would have liked to use regular expressions to perform the check.
这些步骤还能使我在开发期间跟踪代码覆盖情况,从而构建更加丰富的规范。
The small steps also let me keep up with my code coverage as I develop, and build a richer specification.
我在代码中加了很多注释,突出说明了使用EXSLT的位置,以及其他有用注释。
I've heavily commented the code, highlighting where I use EXSLT, as well as other useful notes.
清单7中的代码在我的配置上的执行时间是总是4.91秒。
I consistently find that the code in Listing 7 executes in 4.91 seconds on my configuration.
那是因为我将代码改为在构造函数中添加1和数字本身。
Ah, that's because I changed my code to add 1 and the number in the constructor.
在本文中,我演示了如何编写代码来创建X - Y坐标图和线形图。
In this article, I demonstrate how to write code to create an X-Y plot or line graph.
在页面代码中,我还可以使用XML响应,因为服务器返回的是有效的XML。
In the page code, I could have used the XML response, as the material returned from the server is valid XML.
通过几行代码,我在云中创建了一个安全资产,该资产只能通过特殊的URL下载。
With a few lines of code, I've created a secure asset in the cloud that can only be downloaded with a special URL.
但是,在深入代码之前,我将描述几个通过ZK生成的用户界面屏幕。
But, before diving into the code, I'll explain a few user interface screens that have been generated using ZK.
在我提供的代码中,数据库是MySQL,但是您可以使用DB 2或者您喜欢的任何其他数据库。
In the code that I provide, the database is MySQL, but you can use DB2 or any other database that you like.
在示例代码中,我用Spring的ApplicationContext确保了这种情况,因为它会自动地预先实例化所有单体bean。
In the sample code, I'm using a Spring ApplicationContext that ensures this is the case, because it automatically pre-instantiates all singleton beans.
我在代码示例中使用EJB 3.0规范;同样的概念也适用于SpringFramework和JOTM。
I use the EJB 3.0 specification in my code examples; the concepts are the same for the Spring Framework and JOTM.
根据前面简单的单元测试用例,这块代码是“干净,绿色”的——但只有在我真正彻底地测试这块代码的情况下这才有意义。
So the code is "clean and green," according to my simple unit test case — but that's meaningful only if I'm really testing the code thoroughly.
这个工具在我对代码的问题(如我的客户端软件可能设置不正确)进行调试时有帮助,并且有助于我识别其他用户的软件问题。
This tool has helped me debug issues with my code, how my codes client software might not be setup correct, and help identify issues with other users software.
我可不想让依赖注入框架的代码散布在我的应用当中。
I don't want [Dependency Injection] framework code smeared all through my application.
我已经在代码中显示了一些最重要的文件和目录。
I've displayed a few of the most important files and directories in the code.
因为我已经看过他们其中的一些代码——在我的教学和研究中我已经阅读过非常多的代码——我认为您可以遵守一些通用的原则。
As I've looked over some of these — I've been reading more and more code for my classes and my research — I believe there are some general principles you can follow.
作为应用开发者,我更关心应用最终用户能做什么,而不是我的代码在JVM中能做什么。
As an application developer, I cared more about what an application end-user could do rather than what my code could do inside the JVM.
在过去一年的时间中,我在“追求代码质量”专栏撰写了大量的文章。这些文章向大家介绍了许多可以改进代码质量的工具和技巧。
In the past year or so of writing this column, I have introduced many tools and techniques that you can use to improve the quality of your code.
根据我的经验,在测试推动代码时,我的代码就会简单得多,而且我一直在设法使它们更为简单。
And in my experience, my code is much simpler when tests drive it, and I'm always in the market for greater simplicity.
如果我在自己的代码中错误地设计了一个函数,那么影响到的人就只有我自己而已,因为我是这个函数的唯一调用者。
If I mis-design a function in my own code, the only person affected is me, because I am the only caller of the function.
杰克“杰克毫不掩饰他对《月球》和山姆在其中的表现大为兴奋,他想让我在《源代码》中有同样的表现。”
Jake was excited visually by Moon and by what Sam [Rockwell] was doing in it. He wanted me to do the same thing on Source Code.
在我终于找到正确的代码之后,又得努力回忆我要在这做什么。
After I finally found the correct code, I was trying to remember what I wanted to do with it.
应用推荐