Computer Programming

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

How Much Money Can You Save on Gas by Riding the Bus?

This is a javascript calculator that will estimate if taking a bus will cost less than what you pay in gasoline. Surprisingly, for short commutes, commuting by car is cheaper than getting a bus pass. (Calculator is on the full article.) You can get prices at Gas Buddy.

Vi and Vim, Macros

Vi and Vim have a "macro" feature to help automate routine editing tasks.

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.

Lazy Evalutation in PHP (sorta)

This is a nice little example that will show you how to do something really useful and cool. It'll also show you how PHP kinda sucks:


function f( $x )
        say("function f called with $x...");
        return create_function( '', " return quote('$x'); ");

function quote( $s )
        say('quote called...');
        return '***'.$s.'***';


$x = f( 'hello, world' );

say('$x defined as '.$x.'...');

print $x();

///// utility funcs
function say( $s ) { echo $s.'

'; }

The results look like this:


function f called with hello, world...

$x defined as �lambda_6...

quote called...

***hello, world***

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.

Routers Hacked via Browser

This is uncool: Router hacked through a web browser.

A page will log into your router and force an update with a bad firmware. The only fix would be to reload good firmware, and then fix your router to be less hackable.

I just started on a network where the router had been hacked, but only inasmuch as the DNS was pointing to a nameserver that resolved bad addresses to a Ukrainian search engine.

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.

Syndicate content