Thursday, January 8, 2009

Emperors New Mind or Wicked Cool PHP

Emperor's New Mind: Concerning Computers, Minds, and the Laws of Physics

Author: Roger Penros

For decades, proponents of artificial intelligence have argued that computers will soon be doing everything that a human mind can do. Admittedly, computers now play chess at the grandmaster level, but do they understand the game as we do? Can a computer eventually do everything a human mind can do?
In this absorbing and frequently contentious book, Roger Penrose--eminent physicist and winner, with Stephen Hawking, of the prestigious Wolf prize--puts forward his view that there are some facets of human thinking that can never be emulated by a machine. Penrose examines what physics and mathematics can tell us about how the mind works, what they can't, and what we need to know to understand the physical processes of consciousness.
He is among a growing number of physicists who think Einstein wasn't being stubborn when he said his "little finger" told him that quantum mechanics is incomplete, and he concludes that laws even deeper than quantum mechanics are essential for the operation of a mind. To support this contention, Penrose takes the reader on a dazzling tour that covers such topics as complex numbers, Turing machines, complexity theory, quantum mechanics, formal systems, Godel undecidability, phase spaces, Hilbert spaces, black holes, white holes, Hawking radiation, entropy, quasicrystals, the structure of the brain, and scores of other subjects.
The Emperor's New Mind will appeal to anyone with a serious interest in modern physics and its relation to philosophical issues, as well as to physicists, mathematicians, philosophers and those on either side of the AI debate.

Interesting textbook: The Betrayal of America or Bobby and J Edgar

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems

Author: William Steinmetz

PHP is an easy-to-use scripting language perfect for quickly creating the Web features you need. Once you know the basics of how the language works, wouldn't it be great to have a collection of useful scripts that solve those tricky problems and add interesting functionality to your site? We thought so, too.

Instead of starting at "Hello World," "Wicked Cool PHP" assumes that you're familiar with the language and jumps right into the good stuff. After you learn the FAQs of life-the most commonly wished for PHP scripts-you'll work your way through smart configuration options and the art of forms, all the way through to complex database-backed scripts.

"Wicked Cool PHP" contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text. The 76 easily implemented scripts will also teach you how to:

Send and receive email notifications Track your visitors' behavior with cookies and sessions Override PHP's default settings Manipulate dates, images, and text on the fly Harness SOAP and other web services Create an online poll, ecard delivery system, and blog

But it's not all fun and games: Security is a big concern when programming any web application. So you'll learn how to encrypt your confidential data, safeguard your passwords, and prevent common cross-site-scripting attacks. And you'll learn how to customize all of the scripts to fit your own needs.

Dynamic Web content doesn't have to be difficult. Learn the secrets of the craft from two experienced PHP developers with "Wicked Cool PHP,"

Table of Contents:
Introduction     xiii
The Faqs of Life-The Scripts Every PHP Programmer Wants (or Needs) to Know     1
Including Another File as a Part of Your Script     2
What Can Go Wrong?     3
Highlighting Alternate Row Colors in a Table     4
Hacking the Script     5
Creating Previous/Next Links     7
Using the Script     10
Printing the Contents of an Array     11
Turning an Array into a Nonarray Variable That Can Be Restored Later     12
What Can Go Wrong?     12
Sorting Multidimensional Arrays     13
Hacking the Script     14
Templating Your Site with Smarty     14
Installing Smarty     14
A Brief Smarty Tutorial     15
What Can Go Wrong?     16
Hacking the Script     17
Configuring PHP     19
Configuration Settings and the php.ini File     20
Locating Your php.ini File     20
Revealing All of PHP's Settings     21
Reading an Individual Setting     21
Error Reporting     22
Common Error Messages     23
Suppressing All Error Messages     24
Extending the Run Time of a Script     24
What Can Go Wrong?     25
Preventing Users from Uploading Large Files     25
Turning Off Registered Global Variables     25
Enabling Magic Quotes     26
What Can Go Wrong?     26
Restricting the Files that PHP Can Access     26
What Can Go Wrong?     27
Shutting Down Specific Functions     27
Adding Extensions to PHP     27
Adding PHP Extensions     28
Installing Extensions with a Web-Based Control Panel     29
What Can Go Wrong?     32
PHP Security     33
Recommended Security Configuration Options     35
SQL Injection Attacks     35
Preventing Basic XSS Attacks     37
Using SafeHTML     38
What Can Go Wrong?     39
Protecting Data with a One-Way Hash     40
Hacking the Script     41
Encrypting Data with Mcrypt     41
Hacking the Script     43
Generating Random Passwords     43
Using the Script     44
Working with Forms     45
Security Measures: Forms Are Not Trustworthy     45
Verification Strategies     46
Using {dollar}_POST, {dollar}_GET, {dollar}_REQUEST, and {dollar}_FILES to Access Form Data     47
Fetching Form Variables Consistently and Safely     47
Trimming Excess Whitespace     47
Importing Form Variables into an Array     48
Making Sure a Response Is One of a Set of Given Values     51
Hacking the Script     51
Using Multiple Submit Buttons     52
Validating a Credit Card     52
Using the Script     54
Hacking the Script     55
Double-Checking a Credit Card's Expiration Date     55
Using the Script     56
Checking Valid Email Addresses     56
Checking American Phone Numbers     57
Working with Text and HTML     59
Extracting Part of a String     59
Hacking the Script     61
Making a String Uppercase, Lowercase, or Capitalized     62
What Can Go Wrong?     62
Finding Substrings     63
What Can Go Wrong?     64
Replacing Substrings     64
What Can Go Wrong?     65
Finding and Fixing Misspelled Words with pspell     65
Working with the Default Dictionary     66
Adding a Custom Dictionary to pspell      68
What Can Go Wrong?     69
Regular Expressions     69
Regular Expression Basics     69
Special Character Sequences     70
Pattern Repeaters     71
Grouping     71
Character Classes     71
Putting It All Together     72
Matching and Extracting with Regular Expressions     72
Replacing Substrings with Regular Expressions     74
Rearranging a Table     75
Creating a Screen Scraper     75
Hacking the Script     77
Converting Plaintext into HTML-Ready Markup     77
Automatically Hyperlinking URLs     80
Stripping HTML Tags from Strings     80
Working with Dates     81
How Unix Time Works     81
Getting the Current Timestamp     82
Getting the Timestamp of a Date in the Past or Future     83
Creating Timestamps from a String     83
Creating Timestamps from Date Values     84
Formatting Dates and Times     85
Calculating the Day of the Week from a Given Date     88
Finding the Difference Between Two Dates     88
Using the Script     89
Hacking the Script      90
MySQL Date Formats     90
Working with Files     91
File Permissions     91
Permissions with an FTP Program     92
The Command Line     93
What Can Go Wrong?     93
Placing a File's Contents into a Variable     93
Hacking the Script     95
What Can Go Wrong?     95
Creating and Writing to a File     96
Checking to See If a File Exists     96
Deleting Files     97
Uploading Images to a Directory     97
Using the Script     101
What Can Go Wrong?     101
Hacking the Script     101
Reading a Comma-Separated File     101
User and Session Tracking     103
Using Cookies and Sessions to Track User Data     104
Cookies     104
Sessions     104
Creating a "Welcome Back, Username!" Message with Cookies     105
What Can Go Wrong?     106
Using Sessions to Temporarily Store Data     107
What Can Go Wrong?     109
Checking to See If a User's Browser Accepts Cookies     109
Redirecting Users to Different Pages     110
Forcing a User to Use SSL-Encrypted Pages      111
Extracting Client Information     111
Session Timeouts     115
A Simple Login System     116
Working with Email     119
Using PHPMailer to Send Mail     120
Installing PHPMailer     120
Using the Script     121
Adding Attachments     122
What Can Go Wrong?     123
Using Email to Verify User Accounts     124
Working with Images     129
Creating a CAPTCHA (Security) Image     129
Creating Thumbnail Images     136
Using cURL to Interact with Web Services     141
Connecting to Other Websites     142
Using Cookies     144
Transforming XML into a Usable Form     144
Using Mapping Web Services     146
Using PHP and SOAP to Request Data from     149
Building a Web Service     151
Intermediate Projects     155
A User Poll     156
Creating a Ballot Form     157
Processing the Ballot     159
Getting Poll Results     160
Hacking the Script     162
Electronic Greeting Cards     162
Choosing a Card      164
Sending the Card     165
Viewing the Card     169
Hacking the Script     171
A Blogging System     171
Creating Blog Entries     172
Displaying an Entry     174
Adding Comments     178
Creating a Blog Index     178
Hacking the Script     181
Appendix     183
Index     185

No comments:

Post a Comment