Submitted by Nola Stowe on Wed, 2006-12-13 11:41.
Apress: Beginning Ajax with PHP by Lee Babin
The book starts out exactly how I would write it -- SIMPLE! The first time I did Ajax with XHR (xml http request), I used a plain text file, which I then read into a DIV at the click of a link. This takes a similar approach and has data stored in an array which is then accessed with a simple call to a PHP file. The following chapter, takes it a step further and this building upon previous chapters is a common theme in the book.
Submitted by Nola Stowe on Fri, 2006-12-01 09:27.
Book Review: PHP Hacks by Jack D. Herrington, published by O'Reilly
I had borrowed a Perl Hacks book from and friend and really liked it, it was great! It had a lot of practical things as well as some fun things. I expected the same from PHP Hacks and I was not disappointed!
Here’s the table of contents: http://www.oreilly.com/catalog/phphks/toc.html
O’Reilly also has some sample hacks: http://www.oreilly.com/catalog/phphks/chapter/index.html
Here's some that I found interesting:
The Practical Stuff
Not familiar with the term? Check it out. I think this hack may get you started on a breadcrumb function/method. In the end they suggest a xml file to show which page urls were parents of which. The way I've done this before was I had a class for each major section, and sub section, and had a method ->addCrumb($label, $url) which I had in the constructor…and the subsections of course would call the parent contructor and it kept the breadcrumb hierarchy intact. But hey, that’s the fun of programming - different ways to do the same thing to meet different needs! Definitely a good hack to get the juices flowing!
Following on from the last part, this one is more of an intermission—a round up of regex syntax seen so far and a couple of links following feedback.
First you have to check out Andrei’s Regex Clinic (slides / pdf)—even if you don’t get it all, it’s worth it for the pictures at the start ;) That’s Andrei as in Zmievski, as in works at Yahoo, can be blamed for Smarty and PHP-GTK, is one of those who needs thanking when PHP6 (with Unicode) hits the streets and, long ago, even did an interview with Sitepoint.
Andrei’s talk also prompts me to confession: I’m not qualified to tell you about the theory behind regular expressions (if you’re interested, start here and Google for more—or annoy these guys)—I’m coming from a practical perspective so while these blogs will (hopefully) help you discover regexes as a useful tool, don’t expect to find out how to to write your own regex engine.
Cairo is the “next generation” vector graphics library for Linux and very cool to have it available in PHP. Also cool about the extension was created using PEAR::CodeGen_PECL, which Hartmut describes here: look Mum—no C! (well almost).
Related to recent UTF-8 discussions…
- Rebuilding 4.0 data into 4.1 data
- What does mySQL 4.1 do with utf8 and collation
- Calculating utf8 sizes for varchars
- MySQL 4.1 and insert or Load data warnings
- Note about utf8_bin
- Quick php script to figure out bad utf8 characters. (Blogger.com really needs to sort out syntax formatting and highlighting!)
Will update the wiki in due course.
Rob Walling managed to generate a lot of interest in writing Personality Traits of the Best Software Developers. While I vaguely agree with Rob’s points, at some level reading it produces a feeling which I can only compare to finding a fingernail in your sandwich.
On this “perfect developer” profile, strikes me there are a couple of missing points (for starters!). Based on my own flawed view of things…
- Is passionate about what they do. Let’s face it—staring at a monitor for 8+ hours a day ain’t Rock N’ Roll (well for most of us anyway)—at some fundamental level you have to enjoy doing this stuff. Put another way—I’d rather work with a passionate trainee than a bored veteran.
- Has some humility. Being “wrong” is inevitable—you will write code that has bugs, you will produce suboptimal designs and you’re not an expert on everything—how would Linus fare with CSS? If you can’t admit you’re in the wrong, there’s little space to fix problems, learn from mistakes plus you’re probably hard to work with. Inverting this—between binary 0 and 1, there’s no room for ego. The danger, given you’re spending a fair chunk of your life at the keyboard, is your perceived self-worth becomes attached to your ability to hack—an affront to your code becomes a deeply personal attack…
More nit-picking in detail…
Submitted by Keith Casey on Fri, 2006-07-07 11:18.
If you're considering submitting, don't forget that today is the deadline:
Submitted by Peter Harkins on Tue, 2006-06-27 10:10.
I wrote about building a site with clean URLs, but that's useless to you. No, you've got a creaking hulking monster of a site that coughs up URLs like "render.php?action=list_mailbox&id=42189", was built "to meet an accelerated schedule", and eats summer interns whole.
This article tells you how to put clean and human-usable URLs on top of the site without even editing your underlying scripts. All these examples mention PHP but it doesn't matter what you coded the site in, you just have to be running Apache and have a little familiarity with regular expressions.
So we have two goals. First, requests for the new URL are internally rewritten to call the existing scripts without users ever knowing they exist. Second, requests for the old URLs get a 301 redirect to the new URLs so that search engines and good bookmarks immediately switch to the new URLs.
Let's work through an example .htaccess file. We take apart the new URLs and map them internally to the old URLs:
Chris Jones just announced the publication of the PHP and Oracle Manual (PDF) and from a high speed eyeballing, it’s good—basically tells you everything you need to know to be able to do useful stuff with PHP + Oracle but with little assumed knowledge.
In fact it seems to be geared to the typical LAMP developer—for example there’s a section on “Installing Oracle XE on Debian, Ubuntu and Kubuntu” plus sections on “Limiting Rows and Creating Paged Datasets” and “Auto-Increment Columns” show an awareness that readers will probably have MySQL experience.
Perhaps one addendum (I didn’t find reference to it) would be pointing readers at SQL Developer, which is a fairly new, free offering from Oracle as a desktop based development tool—the Underground manual focuses on a web based interface to Oracle—something logically equivalent to phpMyAdmin and a good starting point I guess but if you have to do real work, SQL Developer is probably a better choice.