Go forward in time to November 2003.
We drove back to Mexico City last night so that we can cancel our apartment lease tomorrow. Paperwork, paperwork...
The problem:
my-laptop --- my-firewall --- internet --- miguel-angel's-firewall --- my-desktop-box \______Mexico City______/ \_________________Xalapa_________________/
I'm in my-laptop. My Evolution data is in my-desktop-box, and I need to copy it back to my-laptop. Mike's beautiful solution is this:
my-laptop$ ssh -f -N -P -L 2222:my-desktop-box:22 miguel-angel's-firewall my-laptop$ rsync -vaz --delete -e 'ssh -x -P -p 2222' localhost:~/evolution ~
So we get an ssh that rsync runs over an ssh tunnel. I'm delighted. I can also do
my-laptop$ ssh -p 2222 localhost my-desktop-box$
Which is plain elegant.
Friday: We were pretty tired by Thursday night from all the packing and were considering postponing the move until Monday. So we called Carmen on Friday morning and she said she would send us two or three people to help us finish packing. We said, why not.
So she sent us these packing/moving ninjas who put everything in bubble wrap, wrapping paper, and tape really quickly and loaded our furniture, boxes and packages into a truck without a hitch. They drove off to Xalapa, and we were left with nothing on our apartment. After a good and rewarding Argentinian dinner, we slept at my father's house that night.
Saturday: My father lent us his station wagon, which is much larger than our small car, and we loaded the last few potted plants in it. We drove to Xalapa early in the morning, and we managed to take the long way around; instead of going through Perote, we almost got to Veracruz, so we got to Xalapa two hours late. The movers were already there when we arrived, but fortunately Miguel Ángel had already made them unload our things and put them inside the new apartment. We paid the movers off and started to arrange things around. We managed to get the bedroom and part of the kitchen sorted out.
Miguel Ángel and Lucy took us to Jalcomulco, a little town about 30 Km away from Xalapa. There is a river where the townspeople grow shrimp, and we went to a totally fantastic seafood restaurant. I had the best mojarra enchipotlada I've ever had in my life, and everything else was excellent as well.
Sunday: Got the dining room more or less in order, but the unpacked boxes are piling up to worrisome levels in the spare room that we'll use as a living room. In the evening we went to watch Once Upon a Time in Mexico, which is a good parody of itself, and made for a nice and silly Sunday movie.
Monday: Set up my desktop box at Miguel Ángel's house, as our phone line and DSL haven't been set up yet. Our original plans were to return to Mexico City on Sunday evening, but we decided to stay in Xalapa to finish setting up the basic house services. I downloaded a bunch of files I needed from the office, and got my machine set up to working condition.
In the evening we made a short trip to Veracruz to have a few lecheros at La Parroquia. It's unreal to drive for just two hours and be there; in our minds Veracruz is supposed to be far away from where we live.
If the day is clear, one can see the Pico de Orizaba, Mexico's tallest mountain, through our bedroom window. This is so pretty.
Now that our apartment is not a dark cave like the old one in Mexico City, we are not having any trouble at all waking up at 7:00 AM. Sunlight streams through the huge bedroom window, and it wakes us up.
Update: Our phone line got installed! Our water heater got fixed! A letter from my brother arrived! Oralia made strawberries with cream and sugar for dessert! These made the day just perfect. We still have to wait until Friday for DSL to be set up, though.
Last night Hans Petter and Maru invited us over to their house for dinner, where HP cooked a very good ham and cheese quiche. Their house looks so nice these days with Ikea inflatable furniture, Zimbabwean fabric on the walls, and especially the Japanese suicide girls poster.
HP got a hacked Xbox. It has this GPLed media player that automagically reads music/video/whatever from an SMB share on his main computer. It looks quite interesting, and much less painful than trying to set up multimedia on Linux.
Boxes. Boxes, boxes, bubble wrap, packing tape. Random shit you have no idea of why you ever decided to keep. We certainly don't need 5 copies of a London bus map that you can grab for free as soon as you set foot there. Neither do we need to archive my first Computer Science exam from college, where I correctly pointed out all the syntax errors in the example programs...
GtkFileChooser got merged into GTK+! There will be much rejoicing, and everyone should port their applications to it ASAP.
Piazzolla on the radio, as played by a Finnish group. This makes my day.
This weekend we visited Hugo and Juanita. We gave them a virtually new spare mattress we had, identical to the one in our bed, because we will not have room for it in the apartment in Xalapa. Their old mattress was quite tattered, so this will be a good change for them.
Yesterday morning I went to the dentist, and it totally kicked my butt. The dentist drilled on my lower left molars for about two hours, and then took some casts and did some cleaning. I need two other crowns and a filling on that side of my mouth. This is the last section that needs fixing, and I am glad that it is going to be over soon. My mouth should be completely fixed by the time we move to Xalapa, and then it is Oralia's turn. Fortunately, she needs much less dental work than I did.
We now have a date set for our current asshole realtors to come to our apartment to see if we managed to completely destroy it, lest our fixes to the 30+-year old building be not suitable for the next tenant. Since we are terminating the contract before its expiration date, on November rather than January, we will not be getting the deposit back. That's 10K pesos. Ouch.
But other than that and my father's and Oralia's mother's endless stream of preoccupations about the move — advice from experience, they say, but there are better ways of giving advice than scaring you shitless — everything seems to be on track for our move. Oralia started packing books into boxes, and tonight I want to empty at least one of the closets that is full of totally random crap. We have been quite the packrats, so this is a good time to get rid of stuff that we have never used and will probably never use. For example, my basketful of old computer/electronics cables would be better in the garbage.
I need a new bike.
We are in Xalapa, and we found a nice little apartment for rent. It's part of a duplex house, and the owner made it really, really easy for us to secure the deal. People outside of Mexico City are evidently more trustful; realty was supposed to be painful, wasn't it?
Oralia had found a nicer house yesterday, but there are no phone lines that reach that area yet, so we discarded it.
It looks like we'll be moving on the weekend of November 1st. We are excited, and nervous!
Oralia grabbing a little sun at Jardín Borda, in
Cuernavaca:
Mister Blandford needs some google-fu.
Last night I took Oralia to the bus station so that she could go again to Xalapa to look for a house for rent. Today it looks like she found a great place, and it's cheap! Our moving plans are going well so far.
But I miss her so much. I couldn't sleep well at all, had a few nightmares, and woke up feeling terrible.
The file chooser now has bookmarks support:
There is a problem with GtkFileSystemGnomeVFS, though. It loads directories asynchronously, and it will not return anything from the get_info() method until the corresponding file's info is loaded. Tomorrow I'll fix that and revise the API for getting icons from GtkFileSystem; it doesn't look like it will integrate nicely with Gnome-VFS as it is right now.
On Friday evening we went to watch Real Women Have Curves. What a nice surprise! The whole movie looks very natural. At first the constant changes between English and Spanish were a bit annoying, but that is just the way it is just north of the border: my cousins, who moved from Mexico City to Laredo, Texas when they were small kids, are like that. They'll talk among themselves in English, but they'll speak Spanish with their parents.
After the movie we were hungry, so we went to the fondue place in the little shopping mall where the theater is. Eduardo, a friend of Oralia since elementary school, works there. When we had finished our cheese fondue, he told us that as a "house courtesy" he would get us a fondue de cajeta, or sweet burnt milk fondue. It was delicious, and then he brought us a couple of capuccinos. This was really kind of him.
We were in a very good mood, so we went into the theater again and watched Nicotina. We had some good laughs.
Oralia found the Waking Life sountrack at the record store! The music, by Glover Gill, is just great.
The other day Oralia made some berry marmalade. I got some very good Camembert cheese a few days ago, so these days breakfast consists of bread with Camembert and marmalade. I had not had this for a long time and I had almost forgotten how good it is.
I'm almost done fixing libwnck for the tasklist:
Note that Emacs is grouped! It didn't use to do this, and now it works fine. Libwnck used window group leaders for grouping, and now it properly uses the WM_CLASS hint. Tomorrow I'll finish fixing the icons and the other loose ends of the patch.
More cosmetic stuff for the file chooser. It has the start of the bookmarks list now, and it always sorts the file list by showing directories before files. That is, no matter whether your sort order is ascending or descending, your primary sort key is always directories-versus-files; your secondary sort key is the filename, size, modification time, or whatever. In other words, you do not want this:
| Ascending | Descending |
|---|---|
| Dir1 | File3 |
| Dir2 | File2 |
| Dir3 | File1 |
| File1 | Dir3 |
| File2 | Dir2 |
| File3 | Dir1 |
But rather this:
| Ascending | Descending |
|---|---|
| Dir1 | Dir3 |
| Dir2 | Dir2 |
| Dir3 | Dir1 |
| File1 | File3 |
| File2 | File2 |
| File3 | File1 |
That kind of sorting should be trivial, right? Your specific sorting function takes two arguments. If both are directories or both are files, you compare them by the secondary sort key. Otherwise, you put directories first. In a real programming language, you could write this concisely as follows:
(set-sort-func sortable NAME_COLUMN
(make-comparer impl (lambda (a b) (strcmp (get-name a) (get-name b)))))
(set-sort-func sortable SIZE_COLUMN
(make-comparer impl (lambda (a b) (compare (get-size a) (get-size b)))))
... etc ...
(define (make-comparer impl f)
(lambda (a b)
(if (eq (is-dir? a) (is-dir? b))
(f a b)
(if (sort-ascending? impl)
(if (is-dir? a) -1 1)
(if (is-dir? a) 1 -1)))))
Here, sortable is the general sorting mechanism to which you pass a specific sorting function. Also, impl is something that carries information about whether the sort order is ascending or descending — we need to know this so that we can always put directories before files. Note how make-comparer takes in a function and returns another function. It simply wraps whatever you passed in with a helper that does the directories-versus-files comparison first.
In a crappy programming language, however, you cannot have functions that return functions — we cannot write the little make-comparer like above. Instead, we have this mess of callbacks:
static gint
compare_with_folders_first (Magic *impl,
File *a, File *b,
gint (* func) (File *a, File *b))
{
gboolean dir_a = is_folder (a);
gboolean dir_b = is_folder (b);
if (dir_a == dir_b)
return (* func) (a, b);
else
return is_sort_ascending (impl) ? (dir_a ? -1 : 1) : (dir_a ? 1 : -1);
}
static gint
compare_names (File *a, File *b)
{
return strcmp (get_name (a), get_name (b));
}
static gint
compare_sizes (File *a, File *b)
{
gint64 size_a = get_size (a);
gint64 size_b = get_size (b);
return a > b ? -1 : (a == b ? 0 : 1);
}
... etc ...
static gint
name_sort_func (Magic *impl, File *a, File *b)
{
return compare_with_folders_first (impl, a, b, compare_names);
}
static gint
size_sort_func (Magic *impl, File *a, File *b)
{
GtkFileChooserImplDefault *impl = user_data;
return compare_with_folders_first (impl, a, b, compare_sizes);
}
... etc ...
{
set_sort_func (sortable, NAME_COLUMN, name_sort_func, impl);
set_sort_func (sortable, SIZE_COLUMN, size_sort_func, impl);
}
In other words, it is a hell of a lot of code. Our make-comparer becomes a helper function called compare_with_folders_first(), but one needs to define a bunch of little functions for each special case; these are compare_names(), compare_sizes(), etc. Furthermore, when we invoke set_sort_func() we must pass yet another set of callbacks.
I could probably write a macro to generate the compare_*() helper functions and yet another one for *_sort_func(), but C macros are fantastically ugly.
Moral of the story: why the fuck are we still programming in C? Corollary: I'll be happy when Mono lets us write the foundations of GNOME. Doing all the framework in C is a waste of time.
Update: I simplified the whole mess with a macro. Now the individual functions look like this:
static gint
name_sort_func (GtkTreeModel *model,
GtkTreeIter *a,
GtkTreeIter *b,
gpointer user_data)
{
COMPARE_DIRECTORIES;
else
return strcmp (gtk_file_info_get_display_key (info_a), gtk_file_info_get_display_key (info_b));
}
It makes the code a lot more readable, but the compiled code is larger. Sigh.
Last night we watched Matchstick Men, and it was quite good. Nicolas Cage is kicking ass these days.
Go backward in time to September 2003.
Federico Mena-Quintero <federico@gnome.org> Wed 2003/Oct/01 15:00:36 CDT