ABSTRACT Inferring Templates from Spreadsheets

合集下载

学术英语写作Unit-5----Abstract

学术英语写作Unit-5----Abstract
Unit 5 Abstract
What is an abstract? Types of abstracts Why write an abstract? What should the abstract include? How do you write an abstract? What is the style of an abstract? An outline for writing an abstract Common problems in writing an abstract Difference between an abstract and an introduction The Tricks, Conclusion of the lecture
Informative abstracts资料性摘要
The informative abstract, also known as the complete abstract, is a compendious summary of a paper's substance including its background, purpose, methodology, results, and conclusion. Usually between 100 and 200 words, the informative abstract summarizes the paper's structure, its major topics and key points. A format for scientific short reports that is similar to an informative abstract has been proposed in recent years. Informative abstracts may be viewed as standalone documents.

sfinae规则

sfinae规则

SFINAE(Substitution Failure Is Not An Error)是C++中的一种编译时策略,它允许在模板实例化的过程中选择一个合适的重载版本,而不是导致编译错误。

SFINAE 的核心思想是,如果在实例化模板时发生了某种类型的错误(通常是类型推导失败),编译器并不应该报错,而是应该尝试选择下一个重载版本。

SFINAE 主要应用在模板元编程和泛型编程中,它允许根据类型是否具有某种性质来选择不同的模板实例。

常见的应用场景包括类型检查、函数重载、模板特化等。

以下是一些常见的 SFINAE 规则:
1.使用enable_if进行条件编译:
2.使用std::void_t进行类型过滤:
3.使用std::enable_if进行模板特化:
SFINAE 的使用可以使得模板更加灵活,并根据不同的条件选择不同的实现。

然而,由于 SFINAE 使用时需要一些模板元编程的技巧,可能使得代码变得复杂,所以
需要谨慎使用,以确保代码的可读性和维护性。

abstractmethoderror案例

abstractmethoderror案例

abstractmethoderror案例1. 引言abstractmethoderror是Python中的一个常见错误类型,通常在使用抽象基类或继承的过程中发生。

在本文中,我们将深入探讨abstractmethoderror的定义、原因、解决方法,并通过案例分析来帮助读者更好地理解和避免这一错误。

2. 什么是abstractmethoderror?abstractmethoderror是指在Python中使用抽象基类(Abstract Base Classes, ABCs)或继承时,如果未实现抽象方法就会触发的错误。

在面向对象编程中,抽象基类是指包含抽象方法的类,这些方法必须在子类中被具体实现。

如果子类没有实现所有抽象方法,就会导致abstractmethoderror。

3. 导致abstractmethoderror的原因导致abstractmethoderror的原因通常有两种:3.1. 没有实现抽象方法:在子类中没有实现抽象基类中定义的抽象方法。

3.2. 调用未实现的抽象方法:在子类中调用了抽象基类中定义的但未被实现的抽象方法。

4. 解决abstractmethoderror的方法为了避免abstractmethoderror,我们可以采取以下方法来解决:4.1. 实现抽象方法:在子类中必须实现所有抽象基类中定义的抽象方法,确保不会出现未实现的情况。

4.2. 使用@abstractmethod装饰器:在抽象基类中使用@abstractmethod装饰器来标记抽象方法,以确保子类必须实现这些方法。

5. 案例分析让我们通过一个简单的案例来更好地理解abstractmethoderror。

假设我们有一个抽象基类Animal,其中定义了一个抽象方法speak(),我们再定义一个子类Dog,但在Dog类中忘记实现speak()方法。

当我们调用Dog类的speak()方法时,就会触发abstractmethoderror。

graphic abstract 综述可以引用

graphic abstract 综述可以引用

图形摘要(Graphic abstract)1. 引言在20世纪90年代以来,随着计算机技术的飞速发展和数码技术的普及,图形学作为一门跨学科的学科,取得了长足的发展。

图形学在各行各业都有着广泛的应用,包括娱乐、教育、医疗、制造业等领域。

本文将对图形学的发展历程、主要应用领域、技术发展趋势等方面进行综述。

2. 图形学的发展历程图形学作为一门学科,起源于计算机科学与技术,在其发展过程中融合了数学、物理学、工程学等多个学科的理论和方法。

20世纪60年代,图形学开始萌芽,主要应用于计算机辅助设计(CAD)等领域。

而今,在物理学建模、渲染、图像处理、虚拟现实等方面都取得了长足的发展。

3. 图形学的主要应用领域3.1 娱乐产业随着电脑和游戏机的普及,图形学在游戏、电影等方面得到了广泛的应用。

游戏行业的开发商对图形学技术的需求不断增加,包括三维建模、动画制作、特效渲染等方面。

电影工业也离不开图形学技术的支持,例如许多好莱坞大片中的特效场景都是借助图形学技术制作的。

3.2 教育领域在教育领域,图形学技术已经成为了一种重要的教学手段。

通过计算机辅助设计软件,学生可以更直观地了解各种复杂的知识点,例如解剖学、建筑学等领域。

3.3 医疗领域图形学技术在医疗领域也有着广泛的应用。

医学影像学中的数字化技术、图像处理技术,都是图形学技术的重要应用。

通过图形学技术,医生可以更准确地诊断疾病,为病患提供更好的治疗方案。

3.4 制造业在制造业中,图形学技术也为产品设计与制造提供了便利。

通过计算机辅助设计软件,工程师可以更快速地完成产品设计,并且通过虚拟仿真技术,可以在产品制造之前进行全方位的模拟测试,提高了产品的质量和效率。

4. 图形学的技术发展趋势4.1 三维技术随着VR、AR等技术的飞速发展,对三维技术的需求也越来越大。

未来,三维技术将更加广泛地应用于游戏、影视、建筑等领域。

4.2 深度学习与图形学的结合深度学习技术的兴起,为图形学技术的提升提供了新的机会。

art-template原始语法的特点

art-template原始语法的特点

【主题】art-template原始语法的特点1. art-template原始语法的特点art-template是一款简洁、高效的模板引擎,被广泛应用于前端开发中。

其原始语法有着独特的特点,包括简洁性、灵活性、扩展性和高性能等方面的优势。

2. 简洁性art-template的原始语法设计简洁明了,采用{{}}作为模板标记,使得模板语法更加直观和易于理解。

支持逻辑语法的使用,能够在模板中实现循环、条件判断等复杂逻辑操作,提高了模板的灵活性和功能性。

3. 灵活性与其他模板引擎相比,art-template的原始语法更加灵活,可以轻松地实现模板嵌套、变量替换等操作。

支持自定义辅助方法和过滤器,可以根据实际需求对模板引擎进行灵活定制,满足各种复杂的模板需求。

4. 扩展性art-template的原始语法具有很强的扩展性,支持插件和组件的扩展,可以通过扩展自定义的标签和函数,实现对模板引擎功能的无缝扩展。

这种扩展性使得art-template在实际开发中具有更广泛的适用性,能够满足各种复杂的模板需求。

5. 高性能art-template的原始语法在性能方面表现出色,渲染速度快,渲染效率高,能够有效提升页面加载速度,减少服务器压力。

这也是art-template得到广泛应用的重要原因之一,尤其在对性能有要求的前端项目中,art-template的原始语法具有很强的竞争力。

6. 个人观点和理解从我的个人观点和理解来看,art-template的原始语法具有很多优越性,其简洁、灵活、扩展和高性能的特点使得它成为前端开发中的瑰宝。

在实际项目中,我也深切体会到了art-template原始语法的强大之处,能够帮助开发人员快速、高效地完成各种复杂的模板需求,极大地提升了开发效率和产品性能。

7. 总结回顾通过以上对art-template原始语法特点的分析,我们可以清晰地看到其在简洁性、灵活性、扩展性和高性能方面的优异表现。

C#中abstract的用法详解

C#中abstract的用法详解

C#中abstract的⽤法详解参考:abstract可以⽤来修饰类,⽅法,属性,索引器和时间,这⾥不包括字段. 使⽤abstrac修饰的类,该类只能作为其他类的基类,不能实例化,⽽且abstract修饰的成员在派⽣类中必须全部实现,不允许部分实现,否则编译异常. 如:using System;namespace ConsoleApplication8{ class Program { static void Main(string[] args) { BClass b = new BClass(); b.m1(); } } abstract class AClass { public abstract void m1(); public abstract void m2(); } class BClass : AClass { public override void m1() { throw new NotImplementedException(); } //public override void m2() //{ // throw new NotImplementedException(); //} }}Abstract classes have the following features:抽象类拥有如下特征:1,抽象类不能被实例化, 但可以有实例构造函数, 类是否可以实例化取决于是否拥有实例化的权限 (对于抽象类的权限是abstract, 禁⽌实例化),即使不提供构造函数, 编译器也会提供默认构造函数;2,抽象类可以包含抽象⽅法和访问器;3,抽象类不能使⽤sealed修饰, sealed意为不能被继承;4,所有继承⾃抽象类的⾮抽象类必须实现所有的抽象成员,包括⽅法,属性,索引器,事件;abstract修饰的⽅法有如下特征:1,抽象⽅法即是虚拟⽅法(隐含);2,抽象⽅法只能在抽象类中声明;3,因为抽象⽅法只是声明, 不提供实现, 所以⽅法只以分号结束,没有⽅法体,即没有花括号部分;如public abstract void MyMethod();4,override修饰的覆盖⽅法提供实现,且只能作为⾮抽象类的成员;5,在抽象⽅法的声明上不能使⽤virtual或者是static修饰.即不能是静态的,⼜因为abstract已经是虚拟的,⽆需再⽤virtual强调.抽象属性尽管在⾏为上与抽象⽅法相似,但仍有有如下不同:1,不能在静态属性上应⽤abstract修饰符;2,抽象属性在⾮抽象的派⽣类中覆盖重写,使⽤override修饰符;抽象类与接⼝:1,抽象类必须提供所有接⼝成员的实现;2,继承接⼝的抽象类可以将接⼝的成员映射位抽象⽅法.interface I{void M();}abstract class C: I{public abstract void M();}抽象类实例:// abstract_keyword.cs// 抽象类using System;abstract class BaseClass // 抽象类{protected int _x = 100; //抽象类可以定义字段,但不可以是抽象字段,也没有这⼀说法.protected int _y = 150;public BaseClass(int i) //可以定义实例构造函数,仅供派⽣的⾮抽象类调⽤; 这⾥显式提供构造函数,编译器将不再提供默认构造函数. {fielda = i;}public BaseClass(){}private int fielda;public static int fieldsa = 0;public abstract void AbstractMethod(); // 抽象⽅法public abstract int X { get; } //抽象属性public abstract int Y { get; }public abstract string IdxString { get; set; } //抽象属性public abstract char this[int i] { get; } //抽象索引器}class DerivedClass : BaseClass{private string idxstring;private int fieldb;//如果基类中没有定义⽆参构造函数,但存在有参数的构造函数,//那么这⾥派⽣类得构造函数必须调⽤基类的有参数构造函数,否则编译出错public DerivedClass(int p): base(p) //这⾥的:base(p)可省略,因为基类定义了默认的⽆参构造函数{fieldb = p;}public override string IdxString //覆盖重新属性{get{return idxstring;}set{idxstring = value;}}public override char this[int i] //覆盖重写索引器{get { return IdxString[i]; }}public override void AbstractMethod(){_x++;_y++;}public override int X // 覆盖重写属性{get{return _x + 10;}}public override int Y // 覆盖重写属性{get{return _y + 10;}}static void Main(){DerivedClass o = new DerivedClass(1);o.AbstractMethod();Console.WriteLine("x = {0}, y = {1}", o.X, o.Y); }}。

art-template实现原理

art-template实现原理

art-template实现原理art-template 是一种轻量级、高性能的模板引擎,简称 art,它在前端开发中具有广泛的应用。

在 art-template 的实现原理中,主要包括编译阶段和渲染阶段两个主要过程。

下面将详细介绍一下 art-template的实现原理。

编译阶段:在编译阶段,art-template 将模板代码转换为可执行的 JavaScript 代码。

主要包括以下几个步骤:3. 生成代码:通过遍历语法树,将其转换为可执行的 JavaScript代码。

在生成代码的过程中,还需要对模板中的变量进行作用域判定,以及处理控制流语句(如 if-else、for 循环等)。

渲染阶段:在渲染阶段,art-template 则是利用编译阶段生成的 JavaScript代码来渲染数据,将模板代码中的变量替换为实际的值,生成最终的HTML 代码。

主要包括以下几个步骤:1. 创建 render 函数:根据编译阶段生成的 JavaScript 代码,创建一个 render 函数,该函数可以接受一个数据对象作为参数。

2. 数据注入:将数据对象注入到 render 函数中,以便在渲染过程中可以获取到需要展示的数据。

3. 模板引擎执行:执行 render 函数,通过执行 JavaScript 代码,将模板中的变量替换为实际的值,并生成最终的 HTML 代码。

4.返回结果:将生成的HTML代码返回给调用者,供其在前端页面中显示。

在 art-template 的渲染过程中,为了提高性能,还引入了缓存机制。

即在第一次渲染后,会将编译后的 JavaScript 代码缓存起来,下次渲染时直接使用缓存的代码,提高了渲染速度。

art-template 的实现原理相较于其他模板引擎而言,最大的特点就是编译阶段将模板代码转换为 JavaScript 代码,然后使用 JavaScript执行模板,这样可以充分利用到 JavaScript 引擎的优化能力,提高渲染速度和性能。

setrenderinghints使用

setrenderinghints使用

setrenderinghints使用setRenderingHints是Java中Graphics2D类的一个方法,用于设置图形或图像渲染的提示。

渲染提示是一个键值对的集合,可以用来指定图形的渲染方式,以获得更好的视觉效果。

Graphics2D是Java 2D图像绘制的基本类,继承自Graphics类。

其中包含了绘制线条、矩形、椭圆等基本形状的方法,同时也提供了一些高级绘图功能。

setRenderingHints方法就是其中的一个高级功能。

在开始介绍setRenderingHints方法之前,我们先来看一下Graphics2D类的一些基本概念。

1. Graphics2D类:Java 2D图像绘制的基本类,提供了一系列绘图方法和属性。

可以通过调用getGraphics方法来获取Graphics2D对象。

2. RenderingHints类:用于描述图形渲染的提示信息,通过键值对的形式指定不同的渲染方式。

RenderingHints类是一个抽象类,使用其静态的getRenderingHints方法可以获取默认的渲染提示。

另外,还有一些静态的字段,用于指定渲染提示的类型。

3. RenderingHints.Key接口:RenderingHints类的键的接口,用于定义不同类型的渲染提示。

其中,采用了四种不同的Hint的值:- RenderingHints.KEY_ANTIALIASING:抗锯齿提示,用于指定是否启用图形抗锯齿化。

- RenderingHints.KEY_RENDERING:渲染提示,用于指定图形的渲染方式。

- RenderingHints.KEY_COLOR_RENDERING:颜色渲染提示,用于指定颜色的渲染方式。

- RenderingHints.KEY_TEXT_ANTIALIASING:文本抗锯齿提示,用于指定是否启用文本抗锯齿化。

setRenderingHints方法的语法如下:```javapublic void setRenderingHints(Map<?,?> hints)```其中,hints参数是一个Map类型的键值对集合,用于指定不同类型的渲染提示。

c++ abstract修饰类用法

c++ abstract修饰类用法

C++中abstract修饰类的用法1. 概述在C++中,我们经常会听到关于abstract类的概念。

那么,abstract 类到底是什么?它又有什么作用呢?2. 什么是abstract类在C++中,我们可以使用关键字“abstract”来修饰一个类,使其成为一个“abstract类”。

一个abstract类是一种不能被实例化的类,即不能创建它的对象。

abstract类通常用于定义接口和抽象的行为,它的目的是为了让其他类继承并实现它的纯虚函数。

3. abstract类的定义要定义一个abstract类,我们可以在类中声明纯虚函数。

纯虚函数是指在类中声明但没有实现的虚函数。

通过在函数声明后面加上“= 0”来将一个虚函数声明为纯虚函数。

例如:```C++class AbstractClass {public:virtual void pureVirtualFunction() = 0;};```4. abstract类的作用abstract类的作用主要有以下几点:- 定义接口:abstract类定义了一组接口,表示了一种抽象的行为。

其他类可以继承并实现这些接口。

这样一来,我们就可以通过基类指针来调用派生类的函数。

- 特定行为的约束:abstract类可以约束其派生类必须实现某些特定的行为。

这样一来,我们就可以确保派生类都具有相同的接口,从而提高代码的一致性和可维护性。

- 防止实例化:abstract类的对象不能被创建,这可以防止程序员错误地使用该类,从而避免一些潜在的错误。

5. 如何使用abstract类在C++中,我们可以通过继承abstract类并实现其中定义的纯虚函数来使用abstract类。

例如:```C++class ConcreteClass : public AbstractClass {public:void pureVirtualFunction() override {// 实现纯虚函数的具体逻辑}};```在上面的例子中,ConcreteClass继承了AbstractClass,并实现了其中定义的纯虚函数pureVirtualFunction。

abstractprocessor使用场景

abstractprocessor使用场景

abstractprocessor使用场景abstractprocessor是一种在Java中使用的注解处理器。

它主要用于处理编译时的注解,能够在编译期间生成一些额外的代码,以便在运行时能够更高效地执行某些任务。

这个工具非常实用,可以在很多场景下发挥作用。

下面将详细介绍abstractprocessor的使用场景。

1.自动生成代码:abstractprocessor能够根据注解定义的规则,在编译期间自动生成一些代码。

这对于一些重复性的工作来说非常有用,比如生成getters和setters方法、实现Parcelable接口、生成构造函数等等。

使用abstractprocessor可以省去手动编写这些代码的功夫,提高开发效率。

2.实现安全检查:abstractprocessor可以对代码进行静态检查,确保代码在运行时不会出现一些常见的错误。

例如,可以使用abstractprocessor检查注解在运行时是否被错误地使用,比如对错误的方法或类进行了注解。

这能够帮助开发者在编译期间发现潜在的问题,避免在运行时出现错误。

3.自动生成配置文件:有时候我们需要在编译期间生成一些配置文件,以便在运行时使用。

使用abstractprocessor能够轻松地实现这一功能。

比如,在Android开发中,我们可以使用abstractprocessor生成一些资源文件、Manifest文件等。

这能够提高项目的可维护性,避免手动编辑这些文件可能出现的错误。

4.实现注解驱动框架:注解是一种非常强大的技术,能够在编译期间对代码进行丰富的扩展。

使用abstractprocessor能够方便地实现注解驱动的框架。

通过定义自己的注解,开发者可以使用abstractprocessor来处理这些注解,并生成相应的代码。

这能够大大简化框架的使用,提供更强大的功能。

5.自动生成文档:abstractprocessor可以根据代码中的注解来生成文档,这对于项目的文档自动化是非常有帮助的。

abstracthandlerexceptionresolver的用法

abstracthandlerexceptionresolver的用法

abstracthandlerexceptionresolver的用法使用AbstractHandlerExceptionResolver的步骤和示例AbstractHandlerExceptionResolver是Spring MVC框架中的异常处理器。

它允许开发人员在控制器方法中抛出异常时,对异常进行处理并返回自定义的错误页面或错误信息。

这个异常处理器提供了很大的灵活性和可定制化的选项。

下面将介绍使用AbstractHandlerExceptionResolver的步骤和一个具体的示例。

步骤1:创建一个类并继承AbstractHandlerExceptionResolver首先,我们需要创建一个类,例如CustomHandlerExceptionResolver,该类将继承AbstractHandlerExceptionResolver类。

我们可以在这个类中实现对异常的处理逻辑。

javapublic class CustomHandlerExceptionResolver extends AbstractHandlerExceptionResolver {Overrideprotected ModelAndViewdoResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {处理异常的逻辑代码return new ModelAndView("error"); 返回自定义的错误页面}}在doResolveException方法中,我们可以根据需要编写处理异常的逻辑代码,并返回一个ModelAndView对象。

在这个方法中,我们可以使用request和response对象来获取请求和响应的信息,使用handler对象来获取处理当前请求的处理器对象,以及使用ex对象来获取抛出的异常。

抽象类作文英语模版

抽象类作文英语模版

抽象类作文英语模版英文回答:Introduction.In the realm of object-oriented programming, the concept of abstraction occupies a pivotal position. Abstraction allows us to encapsulate the essential characteristics and behaviors of real-world entities into classes, providing a structured and reusable blueprint for creating objects. Among the various class types, abstract classes hold a unique distinction, serving as a foundation for defining common interfaces and preventing the instantiation of incomplete or invalid objects.Definition of an Abstract Class.An abstract class is a class that cannot be instantiated directly but must be subclassed to create concrete objects. It serves as a template that defines theinterface and shared functionality of a group of related classes. By declaring at least one of its methods as abstract, an abstract class ensures that subclasses must implement the method with specific behavior before they can be used.Characteristics of Abstract Classes.1. Cannot be instantiated: Abstract classes cannot be used to create objects directly. They exist solely to provide a blueprint for subclasses to inherit and expand upon.2. Contain abstract methods: Abstract classes declare one or more abstract methods, which are method signatures without implementations. Subclasses must override these abstract methods with concrete implementations to provide specific functionality.3. May contain concrete methods: In addition to abstract methods, abstract classes can also include concrete methods, which provide default implementationsthat subclasses can inherit or override.4. Act as a contract: Abstract classes define a contract that subclasses must adhere to. By implementing the abstract methods, subclasses guarantee that they possess the required functionality and follow the established interface.Uses of Abstract Classes.Abstract classes offer various advantages, including:1. Enforce method signatures: They ensure that subclasses implement the required methods with the correct signatures, preventing inconsistencies and enforcing a common interface.2. Promote code reusability: By providing a shared interface, abstract classes facilitate code reusability across subclasses, reducing duplication and promoting maintainability.3. Prevent incomplete objects: By prohibiting direct instantiation, abstract classes prevent the creation of invalid or incomplete objects, ensuring that only objects with complete and consistent functionality are created.4. Promote polymorphism: Abstract classes support polymorphism, allowing objects of different subclasses to be treated as objects of the abstract class, fostering flexibility and extensibility in code.Example of an Abstract Class.Consider the following abstract class representing the concept of a shape:java.public abstract class Shape {。

Extendedabstract(2-4pages)template-SCinTE2015

Extendedabstract(2-4pages)template-SCinTE2015

Extended Abstract’s Title: Please Centerand use Arial 14First Author1*, Second Author2 and Last Author31Affiliation of the first author, *Corresponding author’s email address2Affiliation of the second author3List all affiliations in the same wayKeywords: (4-6 keywords separated by a comma) keyword 1, keyword 2, keyword 3.For the rest of the extended abstract (except the reference list), please use Times New Roman size 12 AbstractA uniform appearance will assist the reading of the proceedings. It is therefore suggested to authors to use the example of this file to construct their extended abstracts. This template explains and demonstrates how to prepare your extended abstract. The best is to read these instructions and follow the outline of this text. Please set the page settings of your word processor to A4 format with the margins set to normal (2.54cm for all margins).Please review this document to learn about the formatting of text, table captions and references.An abstract not exceeding 200 words should appear on the top of the first page, after the title of the extended abstract in a section titled "Abstract". It should be written so as to motivate readers to continue and explore the article.IntroductionWhen receiving the extended abstract, it’s implied that the corresponding author(s) grant us the copyright to use the extended abstract for the proceedings book. Should authors use tables or figures from other Publications, they must ask the respective publishers to grant them the right to publish this material in their extended abstract. Use italics for emphasizing a word or phrase. Please do not use boldface typing or capital letters except for section headings (cf. remarks on section headings below). It is expected that authors will submit carefully written and proofread material. Careful checking for spelling and grammatical errors should be performed. The number of pages of the extended abstract should be from 2 to 4. Any extended abstracts longer than 4 pages will not be accepted. If you are copying and pasting text from another document in which the formatting is different, it’s highly recommended to use the paste special function in MS Word and choosing the "Keep Text Only" option.Organization of the TextSection HeadingsThe section headings are in boldface capital and lowercase letters. Second level headings are typed as part of the succeeding paragraph (like the subsection heading of this paragraph).Page Numbers. Please do not number your extended abstract.Tables. Tables (refer with: Table 1, Table 2, ...) should be presented as part of the text, but in such a way as to avoid confusion with the text. A descriptive title should be placed below each table. Units in tables should be given in square brackets [meV]. If square brackets are not available, use curly {meV} or standard brackets (meV).Special Signs . For example, α γ μ Ω () ≥ ± ● Γ {1120} should always be written in with the fonts Times New Roman or Arial, especially in the figures and tables.Macros . Do not use any macros for the figures and tables. (We will not be able to convert such extended abstracts into our system).Language . All text, figures and tables must be in English. When writing the extended abstract, please remember to use either British, or US, spelling but not a mix of the two, i.e., if you choose British spelling it would be colour not color; behaviour (behavioural) not behavior; [school] programme not program; [he] practises not practices; centre not center; organisation not organization; analyse not analyze, etc.Figures. Figures (refer with: Fig. 1, Fig. 2 etc.) should be presented as part of the text, leaving enough space so that the caption will not be confused with the text. The caption should be self-contained and placed below the figure. Generally, only original drawings or photographic reproductions are acceptable. Only very good photocopies are acceptable. Utmost care must be taken to insert the figures in correct alignment with the text . Half-tone pictures should be in the form of glossy prints. If possible, please include your figures as graphic images in the electronic version. For best quality the pictures should have a resolution of 300 dpi (dots per inch). Color figures are welcome for the online version. Generally, these figures will be reduced to black and white for the print version.Equations. Equations (refer with: Eq. 1, Eq. 2 etc.) should be indented 5 mm (0.2"). There should be one line of space above the equation and one line of space below it before the text continues. The equations have to be numbered sequentially, and the number put in parentheses at the right-hand edge of the text. Equations should be punctuated as if they were an ordinary part of the text. Punctuation appears after the equation, but before the equation number, e.g.c 2 = a 2 + b 2 (1)1212log ()log ()()b N N I μασμασαασ--+=+⋅ (2)Table 1. Table headingFigure 1. Figure headingsCitationsThe whole citation should follow Harvard style, enclosed within parentheses (author surname, year) if not a natural part of the surrounding sentence; the year should be enclosed within parentheses if the names do form a natural part of the surrounding sentence. Citations of works by two authors should have ‘and’ (not an ampersand) between the names. Citations of works by three or more authors should have the first author followed by et al in italics with no trailing stop.In-text lists of references should be listed in chronological order (e.g. author1, 2002, author2, 2004, author3, 2008). Publications by the same author(s) in the same year should be identified with a, b, c (e.g. 2008a, 2008b) closed up to the year. A reference list should appear at the end of the extended abstract under the heading "References". All the references should be arranged in alphabetical order. Please follow the examples below (cf. References).Results and DiscussionIf you follow the format herein your extended abstract will conform to the requirements of the conference and facilitate a problem-free publication process.Concluding RemarksWithin the conclusions’section you may present the major remarks that were drawn from the scientific work.AcknowledgementsAny acknowledgements the authors wish to make should be included in a separate headed section at the end of the manuscript but before the list of references.References [please choose the appropriate style for the type of reference from the list below and use Times New Roman size 10][For an article in a journal] Goss, R. O., 1990, Economic policies and seaports: strategies for port authorities. Maritime Policy and Management, 17(4), 273-287.[Book] Frankel, E. G., 1987, The World Shipping Industry (London, U.K.: Croom Helm).[Chapter in a book] Friesz, T. L., 1981, The multiobjective optimization in transportation: the case of equilibrium network design. In: Organizations: Multiple Agents with Multiple Criteria, edited by J. N. Morse. Lecture Notes in Economics and Mathematical Systems, Vol. 190 (NewYork: Springer-Verlag), pp. 116-127.[Report, proceedings, and unpublished literature (a)] Tan, H., Gershwin, S., and Athans, M., 1979, Hybrid optimization in urban traffic networks. MIT Report Dot-TSC-RSPA-79-7.[Report, proceedings, and unpublished literature (b)] Asakura, Y., and Sasaki, T., 1990. Formulation and feasibility test of optimal road network design model with endogenously determined travel demand. Proceedings of the 5th World Conference on Transport Research, Yokohama, Japan, July, pp. 351-365[Report, proceedings, and unpublished literature (c)] Yang, H., Bell, M. G. H., and Meng, Q., 1997, Equilibrium zone reserve capacity under network capacity constraints. Working paper, The Hong Kong University of Science and Technology.[Newspaper or magazine] Smith, A., 1996, Labour ditches plans to re-regulate buses. Financial Times, 30 December. [Internet source (with title, date of access and the universal resource locator in full)] UNO, Charter of the United Nations (Preamble), Date of access: 21/11/2012. /en/documents/charter/preamble.shtml. [Government legislation (a)] US Congress, Senate Committee on Foreign Relations, 1956, The Mutual Security Act of 1956, 84th Congress, second session, report 2273.[Government legislation (b)] United Kingdom Parliament, Committee on the Working of the Monetary System [Radcliffe Committee] 1960, Principal Memoranda of Evidence , vol. 2, Cmd 1958.[Government legislation (c)] United Nations General Assembly, Secretariat for Economic Affairs, 1951, Methods of Financing Economic Development in Less Developed Countries, report II B2.。

Author-Templates-ASMETemplate-Sample

Author-Templates-ASMETemplate-Sample

ABSTRACTA short abstract (150words maximum)should open the paper.The purposes of an abstract are:•to give a clear indication of the objective,scope,and results of the paper so that readers may determine whether the full text will be of particular interest to them;•to provide key words and phrases for indexing,abstracting,and retrieval purposes.The abstract should not attempt to condense the whole subject matter into a few words for quick reading.NOMENCLATURENomenclature should follow customary usage. Thenomenclature list should be in alphabetical order (capital letters first, followed by lowercase letters), followed by any Greek symbols, with subscripts and superscripts last, identified with headings.The following were created with format Nomenclaturecross-sectional area zone of interest angle of reflectionincremental displacementcomplex conjugateth component of argument. Not to be confused with the derivative in the th direction.INTRODUCTIONAn effort has been made to define most of the necessaryA Z αδ()∗()kk k formats for an ASME conference paper. These include Body : This is the standard paragraph format Equation :(1)Undented : This is the body format but without an initial indentation. This is useful for continuing a paragraph interrupted by an equation. Note that equations are automatically numbered.•bulleted1.Numbered1 (to initialize the counting of an enumeration2.NumberedHEADING1: BE SURE TO MAKE THIS ALL CAPS Heading2:Also present and used above are the formats:Title ,Author ,and Author Affiliation .For multiple authors:if there are multiple authors with individual affiliations,please use your judgment to position them in the space provided.Try to position two or three authors and their affiliations across the title area within the specified margins. For four authors, position two across the page (in a tabular format)with two blank lines between the two blocks of author information.Additional formats are PaperHeader , which is shown on the top three lines of this page, and PaperNumber , which is just below that.F Ma=TitleAuthor Affiliation:AddressCity, State, Zip Code Phone, Fax, EmailProceedings of Insert Conference AbbreviationInsert Conference NameInsert Conference Date and LocationPaper Number HereFiguresFigures should be placed within anchored frames. Be sure to leave space within that frame for a text box for the caption.Figures should be referenced within the text as “Fig. 1." When the reference to a figure begins a sentence, the abbreviation “Fig.” should be spelled out, e.g., “Figure 1."EquationsFramemaker offers many tools for creating equations inequation boxes. It is assumed here that the user is familiar with those capabilities. This template has been set so that “New Small Equation”, “New Medium Equation”, and “New Large Equation” all generate equations of the same font distributions.Equations should be referenced within the text as “Eq. (n).”When the reference to an equation begins a sentence, it should be spelled out, e.g., “Equation (n).”Reference CitationsWithin the text, references should be cited by giving the last name of the author(s) and the year of publication of thereference. The year should always be enclosed in parentheses;whether or not the name of the author(s) should be enclosed within the parentheses depends on the context.In the case of two authors, the last names of both authors should be included in the citation, as shown in the above examples, with the word “and” separating the two authors. In the case of three or more authors, only the last name of the first author of the reference should be included,as shown in the above examples,with the other authors being denoted by “et al.”In the case of two or more references with the sameauthor(s) and with the same year of publication, the references should be distinguished in the text by appending a lowercase letter “a”to the year of publication of the first cited,a letter “b”to the second cited, etc. The references should follow the examples shown above.Cross ReferencingLife is easiest if good use is made of Framemaker’s cross-Figure 1. The caption for a figure should use the format:FigureCapNN . Note that figures are automatically numbered.referencing capabilities. These permit insertion and deletion of figures and equations without destroying the numbering of the citations of other figures and equations.FootnotesHere is one 1, please read it.REALL Y IMPORTANTNeither ASME nor its printers have the facilities to process Framemaker files.To submit your paper electronically, you must print to either postscript or pdf and submit that product. Pdf file format is usually the more compact.CONCLUSIONSThis template was derived from the a specific paper formatted to meet specifications for an ASME conference.No assertion is made that this template is correct in all respects. As errors are found, please contact Dan Segalman: djsegal@.Those corrections will eventually appear in version downloaded from ASME.I will also be available to answer a few casual questions about the use of this template, but I cannot give basic instruction on Framemaker.REFERENCESReference to journal articles, papers in conferenceproceedings, or any other collection of works by numerous authors should include:•year of publication•full title of the cited article•full name of the publication in which it appeared •volume number (if any)•inclusive page numbers of the cited articleReference to textbooks, monographs, theses, and technical reports should include:•year of publication•full title of the publication •publisher•city of publication•inclusive page numbers of the work being citedIn all cases, titles of books, periodicals, and conferenceproceedings should be underlined or in italics.There is a format,Reference , that can be used for references. following are some examples:Kwon, O. K., and Pletcher, R. H., 1981, "Prediction of theIncompressible Flow Over a Rearward-Facing Step,’’Technical Report HTL-26, CFD-4, Iowa State Univ., Ames, IA.Lee, Y ., Korpela, S. A., and Horne, R. N., 1982, "Structure of1.Footnotes are initiated under the “Special” menu.Multi-Cellular Natural Convection in a Tall Vertical Annulus,’’Proceedings, 7th International Heat Transfer Conference, U. Grigul et al., ed., Hemisphere Publishing Corp., Washington, D.C., V ol. 2, pp. 221-226.Sparrow,E.M.,1980a,"Fluid-to-Fluid Conjugate Heat Transfer for a Vertical Pipe - Internal Forced Convection and External Natural Convection,’’ASME Journal of Heat Transfer,Vol.102, pp. 402-407.Sparrow, E. M., 1980b, "Forced-Convection Heat Transfer in a Duct Having Spanwise-Periodic Rectangular Protuberances,’’Numerical Heat Transfer, Vol. 3, pp. 149-167.Tung, C. Y., 1982, "Evaporative Heat Transfer in the Contact Line of a Mixture,’’ Ph.D. Thesis, Rensselaer Polytechnic Institute, Troy, NY.。

abstract关键字用法

abstract关键字用法

abstract关键字用法
abstract关键字用法有以下几种:
1. 抽象类的声明:在类的声明前加上abstract,表示该类是抽象类,不能直接实例化,只能被继承。

2. 抽象方法的声明:在方法的声明前加上abstract,表示该方法是抽象方法,没有具体的实现,需要子类去实现。

抽象方法没有方法体,用分号代替。

3. 抽象属性的声明:在成员变量的声明前加上abstract,表示该成员变量是抽象属性,没有具体的实现,需要子类去实现。

4. 接口的声明:接口中的所有方法默认都是抽象方法,所有成员变量默认都是public、static、final类型,可以不用声明为abstract。

5. 抽象类的继承:一个非抽象类可以继承一个抽象类,但必须实现该抽象类的所有抽象方法。

总的来说,abstract关键字的作用是定义抽象类、抽象方法或抽象属性,通过继承和实现来完成具体的操作。

abstractinterceptor使用详解

abstractinterceptor使用详解

abstractinterceptor使用详解
AbstractInterceptor是一个抽象类,作为Interceptor接口的默认
实现。

它提供了一些基本的方法和属性,方便开发人员实现自定义的拦截器。

使用AbstractInterceptor,你只需要继承这个类并实现相应的
方法即可。

AbstractInterceptor有以下几个重要的方法:
1. preHandle:在请求处理之前被调用。

可以通过返回一个布
尔值来决定是否打断后续拦截器和处理器的执行。

2. postHandle:在请求处理之后,渲染视图之前被调用。

可以
对ModelAndView进行修改。

3. afterCompletion:在请求处理完成之后被调用。

允许进行资
源清理等工作。

注意,这些方法都有一个入参是HandlerExecutionChain对象,它可以获取到当前请求的处理器和拦截器。

AbstractInterceptor还有一些其他方法和属性,例如:
1. getOrder:获取当前拦截器的执行顺序。

2. setOrder:设置当前拦截器的执行顺序。

3. excludePatterns:设置一个或多个URL的匹配模式,用于排除特定的请求。

4. includePatterns:设置一个或多个URL的匹配模式,用于包含特定的请求。

使用AbstractInterceptor可以方便地实现拦截器,并把它们添加到拦截器链中,对请求进行处理。

一个上下文无关文法生成句子abbaa的推导树

一个上下文无关文法生成句子abbaa的推导树

一个上下文无关文法生成句子abbaa的推导树以《一个上下文无关文法生成句子abbaa的推导树》为标题,本文将详细阐述上下文无关文法生成句子abbaa的推导树,解释如何用此推导树生成该句子。

首先,我们需要对上下文无关文法进行一个简要的介绍。

上下文无关文法(Context-free Grammar)是由于Noam Chomsky发展的一种文法,用于描述一组字符串之间的关系,其中这些字符串由一组非终结符(即变量)和一组终结符(即终结字符)组成,每个变量都由一组终结字符和/其他变量组成,通过一组产生规则表示。

接下来,我们来看一下具体的推导树,生成上述句子abbaa。

该推导树是以一个根符号S为起始符号,它可以通过如下产生规则产生句子abbaa:S→AbAaA→bAA→a从开始符号S开始,该符号可以通过替换成AbAa来左移,然后A可以被bA或a替换,此时右边变为bAa,若A以a替换,则此时可以完成推导,得到abbaa;否则,A可以继续替换成bA,然后A 又可以替换成a,最终可以得到abbaa。

在这个推导的过程中,我们使用了无关文法的三个基本性质:规则可以以左移的方式应用,终结字符可以正确对应,而无需考虑文本中的上下文。

最后,我们可以用它来生成更复杂的句子。

例如,我们可以提出一个新的产生规则,如:S→AbBbAa,然后用相同的推导方法来生成更复杂的句子,如abbbbaaa。

因此,我们可以看出,上下文无关文法推导树可以用来生成复杂的句子,而且可以很好地重新组合出不同句子。

总之,本文通过详细阐述上下文无关文法生成句子abbaa的推导树,说明如何用上下文无关文法生成该句子。

上下文无关文法具有非常重要的作用,不仅能够构建形式语言,还可以用来解析复杂句子,分析句子之间的关系,为计算机语言编程提供重要支持。

abstract修饰方法总结

abstract修饰方法总结

abstract修饰⽅法总结
abstract这种⽅法修饰,主要⽤在抽象类和抽象⽅法.
抽象的类是不可实例化的⽐如
public abstract class Test{
}
他能够含有抽象的⽅法
public abstract class Test{
public abstract void defMethod();
}
抽象的⽅法是要让⼦类继承下去再定义它的,让抽象的概念得以设计。

⽐如当⼀种⾯向对象设计遇到⼀种⽅法有多种设计的时候,能够在基类暂且不设计他,把设计的⼯作交给⼦类去完毕,但⼦类设计时,要么继续继承他超类的抽象概念,要么就把抽象的⽅法定义出来。

⽐如
abstract class Test2 extends Test{
……..
}
仍然不定义超类的抽象⽅法,继续把这样的抽象概念交给Test2的⼦类去完毕。

class Test2 extends Test{
public void deMethod(){
}
}
继承Test,让抽象的概念得到设计。

尽管在{}⾥没有不论什么语句,但这也表⽰我们为他做了⼀种设计,⼀种什么也不做的定义。

假设要定义能够写在{}⾥。

总结:
在类中没有⽅法体的⽅法,就是抽象的⽅法。

含有抽象⽅法的类,即为抽象类。

假设⼀个⼦类没有实现抽象基类中全部的抽象⽅法,则⼦类也能够成为⼀个抽象的类。

我们能够将⼀个没有不论什么抽象⽅法的类声明为abstract,避免由这个类产⽣不论什么的对象。

spiea4template

spiea4template

Manuscript Paper (Article Title)Author (Author Names & Affiliations)Nation’s Research Laboratory, 345 Photon Drive, Los Angeles, CA, USA 95555-0345;ABSTRACT (SECTION HEADING)(All Font using Times New Roman).(Body text)Begin the abstract two lines below author names and addresses. The abstract should concisely summarize key findings of the paper, and should consist of a single paragraph containing no more than 250 words. The abstract does not have a section number. A list of up to 10 keywords to use in online content search should immediately follow. Text paragraphs are single-spaced.Keywords: Times Roman, image area, acronyms, references1. INTRODUCTIONUse Times Roman or an equivalent font 1 throughout your manuscript, in the appropriate size and style for each section (Fig. 1). All text and figures, including footnotes, must fit inside an image area of 6.75×8.75 in. or 17.15×22.23 cm (Fig.2). Leave additional space between paragraphs. Indentation is optional.(Figure captions) Figure 1: Text styles for manuscript elements. Figure 2: Margin and image area settings.1.1 Title and author information (Subsection heading)Center the paper title at the top of the page in 16-pt. bold. Only the first word, proper nouns, and acronyms are capitalized. Keep titles brief and descriptive. Avoid starting with articles or prepositions, e.g., “The study of … ,” “On the ….” Spell out acronyms unless they are widely known. The list of authors immediately follows the title, in 12-pt. regular, with each line centered. Omit titles or degrees such as Dr., Prof., Ph.D, etc. The list of affiliations follows, with clear notation for each author’s affiliation.1.2 Section headings and attributesType each section heading on a separate line in 11-pt. bold capitals, centered. Number sections sequentially, except for the Acknowledgments and References sections. Typical principal headings are 1. Introduction, 2. Methodology, 3. Data,4. RESULTS(body text)5. CONCLUSIONSAcknowledgments, and References. Only the first word, acronyms, and proper nouns in a subsection heading are capitalized. The subsection heading is left-justified and formatted in 10-pt. bold. Number sections following this example: Sec. 3.1 is the first subsection of Sec. 3; Sec. 3.2.1 is the first subsection of Sec. 3.2.REFERENCES1.(References) A. Eisenberg, Guide to Technical Editing, Oxford University, New York, 1992.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Inferring Templates from Spreadsheets∗Robin AbrahamSchool of EECSOregon State University abraharo@Martin ErwigSchool of EECSOregon State University erwig@ABSTRACTWe present a study investigating the performance of a system for automatically inferring spreadsheet templates. These templates allow users to safely edit spreadsheets,that is,certain kinds of errors such as range,reference,and type errors can be provably prevented.Since the inference of templates is inherently ambiguous,such a study is required to demonstrate the effectiveness of any such automatic sys-tem.The study results show that the system considered performs significantly better than subjects with intermedi-ate to expert level programming expertise.These results are important because the translation of the huge body of exist-ing spreadsheets into a system based on safety-guaranteeing templates cannot be performed without automatic support. We also carried out post-hoc analyses of the video recordings of the subjects’interactions with the spreadsheets and found that although expert-level subjects needed less time and de-veloped more accurate templates than less experienced sub-jects,they did not inspect fewer cells in the spreadsheet. Categories and Subject DescriptorsD.2.7[Software Engineering]:Distribution,Mainte-nance,and Enhancement;H.4.1[Information Systems Applications]:Office Automation—spreadsheets KeywordsSpreadsheet Specification,Template Inference,End-User Software Engineering1.INTRODUCTIONA study conducted this year based on data from the U.S. Bureau of Labor Statistics shows that there are currently as many as11million end-user programmers in the United States,compared to only2.5million professional program-mers[32].Many of these end-user programmers develop ∗This work is partially supported by the National Science Foundation under the grant ITR-0325273and by the EUSES Consortium().Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on thefirst page.To copy otherwise,to republish,to post on servers or to redistribute to lists,requires prior specific permission and/or a fee.International Conference on Software Engineering2006,Shanghai,China Copyright200X ACM X-XXXXX-XX-X/XX/XX...$5.00.spreadsheets.Moreover,the number of American workers who use spreadsheets is even higher,about23million work-ers,which amounts to30%of the workforce.Numerous studies have shown that existing spreadsheets contain er-rors at an alarmingly high rate[6,19,23,33].Some studies report that up to90%of real-world spreadsheets contain er-rors[27].These errors impact people directly because they use spreadsheet systems,and indirectly by the decisions that are based on spreadsheet calculations.Spreadsheet systems offer users a high level offlexibility. This aspect makes it easier for people to get started work-ing with spreadsheets.The downside is that this freedom also offers ample opportunity to create erroneous spread-sheets.Errors during creation of a spreadsheet are made as well as when modified by other users.The problem gets further exacerbated when the people who use or modify the spreadsheet do not fully understand its functionality.This situation arises because spreadsheet systems do not offer any higher-level abstractions.Moreover,data and compu-tation are not separated in spreadsheets,and the immedi-ate visual feedback mechanism makes traditional coding and program compilation/execution steps indistinguishable from each other.These factors make widespread reuse of spread-sheets difficult and prone to errors.Since a spreadsheet is essentially a program,we address the problem along the lines of traditional Software Engineer-ing approaches to software development.The key aspect of our approach is that we separate the modeling and data-entry aspects of spreadsheet development.We have devel-oped a visual language called V i tsl(an acronym for vi sual t emplate s pecification l anguage)[3]for modeling spread-sheet templates.The user can import a V i tsl template into Gencel[11,12],a spreadsheet system we have developed as an add-on to Excel,and create and edit spreadsheets that are guaranteed to conform to the template.In Figure1,on the left,we show how spreadsheets are usually developed.In this case,the application-level and data-level updates are both performed on the spreadsheet directly.On the right we show the V i tsl/Gencel model of spreadsheet development.In this case,the application-level updates are performed on the V i tsl template,while the safe data updates are performed on the spreadsheet. The updates are safe in the sense that they are customized according to the template and the user is only allowed to change data values.The system prohibits direct changes to the spreadsheet formulas.Formulas will be automatically updated whenever rows or columns are inserted or deleted. The spreadsheet generator component of the framework al-lows the user to generate the spreadsheets from the V i tsltemplate.SpreadsheetModel UpdatesSafe DataUpdatesTemplateSpreadsheet GeneratorTemplate Inference SpreadsheetModel UpdatesData UpdatesFigure 1:Vitsl/Gencel model of spreadsheets.In the original scenario,once a template was created and loaded in Gencel,it was not possible to change the tem-plate and have the changes propagate to the already created spreadsheet data.Moreover,templates had to be developed from scratch.That is,there was no way of inferring a tem-plate from an already existing spreadsheet,which limits the applicability of this approach and makes a transition very costly.In this paper we address this problem and describe a method for inferring templates from spreadsheets.The template inference component shown highlighted in Fig-ure 1complements the spreadsheet generator and enables a broader and more flexible use of the V i tsl /Gencel approach.However,a challenge is presented by the fact that the tem-plate inference process is inherently ambiguous.Therefore,in order to judge the effectiveness of the developed method,we have performed a study to assess the reliability of tem-plate inference.The rest of this paper is structured as follows.In the next section we describe our template-based approach that protects spreadsheet users from a large class of errors.In Section 3we describe a method that we have developed to extract templates from spreadsheets and discuss the imple-mentation and working of the system with a couple of ex-amples.In Section 4we describe a study we carried out to evaluate the system.Related work is described in Section 5,and we present future work and conclusions in Section 6.2.TOW ARDS SAFER SPREADSHEETSIn this section,we illustrate some common problems in existing spreadsheet systems through an example.In partic-ular,we illustrate how errors can be introduced into spread-sheets.We then show how the errors can be avoided by using the V i tsl /Gencel system.2.1A ScenarioSharon is an elementary school teacher who has created a grading spreadsheet for her class,in which she records points for students on individual assignments,see Figure 2.This spreadsheet contains one row for each student and two columns for each assignment.Since different assignments have different total number of points in general,the spread-sheet stores for each student and assignment,the number of points earned by the student as well as the percentage of that number with respect to the total number of points for that assignment.The overall performance of each student is computed in the rightmost column by an average of the percentages over all the assignments.After having added several students,Sharon notices that her formula forcomputing percentages,=B3/B2,was notFigure 2:Grade sheet.properly propagated to the newly inserted rows.After some time she figures out that the column number of the cell containing the total number of points must not be relative,but an absolute address.Therefore,she changes the formula to =B3/B$2.1After she has graded a new assignment,Sharon adds the results into the spreadsheet.She inserts two columns and fills in the data.However,she notices that the average for the first student seems to be too low,see Figure 3.Inspect-ing the formula in cell H3,she learns that Excel has not automatically updated the formula,which is still =AVER-AGE(C3,E3),representing an average over the non-contiguous range.2Therefore she has to update all the formulas in column H by hand,that is,she changes the formula in H3to =AVERAGE(C3,E3,G3),and similarly for cells H4,H5,etc.The procedure is time consuming and prone to errors.Even worse,she realizes that she has to repeat this update ordeal again and again for everynew assignment she wants to add.Figure 3:Grade sheet after updates.This example demonstrates that update operations of-fered by existing spreadsheet systems are weak and ill-defined in the sense that they do not provide adequate safety guarantees and make it easy to introduce errors.What makes errors like the one shown particularly harmful is that they are generally not introduced in a single cell,but can in-validate many cells at once.The study reported in [6]found that 65%of all spreadsheet errors are contained in formulas.The fact that a semantic update operation,the insertion of a new assignment,has to be implemented by Sharon in terms of a number of low-level operations (namely,two column in-sertions,copying of formulas,and adjusting multiple formu-las)is problematic since it is not enforced by the spreadsheet 1At this point,many non-professional spreadsheet users would have probably not gone all the way to figure out the correct referencing mode,which would have caused the spreadsheet to be already incredibly difficult to maintain.2If the range was contiguous,Excel would update the for-mula automatically and include the newly-inserted cell.system that all the required steps be performed.Therefore, any omission might leave the spreadsheet in an inconsistent state.Moreover,each individual step presents another op-portunity to introduce errors into the spreadsheet.One reason for this situation is that existing spreadsheet systems work with a simple programming model of aflat collection of cells that do not contain any structure other than their arrangement on a grid.This lack of modular-ity and abstractions has been reported as a major weak-ness of spreadsheet systems[20].One particular problem is that cells are identified by global row and column numbers (letters)so that references to cells or subareas of a spread-sheet have to be expressed using these global addresses.The global cell addressing schema has been blamed for compli-cating the comprehension of spreadsheets and for location errors[58].The lack of structure and abstraction puts current spread-sheet systems into the category of assembly languages when compared to the state of the art in other programming lan-guages.This situation is peculiar because spreadsheet sys-tems are equipped with very sophisticated user interfaces offering many fancy features,which can distract from their intrinsic language limitations.The rigid,global addressing scheme makes computations vulnerable to changes in the structure of the spreadsheet—much like in the old days of assembly language programming where the introduction of a new item into the memory could cause some references to become invalid.Related is the problem of viscosity,which means the difficulty of changing one part of a program with-out changing other parts[16].In the presented example, high viscosity can be observed,for example,when the to-tal number of points per assignment is moved one cell to the right.In that case,it is necessary to change all percent-age formulas in that column afterwards.Studies have shown that users try to exploit the surface structure of spreadsheets [30]and that spreadsheets should therefore make their in-herent structure visible.Next we will outline an approach for explicitly represent-ing and enforcing structure in spreadsheet applications that follows these insights.By separating model and data up-dates into two layers,many of the described problems can be avoided.In particular,a large class of spreadsheet errors can be exterminated from spreadsheets altogether.2.2Safer Spreadsheets with ViTSL/Gencel The model layer of a spreadsheet application can be de-scribed by a visual language for structuring spreadsheets, allowing reuse and preventing errors.The idea originates by noticing that a given spreadsheet may evolve in a number of predictable ways,and various instances of a spreadsheet could emerge from a common template.The visual lan-guage V i tsl provides a method for modeling the template of a spreadsheet and the ways it can evolve[3].V i tsl templates are constructed with an editor and are loaded into Gencel[11],which is an Excel extension that manages the evolution of a spreadsheet from a V i tsl tem-plate.This environment automatically handles all formula generation and spreadsheet structure modification,ensuring that all spreadsheet formulas are correct and allowing the user to focus on data entry and analysis.Templates also act as a documentation to describe the functionality of the spreadsheet without reference to particular instances. From the example presented in Section2.1we can observe that once the structure of the spreadsheet application has beenfixed,the teacher progresses by performing basically three kinds of updates:add another student(row),add an-other assignment(two columns),or update points and labels (for assignments or student names).The teacher may also choose to delete an assignment or a student,although this is probably less common.On a closer look,we can observe that each of these op-erations can be broken down into afixed set of necessary steps,in particular,adding rows or columns and updating formulas and data.In this way,an initial spreadsheet with one assignment,a spreadsheet with two assignments,and a spreadsheet with seven assignments are all related.In this sense,the spreadsheets from Figures2and3(once cor-rected)can be thought of as deriving from the one shown in Figure4(shown in formulaview).Figure4:Grade sheet in Gencel.From this sample sheet,any number of spreadsheets may be derived using the operations provided by Gencel.These operations,which consist of row or column insert,value up-date,and row or column delete,are specialized for this par-ticular sample sheet to ensure that updates occur correctly with all necessary changes.For example,if Sharon presses the insert column button(see right panel in Figure4)when the cursor is within an assignment group,two new columns representing a new assignment will be inserted at once and all the formulas(the percentage formulas as well as the av-erage formula at the far right)will be correctly updated instantly.The Gencel system provides these specialized updates to ensure the correctness of formulas.Since the sample sheet is generic with respect to the actual students and assign-ments,and other labels and values,it may be reused by various users at different times.In all cases,the safety and correctness of the formulas and structure within the Gencel system is assured.From the sample sheet shown in Figure4it is not immedi-ately clear which columns and rows arefixed and which are expandable,which makes the inference process challenging. However,the creator of the grading spreadsheet application would know about the intended behavior and could specify the corresponding information,in this case a two-column horizontal expanding group,called hex group,which forms an assignment,and a single-row vertical expanding group, called vex group,for each student.In addition,an aggrega-tion formula that computes the average of the percentages for each student is contained in the hex group to the right of the vex group,and so on.By abstracting out the build-ing blocks from the concrete Gencel spreadsheet in this way, we can fully and formally describe the operations requiredto create a spreadsheet.This is the purpose of V i tsl —to provide a visual specification language for spreadsheets and their evolutions.The V i tsl template for the above Gencel spreadsheet is shown in Figure 5.The vex group is repre-sented by the ellipsis ...following row 3,which can be ex-panded.Similarly,the hex group is represented by the ellip-sis ···.The fact that the hex group consists of two columns is represented by the absence of the separating line between the column headers B and C .In addition to the formulas,the template consists of labels,such as Assg and Name ,that will generally not be edited in the generated Gencel spreadsheet and the sample values,such as 10,abc ,and 0,that will beedited.Figure 5:Grade sheet template in ing Gencel,Sharon simply has to load the V i tsl tem-plate and then press the insert column button two times to create the assignments.All formulas are updated cor-rectly and automatically and are protected against unin-tended changes.Similarly,for adding a new student,press-ing the insert row button is all that is needed to update the formulas in the spreadsheet.Therefore,Sharon can concen-trate on entering data and does not have to worry about formulas.In particular,the errors illustrated in Section 2.1would have been prevented using Gencel.In general,Gencel provably eliminates the following kinds of errors from spreadsheets [12].•Range errors (for example,omitted or additional cells in aggregations)•Reference errors (for example,references to wrong cells or circular references)•Type errors (for example,using strings in numeric computations)The impact of these errors have been extensively docu-mented.For example,a range error has caused a Florida construction company to underbid a project by a quarter of a million dollars [17].An example of a type error is the illegal interpretation of a date as a numeric value,which caused an operating fund of the Colorado Student Loan Program to be understated by $36,131[34].Finally,a refer-ence error caused a hospital’s records to overstate its Med-icaid/Medicare crossover log by $38,240[35].The use of Gencel would have prevented all these errors.3.EXTRACTING TEMPLATES FROMSPREADSHEETSWe anticipate that Gencel will be used by spreadsheet users working with V i tsl templates developed by domainexperts who have some programming experience.In the case of legacy spreadsheets,it would be vital (from an adoption point of view)to have tools that extract the tem-plates automatically.In this section we discuss algorithms for extracting V i tsl templates from spreadsheets.This effort is a first step towards reverse engineering spread-sheets.In related work,we have developed ClassSheets [10],which is a more expressive form of spreadsheet specifica-tions.ClassSheets could potentially also be the target of future reverse-engineering efforts.There is a high level of ambiguity associated with spread-sheet template inference since spreadsheets are the result of a mapping of higher-level abstract models in the user’s mind to a simple two-dimensional grid structure.Moreover,spreadsheets do not impose any restrictions on how the users map their mental models to the two-dimensional grid (flexi-bility is one of the main reasons for the popularity of spread-sheets).Therefore the relationship between the model and the spreadsheet is essentially many-to-many,and we suspect that template inference of spreadsheets will generally require user input to resolve ambiguities.The current version of the system only displays one (the first)template it comes up with.In future versions we plan to incorporate interaction mechanisms by which the user can pick from a list of possi-ble templates.Another problem is that,in some cases,the spreadsheet being considered might not have enough infor-mation for the correct template to be inferred.For example,in the spreadsheet shown in Figure 2,if data for only one student was present,the template inference system should be able to identify the hex group but it simply does not have information to identify the vex group (for the student data).While developing the algorithms for the system,we were guided by two principles.1.The generated template should be the smallest pos-sible,starting from which the user should be able to generate the target spreadsheet using only Gencel insert/delete row/column commands and changes to data cells.2.The system should be tolerant to errors within the spreadsheet.The user should be able to control the tolerance threshold.In the following subsections we discuss the steps involved in extracting V i tsl templates from spreadsheets.We use the corrected version of the grade sheet shown in Figure 3as a running example to explain the steps involved in template inference.3.1Identifying Tables in SpreadsheetsWe have observed in some cases that end users put unre-lated information in the same spreadsheet (maybe so they have all their data in the same sheet).We define a table as (part of)a spreadsheet that is an instance of a V i tsl template.In case the user has unrelated information in the same spreadsheet,we are faced with the scenario of a single spreadsheet containing multiple tables.It is therefore im-portant to identify the different tables within a spreadsheet since inferring a common template for unrelated data that just happens to be in the same sheet would be a mistake.We have reused some spatial analysis algorithms from the UCheck tool [1]to break up the spreadsheet into connected cell areas we treat as tables.In the grade sheet shown in Figure 3,the cell area from A1to H5is a single table.3.2Oncethe next step is to identify regions within each table area containing similar formulas.The idea is to reduce sets of similar formulas to hex and vex groups.We follow a strat-egy of identifying maximal sets of similar formulas which maximizes the number of instances of repeating groups and thus minimizes the size of the inferred template.Since the described approach hinges on the notion of cell similarity, we will discuss this notion next.Two formulas are similar if they satisfy the cp-similarity criterion described in[8].Two cells are cp-similar if their formulas could have resulted from a copy/paste action from one of the cells to the other.An absolute reference points to a particular cell in the spreadsheet and will point to the same cell even if the reference is copied to another cell in the sheet.A relative reference refers to a cell based on its position relative to the cell containing the reference.If a relative reference is copied to another cell,it will point to a cell at the same relative position with respect to the new location.Excel allows two reference schemes in cells.1.In the A1-style referencing scheme,relative referencesare of the form A2(both the row and column change when the reference is copied to a new cell)and abso-lute references are of the form A$3(the row number remains unchanged if the reference is copied to a new location),$A3(the column number remains unchanged if the reference is copied to a new location),or$A$3 (both the column and rows remain unchanged if the reference is copied to a new location.2.In the R1C1-style,a reference B3in cell C3,for ex-ample,would be represented as RC[-1]—reference the cell in this row and one column to the left of this one.Along similar lines,a formula=B3/B$2in cell C3could be represented as=RC[-1]/R2C[-1]in the R1C1style. We follow the approach described in[8]and decide two for-mulas are cp-similar by comparing their R1C1-style repre-sentations.The cp-similar formula cells in the grade sheet have been marked in Figure6.Note that column headers are num-bered in R1C1-style in Excel.The cells enclosed by the blue rectangles all have the formula=RC[-1]/R2C[-1].All thehave the for-by comparingthe systemby the blue rectangles and the one enclosed by the brown rectangle) within the spreadsheet.The cells whose formulas have been found to be cp-similar are grouped on the basis of rows and columns.The cp-similar blocks are indicators for repeating groups.For ex-ample if the formula cells in one row are cp-simlar to cells in the same columns in another row,the two rows could be instances of the same vex group.The system does a column-wise and then a row-wise partitioning of the cp-similar cells. This sequence is followed simply because V i tsl only allows nesting of vex groups within hex groups.Note that this representation is as expressive as only allowing nesting of hex groups within vex groups.The column-wise partition-ing generates the lists[C3,C4,C5],[E3,E4,E5],and[G3,G4,G5] as potentially belonging to the same hex group.Similarly, the row-wise partitioning generates the lists[C3,E3,G3,H3], [C4,E4,G4,H4],and[C5,E5,G5,H5]as(parts of)potential ex-pansions of the same vex group.3.3Inferring TemplatesOnce the cells within a table area have been partitioned into regions containing cp-similar formulas,the system tries to overlay them(along with the regions they refer to)to generate the templates.In addition to the formula cells, we also compare the referenced data cells in the two rows to check if they have the same type.If the corresponding formula cells are cp-similar and the corresponding data cells are of the same type,we have a perfect match.For example, based on the column-wise partitioning of the cp-similar cells, the system tries to overlay the cells in the lists[C3,C4,C5]and [E3,E4,E5].The cells in thefirst list have references to the cells B2,B3,B4,and B5,and the cells in the second list have references to the cells D2,D3,D4,and D5.The system compares the corresponding referenced cells to check that they have the same types.If this condition is satisfied,we have strong indication that columns D and E together come from the same hex group as columns B and C.The same reasoning is applicable to columns F and G as well,and they too can be considered to be instances of the same hex group as columns B and C.Along similar lines,rows3,4,and5are inferred to be the instances of the same vex group.In some cases,the data cells might not agree,for example, if the data in a cell has been omitted.Figure7shows part of a grade sheet that was used in the study.The rows that store information for each of the students are all part of the same vex group.The data in row10differs from the others since the student dropped the course in week2.Because of this,the lab and quiz score entries for this student are all blank from E10onwards in the row.The system is tolerant to such minor deviations(integer values for the scores in the other rows and blanks in the corresponding cells in row10) and can nevertheless distill the template for thespreadsheet.Figure7:Deviations from template.3.4Template Inference in ActionIn our system,the user can open an Excel spreadsheet and then click the button labeled“Template”(on the right toolbar in Figure5).The system carries out the automatic extraction of the spreadsheet template as described above (for the grade sheet in the example shown in Figure5)and displays it in a new worksheet with“-Templ”appended to the name of the originalworksheet.Figure8:Automatically inferred grade sheet tem-plate.The system shades vex groups light blue and hex groups pink.Cells in the template that are part of vex and hex groups are shaded purple.In case you are reading a black and white printout of this paper,A3and D3have been shaded blue,B1,B2,C1,and C2have been shaded pink, and B3and C3have been shaded purple by the system.The system retains some of the values from the spreadsheet as default values in the templates.We made this design choice under the assumption that the default values would serve as an example and help the user get started with the task of modifying the spreadsheet.The default values might also serve as documentation and remind the users of the original spreadsheet from which the template is inferred.Besides the default values,the template shown in Figure8is the exact same one shown in Figure5in the V i tsl editor.The inferred templates can be saved as V i tsl templates and can be further edited in the V i tsl editor or be directly loaded into Gencel.The system described above allows the user to adopt a veryflexible approach to developing safe spreadsheets within the V i tsl/Gencel framework.The user could start with a V i tsl template and then work with the spreadsheet in Gencel or the user could start with an Excel spreadsheet di-rectly and then infer the V i tsl template using the tool and then continue using Gencel.The user might also start creat-ing a spreadsheet with a V i tsl template loaded in Gencel. At some point,if the user wants to deviate from the ini-tial template,she could turn offGencel,work in Excel(in an unrestricted mode so to speak),invoke the template in-ference system to generate a V i tsl template for the new spreadsheet,reactivate Gencel and continue working with the spreadsheet.The template inference system puts the safety features of Gencel within the grasp of people and or-ganizations who have spreadsheets they might have invested considerable time and effort in developing.4.EV ALUATIONOne particular spreadsheet could potentially be generated from many different templates.This precludes the possibil-ity of automatically validating the correctness of the tem-plates generated by our system by an oracle.The creator of the spreadsheet would be the one in the best position to decide if the spreadsheet and the template generated by the automatic extractor match up.We assume this judg-ment would become more accurate with increasing experi-ence with spreadsheet systems and the domain.For exam-ple,an accountant with considerable experience with spread-sheets would be in a better position to judge the correctness of a template for an accounting sheet than a person without any background in accounting.To judge the performance of our system,we compare tem-plates generated by the system against those generated by novice and expert subjects.The main goal is to assess the effectiveness/performance of a system that automates the task of extracting templates from spreadsheets.We are also interested in how experts and novices go about the task of inferring templates from spreadsheets.This information can be used for improving the inference tool and its interaction with the users.More formally,we seek to answer the follow-ing research questions.RQ1:How well does the system perform compared to expert and novice test subjects in extracting templates from spreadsheets?RQ2:Are there any patterns of behavior exhibited by novice and expert subjects when they are trying to under-stand spreadsheets in order to develop their templates? 4.1ParticipantsNineteen students from a300-level course on Software Engineering at Oregon State University participated in the study.We refer to this group of subjects as Group N.The course primarily dealt with the specification and design of software.UML was presented as the de facto standard mod-eling language for software,and V i tsl was presented as a language for modeling spreadsheets.Prior programming ex-perience ranged from two to ten years(in two to four lan-guages)and all the participants had between two and eight years of experience using spreadsheets.We chose students from this course as the test subjects because the target audi-。

相关文档
最新文档