Archive for the ‘Computing’ Category.

Making documentation for PHP Weather

I’ve been playing a lot lately with a lot of exciting technologies, such as XML. I wanted to produce some nice documentation for PHP Weather. I then thought of Docbook. But I’ve never used Docbook before — I hardly knew what it was.

So I tried writing a little, and I produced both

HTML and PDF files. But it looks awful! The lines are not justified, the font used is Times, etc. Compared with LaTeX I didn’t like it. I know that I can change these things, and I did manage to change the font to Palatino, but it still didn’t look “right”.

So I set out to try and use the XML-files produced by PHPDoc to make code for LaTeX. First I tried using a XSLT stylesheet to transform the XML code. That worked a little, but it wasn’t powerful enough — you can do some simple things, but not nearly enough.

So I then decided to do it myself with the aid of PHP. At first I had a really hard time figuring out how to parse the data properly. PHP can parse XML, but you’re only given three events to react on: open-tags, character-data, and close-tags. You have to do the rest… But I managed to find a solution, so now I have a nice script called phpdoc2latex.php that does what it says it does: converts XML files produced with PHPDoc into LaTeX code. You can see the result in the CVS repository.

As you can see, I’ve added some extras to the doc-comments :-) The really nice graphs are made with an amazing program called Dot from the Graphviz package.

Listening to Ogg Vorbis…

I just stumbled upon something called Ogg Vorbis the other day. Ogg Vorbis is a new audio encoding format similar to mp3. The advantage of Ogg Vorbis is that it’s opensource, without the patent-problems that plague mp3 and free. It’s also slightly better that mp3, which means that the files are smaller.

So I’ve started to re-rip all my Cd’s and encode them in Ogg Vorbis. I use Grip to automate the task of ripping and encoding the Cd’s. Grip first asks freedb for information about the disc, it then uses cdparanoia to do the ripping and then starts oggenc to do the encoding. A pretty cool program.

I’m still waiting for my 10 Cd’s to arrive, but with a little luck I’ll get them tonight. Then I can start the ripping :-)

So many releases…

Yesterday I made two new releases of PHP Weather. The stable version now includes a Hungarian translation donated by Gyulai Mihály. That brings the total number of translations up to 11.

The unstable version has also been improved. It’s now possible to get a list of countries and a list of stations in a specific country, so that it’s easy to make pages like the ones you find at the NWS Internet Weather Source. All the database backends can do this — even the ‘null’ database. So this means that things should work right out of the box.

The output has also been changed, so that it’s more correct now. Instead of saying things like light showers of rain it now says showers of light rain. The problem is that showers can’t be light because it’s a descriptor. It’s only rain that can be light because it’s a form of precipitation. (I didn’t figure this out myself — Thanks goes to Johnny Funder for this information.)

I’m graduated!

I’m done with the gymnasium — I had my final exam two days ago. It was in mathematics and I got 11. All-in-all I must say, that I’m very pleased with the exams. My average grade is 10.5 which means that I have access to whatever study I would like to try. But it really doesn’t matter, since there isn’t any limits on Computer Science. Everybody that wants to give it a try is let in, because there’s too few applicants.

But I now have two months of spare time before I’ll start at the Department of Computer Science in Aarhus (DAIMI). It’s just so great to be able to relax after the last four weeks.

Now that I have all this spare time, I hope to make a release of the new and improved PHP Weather version 2.x. You can try the snapshot or the latest code directly from CVS. And if you haven’t noticed yet, then I’ve moved the tarballs and zip-files to SourceForge, so you should go here if you want to download it.

You’ll also find that the stable version of PHP Weather has jumped to 1.55. The only new feature is support for proxyservers. So if you’ve been needing that, be sure to upgrade. You’ll have to set three variables at the top of phpweather.inc to enable the support.

Please sign my GnuPG key

There’s been a lot of talk about Echelon lately in the Danish press, after the EU made a report that established, that Echelon does indeed exist, and that it is aimed at the individual citizens.

So I’ve taken a look at GnuPG and have made a new public key. I’ve revoked the old key, as the email-addresses was obsolete.

If you believe that I’m the one I’m telling you I am (look here for a photo), then please sign my key. You should only sign the key, if you are certain that it does indeed belong to me. When I say “me”, I mean the person that’s maintaining these pages (which should be me, unless someone has stolen my password :-).

On the right, you’ll see my current web-of-trust. It shows that I’ve signed Cookies key. As I sign other keys, they’ll be added to the web, and as other sign my key, they’ll be added too. The idea is, that one should have a web of trusted keys, so that I can judge if a key is trustworthy from it’s location in my web-of-trust.

For you to sign my key, you should first obtain it from a keyserver or look here. The ID is F7F6B57B and the fingerprint is: FF54 E085 D1FD CFF2 99BF 7D70 76EB 310E F7F6 B57B

After you’ve signed it, you can either upload it again to the keyserver, or you could send it to me. I’ll then update my web-of-trust.

I’ll be happy to sign your key too, if I can be convinced, that it really belongs to you.