Computer Programming

Yes, a bit specific, but I need to store some links!

Risks of Web Services to Applications

Increasingly, applications are dependent on external web services.

Data and Input Validation with Filters (PHP 5.2 and up)

For years (and years) we've done data validation in PHP "by hand" either with string functions or with regular expressions. The problem with PHP has been that, well, PHP programmers aren't so great at regexs. Also, unlike Perl, there's no data tainting feature that forces you to validate your inputs before they're used in expressions. (Correction, there is a tainting extension.) The upshot is that a lot of bad data gets through. PHP finally added some data validation function, but it seems like nobody is using them. It still lacks tainting. The former problem, we can address.

Screen Scraper in Perl to Extract Dates and Times

This is something I wrote to learn some of the latest Perl tech to scrape pages. What's cool about this demo script is that it doesn't use regular expressions that much.

Reading Code with GVIM/VIM and ctags

Vim/GVim has great features to make it easy to read C (and PHP and Perl) code.


This is a list of links to articles about OOP in PHP. I need to read up on it. Though I know the OO features (most of them at least) I wanted to read some code.

Formatting Email So It Looks the Same on All the Clients and Browsers

I was having lots of problems with HTML email layouts. After doing some research, I came up with a method to get almost pixel-perfect positioning and sizing. It's not that hard.

Shared Memory Example

Here's one for the noobs (from a noob). This demonstrates the use of shared memory. It's a program that spawns 10 children, and each one gets a special "babytalk" word to say.


I've never put a ID onto the BODY tag, but here's a situation where it's useful.

Normally, an article has an H1 tag that contains the title for the page.  You do this for SEO reasons, as well as semantics.

Loop Faster

nzakas has a great presentation about speeding up Javascript loops but it applies to any language that uses C-like loop structures.

SFF Computers

This rant is so right. SFF computers with power bricks suck.

Code Is Usually Not Data

One of the big problems with PHP is the include statement. You can include a file. You can define that file at runtime, and alter it during runtime.

Caching Data for AJAX with Javascript

Here's a way to cache data on the client side, via javascript. This was tested on Firefox 3.6.3 on Ubuntu.

The idea is to convert your data into Javascript, and then load it with the SCRIPT tag. You then use the Expires HTTP header to tell the client how long to cache the data. Finally, you use some Javascript code to display the data.

Image with Transparent Caption

Here's some HTML and CSS to make an image with a transparent caption that displays over the image.

<style type="text/css">
  .caption-background {
      width: 500px;

CodeIgniter loader class? WTF?

Here is something I can't understand The CodeIgniter Loader class.

It's just weird. When you load a class, it's instantiated and made an attribute of the $this object. That has a real "Javascript" feel to it.

Beyond that, I think class loaders sometimes obfuscate where the included files reside. That might seem okay, or even "cool", but I find it annoying.

What is dirname(__FILE__) about?

The old Slaptech framework had the old PHP includes problem, where one cannot to include() a file relative to the current file.

Syndicate content