Quote of the day:

Marge: We're just going to have to cut down on luxuries.

Homer: Well, you know, we're always buying Maggie vaccinations for
diseases she doesn't even have.

Lisa's Pony
 

WordPress


Fri
14
Apr '06

Also upgraded WPG2 to 2.0. Things seemed to go smoothly.

Thu
15
Sep '05

Our admin knocked at my door this morning telling me that my blog was hacked and compromised. This was really to my surprise. Why would anyone want to hack it? Weird. Anyway, I had to take it down and upgrade Wordpress and Gallery to the latest versions. But I am not sure what the security holes are and whether they are gone in the new versions. Updating is always painful. Fortunately, wordpress didn’t undergo too many changes. Just want to document the procedure here for future reference:

  • Copy over wp-config.php
  • Copy over fortune directory
  • Copy over .htaccess otherwise URL rewriting wouldn’t work.
  • Copy over the theme.
  • Copy over the plugins
  • Make changes to template-functions-post.php as I did for the last version
  • Copy the smilies

For Gallery2, it’s a little bit more. Seems that it has undergone more changes. Did the upgrade, then follow the instructions to make URL rewrite work. The Veloria theme is gone and the new theme structure has changed a lot. So I am living with the default matrix theme now. Will fiddle later.

Sun
15
May '05

Below the header, I have added a block “quote of the day”. It is based on the notorious unix program fortune. I found the PHP script here.

I had to hack the theme a little bit to make it look nice. Code wise, changes were made in header.php. One drawback is the fortune data directory is relative to the PHP code that includes the script. So I have to either specify an absolute path or symlink under each directory that wants to include fortune.php. I currently have only two such directories, so not that bad.

Now it’s time to get interesting quotes :D and fiddle a little bit with the fonts and color.

Sat
14
May '05

After playing with WordPress a little bit, I am now slightly exposed to PHP. Generating HTML code with PHP does not seem to be fun, from my point of view, as a researcher in the area of meta programming. The text based approach is so ugly, clumsy and error prone. The generated code is basically not readable to human being. It is also very hard to get different modules to work together well.

Anyway, this is an ugly approach. It would be nice to have a functional HTML library based on AST. And of course, the first thing that comes to my mind is writing Haskell data type definitions, smart constructors and a pretty printer. Thus we can probably write a blogging platform using Haskell :). But I am not sure yet how to interact with databases. I currently have no knowledge in database. We probably will end up with heavy use of IO monad.

For now, there are some pointers I might want to refer to later:

  • A Prettier Printer by Phil Wadler.
  • HaXML. Since HTML is an application of XML, we certainly want to generalize. HTML might need some tolerence in validity though.
  • HXML. This looks like a drop-in replacement of HaXML.

I need more information on:

  • How to run a Haskell program as a CGI.
  • How to interact with MySQL or other databases.
  • Interaction with the system and IO in Haskell.