McEs, A Hacker Life
2004 Linux Symposium, The End
Since I was lazy to start writing down OLS'04, I just post what I wrote on keynote. I will go back and write about talks I attended later.
After the entertaining key-signing party, was the keynote. Keynote was to be addressed by
Andrew Morton, the 2.6 kernel maintainer.
Rusty Russell who did the keynote last year, introduced Andrew and welcomed him. Andrew is more than forty years old which is heck a lot for such a hacker. He's a very easy East Asian looking guy, with kinda blue eyes.
Well, the keynote was in plain talk, no slides, no eye-candies, etc. He basically went over how system software is developed in companies and the new model of development of the Linux kernel and stuff like that.
Then Andrew Hutton, the organizer showed up, thanked everybody, and noted that Andrew is expected to introduce the keynote addresser next year, when he also asked him to stand up! With a bit of wonder, he was good old Dave Jones. And it was now about the prizes. The guy from CE Linux Forum told us how by Canadian laws, winning people have to pass an
skill test. Unlike last year, this year there were just three prizes, which with their test questions they where:
- Sharp Zarus with internal Camera and 256MB Flash
Q: Square root of binary number 100 expressed in binary?
A: 10. - Sharp Zarus with internal Camera
Q:Square root of binary number 10000 expressed in binary?
A:100. - Pioneer DVD Recorder, 8 hours recording...
Q:Square root of binary number 1001 expressed in binary?
A:11.
Then I just jumped out to hotel, took a shower, packed my stuff, made a couple calls and went out to visit an old friend.
It was around 11:30 that I joined the sponsored all-drinks-free pub-night that was started at 8PM and was going up to 4AM, like the past two years, at Black Thorn Cafe. They had this cherry kinda beer on tap that Telsa recommended and was great. So I basically just had something fast, emm, two pint of Rickards Red, half a pint of the other beer, two shots of something, that's all I
guess, and waved “goodbye...see you next year” for everybody... Headed to the hotel, took a taxi, and right now I'm almost in Toronto. The battery of this Vaio is almost dead these days. Wasn't like that, but is. Goes from 100% to 5% in just fifteen minutes. Got to buy a new battery :-(.
See you next year :-).
A Hanoi-like Puzzle
Someone forced me to write than the solution of this puzzle, so I did. Here it comes: (I wrote in text, not much markup, sorry)
Part 1. Here is a solution for N=4: (1 means to flip the cup, 0 means not to do)
1111
1111
1010
1111
1100
1111
1010
1111
1000
1111
1010
1111
1100
1111
1010
1111
16 moves
Part 2. We prove that for all powers of 2 there exists a solution and for no other number there exists one. To prove this, we prove three lemmas.
Lemma I. If there exists a solution for n/2, then there exists a solution for n. (n is even)
Lemma II. If there exists a solution for 2n, then there exists a solution for n.
Lemma III. No odd number other than 1 has a solution.
It's easy to see that the three lemmas above result in what we want.
Moreover, it's easy to see that the same sequence always works for all goals, not only the goal with all cups facing up. This is because we can always "xor" the goal with the initial sequence. The point is that, it's always the xor of the goal and the current arrangement which is important. We use this property in our proofs. We consider an arrangement as an array a[0]..a[n-1], and the i'th move of sequence m as m[i][0]..m[i][n-1]. Now the proofs:
Lemma I. If there exists a solution for n/2, then there exists a solution for n. (n is even)
Proof: First, observe that if the initial arrangement is concatenation of two identical length n/2 sequences, then the same winning sequence for n/2 can be used to solve this special n problem, by doubling each move too. In other words, if for the initial sequence we have a[0]..a[n/2-1] == a[n/2]..a[n-1], and m2 is a winning sequence for the problem of a[0]..a[n/2-1], then m is a winning sequence for a[0]..a[n-1] where m has the same number of moves as m2, and each move i of m is composed as:
m[i][0]..m[i][n-1] = m2[i][0]..m2[i][n/2-1],m2[i][0]..m2[i][n/2-1].
This is because after applying such *doubled* moves, and rotation, all the time the first half of the sequence always looks exactly like the second half.
Now, for an arbitrary initial sequence, what do is to do moves that at some time makes the first half and second half of the sequence (table) look the same. This is particularly easy too. All we need to do is to pad the moves from m2 with zeros:
m[i][0]..m[i][n-1] = m2[i][0]..m2[i][n/2-1],000...0(n/2 times)
Note that no matter what the rotation, this move always has the same effect on *the xor of first and second half of the sequence*, and as we noted earlier, that's all that matters. So, at some time between one of these moves, or before the first move or after the last move, we get a sequence with first and second halfs equal. Now we can use the strategy we described before to solve the problem. So, what we do, is to run the second strategy, doing the first strategy completely once between each (and before the first and after the last) move of the second strategy. All we need to check is that none of the moves of the first strategy alter the "xor" of the first and second halfs, so does not conflict with our running second strategy at all. We are done.
The following Python code uses this strategy to solve the problem for powers of 2:
#### BEGIN PYTHON CODE ####
#!/usr/bin/python
import sys
n = int(sys.argv[1])
def solve(n):
if n == 1:
return ['1']
if n%2:
print "impossible"
sys.exit(1)
n2 = n / 2
m2 = solve(n2)
m = []
for x in m2+['']:
for y in m2:
m.append(y*2)
if x:
m.append(x + '0'*n2)
return m
moves = ['1'*n]+solve(n)
for x in moves:
print x
print len(moves), 'moves'
#### END PYTHON CODE ####
It's easy to see that for n, it takes 2^n moves.
Lemma II. If there exists a solution for 2n, then there exists a solution for n.
Proof: Let m2 be a winning sequence for 2n, then m constructed in the following way is a winning sequence for n:
m[i][j] = m[i][2j] xor m[i][2j+1]
Let's see how it works. For initial arrangement a[0]..a[n-1], we construct the following 2n arrangement, called b, by interleaving the n arrangement with zeros:
b[0]..b[2n-1] = a[0],0,a[1],0,a[2],0,...,a[n-1],0
Now, m2 is a winning sequence for 2n and so wins the game started with this long sequence b too. We play the two games for a and b in parallel, with the exception that we make the move of the genie for the simulated game on sequence b too. This is how we do it: If genie of table a (the real game) rotates the table x turns, we rotate the table b, 2x times. (of course we don't know how much genie turns the table, but we just need to consider this to prove the correctness, the algorithm doesn't need us to know.) Now all we do is to sit back and observe that the following invariant holds for all j, allthe time, for arrangements on table a and b before/after all moves, rotations, etc:
a[j] = b[2j] xor b[2j+1]
For rotations it's obvious, for moves we get because the way we designed our moves. Means, if a.old and b.old are the arrangement of table before i'th move, and a and b are the arrangements for after move i, we know:
a[j] = a.old[j] xor m[i][j]
b[2j] = b.old[2j] xor m2[i][2j]
b[2j+1] = b.old[2j+1] xor m2[i][2j+1]
And:
m[i][j] = m[i][2j] xor m[i][2j+1]
And by induction have:
a.old[j] = b.old[2j] xor b.old[2j+1]
Mixing the all we get what we want:
a[j] = a.old[j] xor m[i][j]
= b.old[2j] xor b.old[2j+1] xor m[i][2j] xor m[i][2j+1]
= b.old[2j] xor m[i][2j] xor b.old[2j+1] xor m[i][2j+1]
= b[2j] xor b[2j+1]
Initially the condition holds, because of the way we constructed b. Since m2 is a winning sequence, at some point b becomes all zero (000000...00), which by our invariant, means that a should be all zeros (000...0) too. We are done.
Lemma III. No odd number other than 1 has a solution.
Proof: Assume by way of contradiction that there exists a finite sequence of moves that guarantees a win. Then there also exists a minimal such sequence, ie. A winning sequence that removing any of its moves will result in a sequence that does not guarantee a win anymore.
Now consider the last move in this minimal winning sequence that contains both zeros and ones, ie. the last move which is not of form 111...1 (the last move cannot be all zeros, otherwise we can remove it, which contradicts the minimality assumption.) This last non-trivial move, by assumption of minimality, cannot be removed. Means that, there are situations that the game is actually played until this particular move; in other words, it is not the case that the game is always finished before this particular move. Consider a game path arriving at this move. Since this sequence guarantees a win, and this is the last non-trivial move, the arrangement of the cups after this moves should be either 000...0 or 111...1; or otherwise we lose the game.
So, no matter how much the genie rotates the table before this move, after the move we get a trivial sequence of 000...0 or 111...1. Now all we need to do is to observe that the ONLY sequences that when xor'ed with another sequence after an arbitrary rotation result in either 000...0 or 111...1 are the 101010...10 or 010101...01. In other words, since the number of cups is odd, the genie can always rotate the table such that after the last non-trivial move, we have an arrangement which is not 000...0 or 111...1, and so we lose. Done.
Static Unicode to Utf-8 Converter!
I was frustrated 5 in the morning and couldn't sleep. This is how I looked like:
So I decided to do something exciting. I've seen all over the place in Pango and other libraries that use UTF-8 for their internal encoding, that they have to hardcode the UTF-8 value of a character. For example from Pango sources:
/* First try using a specific ellipsis character in the best matching font
*/
if (state->ellipsis_is_cjk)
ellipsis_text = "\342\213\257"; /* U+22EF: MIDLINE HORIZONTAL ELLIPSIS, used for CJK */
else
ellipsis_text = "\342\200\246"; /* U+2026: HORIZONTAL ELLIPSIS */
So I decided to write down a macro to do the conversion. Such that you give it 0x22EF and it gives back "\342\213\257". Since nobody has done that before, I knew that's not going to be easy. Mastering the C preprocessor these days, I knew that it may be impossible...
I started thinking. First: The only way to create a string in preprocessor is using the STRINGIZE operator #x, which is not any helpful here. So I decided that what I'm going to form is an array. After playing a bit I found that (char *) {0342, 0213, 0257, 0} is almost as good as what I want, and if not anywhere else, at least it can be used to initialize string buffers. Then I can say:
char ellipsis_text[] = UNICODE_TO_UTF8(0x22EF);
That's pretty much what I did, except that you can't put this initializer inside paranthesis, as it's not an expression. So you cannot use (x?y:z), means, no control on the size of the initilizer. So I had to stick with 7 octets. Here is what came out:
#ifndef _STATIC_UTF8_LONG_H
#define _STATIC_UTF8_LONG_H
#define UNICHAR_TO_UTF8(Char) \
(const char []) \
{ \
/* first octet */ \
(Char) < 0x00000080 ? (Char) : \
(Char) < 0x00000800 ? ((Char) >> 6) | 0xC0 : \
(Char) < 0x00010000 ? ((Char) >> 12) | 0xE0 : \
(Char) < 0x00200000 ? ((Char) >> 18) | 0xF0 : \
(Char) < 0x04000000 ? ((Char) >> 24) | 0xF8 : \
((Char) >> 30) | 0xFC, \
/* second octet */ \
(Char) < 0x00000080 ? 0 /* null-terminator */ : \
(Char) < 0x00000800 ? ((Char) & 0x3F) | 0x80 : \
(Char) < 0x00010000 ? (((Char) >> 6) & 0x3F) | 0x80 : \
(Char) < 0x00200000 ? (((Char) >> 12) & 0x3F) | 0x80 : \
(Char) < 0x04000000 ? (((Char) >> 18) & 0x3F) | 0x80 : \
(((Char) >> 24) & 0x3F) | 0x80, \
/* third octet */ \
(Char) < 0x00000800 ? 0 /* null-terminator */ : \
(Char) < 0x00010000 ? ((Char) & 0x3F) | 0x80 : \
(Char) < 0x00200000 ? (((Char) >> 6) & 0x3F) | 0x80 : \
(Char) < 0x04000000 ? (((Char) >> 12) & 0x3F) | 0x80 : \
(((Char) >> 18) & 0x3F) | 0x80, \
/* fourth octet */ \
(Char) < 0x00010000 ? 0 /* null-terminator */ : \
(Char) < 0x00200000 ? ((Char) & 0x3F) | 0x80 : \
(Char) < 0x04000000 ? (((Char) >> 6) & 0x3F) | 0x80 : \
(((Char) >> 12) & 0x3F) | 0x80, \
/* fifth octet */ \
(Char) < 0x00200000 ? 0 /* null-terminator */ : \
(Char) < 0x04000000 ? ((Char) & 0x3F) | 0x80 : \
(((Char) >> 6) & 0x3F) | 0x80, \
/* sixth octet */ \
(Char) < 0x04000000 ? 0 /* null-terminator */ : \
((Char) & 0x3F) | 0x80, \
0 /* null-terminator */ \
}
#endif /* !_STATIC_UTF8_LONG_H */
and the code to use it:
#include <stdio.h>
#include "static-utf8-long.h"
int
main()
{
printf ("%s\n", UNICHAR_TO_UTF8 (0x06CC));
return 0;
}
But as you should have guessed (leave here otherwise ;), this way every single UTF-8 character consumes exactly 7 bytes, which is way a lot. So I was not satisfied. I tried and checked out the assembly output of
gcc
under different optimization options, and no wonder none of them kicked the trailing zero bytes out. So I needed to continue. Good, it was only 6 by now. For sure I needed to use preprocessor conditionals. But then, in preprocessor conditionals, you can only use preprocessor symbols. The rest is obvious now:
#ifndef Char
# error Char undefined
#else
(const char [])
{
#if Char >= 0x00000000
/* first octet */
(Char) < 0x00000080 ? (Char) :
(Char) < 0x00000800 ? ((Char) >> 6) | 0xC0 :
(Char) < 0x00010000 ? ((Char) >> 12) | 0xE0 :
(Char) < 0x00200000 ? ((Char) >> 18) | 0xF0 :
(Char) < 0x04000000 ? ((Char) >> 24) | 0xF8 :
((Char) >> 30) | 0xFC,
#endif
#if Char >= 0x00000080
/* second octet */
(Char) < 0x00000800 ? ((Char) & 0x3F) | 0x80 :
(Char) < 0x00010000 ? (((Char) >> 6) & 0x3F) | 0x80 :
(Char) < 0x00200000 ? (((Char) >> 12) & 0x3F) | 0x80 :
(Char) < 0x04000000 ? (((Char) >> 18) & 0x3F) | 0x80 :
(((Char) >> 24) & 0x3F) | 0x80,
#endif
#if Char >= 0x00000800
/* third octet */
(Char) < 0x00010000 ? ((Char) & 0x3F) | 0x80 :
(Char) < 0x00200000 ? (((Char) >> 6) & 0x3F) | 0x80 :
(Char) < 0x04000000 ? (((Char) >> 12) & 0x3F) | 0x80 :
(((Char) >> 18) & 0x3F) | 0x80,
#endif
#if Char >= 0x00010000
/* fourth octet */
(Char) < 0x00200000 ? ((Char) & 0x3F) | 0x80 :
(Char) < 0x04000000 ? (((Char) >> 6) & 0x3F) | 0x80 :
(((Char) >> 12) & 0x3F) | 0x80,
#endif
#if Char >= 0x00200000
/* fifth octet */
(Char) < 0x04000000 ? ((Char) & 0x3F) | 0x80 :
(((Char) >> 6) & 0x3F) | 0x80,
#endif
#if Char >= 0x04000000
/* sixth octet */
((Char) & 0x3F) | 0x80,
#endif
0 /* null-terminator */
}
#undef Char
#endif
and the code to use it:
#include <stdio.h>
int
main()
{
printf ("%s\n",
# define Char 0x06CC
# include "static-utf8-short.h"
);
return 0;
}
I'm not quite sure that I can find anybody to actually use this. At least I'm sure it will not show up in Glib. Yet another reason to start my own Unicode library ;-). By the way, lemme know if you have a better (read: real) solution.
[I said that we need a gallery of codecs on
UTF-8 Project.]
More Pango
Owen, Soheil, and I commited five of our pending patches today in Pango. The storm is coming...
Owen Taylor
We went into technical discussion three times.
First the night before conference starting. As I said before, I told him how Arabic rendering is pretty slow in Pango, which we both agreed that it's a problem in Pango's OpenType handling. Two days later, he told me that he did some optimizations last night, caching some values when handling OpenType features, which made Arabic rendering faster! Before the patch Arabic was taking 2.2 times slower than English, after the patch it's just 1.8 times. Pretty good. [Update: he applied the patch on July 26. From the ChangeLog:]
Mon Jul 26 14:49:22 2004 Owen Taylor
* ftxgdef.[ch] otlbuffer.[ch]: Make Check_Property() take a
OTL_GlyphItem, add a gproperties field to OTLGlyphItem,
and use that to cache the properties for a glyph.
* ftxgsub.c ftxgdef.c: Adapt to Check_Property() changes.
* otlbuffer.[ch] ftxgsub.c: Add otl_buffer_copy_output_glyph()
to use when we are copying an unmodified glyph from input
to output that preserves the cached properties.
Isn't that cool? [Update: The patch had a bug. Just fixed it now after a long hacking session.]
Second time was at lunch on the second (last) day of the conference. I asked all kind of questions. Mainly talked about different features that I like to see in Glib, like complete
Unicode Character Database, or loose searching, or new
Unicode Technical Reports. What I found out was that Owen is not interested in more functionality and features at all; he needs enough evidence that a feature is really useful in real life before he decides to put it in. That's a good characteristic of a good maintainer. So, Unicode Character Database goes into a separate library. I'll post later about the details. Stay tuned.
Third and last was at the pub the night that conference finished. I asked all kind of questions again, about justification, paragraph direction code and keyboard layout direction, enclosing marks, font selection for neutrals, many many other things. I can't just dump what I said and heard. I will implement them step by step... For the first step, I'm going to clean-up all direction-related stuff in opentype/ and modules/.
Owen also noted that he's got mails about how theming engine is not working for some widget in Gtk+, when people wanted to design a red theme for use in their sub-marine! According to him, Gtk+ is being used in flight-control software too.
On the way back from pub to hotel, me, Owen and Daniel Viellard were talking about optimizations for ASCII text. Daniel mentioned how he close-circuits certain code-paths for ASCII-only text. Owen noted that he's not going to do any such thing in Pango, cause if ASCII rendering is much faster than the rest, then people will write applications that works Ok with ASCII, but fails (is very slow) with other characters... Thanks Owen :-).
[Unfortunately I didn't took a photo of him, so I stole the photo.]
New Features of Qt 4
The talk about
New Features of Qt 4 was delivered by a
Trolltech employee,
Jasmin Blanchette. A few interesting points:
- In Trolltech they pronounce it "cute" internally
- Trolltech has 60 employees, not a big company, but way too many people to work on a toolkit. I mean, we definitely don't have 20 people working full-time on Glib, Pango, and Gtk+ put together, which is a good approximation of what Qt does. Just if we had...
- They have around 4000 customers. 25% of them use Qt only on Windows
Seems like most of the changes they have done in Qt 4 is cleaning up and rearchitecturing Qt 3. They have also divided it into 6 or 7 smaller libraries, one of them being qt-core, which is doing what glib does. They coined a name for theire rendering subsystem, like Microsoft did ;-). They support line justification with special handling for Arabic. We really need to do this in Pango soon. They've done a few interesting optimizations too, for example in number of malloc() calls. They also noted that when allocating on multiples of page-size, a realloc does not copy all pages, just tweaks the page-tables. So now, when realloc()ing, they add one page at a time, don't double the chunk size.
After the slides where done, he switched to show us a few examples. We all witnessed that he's using a very very simple stone-age Xv desktop, not KDE, with no panel at all! He asked us not to tell his boss about these! I couldn't help but bringing out the camera and taking a photo; which I did :D. He just got what happened after everybody started to laugh. The photo unfortunately didn't turned out great because of the flash, but you can still see that it apparently is not KDE running. I edited with The GIMP the color levels of the screen:
Later Jasmin found me and showed me how he's written this accident in his report, and how he's managed to make KDE running. I promised to show up and take another photo during his presentation in OLS, and I did, this time with no flash. Turned out blurry, but here it is:
All in all, Qt 4 looks even nicer than Qt 3. Just if it wasn't in C++... And oh, another interesting point, they support three different APIs for iterators, one Java style, one old Qt 3 style, and one like the kernel way, defining the macro
foreach
or something like that. They don't care about the name-space ;-). A beta is already out, good idea is to test it. Final version is scheduled for first half of 2005.
Desktop Developers' Conference - Day2
I slept and missed the
Wine talk by CodeWeavers CEO
Jeremy White.
Next talk was about
Games on Linux. These two guys hang around and port all kind of games to Linux for companies. They showed us some demos of Unreal Tournament. Alan Cox also showed up.
Then was the interesting talk about
GCJ and the Desktop by
Thomas Fitzsimmons or Red Hat. Seems like in a year or two we can really use gcj to compile and run all Java programs, which makes Java a good candidate for
the higher-level language for
GNOME desktop.
After that was the talk on
Eclipse by
Billy Biggs. He actually focused on the
Standard Widget Toolkit (SWT) they have implemented and
Eclipse is based on. Sounds like an interesting widget set for Java.
Then was the talk about
New Features of Qt 4, delivered by
Jasmin Blanchette that I will cover in the next post.
And finally,
Getting to the Next Web was delivered by the
Mozilla.org founders
Mike Shaver and Brendan Erich. They talked about all these different markup languages. More importantly, they told us how SVG 1.2 is not what you think it is. It is Evil(TM). It even has a socket API in it! And that they are not going to implement the dirty sutff in it. They will implement SVG 1.1 and a few parts of 1.2. The rest was open discussion...
This marked the end of conference. I asked everybody to come for a group photo which we made. Here it is:
There was also a unsponsored pub-night for the coming
OLS'04 that we were invited too. I met Harald Welte, the netfilter & iptables chairman. We happened to become friends last year in OLS'03. I talked more with Telsa, and a few other people. Then I joined the table with gstreamer developers and Owen Taylor, and soon found myself talking Pango with Owen, which lasted an hour. Then we joined Daniel Viellard and a KDE developer, talked about libxml a bit, and the KDE guys noted that they want to use
GNU FriBidi in
KSVG, the SVG engine for KDE!
We came back to hotel, shook goodbye hands with Owen, hoping to meet next year at
GUADEC in Germany...
My Presentation
For the first time in conferences, I started my presentation on time. Although it was the last presentation of the day, everybody was still there, that I didn't expect. For the first couple of slides that were all text, I thought that I'm being too technical with people still having no idea of what these things are, but after that examples helped and didn't felt like that to anymore.
It turned out that the screen-shots helped a lot and were quite well-chosen. The experience of this talk and the on from IUC 25 show that technical meetings have no place in conferences. In a conference, you have an audience who is not much familiar with your problems, and you just want to show them your stuff using examples and shots. For a technical discussion, first, you need at least two experts, and two very interested people. Here I was the only expert (at bidi stuff), and Owen was the interested one. So we just did our discussions in the pub later, instead of around a table in the conference...
I even got five or more questions at the end. Someone suggested that SVG with run-time strings may be a solution for translating icons with text in them. Good idea! We can add mirroring in there too. Someone noted that Keshide should be used to justified Arabic lines that I agreed. Owen was wondering if we can do user testing for the layouts. Someone else was asking if right-to-left layouts are really what a user expects or not, which I said yes, we've had them in DOS too.
That's basically it for the day. On the next day, several people approached me and expressed their feelings on how good my presentation was! Seems like the examples were chosen really good and I expressed the problem quite good. I didn't expect that at all. One of them was from Red Hat, thanked me for letting him finally know why Pango is there! The Eclipse developer also was interested in doing bidi stuff in their widget set (SWT). Someone from University of Waterloo asked me for the slides.
Well, finally I did a good presentation in English with no delay and other problems... I'm happy about that. I sat down and cleaned the slides and uploaded them. Again,
here are the slides. Best work with Mozilla. They validate, but I'm not sure how they look with IE or another browser.
Two more photos of me presenting are
here and
here.
Desktop Developers' Conference - Day 1
There was just one track, and 12 talks. Started with
Havoc's keynote address on
Creating a Desktop Operating System, which was good.
The next talk was the
X Development at freedesktop.org talk by our beloved (mailing list) administrator at freedesktop.org,
Daniel Stone. Seems like there are four or five xserver trees there right now. One is the monolithic xorg tree, one Daniel's modular autoconfiscated tree in TLA (something better than CVS), a Keith's personal tree including kdrive and stuff, a Glitz tree which is an X server on top of OpenGL (Yes!), and probably a couple more. I go over these later when writing X talks at OLS.
ROX and Zero Install talk by
Thomas Leonard, I didn't really payed any attention. I knew all the ideas and stuff behind it, but never really tried it. At the end of the dayed I hanged out a bit with Thomas who is nice young guy. Since I named on my talk Robert Brady, he noted that he and Robert have been class-mates in high school or something like that. On the second day, we hanged out a bit more. He just finished his PhD a couple weeks ago, and is going to continue his work on his desktop for the time.
UniConf is yet another configuration system but the presentation by
Avery Pennarun made it look much more interesting.
MultiSync and Synchronizing Personal Infomation on the Desktop, again I knew the idea and stuff from the mailing lists.
Now's
my turn.
Preparing the Slides
Ok it's not really tomorrow yet. It's July 19th, 1AM, I'm supposed to prepare slides for my talk tomorrow afternoon 5:15PM, still not started though. Neither I've read what I used to think I need to read before it. I say "I used to think I need" because I'm next to sure that I'm not gonna read. Just got to do the slides. But well, the laptop is there by the queen-sized bed, just have to go over the bed to get it...
...Magically woke up 4AM! Started slides while drinking Ahmad tea after Ahmad tea and smoking Winston after Winston. Well, Yes, the room is smoking. In fact it costs me a lot but I didn't want that. Andrew J Hutton the organizer was assigning we sharing people to suites, there were six of us, and John Lockhart was looking for a smoking room. So Andrew was looking for another smoker to put with him in one suite and pack the other four in another suite, so I volunteered. I mean, I normally don't ask for smoking room since I'm in "quitting" state for a long time now. The point is that, now "the two of us" are supposed to share the bill, not any "the four of us"! :((
Chain-smoking is allowed (and encouraged) when preparing slides or projects which are due in less than 24 hours, but the problem is that, I mean, after smoking a pack of them in a day, you most probably gonna do the same thing for the rest of week. [Update: and that's what's happening now four days after...]
The talk is called FIXME Bidirectional Layouts in GTK+. I decided to do the slides in HTML instead of LaTeX (or Lambda) to take advantage of our beloved OpenType Persian fonts, and well, really easier to write down, and don't need a manual (and I don't have internet at hotel)... And in case need be, I can switch to PHP to get some programming functionality to and avoid using LaTeX beasts just for a simple "for" loop... Which is exactly what happened :-).
I designed the template and it turned out to be quite like my LaTeX presentations, same color theme, and also same markup, in PHP format instead of LaTeX! Did the cover and overview but then it looked like I can't really make any progress there, so turned to the sofa, smoking Winston, drinking Ahmad tea, writing down slides on paper. Wow, it went sooo fast. In half an
hour I did 7 or 8 slides which did all the introductory and basic material, with examples and all. Then started to type them in. Many things changed in the process, but eventually by 8 I had half of the presentation ready, with a fair amount of eye-candy, compared to the pretty technical subject of the talk.
Then I dressed up, a coffee and and headed up to the Ottawa Conference Center, picked up the badge and entered the room. FIXME Havoc's FIXME keynote was already started. It took a while to make the wireless work, but then I just sat on the back of the room on a very comfortable sofa and kept going with the slides full powered. It was just in the afternoon that I found that I've not studied GTK+'s internals at all, so I can't really propose any solutions as I've promised in the FIXME abstract, and gosh, all people put aside, what Owen and Havoc would say? Probably that I just covered the Unicode Bidirectional Algorithm for the beginners...
To get an idea of GTK+'s model for handling direction, I started Glade-2 and looked up the widget properties. Found a couple of interesting ones, tweaked them to different values, put both English and Persian text and saved a few screenshots. Having an idea of what to look for now, I took a few interesting screenshots of applications under both en_US and fa_IR locales, and marked the interesting parts using The GIMP. They turned out better than I expected.
Finally with a bit of greping the GTK+ sources and headers, I compiled a couple of slides showing the GTK+ interface to them, and then fortunately found a couple bugs and misfunctionalities there, proposed best solutions that came to my mind. Wow, was getting something finally. Wrapped up with conclusions and I'm done!
At the end, I even had an hour to stretch and get some coffee before the presentation. It was a long 12-hour presentation-hacking session. But the result was again better than I expected.
Here are them.
Meeting the Gods
In the lobby, cool, he's
Havoc Pennington. Introduced myself, but unlike last year I was not recognized, fair enough, since I didn't said I do
GNU FriBidi either.
Next to him is this apparently British guy that I later found out is the developer of both
ROX desktop and
Zero Install system which is way cool.
While still standing there, looking around, trying to see what the plan is and if anybody knows about the wireless internet problem, he moved in,
Owen Taylor was there; finally met him! Introduced myself, got recognized this time! Then the four of us walked out heading to that street full of bars and restaurants in front of the US Embassy.
Here we go, Havoc and
Thomas (as I later found his name) in front, back is me and Owen, this blue-eyed thin tall hacker with t-shirt slipped into his pants that I've wanted to meet for a couple of years to say the least. The t-shirt shows this classic quotation by Mahatma Gandhi that says:
- First they ignore you
- Then they laugh at you
- Then they fight you
- Then you win
with the first three items checked on the left, the fourth with an (yet) unchecked box. Later I found that it's a Red Hat shirt on the back. [right now that I'm writing these, Michael K. Johnson, the former leader of the
Fedora Project, is around here, chatting with ex-co-workers from Red Hat.] By the way, I once took four photos and
tried to rhyme them with this Gandhi quotations. Maybe time to change the misleading quotation on my homepage:
To follow the path:
- look to the master,
- follow the master,
- walk with the master,
- see through the master,
- become the master.
Wasn't hard to start the talk, Owen asked if I'm still working on FriBidi (which like me and unlike Havoc, he pronounced it /frEbEdE/, not /frIbIdI/), and I explained how I'm supposed to make a release in a week or two for a long time now. Explained the problems, that people want to shape to presentation forms, etc. Was a good start. Then I started with how Pango renders Arabic text pretty slow, which is probably because of the OpenType tables in the font. [Update: Read the entry for two days later for more about this.]
We arrived at the pub, found out that the Kernel Summit people are there, so we Desktop people left and found (as Havoc's suggestion) a Vietnamese restaurant for us. Thomas and me ordered pan fried pork, while Owen and Havoc ordered the more weird-looking names, which turned out to be some kind of fish and shrimps. Owen asked about how we do ellipsize text in right-to-left context, turned out that he's been doing ellipsization in
Pango recently. Later that he released new Pango, I updated my CVS checkout and read the code; some ~700 lines of code just for ellisizing Pango layouts, which is quite useful, for example, in window titles. He explained how he uses U+2026 HORIZONTAL ELLIPSIS if the first preferred font contains such a character, otherwise uses three dots... Moreover, if the character after the place to put ellipsis is a CJK (Chinese, Japanese, Korean), it uses U+22EF MIDLINE HORIZONTAL ELLIPSIS!
He also told us how he drove from Boston to Ottawa in only 7 hours, but he mistakenly drove to Montreal and then came back to Ottawa, so 6:30 from Boston to Ottawa in fact!
After dinner, we went back to Kernel Summit people, asked them where we DesktopConf people are supposed to meet! And went to that place. Other people were already there, including
Jim Gettys of
X.org and Daniel Viellard, the GNOME developer of libxml2 . Later Andrew J. Hutton, the kind organizer of the conferences showed up and introduced me to my suite-mate. I didn't need to introduce myself to Andrew, he remembered me from Orkut :D.
Spent a couple of hours drinking beers and talking to
Telsa, the well-known GNOME hacker that mostly does documentation and also Welsh translation [right now I read her
.procmailrc and
.muttrc. Got to switch to
mutt really soon.] Came back to hotel with Mike K. Harris, the X guy at Red Hat that we all like his packages.
Ottawa Again
I hardly ever slept in the bus, but doesn't really matter, I'm finally here :D. Jumped into a taxi and got to the Les Suites hotel, where I'm sharing a suite with Mr Lockhart from Red Hat. Damn, this suite is a complete flat, kitchen with dish-washer, laundry, cool, even cups, dishes, pans, everrrrrrrrrything! It's even bigger than the flat I'm moving to next month to share with a friend. But wait, it's gonna cost me still a loooot after dividing in two :-(((.
A not-so-short nap, showered, shaved, and is almost 8PM. Lets head down for pre-conference pub night. Wireless internet was supposed to work, but apparently isn't. But going to pay more dollars to the hotel for internet, lets sleep the nights for one week this year at least...
First Anniversary
OK, here I'm back. The blog is one-year old officially today (I started writing down stuff on July 22th 2003, and actually posted here on 23th; I also wrote these yesterday and posting today), and it means I'm back to Ottawa to fly back to my planet :-). Once again I've been lazy, so I've got to write down stories from a few days back.
The short is that, this is the best week of the year to be in Ottawa. This year the plan is (links to schedules):
I registered for both OLS and DesktopConf as soon as possible, student early bird, which cost me $199 and $99. It was two months after registering that I became an speaker for DesktopConf and I could register for free...
Here we start. Adjust your clocks, we're going back five days, to July 18th. [In the brackets comes comments at the time of writing.]
Ottawa conferences again
In two weeks I'm heading to Ottawa again to attend
Desktop Developers Conference and
Linux Symposium. Accidentally it would be the first anniversary of this (already closed) blog. I'm still deciding where to write regularly. Here? On Advogato? Slashdot?
Behdad.org? I just noticed that I
like to write regularly again, specially on the on going status of
GNU FriBidi, but I'm busier than doing that :-(.
For the Desktop Conference I'm supposed to talk on Bidirectional Layouts in Gtk+. I've got to read a few documents, parts of Gtk+ source, and prepare lots of slides for that. These will take a week! And got to finish work on FriBidi which is lingering way too much :-(. No helping hand...
Farsi
I've set up a Google petition against
Farsi!