686 Beginning Programming All-in-One Desk Reference For Dummies offline sorting algorithms, 394 one-based arrays, 315, 316 one-time pad algorithm, 446 online sorting algorithms, 394 open source compilers, 85 operating systems. See also specific kinds choices for programming, 18–19 choosing compiler for, 84–85 compiler support for, 88–89 compilers specific to, 21–22 defined, 18 editors free with, 19 future of, 658–660 interpreters, 91 p-code compatibility issues, 23 shielded from programmers by BASIC, 54 operators. See also specific kinds assignment (overview), 162 C/C++, 528–531 defined, 162 increment (overview), 202–203 Java/C#, 545–548 JavaScript, 488–490 language differences for, 161 logical/Boolean (overview), 174–178 mathematical (overview), 162–165 Pascal/Delphi, 580–581 Perl, 561–563 PHP, 500–502 precedence, 164–165 Python, 561–563, 564–565 regular expressions, 168–171 relational/comparison (overview), 172–174 Ruby, 511–513 VB/RB, 596–597 optical character recognition (OCR), 651 optimizing programs compiler features for, 86–87 profilers for, 102–103 Or operator, 176–177. See also logical/Boolean operators ordered trees binary, 382–383 B-trees, 383–384 ordinary, 381–382 OrElse operator (Visual Basic), 597 organizing programs breaking into subprograms, 131–135 creating a user interface, 138–140 dividing into objects, 135–138 need for, 130–131 storing subprograms in separate files, 36–37, 131, 133–135 organizing user interfaces, 301–302 P parameter passing calling functions, 226–227 calling subprograms, 219–222 parameter list for, 219, 226 parameters, defined, 219 by reference, 222–225, 602 scope of variables with, 158–159 by value, 223, 602 PARRY NLP program, 650 Pascal language advantages, 57–58 branching statements, 581–582 comments, 281, 577 constants, 579 creating functions and subprograms, 584–585 data structures, 585–587 declaring variables, 147, 577–579 development of, 57 fading popularity of, 58 as high-level language, 14 linked lists with, 343–344 looping statements, 583–584 objects, 587–588 overview, 575–576 program structure, 576 structured programming in, 37, 57–58 passing parameters. See parameter passing password algorithms, 446–447. See also keys for encryption patching, 640 pattern matching combining regular expressions, 170–171 with multiple-character wildcards, 169–170 with ranges, 170 with single-character wildcard, 168 for specific characters, 169 payload of viruses, 634 P-box algorithms, 447–448 p-code
Index 687 advantages and disadvantages, 23 compatibility issues, 23 compiling to a virtual machine for, 93–94 with Java, 23, 66 with .NET framework, 68 overview, 23 with Revolution, 77–78 virtual machines for, 662 with Visual Basic, 77 PDF (Portable Document Format), 264 performance arrays, 328 assembly language, 16 BASIC limitations, 589 compiler issues, 16, 64, 87–88, 130 of compilers, 87–88 keywords’ affect on, 64, 130 machine language, 16 sorting algorithms, 394, 406–408 string searching algorithms, 433 structures, 328 virtual machines, 94 Perl based on C, 50 bioinformatics in, 627, 628, 631, 632 branching statements, 565–566 comments, 278, 561 creating functions, 568–569 data structures, 569–570 default sorting algorithm, 404 defining variables, 561 interpreter for, 92 looping statements, 566–568 objects, 572–573 operators, 561–565 overview, 559–560 program structure, 560–561 Python compared to, 559–560 for transferring data among programs, 77 permutation box algorithms, 447–448 PGP (Pretty Good Privacy), 454, 455 phonetic string searching, 431–433 PHP (PHP Hypertext Processor) arrays, 506 branching statements, 502–504 comments, 498 creating functions, 505 creating objects, 507 declaring variables, 499 HTML markup for, 497–498 interpreter for, 92 looping statements, 504–505 operators, 500–502 program structure, 497–498 Phrogram teaching language, 60 plain text files. See text files plaintext attacks on encryption, 458 pointers, 338. See also linked lists polymorphism, 242–243, 256–258 popping data from a stack, 363–364 portability. See also crossplatform programming of C, 65, 660–661 defined, 65 of Java, 66, 541 of REALbasic, 589–590 Visual Basic issues, 589 Portable Document Format (PDF), 264 postorder traversal of trees, 386 PowerShell interpreter (Windows), 91 precedence of operators, 164–165 preorder traversal of trees, 385 Pretty Good Privacy (PGP), 454, 455 private versus public data and subprograms, 234–235 private-key (symmetric) encryption, 452–453 problem solving in AI expert systems, 646–648 game-playing, 645–646 image recognition, 651–652 natural language processing, 648–650 overview, 644 speech recognition, 650–651 problem solving in programming, 7–9, 127–128 procedural languages, 70 procedures. See subprograms processors assembly language particular to, 14 C manipulation of, 15 compilers specific to, 84 defined, 11 functions of, 12 native language of, 11 registers, 12, 13 profilers, 83, 96, 102–103
Beginning Programming ALL-IN-ONE DE
Beginning Programming ALL-IN-ONE DE
About the Author I started off as a
Acknowledgments This is the part of
Contents at a Glance Introduction .
Table of Contents Introduction.....
Table of Contents xi Finding an Int
Table of Contents xiii Playing with
Table of Contents xv Using Structur
Table of Contents xvii Searching wi
Table of Contents xix Book VI: Prog
Table of Contents xxi Declaring Con
Introduction If you enjoy using a c
How to Use This Book 3 means they
Book I Getting Started
Chapter 1: Getting Started Programm
How Computer Programming Works 9 De
The History of Computer Programming
The History of Computer Programming
The History of Computer Programming
Figuring Out Programming 17 As a ge
Figuring Out Programming 19 ✦ Lin
Figuring Out Programming 21 Convert
Figuring Out Programming 23 certain
Getting Started with Programming 25
Knowing Programming versus Knowing
Chapter 2: Different Methods for Wr
Spaghetti Programming without a Pla
Planning Ahead with Structured Prog
Planning Ahead with Structured Prog
Planning Ahead with Structured Prog
Making User Interfaces with Event-D
Making User Interfaces with Event-D
Organizing a Program with Object-Or
Organizing a Program with Object-Or
Organizing a Program with Object-Or
Chapter 3: Types of Programming Lan
Choosing Your First Language 51 ext
Teaching Languages 53 Principles Be
Teaching Languages 55 The Interacti
Teaching Languages 57 near future.
Teaching Languages 59 The main disa
Teaching Languages 61 Book I Chapte
“Curly Bracket” Languages 63
“Curly Bracket” Languages 65 Th
“Curly Bracket” Languages 67 C#
“Curly Bracket” Languages 69 Vi
Artificial Intelligence Languages 7
Scripting Languages 73 2. From the
Scripting Languages 75 In compariso
Scripting Languages 77 Transferring
Database Programming Languages 79 @
Comparing Programming Languages 81
Chapter 4: Programming Tools In Thi
Choosing a Compiler 85 3. Choose a
Choosing a Compiler 87 than other c
Choosing a Compiler 89 With a cross
Finding an Interpreter 91 In the ol
Compiling to a Virtual Machine 93 C
Writing a Program with an Editor 95
Fixing a Program with a Debugger 97
Fixing a Program with a Debugger 99
Fixing a Program with a Debugger 10
Creating a Help File 103 Obviously,
Dissecting Programs with a Disassem
Chapter 5: Managing Large Projects
Software Engineering Methods 109 Fi
Software Engineering Methods 111 de
Software Engineering Methods 113 Ad
Automating Software Engineering wit
Automating Software Engineering wit
Automating Software Engineering wit
Automating Software Engineering wit
The Pros and Cons of Software Engin
Book II Programming Basics
Chapter 1: How Programs Work In Thi
Using Keywords as Building Blocks 1
Organizing a Program 131 So if your
Dividing a Program into Subprograms
Dividing a Program into Objects 135
Dividing a Program into Objects 137
Creating a User Interface 139 The u
Chapter 2: Variables, Data Types, a
Declaring Variables 143 This BASIC
Declaring Variables 145 You can alw
Declaring Variables 147 Every progr
Using Different Data Types 149 type
Retrieving Data from a Variable 151
Using Constant Values 153 Using Con
Defining the Scope of a Variable 15
Defining the Scope of a Variable 15
Defining the Scope of a Variable 15
Chapter 3: Manipulating Data In Thi
Using Math to Manipulate Numbers 16
Using Math to Manipulate Numbers 16
Manipulating Strings 167 Most progr
Finding Strings with Regular Expres
Finding Strings with Regular Expres
Using Comparison Operators 173 Comp
Using Boolean Operators 175 Most pr
Using Boolean Operators 177 So if t
Converting Data Types 179 Both type
Chapter 4: Making Decisions by Bran
Picking One Choice with the IF-THEN
Picking Three or More Choices with
Picking Three or More Choices with
Playing with Multiple Boolean Opera
Making Multiple Choices with the SE
Making Multiple Choices with the SE
Making Multiple Choices with the SE
Making Multiple Choices with the SE
Chapter 5: Repeating Commands by Lo
Looping a Fixed Number of Times wit
Looping a Fixed Number of Times wit
Looping a Fixed Number of Times wit
Looping Zero or More Times with the
Playing with Nested Loops 209 This
Checking Your Loops 211 Outer loop
Chapter 6: Breaking a Large Program
Creating and Using Subprograms 215
Creating and Using Subprograms 217
Passing Parameters 219 The #include
Passing Parameters 221 Figure 6-5:
Passing Parameters 223 When you pas
Passing Parameters 225 DIM Temp AS
Repeating a Subprogram with Recursi
Repeating a Subprogram with Recursi
Chapter 7: Breaking a Large Program
How Object-Oriented Programming Wor
Encapsulation Isolates Data and Sub
Encapsulation Isolates Data and Sub
Sharing Code with Inheritance 239 S
Sharing Code with Inheritance 241 F
Design Patterns 243 However, when y
Design Patterns 245 The flyweight p
Object-Oriented Languages 247 Becau
Real-Life Programming Examples 249
Real-Life Programming Examples 251
Real-Life Programming Examples 253
Real-Life Programming Examples 255
Real-Life Programming Examples 257
Chapter 8: Reading and Saving Files
Storing Data in Text Files 261 A co
Storing Data in Text Files 263 Read
Storing Fixed Size Data in Random-A
Storing Fixed Size Data in Random-A
Storing Varying Size Data in Untype
Using Database Files 271 Figure 8-5
Using Database Files 273 Think of a
Using Database Files 275 When using
Chapter 9: Documenting Your Program
Adding Comments to Source Code 279
Adding Comments to Source Code 281
Adding Comments to Source Code 283
Writing Software Documentation 285
Writing Software Documentation 287
Chapter 10: Principles of User Inte
The Evolution of User Interfaces 29
Elements of a User Interface 293 GU
Elements of a User Interface 295 Fi
Elements of a User Interface 297 If
Elements of a User Interface 299 Fi
Elements of a User Interface 301 Fi
Designing a User Interface 303 diff
Designing a User Interface 305 A we
Designing a User Interface 307 Figu
Book III Data Structures
Chapter 1: Structures and Arrays In
Using Structures 313 If you wanted
Using an Array 315 the array, which
Using an Array 317 Perkins has empl
Working with Resizable Arrays 319 D
Working with Multi-Dimensional Arra
Using Structures with Arrays 323 Th
Drawbacks of Arrays 325 To store da
Drawbacks of Arrays 327 Suppose you
Chapter 2: Sets and Linked Lists In
Using Sets 331 Adding (and deleting
Using Sets 333 This command asks th
Using Sets 335 Bill Evans John Doe
Using Linked Lists 337 This tells t
Using Linked Lists 339 Each time yo
Drawbacks of Sets and Linked Lists
Drawbacks of Sets and Linked Lists
Chapter 3: Collections and Dictiona
Using a Collection 347 Every elemen
Using a Collection 349 When you del
Using a Collection 351 Figure 3-6:
Understanding Hash Tables 353 Every
Understanding Hash Tables 355 VP Ke
Understanding Hash Tables 357 ✦ D
Understanding Hash Tables 359 In ge
Chapter 4: Stacks, Queues, and Dequ
Using a Stack 363 Like a collection
Using Queues 365 Counting and searc
Using Queues 367 Adding data to a q
Using Queues 369 Figure 4-6: The Pe
Using Deques 371 Initially, a deque
Using Deques 373 Figure 4-11: The U
Chapter 5: Graphs and Trees In This
Understanding Graphs 377 457 miles
Understanding Graphs 379 Figure 5-4
Creating Trees 381 Figure 5-5: A tr
Creating Trees 383 For example, an
Taking Action on Trees 385 Traversi
Taking Action on Trees 387 10 8 12
Taking Action on Trees 389 10 8 12
Book IV Algorithms
Chapter 1: Sorting Algorithms In Th
Using Bubble Sort 395 32 9 74 21 Or
Using Insertion Sort 397 32 9 74 21
Using Shell Sort 399 32 9 74 21 50
Using Heap Sort 401 Heap sort dumps
Using Merge Sort 403 94 46 74 21 32
Using Quick Sort 405 Using Quick So
Comparing Sorting Algorithms 407 If
Chapter 2: Searching Algorithms In
Sequential Search 411 Backward or f
Sequential Search 413 Binary search
Sequential Search 415 Fibonacci num
Using Indexes 417 102 John Smith 55
Adversarial Search 419 The more lev
Adversarial Search 421 So if the co
Chapter 3: String Searching In This
Sequential Text Search 425 In this
Sequential Text Search 427 The Shif
Searching with Regular Expressions
Searching Phonetically 431 Both sym
Searching Phonetically 433 If you h
Chapter 4: Data Compression Algorit
Lossless Data Compression Algorithm
Lossless Data Compression Algorithm
Lossless Data Compression Algorithm
Lossy Data Compression 443 Basicall
Chapter 5: Encryption Algorithms In
The Basics of Encryption 447 in a m
The Basics of Encryption 449 Stream
The Basics of Encryption 451 Electr
Symmetric/Asymmetric Encryption Alg
Cracking Encryption 455 Sender’s
Cracking Encryption 457 Instead of
Cracking Encryption 459 Code cracki
Book V Web Programming
Chapter 1: HyperText Markup Languag
The Structure of an HTML Document 4
The Structure of an HTML Document 4
Defining the Background 469 Adding
Making Tables 471 The anchor point
Making Tables 473 Book V Chapter 1
Making Tables 475 Column 1 Column
Chapter 2: CSS In This Chapter Und
Creating Style Classes 479 color :
Separating Styles in Files 481 Sepa
Cascading Stylesheets 483 If you ha
Chapter 3: JavaScript In This Chapt
Declaring Variables 487 need to def
Using Operators 489 The relational
Branching Statements 491 To make th
Using Arrays 493 A variation of the
Designing User Interfaces 495 A con
Chapter 4: PHP In This Chapter Und
Declaring Variables 499 Declaring V
Using Operators 501 Table 4-3 Logic
Branching Statements 503 Command; }
Creating Functions 505 If you don
Creating Objects 507 Creating Objec
Chapter 5: Ruby In This Chapter Un
Using Operators 511 # long time to
Using Operators 513 Table 5-3 Logic
Looping Statements 515 Command else
Using Data Structures 517 Using Dat
Creating Objects 519 To tell an obj
Book VI Programming Language Syntax
Chapter 1: C and C++ In This Chapte
Declaring Variables 525 Despite min
Declaring Variables 527 All integer
Using Operators 529 Relational oper
Branching Statements 531 Table 1-6
Looping Statements 533 switch (expr
Data Structures 535 If a function d
Using Objects 537 Now you can decla
Using Objects 539 To inherit from m
Chapter 2: Java and C# In This Chap
Declaring Variables 543 The double
Using Operators 545 Declaring float
Using Operators 547 The increment o
Branching Statements 549 if (condit
Looping Statements 551 Because no b
Data Structures 553 If the function
Data Structures 555 You can create
Using Objects 557 So if you created
Chapter 3: Perl and Python In This
Using Operators 561 You can write b
Using Operators 563 The relational
Branching Statements 565 Table 3-5
Looping Statements 567 In Python, t
Perl Data Structures 569 A typical
Python Data Structures 571 Creating
Using Objects 573 After you define
Chapter 4: Pascal and Delphi In Thi
Declaring Variables 577 Creating Co
Declaring Constants 579 Declaring d
Branching Statements 581 Table 4-5
Looping Statements 583 Looping Stat
Data Structures 585 FUNCTION Functi
Creating Objects 587 clear a dynami
Chapter 5: Visual Basic and REALbas
The Structure of a BASIC Program 59
Declaring Variables 593 Declaring i
Declaring Constants 595 Declaring B
Branching Statements 597 Table 5-7
Branching Statements 599 The preced
Creating Subprograms and Functions
Data Structures 603 Data Structures
Creating Objects 605 Creating Objec
Book VII Applications
Chapter 1: Database Management In T
The Basics of Databases 611 To retr
The Basics of Databases 613 Althoug
The Basics of Databases 615 Employe
Manipulating Data 617 Tables divide
Manipulating Data 619 The Join comm
Manipulating Data 621 SET PhoneNumb
Database Programming 623 Figure 1-1
Chapter 2: Bioinformatics In This C
The Basics of Bioinformatics 627 Un
Searching Databases 629 ✦ Swiss-P
Bioinformatics Programming 631 Alth
Chapter 3: Computer Security In Thi