BetterPlatform.org: time for a better Texas Republican Platform

With this blog entry, I am publicly unveiling BetterPlatform.org, a movement to reform the Texas Republican Platform.

The 2008 platform is a farce. After removing problem planks, the platform shrinks 70%. That’s a lot of cruft!

Some of the worst planks:

  1. Theories of Origin, which calls for replacing science with religious theory.
  2. Support of Our Armed Forces, an unfocused grab bag of miscellaneous requests.
  3. Emergency War Powers, which alleges the United States is in some overarching state of emergency.
  4. Elimination of Executive Orders, which have been used since George Washington to conduct business.
  5. Illegal Immigration, which starts with gibberish and prescribes little than punishment and deportation.

I don’t yet know where this movement will go, but it’s started!

Texas GOP’s new web site on kludge

The Texas GOP recently rolled out a new web site at http://www.texasgop.org/.

If you surf it, you’ll see asp file extensions. For example: http://www.texasgop.org/inner.asp?z=6

That means the Texas GOP’s runs its brand new site on a kludge CMS!

“Woah, Aren, isn’t that severe?”

No.

ASP’s most recent version is from 1999.

Microsoft replaced it with ASP.Net 1.0 in January 2002. ASP.Net is now on 3.5, and 4.0 is around the corner.

Vendors still delivering classic ASP code in November 2009 have colossally failed to invest or innovate and may be incompetent.

When I review products, those still on ASP start out such a disadvantage that they’ll probably never make the selection.

What is up with the Texas GOP? How did it get hoodwinked into a kludge CMS?

PEAR Text_Diff doesn’t split words on punctuation

The PEAR Text_Diff system’s inline parser has a silly word splitting algorithm: it only defines word boundaries as spaces or newlines (\n).

This causes problems with punctuation. Suppose you are diffing the following two sentences:

The quick cat jumped over the lazy fox.
The quick cat jumped over the lazy dog.

The final rendered output will look like this:

The quick cat jumped over the lazy fox.dog.

Notice how the period is included in the word boundary? That makes messy markup. This comparison is worse:

The quick cat jumped over the lazy fox, who was totally lazy and should be shot.
The quick cat jumped over the lazy fox.

Here’s how PEAR Text_Diff does the diff:

The quick cat jumped over the lazy fox, who was totally lazy and should be shot.fox.

This final diff is difficult to read. You are not deleting and reinserting fox, you are in fact just changing the punctuation on its right. But because the inline diff renderer only considers space and newline as word boundaries, it doesn’t catch this basic punctuation issue.

The fix took me 1.5 hours of PHP code review to figure out the system, but it’s painfully easy to do it. Edit PEAR/Text/Diff/Renderer/inline.php. At lines 158 and 159 (per the online source code), you’ll see " \n" at the end. That is a collection of word boundaries, passed as a mask to the PHP strspn function. Simply add your word boundaries between the quotes, and the diff engine works correctly.

I’ve reported this as PHP PEAR bug 16774.