Wednesday, May 13, 2009

Accepted for Google Summer of Code!

I have been accepted for Google Summer of Code 2009! The title of my project is “Extend EclipseFP functionality for Haskell.” I have just set up a blog where I can keep all posts together that are related to this project. (This blog will also allow me to test-drive Wordpress, because as we all know Blogger sucks.) You can find more information at my new blog: EclipseFP GSoC '09.

Wednesday, February 25, 2009

Sumatra PDF Viewer for LaTeX users on Windows

If you use LaTeX on Windows, or in particular pdflatex, you must have noticed that viewing the resulting PDF file is not as easy as you would think.

Sure, Adobe Reader displays it fine. But apart from being bloatware and slow as hell, it also locks the PDF file it is displaying. Thus you cannot rerun pdflatex until you close the file in Reader, because the output file cannot be overwritten. This is a pain in the arse.

Foxit Reader seems like a decent alternative; it is much faster and less bloated than Adobe Reader (even though the installer tries to get you hooked on several other pieces of software that you probably don't want). Foxit does not lock the currently viewed file; however, it offers no reload option, and if you overwrite the output file, it will only display blank pages for what's not currently cached.

Enter Sumatra PDF. A very lightweight and very simple program, contained in a single executable file, written by a single developer, but it has the one killer feature that LaTeX authors need. It automatically reloads the PDF file whenever it changes. And it stays on the same place in the document while it does this.

There is currently a bug that causes the window to demaximize when it reloads, but you can work around that simply by not maximizing the window in the first place. This little viewer will definitely make my life easier.

Tuesday, February 3, 2009

Sunday, February 1, 2009

USB: the right direction

USB plugs are annoying, because it's hard to see how to plug them in, and you have only a 50% chance of getting it right on the first try. But I recently noticed what seems to be a little-known feature that increases your odds. There is a little USB logo on one side of nearly all plugs. It seems that manufacturers mount their ports in such a way that the logo should face upwards.

I haven't figured out the case of side-facing ports yet, but maybe there is a pattern there as well. If your computer has such ports, let me know in the comments which way the logo should face on those!

Thursday, January 22, 2009

Sequential page numbering in LaTeX

Did you ever notice that the page number that your PDF reader gave you was not the same as the page number printed at the bottom of the page? By default, some LaTeX commands, such as \tableofcontents, reset the page number to 1.

I don't like this behaviour. I just want my cover page to be numbered 1, the next to be numbered 2, etcetera. This way, the ‘physical’ and ‘virtual’ page numbers line up nicely. It also prevents some problems with hyperref, which will otherwise create duplicate page labels.

You can get sequential page numbering by putting the following snippet in your document preamble:

\let\oldsetcounter=\setcounter
\renewcommand\setcounter[2]{%
    \def\arg{#1}\def\pg{page}%
    \ifx\arg\pg\else\oldsetcounter{#1}{#2}\fi}

This simply overrides \setcounter, such that it ignores any attempt to set the page counter, which holds the current page number. Ugly, but it works.

Thursday, January 15, 2009

Verified by Visa – verily?

Today I ran into an excellent example of false security – with horrible usability to boot. I was helping my landlady to purchase a laptop online using a Visa card. At the checkout step, a screen appeared that we did not understand. It came from Visa itself and asked for the password associated with the credit card.

The password form was in an IFRAME, so the address bar did not light up green. I did not bother to check the security certificate by hand, or else I might not have dared to continue at all.

But we did read the FAQ that was linked to. As it turned out, this “optional” ‘Verified by Visa’ system makes online purchases more secure. It did not seem at all optional. Well, only more secure then. Right?

Wrong. How exactly does one get a Verified by Visa password? Let's click the “forgot your password” button and find out. To reset the password, you need to specify:

  • the 3-digit card validation code
  • your name, as written on the card
  • the card expiry date
  • the year and month of your birth

The first three of these four pieces of information are written on your credit card, and also submitted in any web form that involves a credit card purchase. By assumption, an attacker already has this information, or else the extra password protection wouldn't serve any purpose. So the only extra piece of information that is asked for is your birth year and month. Not exactly information that is hard to find, or even to brute-force if you put your mind to it. They might as well have skipped the password and asked for your birth date instead.

But well, it doesn't make you any less secure, so we continued to set up a password. First attempt failed: “use letters and numbers only”. Because, you know, secure passwords do not involve special characters at all. Second attempt: “please use both letters and numbers”. If you're going to use stupid limitations, at least tell me beforehand. Third attempt: “please use between 8 and 12 characters”. By now it seemed more like a CAPTCHA to me.

Then, finally, the password was accepted and we could proceed… to the next error message. Turns out that NoScript blocked the transaction, even with Javascript turned on. If NoScript does that to you, it probably means that you're doing something very, very wrong. But finally, after convincing NoScript that it was okay, the payment got through.

Stupidity can, in rare cases, be forgiven. But not if you're the largest credit card issuer in the world.

Sunday, December 14, 2008

XMonad with Ubuntu, dvorak, Pidgin and Skype

The last two days I have been playing around with XMonad, a tiling window manager for X, written in my favourite language Haskell. I now have a setup that is to my liking. It is intended for Ubuntu, using the dvorak keyboard layout, with key bindings that are a mixture of Gnome and XMonad default bindings.

The thing that I'm most proud of, however, is that I made a customized version of XMonad.Layout.IM that allows for multiple buddy lists. The buddy lists from Skype and Pidgin are placed on the right side of the F10 workspace, while chat windows are automatically placed in the remaining area.

I realize that the target audience (Ubuntu users, typing on dvorak, interested in alternative window managers, and using Pidgin and Skype) may be quite small, but in case my configuration file, or parts of it, are useful to somebody, I put it on the Haskell wiki.

This requires XMonad 0.8 or above. This version is in Ubuntu Intrepid. Ubuntu Hardy ships with an old version, so there you will need to install XMonad by hand.