共查询到20条相似文献,搜索用时 711 毫秒
1.
叶青青 《计算机应用与软件》2008,25(9)
如果软件源程序中的一个代码段和同一程序中的另一个代码段在结构或语义上类似,这些代码段就成了代码克隆.概述代码克隆存在的各种形式,分析代码克隆产生的原因,并在概括了代码克隆检测的一般过程以后进一步阐述两类代码克隆检测方法:基于语义抽象树的检测方法和基于Token序列的检测方法. 相似文献
2.
3.
源代码注释生成旨在为源代码生成精确的自然语言注释,帮助开发者更好地理解和维护源代码.传统的研究方法利用信息检索技术来生成源代码摘要,从初始源代码选择相应的词或者改写相似代码段的摘要;最近的研究采用机器翻译的方法,选择编码器-解码器的神经网络模型生成代码段的摘要.现有的注释生成方法主要存在两个问题:一方面,基于神经网络的方法对于代码段中出现的高频词更加友好,但是往往会弱化低频词的处理;另一方面,编程语言是高度结构化的,所以不能简单地将源代码作为序列化文本处理,容易造成上下文结构信息丢失.因此,本文为了解决低频词问题提出了基于检索的神经机器翻译方法,使用训练集中检索到的相似代码段来增强神经网络模型;为了学习代码段的结构化语义信息,本文提出结构化引导的Transformer,该模型通过注意力机制将代码结构信息进行编码.经过实验,结果证明该模型在低频词和结构化语义的处理上对比当下前沿的代码注释生成的深度学习模型具有显著的优势. 相似文献
4.
闭包的引入使得在Swift语言中使用函数式编程成为可能。本文将结合函数式编程的特性来介绍其在Swift语言中的应用,并帮助开发者熟悉Swift提供的函数库、应用函数柯里化以及高阶函数的概念。从而帮助开发者写出更简洁、更模块化的代码。 相似文献
5.
6.
7.
8.
本文介绍Linux环境下,利用C与Tcl/Tk结合编写网络程序的一个实例。例程中用C编写网络通信程序作为底层,利用Tcl/Tk的C接口进行扩展编程,定制合适的Tcl/Tk解释器作为中间层,然后用Tcl/Tk脚本语言编写顶层用户图形界面。为在Linux平台下的C与Tcl/Tk结合的应用程序开发工作提供了一个参考例子。 相似文献
9.
10.
远程再编程是有效维护和管理部署后传感网络的重要手段,但要求更新的代码可靠且能量有效地传送到网络中的所有节点.提出一种基于OLSR的传感网络再编程可靠与能量有效传输协议,该协议利用ADV消息中的"下次ADV发送间隔"参数t和传输的代码段数C,变传统的ADVREQDATA三次握手顺序传输为ADVDATA两次握手非顺序传输;并从低层OLSR协议形成的MPR集中选择下级广播节点,有效地减少了广播的节点数,从而降低了能量开销;事后还能统计出实际参与代码更新的节点数.性能分析与模拟实验表明:该协议在节点完全更新代码率、平均延时、能量消耗等方面优于传统的PSFQ. 相似文献
11.
Embedded systems contain several layers of target processing abstraction. These layers include electronic circuit, binary machine code, mnemonic assembly code, and high-level procedural and object-oriented abstractions. Physical and temporal constraints and artifacts within physically embedded systems make it impossible for software engineers to operate at a single layer of processor abstraction. The Luxdbg embedded system debugger exposes these layers to debugger users, and it adds an additional layer, the extension language layer, that allows users to extend both the debugger and its target processor capabilities. Tcl is Luxdbg's extension language. Luxdbg users can apply Tcl to automate interactive debugging steps, to redirect and to interconnect target processor input-output facilities, to schedule multiple processor execution, to log and to react to target processing exceptions, to automate target system testing, and to prototype new debugging features. Inclusion of an extension language like Tcl in a debugger promises additional advantages for distributed debugging, where debuggers can pass extension language expressions across computer networks. 相似文献
12.
We describe the design and implementation of a workbench for molecular biology that allows the easy integration of analysis tools. The software is implemented in Tcl/Tk using the [incr Tcl] extension that provides object‐oriented programming. The program is called tkGDE and consists of four main parts. The sequence editor allows the user to perform basic editing operations on biomolecule sequences. The graphical annotation editor gives the user a graphical overview of all annotated features of a sequence. The output manager retains information on the results produced by the analysis tools. The bundle control allows several tools to run automatically, passing data from one tool to the next. Tools are integrated into the system by describing their properties in a configuration file, which drastically reduces the time needed for integration. We present results proving that Tcl/Tk has been misjudged to be slow and unsuited for large projects. To achieve sufficient performance we exploited special features of Tcl/Tk, namely idle tasks and the capabilities built into the Tk canvas widget. The system consists of more than 34000 lines of [incr Tcl] code in 182 classes. The whole development process took about one person‐year. Copyright © 2000 John Wiley & Sons, Ltd. 相似文献
13.
对Tcl/Tk语言的代码可重用特性在可重配置平台上的应用进行研究,讨论星载计算机可重配置特性的机理,并详细介绍这种面向用户的脱离底层代码操作的重配置平台的搭建步骤和代码实现,并给出该方案在一款星载数据处理系统可重配置设计上的应用结果. 相似文献
14.
NS-2新功能模块的开发 总被引:2,自引:0,他引:2
网络仿真软件NS-2具有源代码公开、可扩展性强等特点,已广泛用于网络分析、研究和教学。是目前网络仿真最流行的软件之一。网络的迅速发展需要人们不断研究新的网络协议和算法以及通过仿真分析网络性能。NS-2由于其源代码开放的特点,允许用户根据实际需求添加新的协议模块并通过仿真分析协议性能,这一特性成倍加速了新协议开发过程。该文给出了在NS-2中添加新功能模块的模版——编译层实现;解释层实现;编译层与解释层的接口;对原有相关文件的修改;编译及测试。并以自组网路由协议为例,从这五个方面详细介绍了在NS-2软件中添加新模块的过程。 相似文献
15.
易小芸 《数字社区&智能家居》2007,2(8):467
Tcl是一种简明,高效,可移植性好的脚本语言,广泛应用于自动化测试中。但随着自动化程度的加深,对其要求也越来越高,已有的Tcl已经不能满足人们的要求。由于Tcl是在一组C函数库中实现的,所以可以利用C语言编写库来实现对Tcl的扩展。文章主要介绍使用成熟的tcom库来实现Tcl对Excel文件的访问操作,以及在自动化测试中的应用。 相似文献
16.
17.
18.
DON LIBES 《Software》1997,27(4):481-493
Two agent implementations are described—one for mail notification and one for news notification. Both agents are implemented using Tcl. This paper provides a brief history and perspective of similar agents. Included are experiences using Tcl as an agent-implementation language, and comparisons of the results to similar agents. Also described are some new techniques of interest to Tcl programmers. © 1997 by John Wiley & Sons, Ltd. 相似文献
19.
函数式语言编译中,闭包变换和函数消除是广泛采用的高阶代码消除方法。为了提高函数式语言的运行效率,针对函数式语言编译阶段的高阶代码消除过程对目标代码效率的影响,设计并实现了一种函数式语言编译框架。该框架采用了菱形的架构,平行地使用了闭包变换与函数消除两种高阶代码消除方法。设计了一种具有代表性的函数式语言——FUN语言,并以FUN语言为基础,给出了比较框架的一个完整实现。通过该系统,对闭包变换与函数消除的效率影响进行对比实验,选取具有典型特征的测试例,分别从生成代码的规模和运行效率方面对闭包变换与函数消除两种方法的结果进行比较。实验结果表明,与闭包变换相比,使用函数消除方式所得的目标代码量更少,最多可减少33.76%的目标代码量;并且运行效率更高,最多可提高69.51%。 相似文献