Form elements as PHP variables

I had already decided to test this today since I’m a lazy programmer (more on that sometime later). I’m working on creating a voting application and since I like code re-use (part of my laziness) I wanted to see how I could make form processing code that really doesn’t care how many different elements there are in the form. Eric’s wondernment on why PHP requires the brackets to be present in some form element names may also be explained a bit further.

Continue reading

Internet Explorer and Linux

I finally had some time during the holidays to play around with Wine. I originally planned on installing Photoshop Elements to play around with it, but since it required an installation of Internet Explorer I decided to install it too. The Sidenet wine configuration utility was an invaluable help it did the job well after I updated my Wine install to the latest version (20041201).

Now I can finally debug websites under development with in IE without having to use another computer (i.e. Windows box) to run it. But it does feel somewhat odd to run IE on Linux, yet it’s also quite satisfying.

Running IE on Linux

P.S. When configuring font paths to get Photoshop to work, remember to check if the global preferences are being read as well. It may save you a day or two of debugging time. Sometimes I feel so stupid.

Update 14.4.2005: I tested installing multiple IE versions on Linux. Short version: it works.

Finnish hyphenation in LaTeX

It took me quite some time to get Finnish hyphenation working with LaTeX and babel. I don’t know why current Linux distributions seem to comment out languages, I never had this problem before. But here are the steps to get Finnish hyphenation working:

  1. Run texconfig and select hyphenation and latex. In the editor remove the comments from those languages that you want to use (finnish in this case).
  2. Run fmtutil --all in the shell
  3. Now the generic instructions of appending
    \usepackage[T1]{fontenc}
    \usepackage[latin1]{inputenc}
    \usepackage[finnish]{babel}
    

    to the preamble of the document will work

Thank goodness for Google though…

Printing protected PDFs

Quite some time ago, Anna was trying to print some protected PDFs and asked me to help.
On Windows I have no idea how this could be done, but on Linux I did the following…

Most of the documents where easy to print by converting them to PostScript with pdf2ps, but this didn’t work in all situations (some files broke the transformation). So I fiddled around with Ghostscript and came up with the following solution:

gs -sOutputFile=[outputfile.ps] -sDEVICE=pswrite [pdf-file]

The end result is that you get the input file pdf-file transformed into PostScript in outputfile.ps, ready to print. The only problem with this approach is that you have to press enter for each page, but that is a small price to pay.

Now I can delete a message from my inbox in which I reminded myself how I did this ;)