On Sunday evening, Orna, my mother, my little sister and myself went to hear the Haifa Symphony Orchestra perform Beethoven’s 9th Symphony. I was under the impression that it will be a short concert, composed solely of the 9th, which was a blessing as both Orna and I were after long days at work. As it turns out that there were two other compositions on the menu. The concert started with Yosef Tal’s 1st Symphony, which Orna enjoyed, but I found rather simplistic (“plink”, said the violins, over and over again), and Brahm’s Raphsody for Alt, which we both found rather soothing, to the point of falling asleep. By the time the (long!) break finished and the orchestra started playing the 9th, Orna and I were both ready to fall asleep in our seats. The 9th was great, as usual, and I managed to wake up a little towards the end, but all in all, next time I’m sleeping before a concert!
July 8, 2003
July 7, 2003
birthday fallout
ladypine[0] bought me Neil Stephenson’s Quicksilver[1][2][3] and Greg Eagan’s Diaspora[4].
[0] I *heart* ladypine.
[1] *droool*
[2] Have I mentioned Cryptonomicon is likely my favorite book? well, maybe second to Stephen King’s IT.
[3] not yet published…
[4] I hope it gets here in time for the flight to OLS. .ca is a long way off.
July 5, 2003
python talk at Haifux on Monday
Here’s what I wrote to Haifux, CC’d to linux-il:
Updated slides [for my python talk] are now available at http://www.mulix.org/lectures/python_intro_2/python_intro_2.pdf. LaTeX source available at http://www.mulix.org/lectures/python_intro_2/python_intro_2.tex.
Note that the slides are even less descriptive than my usual non-descriptive style this time. They are composed almost completely of code snippets which illustrate python in its myriad forms, to be discussed and elaborated upon during the talk. For something readable, I recommend the excellent python tutorial at http://www.python.org/doc/current/tut/tut.html, which the slides are based on.
July 3, 2003
Nice birthday present
100 in probability. Now that’s a nice birthday present!
Exam in Automata and Formal Systems in 3.5 hours. If I get half that, I’m lucky 😉
Quotation
Amit Shah just sent me a “happy birthday” email (thanks, Amit!) with this great quotation:
Why do you want to read your code? The machine will. — Sunil Beta
Indeed!
July 2, 2003
Code That Sucks #1
This is the first in a series of snippets that present code that I personally consider an affront to humanity. All code must be from real, live projects. If the code is proprietary in origin, or otherwise confidential, symbol names might be changed to protect the guilty, but it’s ALL REAL. YMMV.
Today’s crime against humanity:
Returning from a within a macro
Witness this innocent chunk of code, from fs/intermezzo/journal.c in a kernel tree near you:
#define BUFF_ALLOC(newbuf, oldbuf) \
PRESTO_ALLOC(newbuf, PAGE_SIZE); \
if ( !newbuf ) { \
if (oldbuf) \
BUFF_FREE(oldbuf); \
return -ENOMEM; \
}
Do I really need to explain why returning from a macro is a bad, bad, bad, god awful idea? consider:
void foo(void)
{
void* buf1, buf2, buf3;
BUFF_ALLOC(buf1, NULL);
BUFF_ALLOC(buf2, buf1);
BUFF_ALLOC(buf3, buf2); <----- BOOOM. Bye bye buf1 memory if
allocation fails.
}
Resource allocation and deallocation should always be handled with care. Sequence points where resource book keeping is required must be explicit.
Some things should be dead and forgotten
This diary is personal in nature. If that sort of thing unfazes you, skip.
Looking through some old emails, I came upon a diary excerpt I sent someone. That led me to look through my old files, until I found my personal diary, and that led to reading it.
Jesus.
So much angst, so much hurt, so much pain. Which should come as no surprise when I remind myself that I wrote only when I felt bad, but is still incredibly unnerving to read now. Time has a tendency to soften the memory, to sharpen one’s memory of the good times and obscure the bad ones. The diary bought those bad time, some of them spectacularly bad, under harsh 100 watt interrogation lights in all of their ugliness.
Oh, and … so many women, too. What the fuck (pun intended) was I thinking? thank god that’s all over now.
I would publish the entire diary here as a way of offsetting its bad mojo, but I’m ashamed of the god awful writing. Maybe anonymously?
Birthday Boy
Yes, it’s that time of the year again. I have nothing to say on the occasion, except, maybe, if you must.
Mel Gorman’s VM book
Earlier this week, I got this nice email from Mel Gorman, author of the
excellent Linux Kernel VM documentation. Mel wrote:
“I’ve been offered a contract to write a book on the Linux VM with Prentice Hall based on the material I’ve made available to date at http://www.csn.ul.ie/~mel/projects/vm/ …
If you’re reading this, you are in the acknowledgments section for helping me out at some stage at the other getting the 2.4 docs together …”
The book is going to come out as part of Bruce Peren’s Open Series, but you should all go out and buy it, of course. I know I will. And after you buy it, make sure to highlight my name in the acknowledgments section 🙂
For those curious, here’s the email I sent Mel that will get me mentioned in the book:
First one:
Date: Sun, 12 Jan 2003 19:29:43 +0200
From: Muli Ben-Yehuda
User-Agent: Mutt/1.4i
To: Mel Gorman
Subject: typo in vmalloc document
Hi Mel,
In http://www.csn.ul.ie/~mel/projects/vm/docs/vmalloc.html, section
1.1, you wrote:
if (vmalloc_area_pages(VMALLOC_VMADDR(addr), size, gfp_mask, prot)) {
vfree(addr);
return NULL;
}
vmalloc_area_pages sets up the PGD, PMD and PTE entries to give out
the linear addresses needed. If it fails half way through, 0 is
returned so that vfree can be called to get rid of the PGD, PMD and
PTE entries that have been assigned.
END QUOTE
the '0 is returned' bit is wrong - it should be '-ERRNO is returned',
or at least, 'a non zero value is returned'.
--
Muli Ben-Yehuda
my opinions may seem crazy. But they all make sense. Insane sense, but
sense nontheless. -- Shlomi Fish on #offtopic.
And:
Date: Wed, 2 Apr 2003 14:30:55 +0300 From: Muli Ben-Yehuda User-Agent: Mutt/1.5.4i To: Mel Gorman Subject: bug(?) in VM documentation Apr 1st copy, page 39, section 4.4 "... mk_pte() takes a physical page... mk_pte_phys() treats the address as a physical page ..." Looking at the code, I mk_pte appears to take a struct page, not a physical page (which I parse as a physical page address). Thanks, Muli. -- Muli Ben-Yehuda http://www.mulix.org
Who woulda thunk? 🙂
August Penguins 2003
Earlier this week, the official announcement of August Penguins 2003 finally went out. I’m really excited about Aug. Peng., looking forward to the MOSIX lecture and moshez‘s Python Internals lecture, and the geek trivia. Looking forward to seeing you all there!
