Toxic Elephant

Don't bury it in your back yard!

Mulholland Drive

Posted by matijs 05/12/2004 at 12h10

The first time I saw Mulholland Drive, I only saw the first part. It made sense to me. Then there was a fire in the theater.

The second time I saw Mulholland Drive, I saw all of it. The first part still made sense. Then something weird happened, and I was confused during the rest of the movie.

Last week, I saw the end of Mulholland Drive for the second time, and this time I understood it. What I had thought was real, was not, and suddenly it all made sense.

(Salon made sense of it too. See the movie first, then read that.)

Maybe I should also see Lost Highway again.

no comments no trackbacks

CSS Shame

Posted by matijs 25/11/2004 at 23h42

All this time, it turns out, people using IE5.5 (36 so far this month), and perhaps IE5.0 (44 so far this month), have been unable to read my website: The left and right sides of the text were simply cut off. I knew IE6 didn't show the vertical borders, but at least it showed the whole text.

Somehow, it feels similar to suddenly finding out you've been walking around all day with mismatched socks, or a torn shirt — assuming those things weren't part of your fashion statement. It's simply a little embarrassing. Anyway, it should all look fine now. The vertical borders even show up in IE6.

Oh, and I'm working on a new layout, so here are samples before and after, just in case the site looks completely different when you read this.

Tags , 1 comment no trackbacks

Oops

Posted by matijs 07/11/2004 at 01h57

I just noticed entry number 13 wasn’t showing. Of course, which other
entry could it be?

The file had the wrong permissions. I fixed it, so you
can go read it now. Scoot. It’s about writing Gimp
plug-ins.

Tags no comments no trackbacks

A LaTeX package for typesetting syntactic trees

Posted by matijs 07/11/2004 at 01h40

While studying linguistics, I often had to put pictures of syntactic trees in my papers about generative grammar. I made several systems to draw these automatically. One of these was a LaTeX package called synttree.

I actually uploaded the version from 1998 to CTAN. That version was clumsy, and the code was hard to read, a result of my struggles with TeX. I have always wanted to clean the package up, so it would be easier to extend it if needed.

In 2001 or so, I read an article from TUGboat that showed me how to write a parser that I could actually understand after I had written it. So, I wrote the new parser, and sort of bolted it onto the existing drawing macros.

Two days ago I finally came back to it. Now, I have a new working version, much more extendable and cleaner, ready to be uploaded to CTAN.

[Update Dec 9, 2004: The new version can also be found at CTAN.]

[Update Jun 11, 2005: Information on downloading and using the package has been moved to the synttree page.]

Tags 3 comments no trackbacks

Cocooning

Posted by matijs 04/11/2004 at 22h06

I feel a great need to shut out the world beyond my home. Curtains must now be closed in the evening, whereas before I wanted them open, even while sleeping. Lights and heating must be on.

I've decided to limit the intake of news to once per day. I get a newspaper. Reading that should be enough. Anxiously waiting for more news all throughout the day will do me no good: Events will not unfold faster, reasons and explanations will not be found earlier, and I will end up feeling more frustrated, angry and sad.

Luckily tuesday night brought Gillmore Girls, Sex and the City, and the OC, all in a row, so I could begin to forget that I live in a country where people are murdered for speaking their mind.

I will now make a nice bowl of decaf latte.

no comments no trackbacks

Getting Bryar to work: A Summary

Posted by matijs 11/10/2004 at 12h40

As I mentioned, installing Bryar was not
completely straightforward. Luckily, it is architected well, so making the
necessary modifications was easy.

Tags , no comments no trackbacks

Tips for Gimp-Perl

Posted by matijs 11/10/2004 at 12h05

After my image filtering annoyance day, I spent some more time on the problem, with more positive results.

First, I found out how to do pixel manipulations properly. It needs some incantations that are not in the man pages, but are in the source to Gimp's plugins written in C. For the basic framework of a plug-in, see Gimp-Perl's documentation and examples. For the rest, see below.

First, of course, you have to load the right modules.

use Gimp ":auto";
use Gimp::Fu;
use Gimp::Feature qw(pdl);
use PDL;

Then, the sub that actually does the work should look something like this:

sub do_something {
  my ($img, $dwb) = @_;

  my $w = $dwb->width;
  my $h = $dwb->height;
  my $gdrawable = $dwb->get;

  # make sure we can undo in one step.
  gimp_image_undo_group_start($img);

  # Read values from the source region, and write them to the
  # destination region. The destination region has its dirty and shadow
  # bits set. 
  my $src_rgn = $gdrawable->pixel_rgn(0,0,$w,$h,0,0);
  my $dst_rgn = $gdrawable->pixel_rgn(0,0,$w,$h,1,1);

  # Get pixel data as a 'piddle'
  my $rect = $src_rgn->get_rect($some_x,$some_y,$some_w,$some_h);

  # Do something with $rect's data.

  # Set pixel data
  $dst_rgn->set_rect($rect, $some_x, $some_y);

  # Magic incantations found in the C destripe plug-in.
  $gdrawable->flush();
  $dwb->update(0,0,$w,$h);
  $dwb->merge_shadow(1);
  gimp_displays_flush();

  # make sure we can undo in one step.
  gimp_image_undo_group_end($img);
  ();
}

Be sure to read the documentation for the PDL module. It explains how to manipulate the piddle with the pixel data. It helps to print part of the piddle now and then, or its dimensions (using the dims function).

Unfortunately, the method I had come up with to destripe my images didn't exactly work right. So, I went searching again. This time, I found a page describing an easy destriping method using the Gimp.

Since the method has several steps, I decided to automate it with a plug-in. I am quite happy with the result: It works on the selected layer, even if it's invisible, it handles errors gracefully, and it only works on the selection, if one is present.

Tags no comments no trackbacks

Orkut Now Comatose, And an Old New Thing

Posted by matijs 30/09/2004 at 21h19

Speaking from a pathetically low sample size, I can conclude that all ASNs go through a comatose period, where the number of users is clearly larger than the system's implementation can handle. Friendster had it, but is now fast again, and Orkut, which was fast, now has it.

The thing is, I'm not really that interested in ASNs, because after logging on, I'm not sure what I should do there, and talking to complete strangers seems just as awkward as in real life. Given that, I still would like them to be fast, for when I do get into the spirit of artificially networking on-line.

At this point, I wrote the following:

The trouble is of course the fact that all these ASNs are server-based, which makes them vulnerable to comatosity. What we need is a peer-to-peer ASN. A kind of FOAF on steroids. With a client that spiders your friends' friend lists (down to a certain level), and constructs your network on your machine. Your profile is your web page of course. Maybe some new home-page providers would spring up to provide the home-page-less with their much needed profile space.

There should be a way to send messages to other people in your network. Perhaps each member could publish a public key, and you would encrypt your message with all the public keys along the route to the person you're trying to contact, and then send it on its way. Each link in your route would only accept e-mail for this purpose from their direct friends, so a real chain linking the sender and the receiver would have to exist.

A similar public key system could help with the accessing of profiles (yes this contradicts the web page idea). Possibly at most friends of friends would get to see something not completely public.

I think this sounds great. With some more thinking, it should be possible to create something that actually works, has al the features of current ASNs that are actually nice, and avoids all current annoyances.

So, what's wrong with this idea? How can it be abused?

And then, of course, I started looking around on the FOAF site, and found out that this is, in fact, not a new idea (except maybe for the public key bits).

no comments no trackbacks

Annoyance

Posted by matijs 20/09/2004 at 20h37

I have just spent most of this day trying to get nice scans of some of my photographs. And I'm annoyed.

My father found me a working scanner in the trash. Yes, people throw away perfectly good scanners. And monitors too. I even threw away a perfectly good computer once. It was hideously old, and someone else found it in the trash. I know, because it was gone before the garbage truck came. Anyway, after a while we managed to arrange for the scanner to actually come to my house, and after fixing an endianness-problem it actually worked. Note that I consider fixing endianness-problems fun.

So, what is the problem? The scans are overlayed with a wave pattern of blue and red. It's a pattern that repeats every 16 rows, and it's perfectly predictable. It's also very hard to filter out using standard image tools.

I know almost nothing about image filtering, and I know nothing of scripting either the Gimp, or ImageMagick. So, while trying to figure out what I had to do to the image to get it right, I was also trying to figure out how to do whatever I had to do using the underdocumented scripting features of these fine programs. Let me qualify that: Gimp's Script-Fu may be well-documented, but I didn't want to combine the two things I already didn't know with a programming language I didn't know (i.e., scheme), so I stayed with the Perl version.

So, I spent a day without much progress (well, the colors look better), and I'm so annoyed, that while writing this, I smeared garlic on my keyboard.

no comments no trackbacks

Research Ideas

Posted by matijs 15/09/2004 at 22h52

I sometimes think of fun things that should be researched. These are typically topics for things like term papers. At least, I think they are. Usually I forget about them after half a day or so, and then I'm annoyed that I didn't write this wonderful idea down. These days, I'm trying to remember to write things down before I forget them.

The first item on my list of things that should be researched that I have actually remembered long enough to write down is: The history of french fries and their sauces.

Some background information on this subject: I was having dinner with some people from different western cultures recently (Dutch, German, American), and one of the Americans (my stepfather, in fact) wanted ketchup with his fries. A friendly discussion ensued, as it had previously, where we Europeans condemned the tendency of these Americans (and, by gross generalization, all Americans) to put ketchup on everything. It then turned to the subject of french fries, and who had first thought of — as the Americans put it — putting mayonnaise instead of ketchup on their fries. Hence the present research subject.

Of course, you can just google for it, and find this: The Secret History of French Fries. It still leaves the sauces, though.

On a related note, in discussions there will often be a point where someone says: We'll look it up, and somehow, the looking-up never happens, and we forget about the whole discussion. This is of course one way to end discussions.

no comments no trackbacks