Computer Programming

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

Be Specific; The Inner Platform Effect

Here are some choice words about seemingly perpetual problems that emerge in software development.

RAID 5 Parity. What is it, and how does it work?

One morning, I started wondering how RAID 5 parity works to rebuild a disk array. It seemed "magical" to me, that you can get redundancy and still use most of your disk capacity.

Resolve IP Addresses to DNS Names

Sometimes, you have textual data, like log files, with IP addresses. You sometimes want this data to show hostnames instead.

j_oocms - an excessively object-oriented cms

They say it's bad to use extend too much. This is a *bad* cms.

It's a simple image gallery, suitable for things like personal image hosting.

No Eval? Variable Interpolation on PHP Code

We recently turned off the websites' ability to use the eval() or related functions. In a small CMS I'd written a while back, I was using eval to interpolate variable names in strings. This was a simple way to do "lazy evaluation" on strings I was using as templates. With eval, there was no need to use a special templating syntax - the syntax was PHP's.

Now, with eval turned off, I needed a function to interpolate variables in a string. Here it is:


function interpolate( $string )
{
    foreach ($GLOBALS as $name => $value)
    {
        $string = str_replace( '$'.$name, $value, $string );
    }
    $string = preg_replace( '/[$]\\w+/', '', $string );
    return $string;
}

TXTMOB for Web Hosts (project)

This is a hack of txtmob that's being developed to run on cheap web hosts.

So far, it'll let you send to the group via the web form, so it's suitable for a one-way, moderated list. Good for news.

The sms forwarding feature doesn't work, so, it's not able to do "real" txtmob yet. Maybe it will one day... This code is very alpha, and based on code from SourceForge, that was at version 0.14, so you know what you're getting :-)

I'm not forking the project. This is just a personal fork for personal use.

Fun Details, and Some Roadmapping

Mutliple Time Sheets 6, Finally

This is a blog about the development of MTS 6, the next version of the wildly unpopular Multiple Timesheets.

It's one of those apps that just never took off. It was probably to quirky and personal, and worked a little funny compared to other solutions. Despite these problems, it helped me make money.

Lately, I've needed to track my time more closely, because work is getting overwhelming, and I'm letting it overwhelm me. I also need to get my finances in order.

Thus, the next version.

With new, exciting (yawn) features planned.

  • Uses a database!
  • Support for more than one user!
  • Track expenses!
  • Invoice for expenses *and* time!

Daylight Savings Time Misconfigurations between Computers Can Lead to Cumulative Data Errors

Symptom: my web app starting losing a day whenever I edited some data records. This app was working fine for a while, then, in March, it started losing time. Because my time was quantized to days, it looked like I was losing a day every time I saved the record.

The environment was a shared web hosting account, with PHP for the app, and a MySQL database behind it, on a separate machine.

According to a new law, starting in 2007, DST starts three weeks earlier than it has in the past.

I suspected that the problem is that one machine has the old style DST timezones, while the other machine has the new DST settings. So I created a test script to simulate the effect of multiple edits on a record.

Salary Surveys for Information Technology

2008-03-12: a report on Tech Republic. It's done by Global Knowledge

Web dev salary survey on Zeldman's A List Apart

Another popular survey is done by SAGE.

PHP List Hack: Shared Codebase

This is a trick to allow you to run one copy of the PHPList software on your server, and have separate configurations for each domain. The main advantage is that you don't have a bunch of copies of the same software all over the place. (PHPList takes up around 5 megs of disk. Using a similar technique with Drupal [which takes up 6 megs], we can install Drupal and PHPList in 260k of space, not including databases.)

At the top of index.php and admin/index.php, there's some code that looks for the config.php file. This new code snippet allowed me to create a config file named "phplist.config.php" in the user's root (or the ftp root) instead of the usual places.

Templating: A Minimalist Templating System

[This article is obsolete. The Twig templating engine is very good, and takes care of escaping the output for safety. It's not unpleasant. Use it.]

Object-Oriented Parser for iCalendar

Been working on a parser for ICS files, and it's done in an OO style - so that parts of the data become instantiated as objects, and the parse tree is a hierarchy of objects.

MS Access: Inserting and Deleting Contact Items With VBA

Gripe: VBA syntax is difficult. The object system is a little confusing too. It's just very hard to use. To make things even more difficult, the sample code out there is kind of *weird*. Maybe there's some good reasons for doing things their way, but, it just seems verbose, error prone, and hard to write, to me.

Here's some code that is the start of a library to work with Outlook's folders. It's based on some code samples from the web, refactored into something resembling a library.

Syndicate content