28 Jul 2000 drivers   » (Apprentice)

I have the day off of work today, because I switched to a 9x9 schedule (work 9 hours for nine days, then take every other Friday off). I think it's different than a weekend because then I usually want to just do too many things at once. Today I want to focus on source code.

I got tired of the noises coming from my computer. I've tried everything I could, buying replacements for my power supply and cooling fans but they still suck. Even supposedly quiet fans from pcpowercooling.com... The wall next to my computer desk has a panel for cable TV outlet, so I opened that up on both sides of the wall and passed the keyboard/mouse/speaker/monitor wires through the wall. Now I have peace and quiet, except birds chirping outside which are nice.

Finally, I upgraded the ram in my linux box last night from 32MB to 96MB. Now I can run Netscape under GNOME without it acting like... something really slow.

Hacking

ESR says in "how to become a hacker" (I just finished reading his Cathedral and the Bazarre book) that you can't really learn to program from books, you have to read other peoples' code (and write your own of course). So I decided to start simple. How do the FSF and BSD projects compare in terms of they implement the very useful utility true(1)? BSD's version was something like:

int main(void) { exit(0); }

plus some optional strings for version control and copyright statements to show up if you run strings(1) against it.

The FSF version was about 10 times as complex. It implemented a --help function to print a help screen where --version was the only other option. It called several other functions related to locales, checking if POSIXLY_CORRECT was set in the environment, the return value was a #defined value instead of 0... tabs were two spaces... strings were passed to a function named "_" (underscore). Very idiomatic, I guess, is the word for it.

Oddly enough, running "true --help" on my Linux-Mandrake box does not produce any output, but I can see the help text running "strings /bin/true". Did Mandrake change their version of true(1), or is something more bizarre going on? (POSIXLY_CORRECT is not set in my environment so...) These are very important questions to discover! :)

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!