[lang]

Present Perfect

Personal
Projects
Packages
Patches
Presents
Linux

Picture Gallery
Present Perfect

I just had to vent

Filed under: Hacking — Thomas @ 17:19

2004-07-20
17:19

Spent an hour on trying to figure out a bug. For the sake of argument, let's say I was trying to figure out why

echo "kaka pipi" | sed 's/\S/./g'

does not substitute every letter with a dot.

Of course, every utility on UNIX systems that USES regular expressions DOES IT DIFFERENT.

grep uses "basic" and "extended", where egrep uses extended by default, and "basic" is something that is "less powerful". What the part on regexps in grep's man page fails to mention (but the list of options has it) is that you can choose a third style, perl-style regexps. Then the usual difficult-to-grok explanation of grep's idea of "extended" regexps is explained in gory details.

"awk" claims to be using the same regexp style as "extended" in grep, then goes on to explain, in a different way, what that means. Mere mortals have no way of verifying the initial claim. Of course awk comes with some switches that modify the regexp engine's behaviour.

"tr" works on sets, so the man page doesn't even use the term "regular expression", but goes on to describe a syntax of how to specify single characters or sets of characters that sort-of-resembles-regexp-style-but-not-sure-which.

"ed" describes regular expressions, explains what it allows, and makes no reference to any other implementation. Again, impossible to tell if it's the same as any of the other or not.

The list goes on, and contains vim, emacs, and all programming languages.

So why does this matter ? If you test a regexp with one application, until it works, growing it genetically like we all do, everything's fine, no ?

Not really.
Running

echo "kaka pipi" | sed 's/\s/./g'

gives:

  • kaka.pipi on FC2
  • kaka pipi on RH9
  • kaka pipi on Mac OSX
  • kaka.pipi on current Gentoo

Interestingly, running

echo "kaka pipi" | sed 's/\W/./g'

gives:

  • kaka.pipi on FC2
  • kaka.pipi on RH9 (!)
  • kaka pipi on Mac OSX (!)

You can't trust sed to either make sense or be consistent across platforms. So back to square one, and this time add a note to my code that says exactly why we stick to this one piece of evolutionary grown sed syntax - because it's the only thing that Works.

And next time someone complains that some new code we are writing is not consistent, and "all the UNIX tools can be consistent, why can't you", I have something to point them to.

gifts

Filed under: Life — Thomas @ 11:26

2004-07-19
11:26

I received two gifts that I'm not sure of who I got them from. Sweet. However, I'd like to thank the people who sent them. The Buffy DVD set I have a good idea of who it came from, but I don't feel up to embarassing myself just yet. The Explosions In The Sky CD contained no additional info whatsoever.

So if you sent them to me, drop me a mail, I received them and am enjoying them :)

It’s the time of the season – for love

Filed under: General,Life — Thomas @ 10:47

10:47

Finally had enough internet bandwidth to upload pictures of Bas' en Siska's wedding. If but all weddings were as lovely as theirs...

Meanwhile, Ross is looking very pretty in his wedding suit. Too bad he's already hitched, has a prettier wife than I could ever be, and I'm generally not that way inclined, because otherwise ...

Congratulations Ross ! Now get back to hacking damnit.

Party time

Filed under: General,Life — Thomas @ 17:25

2004-07-18
17:25

This week Tamara and Timothy have dropped by. They spent their first two nights in the Novotel, because the room Kristien has for work was available.

Apparently our guest room is so warm these days that they prefer to sleep in the living room instead.

Meanwhile Kristien bought some cherry tomato plants after coming back from a short cocktail stop with some friends at a bar. We bought the plants at two in the night, waking up Diego, the shop owner. The flower market is open 24/7, and I have no idea why it is, which makes me love this city.

We were talking about it all week - let's go to the beach, bring some food and drinks and just sit there. So yesterday we went and did just that - making caipirinha and caipiroska on the beach. I think I've finally found an alcoholic cocktail that I like - even though my version of it was not completely the correct one.

Tonight Tamara and I are going to milonga. We tried going yesterday to some place I found on two sites, but apparently they have moved their dance night to Monday. Sigh. Anyway, the one tonight is certainly being held as I called to ask.

And this week a whole bunch of friends are coming over, yay ! Life is good here under the sun.

A typical night in

Filed under: General,Life — Thomas @ 23:49

2004-07-13
23:49

The scene: a top floor appartment with terrace. A dashing young man is transcribing bank account statements to his computer. A strikingly beautiful young girl is going through two baskets of socks, trying to match pairs.

young girl (prodding skin under chin)
When I push hard here it hurts
young man (caught in a fit of laughter)
So stop pushing, problem solved ?
young girl
Hey ! I'm having cancer and you don't even care !

Never in my wildest dreams could I have imagined it would have been so easy and fantastic at the same time to be living together...

« Previous PageNext Page »
picture