Here are some funny signatures I've had over the years:Hacking is to software engineering as climbing Mt. Everest is to building a Denny's there. GNU's not UNIX. Emacs is most definitely not UNIX! Perl: fork while fork
If you are a strong believer in statically typed languages, you won't want to read this post!
Sometimes it makes sense for a function to return multiple things. In such cases, it's common to just return them in a tuple: "return (count, new_obj)".
Sometimes you might want to return objects of different types based on whether an operation succeeded or not. For instance, if the operation was successful, you might return "(True, obj)". If it failed, you might return "(False, reason)". Often, you can use exceptions to handle this situation.
Sometimes you might want to return objects of different types based on arguments to the function. For instance, did the caller ask for the data in this format or that format?
Sometimes you'll want all of these variations at the same time. In such cases, I have found that using a dict for your return value is a good solution. For instance, here is a piece of a docstring that I wrote yesterday: Return a dic…
I've been reading Dreaming in Code lately, and I really like it. If you're not a dreamer, you may safely skip the rest of this post ;)
In Chapter 10, "Engineers and Artists", Alan Kay, John Backus, and Jaron Lanier really got me thinking. I've also been thinking a lot about Minix 3, Erlang, and the original Lisp machine. The ideas are beginning to synthesize into something cohesive--more than just the sum of their parts.
Now, I'm sure that many of these ideas have already been envisioned within Tunes.org, LLVM, Microsoft's Singularity project, or in some other place that I haven't managed to discover or fully read, but I'm going to blog them anyway.
Rather than wax philosophical, let me just dump out some ideas:Start with Minix 3. It's a new microkernel, and it's meant for real use, unlike the original Minix. "This new OS is extremely small, with the part that runs in kernel mode under 4000 lines of executable code." I bet it&…
I upgraded my video card driver once again using the directions here (using the most modern driver), and Second Life stopped sucking! That makes me happy.
I was so bummed about my Second Life experience, I had contemplated getting a Mac. Unfortunately, the Macbook (non-pro) doesn't work with Second Life, and the Macbook Pro is like a grand more--i.e. way more than my wife would ever let me spend.
Anyway, I'm happy.
(Dell Inspiron 6400, Ubuntu 6.10, ATI Mobility Radeon X1300)
I'm sure everyone who codes in Erlang has already seen this, but it was new to me. It's a dead-serious, educational video on Erlang. It's very well done and quite interesting, but I found it totally hilarious in a Monty Python sort of way:
I have a Dell Inspiron 6400 running Ubuntu 6.10. I know there are two different displays for this laptop. At least for me, running "xgamma -gamma 0.7" brings great joy :) To make the change permanent, I added "Gamma 0.7" to the "Monitor" section of "/etc/X11/xorg.conf".
Finally, I can enjoy a nice blue background without becoming subconsciously irritated.