Older blog entries for fxn (starting at number 381)

11 Apr 2005 (updated 11 Apr 2005 at 13:20 UTC) »

Interview with Mark Jason Dominus

The Perl Review has an interview with Mark Jason Dominus about his recently published Higher-Order Perl. I am reading HOP and can't put it down.

5 Apr 2005 (updated 5 Apr 2005 at 19:33 UTC) »

The Return of Emacs

Getting the fonts right has got Emacs back to my desktop. Since I got the Mac (hey, that was October 2003, time flies!) I was using it occasionally to edit my encrypted passwords file with crypt++.el, and some editing here and there, but the font rendering made it kind of ugly and in consequence didn't fire it up often.

I was mainly flirting with SubEthaEdit, or TextMate for quick scripting, with vi in the command-line as usual. Regular programming at work, or playing around with my personal projects, went to Eclipse.

Although I don't have the same control over Eclipse than I have over Emacs (not to mention the list of available modes), and I miss a lot the smart M-q, Eclipse is an IDE I like, and its support for Java is superb. Only it eats too memory for these 512MB, so I need to keep the number of open applications small.

For Perl, Python, reStructuredText, and some other stuff my editor of choice now is Emacs again.

Talking about SubEthaEdit, I saw the other day an interesting usage: people at some Python Conference were taking notes in parallel. Cool!

By the way, with the configuration I came up with a couple of days ago most glyphs were OK, but then I noticed a few keys didn't work properly. Thanks to news:gnu.emacs I could figure out the correct value for mac-keyboard-text-encoding is kTextEncodingMacRoman.

3 Apr 2005 (updated 3 Apr 2005 at 12:40 UTC) »

Monaco in Native OS X GNU Emacs

My current preferred fixed-width font on the Mac is Monaco, but when I compiled Carbon GNU Emacs sometime ago Monaco wasn't rendered cleanly, Andale Mono was more or less OK, but not as nice as in a native editor either. In addition, I needed to create a fontset by hand to be able to enter accented characters.

I installed yesterday the last .dmg and this has dramatically improved. Monaco looks perfect now and there's no need to create the fontset, just configure the keyboard this way:

    ;; See C-h f set-language-environment RET for details.
    (set-language-environment "Latin-1")
    ;; This is a PowerBook.
    (set-keyboard-coding-system 'mac-roman)
    ;; Transform input from the keyboard into latin1.
    (setq mac-keyboard-text-encoding kTextEncodingISOLatin1)

This definitely makes Emacs a better Mac citizen.

21 Mar 2005 (updated 21 Mar 2005 at 23:14 UTC) »

Pragmatic Documentation

One of the things I miss when I am programming in something that is not Perl is pragmatic library documentation accompanying specifications, architecure descriptions, or whatever you want to put there. I don't understand why you are supposed to infer the usage of some library from the spec so often in Java, C, Python, etc. From my experience, in general the Perl conventions are ahead of any other I know.

When you read the documentation of a Perl module you see:

  1. How the module is used
  2. The module specification

The first part is code, right there, no English. By convention it goes in a section called SYNOPSIS which is the first one you see after the one-line description and the table of contents. See for instance the SYNOPSIS of IO::All. You get the picture at a glance. Not the details, to know the details or get the complete interface you then read what you need below, but you already have context.

To give a recent example of lack of pragmatism, look at the most recent documentation of the standard Python module CGIHTTPServer. Oh man, how on earth do I set up a server with that class? One reads that page and thinks: Hum, well, let's try the docs of its parent class. Ha, not so easy dude! Have a look at SimpleHTTPServer. Nope, you find a similar page. OK, be patient, maybe we'll have more luck with the documentation of BaseHTTPServer? Now something! At last! Some example!

But now, how to translate that example to CGIHTTPServer? You backtrack the links and try to figure it out. Finally you come to produce:

    import BaseHTTPServer
    import CGIHTTPServer
    handler_class = CGIHTTPServer.CGIHTTPRequestHandler
    server_address = ('', 8080)
    httpd = BaseHTTPServer.HTTPServer(server_address, handler_class)
    except KeyboardInterrupt:
which curiously enough does not instantiate a CGIHTTPServer. Shrug.
5 Mar 2005 (updated 5 Mar 2005 at 14:01 UTC) »

Interview with Autrijus Tang

Don't miss the interview with Autrijus Tang by chromatic in Perl.com. They talk about Pugs, Perl 5/6 internals, his immersion in Haskell, etc. Excellent reading for the breakfast of a sunny Saturday morning.

Some people whose judgement I appreciate speak very well of functional languages. MJD praised the type inference of Haskell when we met in Lisbon a year ago. Also jao and cerquide talk very well about OCaml and friends. Looks like I should take one of them as language to learn of the year.

Writing Perl Modules for CPAN freely available

I readed yesterday in Sam Tregar's journal at use Perl; that Apress has made his Writing Perl Modules for CPAN freely available in PDF from this page. This is the book that encouraged me to have a PAUSE account, I recommend it to anyone that would like to contribute something to CPAN.

20 Feb 2005 (updated 20 Feb 2005 at 15:45 UTC) »

Running Linux inside Virtual PC for Mac (cont.)

Today I think I got the keyboard right.

I have a PowerBook with a Spanish keyboard. This means that to type some characters as common as @, {, or #, a modifier is needed. That key is AltGr in PCs, and Option in Macs.

As far as I can tell, the Option key is seen as the Alt key by the guest Linux, so in console mode Option+f2 switchs to the 2nd console. The Esc key acts this way as well. Looks like in order to enter Option, in the Mac sense, you need to type the combo Option+Command.

Once that combo was discovered (I founded nothing in the documentation nor Googleing), the keyboard I finally configured is a standard PC Spanish keyboard. For the console dpkg-reconfigure console-data and select choose from arch list -> qwerty -> Spanish -> Standard -> Standard. The first choice might not be exactly worded that way in English, the dialog is in Catalan here. For X set XkbModel to pc105 and XkbLayout to es.

Here's a screenshot depicting the working configuration in a X session.

Running Linux inside Virtual PC 7 for Mac (cont.)

Victory!!! X running!!!

The basic steps were

  1. install Debian (I dist-upgraded to unstable)
  2. install xserver-xfree86
  3. install x-window-system-core
  4. choose the S3 graphical chipset
  5. choose the "macintosh" keyboard type
  6. choose "/dev/psaux" as mouse device
  7. choose "ImPS/2" as mouse type

I don't know whether that's minimal since some trial and error was done until it worked. I think it is enough to install xfree86-common instead of 2 and 3 for instance. Also I need to work out some minor details yet, as keyboard layout.

The great news are that since Virtual PC abstracts the guest OS from some host hardware stuff, the touchpad of the PowerBook works out of the box (including SideTrack's scrolling), Apple bluetooth keyboard and mouse work like a charm, Ctrl-click works as right-click just fine, nothing needs to be done to switch between Ethernet and wifi, it works out of the box, etc. Impressive!

15 Feb 2005 (updated 15 Feb 2005 at 23:04 UTC) »

Running Linux inside Virtual PC 7 for Mac

I have been a few days trying to get a Linux running inside Virtual PC 7 for Mac.

First I tried Ubuntu. The installation more or less run fine. There was no network though, and the graphics appeared mangled. The very application window changes to a too rectangular shape when X launches, and there are a few strange colors on black with something that resemples the Ubuntu logo or letters.

Then I tried Fedora Core 3. I hadn't seen Anaconda before, how beautiful! The installation run smoothly except for the OpenOffice package. For some reason when that package was being processed the installer freezed. I tried both desktop and developer presets to no avail, at that point the installer hanged. After that I went with the custom configuration and it got to finish. Everything looked fine, until I rebooted the virtual Linux. After a few console messages a Virtual PC dialog saying An unrecoverable processor error has occurred. The PC will now restart shows up and cannot go on, but restart (the virtual Linux, not the Mac of course). No luck either.

A coworker had a Debian Woody so I gave it a try. The minimal installation was OK, it even founded the network automatically. Afterwards I dist-upgraded to unstable and it worked like a charm. Unfortunately my first attempt at getting X working produced a screen as the one with Ubuntu. The console is right for the simple stuff I want it for however.

5 Feb 2005 (updated 5 Feb 2005 at 08:52 UTC) »

II Barcelona Perl Festival

Last Thursday Barcelona.pm organized the II Barcelona Perl Festival at the UPC. Carlos Escribano gave an overview of XML in Perl, and our guest speaker Juan Julián Merelo talked about YAML in Perl. JJ is a Perl veteran in Spain who lives in Granada. After that we all went to have dinner and had a good time. It was a pleasure for me to meet JJ in person.

Open Source at work

The directors of the company where I work have made an explicit statement saying that the company is going to start a business line around Open Source services. Now, isn't that magnific?

Thanks to my personal involvement all these years it's very likelly that I'll work in the definition of our offer together with some other coworkers, including the sales department. That will be when I finish my current project this month. Sounds exciting!

372 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!