Archive for the ‘programming’ Category

PSI’s free English to Chinese Dictionary v. 2 is released

Sunday, May 4th, 2008

A couple months ago we released the first minimally useful version of our free Chinese to English dictionary.

Well, after a couple months of use, it was decided to re-do it, this time keeping the full Chinese characters. Now you’ll have a chance of being able to use it to order from a Chinese only menu! Unfortunately, it now requires that a Chinese font be installed also, but you can steal a copy from your desktop.

If the first version was minimally useful, this version is generally OK.

So, get your free copy of our CEDICT based Windows Mobile English to Chinese Dictionary now.

Fixing list indent in CSS

Sunday, March 23rd, 2008

A very quick post for today.

I was tweaking the layout of Naque, our unique names generator.  It took a bit of fiddling to eliminate the indentation of the list elements in an unordered list.

E.g. <ul><li>first item</li></ul>

For some reason I couldn’t remove the ident.  Margin (left) was the obvious thing to change.  However, you also have to change the padding!

CSS, so nice, yet so confusing sometimes…

How I had to fix PHP PEAR

Monday, March 10th, 2008

I’ve always found the code libraries of PHP PEAR to be quite useful.

But the PEAR website and individual package documentation is often baffling. I wish users could contribute comments and sample code easily, like the online documentation of PHP.

On to today’s rant. I just upgraded the Linux distribution that runs my home server to SME7, see contribs.org. Since it’s based on Red Hat Enterprise Linux, it comes with an old version of PHP Pear. Out of the box, it does not work. This is OK. On the frontpage of pear.php.net homepage the reason is clearly posted:

“[January 3, 2008] As promised, XML-RPC has been disabled at pear.php.net.”

The news post tells you how to update older installs of PEAR to work with the new system. That would be fantastic, if the instructions worked.

But they don’t. At least for older than expected versions of PEAR.

Fortunately, I have notes from earlier this year on another server upgrade I did.  I had to search high and low to get my old version of Pear working. Earlier this year, I run these commands to upgrade and fix PEAR:

pear upgrade –force http://pear.php.net/get/Archive_Tar http://pear.php.net/get/XML_Parser http://pear.php.net/get/Console_Getopt-1.2

(note, that’s all one command up there)

pear upgrade –force http://pear.php.net/get/PEAR-1.4.3.tar


pear upgrade PEAR

The difference is the Console_Getopt-1.2 line. It specifies the exact version of the Console_Getopt package to install. Shrug.

Today, I had an extra step:

On the second command, the PEAR-1.4.3.tar one, I go this error:
requires package `PEAR’ >= 1.3.3

I guessed that I needed to do a half-step upgrade first… i.e.
pear upgrade –force http://pear.php.net/get/PEAR-1.3.3.tar

Then do the original line:
pear upgrade –force http://pear.php.net/get/PEAR-1.4.3.tar

Then the final upgrade:
pear upgrade PEAR

I don’t know why PEAR had to disable the XML-RPC interface.  I don’t really care.  But I do find it annoying when the instructions on the front page of a site don’t work.

This problem will affect other people besides me. This will probably hit everyone else who is installing a new RHEL4 (or derivative) server. Long life distributions with non-functional PHP PEAR software will be kicking around for a few more years.

I’d post this on the PEAR Wiki. But there is none. Fortunately, this blog gets indexed by the search engines, so maybe it will prove useful to someone other than me.

SmoothWall 3. DDNS Port Forwarding Modification

Friday, December 28th, 2007

Leonard Chan‘s SmoothWall Dynamic Hostnames Port Forwarding Modification has been updated for SmoothWall 3.  It also has a new home, here, on this blog: http://blog.perceptus.ca/smoothwall-ddns-mod/.

For those who don’t know, i.e. everyone, Leonard Chan is me, the key guy behind Perceptus, and the guy who writes this blog.

The modification to SmoothWall is rather handy.  It lets one create rules that allow dynamic hostnames, like “leonard.dydns.org” have access to a PC behind a SmoothWall firewall. Thus, whenever the user’s home IP address changes, the firewall eventually adapts.

The mod is now offered to the public from this site.  No warranties whatsoever.