Thursday, August 31, 2006

Linux: On-the-fly BASH Aliases with Cntl-R

If you use BASH, I hope you make use of Cntl-R to search for commands you've already executed. Even though I know about and use Cntl-R, even I underuse it. For instance, you can use Cntl-R to create on-the-fly, short-lived aliases. Start with:
cd /some/long/path # cdlongpath
Then later:
<Cntl-R>cdlongpath
It will autocomplete to your earlier command. If you happen to forget an alias, no big deal :)

Wednesday, August 30, 2006

IETF: RFC 4193

At long last, an Internet draft I contributed to has become RFC 4193, and I am acknowledged in it :-D

Thursday, August 24, 2006

Python: Limitations of Coroutines via Enhanced Generators

I've been thinking a lot about tricks such as the coroutine system in this article. PEP 342 improves the situation for Python 2.5. In fact, Example 3 in the PEP is exactly what was on my mind. I came to the same conclusion as the PEP:
In effect, this example emulates simple tasklets as are used in Stackless Python, as long as you use a yield expression to invoke routines that would otherwise "block".
However, what happens if you can't use a yield expression to invoke routines that would otherwise block?

For instance, say coro() is a coroutine that calls third_party_1() that calls third_party_2() that calls blocker() where blocker() blocks. If third_party_1() and third_party_2() are intermediary functions that exist in third-party code, they won't know how to "do the right" thing using yield. If third_party_1() and third_party_2() don't do the right thing with yield, there's no way for blocker() to yield back to the scheduler.

Ideally, I'd like for coro() to be a coroutine that blocks within blocker(), leaving third_party_1() and third_party_2() ignorant of the whole process. If you know how, please tell me!

Monday, August 21, 2006

Python: Stunning News: Django isn't Perfect!

Concerning http://www.cmlenz.net/blog/2006/08/the_python_web_.html:

Although I have a ton of respect for what the Django guys have accomplished (I really do!), I couldn't agree more with this post based on my own experience and the experience of many of my co-workers.

By the way, when he mentions, "There was a comment by someone in the audience at the Google TechTalk on Django along the lines of...or scale down to teams where the programmers are also those who write the templates," that was me! :)

It's not that our team wasn't large enough for separate template authors. Quite the opposite; we had 169,000 lines of code. It's that I generally don't trust template authors because I fear they write redundant code. Compared to Cheetah or Myghty, Django makes it hard to write quick little template functions that take keyword arguments, thus I suspect that a lot of people put up with redundant templates because, after all, (tongue in cheek) it's HTML, not code, riiight???

Thursday, August 17, 2006

Linux: Ubuntu 6.06 on Dell Inspiron B130

Pretty much everything "just works", including hibernation and sound.

To get my resolution up to 1280x800, I had to install the 915resolution package from the Universe repository as mentioned here.

I bought a mini PCI wireless card from newegg, and it just worked out of the box.

I'm happy :)

Thursday, August 03, 2006

Haskell: Translating C to English Using Haskell

I've written a two-part series for "Linux Journal" called "Translating C to English Using Haskell". Here are links to the two parts:

http://www.linuxjournal.com/article/9096
http://www.linuxjournal.com/article/9242

The catchline is:

Write a program in Haskell that translates C type declarations into English. Manually translate the Haskell into English.

I've tried very hard to make it an entertaining article for Haskell newbies, so if your head exploded when you tried to read "A Gentle Introduction to Haskell", give my article a shot!