Monday, January 22, 2007

Ajax Design Patterns

O'Reilly has published their latest Ajax book: Ajax Design Patterns

This handy reference reveals how Ajax patterns can vastly improve your web development projects. It does so by investigating how others have successfully dealt with conflicting design principles, and then relaying that information directly to you. Includes sections on foundational technology patterns, programming patterns, functionality and usability patterns, and diagnosis/testing of Ajax applications.
Full Description

Ajax, or Asynchronous JavaScript and XML, exploded onto the
scene in the spring of 2005 and remains the hottest story among web
developers. With its rich combination of technologies, Ajax provides a
strong foundation for creating interactive web applications with XML or
JSON-based web services by using JavaScript in the browser to process
the web server response.


Ajax Design Patterns shows you best
practices that can dramatically improve your web development projects.
It investigates how others have successfully dealt with conflicting
design principles in the past and then relays that information
directly to you.


The patterns outlined in the book fall into four
categories:


Foundational technology: Examines the raw technologies
required for Ajax development

Programming: Exposes techniques that developers have
discovered to ensure their Ajax applications are maintainable

Functionality and usability: Describes the types of user
interfaces you'll come across in Ajax applications, as well as the new
types of functionality that Ajax makes possible

Development: Explains the process being used to monitor,
debug, and test Ajax applications


Ajax Design Patterns will also get you up
to speed with core Ajax technologies, such as XMLHttpRequest, the DOM, and JSON.
Technical discussions are followed by code examples so you can see for
yourself just what is-and isn't-possible with Ajax. This handy
reference will help you to produce high-quality Ajax architectures,
streamline web application performance, and improve the user
experience.


Table of Contents

1. Introducing Ajax
Ajax and the Usable Web
The Rise of Ajax
Ajaxifying the Web: The Story of Portals
Webifying the Desktop: The Story of Office Applications
Characteristics of Ajax Applications
The Ajax Technologies
Anatomy of a Server Call
Ajax Trends
Conclusions

2. A Pattern-Led Tutorial
Ajax Technologies in a Blink
Ajaxifying a Web App: One Pattern at a Time
Projects and Katas
Conclusions

3. Ajax Design: Principles and Patterns
Desirable Attributes of Ajax Applications
Designing for Ajax
Ajax Patterns Overview
Anatomy of a Pattern
Ajax Patterns Demos
Conclusions


Part Two. Foundational Technology Patterns

4. Ajax App
Ajax App

5. Display Manipulation
Display Morphing
Page Rearrangement

6. Web Remoting
Web Service
XMLHttpRequest Call
IFrame Call
HTTP Streaming
On-Demand JavaScript

7. Dynamic Behavior
User Action
Scheduling

8. Extended Technologies
Richer Plugin


Part Three. Programming Patterns

9. Web Services
RESTful Service
RPC Service
Ajax Stub
HTML Message
Plain-Text Message
XML Message
JSON Message

10. Browser-Server Dialogue
Call Tracking
Periodic Refresh
Submission Throttling
Explicit Submission
Distributed Events
Cross-Domain Proxy

11. DOM Population
XML Data Island
Browser-Side XSLT
Browser-Side Templating

12. Code Generation and Reuse
Server-Side Code Generation
Cross-Browser Component

13. Performance Optimization
Browser-Side Cache
Predictive Fetch
Guesstimate
Multi-Stage Download
Fat Client


Part Four. Functionality and Usability Patterns

14. Widgets
Slider
Progress Indicator
Drilldown
Data Grid
Rich Text Editor
Suggestion
Live Search
Live Command-Line
Live Form

15. Page Architecture
Drag-And-Drop
Sprite
Popup
Malleable Content
Microlink
Portlet
Status Area
Update Control
Virtual Workspace

16. Visual Effects
One-Second Spotlight
One-Second Mutation
One-Second Motion
Highlight

17. Functionality
Lazy Registration
Direct Login
Host-Proof Hosting
Timeout
Heartbeat
Unique URLs

Part Five. Development Patterns

18. Diagnosis
Logging
Debugging
DOM Inspection
Traffic Sniffing

19. Testing
Simulation Service
Browser-Side Test
Service Test
System Test

Part Six. Appendixes
A. Ajax Frameworks and Libraries
B. Setting Up the Code Examples
C. Patterns and Pattern Languages
D. References

Download sample chapter 10 (Browser-Server Dialogue)

Amazon link:Ajax Design Patterns

Foundations of Atlas: Rapid Ajax Development with ASP.NET 2.0

Apress has published their latest Ajax book. This book introduces a fast-track path to understanding Atlas, and how this technology can increase the power and functionality of your code while conserving time and effort. The book begins with a bare-bones introduction that explains how Atlas relates to Ajax.

Microsoft Atlas is a web-client framework that makes building Ajax-style applications easier. It provides a prewritten framework that gives you a structured environment in which to work. Atlas also provides you with an object model and standardized debugging to make development faster and simpler.

Ajax is a new way of combining a number of Web technologies including JavaScript, dynamic HTML, and a feature known as XmlHttp (which reduces the need for client browsers to constantly reconnect to the server every time new information is downloaded). But at the moment, people developing with Ajax have to write their code from the ground up, which is complex and time consuming.


The book guides you through a series of practical examples that demonstrate the Atlas framework and available controls. After reading this book, you’ll be able to compile a seamless Atlas-based application of your own!

This book demystifies the Atlas technology and shows you how to work with it.
The first book dedicated to this revolutionary new technology.
Written by an experienced .NET author in collaboration with the Atlas development team.

Foundations of Atlas: Rapid Ajax Development with ASP.NET 2.0 is written by Laurence Moroney and contains 336 pages

Table Of contents
CHAPTER 1 Introducing Ajax
CHAPTER 2 Atlas: Taking Ajax to the Next Level
CHAPTER 3 Atlas: Making Client-Side JavaScript Easier
CHAPTER 4 Introducing Client Controls in Atlas
CHAPTER 5 Using Client Controls in Atlas
CHAPTER 6 Introducing Server Controls in Atlas
CHAPTER 7 Using Server Controls in Atlas
CHAPTER 8 Data Binding in Atlas
CHAPTER 9 Using the AtlasUIGlitz Library
CHAPTER 10 Mapping with Atlas
CHAPTER 11 Building a Sample Application with ASP.NET and Atlas


Get sample chapter 6 (Introducing Server Controls in Atlas) here

Amazon link:Foundations of Atlas: Rapid Ajax Development with ASP.NET 2.0

Pro Ajax And The .NET 2.0 Platform

There are a few class libraries recently distributed that open the Ajax door to the .NET Framework 2.0. This book examines how the Ajax technology and the .NET Framework can work in tandem. It thoroughly covers the XMLHTTPRequest processes and the .NET 2.0 class libraries, and shows you how to turn theory into practice and concepts into code, with samples that duplicate many new web technologies. With the knowledge you gain from this book, you’ll be ready to put this asynchronous technology to work.

Thanks to the folks at Google, Ajax technology has become a force to be reckoned with. It is a technology that is here and now, just waiting for you to implement it with full impact. Google Maps, Google Suggest, and Flickr.com are just a few of the sites out there that have moved Ajax into the mainstream. More shall be revealed as the technology eases its way into coding. The book will also prepare you for upcoming work changes with the release of "Atlas."

Pro Ajax and the .NET 2.0 Platform (Pro)
By Daniel Woolston
ISBN: 1-59059-670-6
488 pp.
Published: Jul 2006


Sample Chapter: Ch. 13 - Ajax and Mapping

PART 1 Ajax Concepts
CHAPTER 1 History and Revival of Ajax
CHAPTER 2 Introducing JavaScript
CHAPTER 3 The XmlHttpRequest Object
CHAPTER 4 N-Tier and Ajax

PART 2 Ajax Components
CHAPTER 5 Rich Internet Applications.
CHAPTER 6 CSS and the DOM.
CHAPTER 7 Ajax Frameworks

PART 3 Concept to Code
CHAPTER 8 Understanding the Library
CHAPTER 9 Ajax and Web Services.
CHAPTER 10 Tagging with Ajax
CHAPTER 11 Cloning Google Suggest.
CHAPTER 12 User Controls and Ajax.NET
CHAPTER 13 Ajax and Mapping
CHAPTER 14 Ajax and Web Parts

PART 4 Security and Performance
CHAPTER 15 Ajax and ASP.NET Security.
CHAPTER 16 Performance
CHAPTER 17 Debugging Your Application.
CHAPTER 18 Ajax and Site Testing
CHAPTER 19 Ajax Usability

PART 5 Moving Forward
CHAPTER 20 Atlas
INDEX

Amazon Link: Pro Ajax and the .NET 2.0 Platform (Pro)

SQL Hacks

Title:SQL Hacks
First Edition: November 2006
Series: Hacks
ISBN 10: 0-596-52799-3
ISBN 13: 9780596527990
Pages: 410

Description:
Whether you're running Access, MySQL, SQL Server, Oracle, or PostgreSQL, this book will help you push the limits of traditional SQL to squeeze data effectively from your database. The book offers 100 hacks -- unique tips and tools -- that bring you the knowledge of experts who apply what they know in the real world to help you take full advantage of the expressive power of SQL. You'll find practical techniques to address complex data manipulation problems. Learn how to:

--Wrangle data in the most efficient way possible
--Aggregate and organize your data for meaningful and accurate reporting
--Make the most of subqueries, joins, and unions
--Stay on top of the performance of your queries and the server that runs them
--Avoid common SQL security pitfalls, including the dreaded SQL injection attack

Let SQL Hacks serve as your toolbox for digging up and manipulating data. If you love to tinker and optimize, SQL is the perfect technology and SQL Hacks is the must-have book for you.


Sample Chapter
A sample chapter is available: Hack 4: Date Handling (PDF Format)

Table Of Contents:
Chapter 1. SQL Fundamentals
1. Run SQL from the Command Line
2. Connect to SQL from a Program
3. Perform Conditional INSERTs
4. UPDATE the Database
5. Solve a Crossword Puzzle Using SQL
6. Don't Perform the Same Calculation Over and Over

Chapter 2. Joins, Unions, and Views
7. Modify a Schema Without Breaking Existing Queries
8. Filter Rows and Columns
9. Filter on Indexed Columns
10. Convert Subqueries to JOINs
11. Convert Aggregate Subqueries to JOINs
12. Simplify Complicated Updates
13. Choose the Right Join Style for Your Relationships
14. Generate Combinations

Chapter 3. Text Handling
15. Search for Keywords Without LIKE
16. Search for a String Across Columns
17. Solve Anagrams
18. Sort Your Email

Chapter 4. Date Handling
19. Convert Strings to Dates
20. Uncover Trends in Your Data
21. Report on Any Date Criteria
22. Generate Quarterly Reports
23. Second Tuesday of the Month

Chapter 5. Number Crunching
24. Multiply Across a Result Set
25. Keep a Running Total
26. Include the Rows Your JOIN Forgot
27. Identify Overlapping Ranges
28. Avoid Dividing by Zero
29. Other Ways to COUNT
30. Calculate the Maximum of Two Fields
31. Disaggregate a COUNT
32. Cope with Rounding Errors
33. Get Values and Subtotals in One Shot
34. Calculate the Median
35. Tally Results into a Chart
36. Calculate the Distance Between GPS Locations
37. Reconcile Invoices and Remittances
38. Find Transposition Errors
39. Apply a Progressive Tax
40. Calculate Rank

Chapter 6. Online Applications
41. Copy Web Pages into a Table
42. Present Data Graphically Using SVG
43. Add Navigation Features to Web Applications
44. Tunnel into MySQL from Microsoft Access
45. Process Web Server Logs
46. Store Images in a Database
47. Exploit an SQL Injection Vulnerability
48. Prevent an SQL Injection Attack

Chapter 7. Organizing Data
49. Keep Track of Infrequently Changing Values
50. Combine Tables Containing Different Data
51. Display Rows As Columns
52. Display Columns As Rows
53. Clean Inconsistent Records
54. Denormalize Your Tables
55. Import Someone Else's Data
56. Play Matchmaker
57. Generate Unique Sequential Numbers

Chapter 8. Storing Small Amounts of Data
58. Store Parameters in the Database
59. Define Personalized Parameters
60. Create a List of Personalized Parameters
61. Set Security Based on Rows
62. Issue Queries Without Using a Table
63. Generate Rows Without Tables

Chapter 9. Locking and Performance
64. Determine Your Isolation Level
65. Use Pessimistic Locking
66. Use Optimistic Locking
67. Lock Implicitly Within Transactions
68. Cope with Unexpected Redo
69. Execute Functions in the Database
70. Combine Your Queries
71. Extract Lots of Rows
72. Extract a Subset of the Results
73. Mix File and Database Storage
74. Compare and Synchronize Tables
75. Minimize Bandwidth in One-to-Many Joins
76. Compress to Avoid LOBs

Chapter 10. Reporting
77. Fill in Missing Values in a Pivot Table
78. Break It Down by Range
79. Identify Updates Uniquely
80. Play Six Degrees of Kevin Bacon
81. Build Decision Tables
82. Generate Sequential or Missing Data
83. Find the Top n in Each Group
84. Store Comma-Delimited Lists in a Column
85. Traverse a Simple Tree
86. Set Up Queuing in the Database
87. Generate a Calendar
88. Test Two Values from a Subquery
89. Choose Any Three of Five

Chapter 11. Users and Administration
90. Implement Application-Level Accounts
91. Export and Import Table Definitions
92. Deploy Applications
93. Auto-Create Database Users
94. Create Users and Administrators
95. Issue Automatic Updates
96. Create an Audit Trail

Chapter 12. Wider Access
97. Allow an Anonymous Account
98. Find and Stop Long-Running Queries
99. Don't Run Out of Disk Space
100. Run SQL from a Web Page


And for $19.79 on Amazon this is a great gift

Sunday, January 21, 2007

Effective C#: 50 Specific Ways to Improve Your C#


Title:Effective C#: 50 Specific Ways to Improve Your C#
Author: Bill Wagner
Publisher: Addison Wesley Professional
Format: Paper; 336 pp
ISBN-10: 0321245660
ISBN-13: 9780321245663
Published: 12/03/2004


Description
C# is the premier language for .NET development, and is currently the fastest growing programming language. It is already being used by 29% of professional programmers, with that percentage expected to continue increasing rapidly. It is still a relatively new language, however, and developers are still looking for resources to enable them to use it better. Effective C# covers C# from a practical perspective, and provides insight into using the language more efficiently. The reader will get information based on years of practical C# experience in real world settings. The format of the book is the same that has proven immensely popular in other books in Scott Meyers' series. The author has a devoted following from his regular C# columns in Visual Studio Magazine. Every serious C# developer will keep this book close at hand, to return to again and again for advice.
Table of Contents
Introduction.

1. C# Language Elements.
Item 1 - Always Use Properties Instead of Accessible Data Members.
Item 2 - Prefer readonly to const.
Item 3 - Prefer the is or as Operators to Casts.
Item 4 - Use Conditional Attributes Instead of #if.
Item 5 - Always Provide ToString().
Item 6 - Distinguish Between Value Types and Reference Types.
Item 7 - Prefer Immutable Atomic Value Types.
Item 8 - Ensure That 0 Is a Valid State for Value Types.
Item 9 - Understand the Relationships Among ReferenceEquals(),static Equals(),instance Equals(), and operator==.
Item 10 - Understand the Pitfalls of GetHashCode().
Item 11 - Prefer foreach Loops.

2. .NET Resource Management.
Item 12 - Prefer Variable Initializers to Assignment Statements.
Item 13 - Initialize Static Class Members with Static Constructors.
Item 14 - Utilize Constructor Chaining.
Item 15 - Utilize using and try/finally for Resource Cleanup.
Item 16 - Minimize Garbage.
Item 17 - Minimize Boxing and Unboxing.
Item 18 - Implement the Standard Dispose Pattern.

3. Expressing Designs with C#.
Item 19 - Prefer Defining and Implementing Interfaces to Inheritance.
Item 20 - Distinguish Between Implementing Interfaces and Overriding Virtual Functions.
Item 21 - Express Callbacks with Delegates.
Item 22 - Define Outgoing Interfaces with Events.
Item 23 - Avoid Returning References to Internal Class Objects.
Item 24 - Prefer Declarative to Imperative Programming.
Item 25 - Prefer Serializable Types.
Item 26 - Implement Ordering Relations with IComparable and Icomparer.
Item 27 - Avoid Icloneable.
Item 28 - Avoid Conversion Operators.
Item 29 - Use the new Modifier Only When Base Class Updates Mandate It.

4. Creating Binary Components.
Item 30 - Prefer CLS-Compliant Assemblies.
Item 31 - Prefer Small, Simple Functions.
Item 32 - Prefer Smaller, Cohesive Assemblies.
Item 33 - Limit Visibility of Your Types.
Item 34 - Create Large-Grain Web APIs.

5. Working with the Framework.
Item 35 - Prefer Overrides to Event Handlers.
Item 36 - Leverage .NET Runtime Diagnostics.
Item 37 - Use the Standard Configuration Mechanism.
Item 38 - Utilize and Support Data Binding.
Item 39 - Use .NET Validation.
Item 40 - Match Your Collection to Your Needs.
Item 41 - Prefer DataSets to Custom Structures.
Item 42 - Utilize Attributes to Simplify Reflection.
Item 43 - Don't Overuse Reflection.
Item 44 - Create Complete Application-Specific Exception Classes.

6. Miscellaneous.
Item 45 - Prefer the Strong Exception Guarantee.
Item 46 - Minimize Interop.
Item 47 - Prefer Safe Code.
Item 48 - Learn About Tools and Resources.
Item 49 - Prepare for C# 2.0.
Item 50 - Learn About the ECMA Standard.

Index.

Sample Chapter:Chapter 2 Item 18 - Implement the Standard Dispose Pattern
Amazon Link: Effective C#: 50 Specific Ways to Improve Your C# (Effective Software Development)

Expert C# 2005 Business Objects, Second Edition

By Rockford Lhotka
ISBN: 1-59059-632-3
696 pp.
Published: Mar 2006


Rockford Lhotka started writing his Business Objects books in 1996, and over the years, he’s become one of the world’s foremost authorities on building distributed object-oriented systems. His industry-standard VB .NET Business Objects book not only addresses changes in .NET 2.0 and Visual Studio 2005, but also reflects substantial enhancements and improvements to the CSLA .NET Framework and how it can be used to create enterprise-level .NET applications.

Expert C# 2005 Business Objects is for developers who want to see Lhotka’s ideas applied in the C# idiom. The book takes you from an opening discussion of logical architectures to detailed n-tier deployment options using the CSLA .NET Framework.

The depth of Rockford’s thinking now influences developers across language boundaries. With this book, you can learn directly from the expert whose framework has become universally accepted and respected.

Expert C# 2005 Business Objects, Second Edition

Table Of Contents
About the Author xv
About the Technical Reviewers xvii
Acknowledgments xix
Introduction xxi
CHAPTER 1 Distributed Architecture 1
CHAPTER 2 Framework Design 35
CHAPTER 3 Business Framework Implementation 91
CHAPTER 4 Data Access and Security 159
CHAPTER 5 Completing the Framework 235
CHAPTER 6 Object-Oriented Application Design 321
CHAPTER 7 Using the CSLA .NET Base Classes 361
CHAPTER 8 Business Object Implementation 405
CHAPTER 9 Windows Forms UI 465
CHAPTER 10 Web Forms UI 513
CHAPTER 11 Web Services Interface 563
CHAPTER 12 Implementing Remote Data Portal Hosts601
INDEX 621


Sample Chapter: Chapter 06 Excerpt, "Object-Oriented Application Design"
Amazon Link: Expert C# 2005 Business Objects, Second Edition

Visual Basic 2005 Cookbook


Title: Visual Basic 2005 Cookbook
Subtitle: Solutions for VB 2005 Programmers
First Edition: September 2006
Series: Cookbooks
ISBN 10: 0-596-10177-5
ISBN 13: 9780596101770
Pages: 740

Description
This book will help you solve more than 300 of the most common and not-so-common tasks that working Visual Basic 2005 programmers face every day. If you're a seasoned .NET developer, beginning Visual Basic programmer, or a developer seeking a simple and clear migration path from VB6 to Visual Basic 2005, the Visual Basic 2005 Cookbook delivers a practical collection of problem-solving recipes for a broad range of Visual Basic programming tasks.
The concise solutions and examples in the Visual Basic 2005 Cookbook range from simple tasks to the more complex, organized by the types of problems you need to solve. Nearly every recipe contains a complete, documented code sample showing you how to solve the specific problem, as well as a discussion of how the underlying technology works and that outlines alternatives, limitations, and other considerations. As with all O'Reilly Cookbooks, each recipe helps you quickly understand a problem, learn how to solve it, and anticipate potential tradeoffs or ramifications.


Useful features of the book include:

  • Over 300 recipes written in the familiar O'Reilly Problem-Solution-Discussion format
  • Hundreds of code snippets, examples, and complete solutions available for download
  • VB6 updates to alert VB6 programmers to code-breaking changes in Visual Basic 2005
  • Recipes that target Visual Basic 2005 features not included in previous releases
  • Code examples covering everyday data manipulation techniques and language fundamentals
  • Advanced projects focusing on multimedia and mathematical transformations using linear algebraic methods
  • Specialized topics covering files and file systems, printing, and databases

In addition, you'll find chapters on cryptography and compression, graphics, and special programming techniques. Whether you're a beginner or an expert, the Visual Basic 2005 Cookbook is sure to save you time, serving up the code you need, when you need it.

Preface

1. Visual Basic Programming
1.1 Creating a Windows Forms Application
1.2 Creating a Console Application
1.3 Creating an ASP.NET Web Forms Application

2. The Development Environment
2.1 Discovering and Using a Code Snippet
2.2 Creating a New Snippet
2.3 Sharing Snippets
2.4 Adding Snippet Files to Visual Studio
2.5 Getting an Application's Version Number
2.6 Letting Visual Studio Automatically Update an Application's Version Number
2.7 Setting the Startup Form for an Application
2.8 Setting the Startup to a Sub Main Procedure
2.9 Getting an Application's Command Line
2.10 Testing an Application's Command Line
2.11 Obfuscating an Application
2.12 Determining if an Application Is Running in the Visual Studio Environment
2.13 Accessing Environment Variables
2.14 Accessing the Registry
2.15 Getting System Information
2.16 Getting the User's Name

3. Application Organization
3.1 Creating a Code Module
3.2 Creating a Class
3.3 Creating a Structure
3.4 Creating Other Item Types
3.5 Creating Object Instances
3.6 Initializing a Class Instance with Data
3.7 Releasing an Instance's Resources
3.8 Using Namespaces
3.9 Splitting a Class Across Multiple Files
3.10 Creating a Form Based on Another Form
3.11 Passing and Returning Structures and Other Objects
3.12 Creating and Using an Enumeration
3.13 Converting Between Numeric and String Enumeration Values
3.14 Creating a Method That Accepts Different Sets of Arguments
3.15 Using Standard Operators for Nonstandard Purposes
3.16 Enforcing Strong Data Typing in an Otherwise Weakly Typed Collection

4. Forms, Controls, and Other Useful Objects
4.1 Creating and Adding Controls at Runtime
4.2 Iterating Through All Controls on a Form
4.3 Sharing Event-Handler Logic Among Many Controls
4.4 Working with Timers
4.5 Determining if a Control Can Take the Focus
4.6 Programmatically Clicking a Button
4.7 Drawing a Control
4.8 Making a Form the Top-Most Form
4.9 Indicating the Accept and Cancel Buttons on a Form
4.10 Remembering a Form's Position Between Uses
4.11 Attaching a Control to the Edge of a Form
4.12 Moving or Resizing Controls as a Form Resizes
4.13 Limiting the Sizing of a Form
4.14 Centering a Form
4.15 Creating and Moving a Borderless Form
4.16 Creating a Fading Form
4.17 Creating a Nonrectangular Form
4.18 Changing Menus at Runtime
4.19 Creating Shortcut Menus

5. Strings
5.1 Using a StringBuilder
5.2 Creating a String of N Identical Characters
5.3 Creating a String by Repeating a String N Times
5.4 Obfuscating a String
5.5 Converting Binary Data to a Hexadecimal String
5.6 Extracting Substrings from Larger Strings
5.7 Converting a String's Case
5.8 Comparing Strings with Case Sensitivity
5.9 Comparing Strings Without Case Sensitivity
5.10 Converting Strings to and from Character Arrays
5.11 Converting Strings to and from Byte Arrays
5.12 Tallying Characters
5.13 Counting Words
5.14 Removing Extra Whitespace
5.15 Using the Correct End-of-Line Characters
5.16 Replacing Substrings
5.17 Inserting a Character or String
5.18 Inserting a Line
5.19 Double-Spacing a String
5.20 Formatting Numbers into Strings
5.21 Trimming Sets of Characters from a String
5.22 Identifying and Validating Types of Data in a String
5.23 Converting Strings Between Encoding Systems
5.24 Determining a Character's Type
5.25 Parsing Strings
5.26 Concatenating Strings
5.27 Speeding Up String Manipulation
5.28 Counting Occurrences of a Substring
5.29 Padding a String for Exact Length and Alignment
5.30 Converting Tabs to Spaces
5.31 Reversing a String
5.32 Shuffling a String
5.33 Using a Simple String Encryption
5.34 Converting a String to Morse Code
5.35 Adding Strings to an Application's Resources
5.36 Converting Any Data to a String
5.37 Using Regular Expressions to Extract All Numbers
5.38 Getting a Count of Regular Expression Matches
5.39 Getting the Nth Regular Expression Match
5.40 Compiling Regular Expressions for Speed
5.41 Using Regular Expressions to Validate Data
5.42 Using Regular Expressions to Count Characters, Words, or Lines
5.43 Converting a String to and from Base64
5.44 Splitting a String
5.45 Creating a String of Space Characters

6. Numbers and Math
6.1 Using Compact Operator Notation
6.2 Choosing Integers of the Right Size and Type for the Job
6.3 Using Unsigned Integers
6.4 Swapping Two Integers Without Using a Third
6.5 Using Single- and Double-Precision Variables
6.6 Using Decimal Variables for Maximum Precision
6.7 Converting Between Number Types
6.8 Rounding Numbers Accurately
6.9 Declaring Loop Counters Within Loops
6.10 Converting Between Radians and Degrees
6.11 Limiting Angles to a Range
6.12 Creating Double-Precision Point Variables
6.13 Converting Between Rectangular and Polar Coordinates
6.14 Creating Three-Dimensional Variables
6.15 Converting Between Rectangular, Spherical, and Cylindrical Coordinates
6.16 Working with Complex Numbers
6.17 Solving Right Triangles
6.18 Solving Any Triangle
6.19 Determining if a String Contains a Valid Number
6.20 Converting Numbers to Integers
6.21 Calculating p to Thousands of Digits
6.22 Getting a Number's Prime Factors
6.23 Using Recursion to Calculate Factorials
6.24 Manipulating Bits with Bitwise Operators
6.25 Storing and Retrieving Bits in a BitArray
6.26 Enhancing the Random Number Generator
6.27 Generating Random Integers in a Range
6.28 Generating Random Real Numbers in a Range
6.29 Generating Normal-Distribution Random Numbers
6.30 Generating Exponential-Distribution Random Numbers
6.31 Creating a Matrix
6.32 Inverting a Matrix
6.33 Calculating the Determinant of a Matrix
6.34 Solving Simultaneous Equations
6.35 Listing of the MatrixHelper Class

7. Dates and Times
7.1 Getting the System Date and Time
7.2 Accessing the System's Time Zone
7.3 Using System Ticks
7.4 Timing Application Activities
7.5 Calculating Elapsed Time Using Ticks
7.6 Calculating Elapsed Time with the Stopwatch
7.7 Extracting Year, Month, and Day Numbers from a Date Value
7.8 Extracting Hour, Minute, and Second Numbers from a Date Value
7.9 Creating a Date or Time Value from Its Parts
7.10 Formatting Dates and Times
7.11 Parsing and Validating Dates and Times
7.12 Adding to Dates and Times
7.13 Subtracting from Dates and Times
7.14 Determining the Number of Days Between Two Dates
7.15 Determining the Day of the Week for a Date
7.16 Determining the Day of the Year for a Date
7.17 Determining the Number of Days in a Month
7.18 Using Controls to Enter or Select a Date
7.19 Calculating the Phase of the Moon
7.20 Creating a Calendar
7.21 Checking for Leap Years
7.22 Dates and Times in ISO 8601 Formats

8. Arrays and Collections
8.1 Filling an Array While Declaring It
8.2 Sorting Array Elements
8.3 Reversing an Array
8.4 Inserting into an Array
8.5 Shuffling an Array
8.6 Swapping Two Array Values
8.7 Resizing Arrays Without Losing Existing Values
8.8 Quickly Copying Part of an Array into Another
8.9 Writing a Comma-Separated-Values File from a String Array
8.10 Reading a Comma-Separated-Values File into a String Array
8.11 Using a Multivalue Array Instead of a Two-Dimensional Array
8.12 Converting Between Delimited Strings and Arrays
8.13 Formatting an Array as a Single String
8.14 Iterating Through Array Elements
8.15 Passing Arrays to Methods
8.16 Returning Arrays from Functions
8.17 Creating a Collection
8.18 Inserting an Item into a Collection
8.19 Deleting a Collection Item
8.20 Iterating Through a Collection

9. Graphics
9.1 Creating Graphics Objects
9.2 Drawing on Controls for Special Effects
9.3 Letting the User Select a Color
9.4 Working with Coordinate Systems (Pixels, Inches, Centimeters)
9.5 Creating a Bitmap
9.6 Setting a Background Color
9.7 Drawing Lines, Ellipses, and Rectangles
9.8 Drawing Lines One Pixel Wide Regardless of Scaling
9.9 Forcing a Form or Control to Redraw
9.10 Using Transparency
9.11 Scaling with Transforms
9.12 Using an Outline Path
9.13 Using Gradients for Smooth Color Changes
9.14 Drawing Bezier Splines
9.15 Drawing Cardinal Splines
9.16 Limiting Display Updates to Specific Regions
9.17 Drawing Text
9.18 Rotating Text to Any Angle
9.19 Mirroring Text on the Canvas
9.20 Getting the Height and Width of a Graphic String
9.21 Drawing Text with Outlines and Drop Shadows
9.22 Calculating a Nice Axis
9.23 Drawing a Simple Chart
9.24 Creating Odd-Shaped Forms and Controls
9.25 Using the RGB, HSB (HSV), and HSL Color Schemes
9.26 Creating a Rubber-Band Rectangular Selection
9.27 Animating with Transparency
9.28 Substitutions for Obsolete Visual Basic 6.0 Features

10. Multimedia
10.1 Playing an Audio File
10.2 Displaying Image Files
10.3 Playing a Video File
10.4 Making Your Computer Beep
10.5 Creating an Animation Using Multiple Images
10.6 Creating an Animation by Generating Multiple Bitmaps
10.7 Creating an Animation by Drawing at Runtime
10.8 Creating Animated Sprites
10.9 Resizing and Compressing JPEG Files
10.10 Getting JPEG Extended Information
10.11 Creating Thumbnails
10.12 Displaying Images While Controlling Stretching and Sizing
10.13 Scrolling Images
10.14 Merging Two or More Images
10.15 Using Resource Images
10.16 Capturing an Image of the Screen
10.17 Getting Display Dimensions
10.18 Speeding Up Image Processing
10.19 Converting an Image to Grayscale
10.20 Performing Edge Detection on an Image
10.21 Full Listing of the LockImage Class

11. Printing
11.1 Enumerating Printers
11.2 Sending "Raw" Data to a Printer
11.3 Get Details About the Default Printer
11.4 Creating a Print Preview
11.5 Prompting for Printed Page Settings
11.6 Drawing Text and Graphics to a Printer
11.7 Determining the Print Destination
11.8 Creating Graph Paper

12. Files and File Systems
12.1 Enumerating Drives
12.2 Determining if a Directory Exists
12.3 Creating a New Directory
12.4 Copying Directories
12.5 Moving Directories
12.6 Renaming Directories
12.7 Parsing File and Directory Paths
12.8 Searching Iteratively Through Directories and Subdirectories
12.9 Finding Directories and Files Using Wildcards
12.10 Determining if a File Exists
12.11 Getting and Setting File Attributes
12.12 Accessing Special User and Windows Directories
12.13 Determining the Space on a Drive
12.14 Browsing for a Directory
12.15 Getting File Information
12.16 Using File-Access Methods
12.17 Reading and Writing Files as Strings
12.18 Reading and Writing Binary Files
12.19 Copying or Moving a File
12.20 Sending a File to the Recycle Bin
12.21 Creating a Temporary File
12.22 Calculating a Checksum for a File
12.23 Comparing Two Files for Equality
12.24 Locking a File During Access
12.25 Reading from a File at a Specific Position
12.26 Reading and Writing Objects in a File
12.27 Creating a Comma-Separated-Values File

13. Databases
13.1 Connecting to a Data Provider
13.2 Issuing SQL Commands
13.3 Retrieving Results from a Database Query
13.4 Using SQL Parameters
13.5 Using Stored Procedures
13.6 Using Transactions
13.7 Storing the Results of a Query in Memory
13.8 Creating In-Memory Data Tables Manually
13.9 Writing In-Memory Data Tables to an XML File
13.10 Reading an XML File into In-Memory Data Tables

14. Special Programming Techniques
14.1 Preventing Multiple Instances of a Running Application
14.2 Creating a Simple User Control
14.3 Describing User Control Properties
14.4 Starting Other Applications by EXE, Document, or URL
14.5 Waiting for Applications to Finish
14.6 List All Running Processes
14.7 Terminating a Running Process
14.8 Pausing Execution of a Program
14.9 Control Applications by Simulating Keystrokes
14.10 Watching for File and Directory Changes
14.11 Creating an Icon in the System Tray
14.12 Accessing the Clipboard
14.13 Adding Tooltips to Controls
14.14 Dragging and Dropping Files to a ListBox
14.15 Dragging and Dropping Between ListBox Controls
14.16 Disposing of Objects Appropriately
14.17 Fine-Tuning Garbage Collection
14.18 Moving the (Mouse) Cursor
14.19 Intercepting All Key Presses on a Form
14.20 Accessing the Registry
14.21 Running Procedures in Threads
14.22 Reading XML into a TreeView
14.23 Creating an XML Document
14.24 Validating an XML Document
14.25 Using Generic Collections
14.26 Creating a Screensaver
14.27 Localizing the Controls on a Form
14.28 Adding Pop-up Help to Controls
14.29 Maintaining User-Specific Settings Between Uses of an Application
14.30 Verifying a Credit Card Number
14.31 Capturing a Console Application's Output
14.32 Reading an Assembly's Details
14.33 Performing Serial I/O
14.34 Rebooting the System

15. Exceptions
15.1 Catching an Exception
15.2 Throwing an Exception
15.3 Catching Unhandled Exceptions
15.4 Displaying Exception Information
15.5 Creating New Exception Types
15.6 Ignoring Exceptions in a Block of Code
16. Cryptography and Compression

16.1 Generating a Hash
16.2 Encrypting and Decrypting a String
16.3 Encrypting and Decrypting a File
16.4 Prompting for a Username and Password
16.5 Handling Passwords Securely
16.6 Compressing and Decompressing a String
16.7 Compressing and Decompressing a File
16.8 Generating Cryptographically Secure Random Numbers
16.9 Complete Listing of the Crypto.vb Module
16.10 Complete Listing of the Compress.vb Module

17. Web Development
17.1 Displaying Web Pages on a Form
17.2 Accessing Content Within an HTML Document
17.3 Getting All Links from a Web Page
17.4 Get the Local Computer's IP Address
17.5 Resolving a Host Name or IP Address for Another Computer
17.6 Pinging an IP Address
17.7 Using FTP to Download Files
17.8 Calling a Web Service
17.9 Sending Email Using SMTP
17.10 Getting POP3 Emails
17.11 Sending a Message to Another Computer
17.12 Adding Hyperlinks to a (Desktop) Form

Index

Sample Chapter: Chapter 4: Forms, Controls, and Other Useful Objects (PDF Format)
Amazon Link: Visual Basic 2005 Cookbook