- Main Page
- Main Page
- Table of content
- Copyright
- Foreword
- Preface
- What s in This Book
- What s New in This Edition
- Platform Notes
- Other Books
- Conventions Used in This Book
- We d Like to Hear from You
- Acknowledgments for the First Edition
- Acknowledgments for the Second Edition
- Chapter 1. Strings
- Introduction
- Recipe 1.1 Accessing Substrings
- Recipe 1.2 Establishing a Default Value
- Recipe 1.3 Exchanging Values Without Using Temporary Variables
- Recipe 1.4 Converting Between Characters and Values
- Recipe 1.5 Using Named Unicode Characters
- Recipe 1.6 Processing a String One Character at a Time
- Recipe 1.7 Reversing a String by Word or Character
- Recipe 1.8 Treating Unicode Combined Characters as Single Characters
- Recipe 1.9 Canonicalizing Strings with Unicode Combined Characters
- Recipe 1.10 Treating a Unicode String as Octets
- Recipe 1.11 Expanding and Compressing Tabs
- Recipe 1.12 Expanding Variables in User Input
- Recipe 1.13 Controlling Case
- Recipe 1.14 Properly Capitalizing a Title or Headline
- Recipe 1.15 Interpolating Functions and Expressions Within Strings
- Recipe 1.16 Indenting Here Documents
- Recipe 1.17 Reformatting Paragraphs
- Recipe 1.18 Escaping Characters
- Recipe 1.19 Trimming Blanks from the Ends of a String
- Recipe 1.20 Parsing Comma-Separated Data
- Recipe 1.21 Constant Variables
- Recipe 1.22 Soundex Matching
- Recipe 1.23 Program: fixstyle
- Recipe 1.24 Program: psgrep
- Chapter 2. Numbers
- Introduction
- Recipe 2.1 Checking Whether a String Is a Valid Number
- Recipe 2.2 Rounding Floating-Point Numbers
- Recipe 2.3 Comparing Floating-Point Numbers
- Recipe 2.4 Operating on a Series of Integers
- Recipe 2.5 Working with Roman Numerals
- Recipe 2.6 Generating Random Numbers
- Recipe 2.7 Generating Repeatable Random Number Sequences
- Recipe 2.8 Making Numbers Even More Random
- Recipe 2.9 Generating Biased Random Numbers
- Recipe 2.10 Doing Trigonometry in Degrees, Not Radians
- Recipe 2.11 Calculating More Trigonometric Functions
- Recipe 2.12 Taking Logarithms
- Recipe 2.13 Multiplying Matrices
- Recipe 2.14 Using Complex Numbers
- Recipe 2.15 Converting Binary, Octal, and Hexadecimal Numbers
- Recipe 2.16 Putting Commas in Numbers
- Recipe 2.17 Printing Correct Plurals
- Recipe 2.18 Program: Calculating Prime Factors
- Chapter 3. Dates and Times
- Introduction
- Recipe 3.1 Finding Today s Date
- Recipe 3.2 Converting DMYHMS to Epoch Seconds
- Recipe 3.3 Converting Epoch Seconds to DMYHMS
- Recipe 3.4 Adding to or Subtracting from a Date
- Recipe 3.5 Difference of Two Dates
- Recipe 3.6 Day in a WeekMonthYear or Week Number
- Recipe 3.7 Parsing Dates and Times from Strings
- Recipe 3.8 Printing a Date
- Recipe 3.9 High-Resolution Timers
- Recipe 3.10 Short Sleeps
- Recipe 3.11 Program: hopdelta
- Chapter 4. Arrays
- Introduction
- Recipe 4.1 Specifying a List in Your Program
- Recipe 4.2 Printing a List with Commas
- Recipe 4.3 Changing Array Size
- Recipe 4.4 Implementing a Sparse Array
- Recipe 4.5 Iterating Over an Array





