Previous Up Next

Diary, February 2001


   Sun Mon Tue Wed Thu Fri Sat
                     1   2   3
     4   5   6   7   8   9  10
    11  12  13  14  15  16  17
    18  19  20  21  22  23  24
    25  26  27  28


Thursday, February 1, 2001

A thin layer of snow

There was a thin layer of snow on the car this morning, and under it a strong layer of ice. I had to apply some defrosting liquid to get rid of it. By noon the snow was gone.

Windows XP

There are rumours that the next version of Windows (now known as Windows Wistler) will be called Windows XP. So now even Microsoft has embraced eXtreme Programming (XP for short)?

A few days ago, one of Microsofts spokes man said that Linux would disappear within a year. He appearently, forgot that Microsoft just moved their DNS servers to a provider running Linux servers, because they are more relyable and cannot be hacked.


Friday, February 2, 2001

Windows user interface

The whole Windows interface and most applications running under Windows are based on the load&save mode of working. This mode of working stems from the time that interactions with hard disks were slow. In that time, your word processor, for example, had to read a file from the hard disk into memory, and only after you were finished working, it was saved. This mode of working was enforced by implementation constraints. Although, already in that time, the more advanced word processors would generate a log file with all your changes, such that your work would not be lost in case the PC would crash in the middle of your work.

However, most of the time, you want to save your changes. A much better mode of working would be the undo&redo mode, which simply means that everything you do is immmediately saved, but it is possible to undo changes as long as your window is open. In this mode of working, an explicite save action is not required. And there is thus no need to have a "Do you want to save" question, when you close a window.

In the absence of a "save" button, changes made to a document of any kind, should be published immediately to other parts of the system. Application in this sense, should be considered as clients of a persistency server, which upon changes made by one client should inform all other clients. Of course, it would be very time consuming for the clients to immediately respond to all published changes. The concept of focus should determine when clients have to update their view. The window that has the focus is leading. The client tide to the window with the focus should have the highest priority. The clients should be given time to update their views in the order that they received focus for the last time. The effect of this is that the whenever the user does not touch the input devices for a few seconds, all of the views will be updated.

Making such a user centered undo&redo interface, would require a completely different Operating system design.

Snowing

It has been snowing almost the whole day, but due to the relatively high temperatures, the effect of this was not visible. Only at the afternoon when it became colder, the snow started to pile up on the ground.


Saturday, February 3, 2001

Thick layer of snow

It continued snowing during the night, and when we woke-up everything was covered with snow. I even noticed that the side of a lantern pole across the road had a line of snow on it. The same applied for many of the trees. Later during the day I measured the thickness of the snow, and found it to be 8 cm thick (a little more than three inches, for those who don't use the metric system).

While looking around in some bookshops in the city, Annabel rolled some snow into a big ball of snow. We made a snowman out of it. When we came home, I noticed that all the snow from the grass field in our backyard has disappeared. I remembered that in the morning some boys had rang the doorbell to ask if they could take it. Li-Xia had said yes, but a little later, I had told them no. I wonder if you can press charges for someone stealing snow from your backyard. Can you?

Cheap grapes

This morning, when I walked over the open air market in the center of Enschede, there was a place where they offered a whole box of seedles grapes for 5 guilders (about 2 USD). An incredible good offer. But, I hesitated little, also because I still had some other things to buy first. On my way back, I came a long a place where they offered a box of grapes for just 3 guilders. The boy showed me the grapes, there were indeed of an excellent quality, making the offer even more surprising. Now, I had no escape, and bought a whole box. Around this time, you usually pay 4 guilders per kilo. A box has about 5 kilo of grapes.


Wednesday, February 7, 2001

Zipping

To prevent traffic jams where two lanes merge into one, some organisations in the Netherlands are promoting the zipping method, which suggests that cars from both lines will merge like a zip. For this, two pairs of signs are placed well before where the lanes merge. After the first pair of signs, the people in the left lane should adjust their speed with the traffic in the right lane, and then the zipping should take place right following second pair of signs.

For some reason, this zipping procedure does not work, and today, I found out why it will never work. When I drive from Enschede where I live to Almelo where I work, just before Almelo the highway ends, and two lanes merge into one. But nevertheless the zipping signs, whenever there is a traffic jam, most of the cars will be on the right lane, with a few cars driving on the left lane, which zip right after the second pair of signs, apparently interpreting the rules that you should drive as fast as possible till the second pair of signs and then zipping thereby passing by all cars in the right line. I decided to stay in the left lane, and adjust my speed to the cars in the right lane just around the first pairs of signs, which actually ment driving at walking speed. Soon I discovered that some people behind me had some trouble with my strict interpretation of the rules. Just before the second pair of signs the car right behind me went to the right lane filling up a gap that was left open by a very slowly driving truck. At first I was relieved about him doing this, but than right after the signs, he started driving at the far left side of the right lane, indicating that he didn't want to make room for me to zip. Because, I had moved to the right side of the left lane, the person driving behind me had taken the opportunity to take me over on the right side while using his horn, and leaving me as less as possible space. I felt squized between the two cars on both sides not giving me any room at all. All I could do was break, and let some more cars pass on both sides.

I do not know what would have happened if I had crashed into one of the two cars. Remembering who some people had been shot on the highway in recent years, I concluded that I was a fool with me trying to keep the rules, and that the next time, I should move to the right lane, whenever there are cars behind me that like to take over. Then, I realized that the in the right lane are all people that want to polite, while in the left lane are the people that are impudent. Whenever a traffic jam starts, the people who are afraid to be considered as impudent when they take over others, move to the right lane. As a result of this, the right lane gets full, starts to drive slower, and the queue starts to grow. People approaching the traffic jam while driving on the left lane have the choice to join the long queue in the right lane, or to continue on the right lane. Often because the difference of speed and the traffic behind them, they decided to stay in the right lane, and anyway they are in a hurry. All the cars taking over, only make the right lane going slower. And some feel that because of the "zipping" they should indeed continue till the end before they zip, but they forget about adjusting their speed to the right lane. Anyway, at the end of the left lane, you always find the most impudent and aggressive drivers.

TaoDeChing - Lao Tze

I showed Li-Xia the chinese text of the Tao De Ching by Lao Tze. She did not recognize it as such, but did see that it was a very old Chinese text. She explained that the words in it are not used nowadays like they are in this text. She could not give me a translation, but when I showed her a english translation she said that it could indeed be translated like this. She explained that because of the Cultural Revolution she never has read any of the classical chinese text. I also begin to understand that there are many translations of the Tao De Ching. I wonder, if there are any word-for-word translations from Chinese to English. Because Chinese as a relatively few words, many words have a very rich meaning, and even the most simple words can thus get a different meaning when used in a certain context. In this respect Chinese poetry is much more a playing with concepts than English poetry, I would expect.

(Other stories about Chinese)


Saturday, February 17, 2001

New computer

Today, we ordered a new computer with FunPrice. It is a Athlon 800, with 128 Mbyte of memory, and a 30 GB 7200 RPM hard disk. This machine is at least ten times as fast as the last one we bought, it has eight times as much ram, and more than forty times as much hard disk space. And that for the same price as five years ago.

Reverse engineering Quark Xpress file format

Some time ago, I got some Quark Xpress files from which I wanted to export the contents from into some structured format (XML or a database). Quark Xpress puts text inside boxes. A number of boxes can be linked to contain a running text. These sequences of linked boxes are called stories. Quark Xpress does have all kind of export functions to export the text from a story. But in my documents the text in the boxes are not linked, and exporting the texts from all of the thousand or so boxes by hand, is just a little too much work. Quark Xpress does have a mechanism (called XTensions) for extendings the default functionality. So, I searched at Internet for free XTensions that would solve my problem, but to no prevail. I did find a nice XTension, called XML Xtract(R) version 2.1, to export the contents to XML, but that costed 399 USD, and was not even bug free, as it translated a paragraph style of the form "F<1>" into the XML tag "<F<1>>", which is clearly incorrect, I think. It should have resulted in something like "<F_1_>".

I felt that there was no way left over than to try to convert the files without using Quark Xpress. I searched for conversion programs and descriptions of the Quark Express file format. But again, my search did not result in anything. The only option left, was to reverse engineer the file format myself, and that is what I started to do tonight.

I already had looked at the contents (using bfc.c), a tool which I in the past also had used to reverse engineer the AutoCAD DWG R12 format. From this I already had seen that texts started at 256 byte boundaries. The first program I wrote, was a program which simply dumped the first 30 bytes of each 256 byte block. Studying the output of this, I noticed that the blocks with text were alternated by blocks with binary data. I also noted that the blocks with text did not have a marker (a zero byte, or such) to indicate the end of the text, but instead there was all kind of unreadable stuff at the end. My hypothesis was that the binary blocks would contain some information about the length of the text. I started to look if there was some kind of indication of this, or that there was a way the blocks were refering to this. I noticed that the binary block contained numbers which were just two higher than the number of the block if you counted them from zero. First, I though this was pointing to the next binary block, but it was obvious that this was wrong. Then I noticed that the blocks preceding several blocks of text, had consequentive numbers in it. The hypothesis that these were the numbers of the block containing text, when the blocks were numbered starting from one, appeared to be correct. Then, I also noticed, that these numbers were followed by two bytes, which appeared to contain the number of characters in the refering text block. So that problem was also solved. Furthermore, I discovered that the sequence with numbers was preseded by a number which was equal to six times the number of following text lines. Apparently, this was the number of bytes used to specify the blocks containing the text, and the amouth of text they contained. When I modified the program to read the data like this, it did run correctly, but not through the whole file. Somewhere, there appeared to by a block with binary data that did not match what I had found so far.

I decided to analyse the binary block of data preceding the text blocks in greater detail. I then discovered that the sequence of numbers was followed by a number again, which was a multiple of six again. I also recognized a repeating pattern in the bytes following. It looked like this number specified another block of data. Analyzing this further, I discovered that this pattern was repeated at least once more. My first impression was that this might be information about paragraph and character formating. But, then it was time to go to bed.


Sunday, February 18, 2001

84 Ways to Know If You're Chinese...

I received an email from
an old Chinese friend with a list of 84 ways to know if you are Chinese. It really made me laugh, because I recognized so many of them, being married with a Wonderfull Chinese Lady myself.


Monday, February 19, 2001

Reverse engineering the Quark Xpress format (Part 2)

This evening, I continued my quest of reverse engineering the Quark Xpress format, which I started on last Saturday. Of course, I started with checking my last ideas. The remaining binary data indeed consisted of groups of six bytes of data consisting of a two byte code and a four byte pointer in the text. When I checked this hypothesis, I found out that it indeed looked correct and that the remaining binary data was just filled with zeros. But when I tried to print out the text with the formatting codes, things did not match. I also found some parts where the pointers in the text were not increasing and certain values were repeated. There appeared to be something wrong with my hypothesis that the numbers were pointers. Then I got the idea that they might be represent not pointers, but lengths of sequence of characters with the same formatting. Some checking revealed that this was indeed the correct observation. I furthermore figured out which were the paragraph and the charater formating codes.

Then, I looked at the place where the alternating of binary and text blocks seemed to be broken, and I discovered that there was more than 256 bytes if of formating information. Now it was quite obvious what this extra block of binary data must contain: the rest of the formating information. But, because of the formatting information following the text, it is no longer possible to write a single pass parsing algorithm. The solution to this is simple: just read the whole file into an array of bytes, and parse the info from there, just as I did for my previous reverse engineering job that of figuring out the MS Word 5.0 file format.


Tuesday, February 20, 2001

Reverse engineering the Quark Xpress format (Part 3)

I didn't have much time tonight. The first thing I did was rewriting the program from reading the file to reading from a buffer. I did this in a number of small steps, each time verifying that the program still produced the same output (a form of refractoring). Then, I implemented the hypothesis about what happens if the formatting information does not fit into a single binary block. I made a guess about how it might deals with data over the border of two blocks. When, I ran the program it looked to parse much more than before. So, I was right about how the binary and textual blocks are intermixed. But, then I discovered that my guess about how borders are dealt with was completely wrong. I didn't have enough time to investigate this in detail. It looks like I did come less far than I hoped in the one hour I had tonight.


Wednesday, February 21, 2001

Reverse engineering the Quark Xpress format (Part 4)

Again, I did not have so much time. I tried some guesses about how the data is stored over more than one block, but all of my guesses failed, and seemed to contradict each other. I did conclude that the last four bytes of a block should not be included in the data, but where the data ends, and where you have to start reading in the next block is not clear, and also seems to depend on whether you jumped over some text blocks or not. I have decided that I should figure out the formatting data by looking at the text, and use this information to analyze the rules with respect to borders. Not much progress in the past days thus.


Thursday, February 22, 2001

Reverse engineering the Quark Xpress format (Part 5)

Tonight, I discovered, after two and half hours working, how it works. It appeared to be rather simple and straight forward. I have the feeling that I could have found it quicker, than the five hours I deeded to figure it out. I was misleaded by the fact that the first block is numbered one, while in my program I start numbering with zero (which seems more logical to me, especially when you work with C).

It works in the following way. The last four bytes of a block with binary data points to the next block. If the number is negative then the first two bytes of the next block, tell how many blocks are considered as one block. No bytes are skipped at the end of a binary block. That means that a four byte long value can be split over two binary blocks. It also appeared that the text is stored in the order in which it appears in the document. So, it looks like I do not have to figure out the position of all the blocks.

Because the start of the text is hard coded in the program, I think it will not work with just any file.

(Follow-up: I was not right)


Saturday, February 24, 2001

Snow again

This morning there was snow again. Yesterday afternoon it had snowed twice for about twenty minutes. The first time from 13:16 till about 13:40. The second time from 14:24 till about 14:40. Around 14:27, the snow stayed on the ground for a few minutes. Right after it stopped snowing the sun started shining.

This morning there was a layer of 5.5 cm (a little more than two inches) of powder snow on the car. On the ground it was only a very thin layer, not even covering the ground. We have had a blue sky the whole day, so most of the snow disappeared before the end of the day. I wonder if it will start snowing again, as they had predicted.

Actually, I am not so happy with the snow. I washed my car two weeks ago. Now there is salt on it again.


Sunday, February 25, 2001

Noddy

This afternoon,
Li-Xia, gave Andy the toy catalogue she often gives him to look at it. It is a catalogue from a toy shop, which we got last year in the fall when it was distributed from door to door to make the children nag their parents. Andy likes to look through it, and sometimes he torns a page. He was standing against the table, and was pointing at the catalogue saying something that sounded like "Noddy". When we looked more careful, we saw that he was pointing at a very small illustration, about a square inch, of some kind of CD-ROM for children about "Noddy", a program that Andy likes to watch. It surprised me that he had recognized it, as it was only a small picture on a page full of little illustrations. He was very happy about his discovery and continued pointing and saying "Noddy" when we affirmed it. Although he is retarded in some areas, he is definitely not stupid.


Home | January 2001 | March 2001 | Random memories.