2010-05-01
The end
I'm closing this blog until further, since I do not have much time to invest in writing coherent, meaningful posts. Longer, in-depth texts will from now on appear on my homepage at zvrba.net Commenting is disabled since a lot of spam has lately appeared.
2009-11-29
Finally!
On thursday, 2009-11-26, I have finally defended my PhD! I'll be starting on the new job on tuesday...
2009-11-12
Unpredictability of execution times
2009-10-17
A tricky bug
Today I debugged a piece of code that looked like this:
It turned out that
printf("foobar\n");
if(fork() == 0)
exit(0);
When the program is run from the terminal, the output is as expected: a single line containing "foobar". However, when the output is sent to a pipe or redirected to a file, two lines appear in the output. (Actually, the problem was a bit more complicated: there were n fork()
calls and there were exactly n
additional copies of the output). After a bit of digging around and not finding any obvious fault, I asked about it on IRC.It turned out that
stdout
is fully buffered when it is attached to a pipe or a file. What happened is that fork()
duplicated also the internal I/O buffers, which got flushed after the child process exited, thus producing extra output. I solved the problem by inserting a fflush(NULL);
statement before forking, which flushes buffers of all output streams.
2009-09-03
Foxit PDF reader -- no go
Today I tested the Foxit PDF reader, version 3.1, since many people recommend it as a faster and lighter-weight alternative to Acrobat Reader. Well, its performance is disappointing: opening a 3MB PDF with Foxit takes 2-3 seconds before the first page is displayed. Opening the same PDF with Acrobat Reader (version 9.1) displays the document with no delay at all. I attempted to open few other PDFs with Foxit, with the same result: annoying pause before I could view the document, but with Acrobat Reader showing the document immediately.
So long Foxit, Acrobat Reader is still my favorite PDF reader.
So long Foxit, Acrobat Reader is still my favorite PDF reader.
Subscribe to:
Posts (Atom)