Performance Optimization

A couple notes from the past few days of tweaks and fixes:

Hyper-threading has a huge effect on LAMP performance. 
From now on, I’ll have bad dreams about running MySQL without Query Caching in the way that I used to have nightmares about going to school wearing only my underwear. The difference is that big. 
WordPress rocks, but [...]

Using XML In PHP5

Everybody likes documentation. The Zend folks posted this overview and SimpleXML introduction The O’Reilly folks at ONLamp offered this guide to using SimpleXML. Of course, there’s always the SimpleXML docs at PHP.net.
Two problems: I haven’t encountered CDATA in my XML yet, but I do hope to develop a better solution than offered here when I [...]

I Will Crush You

Or, er, my server will be crushed. I guess I should admit that my stuff could do with some optimization, maybe. Perhaps what I really need is something faster than Celeron with 512MB RAM. Maybe.

tags: 512mb ram, apache, break point, breaking point, celeron, crushed, load average, mysql, php, server, top, web server

PHP5 + XML = LOVE

The Zend overview of the new XML features in PHP 5 has re-energized me for building XML Server Applications at my library.
xml, php, web development

Library-Related Geekery

Ryan beat me to reporting on the interesting new services at the Ockham Network (noted in this Web4lib post). The easiest one to grok is this spelling service, but there are others that are cooler.
He also alerted me to a Perl script to proxy Z39.50 to RSS. Though for those more into PHP (like me), [...]

PHP Developer Resources

Somebody asked for some links to get started with PHP. Of course I lead them to the PHP.net official site, where the documentation is some of the best I’ve seen for any product.
I also suggested PHPDeveloper.org and PHPFreaks.com, though the truth is I usually Google any questions I have that the official docs don’t answer. [...]

XML/PHP/SWF Charts

Flash app dynamically generates charts based on XML formated data or values in a PHP array.
XML/SWF Charts is a simple, yet powerful tool to create attractive web charts and graphs from dynamic XML data. Create an XML source to describe a chart, then pass it to this tool’s flash file to generate the chart. The [...]

WordPress’ is_X() function

An entry at the WordPress support forums gave me the list I needed. How do they work?
“You can use [these] in a conditional to display certain stuff only on [certain] page[s], or to omit certain stuff on [those] page[s].”
Here’s the list:

is_404()
is_archive()
is_author()
is_category()
is_date()
is_day()
is_feed()
is_home()
is_month()
is_new_day()
is_page()
is_search()
is_single()
is_time()
is_year()

So there you go.

tags: is_X(), php, wordpress

RegEx Reference

Regular expressions are a pain. Jan Goyvaerts’ RegEx Reference helps.
In a related tip, the following will eliminate any non-numeric components in a string: ereg_replace(“[^0-9]”, “”, $string) . I guess I’ll have to admit that I’d not used the exclusion operator before (the carrot immediately following a square bracket). Now I know.

tags: ereg_replace, exclusion operator, php, [...]

One Step Forward…

I thought I was real smart when I modified the tags plugin to support integration with Technorati. The code was simple, just look in the tags.php plugin file for the foreach statements that run through the tags names and turn them into links on the page and change the $tags[] = statement to look something [...]