This article provides a pattern of correlating a code smell to a measure that can be configured to be flagged from an automated static analysis tool.
本文提供了一种使代码味道与一种度量方法相关的模式,这种度量方法可以配置为通过自动静态分析工具标记。
This pattern encapsulates code for accessing components through directory services, such as JNDI client code, so that a client can simply pass in the name of a resource and get back that resource.
这个模式通过目录服务封装访问组件的代码,如JNDI客户端代码之类,因此客户端可以简单的以资源名通过验证并返回这个资源。
Better to look to build out a pattern repository, use compound patterns and recognize a role for seeding the code and incorporating user regions where code can be augmented after generation.
最好能够构建一个模式库,使用复合模式,并识别出生成代码的角色,再与用户合作,那样在生成代码之后可以对其进行改善。
If you want to match a pattern multiple times within a character sequence, the above code snippets are a good place to start.
如果您想在一个字符序列中多次匹配一个模式,上面的代码片段是一个很好的起点。
You might even say this pattern is a kind of code, a code that is hidden in the Scriptures and that, once revealed, unlocks the secret of God's changing moods.
你可以把这种模式看成一种编码,一种隐藏在各教派经书中的编码,一旦破解这种编码,也就破解了上帝摇摆不定情绪的秘密。
This is a class that can be used repeatedly to instantiate a class as a singleton without having to re-write the singleton pattern code for that specific class.
这是一个可用来创建单例类实例确不需要为每个特定的类重写单例模式代码的可重用的类。
Suddenly everything is a pattern, from having a coding standard to holding code reviews and selecting a programming language.
突然之间所有的事物都变成了一种模式,从持有一个编码标准到支持代码走查以及选择一个程序设计的语言。
The case statement works like its counterparts in traditional programming languages: It compares its argument to each pattern in a list; when a match is found, the corresponding code executes.
case语句的工作方式与传统编程语言中的对应结构相似。它将其参数与列表中的每个模式比较;当找到匹配项时,则执行对应的代码。
As an example, consider any repetitive coding pattern, such as executing a block of code with a lock held.
以一个常见的编码模式为例,如执行带有Lock的代码块。
All that is needed for a bug pattern detector to be effective is that it turn up a high enough percentage of questionable code to make it worth the effort of using it.
一个有效bug模式检测器的主要功能是发现更高百分比的可疑代码,使该模式具有更大的使用价值。
In Part 1 of this series we introduced a design pattern for grid computing on Azure and in Part 2 we wrote the code for a fraud scoring grid computing application named fraud Check.
在本系列的第1部分,我们介绍了在Azure上进行网格计算开发的设计模式,并在第2部分,我们编写了一个欺诈评分(fraud scoring)网格计算应用程序,命名为fraudCheck。
In this case, we will follow the Active Record pattern and wrap a database row with a class capable of all database operations. Its code is shown below.
在本例中,我们将遵循activeRecord模式并用能够执行所有数据库操作的类封装数据库行。
The Mapper pattern is a way to direct a bounded infinite set of resource requests to a single physical point of code.
Mapper模式特点如下:将无限的资源请求转向一个单独的物理节点。
I built a tool that lets you browse a catalog of patterns, bind them to your code, and statically check your use of the pattern.
我开发了一个工具,它可用来浏览模式,将你的代码与它们绑定起来,用它来静态地检查你对模式的使用。
Once you've objectively determined there's a problem in the code, you can use a handy refactoring pattern to improve it.
一旦客观地判断出代码中有问题,那么就可以用方便的重构模式改进它。
Binding a code template to an operation in a pattern will cause that code to be generated when the code and model are synchronized.
在模式中,当代码和模式同步时,把代码模板绑定到一个操作,便会生成相应代码。
Instead, he said, "it is a pattern, like a bar code with thousands of lines on it," that allows researchers to tease apart the fine points of relatedness among populations.
相反的,他说,“是一种模式,就像上千条线组成的条形码一样,”这使得研究人员能够分别群体中细微的相关之处。
An expansion location is a place in a code-enabled model where the artifacts created by a pattern are placed.
扩展位置是代码启用模型中的一块区域,在这里放置模式生成的构件。
This code defines a Schematron abstract pattern that covers the abstract notion of a purchase order with a unique identifier.
这段代码定义了一个Schematron抽象模式,包含带有惟一标识符的订购单的抽象概念。
Using a popular design pattern (MVC), you must rewrite the code of the corporate Web site so the model and the view are not bound to a particular programming language.
为了使用流行的设计模式(MVC),您必须重写公司Web站点的代码,使模型和视图不特定于某种编程语言。
Using a dispatcher queue to execute the code in parallel with the caller and then an OS event to block a public method that waits for the result (assuming a synchronous future pattern).
使用一个dispatcherqueue来并行的执行调用者和被调用的代码,然后一个操作系统事件会阻塞一个等待结果的公共方法假定一个同步未来模式assuming a synchronous future pattern,看不懂,再汗一个-_- !
The following code snippet is a part of the output from a Trace node, including the pattern ${Root} for this example. The element types are the hex strings, which start each line
下面的代码片段是某个 Trace节点的输出的一部分,包括本示例的模式 ${Root}。
The Command design pattern provides a way to encapsulate behavior in a class with well-known execution semantics. Listing 4 shows the result of applying these two patterns to the code in Listing 3.
公共设计模式提供了利用常规执行语句来在类中封装行为的方法。
A style in which a man's last few strands of hair are combed across the top of his head, thus resembling a bar-code pattern.
男子将头上仅存的几绺头发横梳过来盖在头顶上,其形状像是条形码。
The result is minor bits of scattered fault handling code and implicit coupling between the barrier class and the participants although still a great improvement over not using a pattern at all!
结果就是少数零散的故障处理代码,以及屏障类和参与类间暗含的耦合(这已经比不使用模式进步多了!)
The seal is either stamped smooth or in a corrugated pattern and may feature a serial number or code.
密封采用光滑压纹或者采用波纹压纹,并且可以压印序列号或者代码。
A novel symbol synchronization is presented with frame synchronization of PPM. On the basis of analyzing frame sync code pattern and length, a PPM frame scheme is designed.
在分析帧同步码型和长度要求的基础上,设计了一种PP M帧结构,提出了利用帧同步来实现PPM符号同步的方法。
A novel symbol synchronization is presented with frame synchronization of PPM. On the basis of analyzing frame sync code pattern and length, a PPM frame scheme is designed.
在分析帧同步码型和长度要求的基础上,设计了一种PP M帧结构,提出了利用帧同步来实现PPM符号同步的方法。
应用推荐