Older blog entries for robocoder (starting at number 330)

My new year's resolution for 2011 will be to NOT maintain a daily blog. ;)

I did, however, fulfill my 2010 resolution. I wrote the certification exam for Zend Certified Engineer for PHP 5.3 -- so I'm officially a ZCE now.

I've been sidetracked from Piwik core to work on replacing the continuous integration (on a server hosted by OpenX) to our own server. This was a welcome diversion from PHP... for awhile... but it now looks like I'll have to dive deeper into HtmlUnit (and coding in Java) to isolate some HtmlUnit bugs when using jQuery 1.4.2.

Just popped in to read the blog roll. Advogato's recentlog is downright spammy looking...

Piwik 0.5.5 was released a couple of weeks ago. One critical bug fix, some index improvements, and an IP anonymizer were the big highlights.

While Matt leads the big feature development in 0.6, I've been contributing small patches and improving our Trac reports. (This was a good opportunity to brush up on SQL JOINS.) Generating the graphs for the project's metrics will hopefully be easy to automate. (I hope to revisit the BMI and Fix Responsiveness graphs at a later date.)

Ok...back to work...

PowerUp!

Working on a new plugin for Piwik (and ActiveAnalytics) to provide in-app download/install of plugins. I've prototyped the client and mocked up the digital download store (not pretty). Building our own hosted extension repository (ala Wordpress & Typo3) -- for third-party developers -- may be next on the horizon... (being discussed).

PHP mbstring.func_overload is evil.

There's no mb_substr_replace() function, so you can't pass a value from mb_strpos() -- ie overloaded strpos() -- and expect it to work. Also, if you use substr() on binary data -- precisely because it's binary safe -- then you really don't want/expect to use mb_substr(). And there's no way to disable this at runtime via ini_set().

I just borrowed a snippet from ZendFramework and applied it to Smarty' s outputfilter.trimwhitespace.

Detecting this and coming up with workarounds is fugly.

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 0.9.6.2 (cli)", but my fondness for PHP is nonetheless waning...

<?php
print memory_get_usage()."\n";
Simple enough. But sporadically, I get:
apang@olympus:/tmp$ php test.php
51568
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.

<?php
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
51944
52248
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

321 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!