Older blog entries for robocoder (starting at number 325)

Re-inventing the wheel. Sure, I could have used the ip2c library from FireStats, or the geoip code from MaxMind, but the former doesn't support shared memory and the latter is just fugly looking code.

So, I just coded/tested/benchmarked a new IP-to-country plugin for Active Analytics -- it'll be an optional, third-party plugin for Piwik. It can search the database in either a flat file or shared memory. (The difference is in the 10ths of a millisecond per query on my antiquated test box.)

In hindsight, I wasted a lot of time over-3ngin33ring the solution. I thought it would be safer to sign and check the integrity of the shared memory segment for users in a shared web hosting environment. I later realized this was a non-problem because shared web hosting doesn't offer access to shared memory (due to security and resource concerns). This came as a relief because signing and verifying killed the performance benefit of using shared memory.

[ed. "engineer" is a protected title here in Ontario.]
Active Analytics is bloatware, and it's intentional. Based on Piwik, the package will be further padded to include new plugins and complementary self-hosted solutions.

So far, I've commited my workspace to Sourceforge as a new project ("Active Analytics"). The differences are few at the moment:

  • the directory layout reflects my installation preferences (i.e., public, private, and user folders).
  • non-core plugins (that I developed or coded by other devs) are revision controlled so that I can sanity test them when there are upstream changes (read: compat busters).
  • a couple of rejected patches are included for stability ... at least until the root cause defect is found

We're nearing the release of Piwik 0.5, and I noticed we'd made the 1500th check-in to our svn repository in additon to reaching 1000 tickets created in Trac. So, to reflect on our development journey, I whipped up some pretty charts of the project's software development metrics (using a handful of Perl scripts, MySQL, OpenOffice, and Gimp).

17 Jul 2009 (updated 17 Jul 2009 at 05:15 UTC) »

Granted this is "PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch (cli)", but my fondness for PHP is nonetheless waning...

print memory_get_usage()."\n";
Simple enough. But sporadically, I get:
apang@olympus:/tmp$ php test.php
Segmentation fault
That doesn't instill a lot of confidence when you're trying to figure out where your long running PHP script is leaking memory like a sieve...

Wait there's more.

print memory_get_usage()."\n";
print memory_get_usage()."\n";
You'll have to dig into the Zend Engine internals to figure this out:
apang@olympus:/tmp$ php test.php
I'm presuming there's some voodoo Zend Engine optimization going on under the hood (as opposed to some observer effect).

My absence says it all. Coding/blogging isn't really practical when there's a newborn cradled in one arm. ;)

Still, I've been a busy bee on Piwik, especially now that I have commit privileges. ;) We pushed 0.4.1 out the door primarily to address issues raised by PHP 5.2.10, but there are a lot of other fixes as well, in addition to now being able to manually (programmatically) trigger a goal from the browser.

You can't believe everything you read on Twitter. There were tweets purporting that the Ontario Ombudsman's office had adopted Piwik for its web site, but I just checked and they're currently using GA. =P

25 Feb 2009 (updated 13 Mar 2009 at 13:34 UTC) »
Don't force your infinite wisdom on me.

I'm not the first to notice this, and I probably won't be the last, but it deserves repeating, "don't use Prototype."

Here's one reason: the Prototype JavaScript framework doesn't play nice with others; it breaks "for..in" globally, intentionally. What's ironic is their workaround for json.js.

21 Feb 2009 (updated 22 Feb 2009 at 00:14 UTC) »

+1 to Ta0kira for his flurry of non-syndicated posts. My nitpick would be that sometimes the syndicated posts are OT.

+1 to Apenwarr. Yeah baby, long live hand rolled lexers and parsers! (That brought back fond memories of my university days taking Compiler Design.)

-1 but self::patOnTheBack() for fixing the language and country detection bugs in Piwik. Boo-hiss-scratch for whoever was responsible for using the proposed ISO 3166-1 alpha-2 country code "sp" instead of waiting for the officially assigned "rs" for Serbia. A hex on you and your bloodline that I have to detect "sr-sp" in every visitor's browser's Accepted-Language and fix your mistake.

18 Feb 2009 (updated 19 Feb 2009 at 04:45 UTC) »

No. No. NO! Who's bright idea was it to construct this malformed Accept-Language?

  • en-US,en;q=0.7,chrome://global/locale/intl.properties;q=0.3
"chrome://..." is neither a language tag (per RFC 3282) nor CFWS (per RFC 2822) *grumble*

And where does this originate from?

  • en-securid
It isn't registered in IANA's language subtag registry. The owner should use either x-en-securid or en-x-securid. *grumble*

Currently debating the merits of inferring the country when the language tag is composed of a primary subtag only (e.g., no region subtag). Reading: RFC 4646, RFC 4647

Ran across an interesting blog post on MozSpeak.

I noticed Drupal now has a Piwik module. Some of the items on the TODO would probably be of interest to Piwik users in general (for example, a user tracking example is a frequently requested feature).

Before the new year, I moved all our web sites to Hostgator. Our former web server is now a glorified reverse proxy to our internal servers. Maybe it can host a public git or svn repository...

Other than the Dashboard, I think I prefer the left column navigation in this Flex-based Piwik client to the sticky superfish menu in Piwik. Something to think about, seeing as I wasn't able to migrate all the jquery UI plugins in my recent Piwik patch, and now that jQuery 1.3 is out (and a jquery UI release around the corner).

Better late than never... I've been busy in my spare time submitting patches to piwik. The jquery update to 1.2.6 looks to be done finally -- yes, I know 1.3 came out this past week -- I'll wait for the plugins to catch up before I go through this exercise again.

As a side effect of UI regression testing, I uncovered a handful of bugs which weren't regressions. ;)

I'm glad to see piwik's roadmap has been updated and reorganized. I think the dates are still too aggressive given that matt is the lone developer, while patches trickle in from contributors. =P. Wait and see...

316 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!