__attribute__((__used__)) 和 __attribute__((__section__(“*“ “*“)))的使用

3 篇文章 0 订阅
1 篇文章 0 订阅

见:haproxy代码

C语言注册函数和调用函数,便于模块化开发和编程。

#include <stdio.h>

#ifdef __APPLE__
#define HA_SECTION(s)           __attribute__((__section__("__DATA, " s)))
#define HA_SECTION_START(s)     __asm("section$start$__DATA$" s)
#define HA_SECTION_STOP(s)      __asm("section$end$__DATA$" s)
#else
#define HA_SECTION(s)           __attribute__((__section__(s)))
#define HA_SECTION_START(s)
#define HA_SECTION_STOP(s)
#endif

/*
 * Please keep those names short enough, they are used to generate section
 * names, Mac OS X accepts section names up to 16 characters, and we prefix
 * them with i_, so stage name can't be more than 14 characters.
 */
enum init_stage {
	STG_PREPARE = 0,      // preset variables, tables, list heads
	STG_LOCK,             // pre-initialize locks
	STG_REGISTER,         // register static lists (keywords etc)
	STG_ALLOC,            // allocate required structures
	STG_POOL,             // create pools
	STG_INIT,             // subsystems normal initialization
	STG_SIZE              // size of the stages array, must be last
};

/* This is the descriptor for an initcall */
struct initcall {
	void (*const fct)(void *arg1, void *arg2, void *arg3);
	void *arg1;
	void *arg2;
	void *arg3;
#if defined(USE_OBSOLETE_LINKER)
	void *next;
#endif
};

/* declare a symbol as global */
#define __HA_GLOBL(sym)   __asm__(".globl " #sym)
#define HA_GLOBL(sym)     __HA_GLOBL(sym)

#define HA_INIT_SECTION(s)  HA_SECTION("i_" # s)

#define __DECLARE_INITCALL(stg, linenum, function, a1, a2, a3)     \
        HA_GLOBL(__start_i_##stg );                                \
        HA_GLOBL(__stop_i_##stg );                                 \
	static const struct initcall *__initcb_##linenum           \
	    __attribute__((__used__)) HA_INIT_SECTION(stg) =	   \
	        (stg < STG_SIZE) ? &(const struct initcall) {      \
		.fct = (void (*)(void *,void *,void *))function,   \
		.arg1 = (void *)(a1),                              \
		.arg2 = (void *)(a2),                              \
		.arg3 = (void *)(a3),                              \
	} : NULL

#define _DECLARE_INITCALL(...) \
	__DECLARE_INITCALL(__VA_ARGS__)

#define INITCALL0(stage, function)  \
	_DECLARE_INITCALL(stage, __LINE__, function, 0, 0, 0)

/* Declare func */
#define DECLARE_INIT_SECTION(stg)                                                   \
	extern __attribute__((__weak__)) const struct initcall *__start_i_##stg HA_SECTION_START("i_" # stg); \
	extern __attribute__((__weak__)) const struct initcall *__stop_i_##stg  HA_SECTION_STOP("i_" # stg)

#define FOREACH_INITCALL(p,stg)                                               \
	for ((p) = &(__start_i_##stg); (p) < &(__stop_i_##stg); (p)++)

#define RUN_INITCALLS(stg)                                                     \
	do {                                                                   \
		const struct initcall **ptr;                                   \
		if (stg >= STG_SIZE)                                           \
			break;                                                 \
		FOREACH_INITCALL(ptr, stg)                                     \
			(*ptr)->fct((*ptr)->arg1, (*ptr)->arg2, (*ptr)->arg3); \
	} while (0)

/* register func1 */
static void _do_register_func1(void)
{
    printf("TEST: _do_register_func1()\n");
}
#if 0
__asm__(".globl " "__start_i_STG_REGISTER"); 
__asm__(".globl " "__stop_i_STG_REGISTER"); 
static const struct initcall *__initcb_405 __attribute__((__used__)) __attribute__((__section__("i_" "STG_REGISTER"))) = (STG_REGISTER < STG_SIZE) ? &(const struct initcall) 
{ 
    .fct = (void (*)(void *,void *,void *))_do_register, 
    .arg1 = (void *)(0), 
    .arg2 = (void *)(0), 
    .arg3 = (void *)(0), 
} : ((void *)0);
#endif
INITCALL0(STG_REGISTER, _do_register_func1);

/* register func2 */
static void _do_register_func2(void)
{
    printf("TEST: _do_register_func2()\n");
}
INITCALL0(STG_REGISTER, _do_register_func2);

/* register func3 */
static void _do_register_func3(void)
{
    printf("TEST: _do_register_func3()\n");
}
INITCALL0(STG_REGISTER, _do_register_func3);

/* declare func1, func2, func3 */
DECLARE_INIT_SECTION(STG_REGISTER);

int main(int argc, char *const argv[])
{
    /* call func1, func2, func3 */
    RUN_INITCALLS(STG_REGISTER);

    printf("hello world\n");
    return 0;
}

编译和运行:

ubuntu@dev:test-06$ gcc test1.c
ubuntu@dev:test-06$ ./a.out 
TEST: _do_register_func1()
TEST: _do_register_func2()
TEST: _do_register_func3()
hello world

不使用__attribute__((used)) 和 attribute((section(““ ““)))

#include <stdio.h>

/* register func1 */
static void _do_register_func1(void)
{
    printf("TEST: _do_register_func1()\n");
}

/* register func2 */
static void _do_register_func2(void)
{
    printf("TEST: _do_register_func2()\n");
}

/* register func3 */
static void _do_register_func3(void)
{
    printf("TEST: _do_register_func3()\n");
}

int main(int argc, char *const argv[])
{
    /* call func1, func2, func3 */
    _do_register_func1();
    _do_register_func2();
    _do_register_func3();

    printf("hello world\n");
    return 0;
}
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
View Assessment Result: Multiple-Choice Quiz 2 Your performance was as follows: 1. The degree of a table is the number of _____ in the table. (a) keys (b) columns (c) rows (d) foreign keys Correct answer is (b) Your score on this question is: 10.00 Feedback: (b) -------------------------------------------------------------------------------- 2. The arity of a table is the number of _____ in the table. (a) keys (b) columns (c) foreign keys (d) rows Correct answer is (b) Your score on this question is: 10.00 Feedback: (b) -------------------------------------------------------------------------------- 3. What information is necessary when specifying the structure of a table? (a) the name of the table and the amount of storage space to be allocated to the table (b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (c) the name of the table and the names of the table's attributes (d) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) -------------------------------------------------------------------------------- 4. The foreign key in a table T1 _____ the same _____ as the corresponding primary key in table T2. must have, name need not have, name must have, domain (a) I, II, and III (b) I and II (c) I and III (d) II and III Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) -------------------------------------------------------------------------------- 5. Which of the following SQL statements can be used to add a row to a table? (a) CREATE (b) INSERT (c) APPEND (d) ADD Correct answer is (b) Your score on this question is: 10.00 Feedback: (b) -------------------------------------------------------------------------------- 6. A difference operation can be applied to tables that (a) are union compatible (b) have the same column names (c) have the same name (d) are the same size Correct answer is (a) Your score on this question is: 10.00 Feedback: (a) -------------------------------------------------------------------------------- 7. Which of the following SQL statements can be used to create a relational table? (a) INSERT (b) ADD (c) CREATE (d) APPEND Correct answer is (c) Your score on this question is: 10.00 Feedback: (c) -------------------------------------------------------------------------------- 8. For two tables to be union compatible, the tables should be the same with respect to which of the following? (a) keys (b) cardinality (c) name (d) degree Correct answer is (d) Your score on this question is: 0.00 Feedback: (b) -------------------------------------------------------------------------------- 9. A deletion operation will _____ if the deletion leads to the violation of a referential integrity constraint. (a) fail (b) succeed with warning (c) succeed without warning (d) crash the system Correct answer is (a) Your score on this question is: 10.00 Feedback: (a) -------------------------------------------------------------------------------- 10. With Query By Example, a user enters a query by (a) filling in skeleton tables of the database with examples of what is to be retrieved (b) placing SQL keywords, such as select, under the column names they want to retrieve (c) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (d) writing an English description of the data that the user needs Correct answer is (a) Your score on this question is: 10.00 Feedback: See section 1.2.3 in the course notes. (a) -------------------------------------------------------------------------------- Go to top of assessment. Total score: 90.00 ? Copyright 2008 iCarnegie, Inc. All rights reserved. 1. In the Entity-Relationship model, the degree of a relationship specifies which of the following? (a) The cardinality ratio of the relationship (b) The number of integrity constraints required to implement the relationship (c) The number of attributes that characterize the relationship (d) The number of entities that participate in the relationship Correct answer is (d) 2. In an ER model, which of the following is true about a component attribute? (a) A component attribute is always atomic. (b) Component attributes must always be combined by an aggregation operation. (c) A component attribute can be a composite attribute. (d) A component attribute always contains other components. Correct answer is (c) 3. In the Entity-Relationship model, properties that characterize entities and relationships are modeled as (a) attributes (b) participation constraints (c) entity types (d) weak entities Correct answer is (a) 4. What is an identifying owner in an ER model? (a) The entity upon which a weak entity's existence depends (b) The relationship that identifies a weak entity's owner (c) The entity upon which a strong entity's existence depends (d) The relationship that identifies a strong entity's owner Correct answer is (a) 5. In an ER model, the cardinality ratio of a relationship type is (a) the number of instances of relationships of that relationship type (b) the number of entity types involved in that relationship type (c) the number of relationships of that relationship type in which an entity can participate (d) the minimum number of entities that can participate in that relationship type Correct answer is (c) 6. Which of the following is true about storage for derived attributes? (a) Derived attributes must not be stored. (b) Derived attributes are usually stored because storage improves retrieval performance. (c) Derived attributes must be stored. (d) Derived attributes are usually not stored because they can be computed. Correct answer is (d) 7. In an ER model, what is a recursive relationship type? (a) A never-ending type of relationship (b) The type of relationship that does not belong anywhere (c) The type of relationship between entities of one entity type (d) The relationship type where the related entities are one and the same Correct answer is (c) 8. In EER modeling, generalization is the process of generating (a) superclasses out of subclasses (b) subclasses out of superclasses (c) entities out of attributes (d) attributes out of entities Correct answer is (a) 9. When mapping from an ER model to a relational model, a strong entity is mapped into a (a) table (b) row (c) column (d) key Correct answer is (a) 10. Which of the following is true about attributes in a relational model? Attributes can be multi-valued. Attributes can be composite. (a) Both I and II (b) II only (c) Neither I nor II (d) I only Correct answer is (c) 1. In an ER model, what is a recursive relationship type? (a) The relationship type where the related entities are one and the same (b) The type of relationship that does not belong anywhere (c) The type of relationship between entities of one entity type (d) A never-ending type of relationship Correct answer is (c) 2. In an ER model, the cardinality ratio of a relationship type is (a) the number of relationships of that relationship type in which an entity can participate (b) the minimum number of entities that can participate in that relationship type (c) the number of entity types involved in that relationship type (d) the number of instances of relationships of that relationship type Correct answer is (a) 3. In the Entity-Relationship model, a derived attribute is one (a) that is composed of multiple atomic attributes (b) that characterizes a relationship instead of an entity (c) that may have multiple values simultaneously (d) whose value can be computed from the values of other attributes Correct answer is (d) 4. In the Entity-Relationship model, properties that characterize entities and relationships are modeled as (a) entity types (b) weak entities (c) attributes (d) participation constraints Correct answer is (c) 5. Which of the following is true about storage for derived attributes? (a) Derived attributes must be stored. (b) Derived attributes are usually stored because storage improves retrieval performance. (c) Derived attributes must not be stored. (d) Derived attributes are usually not stored because they can be computed. Correct answer is (d) 6. What is an identifying owner in an ER model? (a) The relationship that identifies a weak entity's owner (b) The relationship that identifies a strong entity's owner (c) The entity upon which a strong entity's existence depends (d) The entity upon which a weak entity's existence depends Correct answer is (d) 7. In an ER model, which of the following is true about a component attribute? (a) A component attribute always contains other components. (b) A component attribute can be a composite attribute. (c) A component attribute is always atomic. (d) Component attributes must always be combined by an aggregation operation. Correct answer is (b) 8. In EER modeling, generalization is the process of generating (a) attributes out of entities (b) superclasses out of subclasses (c) subclasses out of superclasses (d) entities out of attributes Correct answer is (b) 9. When mapping from an ER model to a relational model, a strong entity is mapped into a (a) key (b) row (c) column (d) table Correct answer is (d) 10. Which of the following is true about attributes in a relational model? Attributes can be multi-valued. Attributes can be composite. (a) I only (b) II only (c) Neither I nor II (d) Both I and II Correct answer is (c) 1. Through normalization, update anomalies (a) can be eliminated (b) is usually left unchanged (c) can be maximized (d) can be minimized but not eliminated Correct answer is (a) 2. Which of the following is a property (are properties) exhibited by good relational schemas? The use of null values in tuples The grouping of as many attributes as possible into one main table The elimination of data redundancy to avoid update anomalies (a) III only (b) None (c) I and II only (d) II and III only Correct answer is (a) 3. Which of the following statements concerning normal forms is true? (a) A relation that is in second normal form is also in first normal form. (b) The lower the normal form number, the better the schema design is. (c) Each normal form contains a state of independent properties, unrelated to other normal forms. (d) Schemas that are in second normal form are considered the best. Correct answer is (a) 4. Consider the following functional dependency. {A, B} -> {C} Regarding this dependency, which of the following statements is (are) true? The values of C are uniquely determined by the values of A. The values of A are uniquely determined by the values of C. (a) None (b) II only (c) I only (d) I and II Correct answer is (a) 5. Which of the following problems can be caused by data redundancy in a relational schema? Inefficient use of space Update anomalies and possible loss of data Inefficient use of processing time (a) I and II only (b) I and III only (c) I, II, and III (d) II only Correct answer is (c) 6. Consider a table with atomic attributes A, B, and C and the following functional dependencies. A -> B B -> C If the primary key of this table is attribute A, then this relation satisfies which of the following normal forms? First Second Third (a) None (b) I only (c) I, II and III (d) I and II only Correct answer is (d) 7. For a relation to be in 3NF, it should not contain _____ attribute that is transitively dependent on _____. (a) a non-primary key, a foreign key (b) a primary key, a non-primary key (c) a primary key, a foreign key (d) a non-primary key, the primary key Correct answer is (d) 8. The FD X -> Y is a full dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, added to (b) no, removed from (c) at least one, removed from (d) at least one, added to Correct answer is (b) 9. For a relation to be in 2NF, _____ attribute must be fully functionally dependent on _____. (a) every non-primary-key, the primary key (b) every alternate key, the primary key (c) every non-key, every key (d) every non-key, at least one key Correct answer is (a) 10. The FD X -> Y is a partial dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) at least one, removed from (b) at least one, added to (c) no, added to (d) no, removed from Correct answer is (a) 1. Through normalization, update anomalies (a) can be eliminated (b) is usually left unchanged (c) can be minimized but not eliminated (d) can be maximized Correct answer is (a) 2. Consider the following functional dependency. {A, B} -> {C} Regarding this dependency, which of the following statements is (are) true? The values of C are uniquely determined by the values of A. The values of A are uniquely determined by the values of C. (a) None (b) I and II (c) I only (d) II only Correct answer is (a) 3. Which of the following is a property (are properties) exhibited by good relational schemas? The use of null values in tuples The grouping of as many attributes as possible into one main table The elimination of data redundancy to avoid update anomalies (a) III only (b) None (c) II and III only (d) I and II only Correct answer is (a) 4. Through normalization, data redundancy (a) can be eliminated (b) can be maximized (c) can be minimized but not eliminated (d) are usually left unchanged Correct answer is (a) 5. Which of the following statements concerning normal forms is true? (a) A relation that is in second normal form is also in first normal form. (b) Each normal form contains a state of independent properties, unrelated to other normal forms. (c) Schemas that are in second normal form are considered the best. (d) The lower the normal form number, the better the schema design is. Correct answer is (a) 6. For a relation to be in 3NF, it should not contain _____ attribute that is transitively dependent on _____. (a) a primary key, a foreign key (b) a primary key, a non-primary key (c) a non-primary key, a foreign key (d) a non-primary key, the primary key Correct answer is (d) 7. The FD X -> Y is a full dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, removed from (b) at least one, removed from (c) at least one, added to (d) no, added to Correct answer is (a) 8. Consider a table with atomic attributes A, B, and C and the following functional dependencies. A -> B B -> C If the primary key of this table is attribute A, then this relation satisfies which of the following normal forms? First Second Third (a) I, II and III (b) None (c) I and II only (d) I only Correct answer is (c) 9. For a relation to be in 2NF, _____ attribute must be fully functionally dependent on _____. (a) every alternate key, the primary key (b) every non-key, at least one key (c) every non-key, every key (d) every non-primary-key, the primary key Correct answer is (d) 10. The FD X -> Y is a partial dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, added to (b) no, removed from (c) at least one, added to (d) at least one, removed from Correct answer is (d) 1. What is an identifying owner in an ER model? (a) The entity upon which a weak entity's existence depends (b) The relationship that identifies a weak entity's owner (c) The relationship that identifies a strong entity's owner (d) The entity upon which a strong entity's existence depends Correct answer is (a) 2. In an ER model, the cardinality ratio of a relationship type is (a) the minimum number of entities that can participate in that relationship type (b) the number of instances of relationships of that relationship type (c) the number of entity types involved in that relationship type (d) the number of relationships of that relationship type in which an entity can participate Correct answer is (d) 3. In the Entity-Relationship model, properties that characterize entities and relationships are modeled as (a) entity types (b) participation constraints (c) weak entities (d) attributes Correct answer is (d) 4. In an ER model, what is a recursive relationship type? (a) A never-ending type of relationship (b) The relationship type where the related entities are one and the same (c) The type of relationship between entities of one entity type (d) The type of relationship that does not belong anywhere Correct answer is (c) 5. In the Entity-Relationship model, a derived attribute is one (a) that characterizes a relationship instead of an entity (b) that may have multiple values simultaneously (c) whose value can be computed from the values of other attributes (d) that is composed of multiple atomic attributes Correct answer is (c) 6. In the Entity-Relationship model, the degree of a relationship specifies which of the following? (a) The number of attributes that characterize the relationship (b) The number of entities that participate in the relationship (c) The cardinality ratio of the relationship (d) The number of integrity constraints required to implement the relationship Correct answer is (b) 7. Which of the following is true about storage for derived attributes? (a) Derived attributes are usually not stored because they can be computed. (b) Derived attributes are usually stored because storage improves retrieval performance. (c) Derived attributes must be stored. (d) Derived attributes must not be stored. Correct answer is (a) 8. In EER modeling, generalization is the process of generating (a) superclasses out of subclasses (b) entities out of attributes (c) subclasses out of superclasses (d) attributes out of entities Correct answer is (a) 9. When mapping from an ER model to a relational model, a strong entity is mapped into a (a) key (b) table (c) row (d) column Correct answer is (b) 10. Which of the following is true about attributes in a relational model? Attributes can be multi-valued. Attributes can be composite. (a) II only (b) I only (c) Both I and II (d) Neither I nor II Correct answer is (d) 1. Which of the following is true about storage for derived attributes? (a) Derived attributes are usually stored because storage improves retrieval performance. (b) Derived attributes must be stored. (c) Derived attributes are usually not stored because they can be computed. (d) Derived attributes must not be stored. Correct answer is (c) 2. In an ER model, the cardinality ratio of a relationship type is (a) the minimum number of entities that can participate in that relationship type (b) the number of entity types involved in that relationship type (c) the number of relationships of that relationship type in which an entity can participate (d) the number of instances of relationships of that relationship type Correct answer is (c) 3. In the Entity-Relationship model, the degree of a relationship specifies which of the following? (a) The number of attributes that characterize the relationship (b) The number of integrity constraints required to implement the relationship (c) The cardinality ratio of the relationship (d) The number of entities that participate in the relationship Correct answer is (d) 4. In the Entity-Relationship model, properties that characterize entities and relationships are modeled as (a) weak entities (b) participation constraints (c) attributes (d) entity types Correct answer is (c) Your score on this question is: 0.00 5. A weak entity type implies a (a) weak relationship type (b) relationship with total participation constraint (c) strong relationship type (d) relationship with partial participation constraint Correct answer is (b) 6. In an ER model, which of the following is true about a component attribute? (a) A component attribute can be a composite attribute. (b) Component attributes must always be combined by an aggregation operation. (c) A component attribute always contains other components. (d) A component attribute is always atomic. Correct answer is (a) 7. In the Entity-Relationship model, a derived attribute is one (a) that characterizes a relationship instead of an entity (b) that is composed of multiple atomic attributes (c) whose value can be computed from the values of other attributes (d) that may have multiple values simultaneously Correct answer is (c) 1. Through normalization, update anomalies (a) is usually left unchanged (b) can be minimized but not eliminated (c) can be maximized (d) can be eliminated Correct answer is (d) 2. Which of the following problems can be caused by data redundancy in a relational schema? Inefficient use of space Update anomalies and possible loss of data Inefficient use of processing time (a) I and II only (b) I and III only (c) II only (d) I, II, and III Correct answer is (d) 3. Consider the following functional dependency. {A, B} -> {C} Regarding this dependency, which of the following statements is (are) true? The values of C are uniquely determined by the values of A. The values of A are uniquely determined by the values of C. (a) I only (b) I and II (c) II only (d) None Correct answer is (d) 4. Which of the following is a property (are properties) exhibited by good relational schemas? The use of null values in tuples The grouping of as many attributes as possible into one main table The elimination of data redundancy to avoid update anomalies (a) III only (b) II and III only (c) I and II only (d) None Correct answer is (a) 5. Which of the following statements concerning normal forms is true? (a) Schemas that are in second normal form are considered the best. (b) Each normal form contains a state of independent properties, unrelated to other normal forms. (c) A relation that is in second normal form is also in first normal form. (d) The lower the normal form number, the better the schema design is. Correct answer is (c) 6. The FD X -> Y is a partial dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) at least one, added to (b) at least one, removed from (c) no, removed from (d) no, added to Correct answer is (b) 7. For a relation to be in 2NF, _____ attribute must be fully functionally dependent on _____. (a) every non-primary-key, the primary key (b) every non-key, at least one key (c) every non-key, every key (d) every alternate key, the primary key Correct answer is (a) 8. Consider a table with atomic attributes A, B, and C and the following functional dependencies. A -> B B -> C If the primary key of this table is attribute A, then this relation satisfies which of the following normal forms? First Second Third (a) I only (b) None (c) I and II only (d) I, II and III Correct answer is (c) 9. The FD X -> Y is a full dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, removed from (b) at least one, removed from (c) at least one, added to (d) no, added to Correct answer is (a) 10. For a relation to be in 3NF, it should not contain _____ attribute that is transitively dependent on _____. (a) a primary key, a foreign key (b) a non-primary key, a foreign key (c) a non-primary key, the primary key (d) a primary key, a non-primary key Correct answer is (c) 1. Which of the following statements concerning normal forms is true? (a) The lower the normal form number, the better the schema design is. (b) A relation that is in second normal form is also in first normal form. (c) Schemas that are in second normal form are considered the best. (d) Each normal form contains a state of independent properties, unrelated to other normal forms. Correct answer is (b) 2. Consider the following functional dependency. {A, B} -> {C} Regarding this dependency, which of the following statements is (are) true? The values of C are uniquely determined by the values of A. The values of A are uniquely determined by the values of C. (a) I only (b) II only (c) I and II (d) None Correct answer is (d) 3. Which of the following problems can be caused by data redundancy in a relational schema? Inefficient use of space Update anomalies and possible loss of data Inefficient use of processing time (a) I, II, and III (b) I and II only (c) I and III only (d) II only Correct answer is (a) Y 4. Through normalization, update anomalies (a) can be eliminated (b) can be maximized (c) is usually left unchanged (d) can be minimized but not eliminated Correct answer is (a) 5. Which of the following is a property (are properties) exhibited by good relational schemas? The use of null values in tuples The grouping of as many attributes as possible into one main table The elimination of data redundancy to avoid update anomalies (a) I and II only (b) III only (c) None (d) II and III only Correct answer is (b) 6. Consider a table with atomic attributes A, B, and C and the following functional dependencies. A -> B B -> C If the primary key of this table is attribute A, then this relation satisfies which of the following normal forms? First Second Third (a) I and II only (b) I only (c) I, II and III (d) None Correct answer is (a) 7. For a relation to be in 3NF, it should not contain _____ attribute that is transitively dependent on _____. (a) a non-primary key, a foreign key (b) a primary key, a foreign key (c) a primary key, a non-primary key (d) a non-primary key, the primary key Correct answer is (d) 8. The FD X -> Y is a partial dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) at least one, added to (b) no, removed from (c) no, added to (d) at least one, removed from Correct answer is (d) 9. For a relation to be in 2NF, _____ attribute must be fully functionally dependent on _____. (a) every non-primary-key, the primary key (b) every alternate key, the primary key (c) every non-key, every key (d) every non-key, at least one key Correct answer is (a) 10. The FD X -> Y is a full dependency in a relation R, if there is _____ attribute A that can be _____ X and the dependency still holds. (a) no, added to (b) at least one, removed from (c) at least one, added to (d) no, removed from Correct answer is (d) 1. In an ER model, which of the following is true about a composite attribute? (a) A composite attribute can have a method attached to it. (b) A composite attribute cannot be broken into more basic attributes. (c) A composite attribute can be broken into more basic attributes. (d) A composite attribute can only be designed by users with special privileges. Correct answer is (c) 2. The term physical data independence refers to the ability to change (a) the physical layout of the data without changing the external schemas, the conceptual schemas, or the application programs (b) the data without physically relocating the tables (c) the conceptual schema without changing the application programs (d) the application programs without changing the conceptual schema Correct answer is (a) 3. What attributes does a subclass have? (a) None of the attributes of its superclass (b) All the attributes of its superclass, and possibly more (c) Just the attributes from the superclass (d) A subset of the attributes of its superclass Correct answer is (b) 4. If X -> Y, which of the following would make Y fully dependent on X? (a) Y is a single attribute (b) X is a single attribute (c) X consists of multiple attributes (d) Y consists of multiple attributes Correct answer is (b) 5. In an ER model, what is the degree of a relationship type? (a) The validity of the relationship type (b) The strength of the relationship type (c) The number of entity types participating in the relationship type (d) The number of instances of the relationship type Correct answer is (c) 6. Database design typically consists of which of the following phases? Conceptual design Logical design Physical design (a) II only (b) I, II, and III (c) II and III only (d) I only Correct answer is (b) 7. A relational schema is in first normal form, if the domain of all of its (a) primary keys are not multi-valued (b) primary keys and alternate keys are not multi-valued (c) primary keys are not composite (d) attributes can take on only atomic values Correct answer is (d) 8. In an ER model, a derived attribute is one whose values (a) have been derived at some time in the past (b) can be derived from the values of some other attributes (c) can be derived from the system tables (d) can be derived from another table Correct answer is (b) 9. Y is transitively dependent on X, if (a) X -> Y and A -> Y (b) X -> A, B and A -> Y (c) X -> Y and Y -> A (d) X -> A, B and Y -> A, B Correct answer is (b) 10. Relationships in an ER model are primarily translated to which of the following in a relational model? (a) relationships (b) primary keys and foreign keys (c) three-way tables (d) dummy relationship tables Correct answer is (b) View Assessment Result With Query By Example, a user enters a query by (a) filling in skeleton tables of the database with examples of what is to be retrieved (b) placing SQL keywords, such as select, under the column names they want to retrieve (c) writing an English description of the data that the user needs (d) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database F Your performance was as follows: You took 2 minutes on this assessment from Tue Mar 17 05:22:13 UTC+0800 2009 to Tue Mar 17 05:24:13 UTC+0800 2009. Total score: 100.00 1. An E-Commerce system consists of the following components. Which of the same components must be included in a database management system? 1 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 2 A collection of programs must be included that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains, such as in a library information system. 3 A collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) II only (b) I, II, and III (c) I only (d) II and III only Correct answer is (a) Your score on this question is: 14.29 Feedback: A DBMS refers to just the set of general-purpose programs to control data. (a) 2. An E-Commerce system consists of the following components. Which of these same components will constitute a database system? 4 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 5 A collection of programs that control the data, such as programs to create, maintain, and manipulate the data constitutes a database system. These programs can be easily used to create, maintain, and manipulate data in other domains such as in a library information system. 6 A collection of programs that operate on the data, but are specific to the E-commerce system, constitutes a database system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I only (b) I, II, and III (c) I and II only (d) II only Correct answer is (b) Your score on this question is: 14.29 Feedback: A database system includes the data, the DBMS, and the application-specific programs that operate on that data. (b) 3. An E-Commerce system consists of the following components. Which of these same components must be included in a database? 7 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 8 A database must include a collection of programs that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains. 9 A database must include a collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I and II only (b) I only (c) II only (d) I, II, and III Correct answer is (b) Your score on this question is: 14.29 Feedback: Database refers to just the data (b) 4. An E-Commerce database contains data about customers, products, orders, system response times, etc. Which of the following can be specified as integrity constraints in an E-Commerce database system? 10 No two products can have the same product ID. 11 The DBMS response time for all Web requests should be at most 2 seconds. 12 A customer order cannot have more than one shipping address. (a) I and III only (b) I and II only (c) I only (d) I, II, and III Correct answer is (a) Your score on this question is: 14.29 Feedback: The constraints I, II and III specify the application semantics of the data captured in the E-Commerce database. Constraint II, although it seems contrary to common sense, is not something that can be prohibited by the DBMS because the DBMS is general purpose. The response time of the DBMS cannot be enforced by the DBMS. It depends on factors such the processor speed, memory available, etc. (a) 5. In a database system, whose responsibility is it to provide data consistency? (a) the user's (b) the application programmer's (c) the DBMS's (d) the database administrator's Correct answer is (c) Your score on this question is: 14.29 Feedback: (c) 6. A database is needed for which of the following application scenarios? 13 A video store that needs to keep track of data about members, about videos carried by the store, about videos rented by members, as well as data concerning borrow-date, return-date, and payment information. 14 In the human resources department of a company, information about employees, their titles, their salaries and sick days, and about vacation days taken by each employee. 15 A computer-simulated video game which needs to calculate and display, the physical (x, y) location of each actor in the game, the speed with which they are moving at the current instant, the direction in which they are moving, the action they are performing, the angle at which the game-player is viewing the scene. (a) I only (b) I, II, and III (c) I and II only (d) I and III only Correct answer is (c) Your score on this question is: 14.29 Feedback: (c) 7. The physical storage structure will be _____ to the application programmer in a database approach, and will be _____ to the application programmer in a file system approach. (a) hidden, hidden (b) hidden, visible (c) visible, visible (d) visible, hidden Correct answer is (b) Your score on this question is: 14.29 Feedback: The layer of abstraction offered by a DBMS hides the physical storage structure from the application programmer. (b) Go to top of assessment. Total score: 100.00 Your performance was as follows: You took 3 minutes on this assessment from Tue Mar 17 04:27:27 UTC+0800 2009 to Tue Mar 17 04:30:02 UTC+0800 2009. Total score: 85.71 1. An E-Commerce system consists of the following components. Which of these same components must be included in a database? 1 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 2 A database must include a collection of programs that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains. 3 A database must include a collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) II only (b) I and II only (c) I only (d) I, II, and III Correct answer is (c) Your score on this question is: 14.29 Feedback: Database refers to just the data (c) 2. In a database system, whose responsibility is it to provide data consistency? (a) the database administrator's (b) the user's (c) the application programmer's (d) the DBMS's Correct answer is (d) Your score on this question is: 14.29 Feedback: (d) 3. An E-Commerce system consists of the following components. Which of these same components will constitute a database system? 4 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 5 A collection of programs that control the data, such as programs to create, maintain, and manipulate the data constitutes a database system. These programs can be easily used to create, maintain, and manipulate data in other domains such as in a library information system. 6 A collection of programs that operate on the data, but are specific to the E-commerce system, constitutes a database system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I, II, and III (b) I only (c) I and II only (d) II only Correct answer is (a) Your score on this question is: 14.29 Feedback: A database system includes the data, the DBMS, and the application-specific programs that operate on that data. (a) 4. An E-Commerce system consists of the following components. Which of the same components must be included in a database management system? 7 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 8 A collection of programs must be included that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains, such as in a library information system. 9 A collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I only (b) I, II, and III (c) II only (d) II and III only Correct answer is (c) Your score on this question is: 0.00 Feedback: A DBMS refers to just the set of general-purpose programs to control data. (d) 5. An E-Commerce database contains data about customers, products, orders, system response times, etc. Which of the following can be specified as integrity constraints in an E-Commerce database system? 10 No two products can have the same product ID. 11 The DBMS response time for all Web requests should be at most 2 seconds. 12 A customer order cannot have more than one shipping address. (a) I, II, and III (b) I only (c) I and II only (d) I and III only Correct answer is (d) Your score on this question is: 14.29 Feedback: The constraints I, II and III specify the application semantics of the data captured in the E-Commerce database. Constraint II, although it seems contrary to common sense, is not something that can be prohibited by the DBMS because the DBMS is general purpose. The response time of the DBMS cannot be enforced by the DBMS. It depends on factors such the processor speed, memory available, etc. (d) 6. A database is needed for which of the following application scenarios? 13 A video store that needs to keep track of data about members, about videos carried by the store, about videos rented by members, as well as data concerning borrow-date, return-date, and payment information. 14 In the human resources department of a company, information about employees, their titles, their salaries and sick days, and about vacation days taken by each employee. 15 A computer-simulated video game which needs to calculate and display, the physical (x, y) location of each actor in the game, the speed with which they are moving at the current instant, the direction in which they are moving, the action they are performing, the angle at which the game-player is viewing the scene. (a) I and II only (b) I only (c) I, II, and III (d) I and III only Correct answer is (a) Your score on this question is: 14.29 Feedback: (a) 7. The physical storage structure will be _____ to the application programmer in a database approach, and will be _____ to the application programmer in a file system approach. (a) visible, hidden (b) hidden, hidden (c) hidden, visible (d) visible, visible Correct answer is (c) Your score on this question is: 14.29 Feedback: The layer of abstraction offered by a DBMS hides the physical storage structure from the application programmer. (c) Go to top of assessment. Total score: 85.71 Total score: 42.86 1. An E-Commerce system consists of the following components. Which of these same components must be included in a database? 1 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 2 A database must include a collection of programs that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains. 3 A database must include a collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I and II only (b) I only (c) II only (d) I, II, and III Correct answer is (b) Your score on this question is: 14.29 Feedback: Database refers to just the data (b) 2. In a database system, whose responsibility is it to provide data consistency? (a) the DBMS's (b) the user's (c) the application programmer's (d) the database administrator's Correct answer is (a) Your score on this question is: 0.00 Feedback: (d) 3. An E-Commerce system consists of the following components. Which of these same components will constitute a database system? 4 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 5 A collection of programs that control the data, such as programs to create, maintain, and manipulate the data constitutes a database system. These programs can be easily used to create, maintain, and manipulate data in other domains such as in a library information system. 6 A collection of programs that operate on the data, but are specific to the E-commerce system, constitutes a database system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) II only (b) I and II only (c) I, II, and III (d) I only Correct answer is (c) Your score on this question is: 0.00 Feedback: A database system includes the data, the DBMS, and the application-specific programs that operate on that data. (a) 4. An E-Commerce system consists of the following components. Which of the same components must be included in a database management system? 7 The data, such as information about the goods available for sale, customers, orders placed, shipping information, etc. 8 A collection of programs must be included that control the data, such as programs to create, maintain, and manipulate the data. These programs can be easily used to create, maintain, and manipulate data in other domains, such as in a library information system. 9 A collection of programs that operate on the data, but are specific to the E-commerce system. These programs enable users to browse through the store-items, place orders, track shipping, etc. (a) I, II, and III (b) II only (c) I only (d) II and III only Correct answer is (b) Your score on this question is: 0.00 Feedback: A DBMS refers to just the set of general-purpose programs to control data. (d) 5. An E-Commerce database contains data about customers, products, orders, system response times, etc. Which of the following can be specified as integrity constraints in an E-Commerce database system? 10 No two products can have the same product ID. 11 The DBMS response time for all Web requests should be at most 2 seconds. 12 A customer order cannot have more than one shipping address. (a) I only (b) I and III only (c) I and II only (d) I, II, and III Correct answer is (b) Your score on this question is: 0.00 Feedback: The constraints I, II and III specify the application semantics of the data captured in the E-Commerce database. Constraint II, although it seems contrary to common sense, is not something that can be prohibited by the DBMS because the DBMS is general purpose. The response time of the DBMS cannot be enforced by the DBMS. It depends on factors such the processor speed, memory available, etc. (d) 6. A database is needed for which of the following application scenarios? 13 A video store that needs to keep track of data about members, about videos carried by the store, about videos rented by members, as well as data concerning borrow-date, return-date, and payment information. 14 In the human resources department of a company, information about employees, their titles, their salaries and sick days, and about vacation days taken by each employee. 15 A computer-simulated video game which needs to calculate and display, the physical (x, y) location of each actor in the game, the speed with which they are moving at the current instant, the direction in which they are moving, the action they are performing, the angle at which the game-player is viewing the scene. (a) I only (b) I and II only (c) I, II, and III (d) I and III only Correct answer is (b) Your score on this question is: 14.29 Feedback: (b) 7. The physical storage structure will be _____ to the application programmer in a database approach, and will be _____ to the application programmer in a file system approach. (a) visible, visible (b) visible, hidden (c) hidden, visible (d) hidden, hidden Correct answer is (c) Your score on this question is: 14.29 Feedback: The layer of abstraction offered by a DBMS hides the physical storage structure from the application programmer. (c) Go to top of assessment. The arity of a table is the number of _____ in the table. (a) rows (b) columns (c) keys (d) foreign keys Correct answer is (b) Your score on this question is: 10.00 Feedback: 2. The cardinality of a table is the number of _____ in the table. (a) rows (b) foreign keys (c) keys (d) columns Correct answer is (a) Your score on this question is: 10.00 Feedback: 3. The degree of a table is the number of _____ in the table. (a) rows (b) columns (c) foreign keys (d) keys Correct answer is (b) Your score on this question is: 10.00 Feedback: 4. The foreign key in a table T1 _____ the same _____ as the corresponding primary key in table T2. 1 must have, name 2 need not have, name 3 must have, domain (a) I and III (b) II and III (c) I, II, and III (d) I and II Correct answer is (b) Your score on this question is: 10.00 Feedback: 5. The SQL clause to perform a set UNION operation is (a) MELD (b) UNITE (c) UNION (d) COMBINE Correct answer is (c) Your score on this question is: 10.00 Feedback: 6. DML is used to (a) manipulate the structure of database applications. (b) add/modify/delete data in the database. (c) specify the structure of a database. (d) add and delete tables. Correct answer is (b) Your score on this question is: 10.00 Feedback: 7. DDL is used to (a) specify the structure of a database. (b) add contents to tables. (c) access the contents of tables. (d) define the structure of database applications. Correct answer is (a) Your score on this question is: 10.00 Feedback: 8. Which of the following SQL statements can be used to create a relational table? (a) APPEND (b) CREATE (c) ADD (d) INSERT Correct answer is (b) Your score on this question is: 10.00 Feedback: 9. Which of the following SQL statements can be used to modify just one row (out of many rows) in a table? (a) CHANGE (b) UPDATE (c) ALTER (d) MODIFY Correct answer is (b) Your score on this question is: 0.00 Feedback: 10. The term query by example refers to (a) a visual query language developed by IBM (b) a query for SQL examples (c) example SQL queries provided by the DBMS that users can modify to suit their current needs (d) example SQL queries provided by other users that can be modified to suit current needs Correct answer is (a) Your score on this question is: 10.00 Feedback: See section 1.2.3 in the course notes. Your performance was as follows: You took 4 minutes on this assessment from Wed Mar 29 08:46:41 UTC+0800 2006 to Wed Mar 29 08:50:36 UTC+0800 2006. Total score: 90.00 1. What information is necessary when specifying the structure of a table? (a) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes (b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (c) the name of the table and the names of the table's attributes (d) the name of the table and the amount of storage space to be allocated to the table Correct answer is (a) Your score on this question is: 0.00 Feedback: 2. The cardinality of a table is the number of _____ in the table. (a) columns (b) foreign keys (c) rows (d) keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 3. The arity of a table is the number of _____ in the table. (a) foreign keys (b) keys (c) rows (d) columns Correct answer is (d) Your score on this question is: 10.00 Feedback: 4. The degree of a table is the number of _____ in the table. (a) rows (b) foreign keys (c) columns (d) keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 5. A difference operation can be applied to tables that (a) are union compatible (b) have the same name (c) are the same size (d) have the same column names Correct answer is (a) Your score on this question is: 10.00 Feedback: 6. Which of the following SQL statements can be used to remove a row from a table? (a) DESTROY (b) DELETE (c) ERASE (d) REMOVE Correct answer is (b) Your score on this question is: 10.00 Feedback: 7. DML is used to (a) add/modify/delete data in the database. (b) add and delete tables. (c) manipulate the structure of database applications. (d) specify the structure of a database. Correct answer is (a) Your score on this question is: 10.00 Feedback: 8. A deletion operation will _____ if the deletion leads to the violation of a referential integrity constraint. (a) fail (b) succeed with warning (c) succeed without warning (d) crash the system Correct answer is (a) Your score on this question is: 10.00 Feedback: 9. DDL is used to (a) access the contents of tables. (b) add contents to tables. (c) define the structure of database applications. (d) specify the structure of a database. Correct answer is (d) Your score on this question is: 10.00 Feedback: 10. With Query By Example, a user enters a query by (a) writing an English description of the data that the user needs (b) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (c) filling in skeleton tables of the database with examples of what is to be retrieved (d) placing SQL keywords, such as select, under the column names they want to retrieve Correct answer is (c) Your score on this question is: 10.00 1. What information is necessary when specifying the structure of a table? (a) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes (b) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (c) the name of the table and the names of the table's attributes (d) the name of the table and the amount of storage space to be allocated to the table Correct answer is (a) Your score on this question is: 0.00 Feedback: 2. The cardinality of a table is the number of _____ in the table. (a) columns (b) foreign keys (c) rows (d) keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 3. The arity of a table is the number of _____ in the table. (a) foreign keys (b) keys (c) rows (d) columns Correct answer is (d) Your score on this question is: 10.00 Feedback: 4. The degree of a table is the number of _____ in the table. (a) rows (b) foreign keys (c) columns (d) keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 5. A difference operation can be applied to tables that (a) are union compatible (b) have the same name (c) are the same size (d) have the same column names Correct answer is (a) Your score on this question is: 10.00 Feedback: 6. Which of the following SQL statements can be used to remove a row from a table? (a) DESTROY (b) DELETE (c) ERASE (d) REMOVE Correct answer is (b) Your score on this question is: 10.00 Feedback: 7. DML is used to (a) add/modify/delete data in the database. (b) add and delete tables. (c) manipulate the structure of database applications. (d) specify the structure of a database. Correct answer is (a) Your score on this question is: 10.00 Feedback: 8. A deletion operation will _____ if the deletion leads to the violation of a referential integrity constraint. (a) fail (b) succeed with warning (c) succeed without warning (d) crash the system Correct answer is (a) Your score on this question is: 10.00 Feedback: 9. DDL is used to (a) access the contents of tables. (b) add contents to tables. (c) define the structure of database applications. (d) specify the structure of a database. Correct answer is (d) Your score on this question is: 10.00 Feedback: 10. With Query By Example, a user enters a query by (a) writing an English description of the data that the user needs (b) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (c) filling in skeleton tables of the database with examples of what is to be retrieved (d) placing SQL keywords, such as select, under the column names they want to retrieve Correct answer is (c) The cardinality of a table is the number of _____ in the table. (a) rows (b) keys (c) foreign keys (d) columns Correct answer is (a) Your score on this question is: 10.00 Feedback: 2. The foreign key in a table T1 _____ the same _____ as the corresponding primary key in table T2. 1 must have, name 2 need not have, name 3 must have, domain (a) I and II (b) I, II, and III (c) II and III (d) I and III Correct answer is (c) Your score on this question is: 10.00 Feedback: 3. What information is necessary when specifying the structure of a table? (a) the name of the table and the names of the table's attributes (b) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes (c) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (d) the name of the table and the amount of storage space to be allocated to the table Correct answer is (b) Your score on this question is: 10.00 Feedback: 4. The arity of a table is the number of _____ in the table. (a) columns (b) foreign keys (c) keys (d) rows Correct answer is (a) Your score on this question is: 10.00 Feedback: 5. A difference operation can be applied to tables that (a) are union compatible (b) are the same size (c) have the same name (d) have the same column names Correct answer is (a) Your score on this question is: 10.00 Feedback: 6. What can be specified in the selection condition of a SELECT statement? (a) a Boolean operation (b) an arithmetic operation (c) the conditions under which the statement should be executed (d) the time at which the selection should be performed Correct answer is (a) Your score on this question is: 0.00 Feedback: 7. The SQL clause to perform a set UNION operation is (a) MELD (b) UNION (c) UNITE (d) COMBINE Correct answer is (b) Your score on this question is: 10.00 Feedback: 8. Which of the following SQL statements can be used to add a row to a table? (a) APPEND (b) CREATE (c) ADD (d) INSERT Correct answer is (d) Your score on this question is: 10.00 Feedback: 9. A join operation joins _____ tables into _____. (a) two, one (b) four, two (c) three, one (d) three, two Correct answer is (a) Your score on this question is: 10.00 Feedback: 10. With Query By Example, a user enters a query by (a) placing SQL keywords, such as select, under the column names they want to retrieve (b) writing an English description of the data that the user needs (c) typing a syntactically correct SQL query that uses column and table names similar to the correct column and table names in a database (d) filling in skeleton tables of the database with examples of what is to be retrieved Correct answer is (d) Your score on this question is: 10.00 The degree of a table is the number of _____ in the table. (a) foreign keys (b) columns (c) rows (d) keys Correct answer is (b) Your score on this question is: 10.00 Feedback: 2. The arity of a table is the number of _____ in the table. (a) rows (b) keys (c) columns (d) foreign keys Correct answer is (c) Your score on this question is: 10.00 Feedback: 3. What information is necessary when specifying the structure of a table? (a) the name of the table and the amount of storage space to be allocated to the table (b) the name of the table and the names of the table's attributes (c) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have (d) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes Correct answer is (d) Your score on this question is: 10.00 Feedback: 4. The cardinality of a table is the number of _____ in the table. (a) foreign keys (b) columns (c) keys (d) rows Correct answer is (d) Your score on this question is: 10.00 Feedback: 5. DML is used to (a) specify the structure of a database. (b) add and delete tables. (c) manipulate the structure of database applications. (d) add/modify/delete data in the database. Correct answer is (d) Your score on this question is: 10.00 Feedback: 6. The SQL clause to perform a set UNION operation is (a) COMBINE (b) UNION (c) UNITE (d) MELD Correct answer is (b) Your score on this question is: 10.00 Feedback: 7. Which of the following SQL statements can be used to create a relational table? (a) ADD (b) APPEND (c) CREATE (d) INSERT Correct answer is (c) Your score on this question is: 10.00 Feedback: 8. DDL is used to (a) access the contents of tables. (b) specify the structure of a database. (c) add contents to tables. (d) define the structure of database applications. Correct answer is (b) Your score on this question is: 10.00 Feedback: 9. What can be specified in the selection condition of a SELECT statement? (a) the time at which the selection should be performed (b) an arithmetic operation (c) the conditions under which the statement should be executed (d) a Boolean operation Correct answer is (d) Your score on this question is: 10.00 Feedback: 10. The term query by example refers to (a) a query for SQL examples (b) example SQL queries provided by other users that can be modified to suit current needs (c) a visual query language developed by IBM (d) example SQL queries provided by the DBMS that users can modify to suit their current needs Correct answer is (c) Your score on this question is: 10.00 Feedback: See section 1.2.3 in the course notes. Go to top of assessment. Your performance was as follows: 1. What information is necessary when specifying the structure of a table? (a) the name of the table, the names of the table's attributes, the data types of attributes, and the formats of attributes (b) the name of the table and the amount of storage space to be allocated to the table (c) the name of the table and the names of the table's attributes (d) the name of the table, the names of the table's attributes, the data types of the table's attributes, the formats of the table's attributes, and the maximum number of rows that the table can have Correct answer is (a) Your score on this question is: 10.00 Feedback: (a) 2. The foreign key in a table T1 _____ the same _____ as the corresponding primary key in table T2. 1 must have, name 2 need not have, name 3 must have, domain (a) I and II (b) II and III (c) I and III (d) I, II, and III Correct answer is (b) Your score on this question is: 10.00 Feedback: (b) 3. The arity of a table is the number of _____ in the table. (a) foreign keys (b) rows (c) keys (d) columns Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) 4. The cardinality of a table is the number of _____ in the table. (a) keys (b) columns (c) rows (d) foreign keys Correct answer is (c) Your score on this question is: 10.00 Feedback: (c) 5. Which of the following SQL statements can be used to create a relational table? (a) INSERT (b) ADD (c) CREATE (d) APPEND Correct answer is (c) Your score on this question is: 10.00 Feedback: (c) 6. The SQL clause to perform a set difference operation is (a) EXCEPT (b) OMIT (c) DIFFER (d) REJECT Correct answer is (a) Your score on this question is: 10.00 Feedback: (a) 7. Which of the following SQL statements can be used to remove a row from a table? (a) ERASE (b) REMOVE (c) DESTROY (d) DELETE Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) 8. Which of the following SQL statements can be used to add a row to a table? (a) ADD (b) APPEND (c) CREATE (d) INSERT Correct answer is (d) Your score on this question is: 10.00 Feedback: (d) 9. What can be specified in the selection condition of a SELECT statement? (a) the time at which the selection should be performed (b) a Boolean operation (c) an arithmetic operat
没办法,文件超出上传20M限制 Servlets和JSP核心技术 卷2 内容还是很详细的,看过卷1的人可以继续用这本书深造,呵呵 目录: Chapter 1. Using and Deploying Web Applications Section 1.1. Purpose of Web Applications Section 1.2. Structure of Web Applications Section 1.3. Registering Web Applications with the Server Section 1.4. Development and Deployment Strategies Section 1.5. The Art of WAR: Bundling Web Applications into WAR Files Section 1.6. Building a Simple Web Application Section 1.7. Sharing Data Among Web Applications Chapter 2. Controlling Web Application Behavior with web.xml Section 2.1. Purpose of the Deployment Descriptor Section 2.2. Defining the Header and the Root Element Section 2.3. The Elements of web.xml Section 2.4. Assigning Names and Custom URLs Section 2.5. Disabling the Invoker Servlet Section 2.6. Initializing and Preloading Servlets and JSP Pages Section 2.7. Declaring Filters Section 2.8. Specifying Welcome Pages Section 2.9. Designating Pages to Handle Errors Section 2.10. Providing Security Section 2.11. Controlling Session Timeouts Section 2.12. Documenting Web Applications Section 2.13. Associating Files with MIME Types Section 2.14. Configuring JSP Pages Section 2.15. Configuring Character Encoding Section 2.16. Designating Application Event Listeners Section 2.17. Developing for the Clustered Environment Section 2.18. J2EE Elements Chapter 3. Declarative Security Section 3.1. Form-Based Authentication Section 3.2. Example: Form-Based Authentication Section 3.3. BASIC Authentication Section 3.4. Example: BASIC Authentication Section 3.5. Configuring Tomcat to Use SSL Section 3.6. WebClient: Talking to Web Servers Interactively Section 3.7. Signing a Server Certificate Chapter 4. Programmatic Security Section 4.1. Combining Container-Managed and Programmatic Security Section 4.2. Example: Combining Container-Managed and Programmatic Security Section 4.3. Handling All Security Programmatically Section 4.4. Example: Handling All Security Programmatically Section 4.5. Using Programmatic Security with SSL Section 4.6. Example: Programmatic Security and SSL Chapter 5. Servlet and JSP Filters Section 5.1. Creating Basic Filters Section 5.2. Example: A Reporting Filter Section 5.3. Accessing the Servlet Context from Filters Section 5.4. Example: A Logging Filter Section 5.5. Using Filter Initialization Parameters Section 5.6. Example: An Access Time Filter Section 5.7. Blocking the Response Section 5.8. Example: A Prohibited-Site Filter Section 5.9. Modifying the Response Section 5.10. Example: A Replacement Filter Section 5.11. Example: A Compression Filter Section 5.12. Configuring Filters to Work with RequestDispatcher Section 5.13. Example: Plugging a Potential Security Hole Section 5.14. The Complete Filter Deployment Descriptor Chapter 6. The Application Events Framework Section 6.1. Monitoring Creation and Destruction of the Servlet Context Section 6.2. Example: Initializing Commonly Used Data Section 6.3. Detecting Changes in Servlet Context Attributes Section 6.4. Example: Monitoring Changes to Commonly Used Data Section 6.5. Packaging Listeners with Tag Libraries Section 6.6. Example: Packaging the Company Name Listeners Section 6.7. Recognizing Session Creation and Destruction Section 6.8. Example: A Listener That Counts Sessions Section 6.9. Watching for Changes in Session Attributes Section 6.10. Example: Monitoring Yacht Orders Section 6.11. Identifying Servlet Request Initialization and Destruction Section 6.12. Example: Calculating Server Request Load Section 6.13. Watching Servlet Request for Attribute Changes Section 6.14. Example: Stopping Request Frequency Collection Section 6.15. Using Multiple Cooperating Listeners Section 6.16. The Complete Events Deployment Descriptor Chapter 7. Tag Libraries: The Basics Section 7.1. Tag Library Components Section 7.2. Example: Simple Prime Tag Section 7.3. Assigning Attributes to Tags Section 7.4. Example: Prime Tag with Variable Length Section 7.5. Including Tag Body in the Tag Output Section 7.6. Example: Heading Tag Section 7.7. Example: Debug Tag Section 7.8. Creating Tag Files Section 7.9. Example: Simple Prime Tag Using Tag Files Section 7.10. Example: Prime Tag with Variable Length Using Tag Files Section 7.11. Example: Heading Tag Using Tag Files Chapter 8. Tag Libraries: Advanced Features Section 8.1. Manipulating Tag Body Section 8.2. Example: HTML-Filtering Tag Section 8.3. Assigning Dynamic Values to Tag Attributes Section 8.4. Example: Simple Looping Tag Section 8.5. Assigning Complex Objects as Values to Tag Attributes Section 8.6. Example: Table Formatting Tag Section 8.7. Creating Looping Tags Section 8.8. Example: ForEach Tag Section 8.9. Creating Expression Language Functions Section 8.10. Example: Improved Debug Tag Section 8.11. Handling Nested Custom Tags Section 8.12. Example: If-Then-Else Tag Chapter 9. JSP Standard Tag Library (JSTL) Section 9.1. Installation of JSTL Section 9.2. c:out Tag Section 9.3. c:forEach and c:forTokens Tags Section 9.4. c:if Tag Section 9.5. c:choose Tag Section 9.6. c:set and c:remove Tags Section 9.7. c:import Tag Section 9.8. c:url and c:param Tags Section 9.9. c:redirect Tag Section 9.10. c:catch Tag Chapter 10. The Struts Framework: Basics Section 10.1. Understanding Struts Section 10.2. Setting Up Struts Section 10.3. The Struts Flow of Control and the Six Steps to Implementing It Section 10.4. Processing Requests with Action Objects Section 10.5. Handling Request Parameters with Form Beans Section 10.6. Prepopulating and Redisplaying Input Forms Chapter 11. The Struts Framework: Doing More Section 11.1. Using Properties Files Section 11.2. Internationalizing Applications Section 11.3. Laying Out Pages with Tiles Section 11.4. Using Tiles Definitions Chapter 12. The Struts Framework: Validating User Input Section 12.1. Validating in the Action Class Section 12.2. Validating in the Form Bean Section 12.3. Using the Automatic Validation Framework Developing Applications with Apache Ant Section A.1. Summarizing the Benefits of Ant Section A.2. Installing and Setting Up Ant Section A.3. Creating an Ant Project Section A.4. Reviewing Common Ant Tasks Section A.5. Example: Writing a Simple Ant Project Section A.6. Using Ant to Build a Web Application Section A.7. Example: Building a Web Application Section A.8. Using Ant to Create a WAR File Section A.9. Example: Creating a Web Application WAR File Index
Drag and Drop Component Suite Version 4.1 Field test 5, released 16-dec-2001 ?1997-2001 Angus Johnson & Anders Melander http://www.melander.dk/delphi/dragdrop/ ------------------------------------------- Table of Contents: ------------------------------------------- 1. Supported platforms 2. Installation 3. Getting started 4. Known problems 5. Support and feedback 6. Bug reports 7. Upgrades and bug fixes 8. Missing in this release 9. New in version 4.x 10. TODO 11. Licence, Copyright and Disclaimer 12. Release history ------------------------------------------- 1. Supported platforms: ------------------------------------------- This release supports Delphi 4-6 and C++ Builder 4-5. Earlier versions of Delphi and C++ Builder will not be supported. If you need Delphi 3 or C++ Builder 3 support you will have to revert to version 3.7 of the Drag and Drop Component Suite. The library has been tested on NT4 service pack 5 and Windows 2000. Windows 95, 98, ME and XP should be supported, but has not been tested. Linux and Kylix are not supported. There are *NO* plans to port the library to Kylix. The drag and drop protocols available on Linux are too much of a mess at this time. ------------------------------------------- 2. Installation: ------------------------------------------- 1) Before you do anything else, read the "Known problems" section of this document. 2) Install the source into a directory of your choice. The files are installed into three directories: DragDrop DragDrop\Components DragDrop\Demo 3) Install and compile the appropriate design time package. The design time packages are located in the Components directory. Each version of Delphi and C++ Builder has its own package; DragDropD6.dpk for Delphi 6, DragDropD5.dpk for Delphi 5, DragDropC5.bpk for C++ Builder 5, etc. 4) Add the Drag and Drop Component Suite components directory to your library path. 5) Load the demo project group: demo\dragdrop_delphi.bpg for Delphi 5 and 6 demo\dragdrop_bcb4.bpg for C++ Builder 4 demo\dragdrop_bcb5.bpg for C++ Builder 5 The project group contains all the demo applications. 6) If your version of Delphi does not support text format DFM files (e.g. Delphi 4 doesn't), you will have to use the convert.exe utility supplied with Delphi to convert all the demo form files to binary format. A batch file, convert_forms_to delphi_4_format.bat, is supplied in the demo directory which automates the conversion process. The C++ Builder demo forms are distributed in binary format. 7) If upgrading from a previous version of the Drag and Drop Component Suite, please read the document "upgrading_to_v4.txt" before you begin working on your existing projects. Note about "Property does not exist" errors: Since all demos were developed with the latest version of Delphi, most of the demo forms probably contains references to properties that doesn't exist in earlier versions of Delphi and C++ Builder. Because of this you will get fatal run-time errors (e.g. "Error reading blahblahblah: Property does not exist.") if you attemt to run the demos without fixing this problem. Luckily it is very easy to make the forms work again; Just open the forms in the IDE, then select "Ignore All" when the IDE complains that this or that property doesn't exist and finally save the forms. ------------------------------------------- 3. Getting started: ------------------------------------------- It is recommended that you start by running each of the demo applications and then look through the demo source. Each demo application is supplied with a readme.txt file which briefly describes what the demo does and what features it uses. The demos should be run in the order in which they are listed in the supplied project group. Even if you have used previous versions of the Drag and Drop Component Suite it would be a good idea to have a quick look at the demos. The library has been completely rewritten and a lot of new features has been added. ------------------------------------------- 4. Known problems: ------------------------------------------- * The Shell Extension components does not support C++ Builder 4. For some strange reason the components causes a link error. * There appear to be sporadic problems compiling with C++ Builder 5. Several user have reported that they occasionally get one or more of the following compiler errors: [C++ Error] DragDropFile.hpp(178): E2450 Undefined structure '_FILEDESCRIPTORW' [C++ Error] DropSource.hpp(135): E2076 Overloadable operator expected I have not been able to reproduce these errors, but I believe the following work around will fix the problem: In the project options of *all* projects which uses these components, add the following conditional define: NO_WIN32_LEAN_AND_MEAN The define *must* be made in the project options. It is not sufficient to #define it in the source. If you manage to compile with C++ Builder (any version), I would very much like to know about it. * Delphi's and C++ Builder's HWND and THandle types are not compatible. For this reason it might be nescessary to cast C++ Builder's HWND values to Delphi's THandle type when a HWND is passed to a function. E.g.: if (DragDetectPlus(THandle(MyControl->Handle), Point(X, Y))) { ... } * Virtual File Stream formats can only be pasted from the clipboard with live data (i.e. FlushClipboard/OleFlushClipboard hasn't been called on the data source). This problem affects TFileContentsStreamOnDemandClipboardFormat and the VirtualFileStream demo. This is believed to be a bug in the Windows clipboard and a work around hasn't been found yet. * Asynchronous targets appears to be broken in the current release. * When TDropFileTarget.GetDataOnEnter is set to True, the component doesn't work with WinZip. Although the file names are received correctly by TDropFileTarget, WinZip doesn't extract the files and the files thus can't be copied/moved. This is caused by a quirk in WinZip; Apparently WinZip doesn't like IDataObject.GetData to be called before IDropTarget.Drop is called. ------------------------------------------- 5. Support and feedback: ------------------------------------------- Since these components are freeware they are also unsupported. You are welcome to ask for help via email, but I cannot guarantee that I will have time to help you or even reply to your mail. If you absolytely can't live without my help, you can alway try bribing me. You can also try asking for help in the Delphi newsgroups. Since the Drag and Drop Component Suite is in widespread use, there's a good chance another user can help you. I recommend the following newsgroups for issues regarding this library (or COM based Drag/Drop in general): borland.public.delphi.winapi borland.public.delphi.thirdparty-tools borland.public.delphi.oleautomation borland.public.cppbuilder.winapi borland.public.cppbuilder.thirdparty-tools Please choose the most appropiate newsgroup for your question. Do not cross post to them all. Before posting to the newsgroups, I suggest you try to search for an answer on the Google (DejaNews) search engine: http://groups.google.com Chances are that your question has been asked and answered before. If you have suggestions for improvements please mail them to me: [email protected] Please include the words "Drag Drop" in the subject of any email regarding these components. ------------------------------------------- 6. Bug reports: ------------------------------------------- Bugs can either be reported at my home page (http://www.melander.dk/) or mailed directly to me: [email protected]. When reporting a bug, please provide the following information: * The exact version of the Drag and Drop Component Suite you are using. * The exact version of Delphi or C++ Builder you are using. * The name and exact version of your operating system (e.g. NT4 SP5). * The exact version of the Internet Explorer installed on your system. If you can provide me with a minimal application which reproduces the problem, I can almost guarantee that I will be able to fix the problem in very short time. Please supply only the source files (pas, dfm, dpr, dof, res, etc.) and mail them as a single zip file. If I need a compiled version I will ask for it. If you feel you need to send me a screen shot, please send it in GIF or PNG format. If you mail a bug report to me, please include the words "Drag Drop" in the subject of your email. ------------------------------------------- 7. Upgrades and bug fixes: ------------------------------------------- Upgrades can be downloaded from my home page: http://www.melander.dk/delphi/dragdrop/ Bug fixes will also be posted to the above page. If you have registered for update notification via the installation program, you will receive email notification when a new release is available. You will not be notified of bug fixes. You can use the installation program to check for and download new releases and to check for known bugs. Note: If a new release is made available and you are not notified even though you registered for notification, you probably mistyped your email address during installation; About 10% of all registrations supply an invalid email address. ------------------------------------------- 8. Missing in this release: ------------------------------------------- * On-line help has not been updated and included in the kit due to late changes in the Delphi 6 help system and lack of time. If time permits, I will update the help and include it in a future release. ------------------------------------------- 9. New in version 4.x: ------------------------------------------- * Completely redesigned and rewritten. Previous versions of the Drag and Drop Component Suite used a very monolithic design and flat class hierachy which made it a bit cumbersome to extend the existing components or implement new ones. Version 4 is a complete rewrite and redesign, but still maintains compatibility with previous versions. The new V4 design basically separates the library into three layers: 1) Clipboard format I/O. 2) Data format conversion and storage. 3) COM Drag/Drop implementation and VCL component interface. The clipboard format layer is responsible for reading and writing data in different formats to and from an IDataObject interface. For each different clipboard format version 4 implements a specialized class which knows exactly how to interpret the clipboard format. For example the CF_TEXT (plain text) clipboard format is handled by the TTextClipboardFormat class and the CF_FILE (file names) clipboard format is handled by the TFileClipboardFormat class. The data format layer is primarily used to render the different clipboard formats to and from native Delphi data types. For example the TTextDataFormat class represents all text based clipboard formats (e.g. TTextClipboardFormat) as a string while the TFileDataFormat class represents a list of file names (e.g. TFileClipboardFormat) as a string list. The conversion between different data- and clipboard formats is handled by the same Assign/AssignTo mechanism as the VCLs TPersistent employes. This makes it possible to extend existing data formats with support for new clipboard formats without modification to the existing classes. The drag/drop component layer has several tasks; It implements the actual COM drag/drop functionality (i.e. it implements the IDropSource, IDropTarget and IDataObject interfaces (along with several other related interfaces)), it surfaces the data provided by the data format layer as component properties and it handles the interaction between the whole drag/drop framework and the users code. The suite provides a multitude of different components. Most are specialized for different drag/drop tasks (e.g. the TDropFileTarget and TDropFilesSource components for drag/drop of files), but some are either more generic, handling multiple unrelated formats, or simply helper components which are used to extend the existing components or build new ones. * Support for Delphi 6. Version 4.0 was primarily developed on Delphi 6 and then ported back to previous versions of Delphi and C++ Builder. * Support for Windows 2000 inter application drag images. On Windows platforms which supports it, drag images are now displayed when dragging between applications. Currently only Windows 2000 supports this feature. On platforms which doesn't support the feature, drag images are only displayed whithin the source application. * Support for Windows 2000 asynchronous data transfers. Asynchronous data tranfers allows the drop source and targets to perform slow transfers or to transfer large amounts of data without blocking the user interface while the data is being transfered. For platforms other than Windows 2000, the new TDropSourceThread class can be used to provide similar (but more limited) asynchronous data transfer capabilities. * Support for optimized and non-optimized move. When performing drag-move operations, it is now possible to specify if the target (optimized move) or the source (non-optimized move) is responsible for deleting the source files. * Support for delete-on-paste. When data is cut to the clipboard, it is now possible to defer the deletion of the source data until the target actually pastes the data. The source is notified by an event when the target pastes the data. * Extended clipboard support. All formats and components (both source and target) now support clipboard operations (copy/cut/paste) and the VCL clipboard object. * Support for shell drop handlers. The new TDropHandler component can be used to write drop handler shell extensions. A drop handler is a shell extension which is executed when a user drags and drops one or more files on a file associated wth your application. * Support for shell drag drop handlers. The new TDragDropHandler component can be used to write drag drop handler shell extensions. A drag drop handler is a shell extension which can extend the popup menu which is displayed when a user drag and drops files with the right mouse button. * Support for shell context menu handlers. The new TDropContextMenu component can be used to write context menu handler shell extensions. A context menu handler is a shell extension which can extend the popup menu which is displayed when a user right-clicks a file in the shell. * Drop sources can receive data from drop targets. It is now possible for drop targets to write data back to the drop source. This is used to support optimized-move, delete-on-paste and inter application drag images. * Automatic re-registration of targets when the target window handle is recreated. In previous versions, target controls would loose their ability to accept drops when their window handles were recreated by the VCL (e.g. when changing the border style or docking a form). This is no longer a problem. * Support for run-time definition of custom data formats. You can now add support for new clipboard formats without custom components. * Support for design-time extension of existing source and target components. Using the new TDataFormatAdapter component it is now possible to mix and match data formats and source and target components at design time. E.g. the TDropFileTarget component can be extended with URL support. * It is now possible to completely customize the target auto-scroll feature. Auto scroling can now be completely customized via the OnDragEnter, OnDragOver, OnGetDropEffect and OnScroll events and the public NoScrollZone and published AutoScroll properties. * Multiple target controls per drop target component. In previous versions you had to use one drop target component per target control. With version 4, each drop target component can handle any number of target controls. * It is now possible to specify the target control at design time. A published Target property has been added to the drop target components. * Includes 20 components: - TDropFileSource and TDropFileTarget Used for drag and drop of files. Supports recycle bin and PIDLs. - TDropTextSource and TDropTextTarget Used for drag and drop of text. - TDropBMPSource and TDropBMPTarget Used for drag and drop of bitmaps. - TDropPIDLSource and TDropPIDLTarget Used for drag and drop of PIDLs in native format. - TDropURLSource and TDropURLTarget Used for drag and drop of internet shortcuts. - TDropDummyTarget Used to provide drag/drop cursor feedback for controls which aren't registered as drop targets. - TDropComboTarget (new) Swiss-army-knife target. Accepts text, files, bitmaps, meta files, URLs and file contents. - TDropMetaFileTarget (new) Target which can accept meta files and enhanced meta files. - TDropImageTarget (new) Target which can accept bitmaps, DIBs, meta files and enhanced meta files. - TDragDropHandler (new) Used to implement Drag Drop Handler shell extensions. - TDropHandler (new) Used to implement Shell Drop Handler shell extensions. - TDragDropContext (new) Used to implement Shell Context Menu Handler shell extensions. - TDataFormatAdapter (new) Extends the standard source and target components with support for extra data formats. An alternative to TDropComboTarget. - TDropEmptySource and TDropEmptyTarget (new) Target and source components which doesn't support any formats, but can be extended with TDataFormatAdapter components. * Supports 27 standard clipboard formats: Text formats: - CF_TEXT (plain text) - CF_UNICODETEXT (Unicode text) - CF_OEMTEXT (Text in the OEM characterset) - CF_LOCALE (Locale specification) - 'Rich Text Format' (RTF text) - 'CSV' (Tabular spreadsheet text) File formats: - CF_HDROP (list of file names) - CF_FILEGROUPDESCRIPTOR, CF_FILEGROUPDESCRIPTORW and CF_FILECONTENTS (list of files and their attributes and content). - 'Shell IDList Array' (PIDLs) - 'FileName' and 'FileNameW' (single filename, used for 16 bit compatibility). - 'FileNameMap' and 'FileNameMapW' (used to rename files, usually when dragging from the recycle bin) Image formats: - CF_BITMAP (Windows bitmap) - CF_DIB (Device Independant Bitmap) - CF_METAFILEPICT (Windows MetaFile) - CF_ENHMETAFILE (Enhanced Metafile) - CF_PALETTE (Bitmap palette) Internet formats: - 'UniformResourceLocator' and 'UniformResourceLocatorW' (Internet shortcut) - 'Netscape Bookmark' (Netscape bookmark/URL) - 'Netscape Image Format' (Netscape image/URL) - '+//ISBN 1-887687-00-9::versit::PDI//vCard' (V-Card) - 'HTML Format' (HTML text) - 'Internet Message (rfc822/rfc1522)' (E-mail message in RFC822 format) Misc. formats: - CF_PREFERREDDROPEFFECT and CF_PASTESUCCEEDED (mostly used by clipboard) - CF_PERFORMEDDROPEFFECT and CF_LOGICALPERFORMEDDROPEFFECT (mostly used for optimized-move) - 'InShellDragLoop' (used by Windows shell) - 'TargetCLSID' (Mostly used when dragging to recycle-bin) * New source events: - OnGetData: Fired when the target requests data. - OnSetData: Fired when the target writes data back to the source. - OnPaste: Fired when the target pastes data which the source has placed on the clipboard. - OnAfterDrop: Fired after the drag/drop operation has completed. * New target events: - OnScroll: Fires when the target component is about to perform auto-scroll on the target control. - OnAcceptFormat: Fires when the target component needs to determine if it will accept a given data format. Only surfaced in the TDropComboTarget component. * 8 new demo applications, 19 in total. ------------------------------------------- 10. TODO (may or may not be implemented): ------------------------------------------- * Async target demo (with and without IAsyncOperation support). * Scrap file demo. * Native Outlook message format. * Structured storage support (IStorage encapsulation). ------------------------------------------- 11. Licence, Copyright and Disclaimer: ------------------------------------------- The Drag and Drop Component Suite is Copyright ?1997-2001 Angus Johnson and Anders Melander. All rights reserved. The software is copyrighted as noted above. It may be freely copied, modified, and redistributed, provided that the copyright notice(s) is preserved on all copies. The Drag and Drop Component Suite is freeware and we would like it to remain so. This means that it may not be bundled with commercial libraries or sold as shareware. You are welcome to use it in commercial and shareware applications providing you do not charge for the functionality provided by the Drag and Drop Component Suite. There is no warranty or other guarantee of fitness for this software, it is provided solely "as is". You are welcome to use the source to make your own modified components, and such modified components may be distributed by you or others if you include credits to the original components, and do not charge anything for your modified components. ------------------------------------------- 12. Version 4 release history: ------------------------------------------- 16-dec-2001 * Ported to C++ Builder 4. * Released for test as v4.1 FT5. 12-dec-2001 * Fixed C++ Builder name clash between TDropComboTarget.GetMetaFile and the GetMetaFile #define in wingdi.h 1-dec-2001 * The IAsyncOperation interface is now also declared as IAsyncOperation2 and all references to IAsyncOperation has been replaced with IAsyncOperation2. This was done to work around a bug in C++ Builder. Thanks to Jonathan Arnold for all his help with getting the components to work with C++ Builder. Without Jonathan's help version 4.1 would prabably have shipped witout C++ Builder support and certainly without any C++ Builder demos. * Demo applications for C++ Builder. The C++ Builder demos were contributed by Jonathan Arnold. 27-nov-2001 * TCustomDropTarget.Droptypes property renamed to DropTypes (notice the case). Thanks to Krystian Brazulewicz for spotting this. 24-nov-2001 * The GetURLFromString function in the DragDropInternet unit has been made public due to user request. 21-nov-2001 * Modified MakeHTML function to comply with Microsoft's description of the CF_HTML clipboard format. * Added MakeTextFromHTML function to convert CF_HTML data to plain HTML. Provides the reverse functionality of MakeHTML. * Added HTML support to TTextDataFormat class and TDropTextSource and TDropTextTarget components. * Fixed C++ Builder 5 problem with IAsyncOperation. * Released for test as v4.1 FT4. 10-nov-2001 * Added NetscapeDemo demo application. Demonstrates how to receive messages dropped from Netscape. This demo was sponsored by ThoughtShare Communications Inc. * Released for test as v4.1 FT3. 23-oct-2001 * Conversion priority of TURLDataFormat has been changed to give the File Group Descritor formats priority over the Internet Shortcut format. This resolves a problem where dropping an URL on the desktop would cause the desktop to assume that an Active Desktop item was to be created instead of an Internet Shortcut. Thanks to Allen Martin for reporting this problem. By luck this modification also happens to work around a bug in Mozilla and Netscape 6; Mozilla incorrectly supplies the UniformResourceLocator clipboard format in unicode format instead of ANSI format. Thanks to Florian Kusche for reporting this problem. * Added support for TFileGroupDescritorWClipboardFormat to TURLDataFormat. * Added declaration of FD_PROGRESSUI to DragDropFormats. * Added TURLWClipboardFormat which implements the "UniformResourceLocatorW" (a.k.a. CFSTR_INETURLW) clipboard format. Basically a Unicode version of CFSTR_SHELLURL/CFSTR_INETURL. The TURLWClipboardFormat class isn't used anywhere yet but will probably be supported by TURLDataFormat (and thus TDropURLTarget/TDropURLSource) in a later release. * Added experimental Shell Drag Image support. This relies on undodumented shell32.dll functions and probably won't be fully support before v4.2 (if ever). See InitShellDragImage in DropSource.pas. Thanks to Jim Kueneman for bringning these functions to my attention. 13-oct-2001 * TCustomDropSource.Destroy and TCustomDropMultiSource.Destroy changed to call FlushClipboard instead of EmptyClipboard. This means that clipboard contents will be preserved when the source application/component is terminated. * Added clipboard support to VirtualFileStream demo. * Modified VirtualFileStream demo to work around clipboard quirk with IStream medium. * Modified TCustomSimpleClipboardFormat to disable TYMED_ISTORAGE support by default. At present TYMED_ISTORAGE is only supported for drop targets and enabling it by default in TCustomSimpleClipboardFormat.Create caused a lot of clipboard operations (e.g. copy/paste of text) to fail. Thanks to Michael J Marshall for bringing this problem to my attention. * Modified TCustomSimpleClipboardFormat to read from the the TYMED_ISTREAM medium in small (1Mb) chunks and via a global memory buffer. This has resultet in a huge performance gain (several orders of magnitude) when transferring large amounts of data via the TYMED_ISTREAM medium. 3-oct-2001 * Fixed bug in TCustomDropSource.SetImageIndex. Thanks to Maxim Abramovich for spotting this. * Added missing default property values to TCustomDropSource. Thanks to Maxim Abramovich for spotting this. * DragDrop.pas and DragDropContext.pas updated for Delphi 4. * Reimplemented utility to convert DFM form files from Delphi 5/6 test format to Delphi 4/5 binary format. * Improved unregistration of Shell Extensions. Shell extension now completely (and safely) remove their registry entries when unregistered. * Deprecated support for C++ Builder 3. * Released for test as v4.1 FT2. 25-sep-2001 * Rewritten ContextMenuHandlerShellExt demo. The demo is now actually a quite useful utility which can be used to register and unregister ActiveX controls, COM servers and type libraries. It includes the same functionality as Borland's TRegSvr utility. 20-sep-2001 * Added support for cascading menus, ownerdraw and menu bitmaps to TDropContextMenu component. * Modified TFileContentsStreamOnDemandClipboardFormat to handle invalid parameter value (FormatEtcIn.lindex) when data is copied to clipboard. This works around an apparent bug in the Windows clipboard. Thanks to Steve Moss for reporting this problem. * Modified TEnumFormatEtc class to not enumerate empty clipboard formats. Thanks to Steve Moss for this improvement. 1-sep-2001 * Introduced TCustomDropTarget.AutoRegister property. The AutoRegister property is used to control if drop target controls should be automatically unregistered and reregistered when their window handle is recreated by the VCL. If AutoRegister is True, which is the default, then automatic reregistration will be performed. This property was introduced because the hidden child control, which is used to monitor the drop target control's window handle, can have unwanted side effects on the drop target control (e.g. TToolBar). * Deprecated support for Delphi 3. 22-jun-2001 * Redesigned TTextDataFormat to handle RTF, Unicode, CSV and OEM text without conversion. Moved TTextDataFormat class to DragDropText unit. Added support for TLocaleClipboardFormat. * Surfaced new text formats as properties in TDropTextSource and TDropTextTarget. Previous versions of the Text source and target components represented all supported text formats via the Text property. In order to enable users to handle the different text formats independantly, the text source and target components now has individual properties for ANSI, OEM, Unicode and RTF text formats. The text target component can automatically synthesize some of the formats from the others (e.g. OEM text from ANSI text), but applications which previously relied on all formats being represented by the Text property will have to be modified to handle the new properties. * Added work around for problem where TToolBar as a drop target would display the invisible target proxy window. * Fixed wide string bug in WriteFilesToZeroList. Thanks to Werner Lehmann for spotting this. 15-jun-2001 * Added work-around for Outlook Express IDataObject.QueryGetData quirk. 3-jun-2001 * Ported to C++ Builder 4 and 5. * Added missing DragDropDesign.pas unit to design time packages. * First attempt at C++ Builder 3 port.... failed. * Improved handling of oversized File Group Descriptor data. * Added support for IStorage medium to TFileContentsStreamClipboardFormat. This allows the TDropComboTarget component to accept messages dropped from Microsoft Outlook. This work was sponsored by ThoughtShare Communications Inc. 23-may-2001 * Ported to Delphi 4. * First attempt at C++ Builder 5 port.... failed. 18-may-2001 * Released as version 4.0. Note: Version 4.0 was released exclusively on the Delphi 6 Companion CD. * ContextMenuDemo and DropHandlerDemo application has been partially rewritten and renamed. ContextMenuDemo is now named ContextMenuHandlerShellExt. DropHandlerDemo is now named DropHandlerShellExt. * TDropContextMenu component has been rewitten. The TDropContextMenu now implements a context menu handler shell extension. In previous releases it implemented a drag drop handler shell extension. * The DragDropHandler.pas unit which implements the TDropHandler component has been renamed to DropHandler.pas. * Added new TDragDropHandler component. The new component, which lives in the DragDropHandler unit, is used to implement drag drop handler shell extensions. * Added DragDropHandlerShellExt demo application. * Removed misc incomplete demos from kit. * Fixed minor problem in VirtualFileStream demo which caused drops from the VirtualFile demo not to transfer content correctly. 11-may-2001 * Converted all demo forms to text DFM format. This has been nescessary to maintain compatibility between all supported versions of Delphi. * Fixed a bug in GetPIDLsFromFilenames which caused drag-link of files (dtLink with TDropFileSource) not to work. * Added readme.txt files to some demo applications. * Added missing tlb and C++ Builder files to install kit. * Released as FT4. 6-may-2001 * Added missing dfm files to install kit. * Tested with Delphi 5. Fixed Delphi 5 compatibility error in main.dfm of DragDropDemo. * Removed misc compiler warnings. * The AsyncTransferTarget and OleObjectDemo demos were incomplete and has been removed from the kit for the V4.0 release. The demos will be included in a future release. * Released as FT3. 3-may-2001 * Added missing dpr and bpg files to install kit. * Updated readme.txt with regard to lack of C++ Builder demos. * Released as FT2. 29-apr-2001 * Cleaned up for release. * Released as FT1. 23-feb-2001 * Modified TCustomDropTarget.FindTarget to handle overlapping targets (e.g. different targets at the same position but on different pages of a page control or notebook). Thanks to Roger Moe for spotting this problem. 13-feb-2001 * Renamed AsyncTransfer2 demo to AsyncTransferSource. * Added AsyncTransferTarget demo. * Replaced TChart in AsyncTransfer2 demo with homegrown pie-chart-thing. * Modified all IStream based target formats to support incremental transfer. * URW533 problem has finally been fixed. The cause of the problem, which is a bug in Delphi, was found by Stefan Hoffmeister. * Fixed free notification for TDropContextmenu and TDataFormatAdapter. 27-dec-2000 * Moved TVirtualFileStreamDataFormat and TFileContentsStreamOnDemandClipboardFormat classes from VirtualFileStream demo to DragDropFormats unit. * Added TClipboardFormat.DataFormat and TClipboardFormats.DataFormat property. * Added TDropEmptySource and TDropEmptyTarget components. These are basically do-nothing components for use with TDataFormatAdapter. * Rewritten AsyncTransfer2 demo. The demo now uses TDropEmptySource, TDataFormatAdapter and TVirtualFileStreamDataFormat to transfer 10Mb of data with progress feedback. * Rewritten VirtualFileStream demo. The demo now uses TDropEmptySource, TDropEmptyTarget, TDataFormatAdapter and TVirtualFileStreamDataFormat. * Fixed memory leak in TVirtualFileStreamDataFormat. This leak only affected the old VirtualFileStream demo. * Added support for full File Descriptor attribute set to TVirtualFileStreamDataFormat. It is now possible to specify file attributes such as file size and last modified time in addition to the filename. I plan to add similar features to the other classes which uses FileDescriptors (e.g. TDropFileSource and TDropFileTarget). 21-dec-2000 * Ported to Delphi 4. * Added workaround for design bug in either Explorer or the clipboard. Explorer and the clipboard's requirements to the cursor position of an IStream object are incompatible. Explorer requires the cursor to be at the beginning of stream and the clipboard requires the cursor to be at the end of stream. 15-dec-2000 * Fixed URW533 problem. I'll leave the description of the workaround in here for now in case the problem resurfaces. 11-dec-2000 * Fixed bug in filename to PIDL conversion (GetPIDLsFromFilenames) which affected TDropFileTarget. Thanks to Poul Halgaard J鴕gensen for reporting this. 4-dec-2000 * Added THTMLDataFormat. * Fixed a a few small bugs which affected clipboard operations. * Added {$ALIGN ON} to dragdrop.inc. Apparently COM drag/drop requires some structures to be word alligned. This change fixes problems where some of the demos would suddenly stop working. * The URW533 problem has resurfaced. See the "Known problems" section below. 13-nov-2000 * TCopyPasteDataFormat has been renamed to TFeedbackDataFormat. * Added support for the Windows 2000 "TargetCLSID" format with the TTargetCLSIDClipboardFormat class and the TCustomDropSource.TargetCLSID property. * Added support for the "Logical Performed DropEffect" format with the TLogicalPerformedDropEffectClipboardFormat class. The class is used internally by TCustomDropSource. 30-oct-2000 * Added ContextMenu demo and TDropContextMenu component. Demonstrates how to customize the context menu which is displayed when a file is dragged with the right mouse button and dropped in the shell. * Added TCustomDataFormat.GetData. With the introduction of the GetData method, Data Format classes can now be used stand-alone to extract data from an IDataObject. 20-oct-2000 * Added VirtualFileStream demo. Demonstrates how to use the "File Contents" and "File Group Descritor" clipboard formats to drag and drop virtual files (files which doesn't exist physically) and transfer the data on-demand via a stream. 14-oct-2000 * Added special drop target registration of TCustomRichEdit controls. TCustomRichEdit needs special attention because it implements its own drop target handling which prevents it to work with these components. TCustomDropTarget now disables a rich edit control's built in drag/drop handling when the control is registered as a drop target. * Added work around for Windows bug where IDropTarget.DragOver is called regardless that the drop has been rejected in IDropTarget.DragEnter. 12-oct-2000 * Fixed bug that caused docking to interfere with drop targets. Thanks to G. Bradley MacDonald for bringing the problem to my attention. 30-sep-2000 * The DataFormats property has been made public in the TCustomDropMultiTarget class. * Added VirtualFile demo. Demonstrates how to use the TFileContentsClipboardFormat and TFileGroupDescritorClipboardFormat formats to drag and drop a virtual file (a file which doesn't exist physically). 28-sep-2000 * Improved drop source detection of optimized move. When an optimized move is performed by a drop target, the drop source's Execute method will now return drDropMove. Previously drCancel was returned. The OnAfterDrop event must still be used to determine if a move operation were optimized or not. * Modified TCustomDropTarget.GetPreferredDropEffect to get data from the current IDataObject instead of from the VCL global clipboard. 18-sep-2000 * Fixed bug in DropComboTarget caused by the 17-sep-2000 TStreams modification. 17-sep-2000 * Added AsyncTransfer2 demo to demonstrate use of TDropSourceThread. * Renamed TStreams class to TStreamList. 29-aug-2000 * Added TDropSourceThread. TDropSourceThread is an alternative to Windows 2000 asynchronous data transfers but also works on other platforms than Windows 2000. TDropSourceThread is based on code contributed by E. J. Molendijk. 24-aug-2000 * Added support for Windows 2000 asynchronous data transfers. Added IAsyncOperation implementation to TCustomDropSource. Added TCustomDropSource.AllowAsyncTransfer and AsyncTransfer properties. 5-aug-2000 * Added work around for URW533 compiler bug. * Fixed D4 and D5 packages and updated a few demos. Obsolete DropMultiTarget were still referenced a few places. * Documented work around for C++ Builder 5 compiler error. See the Known Problems section later in this document for more information. 2-aug-2000 * The package files provided in the kit is now design-time only packages. In previous versions, the packages could be used both at design- and run-time. The change was nescessary because the package now contains design-time code. * Added possible work around for suspected C++ Builder bug. The bug manifests itself as a "Overloadable operator expected" compile time error. See the "Known problems" section of this document. * Rewrote CustomFormat1 demo. * Added CustomFormat2 demo. * TDataDirection members has been renamed from ddGet and ddSet to ddRead and ddWrite. * All File Group Descritor and File Contents clipboard formats has been moved from the DragDropFile unit to the DragDropFormats unit. * File Contents support has been added to TTextDataFormat. The support is currently only enabled for drop sources. * Renamed TDropMultiTarget component to TDropComboTarget. Note: This will break applications which uses the TDropMultiTarget component. You can use the following technique to port application from previous releases: 1) Install the new components. 2) Repeat step 3-8 for all units which uses the TDropMultiTarget component. 3) Make a backup of the unit (both pas and dfm file) just in case... 4) Open the unit in the IDE. 5) In the .pas file, replace all occurances of "TDropMultiTarget" with "TDropComboTarget". 6) View the form as text. 7) Replace all occurances of "TDropMultiTarget" with "TDropComboTarget". 8) Save the unit. * Renamed a lot of demo files and directories. * Added work around for yet another bug in TStreamAdapter. * Added TCustomStringClipboardFormat as new base class for TCustomTextClipboardFormat. This changes the class hierachy a bit for classes which previously descended from TCustomTextClipboardFormat: All formats which needs zero termination now descend from TCustomTextClipboardFormat and the rest descend from TCustomStringClipboardFormat. Added TrimZeroes property. Fixed zero termination bug in TCustomTextClipboardFormat and generally improved handling of zero terminated strings. Disabled zero trim in TCustomStringClipboardFormat and enabled it in TCustomTextClipboardFormat. 23-jul-2000 * Improved handling of long file names in DropHandler demo. Added work around for ParamStr bug. * Added TDataFormatAdapter component and adapter demo. TDataFormatAdapter is used to extend the existing source and target components with additional data format support without modifying them. It can be considered an dynamic alternative to the current TDropMultiTarget component. 17-jul-2000 * TDropHandler component and DropHandler demo fully functional. 14-jul-2000 * Tested with C++ Builder 5. * Fixed sporadic integer overflow bug in DragDetectPlus function. * Added shell drop handler support with TDropHandler component. This is a work in progress and is not yet functional. 1-jul-2000 * Tested with Delphi 4. * Support for Windows 2000 inter application drag images. * TRawClipboardFormat and TRawDataFormat classes for support of arbitrary unknown clipboard formats. The classes are used internally in the TCustomDropSource.SetData method to support W2K drag images.
Servlets和JSP核心技术 卷2 内容还是很详细的,看过卷1的人可以继续用这本书深造,呵呵 目录: Chapter 1. Using and Deploying Web Applications Section 1.1. Purpose of Web Applications Section 1.2. Structure of Web Applications Section 1.3. Registering Web Applications with the Server Section 1.4. Development and Deployment Strategies Section 1.5. The Art of WAR: Bundling Web Applications into WAR Files Section 1.6. Building a Simple Web Application Section 1.7. Sharing Data Among Web Applications Chapter 2. Controlling Web Application Behavior with web.xml Section 2.1. Purpose of the Deployment Descriptor Section 2.2. Defining the Header and the Root Element Section 2.3. The Elements of web.xml Section 2.4. Assigning Names and Custom URLs Section 2.5. Disabling the Invoker Servlet Section 2.6. Initializing and Preloading Servlets and JSP Pages Section 2.7. Declaring Filters Section 2.8. Specifying Welcome Pages Section 2.9. Designating Pages to Handle Errors Section 2.10. Providing Security Section 2.11. Controlling Session Timeouts Section 2.12. Documenting Web Applications Section 2.13. Associating Files with MIME Types Section 2.14. Configuring JSP Pages Section 2.15. Configuring Character Encoding Section 2.16. Designating Application Event Listeners Section 2.17. Developing for the Clustered Environment Section 2.18. J2EE Elements Chapter 3. Declarative Security Section 3.1. Form-Based Authentication Section 3.2. Example: Form-Based Authentication Section 3.3. BASIC Authentication Section 3.4. Example: BASIC Authentication Section 3.5. Configuring Tomcat to Use SSL Section 3.6. WebClient: Talking to Web Servers Interactively Section 3.7. Signing a Server Certificate Chapter 4. Programmatic Security Section 4.1. Combining Container-Managed and Programmatic Security Section 4.2. Example: Combining Container-Managed and Programmatic Security Section 4.3. Handling All Security Programmatically Section 4.4. Example: Handling All Security Programmatically Section 4.5. Using Programmatic Security with SSL Section 4.6. Example: Programmatic Security and SSL Chapter 5. Servlet and JSP Filters Section 5.1. Creating Basic Filters Section 5.2. Example: A Reporting Filter Section 5.3. Accessing the Servlet Context from Filters Section 5.4. Example: A Logging Filter Section 5.5. Using Filter Initialization Parameters Section 5.6. Example: An Access Time Filter Section 5.7. Blocking the Response Section 5.8. Example: A Prohibited-Site Filter Section 5.9. Modifying the Response Section 5.10. Example: A Replacement Filter Section 5.11. Example: A Compression Filter Section 5.12. Configuring Filters to Work with RequestDispatcher Section 5.13. Example: Plugging a Potential Security Hole Section 5.14. The Complete Filter Deployment Descriptor Chapter 6. The Application Events Framework Section 6.1. Monitoring Creation and Destruction of the Servlet Context Section 6.2. Example: Initializing Commonly Used Data Section 6.3. Detecting Changes in Servlet Context Attributes Section 6.4. Example: Monitoring Changes to Commonly Used Data Section 6.5. Packaging Listeners with Tag Libraries Section 6.6. Example: Packaging the Company Name Listeners Section 6.7. Recognizing Session Creation and Destruction Section 6.8. Example: A Listener That Counts Sessions Section 6.9. Watching for Changes in Session Attributes Section 6.10. Example: Monitoring Yacht Orders Section 6.11. Identifying Servlet Request Initialization and Destruction Section 6.12. Example: Calculating Server Request Load Section 6.13. Watching Servlet Request for Attribute Changes Section 6.14. Example: Stopping Request Frequency Collection Section 6.15. Using Multiple Cooperating Listeners Section 6.16. The Complete Events Deployment Descriptor Chapter 7. Tag Libraries: The Basics Section 7.1. Tag Library Components Section 7.2. Example: Simple Prime Tag Section 7.3. Assigning Attributes to Tags Section 7.4. Example: Prime Tag with Variable Length Section 7.5. Including Tag Body in the Tag Output Section 7.6. Example: Heading Tag Section 7.7. Example: Debug Tag Section 7.8. Creating Tag Files Section 7.9. Example: Simple Prime Tag Using Tag Files Section 7.10. Example: Prime Tag with Variable Length Using Tag Files Section 7.11. Example: Heading Tag Using Tag Files Chapter 8. Tag Libraries: Advanced Features Section 8.1. Manipulating Tag Body Section 8.2. Example: HTML-Filtering Tag Section 8.3. Assigning Dynamic Values to Tag Attributes Section 8.4. Example: Simple Looping Tag Section 8.5. Assigning Complex Objects as Values to Tag Attributes Section 8.6. Example: Table Formatting Tag Section 8.7. Creating Looping Tags Section 8.8. Example: ForEach Tag Section 8.9. Creating Expression Language Functions Section 8.10. Example: Improved Debug Tag Section 8.11. Handling Nested Custom Tags Section 8.12. Example: If-Then-Else Tag Chapter 9. JSP Standard Tag Library (JSTL) Section 9.1. Installation of JSTL Section 9.2. c:out Tag Section 9.3. c:forEach and c:forTokens Tags Section 9.4. c:if Tag Section 9.5. c:choose Tag Section 9.6. c:set and c:remove Tags Section 9.7. c:import Tag Section 9.8. c:url and c:param Tags Section 9.9. c:redirect Tag Section 9.10. c:catch Tag Chapter 10. The Struts Framework: Basics Section 10.1. Understanding Struts Section 10.2. Setting Up Struts Section 10.3. The Struts Flow of Control and the Six Steps to Implementing It Section 10.4. Processing Requests with Action Objects Section 10.5. Handling Request Parameters with Form Beans Section 10.6. Prepopulating and Redisplaying Input Forms Chapter 11. The Struts Framework: Doing More Section 11.1. Using Properties Files Section 11.2. Internationalizing Applications Section 11.3. Laying Out Pages with Tiles Section 11.4. Using Tiles Definitions Chapter 12. The Struts Framework: Validating User Input Section 12.1. Validating in the Action Class Section 12.2. Validating in the Form Bean Section 12.3. Using the Automatic Validation Framework Developing Applications with Apache Ant Section A.1. Summarizing the Benefits of Ant Section A.2. Installing and Setting Up Ant Section A.3. Creating an Ant Project Section A.4. Reviewing Common Ant Tasks Section A.5. Example: Writing a Simple Ant Project Section A.6. Using Ant to Build a Web Application Section A.7. Example: Building a Web Application Section A.8. Using Ant to Create a WAR File Section A.9. Example: Creating a Web Application WAR File Index
TAC KBP Chinese Entity Linking Comprehensive Training and Evaluation Data 2011-2014 LDC2015E17 March 20, 2015 Linguistic Data Consortium 1. Overview Text Analysis Conference (TAC) is a series of workshops organized by the National Institute of Standards and Technology (NIST). TAC was developed to encourage research in natural language processing (NLP) and related applications by providing a large test collection, common evaluation procedures, and a forum for researchers to share their results. Through its various evaluations, the Knowledge Base Population (KBP) track of TAC encourages the development of systems that can match entities mentioned in natural texts with those appearing in a knowledge base and extract novel information about entities from a document collection and add it to a new or existing knowledge base. The goal of Entity Linking is to determine whether or not the entity referred to in each query has a matching entity node in the reference Knowledge Base (KB) (LDC2014T16). If there is a matching node for a query, annotators create a link between the two. If there is not a matching node for a query, the entity is marked as 'NIL' and then clustered with other NIL entities into equivalence classes. For more information, please refer to the Entity Linking section of NIST's 2014 TAC KBP website (2014 was the last year in which the Chinese Entity Linking evaluation was conducted as of the time this package was created) at http://nlp.cs.rpi.edu/kbp/2014/ This package contains all evaluation and training data developed in support of TAC KBP Chinese Entity Linking during the four years since the task's inception in 2011. This includes queries, KB links, equivalence class clusters for NIL entities (those that could not be linked to an entity in the knowledge base), and entity type information for each of the queries. The data included in this package were originally released by LDC to TAC KBP coordinators and performers under the following ecorpora catalog IDs and titles: LDC2011E46: TAC 2011 KBP Cross-lingual Sample Entity Linking Queries V1.1 LDC2011E55: TAC 2011 KBP Cross-lingual Training Entity Linking V1.1 LDC2012E34: TAC 2011 KBP Cross-Lingual Evaluation Entity Linking Annotation LDC2012E66: TAC 2012 KBP Chinese Entity Linking Web Training Queries and Annotations LDC2012E103: TAC 2012 KBP Chinese Entity Linking Evaluation Annotations V1.2 LDC2013E96: TAC 2013 KBP Chinese Entity Linking Evaluation Queries and Knowledge Base Links V1.2 LDC2014E47: TAC 2014 KBP Chinese Entity Linking Discussion Forum Training Data LDC2014E83: TAC 2014 KBP Chinese Entity Linking Evaluation Queries and Knowledge Base Links V2.0 2. Contents ./README.txt This file ./data/2011/eval/tac_kbp_2011_chinese_entity_linking_evaluation_queries.xml This file contains 2176 queries. Each query entry consists of the following fields: <query id> - A query ID formatted as the letters "EL_CLCMN_" (if a Chinese language query) or "EL_CLENG_" (if an English language query) plus a five-digit zero-padded, sequentially assigned integer (e.g. "EL_CLCMN_00001"). <name> - The full namestring of the query entity. <docid> - An ID for a document in ./data/2011/eval/source_documents/ from which the namestring was extracted. The queries are distributed by language and type as follows: KB-Link GPE ORG PER Total ---------------------------------------- CMN NW NIL: 120 291 420 831 CMN NW Non-NIL: 279 150 221 650 ENG NW NIL: 90 129 20 239 ENG NW Non-NIL: 93 72 104 269 ENG WB NIL: 16 0 5 21 ENG WB Non-NIL: 44 68 54 166 ---------------------------------------- Total: 624 710 824 2176 ./data/2011/eval/tac_kbp_2011_chinese_entity_linking_evaluation_KB_links.tab This file contains the responses for each query as identified by human annotators at LDC. This file is tab delimited, with 4 fields total. The column descriptions are as follows: 1. query ID - The ID for the query detailed in tac_kbp_2011_chinese_entity_linking_evaluation_queries.xml to which the subsequent information pertains 2. entity ID - A unique entity node ID or NIL ID, correspondent to entity linking annotation and NIL-coreference (clustering) annotation respectively. If the entity node ID begins with "E", the text refers to an entity in the Knowledge Base (TAC KBP Reference Knowledge Base - LDC2014T16). If the given query is not linked to an entity in the Knowledge Base (KB), then it is given a NIL-ID, which consists of "NIL" plus a four-digit zero-padded sequentially assigned integer (e.g. NIL-0001, NIL-0002). Both the entities with an entity node ID of "E" type and "NIL" type are assumed to be co-referenced (clustered), with the same "E" type ID or the same "NIL" ID if they refer to the same entity. Each "E" type ID and NIL ID is distinct from one another. 3. entity-type - GPE, ORG, or PER type indicator for the entity 4. genre - WB/NW/DF indicating the source genre of the document for the query (WB for web data, NW for newswire data, or DF for discussion forum data). ./data/2011/eval/source_documents/* This directory contains all of the source documents listed in the <docid> attribute for each query in tac_kbp_2011_chinese_entity_linking_evaluation_queries.xml. See section 5 for more information about source documents. ./data/2011/training/tac_kbp_2011_chinese_entity_linking_sample_and_training_queries.xml This file is a concatenation of the queries files originally released in LDC2011E46 (sample) and LDC2011E55 (training). This file contains 2171 queries. Each query entry consists of the following fields: <query id> - A query ID formatted as the letters "EL_CLCMN_" (if a Chinese language query) or "EL_CLENG_" (if an English language query) plus a five-digit zero-padded, sequentially assigned integer (e.g. "EL_CLCMN_00001"). <name> - The full namestring of the query entity. <docid> - An ID for a document in ./data/2011/training/source_documents/ from which the namestring was extracted. The queries are distributed by language and type as follows: KB-Link GPE ORG PER Total ---------------------------------------- CMN NW NIL: 124 293 426 843 CMN NW Non-NIL: 284 149 227 660 ENG NW NIL: 143 116 63 322 ENG NW Non-NIL: 122 100 100 322 ENG WB NIL: 0 1 0 1 ENG WB Non-NIL: 14 3 6 23 ---------------------------------------- Total: 687 662 822 2171 ./data/2011/training/tac_kbp_2011_chinese_entity_linking_sample_and_training_KB_links.tab This file is a concatenation of the KB_links files originally released in LDC2011E46 (sample) and LDC2011E55 (training). This file contains the responses for each query as identified by human annotators at LDC. This file is tab delimited, with 4 fields total. The column descriptions are as follows: 1. query ID - The ID for the query detailed in tac_kbp_2011_chinese_entity_linking_sample_and_training_queries.xml to which the subsequent information pertains 2. entity ID - A unique entity node ID or NIL ID, correspondent to entity linking annotation and NIL-coreference (clustering) annotation respectively. If the entity node ID begins with "E", the text refers to an entity in the Knowledge Base (TAC KBP Reference Knowledge Base - LDC2014T16). If the given query is not linked to an entity in the Knowledge Base (KB), then it is given a NIL-ID, which consists of "NIL" plus a four-digit zero-padded sequentially assigned integer (e.g. NIL-0001, NIL-0002). Both the entities with an entity node ID of "E" type and "NIL" type are assumed to be co-referenced (clustered), with the same "E" type ID or the same "NIL" ID if they refer to the same entity. Each "E" type ID and NIL ID is distinct from one another. 3. entity-type - GPE, ORG, or PER type indicator for the entity 4. genre - WB/NW/DF indicating the source genre of the document for the query (WB for web data, NW for newswire data, or DF for discussion forum data). ./data/2011/training/source_documents/* This directory contains all of the source documents listed in the <docid> of tac_kbp_2011_chinese_entity_linking_sample_and_training_queries.xml See section 5 for more information about source documents. ./data/2012/eval/tac_kbp_2012_chinese_entity_linking_evaluation_queries.xml This file contains 2122 queries. Each query entry consists of the following fields: <query id> - A query ID formatted as the letters "EL_CMN_" plus a five-digit zero-padded, sequentially assigned integer (e.g., "EL_CMN_00001"). <name> - The full namestring of the query entity. <docid> - An ID for a document in ./data/2012/eval/source_documents/ from which the namestring was extracted. <beg> - The starting offset for the namestring. <end> - The ending offset for the namestring. The queries are distributed by language and type as follows: KB-Link GPE ORG PER Total ---------------------------------------- CMN NW NIL: 99 89 167 355 CMN NW Non-NIL: 164 167 148 479 CMN WB NIL: 88 86 68 242 CMN WB Non-NIL: 131 112 110 353 ENG NW NIL: 90 79 68 237 ENG NW Non-NIL: 101 107 83 291 ENG WB NIL: 6 26 16 48 ENG WB Non-NIL: 26 52 39 117 ---------------------------------------- Total: 705 718 699 2122 ./data/2012/eval/tac_kbp_2012_chinese_entity_linking_evaluation_KB_links.tab This file contains the responses for each query as identified by human annotators at LDC. This file is tab delimited, with 5 fields total. The column descriptions are as follows: 1. query ID - The ID for the query detailed in tac_kbp_2012_chinese_entity_linking_evaluation_queries.xml to which the subsequent information pertains 2. entity ID - A unique entity node ID or NIL ID, correspondent to entity linking annotation and NIL-coreference (clustering) annotation respectively. If the entity node ID begins with "E", the text refers to an entity in the Knowledge Base (TAC KBP Reference Knowledge Base - LDC2014T16). If the given query is not linked to an entity in the Knowledge Base (KB), then it is given a NIL-ID, which consists of "NIL" plus a three-digit zero-padded sequentially assigned integer (e.g. NIL001, NIL002). Both the entities with an entity node ID of "E" type and "NIL" type are assumed to be co-referenced (clustered), with the same "E" type ID or the same "NIL" ID if they refer to the same entity. Each "E" type ID and NIL ID is distinct from one another. 3. entity-type - GPE, ORG, or PER type indicator for the entity 4. genre - WB/NW/DF indicating the source genre of the document for the query (WB for web data, NW for newswire data, or DF for discussion forum data). 5. web-search - (Y/N) indicating whether the annotator made use of web searches in order to make the linking judgment. ./data/2012/eval/source_documents/* This directory contains all of the source documents listed in the <docid> of tac_kbp_2012_chinese_entity_linking_evaluation_queries.xml See section 5 for more information about source documents. ./data/2012/training/tac_kbp_2012_chinese_entity_linking_training_queries.xml This file contains 158 queries. Each query entry consists of the following fields: <query id> - A query ID formatted as the letters "EL_CMN_" plus a five-digit zero-padded, sequentially assigned integer (e.g., "EL_CMN_00001"). <name> - The full namestring of the query entity. <docid> - An ID for a document in ./data/2012/training/source_documents/ from which the namestring was extracted. <beg> - The starting offset for the namestring. <end> - The ending offset for the namestring. The queries are distributed by language and type as follows: KB-Link GPE ORG PER Total ---------------------------------------- CMN NW NIL: 2 2 2 6 CMN NW Non-NIL: 0 2 0 2 CMN WB NIL: 16 16 17 49 CMN WB Non-NIL: 24 25 24 73 ENG WB NIL: 3 4 0 7 ENG WB Non-NIL: 7 5 9 21 ---------------------------------------- Total: 52 54 52 158 ./data/2012/training/tac_kbp_2012_chinese_entity_linking_training_KB_links.tab This file contains the responses for each query as identified by human annotators at LDC. This file is tab delimited, with 5 fields total. The column descriptions are as follows: 1. query ID - The ID for the query detailed in tac_kbp_2012_chinese_entity_linking_training_queries.xml to which the subsequent information pertains 2. entity ID - A unique entity node ID or NIL ID, correspondent to entity linking annotation and NIL-coreference (clustering) annotation respectively. If the entity node ID begins with "E", the text refers to an entity in the Knowledge Base (TAC KBP Reference Knowledge Base - LDC2014T16). If the given query is not linked to an entity in the Knowledge Base (KB), then it is given a NIL-ID, which consists of "NIL" plus a three-digit zero-padded sequentially assigned integer (e.g. NIL001, NIL002). Both the entities with an entity node ID of "E" type and "NIL" type are assumed to be co-referenced (clustered), with the same "E" type ID or the same "NIL" ID if they refer to the same entity. Each "E" type ID and NIL ID is distinct from one another. 3. entity-type - GPE, ORG, or PER type indicator for the entity 4. genre - WB/NW/DF indicating the source genre of the document for the query (WB for web data, NW for newswire data, or DF for discussion forum data). 5. web-search - (Y/N) indicating whether the annotator made use of web searches in order to make the linking judgment. ./data/2012/training/source_documents/* This directory contains all of the source documents listed in the <docid> of tac_kbp_2012_chinese_entity_linking_training_queries.xml See section 5 for more information about source documents. ./data/2013/eval/tac_kbp_2013_chinese_entity_linking_evaluation_queries.xml This file contains 2155 queries. Each query entry consists of the following fields: <query id> - A query ID formatted as the letters "EL13_CMN" plus a four-digit zero-padded, sequentially assigned integer (e.g., "EL13_CMN_0001"). <name> - The full namestring of the query entity. <docid> - An ID for a document in ./data/2013/eval/source_documents/ from which the namestring was extracted. <beg> - The starting offset for the namestring. <end> - The ending offset for the namestring. The queries are distributed by language and type as follows: KB-Link PER ORG GPE Total ----------------------------------------- CMN NW NIL: 123 197 125 445 CMN NW Non-NIL: 124 119 163 406 CMN WB NIL: 112 105 87 304 CMN WB Non-NIL: 173 150 162 485 ENG NW NIL: 52 16 68 136 ENG NW Non-NIL: 83 87 64 234 ENG WB NIL: 11 19 7 37 ENG WB Non-NIL: 28 42 38 108 ----------------------------------------- Total: 706 735 714 2155 ./data/2013/eval/tac_kbp_2013_chinese_entity_linking_evaluation_KB_links.tab This file contains the responses for each query as identified by human annotators at LDC. This file is tab delimited, with 6 fields total. The column descriptions are as follows: 1. query ID - The ID for the query detailed in tac_kbp_2013_chinese_entity_linking_evaluation_queries.xml to which the subsequent information pertains 2. entity ID - A unique entity node ID or NIL ID, correspondent to entity linking annotation and NIL-coreference (clustering) annotation respectively. If the entity node ID begins with "E", the text refers to an entity in the Knowledge Base (TAC KBP Reference Knowledge Base - LDC2014T16). If the given query is not linked to an entity in the Knowledge Base (KB), then it is given a NIL-ID, which consists of "NIL" plus a three-digit zero-padded sequentially assigned integer (e.g. NIL001, NIL002). Both the entities with an entity node ID of "E" type and "NIL" type are assumed to be co-referenced (clustered), with the same "E" type ID or the same "NIL" ID if they refer to the same entity. Each "E" type ID and NIL ID is distinct from one another. 3. entity-type - GPE, ORG, or PER type indicator for the entity 4. genre - WB/NW/DF indicating the source genre of the document for the query (WB for web data, NW for newswire data, or DF for discussion forum data). 5. web-search - (Y/N) indicating whether the annotator made use of web searches in order to make the linking judgment. 6. wiki text - (Y/N) indicating whether the annotator made use of the wiki text in the knowledge base (as opposed to just the infobox information) in order to make the linking judgment. ./data/2013/eval/source_documents/* This directory contains all of the source documents listed in the <docid> of tac_kbp_2013_chinese_entity_linking_evaluation_queries.xml See section 5 for more information about source documents. ./data/2014/eval/tac_kbp_2014_chinese_entity_linking_evaluation_queries.xml This file contains 2739 queries. Each query entry consists of the following fields: <query id> - A query ID formatted as the letters "EL14_CMN_" plus a four-digit zero-padded, sequentially assigned integer (e.g., "EL14_CMN_0001"). <name> - The full namestring of the query entity. <docid> - An ID for a document in ./data/2014/eval/source_documents/ from which the namestring was extracted. <beg> - The starting offset for the namestring. <end> - The ending offset for the namestring. The queries are distributed by language and type as follows: KB-Link PER ORG GPE Total --------------------------------------------- CMN DF NIL: 118 40 16 174 CMN DF Non-NIL: 426 61 66 553 CMN NW NIL: 179 413 300 892 CMN NW Non-NIL: 349 139 184 672 ENG DF NIL: 1 4 5 10 ENG DF Non-NIL: 5 26 25 56 ENG NW NIL: 10 65 32 107 ENG NW Non-NIL: 87 66 119 272 ENG WB Non-NIL: 1 0 2 3 --------------------------------------------- Total: 1176 814 749 2739 ./data/2014/eval/tac_kbp_2014_chinese_entity_linking_evaluation_KB_links.tab This file contains the responses for each query as identified by human annotators at LDC. This file is tab delimited, with 6 fields total. The column descriptions are as follows: 1. query ID - The ID for the query detailed in tac_kbp_2014_chinese_entity_linking_evaluation_queries.xml to which the subsequent information pertains 2. entity ID - A unique entity node ID or NIL ID, correspondent to entity linking annotation and NIL-coreference (clustering) annotation respectively. If the entity node ID begins with "E", the text refers to an entity in the Knowledge Base (TAC KBP Reference Knowledge Base - LDC2014T16). If the given query is not linked to an entity in the Knowledge Base (KB), then it is given a NIL-ID, which consists of "NIL" plus a three-digit zero-padded sequentially assigned integer (e.g. NIL001, NIL002). Both the entities with an entity node ID of "E" type and "NIL" type are assumed to be co-referenced (clustered), with the same "E" type ID or the same "NIL" ID if they refer to the same entity. Each "E" type ID and NIL ID is distinct from one another. 3. entity-type - GPE, ORG, or PER type indicator for the entity 4. genre - WB/NW/DF indicating the source genre of the document for the query (WB for web data, NW for newswire data, or DF for discussion forum data). 5. web-search - (Y/N) indicating whether the annotator made use of web searches in order to make the linking judgment. 6. wiki text - (Y/N) indicating whether the annotator made use of the wiki text in the knowledge base (as opposed to just the infobox information) in order to make the linking judgment. ./data/2014/eval/source_documents/* This directory contains all of the source documents listed in the <docid> of tac_kbp_2014_chinese_entity_linking_evaluation_queries.xml See section 5 for more information about source documents. ./data/2014/training/tac_kbp_2014_chinese_entity_linking_training_queries.xml This file contains 514 queries. Each query entry consists of the following fields: <query id> - A query ID formatted as the letters "EL14_CMN_TRAINING" plus a four-digit zero-padded, sequentially assigned integer (e.g., "EL14_CMN_TRAINING_0001"). <name> - The full namestring of the query entity. <docid> - An ID for a document in ./data/2014/training/source_documents/ from which the namestring was extracted. <beg> - The starting offset for the namestring. <end> - The ending offset for the namestring. The queries are distributed by language and type as follows: KB-Link PER ORG GPE Total ----------------------------------------- ENG DF NIL: 1 6 3 10 ENG DF Non-NIL: 33 37 41 111 CMN DF NIL: 28 46 6 80 CMN DF Non-NIL: 109 83 121 313 ----------------------------------------- Total: 171 172 171 514 ./data/2014/training/tac_kbp_2014_chinese_entity_linking_training_KB_links.tab This file contains the responses for each query as identified by human annotators at LDC. This file is tab delimited, with 6 fields total. The column descriptions are as follows: 1. query ID - The ID for the query detailed in tac_kbp_2014_chinese_entity_linking_training_queries.xml to which the subsequent information pertains 2. entity ID - A unique entity node ID or NIL ID, correspondent to entity linking annotation and NIL-coreference (clustering) annotation respectively. If the entity node ID begins with "E", the text refers to an entity in the Knowledge Base (TAC KBP Reference Knowledge Base - LDC2014T16). If the given query is not linked to an entity in the Knowledge Base (KB), then it is given a NIL-ID, which consists of "NIL" plus a three-digit zero-padded sequentially assigned integer (e.g. NIL001, NIL002). Both the entities with an entity node ID of "E" type and "NIL" type are assumed to be co-referenced (clustered), with the same "E" type ID or the same "NIL" ID if they refer to the same entity. Each "E" type ID and NIL ID is distinct from one another. 3. entity-type - GPE, ORG, or PER type indicator for the entity 4. genre - WB/NW/DF indicating the source genre of the document for the query (all DF or discussion forum threads in these data). 5. web-search - (Y/N) indicating whether the annotator made use of web searches in order to make the linking judgment. 6. wiki text - (Y/N) indicating whether the annotator made use of the wiki text in the knowledge base (as opposed to just the infobox information) in order to make the linking judgment. ./data/2014/training/source_documents/* This directory contains all of the source documents listed in the <docid> of tac_kbp_2014_chinese_entity_linking_training_queries.xml See section 5 for more information about source documents. ./dtd/2011_kbpentlink.dtd DTD for: tac_kbp_2011_chinese_entity_linking_evaluation_queries.xml tac_kbp_2011_chinese_entity_linking_sample_and_training_queries.xml ./dtd/2012_2013_2014_kbpentlink.dtd DTD for: tac_kbp_2012_chinese_entity_linking_evaluation_queries.xml tac_kbp_2012_chinese_entity_linking_training_queries.xml tac_kbp_2013_chinese_entity_linking_evaluation_queries.xml tac_kbp_2014_chinese_entity_linking_evaluation_queries.xml tac_kbp_2014_chinese_entity_linking_training_queries.xml 3. Annotation Given a name string and using information from the query's source document, bilingual Chinese/English-speaking annotators used a specialized search engine to look in the Knowledge Base for a page in which the entity referred to by the query was the central topic. If such a page was found, a link was created between the query and the matching KB node ID. If no matching page was found, the query was marked as NIL and later coreferenced with other NIL entities. Annotators were allowed to use online searching to assist in determining the KB link/NIL status. Queries for which a human annotator could not confidently determine the KB link status were removed from the final data sets. 4. Text Normalization Name string matches are case and punctuation sensitive. The only text normalization performed was: 1. conversion of newlines to spaces, except where preceding characters were hyphens ("-"), in which case newlines were removed 2. conversion of multiple spaces to a single space 5. Source Documents All the text data in the source files have been taken directly from previous LDC corpus releases, and are being provided here essentially "as-is", with little or no additional quality control. An overall scan of character content in the source collections indicates some relatively small quantities of various problems, especially in the web and discussion forum data, including language mismatch (characters from Chinese, Korean, Japanese, Arabic, Russian, etc.), and encoding errors (some documents have apparently undergone "double encoding" into UTF-8, and others may have been "noisy" to begin with, or may have gone through an improper encoding conversion, yielding occurrences of the Unicode "replacement character" (U+FFFD) throughout the corpus); the web collection also has characters whose Unicode code points lie outside the "Basic Multilanguage Plane" (BMP), i.e. above U+FFFF. All documents that have filenames beginning with "cmn-NG" and "eng-NG" are Web Document data (WB) and some of these fail XML parsing (see below for details). All files that start with "bolt-" are Discussion Forum threads (DF) and have the XML structure described below. All other files are Newswire data (NW) and have the newswire markup pattern detailed below. Note as well that some source documents are duplicated across a few of the separated source_documents directories, indicating that some queries from different data sets originated from the same source documents. As it is acceptable for sources to be reused for Entity Linking queries, this duplication is intentional and expected. The subsections below go into more detail regarding the markup and other properties of the three source data types: 5.1 Newswire Data Newswire data use the following markup framework: <DOC id="{doc_id_string}" type="{doc_type_label}"> <HEADLINE> ... </HEADLINE> <DATELINE> ... </DATELINE> <TEXT> <P> ... </P> ... </TEXT> </DOC> where the HEADLINE and DATELINE tags are optional (not always present), and the TEXT content may or may not include "<P> ... </P>" tags (depending on whether or not the "doc_type_label" is "story"). All the newswire files are parseable as XML. 5.2 Discussion Forum Data Discussion forum files use the following markup framework: <doc id="{doc_id_string}"> <headline> ... </headline> <post ...> ... <quote ...> ... </quote> ... </post> ... </doc> where there may be arbitrarily deep nesting of quote elements, and other elements may be present (e.g. "<a...>...</a>" anchor tags). As mentioned in section 2 above, each <doc> unit contains at least five post elements. All the discussion forum files are parseable as XML. 5.3 Web Document Data "Web" files use the following markup framework: <DOC> <DOCID> {doc_id_string} </DOCID> <DOCTYPE> ... </DOCTYPE> <DATETIME> ... </DATETIME> <BODY> <HEADLINE> ... </HEADLINE> <TEXT> <POST> <POSTER> ... </POSTER> <POSTDATE> ... </POSTDATE> ... </POST> </TEXT> </BODY> </DOC> Other kinds of tags may be present ("<QUOTE ...>", "<A >", etc). Some of the web source documents contain material that interferes with XML parsing (e.g. unescaped "&", or "<QUOTE>" tags that lack a corresponding "</QUOTE>"). 6. Using the Data 6.1 Offset calculation The values of the beg and end XML elements in the later queries.xml files indicate character offsets to identify text extents in the source. Offset counting starts from the initial character (character 0) of the source document and includes newlines and all markup characters - that is, the offsets are based on treating the source document file as "raw text", with all its markup included. 6.2 Proper ingesting of XML queries While the character offsets are calculated based on treating the source document as "raw text", the "name" strings being referenced by the queries sometimes contain XML metacharacters, and these had to be "re-escaped" for proper inclusion in the queries.xml file. For example, an actual name like "AT&T" may show up a source document file as "AT&T" (because the source document was originally formatted as XML data). But since the source doc is being treated here as raw text, this name string is treated in queries.xml as having 7 characters (i.e., the character offsets, when provided, will point to a string of length 7). However, the "name" element itself, as presented in the queries.xml file, will be even longer - "AT&amp;T" - because the queries.xml file is intended to be handled by an XML parser, which will return "AT&T" when this "name" element is extracted. Using the queries.xml data without XML parsing would yield a mismatch between the "name" value and the corresponding string in the source data. 7. Copyright Information (c) 2015 Trustees of the University of Pennsylvania 8. Contact Information For further information about this data release, contact the following project staff at LDC: Joseph Ellis, Project Manager <[email protected]> Jeremy Getman, Lead Annotator <[email protected]> Stephanie Strassel, PI <[email protected]> -------------------------------------------------------------------------- README created by Jeremy Getman on February 4, 2015 updated by Joe Ellis on February 16, 2015 updated by Jeremy Getman on February 17, 2015 updated by Joe Ellis on March 18, 2015

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值