SlideShare a Scribd company logo
Internet World Wide Web How to Program 2nd Edition
Harvey M. Deitel - PDF Download (2025)
https://ebookultra.com/download/internet-world-wide-web-how-to-
program-2nd-edition-harvey-m-deitel/
Visit ebookultra.com today to download the complete set of
ebooks or textbooks
Here are some recommended products for you. Click the link to
download, or explore more at ebookultra.com
C how to program Tenth Edition Deitel
https://ebookultra.com/download/c-how-to-program-tenth-edition-deitel/
Operating Systems 3rd Edition Harvey M. Deitel
https://ebookultra.com/download/operating-systems-3rd-edition-harvey-
m-deitel/
Java How to Program Early Objects 10th ed Edition Deitel
https://ebookultra.com/download/java-how-to-program-early-
objects-10th-ed-edition-deitel/
C How to Program With an Introduction to C Global Edition
Paul Deitel
https://ebookultra.com/download/c-how-to-program-with-an-introduction-
to-c-global-edition-paul-deitel/
Visual C 2010 How to Program 4th Edition 1 29 pdf Paul
Deitel
https://ebookultra.com/download/visual-c-2010-how-to-program-4th-
edition-1-29-pdf-paul-deitel/
e Business e Commerce for Managers 1st Edition Harvey M.
Deitel
https://ebookultra.com/download/e-business-e-commerce-for-
managers-1st-edition-harvey-m-deitel/
Sh kespeare in the Media From the Globe Theatre to the
World Wide Web 2nd Edition Stefani Brusberg-Kiermeier
https://ebookultra.com/download/sh-kespeare-in-the-media-from-the-
globe-theatre-to-the-world-wide-web-2nd-edition-stefani-brusberg-
kiermeier/
Computer Theology Intelligent Design of the World Wide Web
First Edition Bertrand Du Castel
https://ebookultra.com/download/computer-theology-intelligent-design-
of-the-world-wide-web-first-edition-bertrand-du-castel/
Building an Enterprise Wide Business Continuity Program
1st Edition Kelley Okolita
https://ebookultra.com/download/building-an-enterprise-wide-business-
continuity-program-1st-edition-kelley-okolita/
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
Internet World Wide Web How to Program 2nd Edition
Harvey M. Deitel Digital Instant Download
Author(s): Harvey M. Deitel, Paul J. Deitel, T. R. Nieto
ISBN(s): 9780130308979, 0130308978
Edition: 2nd
File Details: PDF, 40.19 MB
Year: 2001
Language: english
This book is compiled in PDF format by The Admin®. Please visit my web site
www.theadmin.data.bg
Contents
Preface xlv
1 Introduction to Computers and the Internet 1
1.1 Introduction 2
1.2 What Is a Computer? 4
1.3 Types of Programming Languages 5
1.4 Other High-Level Languages 7
1.5 Structured Programming 7
1.6 History of the Internet 8
1.7 Personal Computing 9
1.8 History of the World Wide Web 10
1.9 World Wide Web Consortium (W3C) 10
1.10 Hardware Trends 11
1.11 Key Software Trend: Object Technology 12
1.12 JavaScript: Object-Based Scripting for the Web 13
1.13 Browser Portability 14
1.14 C and C++ 15
1.15 Java 16
1.16 Internet and World Wide Web How to Program 16
1.17 Dynamic HTML 18
1.18 Tour of the Book 18
1.19 Internet and World Wide Web Resources 30
2 Microsoft® Internet Explorer 5.5 35
2.1 Introduction to the Internet Explorer 5.5 Web Browser 36
2.2 Connecting to the Internet 36
2.3 Internet Explorer 5.5 Features 37
2.4 Searching the Internet 41
iw3htp2TOC.fm Page vii Monday, July 23, 2001 4:43 PM
VIII
2.5 Online Help and Tutorials 42
2.6 Keeping Track of Favorite Sites 43
2.7 File Transfer Protocol (FTP) 44
2.8 Outlook Express and Electronic Mail 46
2.9 NetMeeting 49
2.10 MSN Messenger Service 55
2.11 Customizing Browser Settings 56
3 Photoshop®
Elements 63
3.1 Introduction 64
3.2 Image Basics 64
3.3 Vector and Raster Graphics 74
3.4 Toolbox 75
3.4.1 Selection Tools 76
3.4.2 Painting Tools 80
3.4.3 Shape Tools 86
3.5 Layers 91
3.6 Screen Capturing 93
3.7 File Formats: GIF and JPEG 94
3.8 Internet and World Wide Web Resources 95
4 Introduction to XHTML: Part 1 101
4.1 Introduction 102
4.2 Editing XHTML 103
4.3 First XHTML Example 103
4.4 W3C XHTML Validation Service 106
4.5 Headers 108
4.6 Linking 109
4.7 Images 112
4.8 Special Characters and More Line Breaks 116
4.9 Unordered Lists 118
4.10 Nested and Ordered Lists 119
4.11 Internet and World Wide Web Resources 122
5 Introduction to XHTML: Part 2 127
5.1 Introduction 128
5.2 Basic XHTML Tables 128
5.3 Intermediate XHTML Tables and Formatting 131
5.4 Basic XHTML Forms 133
5.5 More Complex XHTML Forms 136
5.6 Internal Linking 143
5.7 Creating and Using Image Maps 146
5.8 meta Elements 148
5.9 frameset Element 150
5.10 Nested framesets 153
5.11 Internet and World Wide Web Resources 155
iw3htp2TOC.fm Page viii Monday, July 23, 2001 4:43 PM
IX
6 Cascading Style Sheets™ (CSS) 161
6.1 Introduction 162
6.2 Inline Styles 162
6.3 Embedded Style Sheets 163
6.4 Conflicting Styles 166
6.5 Linking External Style Sheets 169
6.6 W3C CSS Validation Service 172
6.7 Positioning Elements 173
6.8 Backgrounds 176
6.9 Element Dimensions 178
6.10 Text Flow and the Box Model 180
6.11 User Style Sheets 185
6.12 Internet and World Wide Web Resources 189
7 JavaScript: Introduction to Scripting 194
7.1 Introduction 195
7.2 Simple Program: Printing a Line of Text in a Web Page 195
7.3 Another JavaScript Program: Adding Integers 203
7.4 Memory Concepts 208
7.5 Arithmetic 209
7.6 Decision Making: Equality and Relational Operators 212
7.7 JavaScript Internet and World Wide Web Resources 219
8 JavaScript: Control Structures 1 229
8.1 Introduction 230
8.2 Algorithms 230
8.3 Pseudocode 231
8.4 Control Structures 231
8.5 if Selection Structure 234
8.6 if/else Selection Structure 235
8.7 while Repetition Structure 240
8.8 Formulating Algorithms:
Case Study 1 (Counter-Controlled Repetition) 241
8.9 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2
(Sentinel-Controlled Repetition) 245
8.10 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3
(Nested Control Structures) 251
8.11 Assignment Operators 255
8.12 Increment and Decrement Operators 256
8.13 Note on Data Types 259
8.14 JavaScript Internet and World Wide Web Resources 260
9 JavaScript: Control Structures II 271
9.1 Introduction 272
9.2 Essentials of Counter-Controlled Repetition 272
9.3 for Repetition Structure 275
9.4 Examples Using the for Structure 279
iw3htp2TOC.fm Page ix Monday, July 23, 2001 4:43 PM
X
9.5 switch Multiple-Selection Structure 284
9.6 do/while Repetition Structure 289
9.7 break and continue Statements 291
9.8 Labeled break and continue Statements 294
9.9 Logical Operators 296
9.10 Summary of Structured Programming 301
10 JavaScript: Functions 315
10.1 Introduction 316
10.2 Program Modules in JavaScript 316
10.3 Programmer-Defined Functions 318
10.4 Function Definitions 318
10.5 Random-Number Generation 324
10.6 Example: Game of Chance 329
10.7 Duration of Identifiers 337
10.8 Scope Rules 338
10.9 JavaScript Global Functions 340
10.10 Recursion 341
10.11 Example Using Recursion: Fibonacci Series 345
10.12 Recursion vs. Iteration 349
10.13 JavaScript Internet and World Wide Web Resources 351
11 JavaScript: Arrays 365
11.1 Introduction 366
11.2 Arrays 366
11.3 Declaring and Allocating Arrays 368
11.4 Examples Using Arrays 369
11.5 References and Reference Parameters 376
11.6 Passing Arrays to Functions 377
11.7 Sorting Arrays 380
11.8 Searching Arrays: Linear Search and Binary Search 382
11.9 Multiple-Subscripted Arrays 388
11.10 JavaScript Internet and World Wide Web Resources 392
12 JavaScript: Objects 402
12.1 Introduction 403
12.2 Thinking About Objects 403
12.3 Math Object 405
12.4 String Object 407
12.4.1 Fundamentals of Characters and Strings 407
12.4.2 Methods of the String Object 407
12.4.3 Character Processing Methods 409
12.4.4 Searching Methods 411
12.4.5 Splitting Strings and Obtaining Substrings 413
12.4.6 XHTML Markup Methods 415
12.5 Date Object 417
12.6 Boolean and Number Objects 423
iw3htp2TOC.fm Page x Monday, July 23, 2001 4:43 PM
XI
12.7 JavaScript Internet and World Wide Web Resources 424
13 Dynamic HTML: Object Model and Collections 435
13.1 Introduction 436
13.2 Object Referencing 436
13.3 Collections all and children 438
13.4 Dynamic Styles 441
13.5 Dynamic Positioning 444
13.6 Using the frames Collection 446
13.7 navigator Object 448
13.8 Summary of the DHTML Object Model 450
14 Dynamic HTML: Event Model 456
14.1 Introduction 457
14.2 Event onclick 457
14.3 Event onload 459
14.4 Error Handling with onerror 460
14.5 Tracking the Mouse with Event onmousemove 462
14.6 Rollovers with onmouseover and onmouseout 464
14.7 Form Processing with onfocus and onblur 468
14.8 More Form Processing with onsubmit and onreset 470
14.9 Event Bubbling 472
14.10 More DHTML Events 474
15 Dynamic HTML: Filters and Transitions 480
15.1 Introduction 481
15.2 Flip filters: flipv and fliph 482
15.3 Transparency with the chroma Filter 484
15.4 Creating Image masks 486
15.5 Miscellaneous Image filters: invert, gray and xray 487
15.6 Adding shadows to Text 489
15.7 Creating Gradients with alpha 491
15.8 Making Text glow 493
15.9 Creating Motion with blur 496
15.10 Using the wave Filter 499
15.11 Advanced Filters: dropShadow and light 501
15.12 Transitions I: Filter blendTrans 505
15.13 Transitions II: Filter revealTrans 509
16 Dynamic HTML: Data Binding with Tabular Data
Control 517
16.1 Introduction 518
16.2 Simple Data Binding 519
16.3 Moving a Recordset 523
16.4 Binding to an img 526
16.5 Binding to a table 529
16.6 Sorting table Data 530
iw3htp2TOC.fm Page xi Monday, July 23, 2001 4:43 PM
XII
16.7 Advanced Sorting and Filtering 533
16.8 Data Binding Elements 540
16.9 Internet and World Wide Web Resources 541
17 Dynamic HTML: Structured Graphics ActiveX Control 545
17.1 Introduction 546
17.2 Shape Primitives 546
17.3 Moving Shapes with Translate 550
17.4 Rotation 552
17.5 Mouse Events and External Source Files 554
17.6 Scaling 556
17.7 Internet and World Wide Web Resources 560
18 Dynamic HTML: Path, Sequencer and
Sprite ActiveX Controls 564
18.1 Introduction 565
18.2 DirectAnimation Path Control 565
18.3 Multiple Path Controls 567
18.4 Time Markers for Path Control 570
18.5 DirectAnimation Sequencer Control 573
18.6 DirectAnimation Sprite Control 576
18.7 Animated GIFs 579
18.8 Internet and World Wide Web Resources 581
19 Macromedia®
Flash™
: Building Interactive
Animations 584
19.1 Introduction 585
19.2 Flash™
Movie Development 586
19.3 Learning Flash with Hands-on Examples 589
19.3.1 Creating a Shape With the Oval Tool 590
19.3.2 Adding Text to a Button 593
19.3.3 Converting a Shape into a Symbol 594
19.3.4 Editing Button Symbols 595
19.3.5 Adding Keyframes 597
19.3.6 Adding Sound to a Button 597
19.3.7 Verifying Changes with Test Movie 600
19.3.8 Adding Layers to a Movie 600
19.3.9 Animating Text with Tweening 602
19.3.10 Adding a Text Field 604
19.3.11 Adding ActionScript 605
19.4 Creating a Projector (.exe) File With Publish 608
19.5 Manually Embedding a Flash Movie in a Web Page 609
19.6 Creating Special Effects with Flash 610
19.6.1 Importing and Manipulating Bitmaps 610
19.6.2 Create an Advertisement Banner with Masking 611
19.6.3 Adding Online Help to Forms 613
19.7 Creating a Web-Site Introduction 622
iw3htp2TOC.fm Page xii Monday, July 23, 2001 4:43 PM
XIII
19.8 ActionScript 627
19.9 Internet and World Wide Web Resources 628
20 Extensible Markup Language (XML) 633
20.1 Introduction 634
20.2 Structuring Data 635
20.3 XML Namespaces 641
20.4 Document Type Definitions (DTDs) and Schemas 643
20.4.1 Document Type Definitions 643
20.4.2 W3C XML Schema Documents 645
20.5 XML Vocabularies 648
20.5.1 MathML™ 648
20.5.2 Chemical Markup Language (CML) 652
20.5.3 Other Markup Languages 654
20.6 Document Object Model (DOM) 654
20.7 DOM Methods 655
20.8 Simple API for XML (SAX) 662
20.9 Extensible Stylesheet Language (XSL) 663
20.10 Microsoft BizTalk™ 670
20.11 Simple Object Access Protocol (SOAP) 671
20.12 Internet and World Wide Web Resources 672
21 Web Servers (IIS, PWS and Apache) 681
21.1 Introduction 682
21.2 HTTP Request Types 683
21.3 System Architecture 684
21.4 Client-Side Scripting versus Server-Side Scripting 685
21.5 Accessing Web Servers 686
21.6 Microsoft Internet Information Services (IIS) 687
21.7 Microsoft Personal Web Server (PWS) 690
21.8 Apache Web Server 692
21.9 Requesting Documents 692
21.9.1 XHTML 692
21.9.2 ASP 694
21.9.3 Perl 694
21.9.4 Python 695
21.9.5 PHP 697
21.10 Internet and World Wide Web Resources 698
22 Database: SQL, MySQL, DBI and ADO 702
22.1 Introduction 703
22.2 Relational Database Model 704
22.3 Relational Database Overview 705
22.4 Structured Query Language 709
22.4.1 Basic SELECT Query 710
22.4.2 WHERE Clause 711
22.4.3 GROUP BY Clause 713
iw3htp2TOC.fm Page xiii Monday, July 23, 2001 4:43 PM
XIV
22.4.4 ORDER BY Clause 714
22.4.5 Merging Data from Multiple Tables 715
22.4.6 Inserting a Record 718
22.4.7 Updating a Record 719
22.4.8 DELETE FROM Statement 720
22.4.9 TitleAuthor Query from Books.mdb 720
22.5 MySQL 723
22.6 Introduction to DBI 723
22.6.1 Perl Database Interface 724
22.6.2 Python DB-API 724
22.6.3 PHP dbx module 725
22.7 ActiveX Data Objects (ADO) 725
22.8 Internet and World Wide Web Resources 727
23 Wireless Internet and m-Business 734
23.1 Introduction 735
23.2 M-Business 736
23.3 Identifying User Location 736
23.3.1 E911 Act 737
23.3.2 Location-Identification Technologies 737
23.4 Wireless Marketing, Advertising and Promotions 738
23.5 Wireless Payment Options 740
23.6 Privacy and the Wireless Internet 741
23.7 International Wireless Communications 742
23.8 Wireless-Communications Technologies 743
23.9 WAP and WML 744
23.10 Phone Simulator and Setup Instructions 745
23.11 Creating WML Documents 746
23.12 WMLScript Programming 753
23.13 String Object Methods 760
23.14 Wireless Protocols, Platforms and Programming Languages 770
23.14.1 WAP 2.0 770
23.14.2 Handheld Devices Markup Languages (HDML) 771
23.14.3 Compact HTML (cHTML) and i-mode 771
23.14.4 Java and Java 2 Micro Edition (J2ME) 771
23.14.5 Binary Run-Time Environment for Wireless (BREW) 772
23.14.6 Bluetooth Wireless Technology 772
23.15 Internet and World Wide Web Resources 773
24 VBScript 783
24.1 Introduction 784
24.2 Operators 784
24.3 Data Types and Control Structures 787
24.4 VBScript Functions 791
24.5 VBScript Example Programs 795
24.6 Arrays 803
24.7 String Manipulation 807
iw3htp2TOC.fm Page xiv Monday, July 23, 2001 4:43 PM
XV
24.8 Classes and Objects 811
24.9 Operator Precedence Chart 820
24.10 Internet and World Wide Web Resources 820
25 Active Server Pages (ASP) 831
25.1 Introduction 832
25.2 How Active Server Pages Work 832
25.3 Setup 833
25.4 Active Server Page Objects 833
25.5 Simple ASP Examples 834
25.6 File System Objects 839
25.7 Session Tracking and Cookies 849
25.8 Accessing a Database from an Active Server Page 859
25.9 Server-Side ActiveX Components 870
25.10 Internet and World Wide Web Resources 878
26 Case Study: Active Server Pages and XML 884
26.1 Introduction 885
26.2 Setup and Message Forum Documents 885
26.3 Forum Navigation 886
26.4 Adding Forums 889
26.5 Forum XML Documents 894
26.6 Posting Messages 898
26.7 Other Documents 902
26.8 Internet and World Wide Web Resources 906
27 Perl and CGI (Common Gateway Interface) 908
27.1 Introduction 909
27.2 Perl 910
27.3 String Processing and Regular Expressions 916
27.4 Viewing Client/Server Environment Variables 921
27.5 Form Processing and Business Logic 924
27.6 Server-Side Includes 930
27.7 Verifying a Username and Password 934
27.8 Using DBI to Connect to a Database 939
27.9 Cookies and Perl 945
27.10 Operator Precedence Chart 950
27.11 Internet and World Wide Web Resources 950
28 Python 962
28.1 Introduction 963
28.1.1 First Python Program 963
28.1.2 Python Keywords 965
28.2 Basic Data Types, Control Structures and Functions 965
28.3 Tuples, Lists and Dictionaries 969
28.4 String Processing and Regular Expressions 974
28.5 Exception Handling 979
28.6 Introduction to CGI Programming 981
iw3htp2TOC.fm Page xv Monday, July 23, 2001 4:43 PM
XVI
28.7 Form Processing and Business Logic 983
28.8 Cookies 989
28.9 Database Application Programming Interface (DB-API) 994
28.9.1 Setup 994
28.9.2 Simple DB-API Program 994
28.10 Operator Precedence Chart 999
28.11 Internet and World Wide Web Resources 1000
29 PHP 1008
29.1 Introduction 1009
29.2 PHP 1010
29.3 String Processing and Regular Expressions 1019
29.4 Viewing Client/Server Environment Variables 1024
29.5 Form Processing and Business Logic 1026
29.6 Verifying a Username and Password 1031
29.7 Connecting to a Database 1039
29.8 Cookies 1043
29.9 Operator Precedence 1048
29.10 Internet and World Wide Web Resources 1048
30 Servlets 1056
30.1 Introduction 1057
30.2 Servlet Overview and Architecture 1059
30.2.1 Interface Servlet and the Servlet Life Cycle 1060
30.2.2 HttpServlet Class 1062
30.2.3 HttpServletRequest Interface 1063
30.2.4 HttpServletResponse Interface 1064
30.3 Handling HTTP get Requests 1064
30.3.1 Setting Up the Apache Tomcat Server 1069
30.3.2 Deploying a Web Application 1071
30.4 Handling HTTP get Requests Containing Data 1076
30.5 Handling HTTP post Requests 1079
30.6 Redirecting Requests to Other Resources 1082
30.7 Session Tracking 1086
30.7.1 Cookies 1087
30.7.2 Session Tracking with HttpSession 1095
30.8 Multi-tier Applications: Using JDBC from a Servlet 1103
30.8.1 Configuring animalsurvey Database and SurveyServlet 1109
30.9 HttpUtils Class 1111
30.10 Internet and World Wide Web Resources 1111
31 JavaServer Pages (JSP) 1119
31.1 Introduction 1120
31.2 JavaServer Pages Overview 1121
31.3 A First JavaServer Page Example 1122
31.4 Implicit Objects 1124
31.5 Scripting 1125
iw3htp2TOC.fm Page xvi Monday, July 23, 2001 4:43 PM
XVII
31.5.1 Scripting Components 1126
31.5.2 Scripting Example 1127
31.6 Standard Actions 1130
31.6.1 <jsp:include> Action 1131
31.6.2 <jsp:forward> Action 1135
31.6.3 <jsp:plugin> Action 1139
31.6.4 <jsp:useBean> Action 1143
31.7 Directives 1160
31.7.1 page Directive 1160
31.7.2 include Directive 1162
31.8 Custom Tag Libraries 1164
31.8.1 Simple Custom Tag 1165
31.8.2 Custom Tag with Attributes 1169
31.8.3 Evaluating the Body of a Custom Tag 1173
31.9 World Wide Web Resources 1179
32 e-Business & e-Commerce 1186
32.1 Introduction 1188
32.2 E-Business Models 1189
32.2.1 Storefront Model 1189
32.2.2 Shopping-Cart Technology 1190
32.2.3 Auction Model 1191
32.2.4 Portal Model 1194
32.2.5 Name-Your-Price Model 1195
32.2.6 Comparison-Pricing Model 1195
32.2.7 Demand-Sensitive Pricing Model 1195
32.2.8 Bartering Model 1195
32.3 Building an e-Business 1196
32.4 e-Marketing 1197
32.4.1 Branding 1197
32.4.2 Marketing Research 1197
32.4.3 e-Mail Marketing 1197
32.4.4 Promotions 1198
32.4.5 Consumer Tracking 1198
32.4.6 Electronic Advertising 1198
32.4.7 Search Engines 1199
32.4.8 Affiliate Programs 1199
32.4.9 Public Relations 1200
32.4.10 Customer Relationship Management (CRM) 1200
32.5 Online Payments 1201
32.5.1 Credit-Card Payment 1201
32.5.2 Digital Cash and e-Wallets 1201
32.5.3 Micropayments 1201
32.5.4 Smart Cards 1202
32.6 Security 1202
32.6.1 Public-Key Cryptography 1203
32.6.2 Secure Sockets Layer (SSL) 1205
iw3htp2TOC.fm Page xvii Monday, July 23, 2001 4:43 PM
XVIII
32.6.3 WTLS 1207
32.6.4 IPSec and Virtual Private Networks (VPN) 1207
32.6.5 Security Attacks 1208
32.6.6 Network Security 1208
32.7 Legal Issues 1209
32.7.1 Privacy 1209
32.7.2 Defamation 1209
32.7.3 Sexually Explicit Speech 1210
32.7.4 Copyright and Patents 1210
32.8 XML and e-Commerce 1211
32.9 Internet and World Wide Web Resources 1212
33 Multimedia: Audio, Video, Speech Synthesis and
Recognition 1223
33.1 Introduction 1224
33.2 Audio and Video 1225
33.3 Adding Background Sounds with the bgsound Element 1225
33.4 Adding Video with the img Element’s dynsrc Property 1228
33.5 Adding Audio or Video with the embed Element 1230
33.6 Using the Windows Media Player ActiveX Control 1232
33.7 Microsoft®
Agent Control 1236
33.8 RealPlayer™ Plug-in 1249
33.9 Synchronized Multimedia Integration Language (SMIL) 1252
33.10 Scalable Vector Graphics (SVG) 1254
33.11 Internet and World Wide Web Resources 1259
34 Accessibility 1267
34.1 Introduction 1268
34.2 Web Accessibility 1268
34.3 Web Accessibility Initiative 1269
34.4 Providing Alternatives for Images 1271
34.5 Maximizing Readability by Focusing on Structure 1272
34.6 Accessibility in XHTML Tables 1272
34.7 Accessibility in XHTML Frames 1276
34.8 Accessibility in XML 1277
34.9 Using Voice Synthesis and Recognition with VoiceXML™ 1277
34.10 CallXML™ 1284
34.11 JAWS® for Windows 1289
34.12 Other Accessibility Tools 1291
34.13 Accessibility in Microsoft® Windows® 2000 1292
34.13.1 Tools for People with Visual Impairments 1294
34.13.2 Tools for People with Hearing Impairments 1296
34.13.3 Tools for Users Who Have Difficulty Using the Keyboard 1296
34.13.4 Microsoft Narrator 1302
34.13.5 Microsoft On-Screen Keyboard 1303
34.13.6 Accessibility Features in Microsoft Internet Explorer 5.5 1304
iw3htp2TOC.fm Page xviii Monday, July 23, 2001 4:43 PM
XIX
34.14 Internet and World Wide Web Resources 1305
A XHTML Special Characters 1313
B Operator Precedence Chart 1314
C ASCII Character Set 1316
D Number Systems 1317
D.1 Introduction 1318
D.2 Abbreviating Binary Numbers as Octal Numbers and Hexadecimal Numbers 1321
D.3 Converting Octal Numbers and Hexadecimal Numbers to Binary Numbers 1322
D.4 Converting from Binary, Octal, or Hexadecimal to Decimal 1322
D.5 Converting from Decimal to Binary, Octal, or Hexadecimal 1323
D.6 Negative Binary Numbers: Two’s Complement Notation 1325
E XHTML Colors 1330
F Career Opportunities 1333
F.1 Introduction 1334
F.2 Resources for the Job Seeker 1335
F.3 Online Opportunities for Employers 1336
F.3.1 Posting Jobs Online 1338
F.3.2 Problems with Recruiting on the Web 1340
F.3.3 Diversity in the Workplace 1340
F.4 Recruiting Services 1341
F.4.1 Testing Potential Employees Online 1342
F.5 Career Sites 1343
F.5.1 Comprehensive Career Sites 1343
F.5.2 Technical Positions 1344
F.5.3 Wireless Positions 1345
F.5.4 Contracting Online 1345
F.5.5 Executive Positions 1346
F.5.6 Students and Young Professionals 1347
F.5.7 Other Online Career Services 1348
F.6 Internet and World Wide Web Resources 1349
G Unicode®
1357
G.1 Introduction 1358
G.2 Unicode Transformation Formats 1359
G.3 Characters and Glyphs 1360
G.4 Advantages/Disadvantages of Unicode 1360
G.5 Unicode Consortium’s Web Site 1361
G.6 Using Unicode 1362
G.7 Character Ranges 1366
Bibliography 1370
Index 1372
iw3htp2TOC.fm Page xix Monday, July 23, 2001 4:43 PM
Preface
Live in fragments no longer. Only connect.
Edward Morgan Forster
Welcome to the exciting world of Internet and World Wide Web programming. This book
is by an old guy and two young guys. The old guy (HMD; Massachusetts Institute of Tech-
nology 1967) has been programming and/or teaching programming for 40 years. The two
young guys (PJD; MIT 1991 and TRN; MIT 1992) have been programming and/or teaching
programming for over 20 years. The old guy programs and teaches from experience; the
young guys do so from an inexhaustible reserve of energy. The old guy wants clarity; the
young guys want performance. The old guy seeks elegance and beauty; the young guys
want results. We got together to produce a book we hope you will find informative, chal-
lenging and entertaining.
The explosion and popularity of the Internet and the World Wide Web creates tremen-
dous challenges for us as authors, for our publisher—Prentice Hall, for instructors, for stu-
dents and for professionals.
The World Wide Web increases the prominence of the Internet in information systems,
strategic planning and implementation. Organizations want to integrate the Internet “seam-
lessly” into their information systems and the World Wide Web offers endless opportunity
to do so.
New Features in Internet & World Wide Web How to Program:
Second Edition
This edition contains many new features and enhancements including:
• Full-Color Presentation. The book enhances LIVE-CODE
™
examples by using full
color. Readers see sample outputs as they would appear on a color monitor. We
have syntax colored all the code examples, as many of today’s development envi-
ronments do. Our syntax-coloring conventions are as follows:
iw3htp2_preface.fm Page xli Wednesday, July 25, 2001 5:04 PM
XLII Preface Appendix
comments appear in green
keywords appear in dark blue
literal values appear in light blue
XHTML text and scripting text appear in black
ASP and JSP delimiters appear in red
• XHTML. This edition uses XHTML as the primary means of describing Web con-
tent. The World Wide Web Consortium deprecated the use of HTML 4 and replaced
it with XHTML 1.0 (Extensible Hypertext Markup Language). XHTML is derived
from XML (Extensible Markup Language), which allows Web developers to create
their own tags and languages. XHTML is replacing HTML as the standard for mark-
ing up Web content because it is more robust and offers more features.
• Chapter 19, Macromedia®
Flash.™
Flash is a cutting-edge multimedia applica-
tion that enables Web developers to create interactive, animated content. Through
hands-on examples, we show how to add interactivity, sound and animation to
Web sites while teaching the fundamentals of Flash and ActionScript—Flash’s
scripting language. The chapter examples include creating interactive buttons, an-
imated banners and animated splash screens (called animation pre-loaders).
• Chapter 20, Extensible Markup Language (XML). Throughout the book we em-
phasize XHTML, which derived from XML and HTML. XML derives from
SGML (Standardized General Markup Language), whose sheer size and complex-
ity limits its use beyond heavy-duty, industrial-strength applications. XML is a
technology created by the World Wide Web Consortium for describing data in a
portable format. XML is an effort to make SGML-like technology available to a
much broader community. XML is a condensed subset of SGML with additional
features for usability. Document authors use XML’s extensibility to create entire-
ly new markup languages for describing specific types of data, including mathe-
matical formulas, chemical molecular structures and music. Markup languages
created with XML include XHTML (Chapters 4 and 5), MathML (for mathemat-
ics), VoiceXML™
(for speech), SMIL™ (the Synchronized Multimedia Integra-
tion Language for multimedia presentations), CML (Chemical Markup Language
for chemistry) and XBRL (Extensible Business Reporting Language for financial
data exchange).
• Chapter 23, Wireless Internet and m-Business. We introduce the impact of wire-
less communications on individuals and businesses. The chapter then explores
wireless devices and communications technologies and introduces wireless pro-
gramming. The Wireless Application Protocol (WAP) is designed to enable differ-
ent kinds of wireless devices to communicate and access the Internet using the
Wireless Markup Language (WML). WML tags mark up a Web page to specify
how to format a page on a wireless device. WMLScript helps WAP applications
“come alive” by allowing a developer to manipulate WML document content dy-
namically. In addition to WAP/WML, we explore various platforms and program-
ming languages on the client, such as Java 2 Micro Edition (J2ME), Qualcomm’s
Binary Runtime Environment for Wireless (BREW), the enormously popular Japa-
nese i-mode service, Compact HyperText Markup Language (cHTML) and Blue-
tooth™ wireless technology.
iw3htp2_preface.fm Page xlii Wednesday, July 25, 2001 5:04 PM
Appendix Preface XLIII
• Server-Side Technology. We present condensed treatments of six popular Internet/
Web programming languages for building the server side of Internet- and Web-
based client/server applications. In Chapters 25 and 26, we discuss Active Server
Pages (ASP)—Microsoft’s technology for server-side scripting. In Chapter 27, we
introduce Perl, an open-source scripting language for programming Web-based ap-
plications. In Chapters 28 and 29, we introduce Python and PHP—two emerging,
open-source scripting languages. In Chapters 30 and 31, we provide two bonus
chapters for Java programmers on Java™ servlets and JavaServer Pages™ (JSP).
• Chapter 34, Accessibility. Currently, the World Wide Web presents many chal-
lenges to people with disabilities. Individuals with hearing and visual impairments
have difficulty accessing multimedia-rich Web sites. To rectify this situation, the
World Wide Web Consortium (W3C) launched the Web Accessibility Initiative
(WAI), which provides guidelines for making Web sites accessible to people with
disabilities. This chapter provides a description of these guidelines. We also intro-
duce VoiceXML and CallXML, two technologies for increasing the accessibility of
Web-based content.
• Appendix F, Career Opportunities. This detailed appendix introduces career ser-
vices on the Internet. We explore online career services from the employer and em-
ployee’s perspective. We suggest sites on which you can submit applications, search
for jobs and review applicants (if you are interested in hiring people). We also re-
view services that build recruiting pages directly into e-businesses. One of our re-
viewers told us that he had just gone through a job search largely using the Internet
and this chapter would have expanded his search dramatically.
• Appendix G, Unicode. This appendix overviews the Unicode Standard. As com-
puter systems evolved worldwide, computer vendors developed numeric repre-
sentations of character sets and special symbols for the local languages spoken in
different countries. In some cases, different representations were developed for
the same languages. Such disparate character sets made communication between
computer systems difficult. XML and XML-derived languages, such as XHTML,
support the Unicode Standard (maintained by a non-profit organization called the
Unicode Consortium), which defines a single character set with unique numeric
values for characters and special symbols in most spoken languages. This appen-
dix discusses the Unicode Standard, overviews the Unicode Consortium Web site
(unicode.org) and shows an XML example that displays “Welcome to Uni-
code!” in ten different languages!
Some Notes to Instructors
Why We Wrote Internet & World Wide Web How to Program: Second Edition
Dr. Harvey M. Deitel taught introductory programming courses in universities for 20 years
with an emphasis on developing clearly written, well-designed programs. Much of what is
taught in these courses are the basic principles of programming with an emphasis on the
effective use of control structures and functionalization. We present these topics in Internet
& World Wide Web How to Program: Second Edition, the way HMD has done in his uni-
versity courses. Students are highly motivated by the fact that they are learning six leading-
iw3htp2_preface.fm Page xliii Wednesday, July 25, 2001 5:04 PM
XLIV Preface Appendix
edge scripting languages (JavaScript, VBScript, Perl, Python, PHP and Flash ActionScript)
and a leading-edge programming paradigm (object-based programming). We also teach
Dynamic HTML, a means of adding “dynamic content” to World Wide Web pages. Instead
of Web pages with only text and static graphics, Web pages “come alive” with audios, vid-
eos, animations, interactivity and three-dimensional moving images. Dynamic HTML’s
features are precisely what businesses and organizations need to meet today’s information
processing requirements. These programming languages will be useful to students imme-
diately as they leave the university environment and head into a world in which the Internet
and the World Wide Web have massive prominence.
Focus of the Book
Our goal was clear: produce a textbook for introductory university-level courses in com-
puter programming for students with little or no programming experience, yet offer the
depth and rigorous treatment of theory and practice demanded by traditional, upper-level
programming courses and professionals. To meet this goal, we produced a comprehensive
book that teaches the principles of control structures, object-based programming, various
markup languages (XHTML, Dynamic HTML and XML) and scripting languages such as
JavaScript, VBScript, Perl, Python, PHP and Flash ActionScript. After mastering the ma-
terial in this book, students entering upper-level programming courses and industry will be
well prepared to take advantage of the Internet and the Web.
Using Color to Enhance Pedagogy and Clarity
We have emphasized color throughout the book. The World Wide Web is a colorful, multi-
media-intensive medium. It appeals to our visual and audio senses. Someday it may even ap-
peal to our senses of touch, taste and smell! We suggested to our publisher, Prentice Hall, that
they publish this book in color. The use of color is crucial to understanding and appreciating
many of the programs we present. Almost from its inception, the Web has been a color-inten-
sive medium. We hope it helps you develop more appealing Web-based applications.
Web-Based Applications Development
Many books about the Web concentrate on developing attractive Web pages. We discuss
Web-page design intensely. But more importantly, the key focus of this book is on Web-
based applications development. Our audiences want to build real-world, industrial-strength,
Web-based applications. These audiences care about good looking Web pages, but they also
care about client/server systems, databases, distributed computing, etc. Many books about the
Web are reference manuals with exhaustive listings of features. That is not our style. We con-
centrate on creating real applications. We provide the LIVE-CODE™ examples on the CD ac-
companying this book (and at www.deitel.com) so that you can run the applications and
see and hear the multimedia outputs. You can interact with our game and art programs. The
Web is an artist’s paradise. Your creativity is your only limitation. However, the Web con-
tains so many tools and mechanisms to leverage your abilities that even if you are not artisti-
cally inclined, you can create stunning output. Our goal is to help you master these tools so
that you can maximize your creativity and development abilities.
Multimedia-Intensive Communications
People want to communicate. Sure, they have been communicating since the dawn of civ-
ilization, but computer communications have been limited mostly to digits, alphabetic char-
iw3htp2_preface.fm Page xliv Wednesday, July 25, 2001 5:04 PM
Appendix Preface XLV
acters and special characters. The next major wave of communication technology is
multimedia. People want to transmit pictures and they want those pictures to be in color.
They want to transmit voices, sounds and audio clips. They want to transmit full-motion
color video. At some point, they will insist on three-dimensional, moving-image transmis-
sion. Our current flat, two-dimensional televisions eventually will be replaced with three-
dimensional versions that turn our living rooms into “theaters-in-the-round.” Actors will
perform their roles as if we were watching live theater. Our living rooms will be turned into
miniature sports stadiums. Our business offices will enable video conferencing among col-
leagues half a world apart, as if they were sitting around one conference table. The possi-
bilities are intriguing, and the Internet is sure to play a key role in making many of these
possibilities become reality. Dynamic HTML and Flash ActionScript are means of adding
“dynamic content” to World Wide Web pages. Instead of Web pages with only text and
static graphics, Web pages “come alive” with audios, videos, animations, interactivity and
three-dimensional imaging. Dynamic HTML’s and Flash ActionScript’s features are pre-
cisely what businesses and organizations need to meet today’s multimedia-communica-
tions requirements. There have been predictions that the Internet will eventually replace the
telephone system. Why stop there? It could also replace radio and television as we know
them today. It is not hard to imagine the Internet and the World Wide Web replacing news-
papers with electronic news media. Many newspapers and magazines already offer Web-
based versions, some fee based and some free. Increased bandwidth makes it possible to
stream audio and video over the Web. Both companies and individuals run their own Web-
based radio and television stations. Just a few decades ago, there were only a few television
stations. Today, standard cable boxes accommodate about 100 stations. In a few more
years, we will have access to thousands of stations broadcasting over the Web worldwide.
This textbook may someday appear in a museum alongside radios, TVs and newspapers in
an “early media of ancient civilization” exhibit.
Teaching Approach
Internet & World Wide Web How to Program: Second Edition contains a rich collection of
examples, exercises and projects drawn from many fields to provide the student with a
chance to solve interesting real-world problems. The book concentrates on the principles
of good software engineering and stresses program clarity. We avoid arcane terminology
and syntax specifications in favor of teaching by example. The book is written by educators
who spend much of their time teaching edge-of-the-practice topics in industry classrooms.
The text emphasizes good pedagogy.
LIVE-CODE™ Teaching Approach
The book is loaded with hundreds of LIVE-CODE™ examples. This is how we teach and write
about programming, and is the focus of each of our multimedia Cyber Classrooms as well.
Each new concept is presented in the context of a complete, working example immediately
followed by one or more windows showing the example’s input/output dialog. We call this
style of teaching and writing our LIVE-CODE™ approach. We use the language to teach the
language. Reading these examples is much like entering and running them on a computer.
Internet & World Wide Web How to Program: Second Edition “jumps right in” with
XHTML in Chapter 4, then rapidly proceeds with programming in JavaScript, Microsoft’s
Dynamic HTML, XML, VBScript/ASP, Perl, Python, PHP, Flash ActionScript, Java Serv-
iw3htp2_preface.fm Page xlv Wednesday, July 25, 2001 5:04 PM
XLVI Preface Appendix
lets and JavaServer Pages. Many students wish to “cut to the chase;” there is great stuff to
be done in these languages so let’s get to it! Web programming is not trivial by any means,
but it is fun, and students can see immediate results. Students can get graphical, animated,
multimedia-based, audio-intensive, database-intensive, network-based programs running
quickly through “reusable components.” They can implement impressive projects. They
can be more creative and productive in a one- or two-semester course than is possible in
introductory courses taught in conventional programming languages, such as C, C++,
Visual Basic and Java. [Note: This book includes Java Servlets and JavaServer Pages as
“bonus chapters;” it does not teach the fundamentals of Java programming. Readers who
want to learn Java may want to consider reading our book, Java How to Program: Fourth
Edition. Readers who desire a deeper, more developer-oriented treatment of Java may want
to consider reading our book, Advanced Java 2 Platform How to Program.]
World Wide Web Access
All the code for Internet & World Wide Web How to Program: Second Edition (and our other
publications) is on the Internet free for download at the Deitel & Associates, Inc. Web site
www.deitel.com
Please download all the code, then run each program as you read the text. Make changes to
the code examples and immediately see the effects of those changes. A great way to learn
programming is by programming. [Note: You must respect the fact that this is copyrighted
material. Feel free to use it as you study, but you may not republish any portion of it in any
form without explicit permission from Prentice Hall and the authors.]
Objectives
Each chapter begins with a statement of Objectives. This tells students what to expect and
gives students an opportunity, after reading the chapter, to determine if they have met these
objectives. This is a confidence builder and a source of positive reinforcement.
Quotations
The learning objectives are followed by quotations. Some are humorous, some are philo-
sophical and some offer interesting insights. Our students enjoy relating the quotations to
the chapter material. Many of the quotations are worth a “second look” after reading the
chapter.
Outline
The chapter Outline helps the student approach the material in top-down fashion. This, too,
helps students anticipate what is to come and set a comfortable and effective learning pace.
15,836 Lines of Code in 311 Example LIVE-CODE™ Programs (with Program Outputs)
Each program is followed by the outputs produced when the document is rendered and its
scripts are executed. This enables the student to confirm that the programs run as expected.
Reading the book carefully is much like entering and running these programs on a comput-
er. The programs range from just a few lines of code to substantial examples with several
hundred lines of code. Students should run each program while studying that program in
the text. The examples are available on the CD and at our Deitel (www.deitel.com) and
Prentice Hall Web sites (www.prenhall.comdeitel).
iw3htp2_preface.fm Page xlvi Wednesday, July 25, 2001 5:04 PM
Other documents randomly have
different content
When, with faltering steps, he at length reached the village, it was
to find the whole place in a tumult. Every canoe was afloat; a couple
of whale-boats were scouring the outer bay; and the malae, usually
so deserted on a hot afternoon, was overrun by an excited throng.
Had he not, then, heard the news? It was thought that the Helper
had been drowned that morning, and the boats were now searching
for his body! Behold, here were the unfortunate’s clothes, found
even as they were, and by order of the chief left untouched for the
priest himself to see; here, too, was old Lefao, the shrill mother of
Pa’a, who had seen the young man go in to his death, and had
heard his sinking cry. “Lefao, make for his Excellency a repetition of
that mournful sound, and show how he cast up his arms as thou
watchedst him from the beach.” The old impostor was enjoying all
the importance of having such a tale to tell, and the father winced
under a pang of shame as he listened to this unexpected
confederate.
It was afterwards thought that the sad affair must have unhinged
Father Studby’s mind, for he subsequently began to show symptoms
of serious mental disturbance, which culminated a few months later
in his tragic suicide. A marble pillar, the outcome of a public
subscription in Sydney, was raised to the memory of these two
martyrs of the cross. In faded letters, beneath their crumbling
names, one can still spell out the lies:
IN LIFE THEY WERE TOGETHER;
IN DEATH THEY WERE NOT DIVIDED.
AMATUA’S SAILOR
A
AMATUA’S SAILOR
MATUA was running down a beautifully shaded road as fast as his
little legs would carry him, and close in chase, like a hawk after a
sparrow, was a grizzled man-of-war’s-man with a switch. The road
was long and straight; on both sides it was bordered by prickly
hedges bright with limes, and as impenetrable as a tangle of barbed
wire. At every step the white man gained on the boy, until the latter
could hear the hoarse, angry breath of his pursuer. Amatua stopped
short, and before he could even so much as turn he found himself in
a grip of iron. Whish, whish, whish! dashed the switch on his bare
back and legs, keen and stinging like the bite of fire-ants. It took all
the little fellow’s manliness to keep him from bellowing aloud. The
tears sprang to his eyes,—even the son of a chief is human like the
rest of us,—but he would not cry.
“What’s all this?” rang out a voice, as a white man reined in his horse
beside them—a tall man in spectacles, who spoke with an air of
authority.
The sailor touched his hat. “Why, sir, you’d scarcely believe it,” he
said, “the fuss I’ve had with this young savage! First he tried to lose
me in the woods. I didn’t think nothing of that; but when he got me
into a river for a swim, and then made off with my clothes, and hid
’em under a tree—I might have been looking for ’em yet, me that
must be aboard my ship at twelve o’clock. Why, it might have cost
me my stripe! I tell you, I never dreamed of such a thing, for me and
Am have been friends ever since the first day I came ashore. He’s no
better than a treacherous little what-d’ye-call-’em!”
“The chief says thou hidst his clothes,” said the stranger, in the native
language. “He says thou triedst to lose him in the woods.”
“Ask him if I haven’t always been a good friend to him,” said the
sailor. “Ask him who gave him the knife with the lanyard, and who
made him the little spear to jug fish on the reef. Just you ask him
that, sir.”
“Your Highness,” said Amatua, in his own tongue, “Bill doesn’t
understand. I love Bill, and I don’t want him to drown. I want to save
Bill’s high-chief life.”
“And so thou hidst Bill’s clothes,” said the stranger. “That was a fine
way to help him!”
“Be not angry,” said Amatua. “Great is the wisdom of white chiefs in
innumerable things, but there are some little, common, worthless
things that they don’t understand at all.”
“Tell him I’m a leading seaman, sir,” went on Bill, who of course
understood not a word of what Amatua was saying, and whose red,
tired face still showed his indignation.
“The old women say that a great evil is about to befall us,” said
Amatua, gravely, entirely disregarding Bill. “Everybody is talking of it,
your Highness, even the wise minister from Malua College, Toalua,
whose wisdom is like that of Solomon. There’s to be a storm from
the north—a storm that will break the ships into ten thousand pieces,
and line the beach with dead. Last night I could not sleep for
thinking of Bill. Then I said to myself, ‘I will lose Bill for two days in
the woods, and then he won’t be drowned at all.’ But Bill is wise, and
made the sun guide him back to the right road. Then I made Bill
bathe, and tried to steal his clothes. But Bill looked and looked and
looked, and when he found them he thought I was a very bad boy.”
The stranger laughed, and translated all this long explanation to Bill.
“Goodness gracious!” said Bill. “Do you mean that the kid believes
this fool superstition, and was trying to save me from the wreck?”
“That’s it,” said the stranger. “I’ve known Amatua for a long time, and
I think he’s a pretty square boy.”
“Why, bless his little heart,” said the sailor, catching up the boy in his
arms, “I might have known he couldn’t mean no harm! I tell you,
we’ve been like father and son, me and Am has, up to this little
picnic. But just you say to him, sir, that, storm or no storm, Bill’s
place is the post of duty, and that he’d rather die there than live to
be disgraced.”
But the white man had other work to do than translating for Bill and
Amatua. He rode off and left them to trudge along on foot. Half an
hour later they reached the beach, and saw the ships-of-war tugging
heavily at their anchors. The weather looked dark and threatening,
and a leaden surf was pounding the outer reefs. It appeared no easy
matter to get Bill into the boat that was awaiting him, for she was
full of men bound for the ship, and difficult to manage in the ebb and
sweep of the seas. Bill’s face grew stern as he stared before him. He
walked to the end of the wharf, and took a long, hawk-like look to
seaward, never heeding the shaking woodwork nor the breakers that
wet him to the knees. There was something ominous to Amatua in
the sight of those deep-rolling ships and the piercing brightness of
their ensigns and signal-flags. He was troubled, too, to see Bill so
reckless in wetting his beautiful blue trousers and reducing his sliding
feet, as the natives call shoes, his lovely patent-leather, silk-laced
se’evae, to a state of pulp. He tried to draw him back, and pointed to
the shoes as a receding wave left them once more to view. But Bill
only laughed,—not one of his big hearty laughs, but the ghost of a
laugh,—and a queer look came into his blue eyes. He walked slowly
back to the boat, which was still rising and falling beside the wharf
with its load of silent men. Suddenly he ran his hand into his pocket,
and almost before Amatua could realise what it all meant, he felt
Bill’s watch in his hand, and a round heavy thing that was
unmistakably a dollar, and something soft and silken that could be
nothing else than the sailor’s precious handkerchief. A second later
Bill was in the boat, the tiller under his arm, while a dozen backs
bent to drive him seaward. Amatua stood on the wharf and cried. He
forgot the watch and the dollar and the silk handkerchief; he thought
only of Bill,—his friend Bill,—the proud chief who would rather die at
his post than find a coward’s place on shore. “Come back, Bill,” he
cried, as he ran out to the end of the wharf, never caring for the
waves that were dashing higher and higher. But the boat held on her
course, dipping into the seas or rising like a storm-bird on some
cresting comber until she vanished at last behind the towering
Trenton.
Amatua did not sob for long. He was a practical boy, and knew that it
could not help Bill,—poor Bill!—who already had all the salt water he
cared about. So Amatua made his way back to land, and sought out
a quiet spot where he could look at his new treasure and calculate
on the most profitable way of spending his dollar. You could not say
that the dollar burned a hole in his pocket, for Amatua did not use
pockets, and his only clothes consisted of a little strip of very dingy
cotton; but he was just as anxious to spend it as an American boy
with ten pockets. First he looked at the watch. It was a lovely watch.
It was none of your puny watches such as white ladies wear, but a
thumping big chief of a watch, thick and heavy, with a tick like a
missionary clock. It was of shining silver, and the back of it was all
engraved and carved with ships and dolphins. Bill had shown it to
him a hundred times when they had strolled about the town, or had
gone, hand in hand, in search of many a pleasant adventure. It
brought the tears to Amatua’s eyes to recall it all, and he pushed the
watch aside to have a look at the handkerchief. This was another old
friend. It was of the softest, thickest silk, such as girls delight in, all
red and green and blue and yellow, like the colours of a rainbow.
There was nothing small about Bill. Even the dollar seemed bigger
and fatter than any Amatua had seen; but then it must be
remembered that dollars had seldom come his way. Oh, that dollar!
How was he to spend it so that it would reach as far as two dollars?
—a financial problem every one has had to grapple with at some
time or another.
He was well up in the price of hardtack. The price fluctuated in Apia
—all the way from twelve for a quarter up to eighteen for a quarter.
Quality did not count; at any rate, Amatua was not one of those boys
who mind a little mustiness in their hardtack, or that slight suspicion
of rancid whale-oil which is a characteristic of the cheaper article.
Hardtack was hardtack, and eighteen were better than twelve. Here
was one quarter gone, and hardtack made way for soap. Yes, he
must have soap. Even yesterday old Lu’au had said: “War is a terrible
thing. It makes one’s heart shake like a little mouse in one’s body.
But lack of soap is worse than war. You can get used to war; but who
ever got used to going without soap?” Yes, there must be soap to
gladden old Lu’au. This meant another quarter.
As to the third purchase there could be no manner of doubt; some
’ava, the white, dry root which, pounded in water and strained by the
dexterous use of a wisp of fibre, supplies the Samoan for the lack of
every comfort. Oh, how the ’ava would rejoice his father in those
dismal woods, where he lay with the famishing army, bearing hunger,
cold, and misery with uncomplaining fortitude. And it should be none
of that dusty, spotted stuff that so many traders sell to unknowing
whites, or natives in a hurry, but the white ’ava from Vaea, which
grows the very finest in the South Seas. And the last quarter? How
was that to go? Was it to be a new lava lava, or a white singlet, or
two rusty cans of salmon, or some barrel beef? Amatua would have
dearly loved some marbles; but in the depressed state of the family’s
finances these were not to be thought of. The beef was the thing;
the strong, rank beef that comes in barrels; you could get a slab of it
for a quarter, and Latapie, the French trader, would give you a box of
matches besides, or a few fish-hooks, for every quarter you spent at
his store.
Having finished his calculations, Amatua started off to do his
shopping. Even in the short time he had spent in the corner of the
ruined church the sea had noticeably risen and was now thundering
along the beach, while on the reefs a gleaming spray hung above the
breakers like a mist. The stormy sky was splashed with ragged
clouds and streaked with flying scud. At their moorings the seven
ships rolled under until they seemed to drown the very muzzles of
their guns; and the inky vapour that oozed from their funnels, and
the incessant shrill shrieking of the boatswains’ whistles, all told a
tale of brisk and anxious preparation. “Oh, poor Bill!” thought
Amatua, and looked away. The wharf from which he had seen the
last of his friend was already a wreck, nothing showing of it but the
jagged stumps as the seas rolled back.
Two boys told him that a boat of Misi Moa’s had been smashed to
pieces, and that a big whaler from Lufilufi that pulled fifty oars had
shared the same fate. Knots of white traders stood gazing solemnly
out to sea; the provost guards from the ships were ransacking the
town for the few men they still missed, and they were told to hurry
or their boats would never live to carry them back. There was a
general air of apprehension and excitement; people were nailing up
their windows and drawing in their boats before the encroaching
ocean; and the impressiveness of the situation was not a little
heightened by the heavy guard of blue-jackets lined up before the
German consulate, and the throngs of Tamasese’s warriors that
swarmed everywhere about, fierce of mien in that unfriendly town,
with their faces blackened for war, and their hands encumbered with
rifles and head-knives. But Amatua had no time to think of such
things; the signs of war were familiar to him, and the armed and
overbearing adversaries of his tribe and people were no longer so
terrible as they once had been.
The increasing roar of the sea and the wild sky that spoke of the
impending gale kept the thought of Bill close to his heart, and he
went about his business with none of the pleasure that the spending
of money once involved. Not that he forgot his prudence or his skill
at bargaining in the anxiety for Bill that tore his little heart. By dint of
walking and chaffering, he came off with twenty hardtack for his first
quarter; with the soap he extorted a package of starch; and after he
had sniffed beef all the way from Sogi to Vaiala,—a distance of two
miles,—he became the proprietor of a hunk at least six ounces
heavier than the ruling price allowed. The ’ava was of a superb
quality, fit for a king to drink.
It was late when Amatua got home and crept into the great beehive
of a house that had been the pride of his father’s heart. The girls
shouted as they saw him, and old Lu’au clapped her hands as her
quick eyes perceived the soap. His mother alone looked sad—his
poor mother, who used to be so gay and full of fun in that happy
time before the war. She had never been the same since her cousin,
the divinity student, had brought back her brother’s head from the
battle-field of Luatuanuu—that terrible battle-field where the best
blood of Samoa was poured out like water.
She looked anxiously at Amatua’s parcels, and motioned him to her
side, asking him in a low voice how and where he had got them.
“It was this way,” said Amatua. “Bill and I are brothers. What is mine
is Bill’s; what is Bill’s is mine. We are two, but in heart we are one.
That’s how I understand Bill, though he talks only the white man’s
stutter. ‘Amatua,’ he said, just before he got into the boat,—I mean
what he said in his heart, for there was not time for words,—‘we are
all of us in God’s high-chief hands this day; a storm is coming, and
my place is on my ship, where I shall live or be cast away, as God
wills. Take you this dollar and spend it with care for the comfort of all
our family; take my very valuable watch, that ticks louder than a
missionary clock, and my handkerchief of silk, the like of which there
is not in Samoa, and keep them for me. My life is God’s alone, but
these things belong to all of our family. Stand firm in the love of God,
and strengthen your heart to obey his high-chief will.’”
It was late when Amatua awoke. The house was empty save for old
Lu’au, who was kindling a fire on the hearth. A strange uproar filled
the air, the like of which Amatua had never heard before—the tramp
of multitudes as they rushed and shouted, deafening explosions, and
the shrill, high scream of the long-expected gale. Amatua leaped
from his mats, girded up his loin-cloth, and ran headlong into the
night. It was piercing cold, and he shivered like a leaf, but he took
thought of nothing. He ran for the beach, which lay at no great
distance from his father’s house, and was soon panting down the
lane beside Mr. Eldridge’s store. It was flaming with lights and filled
with a buzzing crowd of whites and natives; and on the front
verandah there lay the dripping body of a sailor with a towel over his
upturned face. The beach was jammed with people, and above the
fury of the gale and the roaring breakers which threatened to engulf
the very town there rang out the penetrating voices of the old war
chiefs as they vociferated their orders and formed up their men. Even
as Amatua stood dazed and almost crushed in the mob, there was a
sudden roar, a rush of feet, and a narrow lane opened to a dozen
powerful men springing through with the bodies of two sailors.
Amatua turned and fought his way seaward, boring through the
crowd to where the seas swept up to his ankles, and he could make
out the lights of the men-of-war. There was a ship on the reef; he
could see the stupendous tangle of her yards and rigging; every
wave swept in some of her perishing crew. The undertow ran out like
a mill-race; living men were tossed up the beach like corks, only to
be sucked back again to destruction. The Samoans were working
with desperation to save the seamen’s lives, and more than one
daring rescuer was himself swept into the breakers.
Amatua found himself beside a man who had just been relieved, and
was thunderstruck to find that it was no other than Oa, an old friend
of his, who had been in the forest with Mataafa.
“How do you happen here, Chief Oa?” shouted Amatua.
“The Tamaseses have retired on Mulinuu,” said Oa. “It is Mataafa’s
order that we come and save what lives we can.”
“Germans, too?” asked Amatua, doubtfully, never forgetful of his
father’s wound, or of his uncle who fell at Luatuanuu.
“We are not at war with God,” said the chief, sternly. “To-night there
is peace in every man’s heart.”
Amatua stood long beside his friend, peering into that great void in
which so many men were giving up their lives. Sometimes he could
make out the dim hulls of ships when they loomed against the sky-
line or as the heavens brightened for an instant. Bodies kept
constantly washing in, nearly all of them Germans, as Amatua could
tell by their uniforms, or, if these were torn from them in the
merciless waters, by the prevalence of yellow hair and fair skins.
Amatua shrank from the sight of these limp figures, and it was only
his love for Bill that kept him on the watch. Poor Bill! How had he
fared this night? Was he even now tumbling in the mighty rollers, his
last duty done on this sorrowful earth, his brave heart still for ever?
Or did he lie, as so many lay that night here and there about the
town, wrapped in blankets in some white man’s house or native
chief’s, safe and sound, beside a blazing fire?
Amatua at last grew tired of waiting there beside Oa. The cold ate
into his very bones, and the crowd pressed and trampled on him
without ceasing. He cared for nothing so long as he thought he
might find Bill; but he now despaired of that and began to think of
his tired little self. He forced his way back, and moved aimlessly
along from house to house, looking in at the lighted windows in the
vain hope of seeing Bill. Of dead men there were plenty, but he could
not bear to look at them too closely. He was worn out by the horror
and excitement he had undergone, and when his eyes closed, as
they sometimes would, he seemed to see Bill’s face dancing before
him. He was a very tired boy by the time he made his way home and
threw himself once again on the mats in that empty house.
It was a strange sight that met Amatua’s gaze the next day on the
Apia beach. The wind had fallen, and the mountainous waves of the
previous night had given way to a heavy ground-swell. But the ships,
the wreckage of ships, the ten thousand and one things—the million
and one things—which lined the beach for a distance of two miles!
One German man-of-war had gone down with every soul on board;
another—the Adler—lay broken-backed and sideways on the reef;
the Olga had been run ashore, and looked none the worse for her
adventure. The United States ship Vandalia was a total wreck, and
half under water; close to her lay the Trenton, with her gun-deck
awash; and within a pistol-shot of both was the old Nipsic, her nose
high on land. The British ship, the Calliope, was nowhere to be seen,
having forced her way to sea in the teeth of the hurricane.
Amatua went almost crazy at the sight of what lay strewn on the
beach that morning. He ran hither and thither, picking up one thing
and then throwing it away for another he liked better: here an
officer’s full-dress coat gleaming with gold lace, there a photograph-
album in a woful state, some twisted rifles, and a broom; everywhere
an extraordinary hotchpotch of things diverse and innumerable.
Amatua found an elegant sword not a bit the worse for its trip
ashore, an officer’s gold-laced cap, and a ditty-box, full of pins and
needles and sewing-gear and old letters. He would also have carried
off a tempting little cannon had it weighed anything under a quarter
of a ton; as it was, he covered it with sand, and stood up the broom
to mark the place, which, strange to say, he has never been able to
find since. He got a cracked bell next, a tin of pork and beans, a
bottle of varnish, a one-pound Hotchkiss shell, a big platter, and a
German flag! This he thought enough for one load, and made his
triumphant way home, where he tried pork and beans for the first
time in his life—and did not like them.
It would have fared badly with him, for there was nothing in the
house for him to eat save a few green bananas, had it not been for
the Samoan pastor next door. The pastor had hauled a hundred-
pound barrel of prime mess pork out of the surf, and in the fulness of
his heart he was dividing slabs of it among his parishioners. Another
neighbour had salvaged eleven cans of biscuit-pulp, which, though a
trifle salt, was yet good enough to eat.
In fact, Amatua ate a rather hearty breakfast, and lingered longer
over it than perhaps was well for the best interests of his family. By
the time he returned to the beach the cream had been skimmed
from the milk. True, there was no lack of machinery and old iron, and
mountains of tangled rope and other ship’s gear; but there was no
longer the gorgeous profusion of smaller articles, for ten thousand
busy hands had been at work since dawn. Amatua searched for an
hour, and got nothing but a squashy stamp-album and a musical box
in the last stages of dissolution.
He realised regretfully that he could hope for nothing more, and after
trading his album to a half-caste boy for a piece of lead, and
exchanging the musical box for six marbles, he again bent his
energies to the finding of Bill.
For fear of a conflict, the naval commanders had divided their forces.
The Germans were encamped at one end of the town, the Americans
at the other, and armed sentries paced between. Amatua had never
seen so many white men in his life, and he knew scarcely which way
to turn first. He was bewildered by the jostling host that
encompassed him on every side, by the busy files that were
marshalled away to work, the march and countermarch of disciplined
feet, the shrill pipe of the boatswains’ calls, and the almost ceaseless
bugling. He looked long and vainly for Bill in every nook and cranny
of the town. He watched beside the Nipsic for an hour; he forced the
guard-house, and even made his way into the improvised hospital,
dodging the doctors and the tired orderlies. But all in vain. He
trudged into Savalalo and Songi, where the Germans were gathered,
fearing lest Bill might have been thrown into chains by those haughty
foemen; but he found nothing but rows of dead, and weary men
digging graves. He stopped officers on the street, and kind-faced
seamen and marines, and asked them earnestly if they had seen Bill.
Some paid no attention to him; others laughed and passed on; one
man slapped him in the face.
When he came back from the German quarter he found a band
playing in front of Mr. Moors’s store, and noticed sentries about the
place, and important-looking officers, with swords and pistols. He
was told that the admiral was up-stairs, and that Mr. Moors’s house
was now the headquarters of the American forces. A great resolution
welled up in Amatua’s heart. If there was one man on earth that
ought to know about Bill, it was the admiral. Amatua dodged a
sentry, and running up the steps, he crept along the verandah, and
peeped into the room which Kimberly had exchanged for his sea-
swept cabin. The admiral sat at a big table strewn inches high with
papers, reports, and charts. He was writing in his shirt-sleeves, and
on the chair beside him lay his uniform coat and gold-laced cap. At
another table two men were also writing; at another a single man
was nibbling a pen as he stared at the paper before him. It reminded
Amatua of the pastor’s school. Half a dozen officers stood grouped in
one corner, whispering to one another, their hands resting on their
swords. It was all as quiet as church, and nothing could be heard but
the scratch of pens as they raced across the paper. Suddenly a
frowning officer noticed Amatua at the door. “Orderly,” he cried,
“drive away that boy”; and Amatua was ignominiously seized, led
down-stairs, and thrown roughly into the street.
Amatua cried as though his little heart would break. He sat on the
front porch of the house, careless of the swarming folk about him,
and took a melancholy pleasure in being jostled and trampled on.
Oh, it was a miserable world! Bill was gone, and any one could cuff a
little boy. More than one sailor patted his curly head and lifted him in
the air and kissed him; but Amatua was too sore to care for such
attentions. It was cruel to think that the one man alone in Samoa
who knew where to find Bill, the great chief-captain up-stairs, was
absolutely beyond his power to reach. This thought was unbearable;
he nerved himself to try again; he recalled the admiral’s face, which
was not unkindly, though sad and stern. After all, nothing worse
could befall him than a beating. Again he dodged the lower sentry,
and sprang up the stairs like a cat. Again he gazed into that quiet
room and listened to the everlasting pens. This time he was
discovered in an instant; the orderly pounced at him, but Amatua,
with his heart in his mouth, rushed towards the admiral, and threw
himself on his knees beside him. The old man put a protecting arm
round his neck, and the orderly, foiled in the chase, could do nothing
else than salute.
“Anderson,” said the admiral to an officer, “it is the second time the
boy has been here. I tell you he is after something, and we are not
in a position to disregard anything in this extraordinary country. He
may have a message from King Mataafa. Send for Moors.”
In a few moments that gentleman appeared, and was bidden to ask
Amatua what he wanted. The officers gathered close behind their
chief, and even the assiduous writers looked up.
“What does he want?” demanded the admiral, who had no time to
spare.
“He wants to find a sailor named Bill,” said Moors. “He’s afraid Bill is
drowned, and thought he would ask you.”
Every one smiled save the admiral. “Are you sure that is all?” he said.
“He says he loved Bill very much,” said Moors, “and has searched the
beach and the hospital and even the lock-up without finding him.
Says he even waited alongside the Nipsic for an hour.”
“Half my men are named Bill,” said Kimberly; “but I fear his Bill is
numbered with the rest of our brave fellows who went down last
night. Moors,” he went on, “take the lad below, and give him any
little thing he fancies in the store.”
Amatua did not know what might happen next, but he bravely
tramped beside Mr. Moors, prepared to face the worst. He felt dizzy
and faint when they got below, and Mr. Moors popped him up on the
counter, and asked him whether he would prefer candy or some
marbles. “The great chief-captain said thou wert a brave boy, and
should have a present,” said Mr. Moors.
Amatua shook his head. Somehow he had lost interest in such trifles.
“Thank his Majesty the admiral,” he said, “but an aching heart takes
no pleasure in such things. With thy permission I will go out and look
again for Bill. Perhaps, if I change my mind, I will come back and
choose marbles,” he added cautiously; and with that he scrambled
off the counter and made for the door.
“Oh, Bostock,” cried Moors to a naval officer lounging on the front
verandah, “if you have nothing better to do, just take this kid along
with you. He’s crazy to find a sailor named Bill, and he isn’t sure but
that he was drowned last night. He must be pretty well cut up if he
won’t take any marbles.”
Bostock stopped Amatua, and took his hand in his own. “We’ll go
find Bill,” he said.
Again was the search begun for Bill, along the main street; in the
alleys, and through the scattered native settlements behind the town
as far as the Uvea huts, at Vaimoso, and the slums of the Nieué
Islanders. Bostock let no seaman pass unnoticed; a heavy fatigue-
party coming back from work on the wrecks—sixty men and four
officers—were lined up at his request, and Amatua was led through
the disciplined ranks in search of Bill. Even the Nipsic was boarded by
the indefatigable Bostock and the weary little boy; and although
repairs were being rushed at a tremendous pace, and every one
looked overdriven and out of temper, the huge ship was overhauled
from top to bottom. From the grimy stoke-hole, where everything
dripped oil and the heat was insupportable, to the great maintop
where men were busy at the rigging; from the crowded quarters of
the seamen to the sodden and salt-smelling mess-room, in which the
red came off the cushions like blood, the pair made their way in
search of Bill.
Bostock led the boy back to land, and said good-bye to him at the
corner of the Apia Hotel. He tried to raise his spirits, and atone for
their failure to find Bill, by the present of a shilling. Amatua accepted
it with quiet gratitude, although the gift had not the cheering effect
that Bostock desired. The little fellow was sick at heart, and all the
shillings in the world could not have consoled him for the loss of Bill.
The naval officer followed him with his eyes as he trudged
sorrowfully home. He, too, had lost a lifelong friend in that awful
night.
Amatua gave up all hope of ever seeing Bill again, as time slipped
away and one day melted into another. He made friends with
Bostock, and spent many a pleasant hour in the company of that
jovial officer, following him about everywhere like a dog; but for all
that he did not love him as he had loved Bill. Those were exciting
times in Apia, and there was much to amuse and distract a little boy.
In the day Bill often passed from his thoughts, for the incessant
panorama life had now become almost precluded any other thought;
but at night, when he awoke in the early hours and heard the cocks
calling, then it was that his heart turned to Bill and overflowed with
grief for his lost friend.
Two days after the storm—two as men count, but centuries in
Amatua’s calendar—the British ship Calliope returned to port,
strained and battered by that terrible hour when she had pitted her
engines against the gale and taken her desperate dash for freedom.
But Amatua’s little head was far too full of something else for him to
bother about another man-of-war. Bostock had promised to take him
to the raft where men were diving for the Trenton’s treasure-chest.
He knew all about men-of-war by this time, for he had the freedom
of the Nipsic’s ward-room, and he took breakfast regularly with his
friends, the officers. They had given him a gold-laced cap and a tin
sword, and the tailor had made him a blue jacket with shoulder-
straps and brass buttons and the stripes of a second lieutenant. He
had his own appointed station when the ship beat to quarters; for
the Nipsic had been got safely off the reef and once more divided the
waters of the bay.
It was a beautiful morning when they pulled out in a shore boat to
the raft where the work was in progress. As the Americans possessed
no diving apparatus, Kane, the British captain, had lent them the one
he carried, with six good men who had some experience in such
matters. Amatua was disappointed to find so little to interest him. He
examined the pump with which two men were keeping life in the
diver below; but he could not understand the sense of it, and the
continuous noise soon grew monotonous. Except a tin pail containing
the men’s lunch, the brass-bound breaker of drinking water, and
some old clothes, there was nothing in the world to attract a small
boy. Amatua stood beside Bostock and yawned; the little second
lieutenant longed to be on shore playing marbles with his friends in
civil life. He was half asleep when Bostock plucked his arm and
pointed into the depths beneath. A glittering shell-fish of ponderous
weight and monstrous size was slowly rising to the surface. Every
one rushed to the side of the raft, save only the two men at the
pumps, who went on unmoved. Amatua clung to Bostock. Higher and
higher came the hideous shell-fish, until its great, goggling-eyed
head appeared horribly above the water. Amatua turned faint. The
crew behaved with incredible daring, and seized the huge, bulging
thing with the utmost fearlessness. It was frightful to see it step on
the raft and toil painfully to the centre, as though it had been
wounded in some mortal part. One of the men lifted a hammer as
though to kill it, and began to tap, tap, tap on some weak spot in the
neck. Then he threw down the hammer, detached the long suckers
which reached from the beast’s snout, and started to unscrew its
very head from its body. Amatua looked on confounded; he was
shaking with horror, yet the fascination of that brassy monster drew
him close.
Suddenly the creature sank on its knees, and the man gripped the
head in both his hands and lifted it up. And underneath, wonder of
wonders! there was the face of a man—a white man.
And the white man was Bill!
With a cry Amatua threw himself into his friend’s arms, dripping
though he was. What did he care for the fine uniform, now that Bill
was found again!
“And where have you been all this time?” asked Bostock.
“Oh, I’m the boatswain’s mate of the Calliope,” said Bill; “and what
with the knocking about we got, I’ve been kept hard at it on the
rigging.”
“You have been badly missed,” said Bostock.
“Bless his old heart!” said the sailor, “I think a lot of my little Am.”
TRANSCRIBER’S NOTE:
Obvious typographical errors have been corrected.
Inconsistencies in hyphenation have been standardized.
Archaic or alternate spelling has been retained from the original.
*** END OF THE PROJECT GUTENBERG EBOOK THE QUEEN
VERSUS BILLY, AND OTHER STORIES ***
Updated editions will replace the previous one—the old editions will
be renamed.
Creating the works from print editions not protected by U.S.
copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.
START: FULL LICENSE
THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
To protect the Project Gutenberg™ mission of promoting the free
distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.
Section 1. General Terms of Use and
Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.
1.B. “Project Gutenberg” is a registered trademark. It may only be
used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E. Unless you have removed all references to Project Gutenberg:
1.E.1. The following sentence, with active links to, or other
immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookultra.com

More Related Content

PDF
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
PDF
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
PDF
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
PDF
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
PDF
The Complete Internet and World Wide Web Cyber Classroom 2nd ed Edition Deitel
PDF
Beginning JavaScript und CSS development with jQuery 1. ed Edition Richard York
PPTX
Programming and the web for beginners
PDF
Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Interac...
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel
The Complete Internet and World Wide Web Cyber Classroom 2nd ed Edition Deitel
Beginning JavaScript und CSS development with jQuery 1. ed Edition Richard York
Programming and the web for beginners
Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Interac...

Similar to Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel (20)

PPT
Prelims Coverage for Int 213
PDF
How To Do Everything With JavaScript
PPT
Introduction To Javascript_ Vibrant Technologies & Computers
PPT
Introduction To Javascript_Vibrant Technologies & Computers
PPT
Introduction To Javascript_Vibrant Technologies & Computers
PDF
Get Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Int...
PDF
Core Web Programming Volumes I II Includes index 2nd ed Edition Hall
PDF
Download full ebook of (Ebook) learning javascript 3e by kan instant download...
PDF
Beginning JavaScript und CSS development with jQuery 1. ed Edition Richard York
PDF
Introduction to web programming with JavaScript
PDF
Advanced Java Script.pdf
PDF
Special Edition Using Javascript Mcfedries
PPTX
01_JavaScript_Advanced Level_Pratahb.pptx
PDF
Presenter manual RIA technology (specially for summer interns)
PDF
Become a webdeveloper - AKAICamp Beginner #1
PDF
Special Edition Using Javascript Mcfedries
PPT
Introduction to JavaScript
PDF
Special Edition Using Javascript Mcfedries
PDF
Special Edition Using Javascript Mcfedries
PDF
Choosing Javascript Libraries to Adopt for Development
Prelims Coverage for Int 213
How To Do Everything With JavaScript
Introduction To Javascript_ Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & Computers
Introduction To Javascript_Vibrant Technologies & Computers
Get Master Web Design with HTML CSS JavaScript and jQuery Create Stunning Int...
Core Web Programming Volumes I II Includes index 2nd ed Edition Hall
Download full ebook of (Ebook) learning javascript 3e by kan instant download...
Beginning JavaScript und CSS development with jQuery 1. ed Edition Richard York
Introduction to web programming with JavaScript
Advanced Java Script.pdf
Special Edition Using Javascript Mcfedries
01_JavaScript_Advanced Level_Pratahb.pptx
Presenter manual RIA technology (specially for summer interns)
Become a webdeveloper - AKAICamp Beginner #1
Special Edition Using Javascript Mcfedries
Introduction to JavaScript
Special Edition Using Javascript Mcfedries
Special Edition Using Javascript Mcfedries
Choosing Javascript Libraries to Adopt for Development
Ad

Recently uploaded (20)

PDF
RMMM.pdf make it easy to upload and study
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Lesson notes of climatology university.
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Classroom Observation Tools for Teachers
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Pharma ospi slides which help in ospi learning
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
RMMM.pdf make it easy to upload and study
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Microbial disease of the cardiovascular and lymphatic systems
Abdominal Access Techniques with Prof. Dr. R K Mishra
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
GDM (1) (1).pptx small presentation for students
Basic Mud Logging Guide for educational purpose
Lesson notes of climatology university.
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Classroom Observation Tools for Teachers
Module 4: Burden of Disease Tutorial Slides S2 2025
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Computing-Curriculum for Schools in Ghana
Pharma ospi slides which help in ospi learning
STATICS OF THE RIGID BODIES Hibbelers.pdf
Final Presentation General Medicine 03-08-2024.pptx
VCE English Exam - Section C Student Revision Booklet
Ad

Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel

  • 1. Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel - PDF Download (2025) https://ebookultra.com/download/internet-world-wide-web-how-to- program-2nd-edition-harvey-m-deitel/ Visit ebookultra.com today to download the complete set of ebooks or textbooks
  • 2. Here are some recommended products for you. Click the link to download, or explore more at ebookultra.com C how to program Tenth Edition Deitel https://ebookultra.com/download/c-how-to-program-tenth-edition-deitel/ Operating Systems 3rd Edition Harvey M. Deitel https://ebookultra.com/download/operating-systems-3rd-edition-harvey- m-deitel/ Java How to Program Early Objects 10th ed Edition Deitel https://ebookultra.com/download/java-how-to-program-early- objects-10th-ed-edition-deitel/ C How to Program With an Introduction to C Global Edition Paul Deitel https://ebookultra.com/download/c-how-to-program-with-an-introduction- to-c-global-edition-paul-deitel/
  • 3. Visual C 2010 How to Program 4th Edition 1 29 pdf Paul Deitel https://ebookultra.com/download/visual-c-2010-how-to-program-4th- edition-1-29-pdf-paul-deitel/ e Business e Commerce for Managers 1st Edition Harvey M. Deitel https://ebookultra.com/download/e-business-e-commerce-for- managers-1st-edition-harvey-m-deitel/ Sh kespeare in the Media From the Globe Theatre to the World Wide Web 2nd Edition Stefani Brusberg-Kiermeier https://ebookultra.com/download/sh-kespeare-in-the-media-from-the- globe-theatre-to-the-world-wide-web-2nd-edition-stefani-brusberg- kiermeier/ Computer Theology Intelligent Design of the World Wide Web First Edition Bertrand Du Castel https://ebookultra.com/download/computer-theology-intelligent-design- of-the-world-wide-web-first-edition-bertrand-du-castel/ Building an Enterprise Wide Business Continuity Program 1st Edition Kelley Okolita https://ebookultra.com/download/building-an-enterprise-wide-business- continuity-program-1st-edition-kelley-okolita/
  • 5. Internet World Wide Web How to Program 2nd Edition Harvey M. Deitel Digital Instant Download Author(s): Harvey M. Deitel, Paul J. Deitel, T. R. Nieto ISBN(s): 9780130308979, 0130308978 Edition: 2nd File Details: PDF, 40.19 MB Year: 2001 Language: english
  • 6. This book is compiled in PDF format by The Admin®. Please visit my web site www.theadmin.data.bg
  • 7. Contents Preface xlv 1 Introduction to Computers and the Internet 1 1.1 Introduction 2 1.2 What Is a Computer? 4 1.3 Types of Programming Languages 5 1.4 Other High-Level Languages 7 1.5 Structured Programming 7 1.6 History of the Internet 8 1.7 Personal Computing 9 1.8 History of the World Wide Web 10 1.9 World Wide Web Consortium (W3C) 10 1.10 Hardware Trends 11 1.11 Key Software Trend: Object Technology 12 1.12 JavaScript: Object-Based Scripting for the Web 13 1.13 Browser Portability 14 1.14 C and C++ 15 1.15 Java 16 1.16 Internet and World Wide Web How to Program 16 1.17 Dynamic HTML 18 1.18 Tour of the Book 18 1.19 Internet and World Wide Web Resources 30 2 Microsoft® Internet Explorer 5.5 35 2.1 Introduction to the Internet Explorer 5.5 Web Browser 36 2.2 Connecting to the Internet 36 2.3 Internet Explorer 5.5 Features 37 2.4 Searching the Internet 41 iw3htp2TOC.fm Page vii Monday, July 23, 2001 4:43 PM
  • 8. VIII 2.5 Online Help and Tutorials 42 2.6 Keeping Track of Favorite Sites 43 2.7 File Transfer Protocol (FTP) 44 2.8 Outlook Express and Electronic Mail 46 2.9 NetMeeting 49 2.10 MSN Messenger Service 55 2.11 Customizing Browser Settings 56 3 Photoshop® Elements 63 3.1 Introduction 64 3.2 Image Basics 64 3.3 Vector and Raster Graphics 74 3.4 Toolbox 75 3.4.1 Selection Tools 76 3.4.2 Painting Tools 80 3.4.3 Shape Tools 86 3.5 Layers 91 3.6 Screen Capturing 93 3.7 File Formats: GIF and JPEG 94 3.8 Internet and World Wide Web Resources 95 4 Introduction to XHTML: Part 1 101 4.1 Introduction 102 4.2 Editing XHTML 103 4.3 First XHTML Example 103 4.4 W3C XHTML Validation Service 106 4.5 Headers 108 4.6 Linking 109 4.7 Images 112 4.8 Special Characters and More Line Breaks 116 4.9 Unordered Lists 118 4.10 Nested and Ordered Lists 119 4.11 Internet and World Wide Web Resources 122 5 Introduction to XHTML: Part 2 127 5.1 Introduction 128 5.2 Basic XHTML Tables 128 5.3 Intermediate XHTML Tables and Formatting 131 5.4 Basic XHTML Forms 133 5.5 More Complex XHTML Forms 136 5.6 Internal Linking 143 5.7 Creating and Using Image Maps 146 5.8 meta Elements 148 5.9 frameset Element 150 5.10 Nested framesets 153 5.11 Internet and World Wide Web Resources 155 iw3htp2TOC.fm Page viii Monday, July 23, 2001 4:43 PM
  • 9. IX 6 Cascading Style Sheets™ (CSS) 161 6.1 Introduction 162 6.2 Inline Styles 162 6.3 Embedded Style Sheets 163 6.4 Conflicting Styles 166 6.5 Linking External Style Sheets 169 6.6 W3C CSS Validation Service 172 6.7 Positioning Elements 173 6.8 Backgrounds 176 6.9 Element Dimensions 178 6.10 Text Flow and the Box Model 180 6.11 User Style Sheets 185 6.12 Internet and World Wide Web Resources 189 7 JavaScript: Introduction to Scripting 194 7.1 Introduction 195 7.2 Simple Program: Printing a Line of Text in a Web Page 195 7.3 Another JavaScript Program: Adding Integers 203 7.4 Memory Concepts 208 7.5 Arithmetic 209 7.6 Decision Making: Equality and Relational Operators 212 7.7 JavaScript Internet and World Wide Web Resources 219 8 JavaScript: Control Structures 1 229 8.1 Introduction 230 8.2 Algorithms 230 8.3 Pseudocode 231 8.4 Control Structures 231 8.5 if Selection Structure 234 8.6 if/else Selection Structure 235 8.7 while Repetition Structure 240 8.8 Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) 241 8.9 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition) 245 8.10 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Structures) 251 8.11 Assignment Operators 255 8.12 Increment and Decrement Operators 256 8.13 Note on Data Types 259 8.14 JavaScript Internet and World Wide Web Resources 260 9 JavaScript: Control Structures II 271 9.1 Introduction 272 9.2 Essentials of Counter-Controlled Repetition 272 9.3 for Repetition Structure 275 9.4 Examples Using the for Structure 279 iw3htp2TOC.fm Page ix Monday, July 23, 2001 4:43 PM
  • 10. X 9.5 switch Multiple-Selection Structure 284 9.6 do/while Repetition Structure 289 9.7 break and continue Statements 291 9.8 Labeled break and continue Statements 294 9.9 Logical Operators 296 9.10 Summary of Structured Programming 301 10 JavaScript: Functions 315 10.1 Introduction 316 10.2 Program Modules in JavaScript 316 10.3 Programmer-Defined Functions 318 10.4 Function Definitions 318 10.5 Random-Number Generation 324 10.6 Example: Game of Chance 329 10.7 Duration of Identifiers 337 10.8 Scope Rules 338 10.9 JavaScript Global Functions 340 10.10 Recursion 341 10.11 Example Using Recursion: Fibonacci Series 345 10.12 Recursion vs. Iteration 349 10.13 JavaScript Internet and World Wide Web Resources 351 11 JavaScript: Arrays 365 11.1 Introduction 366 11.2 Arrays 366 11.3 Declaring and Allocating Arrays 368 11.4 Examples Using Arrays 369 11.5 References and Reference Parameters 376 11.6 Passing Arrays to Functions 377 11.7 Sorting Arrays 380 11.8 Searching Arrays: Linear Search and Binary Search 382 11.9 Multiple-Subscripted Arrays 388 11.10 JavaScript Internet and World Wide Web Resources 392 12 JavaScript: Objects 402 12.1 Introduction 403 12.2 Thinking About Objects 403 12.3 Math Object 405 12.4 String Object 407 12.4.1 Fundamentals of Characters and Strings 407 12.4.2 Methods of the String Object 407 12.4.3 Character Processing Methods 409 12.4.4 Searching Methods 411 12.4.5 Splitting Strings and Obtaining Substrings 413 12.4.6 XHTML Markup Methods 415 12.5 Date Object 417 12.6 Boolean and Number Objects 423 iw3htp2TOC.fm Page x Monday, July 23, 2001 4:43 PM
  • 11. XI 12.7 JavaScript Internet and World Wide Web Resources 424 13 Dynamic HTML: Object Model and Collections 435 13.1 Introduction 436 13.2 Object Referencing 436 13.3 Collections all and children 438 13.4 Dynamic Styles 441 13.5 Dynamic Positioning 444 13.6 Using the frames Collection 446 13.7 navigator Object 448 13.8 Summary of the DHTML Object Model 450 14 Dynamic HTML: Event Model 456 14.1 Introduction 457 14.2 Event onclick 457 14.3 Event onload 459 14.4 Error Handling with onerror 460 14.5 Tracking the Mouse with Event onmousemove 462 14.6 Rollovers with onmouseover and onmouseout 464 14.7 Form Processing with onfocus and onblur 468 14.8 More Form Processing with onsubmit and onreset 470 14.9 Event Bubbling 472 14.10 More DHTML Events 474 15 Dynamic HTML: Filters and Transitions 480 15.1 Introduction 481 15.2 Flip filters: flipv and fliph 482 15.3 Transparency with the chroma Filter 484 15.4 Creating Image masks 486 15.5 Miscellaneous Image filters: invert, gray and xray 487 15.6 Adding shadows to Text 489 15.7 Creating Gradients with alpha 491 15.8 Making Text glow 493 15.9 Creating Motion with blur 496 15.10 Using the wave Filter 499 15.11 Advanced Filters: dropShadow and light 501 15.12 Transitions I: Filter blendTrans 505 15.13 Transitions II: Filter revealTrans 509 16 Dynamic HTML: Data Binding with Tabular Data Control 517 16.1 Introduction 518 16.2 Simple Data Binding 519 16.3 Moving a Recordset 523 16.4 Binding to an img 526 16.5 Binding to a table 529 16.6 Sorting table Data 530 iw3htp2TOC.fm Page xi Monday, July 23, 2001 4:43 PM
  • 12. XII 16.7 Advanced Sorting and Filtering 533 16.8 Data Binding Elements 540 16.9 Internet and World Wide Web Resources 541 17 Dynamic HTML: Structured Graphics ActiveX Control 545 17.1 Introduction 546 17.2 Shape Primitives 546 17.3 Moving Shapes with Translate 550 17.4 Rotation 552 17.5 Mouse Events and External Source Files 554 17.6 Scaling 556 17.7 Internet and World Wide Web Resources 560 18 Dynamic HTML: Path, Sequencer and Sprite ActiveX Controls 564 18.1 Introduction 565 18.2 DirectAnimation Path Control 565 18.3 Multiple Path Controls 567 18.4 Time Markers for Path Control 570 18.5 DirectAnimation Sequencer Control 573 18.6 DirectAnimation Sprite Control 576 18.7 Animated GIFs 579 18.8 Internet and World Wide Web Resources 581 19 Macromedia® Flash™ : Building Interactive Animations 584 19.1 Introduction 585 19.2 Flash™ Movie Development 586 19.3 Learning Flash with Hands-on Examples 589 19.3.1 Creating a Shape With the Oval Tool 590 19.3.2 Adding Text to a Button 593 19.3.3 Converting a Shape into a Symbol 594 19.3.4 Editing Button Symbols 595 19.3.5 Adding Keyframes 597 19.3.6 Adding Sound to a Button 597 19.3.7 Verifying Changes with Test Movie 600 19.3.8 Adding Layers to a Movie 600 19.3.9 Animating Text with Tweening 602 19.3.10 Adding a Text Field 604 19.3.11 Adding ActionScript 605 19.4 Creating a Projector (.exe) File With Publish 608 19.5 Manually Embedding a Flash Movie in a Web Page 609 19.6 Creating Special Effects with Flash 610 19.6.1 Importing and Manipulating Bitmaps 610 19.6.2 Create an Advertisement Banner with Masking 611 19.6.3 Adding Online Help to Forms 613 19.7 Creating a Web-Site Introduction 622 iw3htp2TOC.fm Page xii Monday, July 23, 2001 4:43 PM
  • 13. XIII 19.8 ActionScript 627 19.9 Internet and World Wide Web Resources 628 20 Extensible Markup Language (XML) 633 20.1 Introduction 634 20.2 Structuring Data 635 20.3 XML Namespaces 641 20.4 Document Type Definitions (DTDs) and Schemas 643 20.4.1 Document Type Definitions 643 20.4.2 W3C XML Schema Documents 645 20.5 XML Vocabularies 648 20.5.1 MathML™ 648 20.5.2 Chemical Markup Language (CML) 652 20.5.3 Other Markup Languages 654 20.6 Document Object Model (DOM) 654 20.7 DOM Methods 655 20.8 Simple API for XML (SAX) 662 20.9 Extensible Stylesheet Language (XSL) 663 20.10 Microsoft BizTalk™ 670 20.11 Simple Object Access Protocol (SOAP) 671 20.12 Internet and World Wide Web Resources 672 21 Web Servers (IIS, PWS and Apache) 681 21.1 Introduction 682 21.2 HTTP Request Types 683 21.3 System Architecture 684 21.4 Client-Side Scripting versus Server-Side Scripting 685 21.5 Accessing Web Servers 686 21.6 Microsoft Internet Information Services (IIS) 687 21.7 Microsoft Personal Web Server (PWS) 690 21.8 Apache Web Server 692 21.9 Requesting Documents 692 21.9.1 XHTML 692 21.9.2 ASP 694 21.9.3 Perl 694 21.9.4 Python 695 21.9.5 PHP 697 21.10 Internet and World Wide Web Resources 698 22 Database: SQL, MySQL, DBI and ADO 702 22.1 Introduction 703 22.2 Relational Database Model 704 22.3 Relational Database Overview 705 22.4 Structured Query Language 709 22.4.1 Basic SELECT Query 710 22.4.2 WHERE Clause 711 22.4.3 GROUP BY Clause 713 iw3htp2TOC.fm Page xiii Monday, July 23, 2001 4:43 PM
  • 14. XIV 22.4.4 ORDER BY Clause 714 22.4.5 Merging Data from Multiple Tables 715 22.4.6 Inserting a Record 718 22.4.7 Updating a Record 719 22.4.8 DELETE FROM Statement 720 22.4.9 TitleAuthor Query from Books.mdb 720 22.5 MySQL 723 22.6 Introduction to DBI 723 22.6.1 Perl Database Interface 724 22.6.2 Python DB-API 724 22.6.3 PHP dbx module 725 22.7 ActiveX Data Objects (ADO) 725 22.8 Internet and World Wide Web Resources 727 23 Wireless Internet and m-Business 734 23.1 Introduction 735 23.2 M-Business 736 23.3 Identifying User Location 736 23.3.1 E911 Act 737 23.3.2 Location-Identification Technologies 737 23.4 Wireless Marketing, Advertising and Promotions 738 23.5 Wireless Payment Options 740 23.6 Privacy and the Wireless Internet 741 23.7 International Wireless Communications 742 23.8 Wireless-Communications Technologies 743 23.9 WAP and WML 744 23.10 Phone Simulator and Setup Instructions 745 23.11 Creating WML Documents 746 23.12 WMLScript Programming 753 23.13 String Object Methods 760 23.14 Wireless Protocols, Platforms and Programming Languages 770 23.14.1 WAP 2.0 770 23.14.2 Handheld Devices Markup Languages (HDML) 771 23.14.3 Compact HTML (cHTML) and i-mode 771 23.14.4 Java and Java 2 Micro Edition (J2ME) 771 23.14.5 Binary Run-Time Environment for Wireless (BREW) 772 23.14.6 Bluetooth Wireless Technology 772 23.15 Internet and World Wide Web Resources 773 24 VBScript 783 24.1 Introduction 784 24.2 Operators 784 24.3 Data Types and Control Structures 787 24.4 VBScript Functions 791 24.5 VBScript Example Programs 795 24.6 Arrays 803 24.7 String Manipulation 807 iw3htp2TOC.fm Page xiv Monday, July 23, 2001 4:43 PM
  • 15. XV 24.8 Classes and Objects 811 24.9 Operator Precedence Chart 820 24.10 Internet and World Wide Web Resources 820 25 Active Server Pages (ASP) 831 25.1 Introduction 832 25.2 How Active Server Pages Work 832 25.3 Setup 833 25.4 Active Server Page Objects 833 25.5 Simple ASP Examples 834 25.6 File System Objects 839 25.7 Session Tracking and Cookies 849 25.8 Accessing a Database from an Active Server Page 859 25.9 Server-Side ActiveX Components 870 25.10 Internet and World Wide Web Resources 878 26 Case Study: Active Server Pages and XML 884 26.1 Introduction 885 26.2 Setup and Message Forum Documents 885 26.3 Forum Navigation 886 26.4 Adding Forums 889 26.5 Forum XML Documents 894 26.6 Posting Messages 898 26.7 Other Documents 902 26.8 Internet and World Wide Web Resources 906 27 Perl and CGI (Common Gateway Interface) 908 27.1 Introduction 909 27.2 Perl 910 27.3 String Processing and Regular Expressions 916 27.4 Viewing Client/Server Environment Variables 921 27.5 Form Processing and Business Logic 924 27.6 Server-Side Includes 930 27.7 Verifying a Username and Password 934 27.8 Using DBI to Connect to a Database 939 27.9 Cookies and Perl 945 27.10 Operator Precedence Chart 950 27.11 Internet and World Wide Web Resources 950 28 Python 962 28.1 Introduction 963 28.1.1 First Python Program 963 28.1.2 Python Keywords 965 28.2 Basic Data Types, Control Structures and Functions 965 28.3 Tuples, Lists and Dictionaries 969 28.4 String Processing and Regular Expressions 974 28.5 Exception Handling 979 28.6 Introduction to CGI Programming 981 iw3htp2TOC.fm Page xv Monday, July 23, 2001 4:43 PM
  • 16. XVI 28.7 Form Processing and Business Logic 983 28.8 Cookies 989 28.9 Database Application Programming Interface (DB-API) 994 28.9.1 Setup 994 28.9.2 Simple DB-API Program 994 28.10 Operator Precedence Chart 999 28.11 Internet and World Wide Web Resources 1000 29 PHP 1008 29.1 Introduction 1009 29.2 PHP 1010 29.3 String Processing and Regular Expressions 1019 29.4 Viewing Client/Server Environment Variables 1024 29.5 Form Processing and Business Logic 1026 29.6 Verifying a Username and Password 1031 29.7 Connecting to a Database 1039 29.8 Cookies 1043 29.9 Operator Precedence 1048 29.10 Internet and World Wide Web Resources 1048 30 Servlets 1056 30.1 Introduction 1057 30.2 Servlet Overview and Architecture 1059 30.2.1 Interface Servlet and the Servlet Life Cycle 1060 30.2.2 HttpServlet Class 1062 30.2.3 HttpServletRequest Interface 1063 30.2.4 HttpServletResponse Interface 1064 30.3 Handling HTTP get Requests 1064 30.3.1 Setting Up the Apache Tomcat Server 1069 30.3.2 Deploying a Web Application 1071 30.4 Handling HTTP get Requests Containing Data 1076 30.5 Handling HTTP post Requests 1079 30.6 Redirecting Requests to Other Resources 1082 30.7 Session Tracking 1086 30.7.1 Cookies 1087 30.7.2 Session Tracking with HttpSession 1095 30.8 Multi-tier Applications: Using JDBC from a Servlet 1103 30.8.1 Configuring animalsurvey Database and SurveyServlet 1109 30.9 HttpUtils Class 1111 30.10 Internet and World Wide Web Resources 1111 31 JavaServer Pages (JSP) 1119 31.1 Introduction 1120 31.2 JavaServer Pages Overview 1121 31.3 A First JavaServer Page Example 1122 31.4 Implicit Objects 1124 31.5 Scripting 1125 iw3htp2TOC.fm Page xvi Monday, July 23, 2001 4:43 PM
  • 17. XVII 31.5.1 Scripting Components 1126 31.5.2 Scripting Example 1127 31.6 Standard Actions 1130 31.6.1 <jsp:include> Action 1131 31.6.2 <jsp:forward> Action 1135 31.6.3 <jsp:plugin> Action 1139 31.6.4 <jsp:useBean> Action 1143 31.7 Directives 1160 31.7.1 page Directive 1160 31.7.2 include Directive 1162 31.8 Custom Tag Libraries 1164 31.8.1 Simple Custom Tag 1165 31.8.2 Custom Tag with Attributes 1169 31.8.3 Evaluating the Body of a Custom Tag 1173 31.9 World Wide Web Resources 1179 32 e-Business & e-Commerce 1186 32.1 Introduction 1188 32.2 E-Business Models 1189 32.2.1 Storefront Model 1189 32.2.2 Shopping-Cart Technology 1190 32.2.3 Auction Model 1191 32.2.4 Portal Model 1194 32.2.5 Name-Your-Price Model 1195 32.2.6 Comparison-Pricing Model 1195 32.2.7 Demand-Sensitive Pricing Model 1195 32.2.8 Bartering Model 1195 32.3 Building an e-Business 1196 32.4 e-Marketing 1197 32.4.1 Branding 1197 32.4.2 Marketing Research 1197 32.4.3 e-Mail Marketing 1197 32.4.4 Promotions 1198 32.4.5 Consumer Tracking 1198 32.4.6 Electronic Advertising 1198 32.4.7 Search Engines 1199 32.4.8 Affiliate Programs 1199 32.4.9 Public Relations 1200 32.4.10 Customer Relationship Management (CRM) 1200 32.5 Online Payments 1201 32.5.1 Credit-Card Payment 1201 32.5.2 Digital Cash and e-Wallets 1201 32.5.3 Micropayments 1201 32.5.4 Smart Cards 1202 32.6 Security 1202 32.6.1 Public-Key Cryptography 1203 32.6.2 Secure Sockets Layer (SSL) 1205 iw3htp2TOC.fm Page xvii Monday, July 23, 2001 4:43 PM
  • 18. XVIII 32.6.3 WTLS 1207 32.6.4 IPSec and Virtual Private Networks (VPN) 1207 32.6.5 Security Attacks 1208 32.6.6 Network Security 1208 32.7 Legal Issues 1209 32.7.1 Privacy 1209 32.7.2 Defamation 1209 32.7.3 Sexually Explicit Speech 1210 32.7.4 Copyright and Patents 1210 32.8 XML and e-Commerce 1211 32.9 Internet and World Wide Web Resources 1212 33 Multimedia: Audio, Video, Speech Synthesis and Recognition 1223 33.1 Introduction 1224 33.2 Audio and Video 1225 33.3 Adding Background Sounds with the bgsound Element 1225 33.4 Adding Video with the img Element’s dynsrc Property 1228 33.5 Adding Audio or Video with the embed Element 1230 33.6 Using the Windows Media Player ActiveX Control 1232 33.7 Microsoft® Agent Control 1236 33.8 RealPlayer™ Plug-in 1249 33.9 Synchronized Multimedia Integration Language (SMIL) 1252 33.10 Scalable Vector Graphics (SVG) 1254 33.11 Internet and World Wide Web Resources 1259 34 Accessibility 1267 34.1 Introduction 1268 34.2 Web Accessibility 1268 34.3 Web Accessibility Initiative 1269 34.4 Providing Alternatives for Images 1271 34.5 Maximizing Readability by Focusing on Structure 1272 34.6 Accessibility in XHTML Tables 1272 34.7 Accessibility in XHTML Frames 1276 34.8 Accessibility in XML 1277 34.9 Using Voice Synthesis and Recognition with VoiceXML™ 1277 34.10 CallXML™ 1284 34.11 JAWS® for Windows 1289 34.12 Other Accessibility Tools 1291 34.13 Accessibility in Microsoft® Windows® 2000 1292 34.13.1 Tools for People with Visual Impairments 1294 34.13.2 Tools for People with Hearing Impairments 1296 34.13.3 Tools for Users Who Have Difficulty Using the Keyboard 1296 34.13.4 Microsoft Narrator 1302 34.13.5 Microsoft On-Screen Keyboard 1303 34.13.6 Accessibility Features in Microsoft Internet Explorer 5.5 1304 iw3htp2TOC.fm Page xviii Monday, July 23, 2001 4:43 PM
  • 19. XIX 34.14 Internet and World Wide Web Resources 1305 A XHTML Special Characters 1313 B Operator Precedence Chart 1314 C ASCII Character Set 1316 D Number Systems 1317 D.1 Introduction 1318 D.2 Abbreviating Binary Numbers as Octal Numbers and Hexadecimal Numbers 1321 D.3 Converting Octal Numbers and Hexadecimal Numbers to Binary Numbers 1322 D.4 Converting from Binary, Octal, or Hexadecimal to Decimal 1322 D.5 Converting from Decimal to Binary, Octal, or Hexadecimal 1323 D.6 Negative Binary Numbers: Two’s Complement Notation 1325 E XHTML Colors 1330 F Career Opportunities 1333 F.1 Introduction 1334 F.2 Resources for the Job Seeker 1335 F.3 Online Opportunities for Employers 1336 F.3.1 Posting Jobs Online 1338 F.3.2 Problems with Recruiting on the Web 1340 F.3.3 Diversity in the Workplace 1340 F.4 Recruiting Services 1341 F.4.1 Testing Potential Employees Online 1342 F.5 Career Sites 1343 F.5.1 Comprehensive Career Sites 1343 F.5.2 Technical Positions 1344 F.5.3 Wireless Positions 1345 F.5.4 Contracting Online 1345 F.5.5 Executive Positions 1346 F.5.6 Students and Young Professionals 1347 F.5.7 Other Online Career Services 1348 F.6 Internet and World Wide Web Resources 1349 G Unicode® 1357 G.1 Introduction 1358 G.2 Unicode Transformation Formats 1359 G.3 Characters and Glyphs 1360 G.4 Advantages/Disadvantages of Unicode 1360 G.5 Unicode Consortium’s Web Site 1361 G.6 Using Unicode 1362 G.7 Character Ranges 1366 Bibliography 1370 Index 1372 iw3htp2TOC.fm Page xix Monday, July 23, 2001 4:43 PM
  • 20. Preface Live in fragments no longer. Only connect. Edward Morgan Forster Welcome to the exciting world of Internet and World Wide Web programming. This book is by an old guy and two young guys. The old guy (HMD; Massachusetts Institute of Tech- nology 1967) has been programming and/or teaching programming for 40 years. The two young guys (PJD; MIT 1991 and TRN; MIT 1992) have been programming and/or teaching programming for over 20 years. The old guy programs and teaches from experience; the young guys do so from an inexhaustible reserve of energy. The old guy wants clarity; the young guys want performance. The old guy seeks elegance and beauty; the young guys want results. We got together to produce a book we hope you will find informative, chal- lenging and entertaining. The explosion and popularity of the Internet and the World Wide Web creates tremen- dous challenges for us as authors, for our publisher—Prentice Hall, for instructors, for stu- dents and for professionals. The World Wide Web increases the prominence of the Internet in information systems, strategic planning and implementation. Organizations want to integrate the Internet “seam- lessly” into their information systems and the World Wide Web offers endless opportunity to do so. New Features in Internet & World Wide Web How to Program: Second Edition This edition contains many new features and enhancements including: • Full-Color Presentation. The book enhances LIVE-CODE ™ examples by using full color. Readers see sample outputs as they would appear on a color monitor. We have syntax colored all the code examples, as many of today’s development envi- ronments do. Our syntax-coloring conventions are as follows: iw3htp2_preface.fm Page xli Wednesday, July 25, 2001 5:04 PM
  • 21. XLII Preface Appendix comments appear in green keywords appear in dark blue literal values appear in light blue XHTML text and scripting text appear in black ASP and JSP delimiters appear in red • XHTML. This edition uses XHTML as the primary means of describing Web con- tent. The World Wide Web Consortium deprecated the use of HTML 4 and replaced it with XHTML 1.0 (Extensible Hypertext Markup Language). XHTML is derived from XML (Extensible Markup Language), which allows Web developers to create their own tags and languages. XHTML is replacing HTML as the standard for mark- ing up Web content because it is more robust and offers more features. • Chapter 19, Macromedia® Flash.™ Flash is a cutting-edge multimedia applica- tion that enables Web developers to create interactive, animated content. Through hands-on examples, we show how to add interactivity, sound and animation to Web sites while teaching the fundamentals of Flash and ActionScript—Flash’s scripting language. The chapter examples include creating interactive buttons, an- imated banners and animated splash screens (called animation pre-loaders). • Chapter 20, Extensible Markup Language (XML). Throughout the book we em- phasize XHTML, which derived from XML and HTML. XML derives from SGML (Standardized General Markup Language), whose sheer size and complex- ity limits its use beyond heavy-duty, industrial-strength applications. XML is a technology created by the World Wide Web Consortium for describing data in a portable format. XML is an effort to make SGML-like technology available to a much broader community. XML is a condensed subset of SGML with additional features for usability. Document authors use XML’s extensibility to create entire- ly new markup languages for describing specific types of data, including mathe- matical formulas, chemical molecular structures and music. Markup languages created with XML include XHTML (Chapters 4 and 5), MathML (for mathemat- ics), VoiceXML™ (for speech), SMIL™ (the Synchronized Multimedia Integra- tion Language for multimedia presentations), CML (Chemical Markup Language for chemistry) and XBRL (Extensible Business Reporting Language for financial data exchange). • Chapter 23, Wireless Internet and m-Business. We introduce the impact of wire- less communications on individuals and businesses. The chapter then explores wireless devices and communications technologies and introduces wireless pro- gramming. The Wireless Application Protocol (WAP) is designed to enable differ- ent kinds of wireless devices to communicate and access the Internet using the Wireless Markup Language (WML). WML tags mark up a Web page to specify how to format a page on a wireless device. WMLScript helps WAP applications “come alive” by allowing a developer to manipulate WML document content dy- namically. In addition to WAP/WML, we explore various platforms and program- ming languages on the client, such as Java 2 Micro Edition (J2ME), Qualcomm’s Binary Runtime Environment for Wireless (BREW), the enormously popular Japa- nese i-mode service, Compact HyperText Markup Language (cHTML) and Blue- tooth™ wireless technology. iw3htp2_preface.fm Page xlii Wednesday, July 25, 2001 5:04 PM
  • 22. Appendix Preface XLIII • Server-Side Technology. We present condensed treatments of six popular Internet/ Web programming languages for building the server side of Internet- and Web- based client/server applications. In Chapters 25 and 26, we discuss Active Server Pages (ASP)—Microsoft’s technology for server-side scripting. In Chapter 27, we introduce Perl, an open-source scripting language for programming Web-based ap- plications. In Chapters 28 and 29, we introduce Python and PHP—two emerging, open-source scripting languages. In Chapters 30 and 31, we provide two bonus chapters for Java programmers on Java™ servlets and JavaServer Pages™ (JSP). • Chapter 34, Accessibility. Currently, the World Wide Web presents many chal- lenges to people with disabilities. Individuals with hearing and visual impairments have difficulty accessing multimedia-rich Web sites. To rectify this situation, the World Wide Web Consortium (W3C) launched the Web Accessibility Initiative (WAI), which provides guidelines for making Web sites accessible to people with disabilities. This chapter provides a description of these guidelines. We also intro- duce VoiceXML and CallXML, two technologies for increasing the accessibility of Web-based content. • Appendix F, Career Opportunities. This detailed appendix introduces career ser- vices on the Internet. We explore online career services from the employer and em- ployee’s perspective. We suggest sites on which you can submit applications, search for jobs and review applicants (if you are interested in hiring people). We also re- view services that build recruiting pages directly into e-businesses. One of our re- viewers told us that he had just gone through a job search largely using the Internet and this chapter would have expanded his search dramatically. • Appendix G, Unicode. This appendix overviews the Unicode Standard. As com- puter systems evolved worldwide, computer vendors developed numeric repre- sentations of character sets and special symbols for the local languages spoken in different countries. In some cases, different representations were developed for the same languages. Such disparate character sets made communication between computer systems difficult. XML and XML-derived languages, such as XHTML, support the Unicode Standard (maintained by a non-profit organization called the Unicode Consortium), which defines a single character set with unique numeric values for characters and special symbols in most spoken languages. This appen- dix discusses the Unicode Standard, overviews the Unicode Consortium Web site (unicode.org) and shows an XML example that displays “Welcome to Uni- code!” in ten different languages! Some Notes to Instructors Why We Wrote Internet & World Wide Web How to Program: Second Edition Dr. Harvey M. Deitel taught introductory programming courses in universities for 20 years with an emphasis on developing clearly written, well-designed programs. Much of what is taught in these courses are the basic principles of programming with an emphasis on the effective use of control structures and functionalization. We present these topics in Internet & World Wide Web How to Program: Second Edition, the way HMD has done in his uni- versity courses. Students are highly motivated by the fact that they are learning six leading- iw3htp2_preface.fm Page xliii Wednesday, July 25, 2001 5:04 PM
  • 23. XLIV Preface Appendix edge scripting languages (JavaScript, VBScript, Perl, Python, PHP and Flash ActionScript) and a leading-edge programming paradigm (object-based programming). We also teach Dynamic HTML, a means of adding “dynamic content” to World Wide Web pages. Instead of Web pages with only text and static graphics, Web pages “come alive” with audios, vid- eos, animations, interactivity and three-dimensional moving images. Dynamic HTML’s features are precisely what businesses and organizations need to meet today’s information processing requirements. These programming languages will be useful to students imme- diately as they leave the university environment and head into a world in which the Internet and the World Wide Web have massive prominence. Focus of the Book Our goal was clear: produce a textbook for introductory university-level courses in com- puter programming for students with little or no programming experience, yet offer the depth and rigorous treatment of theory and practice demanded by traditional, upper-level programming courses and professionals. To meet this goal, we produced a comprehensive book that teaches the principles of control structures, object-based programming, various markup languages (XHTML, Dynamic HTML and XML) and scripting languages such as JavaScript, VBScript, Perl, Python, PHP and Flash ActionScript. After mastering the ma- terial in this book, students entering upper-level programming courses and industry will be well prepared to take advantage of the Internet and the Web. Using Color to Enhance Pedagogy and Clarity We have emphasized color throughout the book. The World Wide Web is a colorful, multi- media-intensive medium. It appeals to our visual and audio senses. Someday it may even ap- peal to our senses of touch, taste and smell! We suggested to our publisher, Prentice Hall, that they publish this book in color. The use of color is crucial to understanding and appreciating many of the programs we present. Almost from its inception, the Web has been a color-inten- sive medium. We hope it helps you develop more appealing Web-based applications. Web-Based Applications Development Many books about the Web concentrate on developing attractive Web pages. We discuss Web-page design intensely. But more importantly, the key focus of this book is on Web- based applications development. Our audiences want to build real-world, industrial-strength, Web-based applications. These audiences care about good looking Web pages, but they also care about client/server systems, databases, distributed computing, etc. Many books about the Web are reference manuals with exhaustive listings of features. That is not our style. We con- centrate on creating real applications. We provide the LIVE-CODE™ examples on the CD ac- companying this book (and at www.deitel.com) so that you can run the applications and see and hear the multimedia outputs. You can interact with our game and art programs. The Web is an artist’s paradise. Your creativity is your only limitation. However, the Web con- tains so many tools and mechanisms to leverage your abilities that even if you are not artisti- cally inclined, you can create stunning output. Our goal is to help you master these tools so that you can maximize your creativity and development abilities. Multimedia-Intensive Communications People want to communicate. Sure, they have been communicating since the dawn of civ- ilization, but computer communications have been limited mostly to digits, alphabetic char- iw3htp2_preface.fm Page xliv Wednesday, July 25, 2001 5:04 PM
  • 24. Appendix Preface XLV acters and special characters. The next major wave of communication technology is multimedia. People want to transmit pictures and they want those pictures to be in color. They want to transmit voices, sounds and audio clips. They want to transmit full-motion color video. At some point, they will insist on three-dimensional, moving-image transmis- sion. Our current flat, two-dimensional televisions eventually will be replaced with three- dimensional versions that turn our living rooms into “theaters-in-the-round.” Actors will perform their roles as if we were watching live theater. Our living rooms will be turned into miniature sports stadiums. Our business offices will enable video conferencing among col- leagues half a world apart, as if they were sitting around one conference table. The possi- bilities are intriguing, and the Internet is sure to play a key role in making many of these possibilities become reality. Dynamic HTML and Flash ActionScript are means of adding “dynamic content” to World Wide Web pages. Instead of Web pages with only text and static graphics, Web pages “come alive” with audios, videos, animations, interactivity and three-dimensional imaging. Dynamic HTML’s and Flash ActionScript’s features are pre- cisely what businesses and organizations need to meet today’s multimedia-communica- tions requirements. There have been predictions that the Internet will eventually replace the telephone system. Why stop there? It could also replace radio and television as we know them today. It is not hard to imagine the Internet and the World Wide Web replacing news- papers with electronic news media. Many newspapers and magazines already offer Web- based versions, some fee based and some free. Increased bandwidth makes it possible to stream audio and video over the Web. Both companies and individuals run their own Web- based radio and television stations. Just a few decades ago, there were only a few television stations. Today, standard cable boxes accommodate about 100 stations. In a few more years, we will have access to thousands of stations broadcasting over the Web worldwide. This textbook may someday appear in a museum alongside radios, TVs and newspapers in an “early media of ancient civilization” exhibit. Teaching Approach Internet & World Wide Web How to Program: Second Edition contains a rich collection of examples, exercises and projects drawn from many fields to provide the student with a chance to solve interesting real-world problems. The book concentrates on the principles of good software engineering and stresses program clarity. We avoid arcane terminology and syntax specifications in favor of teaching by example. The book is written by educators who spend much of their time teaching edge-of-the-practice topics in industry classrooms. The text emphasizes good pedagogy. LIVE-CODE™ Teaching Approach The book is loaded with hundreds of LIVE-CODE™ examples. This is how we teach and write about programming, and is the focus of each of our multimedia Cyber Classrooms as well. Each new concept is presented in the context of a complete, working example immediately followed by one or more windows showing the example’s input/output dialog. We call this style of teaching and writing our LIVE-CODE™ approach. We use the language to teach the language. Reading these examples is much like entering and running them on a computer. Internet & World Wide Web How to Program: Second Edition “jumps right in” with XHTML in Chapter 4, then rapidly proceeds with programming in JavaScript, Microsoft’s Dynamic HTML, XML, VBScript/ASP, Perl, Python, PHP, Flash ActionScript, Java Serv- iw3htp2_preface.fm Page xlv Wednesday, July 25, 2001 5:04 PM
  • 25. XLVI Preface Appendix lets and JavaServer Pages. Many students wish to “cut to the chase;” there is great stuff to be done in these languages so let’s get to it! Web programming is not trivial by any means, but it is fun, and students can see immediate results. Students can get graphical, animated, multimedia-based, audio-intensive, database-intensive, network-based programs running quickly through “reusable components.” They can implement impressive projects. They can be more creative and productive in a one- or two-semester course than is possible in introductory courses taught in conventional programming languages, such as C, C++, Visual Basic and Java. [Note: This book includes Java Servlets and JavaServer Pages as “bonus chapters;” it does not teach the fundamentals of Java programming. Readers who want to learn Java may want to consider reading our book, Java How to Program: Fourth Edition. Readers who desire a deeper, more developer-oriented treatment of Java may want to consider reading our book, Advanced Java 2 Platform How to Program.] World Wide Web Access All the code for Internet & World Wide Web How to Program: Second Edition (and our other publications) is on the Internet free for download at the Deitel & Associates, Inc. Web site www.deitel.com Please download all the code, then run each program as you read the text. Make changes to the code examples and immediately see the effects of those changes. A great way to learn programming is by programming. [Note: You must respect the fact that this is copyrighted material. Feel free to use it as you study, but you may not republish any portion of it in any form without explicit permission from Prentice Hall and the authors.] Objectives Each chapter begins with a statement of Objectives. This tells students what to expect and gives students an opportunity, after reading the chapter, to determine if they have met these objectives. This is a confidence builder and a source of positive reinforcement. Quotations The learning objectives are followed by quotations. Some are humorous, some are philo- sophical and some offer interesting insights. Our students enjoy relating the quotations to the chapter material. Many of the quotations are worth a “second look” after reading the chapter. Outline The chapter Outline helps the student approach the material in top-down fashion. This, too, helps students anticipate what is to come and set a comfortable and effective learning pace. 15,836 Lines of Code in 311 Example LIVE-CODE™ Programs (with Program Outputs) Each program is followed by the outputs produced when the document is rendered and its scripts are executed. This enables the student to confirm that the programs run as expected. Reading the book carefully is much like entering and running these programs on a comput- er. The programs range from just a few lines of code to substantial examples with several hundred lines of code. Students should run each program while studying that program in the text. The examples are available on the CD and at our Deitel (www.deitel.com) and Prentice Hall Web sites (www.prenhall.comdeitel). iw3htp2_preface.fm Page xlvi Wednesday, July 25, 2001 5:04 PM
  • 26. Other documents randomly have different content
  • 27. When, with faltering steps, he at length reached the village, it was to find the whole place in a tumult. Every canoe was afloat; a couple of whale-boats were scouring the outer bay; and the malae, usually so deserted on a hot afternoon, was overrun by an excited throng. Had he not, then, heard the news? It was thought that the Helper had been drowned that morning, and the boats were now searching for his body! Behold, here were the unfortunate’s clothes, found even as they were, and by order of the chief left untouched for the priest himself to see; here, too, was old Lefao, the shrill mother of Pa’a, who had seen the young man go in to his death, and had heard his sinking cry. “Lefao, make for his Excellency a repetition of that mournful sound, and show how he cast up his arms as thou watchedst him from the beach.” The old impostor was enjoying all the importance of having such a tale to tell, and the father winced under a pang of shame as he listened to this unexpected confederate. It was afterwards thought that the sad affair must have unhinged Father Studby’s mind, for he subsequently began to show symptoms of serious mental disturbance, which culminated a few months later in his tragic suicide. A marble pillar, the outcome of a public subscription in Sydney, was raised to the memory of these two martyrs of the cross. In faded letters, beneath their crumbling names, one can still spell out the lies: IN LIFE THEY WERE TOGETHER; IN DEATH THEY WERE NOT DIVIDED.
  • 29. A AMATUA’S SAILOR MATUA was running down a beautifully shaded road as fast as his little legs would carry him, and close in chase, like a hawk after a sparrow, was a grizzled man-of-war’s-man with a switch. The road was long and straight; on both sides it was bordered by prickly hedges bright with limes, and as impenetrable as a tangle of barbed wire. At every step the white man gained on the boy, until the latter could hear the hoarse, angry breath of his pursuer. Amatua stopped short, and before he could even so much as turn he found himself in a grip of iron. Whish, whish, whish! dashed the switch on his bare back and legs, keen and stinging like the bite of fire-ants. It took all the little fellow’s manliness to keep him from bellowing aloud. The tears sprang to his eyes,—even the son of a chief is human like the rest of us,—but he would not cry. “What’s all this?” rang out a voice, as a white man reined in his horse beside them—a tall man in spectacles, who spoke with an air of authority. The sailor touched his hat. “Why, sir, you’d scarcely believe it,” he said, “the fuss I’ve had with this young savage! First he tried to lose me in the woods. I didn’t think nothing of that; but when he got me into a river for a swim, and then made off with my clothes, and hid ’em under a tree—I might have been looking for ’em yet, me that must be aboard my ship at twelve o’clock. Why, it might have cost me my stripe! I tell you, I never dreamed of such a thing, for me and Am have been friends ever since the first day I came ashore. He’s no better than a treacherous little what-d’ye-call-’em!” “The chief says thou hidst his clothes,” said the stranger, in the native language. “He says thou triedst to lose him in the woods.” “Ask him if I haven’t always been a good friend to him,” said the sailor. “Ask him who gave him the knife with the lanyard, and who
  • 30. made him the little spear to jug fish on the reef. Just you ask him that, sir.” “Your Highness,” said Amatua, in his own tongue, “Bill doesn’t understand. I love Bill, and I don’t want him to drown. I want to save Bill’s high-chief life.” “And so thou hidst Bill’s clothes,” said the stranger. “That was a fine way to help him!” “Be not angry,” said Amatua. “Great is the wisdom of white chiefs in innumerable things, but there are some little, common, worthless things that they don’t understand at all.” “Tell him I’m a leading seaman, sir,” went on Bill, who of course understood not a word of what Amatua was saying, and whose red, tired face still showed his indignation. “The old women say that a great evil is about to befall us,” said Amatua, gravely, entirely disregarding Bill. “Everybody is talking of it, your Highness, even the wise minister from Malua College, Toalua, whose wisdom is like that of Solomon. There’s to be a storm from the north—a storm that will break the ships into ten thousand pieces, and line the beach with dead. Last night I could not sleep for thinking of Bill. Then I said to myself, ‘I will lose Bill for two days in the woods, and then he won’t be drowned at all.’ But Bill is wise, and made the sun guide him back to the right road. Then I made Bill bathe, and tried to steal his clothes. But Bill looked and looked and looked, and when he found them he thought I was a very bad boy.” The stranger laughed, and translated all this long explanation to Bill. “Goodness gracious!” said Bill. “Do you mean that the kid believes this fool superstition, and was trying to save me from the wreck?” “That’s it,” said the stranger. “I’ve known Amatua for a long time, and I think he’s a pretty square boy.” “Why, bless his little heart,” said the sailor, catching up the boy in his arms, “I might have known he couldn’t mean no harm! I tell you, we’ve been like father and son, me and Am has, up to this little
  • 31. picnic. But just you say to him, sir, that, storm or no storm, Bill’s place is the post of duty, and that he’d rather die there than live to be disgraced.” But the white man had other work to do than translating for Bill and Amatua. He rode off and left them to trudge along on foot. Half an hour later they reached the beach, and saw the ships-of-war tugging heavily at their anchors. The weather looked dark and threatening, and a leaden surf was pounding the outer reefs. It appeared no easy matter to get Bill into the boat that was awaiting him, for she was full of men bound for the ship, and difficult to manage in the ebb and sweep of the seas. Bill’s face grew stern as he stared before him. He walked to the end of the wharf, and took a long, hawk-like look to seaward, never heeding the shaking woodwork nor the breakers that wet him to the knees. There was something ominous to Amatua in the sight of those deep-rolling ships and the piercing brightness of their ensigns and signal-flags. He was troubled, too, to see Bill so reckless in wetting his beautiful blue trousers and reducing his sliding feet, as the natives call shoes, his lovely patent-leather, silk-laced se’evae, to a state of pulp. He tried to draw him back, and pointed to the shoes as a receding wave left them once more to view. But Bill only laughed,—not one of his big hearty laughs, but the ghost of a laugh,—and a queer look came into his blue eyes. He walked slowly back to the boat, which was still rising and falling beside the wharf with its load of silent men. Suddenly he ran his hand into his pocket, and almost before Amatua could realise what it all meant, he felt Bill’s watch in his hand, and a round heavy thing that was unmistakably a dollar, and something soft and silken that could be nothing else than the sailor’s precious handkerchief. A second later Bill was in the boat, the tiller under his arm, while a dozen backs bent to drive him seaward. Amatua stood on the wharf and cried. He forgot the watch and the dollar and the silk handkerchief; he thought only of Bill,—his friend Bill,—the proud chief who would rather die at his post than find a coward’s place on shore. “Come back, Bill,” he cried, as he ran out to the end of the wharf, never caring for the waves that were dashing higher and higher. But the boat held on her
  • 32. course, dipping into the seas or rising like a storm-bird on some cresting comber until she vanished at last behind the towering Trenton. Amatua did not sob for long. He was a practical boy, and knew that it could not help Bill,—poor Bill!—who already had all the salt water he cared about. So Amatua made his way back to land, and sought out a quiet spot where he could look at his new treasure and calculate on the most profitable way of spending his dollar. You could not say that the dollar burned a hole in his pocket, for Amatua did not use pockets, and his only clothes consisted of a little strip of very dingy cotton; but he was just as anxious to spend it as an American boy with ten pockets. First he looked at the watch. It was a lovely watch. It was none of your puny watches such as white ladies wear, but a thumping big chief of a watch, thick and heavy, with a tick like a missionary clock. It was of shining silver, and the back of it was all engraved and carved with ships and dolphins. Bill had shown it to him a hundred times when they had strolled about the town, or had gone, hand in hand, in search of many a pleasant adventure. It brought the tears to Amatua’s eyes to recall it all, and he pushed the watch aside to have a look at the handkerchief. This was another old friend. It was of the softest, thickest silk, such as girls delight in, all red and green and blue and yellow, like the colours of a rainbow. There was nothing small about Bill. Even the dollar seemed bigger and fatter than any Amatua had seen; but then it must be remembered that dollars had seldom come his way. Oh, that dollar! How was he to spend it so that it would reach as far as two dollars? —a financial problem every one has had to grapple with at some time or another. He was well up in the price of hardtack. The price fluctuated in Apia —all the way from twelve for a quarter up to eighteen for a quarter. Quality did not count; at any rate, Amatua was not one of those boys who mind a little mustiness in their hardtack, or that slight suspicion of rancid whale-oil which is a characteristic of the cheaper article. Hardtack was hardtack, and eighteen were better than twelve. Here
  • 33. was one quarter gone, and hardtack made way for soap. Yes, he must have soap. Even yesterday old Lu’au had said: “War is a terrible thing. It makes one’s heart shake like a little mouse in one’s body. But lack of soap is worse than war. You can get used to war; but who ever got used to going without soap?” Yes, there must be soap to gladden old Lu’au. This meant another quarter. As to the third purchase there could be no manner of doubt; some ’ava, the white, dry root which, pounded in water and strained by the dexterous use of a wisp of fibre, supplies the Samoan for the lack of every comfort. Oh, how the ’ava would rejoice his father in those dismal woods, where he lay with the famishing army, bearing hunger, cold, and misery with uncomplaining fortitude. And it should be none of that dusty, spotted stuff that so many traders sell to unknowing whites, or natives in a hurry, but the white ’ava from Vaea, which grows the very finest in the South Seas. And the last quarter? How was that to go? Was it to be a new lava lava, or a white singlet, or two rusty cans of salmon, or some barrel beef? Amatua would have dearly loved some marbles; but in the depressed state of the family’s finances these were not to be thought of. The beef was the thing; the strong, rank beef that comes in barrels; you could get a slab of it for a quarter, and Latapie, the French trader, would give you a box of matches besides, or a few fish-hooks, for every quarter you spent at his store. Having finished his calculations, Amatua started off to do his shopping. Even in the short time he had spent in the corner of the ruined church the sea had noticeably risen and was now thundering along the beach, while on the reefs a gleaming spray hung above the breakers like a mist. The stormy sky was splashed with ragged clouds and streaked with flying scud. At their moorings the seven ships rolled under until they seemed to drown the very muzzles of their guns; and the inky vapour that oozed from their funnels, and the incessant shrill shrieking of the boatswains’ whistles, all told a tale of brisk and anxious preparation. “Oh, poor Bill!” thought Amatua, and looked away. The wharf from which he had seen the
  • 34. last of his friend was already a wreck, nothing showing of it but the jagged stumps as the seas rolled back. Two boys told him that a boat of Misi Moa’s had been smashed to pieces, and that a big whaler from Lufilufi that pulled fifty oars had shared the same fate. Knots of white traders stood gazing solemnly out to sea; the provost guards from the ships were ransacking the town for the few men they still missed, and they were told to hurry or their boats would never live to carry them back. There was a general air of apprehension and excitement; people were nailing up their windows and drawing in their boats before the encroaching ocean; and the impressiveness of the situation was not a little heightened by the heavy guard of blue-jackets lined up before the German consulate, and the throngs of Tamasese’s warriors that swarmed everywhere about, fierce of mien in that unfriendly town, with their faces blackened for war, and their hands encumbered with rifles and head-knives. But Amatua had no time to think of such things; the signs of war were familiar to him, and the armed and overbearing adversaries of his tribe and people were no longer so terrible as they once had been. The increasing roar of the sea and the wild sky that spoke of the impending gale kept the thought of Bill close to his heart, and he went about his business with none of the pleasure that the spending of money once involved. Not that he forgot his prudence or his skill at bargaining in the anxiety for Bill that tore his little heart. By dint of walking and chaffering, he came off with twenty hardtack for his first quarter; with the soap he extorted a package of starch; and after he had sniffed beef all the way from Sogi to Vaiala,—a distance of two miles,—he became the proprietor of a hunk at least six ounces heavier than the ruling price allowed. The ’ava was of a superb quality, fit for a king to drink. It was late when Amatua got home and crept into the great beehive of a house that had been the pride of his father’s heart. The girls shouted as they saw him, and old Lu’au clapped her hands as her quick eyes perceived the soap. His mother alone looked sad—his
  • 35. poor mother, who used to be so gay and full of fun in that happy time before the war. She had never been the same since her cousin, the divinity student, had brought back her brother’s head from the battle-field of Luatuanuu—that terrible battle-field where the best blood of Samoa was poured out like water. She looked anxiously at Amatua’s parcels, and motioned him to her side, asking him in a low voice how and where he had got them. “It was this way,” said Amatua. “Bill and I are brothers. What is mine is Bill’s; what is Bill’s is mine. We are two, but in heart we are one. That’s how I understand Bill, though he talks only the white man’s stutter. ‘Amatua,’ he said, just before he got into the boat,—I mean what he said in his heart, for there was not time for words,—‘we are all of us in God’s high-chief hands this day; a storm is coming, and my place is on my ship, where I shall live or be cast away, as God wills. Take you this dollar and spend it with care for the comfort of all our family; take my very valuable watch, that ticks louder than a missionary clock, and my handkerchief of silk, the like of which there is not in Samoa, and keep them for me. My life is God’s alone, but these things belong to all of our family. Stand firm in the love of God, and strengthen your heart to obey his high-chief will.’” It was late when Amatua awoke. The house was empty save for old Lu’au, who was kindling a fire on the hearth. A strange uproar filled the air, the like of which Amatua had never heard before—the tramp of multitudes as they rushed and shouted, deafening explosions, and the shrill, high scream of the long-expected gale. Amatua leaped from his mats, girded up his loin-cloth, and ran headlong into the night. It was piercing cold, and he shivered like a leaf, but he took thought of nothing. He ran for the beach, which lay at no great distance from his father’s house, and was soon panting down the lane beside Mr. Eldridge’s store. It was flaming with lights and filled with a buzzing crowd of whites and natives; and on the front
  • 36. verandah there lay the dripping body of a sailor with a towel over his upturned face. The beach was jammed with people, and above the fury of the gale and the roaring breakers which threatened to engulf the very town there rang out the penetrating voices of the old war chiefs as they vociferated their orders and formed up their men. Even as Amatua stood dazed and almost crushed in the mob, there was a sudden roar, a rush of feet, and a narrow lane opened to a dozen powerful men springing through with the bodies of two sailors. Amatua turned and fought his way seaward, boring through the crowd to where the seas swept up to his ankles, and he could make out the lights of the men-of-war. There was a ship on the reef; he could see the stupendous tangle of her yards and rigging; every wave swept in some of her perishing crew. The undertow ran out like a mill-race; living men were tossed up the beach like corks, only to be sucked back again to destruction. The Samoans were working with desperation to save the seamen’s lives, and more than one daring rescuer was himself swept into the breakers. Amatua found himself beside a man who had just been relieved, and was thunderstruck to find that it was no other than Oa, an old friend of his, who had been in the forest with Mataafa. “How do you happen here, Chief Oa?” shouted Amatua. “The Tamaseses have retired on Mulinuu,” said Oa. “It is Mataafa’s order that we come and save what lives we can.” “Germans, too?” asked Amatua, doubtfully, never forgetful of his father’s wound, or of his uncle who fell at Luatuanuu. “We are not at war with God,” said the chief, sternly. “To-night there is peace in every man’s heart.” Amatua stood long beside his friend, peering into that great void in which so many men were giving up their lives. Sometimes he could make out the dim hulls of ships when they loomed against the sky- line or as the heavens brightened for an instant. Bodies kept constantly washing in, nearly all of them Germans, as Amatua could tell by their uniforms, or, if these were torn from them in the
  • 37. merciless waters, by the prevalence of yellow hair and fair skins. Amatua shrank from the sight of these limp figures, and it was only his love for Bill that kept him on the watch. Poor Bill! How had he fared this night? Was he even now tumbling in the mighty rollers, his last duty done on this sorrowful earth, his brave heart still for ever? Or did he lie, as so many lay that night here and there about the town, wrapped in blankets in some white man’s house or native chief’s, safe and sound, beside a blazing fire? Amatua at last grew tired of waiting there beside Oa. The cold ate into his very bones, and the crowd pressed and trampled on him without ceasing. He cared for nothing so long as he thought he might find Bill; but he now despaired of that and began to think of his tired little self. He forced his way back, and moved aimlessly along from house to house, looking in at the lighted windows in the vain hope of seeing Bill. Of dead men there were plenty, but he could not bear to look at them too closely. He was worn out by the horror and excitement he had undergone, and when his eyes closed, as they sometimes would, he seemed to see Bill’s face dancing before him. He was a very tired boy by the time he made his way home and threw himself once again on the mats in that empty house. It was a strange sight that met Amatua’s gaze the next day on the Apia beach. The wind had fallen, and the mountainous waves of the previous night had given way to a heavy ground-swell. But the ships, the wreckage of ships, the ten thousand and one things—the million and one things—which lined the beach for a distance of two miles! One German man-of-war had gone down with every soul on board; another—the Adler—lay broken-backed and sideways on the reef; the Olga had been run ashore, and looked none the worse for her adventure. The United States ship Vandalia was a total wreck, and half under water; close to her lay the Trenton, with her gun-deck awash; and within a pistol-shot of both was the old Nipsic, her nose high on land. The British ship, the Calliope, was nowhere to be seen, having forced her way to sea in the teeth of the hurricane.
  • 38. Amatua went almost crazy at the sight of what lay strewn on the beach that morning. He ran hither and thither, picking up one thing and then throwing it away for another he liked better: here an officer’s full-dress coat gleaming with gold lace, there a photograph- album in a woful state, some twisted rifles, and a broom; everywhere an extraordinary hotchpotch of things diverse and innumerable. Amatua found an elegant sword not a bit the worse for its trip ashore, an officer’s gold-laced cap, and a ditty-box, full of pins and needles and sewing-gear and old letters. He would also have carried off a tempting little cannon had it weighed anything under a quarter of a ton; as it was, he covered it with sand, and stood up the broom to mark the place, which, strange to say, he has never been able to find since. He got a cracked bell next, a tin of pork and beans, a bottle of varnish, a one-pound Hotchkiss shell, a big platter, and a German flag! This he thought enough for one load, and made his triumphant way home, where he tried pork and beans for the first time in his life—and did not like them. It would have fared badly with him, for there was nothing in the house for him to eat save a few green bananas, had it not been for the Samoan pastor next door. The pastor had hauled a hundred- pound barrel of prime mess pork out of the surf, and in the fulness of his heart he was dividing slabs of it among his parishioners. Another neighbour had salvaged eleven cans of biscuit-pulp, which, though a trifle salt, was yet good enough to eat. In fact, Amatua ate a rather hearty breakfast, and lingered longer over it than perhaps was well for the best interests of his family. By the time he returned to the beach the cream had been skimmed from the milk. True, there was no lack of machinery and old iron, and mountains of tangled rope and other ship’s gear; but there was no longer the gorgeous profusion of smaller articles, for ten thousand busy hands had been at work since dawn. Amatua searched for an hour, and got nothing but a squashy stamp-album and a musical box in the last stages of dissolution.
  • 39. He realised regretfully that he could hope for nothing more, and after trading his album to a half-caste boy for a piece of lead, and exchanging the musical box for six marbles, he again bent his energies to the finding of Bill. For fear of a conflict, the naval commanders had divided their forces. The Germans were encamped at one end of the town, the Americans at the other, and armed sentries paced between. Amatua had never seen so many white men in his life, and he knew scarcely which way to turn first. He was bewildered by the jostling host that encompassed him on every side, by the busy files that were marshalled away to work, the march and countermarch of disciplined feet, the shrill pipe of the boatswains’ calls, and the almost ceaseless bugling. He looked long and vainly for Bill in every nook and cranny of the town. He watched beside the Nipsic for an hour; he forced the guard-house, and even made his way into the improvised hospital, dodging the doctors and the tired orderlies. But all in vain. He trudged into Savalalo and Songi, where the Germans were gathered, fearing lest Bill might have been thrown into chains by those haughty foemen; but he found nothing but rows of dead, and weary men digging graves. He stopped officers on the street, and kind-faced seamen and marines, and asked them earnestly if they had seen Bill. Some paid no attention to him; others laughed and passed on; one man slapped him in the face. When he came back from the German quarter he found a band playing in front of Mr. Moors’s store, and noticed sentries about the place, and important-looking officers, with swords and pistols. He was told that the admiral was up-stairs, and that Mr. Moors’s house was now the headquarters of the American forces. A great resolution welled up in Amatua’s heart. If there was one man on earth that ought to know about Bill, it was the admiral. Amatua dodged a sentry, and running up the steps, he crept along the verandah, and peeped into the room which Kimberly had exchanged for his sea- swept cabin. The admiral sat at a big table strewn inches high with papers, reports, and charts. He was writing in his shirt-sleeves, and on the chair beside him lay his uniform coat and gold-laced cap. At
  • 40. another table two men were also writing; at another a single man was nibbling a pen as he stared at the paper before him. It reminded Amatua of the pastor’s school. Half a dozen officers stood grouped in one corner, whispering to one another, their hands resting on their swords. It was all as quiet as church, and nothing could be heard but the scratch of pens as they raced across the paper. Suddenly a frowning officer noticed Amatua at the door. “Orderly,” he cried, “drive away that boy”; and Amatua was ignominiously seized, led down-stairs, and thrown roughly into the street. Amatua cried as though his little heart would break. He sat on the front porch of the house, careless of the swarming folk about him, and took a melancholy pleasure in being jostled and trampled on. Oh, it was a miserable world! Bill was gone, and any one could cuff a little boy. More than one sailor patted his curly head and lifted him in the air and kissed him; but Amatua was too sore to care for such attentions. It was cruel to think that the one man alone in Samoa who knew where to find Bill, the great chief-captain up-stairs, was absolutely beyond his power to reach. This thought was unbearable; he nerved himself to try again; he recalled the admiral’s face, which was not unkindly, though sad and stern. After all, nothing worse could befall him than a beating. Again he dodged the lower sentry, and sprang up the stairs like a cat. Again he gazed into that quiet room and listened to the everlasting pens. This time he was discovered in an instant; the orderly pounced at him, but Amatua, with his heart in his mouth, rushed towards the admiral, and threw himself on his knees beside him. The old man put a protecting arm round his neck, and the orderly, foiled in the chase, could do nothing else than salute. “Anderson,” said the admiral to an officer, “it is the second time the boy has been here. I tell you he is after something, and we are not in a position to disregard anything in this extraordinary country. He may have a message from King Mataafa. Send for Moors.” In a few moments that gentleman appeared, and was bidden to ask Amatua what he wanted. The officers gathered close behind their
  • 41. chief, and even the assiduous writers looked up. “What does he want?” demanded the admiral, who had no time to spare. “He wants to find a sailor named Bill,” said Moors. “He’s afraid Bill is drowned, and thought he would ask you.” Every one smiled save the admiral. “Are you sure that is all?” he said. “He says he loved Bill very much,” said Moors, “and has searched the beach and the hospital and even the lock-up without finding him. Says he even waited alongside the Nipsic for an hour.” “Half my men are named Bill,” said Kimberly; “but I fear his Bill is numbered with the rest of our brave fellows who went down last night. Moors,” he went on, “take the lad below, and give him any little thing he fancies in the store.” Amatua did not know what might happen next, but he bravely tramped beside Mr. Moors, prepared to face the worst. He felt dizzy and faint when they got below, and Mr. Moors popped him up on the counter, and asked him whether he would prefer candy or some marbles. “The great chief-captain said thou wert a brave boy, and should have a present,” said Mr. Moors. Amatua shook his head. Somehow he had lost interest in such trifles. “Thank his Majesty the admiral,” he said, “but an aching heart takes no pleasure in such things. With thy permission I will go out and look again for Bill. Perhaps, if I change my mind, I will come back and choose marbles,” he added cautiously; and with that he scrambled off the counter and made for the door. “Oh, Bostock,” cried Moors to a naval officer lounging on the front verandah, “if you have nothing better to do, just take this kid along with you. He’s crazy to find a sailor named Bill, and he isn’t sure but that he was drowned last night. He must be pretty well cut up if he won’t take any marbles.” Bostock stopped Amatua, and took his hand in his own. “We’ll go find Bill,” he said.
  • 42. Again was the search begun for Bill, along the main street; in the alleys, and through the scattered native settlements behind the town as far as the Uvea huts, at Vaimoso, and the slums of the Nieué Islanders. Bostock let no seaman pass unnoticed; a heavy fatigue- party coming back from work on the wrecks—sixty men and four officers—were lined up at his request, and Amatua was led through the disciplined ranks in search of Bill. Even the Nipsic was boarded by the indefatigable Bostock and the weary little boy; and although repairs were being rushed at a tremendous pace, and every one looked overdriven and out of temper, the huge ship was overhauled from top to bottom. From the grimy stoke-hole, where everything dripped oil and the heat was insupportable, to the great maintop where men were busy at the rigging; from the crowded quarters of the seamen to the sodden and salt-smelling mess-room, in which the red came off the cushions like blood, the pair made their way in search of Bill. Bostock led the boy back to land, and said good-bye to him at the corner of the Apia Hotel. He tried to raise his spirits, and atone for their failure to find Bill, by the present of a shilling. Amatua accepted it with quiet gratitude, although the gift had not the cheering effect that Bostock desired. The little fellow was sick at heart, and all the shillings in the world could not have consoled him for the loss of Bill. The naval officer followed him with his eyes as he trudged sorrowfully home. He, too, had lost a lifelong friend in that awful night. Amatua gave up all hope of ever seeing Bill again, as time slipped away and one day melted into another. He made friends with Bostock, and spent many a pleasant hour in the company of that jovial officer, following him about everywhere like a dog; but for all that he did not love him as he had loved Bill. Those were exciting times in Apia, and there was much to amuse and distract a little boy. In the day Bill often passed from his thoughts, for the incessant panorama life had now become almost precluded any other thought; but at night, when he awoke in the early hours and heard the cocks
  • 43. calling, then it was that his heart turned to Bill and overflowed with grief for his lost friend. Two days after the storm—two as men count, but centuries in Amatua’s calendar—the British ship Calliope returned to port, strained and battered by that terrible hour when she had pitted her engines against the gale and taken her desperate dash for freedom. But Amatua’s little head was far too full of something else for him to bother about another man-of-war. Bostock had promised to take him to the raft where men were diving for the Trenton’s treasure-chest. He knew all about men-of-war by this time, for he had the freedom of the Nipsic’s ward-room, and he took breakfast regularly with his friends, the officers. They had given him a gold-laced cap and a tin sword, and the tailor had made him a blue jacket with shoulder- straps and brass buttons and the stripes of a second lieutenant. He had his own appointed station when the ship beat to quarters; for the Nipsic had been got safely off the reef and once more divided the waters of the bay. It was a beautiful morning when they pulled out in a shore boat to the raft where the work was in progress. As the Americans possessed no diving apparatus, Kane, the British captain, had lent them the one he carried, with six good men who had some experience in such matters. Amatua was disappointed to find so little to interest him. He examined the pump with which two men were keeping life in the diver below; but he could not understand the sense of it, and the continuous noise soon grew monotonous. Except a tin pail containing the men’s lunch, the brass-bound breaker of drinking water, and some old clothes, there was nothing in the world to attract a small boy. Amatua stood beside Bostock and yawned; the little second lieutenant longed to be on shore playing marbles with his friends in civil life. He was half asleep when Bostock plucked his arm and pointed into the depths beneath. A glittering shell-fish of ponderous weight and monstrous size was slowly rising to the surface. Every one rushed to the side of the raft, save only the two men at the pumps, who went on unmoved. Amatua clung to Bostock. Higher and
  • 44. higher came the hideous shell-fish, until its great, goggling-eyed head appeared horribly above the water. Amatua turned faint. The crew behaved with incredible daring, and seized the huge, bulging thing with the utmost fearlessness. It was frightful to see it step on the raft and toil painfully to the centre, as though it had been wounded in some mortal part. One of the men lifted a hammer as though to kill it, and began to tap, tap, tap on some weak spot in the neck. Then he threw down the hammer, detached the long suckers which reached from the beast’s snout, and started to unscrew its very head from its body. Amatua looked on confounded; he was shaking with horror, yet the fascination of that brassy monster drew him close. Suddenly the creature sank on its knees, and the man gripped the head in both his hands and lifted it up. And underneath, wonder of wonders! there was the face of a man—a white man. And the white man was Bill! With a cry Amatua threw himself into his friend’s arms, dripping though he was. What did he care for the fine uniform, now that Bill was found again! “And where have you been all this time?” asked Bostock. “Oh, I’m the boatswain’s mate of the Calliope,” said Bill; “and what with the knocking about we got, I’ve been kept hard at it on the rigging.” “You have been badly missed,” said Bostock. “Bless his old heart!” said the sailor, “I think a lot of my little Am.”
  • 45. TRANSCRIBER’S NOTE: Obvious typographical errors have been corrected. Inconsistencies in hyphenation have been standardized. Archaic or alternate spelling has been retained from the original.
  • 46. *** END OF THE PROJECT GUTENBERG EBOOK THE QUEEN VERSUS BILLY, AND OTHER STORIES *** Updated editions will replace the previous one—the old editions will be renamed. Creating the works from print editions not protected by U.S. copyright law means that no one owns a United States copyright in these works, so the Foundation (and you!) can copy and distribute it in the United States without permission and without paying copyright royalties. Special rules, set forth in the General Terms of Use part of this license, apply to copying and distributing Project Gutenberg™ electronic works to protect the PROJECT GUTENBERG™ concept and trademark. Project Gutenberg is a registered trademark, and may not be used if you charge for an eBook, except by following the terms of the trademark license, including paying royalties for use of the Project Gutenberg trademark. If you do not charge anything for copies of this eBook, complying with the trademark license is very easy. You may use this eBook for nearly any purpose such as creation of derivative works, reports, performances and research. Project Gutenberg eBooks may be modified and printed and given away—you may do practically ANYTHING in the United States with eBooks not protected by U.S. copyright law. Redistribution is subject to the trademark license, especially commercial redistribution. START: FULL LICENSE
  • 47. THE FULL PROJECT GUTENBERG LICENSE
  • 48. PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK To protect the Project Gutenberg™ mission of promoting the free distribution of electronic works, by using or distributing this work (or any other work associated in any way with the phrase “Project Gutenberg”), you agree to comply with all the terms of the Full Project Gutenberg™ License available with this file or online at www.gutenberg.org/license. Section 1. General Terms of Use and Redistributing Project Gutenberg™ electronic works 1.A. By reading or using any part of this Project Gutenberg™ electronic work, you indicate that you have read, understand, agree to and accept all the terms of this license and intellectual property (trademark/copyright) agreement. If you do not agree to abide by all the terms of this agreement, you must cease using and return or destroy all copies of Project Gutenberg™ electronic works in your possession. If you paid a fee for obtaining a copy of or access to a Project Gutenberg™ electronic work and you do not agree to be bound by the terms of this agreement, you may obtain a refund from the person or entity to whom you paid the fee as set forth in paragraph 1.E.8. 1.B. “Project Gutenberg” is a registered trademark. It may only be used on or associated in any way with an electronic work by people who agree to be bound by the terms of this agreement. There are a few things that you can do with most Project Gutenberg™ electronic works even without complying with the full terms of this agreement. See paragraph 1.C below. There are a lot of things you can do with Project Gutenberg™ electronic works if you follow the terms of this agreement and help preserve free future access to Project Gutenberg™ electronic works. See paragraph 1.E below.
  • 49. 1.C. The Project Gutenberg Literary Archive Foundation (“the Foundation” or PGLAF), owns a compilation copyright in the collection of Project Gutenberg™ electronic works. Nearly all the individual works in the collection are in the public domain in the United States. If an individual work is unprotected by copyright law in the United States and you are located in the United States, we do not claim a right to prevent you from copying, distributing, performing, displaying or creating derivative works based on the work as long as all references to Project Gutenberg are removed. Of course, we hope that you will support the Project Gutenberg™ mission of promoting free access to electronic works by freely sharing Project Gutenberg™ works in compliance with the terms of this agreement for keeping the Project Gutenberg™ name associated with the work. You can easily comply with the terms of this agreement by keeping this work in the same format with its attached full Project Gutenberg™ License when you share it without charge with others. 1.D. The copyright laws of the place where you are located also govern what you can do with this work. Copyright laws in most countries are in a constant state of change. If you are outside the United States, check the laws of your country in addition to the terms of this agreement before downloading, copying, displaying, performing, distributing or creating derivative works based on this work or any other Project Gutenberg™ work. The Foundation makes no representations concerning the copyright status of any work in any country other than the United States. 1.E. Unless you have removed all references to Project Gutenberg: 1.E.1. The following sentence, with active links to, or other immediate access to, the full Project Gutenberg™ License must appear prominently whenever any copy of a Project Gutenberg™ work (any work on which the phrase “Project Gutenberg” appears, or with which the phrase “Project Gutenberg” is associated) is accessed, displayed, performed, viewed, copied or distributed:
  • 50. Welcome to our website – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookultra.com