Work post

Feb. 27th, 2008 01:49 pm
pyesetz: (Default)
[personal profile] pyesetz

Lorem ipsum dolor sit amet.  This is some pointless text to go with the animated elephant, which was drawn by Vincent Pontier, who is apparently friends with Oliver Plathey who wrote the FPDF module for PHP.

When I started working at Company 𝔾 in June '06, I didn't know anything about MySQL, so "Mr. Bear" suggested that I use XML instead.  Being a n00b, I stupidly chose the DOMXML module, which is specific to PHP4 and has prevented us from migrating to PHP5.  Now PHP4 is at "end of life" and we really need to get rid of it.  Also the nightly validation report has started failing because even 48 MB of RAM is no longer enough to load in all the databases and check them for validity (because DOMXML has serious memory-leak issues).

This month I've been busting my tail, sniffing the grindstone, trying to get my billable hours up high enough to staunch the financial bleeding.  My RSS feed of LiveJournal posts now has 266 289 unread messages.  Last weekend I had gotten it down to below 100 but the posts just keep coming!  Oddly enough, there is no post from [livejournal.com profile] xolo about his Christmas celebrations.  And no reply for my email to [livejournal.com profile] loganberrybunny re the use of state/province to refer to the "home countries" of the UK; has offence been taken?

For the last three days I've been removing XML and replacing it with PHP arrays.  Instead of
<entry>
<_key>deadbeef</_key>
<name>Joe Schmoe</name>
<country>USA</country>
<region>Colorado</region>
<city>Pike's Peak</city>
</entry>
it's now
$DB_Entries['deadbeef'] = array (
'name' => 'Joe Schmoe',
'country' => 'USA',
'region' => 'Colorado',
'city' => 'Pike\'s Peak',
);

Looks about the same, loads 10‒20 times faster!  Really, this is a serious demerit for XML.  The whole point of XML was that, since everyone would use it, it was worthwhile to optimize the Hell out of the parser for it, so then XML should be parsed faster than any other format.  But PHP's program-code parser is much faster than their XML parser.  In part I think this is because of the attributes.  XML tags have optional attributes, even though I don't use them, so the isomorphism between XML and PHP-arrays potentially could fail, although it doesn't in my case.

Making this change required touching just about every actively-used file at the website!  All the databases needed conversion.  Any program that reads databases needed to start reading them the new way.  Any program that generates databases needed to start writing them the new way.  I've probably introduced dozens of bugs.  We'll see if I get any bug reports.  Most pages at the website are now served in only ⅓ the time they used to take; will anyone notice?

And so, with this little side-problem taken care of, I can get back to the main project for this winter.  Unlike most Company 𝔾 projects, this one actually has a deadline because there's a conference in May that it has to be ready for.  I need to convert various files to PDF and then combine the PDFs on the fly, hence the need for FPDF, whose homepage has an elePHPant and a link to Vincent Pontier, hence this post.  Bye!

Date: 2008-02-28 12:03 am (UTC)
From: [identity profile] loganberrybunny.livejournal.com
I don't think this matters. Massachusetts isn't a "state"...

But, as you say, most people call it one. Most people do not refer to, say, Wales as a "province".

Wales *used* to be a principality, until 1277.

The Treaty of Aberconwy was indeed 1277, but the lands of the Welsh Princes were not legally incorporated into England until the Treaty of Rhuddlan in 1284. It's true that there is no Welsh "Head of State" in the person of Charles, though most people do use "principality". You wouldn't see it on an official form, though, no.

England and Scotland haven't really been kingdoms since 1649 or so.

Why 1649? The Union of the Crowns was 1603, and the Act of Union was 1707.

every website now says "city" as the generic term

Only because most of the software used for this sort of thing is American. People in Britain would never refer to a small town like Bewdley as a "city", and it's not used as a generic term for "urban settlement" either.

Profile

pyesetz: (Default)
Pyesetz/Песец

August 2025

S M T W T F S
      12
3456789
1011 1213141516
17181920212223
24252627282930
31      

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 18th, 2026 02:48 pm
Powered by Dreamwidth Studios