Computer Programming

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

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.

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

A few years back, my co-worker Josh and I came to the conclusion that we didn't like the Smarty templating system. Not that there's anything wrong with Smarty - it's just that we didn't like the fact it was this software system that didn't seem to do anything except behave like a subset of PHP, and required a lot of extra code.

So, we did some thinking, and thought a bit about Cold Fusion, a really nice language that gets little respect because it looks like HTML. There are a few things CF does to make life easier for HTMLers (but makes it a lousy development language for regular programmers). Some ideas bubbled to the top.

1. All variables are globals.
2. Most data is in arrays.

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.

The best feature is the function OLGetSubFolder, which returns a MAPI folder object for a given path. Totally useful.

OOXML, counter-standardization

Read this site:

A site objecting to Microsoft's political promotion of their "open standard" years after the establishment of Open Document Format (ODF), a similar open standard used by the freely available OpenOffice and some other programs.

In response to the promulgation (and relative success) of the ODF formats, Microsoft is pushing OOXML, the confusingly named Office Open XML -- note the order of the two "O" words -- as an international open standard.

ODF is safer than OOXML, because the OpenOffice suite of programs is available in source code. The most popular parser for the ODF formats is always accessible to programmers, so they don't have to puzzle over the subtleties of the ODF.

Syndicate content