Showing posts with label Delphi. Show all posts
Showing posts with label Delphi. Show all posts

Saturday, October 22, 2011

Delphi/Kylix Database Development






Contents
Introduction 1
Who This Book Is For ............................................................................1
How This Book Is Organized ..................................................................1
VCL or CLX? ....................................................................................2
Components Developed in This Book................................................3
Sample Applications ..........................................................................3
dbExpress............................................................................................5
Databases Used in This Book ............................................................6
Conventions Used in This Book ..............................................................6
Contacting the Author..............................................................................6
1 Establishing and Using Database Connections 7
Connecting to and Disconnecting from a Database ................................8
Establishing the Connection ..............................................................9
Disconnecting from the Database ....................................................13
Connect and Disconnect Events ......................................................14
Retrieving Database Metadata ..............................................................18
GetTableNames..................................................................................18
GetFieldNames..................................................................................18
GetIndexNames..................................................................................19
GetProcedureNames..........................................................................19
GetProcedureParams ........................................................................19
Executing DDL and DML Statements ..................................................27
DDL Commands ..............................................................................27
DML Commands ..............................................................................29
Transaction Support ..............................................................................37
Checking for Transaction Support....................................................38
Starting a Transaction ......................................................................39
Committing a Transaction ................................................................40
Rolling Back a Transaction ..............................................................40
Multiple Transactions ......................................................................40
Providing Feedback During SQL Operations........................................46
Changing the Cursor While Executing SQL Statements ................47
Creating a Callback Event to Monitor SQL Commands ................47
TSQLMonitor......................................................................................49
Using Multiple Feedback Mechanisms ............................................50
Summary................................................................................................552 dbExpress Datasets 57
What Are dbExpress Datasets?..............................................................58
dbExpress Datasets Are Unidirectional............................................58
dbExpress Datasets Are Read-Only ................................................59
dbExpress Datasets Are Lightweight ..............................................59
Types of Datasets ..................................................................................59
Tables................................................................................................59
Queries..............................................................................................60
Stored Procedures ............................................................................60
General-Purpose Datasets ................................................................60
Data Manipulation ................................................................................63
Opening a Dataset ............................................................................63
Closing a Dataset..............................................................................64
Retrieving Field Contents from a Dataset........................................64
Navigating a Dataset ........................................................................65
BLOB Support ......................................................................................69
Parameterized Queries ..........................................................................71
Ordering Data Returned from the Server ..............................................73
Ordering Data from a Table..............................................................73
Ordering Data from a Query ............................................................74
Master/Detail Relationships ..................................................................74
Retrieving Schema Information ............................................................79
Summary................................................................................................91
3 Client Dataset Basics 93
What Is a Client Dataset? ......................................................................94
Advantages and Disadvantages of Client Datasets................................94
Creating Client Datasets ........................................................................95
Creating a Client Dataset at Design-Time ......................................96
Creating a Client Dataset at Runtime ............................................101
Accessing Fields ............................................................................103
Populating and Manipulating Client Datasets ....................................105
Populating Manually ......................................................................105
Populating from Another Dataset ..................................................106
Populating from a File or Stream: Persisting Client Datasets ......106
Example: Creating, Populating, and Manipulating a
Client Dataset ..............................................................................108
Navigating Client Datasets ..................................................................113
Sequential Navigation ....................................................................113
Random-Access Navigation ..........................................................114
Client Dataset Indexes ........................................................................118
Creating Indexes ............................................................................119
Using Indexes ................................................................................121
Retrieving Index Information ........................................................122
Filters and Ranges................................................................................126
Ranges ............................................................................................126
Filters..............................................................................................127
Searching..............................................................................................136
Nonindexed Search Techniques......................................................136
Indexed Search Techniques ............................................................138
Summary..............................................................................................145
4 Advanced Client Dataset Operations 147
Dataset Events......................................................................................148
Disabling Data-Aware Components ....................................................158
BLOBs ................................................................................................162
Notes ..............................................................................................162
Images ............................................................................................162
Streamed Data ................................................................................165
Streamed Components....................................................................167
File BLOBs ....................................................................................168
Limitations of BLOB Fields ..........................................................168
Nested Datasets....................................................................................172
Undo Support ......................................................................................176
Cancel ............................................................................................177
The Change Log ............................................................................177
Viewing the Change Log................................................................182
Cloning Data from Another Client Dataset ........................................186
Maintained Aggregates ........................................................................192
Creating a Maintained Aggregate at Design Time ........................193
Creating a Maintained Aggregate at Runtime................................195
Aggregate Expressions ..................................................................195
Aggregates Across a Group of Records ........................................196
Enabling and Disabling Aggregates ..............................................197
GetGroupState................................................................................197
Miscellaneous Properties ....................................................................197
Constraints......................................................................................197
DisableStringTrim........................................................................198
ReadOnly ........................................................................................199
Summary..............................................................................................199
5 Data-Aware Components 201
What Are Data-Aware Components? ..................................................202
TDataSource ........................................................................................204
Common Data-Aware Component Characteristics..............................205
Modifying Component Data from Code ........................................205
Controlling When the User Is Allowed to Edit Data ....................206
Formatting and Editing Field Values..............................................206CONTENTS
vii
Simple Data-Aware Components ........................................................211
TDBText ..........................................................................................211
TDBEdit ..........................................................................................212
TDBMemo ..........................................................................................212
TDBCheckBox....................................................................................212
TDBRadioGroup................................................................................213
TDBComboBox....................................................................................213
TDBListBox ....................................................................................218
TDBImage ........................................................................................221
VCL-Only Data-Aware Controls ........................................................222
Lookup Data-Aware Controls..............................................................222
TDBNavigator ......................................................................................223
Creating Your Own Data-Aware Components ....................................225
TFieldDataLink..............................................................................225
Setting Up the TFieldDataLink......................................................226
Setting Up a Connection to the Data Source ................................227
Responding to Changes in the Dataset ..........................................227
Updating the Dataset ......................................................................227
Message Handlers ..........................................................................228
Action Handlers..............................................................................228
Data-Aware TDateTimePicker........................................................228
Sample Application..............................................................................232
Summary..............................................................................................236
6 Data-Aware Grids 239
TDBGrid ................................................................................................240
TDBGrid Basic Operation ................................................................240
Customizing Columns ....................................................................241
Grid Options ..................................................................................244
Events ............................................................................................245
Custom Drawing ............................................................................252
Solutions to Common Grid Questions ..........................................257
Limitations......................................................................................263
TClientDataSetGrid............................................................................263
Automatic Sorting ..........................................................................264
Column Customization ..................................................................265
TDBCtrlGrid ........................................................................................266
Properties ........................................................................................267
Events ............................................................................................267
Third-Party Data-Aware Grids ............................................................271
Summary..............................................................................................272
7 Dataset Providers 273
What Is a Dataset Provider? ................................................................274
Connecting to a Dataset ......................................................................275
Resolving Changes to Data..................................................................276
Applying Updates ..........................................................................276
Resolving to a Dataset....................................................................278
Reconciliation Errors......................................................................278
Resolving Changes to BLOB Fields ..............................................290
Refreshing Data from the Server....................................................290
Update Modes ................................................................................291
Provider Options ..................................................................................293
Provider Events....................................................................................295
Changing Field Values on the Server ..................................................297
Intercepting Data..................................................................................298
Optional Parameters ............................................................................300
Master/Detail Relationships ................................................................301
Providing and Resolving Data from Stored Procedures and Joins ....302
Providing and Resolving Data from a Stored Procedure ..............302
Providing and Resolving Data from a Join ....................................302
Connecting to a Local Database ..........................................................308
Using Providers Located on a Different Form ..............................308
One-Stop Shopping: TSQLClientDataSet ......................................309
Limiting the Amount of Data Returned by the Server ..................309
Summary..............................................................................................315
8 DataSnap 317
What Is DataSnap? ..............................................................................318
Creating the Application Server ..........................................................318
Remote Data Modules ....................................................................318
Creating the Application Server’s User Interface ..........................326
Preparing the Application Server for Testing ................................328
Creating the Client Application ..........................................................329
Connecting to a Local Database Connection ................................329
Connecting to a Remote Database Connection..............................330
A Complete Example ..........................................................................336
The Briefcase Model............................................................................340
Stateless Servers ..................................................................................341
Sharing a Connection Between Multiple Client DataSets ..................343
Brokering Connections Between Multiple Servers ............................344
Summary..............................................................................................3459 The ConMan Application 347
What Is ConMan? ................................................................................348
Database Structure ..............................................................................349
Overview of the Code..........................................................................352
The Server Application ........................................................................352
The Client Application ........................................................................358
Room for Improvement ......................................................................373
Summary..............................................................................................373
Appendixes
A Redistributing dbExpress Applications 375
Redistributable Files ............................................................................376
Redistributing a Windows Application ..........................................376
Redistributing a Linux Application ................................................377
Licensing Issues ..................................................................................378
CD-ROM-Based Applications ............................................................378
B dbExpress Plus 379
What Is dbExpress Plus? ....................................................................380
Scripting..........................................................................................380
Enhanced Metadata ........................................................................381
Data Pumping ................................................................................383
For More Information ..........................................................................384
Index 385

Another Delphi Books

Another Kylix Books
Another Database Books
Download

Friday, October 14, 2011

Borland Delphi 6 Developer’s Guide






Contents at a Glance
Introduction
Part I: Development Essentials
1 Programming in Delphi
2 The Object Pascal Language
3 Adventures in Messaging
Part II: Advanced Techniques
4 Writing Portable Code
5 Multithreaded Techniques
6 Dynamic Link Libraries
Part III: Database Development
7 Delphi Database Architecture
8 Database Development with dbExpress
9 Database Development with dbGo for ADO
Part IV: Component-Based Development
10 Component Architecture: VCL and CLX
11 VCL Component Building
12 Advanced VCL Component Building
13 CLX Component Development
14 Packages to the Max
15 COM Development
16 Windows Shell Programming
17 Using the Open Tools API
Part V: Enterprise Development
18 Transactional Development with COM+/MTS
19 CORBA Development
20 BizSnap Development: Writing SOAP-Based Web Services
21 DataSnap Development
Part VI: Internet Development
22 ASP Development
23 Building WebSnap Applications
24 Wireless Development
Index


Another Delphi Books

Another Programming Language Books

Download

Tuesday, October 4, 2011

Delphi for .NET Developer’s Guide






Contents at a Glance
Introduction . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Part I Introduction to the .NET Framework
1 Introduction to .NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Overview of the .NET Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Part II Delphi for .NET Programming Language
3 Introduction to Delphi for .NET and the New IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4 Programs, Units, and Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5 The Delphi Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Part III The .NET Framework Class Library Development
6 Assemblies—Libraries and Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
7 GDI+ Programming—Drawing in .NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
8 Mono—A Cross Platform .NET Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
9 Memory Management and Garbage Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
10 Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
11 Working with the String and StringBuilder Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
12 File and Streaming Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
13 Developing Custom WinForms Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
14 Threading in Delphi for .NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
15 Reflection API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
16 Interoperability—COM Interop and the Platform Invocation Service. . . . . . . . . . . . . . . . 356
Part IV Database Development with ADO.NET
17 Overview of ADO.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
18 Using the Connection Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
19 Using Command and DataReader Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
20 DataAdapters and DataSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
21 Working with WinForms—DataViews and Data Binding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
22 Saving Data to the Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
23 Working with Transactions and Strongly-Typed Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
24 The Borland Data Provider. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Part V Internet Development with ASP.NET
25 ASP.NET Fundamentals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
26 Building ASP.NET Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
27 Building Database Driven ASP.NET Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
28 Building Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
29 .NET Remoting and Delphi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
30 .NET Remoting in Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
31 Securing ASP.NET Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
32 ASP.NET Deployment and Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
33 Caching and Managing State in ASP.NET Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
34 Developing Custom ASP.NET Server Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791

Another Delphi Books

Another .NET Books
Download

Saturday, October 1, 2011

Nitty Gritty Delphi 6






Preface xi
Acknowledgments xiii
Part I – Start up! 1
1 Before you get started … 3
1.1 What is Delphi? 3
1.2 Delphi is object-oriented 4
1.3 Delphi is event-oriented 5
1.4 Delphi’s development environment 5
1.4.1 Main window 6
1.4.2 Object Inspector 7
1.4.3 Object Treeview 8
1.4.4 Code Editor 8
1.4.5 Code Explorer 8
1.5 Options in Delphi 9
1.5.1 Environment Options 9
1.5.2 Editor Properties 11
1.5.3 Project Options 12
1.6 Programming help 15
1.6.1 Code completion 15
1.6.2 Code parameters 16
1.6.3 Evaluation via tooltips 17
1.6.4 Code templates 17
1.6.5 Class completion 17
1.6.6 Hyperlinks in source code 17
1.6.7 To-Do List 17
1.7 New in Delphi 6 18
1.7.1 Object Inspector 18
1.7.2 Code Editor 19
1.7.3 Object Treeview 19
1.7.4 Subcomponents 20
1.7.5 New components 20
1.8 Choosing a version 21
2 Hello World … ? 23
2.1 Creating the interface 23
2.2 Adding the base functionality 24
2.2.1 Closing the program 24
2.2.2 Configuring the result field 24
2.2.3 Tab sequence 25
2.2.4 Text in the input fields 25
2.3 Adding the main function 25
2.4 Preventing incorrect input 28
Part II – Take that! 31
3 Object Pascal 33
3.1 Basic language components 33
3.1.1 Symbols and separators 33
3.1.2 Reserved words and directives 33
3.1.3 Variables and constants 35
3.1.4 Data types 37
3.1.5 Arrays 38
3.1.6 Sets 42
3.1.7 Records 42
3.1.8 Pointers 44
3.1.9 Objects and classes 46
3.2 Loops 50
3.2.1 The forloop 50
3.2.2 The whileloop 51
3.2.3 The repeatloop 52
3.3 Branches 52
3.3.1 If–then–else branching 52
3.3.2 Case branching 53
3.3.3 Procedures and functions 54
3.3.4 Passing parameters 55
3.3.5 Overloading procedures and functions 56
3.4 Units 57
3.4.1 Structure of a unit 57
3.4.2 Mutual visibility of units 58
3.4.3 Units in Delphi 59
4 Delphi’s base elements 61
4.1 Visual components library 61
4.1.1 Common properties 61
4.1.2 Component Palette Standard page 64
4.1.3 Component Palette Additional page 68
4.1.4 Component Palette Win32 page 73
4.1.5 Component Palette System page 79
4.1.6 Component Palette BDE page 81
4.1.7 Component Palette Data Controls page 84
4.1.8 Component Palette dbExpress page 87
4.1.9 Component Palette Internet page 89
4.1.10 Component Palette FastNet page 92
4.1.11 Component Palette Dialogs page 94
4.1.12 Component Palette Samples page 102
4.2 Base classes of a program 103
4.2.1 TApplicationclass 103
4.2.2 TScreenclass 104
4.2.3 TPrinterclass 106
5 Basic elements of an application 109
5.1 Forms 109
5.1.1 Main form of the application 109
5.1.2 Displaying forms 109
5.1.3 Creating forms at runtime 111
5.1.4 Evaluating form contents 111
5.1.5 Transparent forms 113
5.2 Menus 114
5.2.1 Menu Designer 114
5.2.2 Menu templates 116
5.2.3 Important properties 116
5.3 Toolbars 116
5.3.1 TToolbarproperties 116
5.3.2 TToolbuttonproperties 116
5.3.3 Grouping buttons 116
5.4 Status bar 118
5.4.1 Splitting the status bar 119
5.4.2 Modifying panels at runtime 119
5.4.3 Filling the status bar with text 120
5.5 TActionListcomponent 121
5.5.1 ActionList Editor 121
5.5.2 TActionproperties 122
5.5.3 Defining the functionality of actions 122
5.5.4 Adding images 123
5.6 TImageListcomponent 123
5.6.1 ImageList Editor 124
5.6.2 TImageListproperties 124
5.7 Action Manager 125
5.7.1 Adding actions 126
5.7.2 Using actions 126
5.7.3 Modifying actions 127
5.7.4 Mimicking Office 2000 128
6 Functions and procedures 131
6.1 Dialog and message windows 131
6.1.1 ShowMessage 131
6.1.2 InputBox 132
6.1.3 InputQuery 132
6.1.4 MessageDlg 132
6.1.5 Application.Messageboxand Messagebox 134
6.1.6 SelectDirectory 136
6.2 Arithmetical functions 137
6.3 Files and folders 139
6.4 Type conversions 144
6.5 Date and time 146
6.6 Other functions and procedures 148
Part III – Go ahead! 151
7 Program development techniques 153
7.1 String lists 153
7.1.1 List components 153
7.1.2 TStringListclass 155
7.2 Working with one-line strings 156
7.2.1 String formats in Delphi 156
7.2.2 String functions 157
7.3 Working with multiline text 160
7.3.1 TMemo component 160
7.3.2 TRichEditcomponent 162
7.4 Forms and components 166
7.4.1 Finding components 166
7.4.2 Senderparameter 167
7.4.3 Generating components dynamically 167
7.5 Frames 169
7.5.1 Creating a frame 169
7.5.2 Properties and events 169
7.5.3 Example of a frame 170
7.5.4 Accessing a frame’s components 172
7.6 Checking entries 173
7.6.1 Input field restrictions 173
7.6.2 Predefined input masks 174
7.6.3 Global hotkeys query 176
7.7 Working with files 177
7.7.1 Typed files 177
7.7.2 Non-typed (text) files 178
7.7.3 Streams 179
7.8 Registry 184
7.8.1 Structure of the Registry database 184
7.8.2 TRegistryclass 184
7.9 Threads 186
7.9.1 Synchronizemethod 186
7.9.2 Declaring a thread 187
7.9.3 Initializing a thread 188
7.10 Dynamic link libraries 189
7.10.1 Structure of a dynamic link library in Delphi 189
7.10.2 Integrating a dynamic link library 191
7.11 Linking and embedding objects 194
7.11.1 TOleContainercomponent 194
7.11.2 Using TOleContainer 196
7.12 Dynamic data exchange 201
7.12.1 Dynamic data exchange components 202
7.12.2 Example dynamic data exchange project 203
7.13 Drag and drop 207
7.13.1 Drag and drop events 208
7.13.2 Example project 209
8 Delphi and databases 211
8.1 Back to basics 211
8.1.1 Structure of a database 211
8.1.2 BDE database components 212
8.1.3 ADO components 214
8.1.4 dbExpress components 215
8.1.5 Data module 216
8.2 Creating a database with BDE 216
8.2.1 Planning the database 216
8.2.2 Creating the database 218
8.2.3 Creating the interface 224
8.2.4 Programming the functionality 226
8.3 Master/detail databases 234
8.3.1 Specifying the master database 234
8.3.2 Creating a master database 235
8.3.3 Linking databases 237
8.3.4 Modifying the program interface 238
8.3.5 Extending the functionality 239
8.4 Other BDE functions 241
8.4.1 Splitting a database 241
8.4.2 Defining the start and end 241
8.4.3 Bookmarks 242
8.5 Database interface 242
8.5.1 Structure information 242
8.5.2 Restructuring the database 243
8.5.3 Defining aliases 245
8.6 ADO 246
8.6.1 Example ADO project 246
9 Delphi and the internet 251
9.1 TWebBrowsercomponent 251
9.2 NetMasters components 252
9.2.1 Common properties 252
9.2.2 TNmFTPcomponent 252
9.2.3 TNmNNTPcomponent 254
9.2.4 TNmPop3component 256
9.2.5 TNmSMTPcomponent 258
9.3 Your own browser 259
9.3.1 Program interface 259
9.3.2 Programming the functionality 260
9.4 Creating a cgi counter with Delphi 264
9.4.1 Basic requirements 264
9.4.2 OnActionevent 265
10 Developing components 271
10.1 Back to basics 271
10.2 Conventions 272
10.3 Structure of a component class 273
10.4 Properties 275
10.4.1 Property variables and properties 275
10.4.2 Accessing a property 276
10.4.3 Publishing properties 276
10.4.4 Loading and saving property values 277
10.5 Windows messages 278
10.5.1 Basic principles of messages 278
10.5.2 Defining message-handling routines 279
10.5.3 Declaring your own messages 279
10.6 Events 280
10.6.1 Declaring events 280
10.6.2 Intercepting messages 281
10.6.3 Publishing events 282
10.7 Methods 283
10.7.1 Published methods 283
10.7.2 Constructors and destructors 283
10.8 Property editors 284
10.8.1 Programming a property editor 284
10.8.2 Registering a property editor 286
10.9 Numerical components 286
10.9.1 Framework for the new component 286
10.9.2 Features of the new component 287
10.9.3 Component properties 287
10.9.4 Access methods for IntValue 288
10.9.5 Restricting the input field 290
10.9.6 Finished framework 291
10.9.7 Installing the component 293
11 Error-handling and debugging 295
11.1 Exceptions 295
11.1.1 What is an exception? 295
11.1.2 Protecting source code 295
11.1.3 Exception-handling 298
11.1.4 Silent exceptions 300
11.2 Debugging 300
11.2.1 Breakpoints 301
11.2.2 Evaluating variables 303
11.2.3 Watched expressions 304
11.2.4 CPU window 304
Appendix
A ASCII table 307
B Virtual key codes 309
Index 313

Another Delphi Books
Another Programming Language
Download

Sunday, September 18, 2011

Delphi developer’s guide to XML







Contents
Dedication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Part I: Introduction to XML
Chapter 1: History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
XML vs. HTML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Related Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Extensible Hypertext Markup Language (XHTML) . . . . . . . . . . . . . . 6
Mathematical Markup Language (MathML) . . . . . . . . . . . . . . . . . . 8
Scalable Vector Graphics (SVG) . . . . . . . . . . . . . . . . . . . . . . . 10
Synchronized Multimedia Integration Language (SMIL) . . . . . . . . . . 13
Resource Description Framework (RDF) . . . . . . . . . . . . . . . . . . . 15
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Sample XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Chapter 2: XML Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Elements and Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Name Tokens and Namespaces . . . . . . . . . . . . . . . . . . . . . . . . 24
Text and White Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Processing Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
CDATA Sections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Prolog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Encoding Schemes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
XML Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Chapter 3: Document Type Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 33
DTD Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Content Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Notations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
iiiChapter 4: Extensible Stylesheet Language Transformations . . . . . . . . . . . . . . 42
Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Templates and Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Text Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Building Document Structure . . . . . . . . . . . . . . . . . . . . . . . . . 45
Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Conditional Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
XSLT Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Chapter 5: XLink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Link Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Simple Links. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Extended Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Out-of-Line Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Chapter 6: XPath and XPointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
General Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Predicates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Locations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Abbreviated Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Chapter 7: XML Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Schema Document. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Simple Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Complex Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Attribute Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Element Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Further Abilities of Schemas . . . . . . . . . . . . . . . . . . . . . . . . . 73
Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Part II: The Document Object Model
Chapter 8: The Document Object Model (DOM) . . . . . . . . . . . . . . . . . . . . 77
DOM Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
DOMException . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Node Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
NodeList Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
NamedNodeMap Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Element Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Attr Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
CharacterData Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Text Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
CDATASection Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Comment Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
ProcessingInstruction Interface . . . . . . . . . . . . . . . . . . . . . . . . 94
DocumentType Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Entity Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
EntityReference Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Notation Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
DocumentFragment Interface . . . . . . . . . . . . . . . . . . . . . . . . . 98
Document Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
DOMImplementation Interface . . . . . . . . . . . . . . . . . . . . . . . 101
NodeFilter Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
NodeIterator Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
TreeWalker Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
DocumentTraversal Interface . . . . . . . . . . . . . . . . . . . . . . . . 106
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Chapter 9: Microsoft’s Document Object Model . . . . . . . . . . . . . . . . . . . . 108
IXMLDOMParseError Interface . . . . . . . . . . . . . . . . . . . . . . . 110
IXMLDOMNode Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 111
IXMLDOMNodeList Interface. . . . . . . . . . . . . . . . . . . . . . . . 119
IXMLDOMNamedNodeMap Interface . . . . . . . . . . . . . . . . . . . 120
IXMLDOMElement Interface . . . . . . . . . . . . . . . . . . . . . . . . 122
IXMLDOMAttribute Interface. . . . . . . . . . . . . . . . . . . . . . . . 124
IXMLDOMCharacterData Interface . . . . . . . . . . . . . . . . . . . . . 125
IXMLDOMText Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 127
IXMLDOMCDATASection Interface . . . . . . . . . . . . . . . . . . . . 127
IXMLDOMComment Interface . . . . . . . . . . . . . . . . . . . . . . . 128
IXMLDOMProcessingInstruction Interface . . . . . . . . . . . . . . . . . 128
IXMLDOMDocumentType Interface . . . . . . . . . . . . . . . . . . . . 129
IXMLDOMEntity Interface . . . . . . . . . . . . . . . . . . . . . . . . . 130
IXMLDOMEntityReference Interface . . . . . . . . . . . . . . . . . . . . 131
IXMLDOMNotation Interface . . . . . . . . . . . . . . . . . . . . . . . . 132
IXMLDOMDocumentFragment Interface . . . . . . . . . . . . . . . . . . 132
IXMLDOMDocument Interface . . . . . . . . . . . . . . . . . . . . . . . 133
IXMLDOMDocument2 Interface . . . . . . . . . . . . . . . . . . . . . . 139
IXMLDOMSchemaCollection Interface. . . . . . . . . . . . . . . . . . . 140
IXMLDOMSelection Interface . . . . . . . . . . . . . . . . . . . . . . . 141
IXMLDOMImplementation Interface . . . . . . . . . . . . . . . . . . . . 143
Document Traversal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
IXSLTemplate Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
IXSLProcessor Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Loading the DOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Contents
vThe MS DOM XML Viewer . . . . . . . . . . . . . . . . . . . . . . . . . 149
Viewing Node Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Threading the DOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Chapter 10: CUESoft’s Document Object Model . . . . . . . . . . . . . . . . . . . . 157
TDOMException Exception . . . . . . . . . . . . . . . . . . . . . . . . . 158
TXmlParserError Exception . . . . . . . . . . . . . . . . . . . . . . . . . 159
TXmlNode Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
TXmlNodeList Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
TXmlNamedNodeMap Class . . . . . . . . . . . . . . . . . . . . . . . . 167
TXmlElement Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
TXmlAttribute Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
TXmlCharacterData Class . . . . . . . . . . . . . . . . . . . . . . . . . . 172
TXmlText Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
TXmlCDataSection Class . . . . . . . . . . . . . . . . . . . . . . . . . . 174
TXmlComment Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
TXmlProcessingInstruction Class . . . . . . . . . . . . . . . . . . . . . . 175
TXmlDocumentType Class . . . . . . . . . . . . . . . . . . . . . . . . . 175
TXmlEntity Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
TXmlEntityReference Class . . . . . . . . . . . . . . . . . . . . . . . . . 177
TXmlNotation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
TXmlDocumentFragment Class . . . . . . . . . . . . . . . . . . . . . . . 178
TXmlDocument Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
TXmlDomImplementation Class . . . . . . . . . . . . . . . . . . . . . . 181
TXmlObjModel Component . . . . . . . . . . . . . . . . . . . . . . . . . 182
TXmlParser Component . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Loading the CUESoft DOM . . . . . . . . . . . . . . . . . . . . . . . . . 189
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Chapter 11: Open XML’s Document Object Model . . . . . . . . . . . . . . . . . . . 195
EDomException Exception . . . . . . . . . . . . . . . . . . . . . . . . . 195
TdomNode Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
TdomNodeList Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
TdomNamedNodeMap Class . . . . . . . . . . . . . . . . . . . . . . . . 206
TdomElement Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
TdomAttr Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
TdomCharacterData Class . . . . . . . . . . . . . . . . . . . . . . . . . . 213
TdomText Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
TdomCDATASection Class . . . . . . . . . . . . . . . . . . . . . . . . . 215
TdomComment Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
TdomProcessingInstruction Class . . . . . . . . . . . . . . . . . . . . . . 216
TdomDocumentType Class . . . . . . . . . . . . . . . . . . . . . . . . . 216
TdomInternalSubset Class . . . . . . . . . . . . . . . . . . . . . . . . . . 219
TdomExternalSubset Class. . . . . . . . . . . . . . . . . . . . . . . . . . 219
Contents
viTdomConditionalSection Class . . . . . . . . . . . . . . . . . . . . . . . 220
TdomEntity Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
TdomEntityDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . . 223
TdomEntityReference Class . . . . . . . . . . . . . . . . . . . . . . . . . 224
TdomNotation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
TdomNotationDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . 226
TdomElementTypeDeclaration Class . . . . . . . . . . . . . . . . . . . . 227
Content Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
TdomAttrList Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
TdomAttrDefinition Class . . . . . . . . . . . . . . . . . . . . . . . . . . 231
TdomNametoken Class . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
TdomXmlDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . . . 233
TdomTextDeclaration Class . . . . . . . . . . . . . . . . . . . . . . . . . 234
TdomDocumentFragment Class . . . . . . . . . . . . . . . . . . . . . . . 234
TdomDocument Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
TdomImplementation Class . . . . . . . . . . . . . . . . . . . . . . . . . 244
TdomNodeFilter Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
TdomNodeIterator Class . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
TdomTreeWalker Class . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
TXmlToDomParser Class . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Helper Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Viewing with the Open XML DOM . . . . . . . . . . . . . . . . . . . . . 261
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Part III: Simple API for XML
Chapter 12: Simple API for XML (SAX). . . . . . . . . . . . . . . . . . . . . . . . . 271
Working with SAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
SAX Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
SAXException Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
SAXParseException Class . . . . . . . . . . . . . . . . . . . . . . . . . . 276
InputSource Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Locator Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Attributes Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
ContentHandler Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 282
DTDHandler Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
EntityResolver Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
ErrorHandler Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
SAX Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
LexicalHandler Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
DeclHandler Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
XMLReader Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
XMLFilter Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
ParserAdapter and XMLReaderAdapter Classes . . . . . . . . . . . . . . 292
XMLReaderFactory Class . . . . . . . . . . . . . . . . . . . . . . . . . . 293
DefaultHandler Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Chapter 13: Microsoft’s SAX Parser . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
IVBSAXLocator Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 295
IVBSAXAttributes Interface. . . . . . . . . . . . . . . . . . . . . . . . . 296
IVBSAXContentHandler Interface . . . . . . . . . . . . . . . . . . . . . 298
IVBSAXDTDHandler Interface . . . . . . . . . . . . . . . . . . . . . . . 301
IVBSAXEntityResolver Interface . . . . . . . . . . . . . . . . . . . . . . 302
IVBSAXErrorHandler Interface . . . . . . . . . . . . . . . . . . . . . . . 302
IVBSAXLexicalHandler Interface . . . . . . . . . . . . . . . . . . . . . . 303
IVBSAXDeclHandler Interface . . . . . . . . . . . . . . . . . . . . . . . 305
IVBSAXXMLReader Interface . . . . . . . . . . . . . . . . . . . . . . . 306
IVBSAXXMLFilter Interface . . . . . . . . . . . . . . . . . . . . . . . . 309
Preparing for SAX Events . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Responding to the Notifications . . . . . . . . . . . . . . . . . . . . . . . 314
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Chapter 14: SAX in Delphi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Conversion to Delphi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
ESAXException Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
ESAXParseException Class . . . . . . . . . . . . . . . . . . . . . . . . . 320
TSAXInputSource Class . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
ISAXLocator Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
ISAXAttributes Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . 323
ISAXContentHandler Interface . . . . . . . . . . . . . . . . . . . . . . . 326
ISAXDTDHandler Interface . . . . . . . . . . . . . . . . . . . . . . . . . 328
ISAXEntityResolver Interface . . . . . . . . . . . . . . . . . . . . . . . . 329
ISAXErrorHandler Interface . . . . . . . . . . . . . . . . . . . . . . . . . 330
SAX Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
ISAXLexicalHandler Interface. . . . . . . . . . . . . . . . . . . . . . . . 331
ISAXDeclHandler Interface . . . . . . . . . . . . . . . . . . . . . . . . . 333
ISAXXMLReader Interface . . . . . . . . . . . . . . . . . . . . . . . . . 334
ISAXXMLFilter Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 336
TSAXParserAdapter and TSAXXMLReaderAdapter Classes . . . . . . . 336
TSAXXMLReaderFactory Class . . . . . . . . . . . . . . . . . . . . . . 338
TSAXDefaultHandler Class . . . . . . . . . . . . . . . . . . . . . . . . . 340
Building a SAX Reader . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
The SAX XML Viewer. . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Implementing ISAXContentHandler. . . . . . . . . . . . . . . . . . . . . 349
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Contents
viiiChapter 15: Wrapping External Parsers. . . . . . . . . . . . . . . . . . . . . . . . . . 354
Adapting Microsoft’s SAX Parser . . . . . . . . . . . . . . . . . . . . . . 354
Using CUESoft’s Parser . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Using Open XML’s Parser . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Part IV: Serving XML
Chapter 16: XML is Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Movie-watcher Database . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Chapter 17: Simple Text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
From a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Chapter 18: Web Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
TRecordPageProducer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Chapter 19: Document Object Model. . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Microsoft’s DOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
CUESoft’s DOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Open XML’s DOM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Chapter 20: SAX Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
IMXWriter Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
IMXAttributes Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Creating a Writer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Defining the DTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Adding Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Chapter 21: Applying XSL Transformations . . . . . . . . . . . . . . . . . . . . . . . 407
XSLT Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
Transforming the Document . . . . . . . . . . . . . . . . . . . . . . . . . 410
Monolithic HTML Transformation . . . . . . . . . . . . . . . . . . . . . 411
Template-Based HTML Transformation. . . . . . . . . . . . . . . . . . . 413
Comma-Separated Transformation . . . . . . . . . . . . . . . . . . . . . 416
Rich Text Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Chapter 22: XML Broker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
The Data Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
InternetExpress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
The CGI Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . 426
Using ISAPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
XML Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434

Part V: Sample Applications
Chapter 23: Mass Electronic Mail-Outs . . . . . . . . . . . . . . . . . . . . . . . . . 437
Loading the Configuration Properties . . . . . . . . . . . . . . . . . . . . 438
Mail Message Template . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Database Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
Drop It in the Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Logging and Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
All Together Now . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
Chapter 24: A Customized Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
The Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
Information Hiding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
Parsing the XML Documents . . . . . . . . . . . . . . . . . . . . . . . . 453
Constructing Model Objects . . . . . . . . . . . . . . . . . . . . . . . . . 455
Accumulating Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Saving Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Client Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Through the Browser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
Chapter 25: Examination XML — Delphi Client . . . . . . . . . . . . . . . . . . . . 464
Loading an Exam. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
User Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
Exam Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Chapter 26: Examination XML — Web Client . . . . . . . . . . . . . . . . . . . . . . 478
Exam Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Scripting in Transformations. . . . . . . . . . . . . . . . . . . . . . . . . 483
Web Application Initialization . . . . . . . . . . . . . . . . . . . . . . . . 486
Applying the Transformations . . . . . . . . . . . . . . . . . . . . . . . . 488
Finishing Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Chapter 27: Simple Object Access Protocol . . . . . . . . . . . . . . . . . . . . . . . 495
SOAP Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Processing SOAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
SOAP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
SOAP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517


Another Delphi Books
Another XML Books
Download

Friday, September 16, 2011

The Tomes of Delphi Algorithms and Data Structures






Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
Chapter 1 What is an Algorithm? . . . . . . . . . . . . . . . . . . . . . . . . 1
What is an Algorithm? . . . . . . . . . . . . . . . . . . . . . . . . . 1
Analysis of Algorithms . . . . . . . . . . . . . . . . . . . . . . . . 3
The Big-Oh Notation . . . . . . . . . . . . . . . . . . . . . . . . . 6
Best, Average, and Worst Cases . . . . . . . . . . . . . . . . . 8
Algorithms and the Platform . . . . . . . . . . . . . . . . . . . . . . 8
Virtual Memory and Paging . . . . . . . . . . . . . . . . . . . . . 9
Thrashing . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Locality of Reference . . . . . . . . . . . . . . . . . . . . . 11
The CPU Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Data Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Space Versus Time Tradeoffs . . . . . . . . . . . . . . . . . . . . 14
Long Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Use const . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Be Wary of Automatic Conversions . . . . . . . . . . . . . . . . . 17
Debugging and Testing . . . . . . . . . . . . . . . . . . . . . . . . 18
Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Tracing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Coverage Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 23
Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Chapter 2 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Array Types in Delphi . . . . . . . . . . . . . . . . . . . . . . . . . 28
Standard Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Dynamic Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
New-style Dynamic Arrays . . . . . . . . . . . . . . . . . . . . . 40
TList Class, an Array of Pointers. . . . . . . . . . . . . . . . . . . . 41
Overview of the TList Class. . . . . . . . . . . . . . . . . . . . . 41
TtdObjectList Class . . . . . . . . . . . . . . . . . . . . . . . . . 43
vArrays on Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Chapter 3 Linked Lists, Stacks, and Queues . . . . . . . . . . . . . . . . . 63
Singly Linked Lists. . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Linked List Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Creating a Singly Linked List . . . . . . . . . . . . . . . . . . . . 65
Inserting into and Deleting from a Singly Linked List . . . . . . . 65
Traversing a Linked List . . . . . . . . . . . . . . . . . . . . . . 68
Efficiency Considerations . . . . . . . . . . . . . . . . . . . . . . 69
Using a Head Node . . . . . . . . . . . . . . . . . . . . . . 69
Using a Node Manager . . . . . . . . . . . . . . . . . . . . 70
The Singly Linked List Class . . . . . . . . . . . . . . . . . . . . 76
Doubly Linked Lists . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Inserting and Deleting from a Doubly Linked List . . . . . . . . . 85
Efficiency Considerations . . . . . . . . . . . . . . . . . . . . . . 88
Using Head and Tail Nodes . . . . . . . . . . . . . . . . . . 88
Using a Node Manager . . . . . . . . . . . . . . . . . . . . 88
The Doubly Linked List Class . . . . . . . . . . . . . . . . . . . . 88
Benefits and Drawbacks of Linked Lists . . . . . . . . . . . . . . . . 96
Stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Stacks Using Linked Lists . . . . . . . . . . . . . . . . . . . . . . 97
Stacks Using Arrays . . . . . . . . . . . . . . . . . . . . . . . . 100
Example of Using a Stack . . . . . . . . . . . . . . . . . . . . . 103
Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Queues Using Linked Lists . . . . . . . . . . . . . . . . . . . . 106
Queues Using Arrays . . . . . . . . . . . . . . . . . . . . . . . 109
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Chapter 4 Searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Compare Routines . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Sequential Search . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Linked Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Binary Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Linked Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Inserting into Sorted Containers . . . . . . . . . . . . . . . . . 129
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Chapter 5 Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Sorting Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Shuffling a TList . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Sort Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Slowest Sorts . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Bubble Sort. . . . . . . . . . . . . . . . . . . . . . . . . . 138
vi
ContentsShaker Sort. . . . . . . . . . . . . . . . . . . . . . . . . . 140
Selection Sort . . . . . . . . . . . . . . . . . . . . . . . . 142
Insertion Sort. . . . . . . . . . . . . . . . . . . . . . . . . 144
Fast Sorts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Shell Sort. . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Comb Sort . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Fastest Sorts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Merge Sort . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Quicksort . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Merge Sort with Linked Lists . . . . . . . . . . . . . . . . . . . 176
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Chapter 6 Randomized Algorithms . . . . . . . . . . . . . . . . . . . . . 183
Random Number Generation . . . . . . . . . . . . . . . . . . . . 184
Chi-Squared Tests . . . . . . . . . . . . . . . . . . . . . . . . . 185
Middle-Square Method . . . . . . . . . . . . . . . . . . . . . . 188
Linear Congruential Method . . . . . . . . . . . . . . . . . . . 189
Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
The Uniformity Test . . . . . . . . . . . . . . . . . . . . . 195
The Gap Test . . . . . . . . . . . . . . . . . . . . . . . . . 195
The Poker Test . . . . . . . . . . . . . . . . . . . . . . . . 197
The Coupon Collector’s Test . . . . . . . . . . . . . . . . . 198
Results of Applying Tests . . . . . . . . . . . . . . . . . . . . . 200
Combining Generators . . . . . . . . . . . . . . . . . . . . 201
Additive Generators . . . . . . . . . . . . . . . . . . . . . 203
Shuffling Generators . . . . . . . . . . . . . . . . . . . . . 205
Summary of Generator Algorithms . . . . . . . . . . . . . . . . 207
Other Random Number Distributions . . . . . . . . . . . . . . . . 208
Skip Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Searching through a Skip List . . . . . . . . . . . . . . . . . . . 211
Insertion into a Skip List . . . . . . . . . . . . . . . . . . . . . 215
Deletion from a Skip List . . . . . . . . . . . . . . . . . . . . . 218
Full Skip List Class Implementation. . . . . . . . . . . . . . . . 219
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Chapter 7 Hashing and Hash Tables . . . . . . . . . . . . . . . . . . . . . 227
Hash Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Simple Hash Function for Strings . . . . . . . . . . . . . . . . . 230
The PJW Hash Functions . . . . . . . . . . . . . . . . . . . . . 230
Collision Resolution with Linear Probing . . . . . . . . . . . . . . 232
Advantages and Disadvantages of Linear Probing . . . . . . . . 233
Deleting Items from a Linear Probe Hash Table . . . . . . . . . 235
The Linear Probe Hash Table Class . . . . . . . . . . . . . . . . 237
Other Open-Addressing Schemes . . . . . . . . . . . . . . . . . . 245
Quadratic Probing . . . . . . . . . . . . . . . . . . . . . . . . . 246

Pseudorandom Probing . . . . . . . . . . . . . . . . . . . . . . 246
Double Hashing . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Collision Resolution through Chaining . . . . . . . . . . . . . . . 247
Advantages and Disadvantages of Chaining . . . . . . . . . . . 248
The Chained Hash Table Class . . . . . . . . . . . . . . . . . . 249
Collision Resolution through Bucketing . . . . . . . . . . . . . . . 259
Hash Tables on Disk . . . . . . . . . . . . . . . . . . . . . . . . . 260
Extendible Hashing . . . . . . . . . . . . . . . . . . . . . . . . 261
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Chapter 8 Binary Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Creating a Binary Tree . . . . . . . . . . . . . . . . . . . . . . . . 279
Insertion and Deletion with a Binary Tree . . . . . . . . . . . . . . 279
Navigating through a Binary Tree . . . . . . . . . . . . . . . . . . 281
Pre-order, In-order, and Post-order Traversals . . . . . . . . . . 282
Level-order Traversals . . . . . . . . . . . . . . . . . . . . . . . 288
Class Implementation of a Binary Tree . . . . . . . . . . . . . . . 289
Binary Search Trees . . . . . . . . . . . . . . . . . . . . . . . . . 295
Insertion with a Binary Search Tree. . . . . . . . . . . . . . . . 298
Deletion from a Binary Search Tree . . . . . . . . . . . . . . . . 300
Class Implementation of a Binary Search Tree . . . . . . . . . . 303
Binary Search Tree Rearrangements . . . . . . . . . . . . . . . 304
Splay Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Class Implementation of a Splay Tree. . . . . . . . . . . . . . . 309
Red-Black Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Insertion into a Red-Black Tree . . . . . . . . . . . . . . . . . . 314
Deletion from a Red-Black Tree . . . . . . . . . . . . . . . . . . 319
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Chapter 9 Priority Queues and Heapsort . . . . . . . . . . . . . . . . . . 331
The Priority Queue . . . . . . . . . . . . . . . . . . . . . . . . . . 331
First Simple Implementation . . . . . . . . . . . . . . . . . . . 332
Second Simple Implementation . . . . . . . . . . . . . . . . . . 335
The Heap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Insertion into a Heap . . . . . . . . . . . . . . . . . . . . . . . 338
Deletion from a Heap . . . . . . . . . . . . . . . . . . . . . . . 338
Implementation of a Priority Queue with a Heap. . . . . . . . . 340
Heapsort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Floyd’s Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 345
Completing Heapsort . . . . . . . . . . . . . . . . . . . . . . . 346
Extending the Priority Queue . . . . . . . . . . . . . . . . . . . . 348
Re-establishing the Heap Property . . . . . . . . . . . . . . . . 349
Finding an Arbitrary Item in the Heap . . . . . . . . . . . . . . 350
Implementation of the Extended Priority Queue . . . . . . . . . 350
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Chapter 10 State Machines and Regular Expressions . . . . . . . . . . . . 357
State Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Using State Machines: Parsing . . . . . . . . . . . . . . . . . . 357
Parsing Comma-Delimited Files . . . . . . . . . . . . . . . 363
Deterministic and Non-deterministic State Machines. . . . . . . 366
Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 378
Using Regular Expressions . . . . . . . . . . . . . . . . . . . . 380
Parsing Regular Expressions . . . . . . . . . . . . . . . . . 380
Compiling Regular Expressions . . . . . . . . . . . . . . . 387
Matching Strings to Regular Expressions. . . . . . . . . . . 399
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Chapter 11 Data Compression . . . . . . . . . . . . . . . . . . . . . . . . 409
Representations of Data . . . . . . . . . . . . . . . . . . . . . . . 409
Data Compression . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Types of Compression . . . . . . . . . . . . . . . . . . . . . . . 410
Bit Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Minimum Redundancy Compression. . . . . . . . . . . . . . . . . 415
Shannon-Fano Encoding . . . . . . . . . . . . . . . . . . . . . 416
Huffman Encoding . . . . . . . . . . . . . . . . . . . . . . . . 421
Splay Tree Encoding. . . . . . . . . . . . . . . . . . . . . . . . 435
Dictionary Compression . . . . . . . . . . . . . . . . . . . . . . . 445
LZ77 Compression Description . . . . . . . . . . . . . . . . . . 445
Encoding Literals Versus Distance/Length Pairs . . . . . . . 448
LZ77 Decompression . . . . . . . . . . . . . . . . . . . . . 449
LZ77 Compression . . . . . . . . . . . . . . . . . . . . . . 456
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
Chapter 12 Advanced Topics. . . . . . . . . . . . . . . . . . . . . . . . . . 469
Readers-Writers Algorithm . . . . . . . . . . . . . . . . . . . . . . 469
Producers-Consumers Algorithm. . . . . . . . . . . . . . . . . . . 478
Single Producer, Single Consumer Model . . . . . . . . . . . . . 478
Single Producer, Multiple Consumer Model. . . . . . . . . . . . 486
Finding Differences between Two Files . . . . . . . . . . . . . . . 496
Calculating the LCS of Two Strings . . . . . . . . . . . . . . . . 497
Calculating the LCS of Two Text Files. . . . . . . . . . . . . . . 511
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Epilogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518


Another Delphi Books
Another The Core of CS Books
Download
Related Posts with Thumbnails

Put Your Ads Here!