» twittering
I am twittering. Why? I'm not exactly sure myself. I guess it would be more fun if I text'd bits from my mobile phone.
posted by Nate @ 10:17 PM [ 1 January A.D. 2009 ]
» mimeparse in lisp
Since everybody else is implementing mimeparse in their favorite programming language, I thought it would be appropriate to have a Common Lisp version of mimeparse. I'm not completely happy with it and it's certainly not anywhere near ready for production use, but maybe other people can have some fun with it. Only tested in SBCL, but should be portable enough.
posted by Nate @ 10:40 PM [ 30 December A.D. 2008 ]
» books finished in 2008
What books did I finish in 2008? Roughly in chronological order:
- In Defense of Food by Michael Pollan
- The Call by Os Guiness
- A High View of Scripture? by Craig D. Allert
- The Discipline of Grace by Jerry Bridges
- The Prison Letters by N.T. Wright
- Inspiration and Incarnation by Peter Enns
- Knowing Jesus Through the Old Testament by Christopher J.H. Wright
- Keep In Step With the Spirit by J.I. Packer
- The Name of the Rose by Umberto Eco
- Persuasion by Jane Austen
- Citadel of the Autarch by Gene Wolfe
- The Good of Affluence by John Schneider
- Faith and Wealth by Justo L. Gonzalez
- The Freedom of Simplicity by Richard Foster
- The Fifth Discipline by Peter M. Senge
- Good to Great by Jim Collins
- The Brothers Karamazov by Fyodor Dosteovsky
- Bill and Dave by Michael S. Malone
- A Tale of Two Cities by Charles Dickens
- The Last Lecture by Randy Pausch
- Made to Stick by Chip and Dan Heath
- Amusing Ourselves to Death by Neil Postman
- Mediated by Thomas de Zengotita
- Creating by Robert Fritz
- The Politics of Jesus by John Howard Yoder
- Two Little Girls by Theresa Reid
- The Creative Habit by Twyla Tharp
- Flow by Mikaly Csikzentmitalyi
- Your God is Too Safe by Mark Buchanan
- The Path of Least Resistance by Robert Fritz
- Buying In by Rob Walker
- In Praise of Slow by Carl Honore
- Double Fold: Libraries and the Assault on Paper by Nicholson Baker
- Creation Regained by Albert Wolters
- 1602 by Neil Gaiman and Andy Kubert
- Built to Last by Jerry Porras and Jim Collins
- Words that Work by Frank Luntz
- A Landscape with Dragons by Michael D. O'Brien
- The Return of History and the End of Dreams by Robert Kagan
- Jackson Pollock: An American saga by Steven Naifeh and Gregory White Smith
- Halting State by Charles Stross
- An Introduction to General Systems Thinking by Gerald M. Weinberg
- Natural Ordermaster by L.E. Modesitt, Jr.
Which ones particularly stood out? For pure fun, 1602 definitely took the cake; reading about the X-Men as they might have been in Elizabethean England was quite amusing. For the must-continue-reading factor, The Name of the Rose, A Tale of Two Cities, The Brothers Karamazov, and Halting State towered above the rest.
In the I-can't-believe-they-did-this category, we have Double Fold: Libraries and the Assault on Paper. Librarians are hardly the passive custodians of knowledge you think they are. It also offers a pretty good apologia for why using technology is hard and why using open formats is a no-brainer.
I've started to think more about how I can grow as a programmer, which is why I read Creating, The Path of Least Resistance, and The Creative Habit--all books about becoming more effective at creating things. I think Robert Fritz's books offer the best argument for why test-driven development works, even though he doesn't mention a single bit about computer programming.
I think differently about my faith after reading Inspiration and Incarnation and Your God is Too Safe. I was apparently a bit late to the I&I party (Dr. Enns left Westminster shortly after I read the book); I can certainly see why he took some flak for what he wrote, but I don't think he deserved to lose his position over it.
While I enjoyed The Fifth Discipline and Citadel of the Autarch, I need to read both of them again. The former because the ideas in it are simply that big and the latter because I keep reading raves about Gene Wolfe. I enjoy his books, but I don't see him as the towering figure described by the blurbs on his books and the reviews I've read in other places. Along similar lines, I didn't understand why An Introduction to General Systems Thinking received such a glowing review from the person who recommended it to me (my father)...so I have to go back and re-read it. I suppose The Politics of Jesus falls into the same category.
I enjoyed The Return of History and the End of Dreams for a readable, concise summary of modern geopolitics. Seriously, at ~100 pages, I read it in an evening; it's the sort of book of which Thad would approve.
Buying In came with a plethora of positive press, but I wasn't impressed. Jackson Pollock: An American saga was a long, depressing story that only sort of answered the question that I was reading it for. I had read somewhere that Pollock had laboriously prepared his paintings by calculating out arcs and colors and such; this claim is clearly bogus. The book suggests that Pollock traced images in 3-D and his drip paintings are merely 2-D representations...I am inclined to believe this, but I don't think there was any sort of meticulous planning process that went into his paintings.
posted by Nate @ 10:16 PM [ 30 December A.D. 2008 ]
» clz ctz trickery
This implementation of count leading/trailing zeroes (shown to me by one of my coworkers) definitely goes in the Nifty Hack category for today. I have to reproduce it here, just for my own archival abilities. Credit to Vadim Borshchev:
/* Count leading zeros */
static const unsigned clz_magic = 0x7dcd629;
static const char clz_table[] = {
0, 31, 9, 30, 3, 8, 18, 29,
2, 5, 7, 14, 12, 17, 22, 28,
1, 10, 4, 19, 6, 15, 13, 23,
11, 20, 16, 24, 21, 25, 26, 27
};
unsigned clz (unsigned x) {
x |= (x >> 1);
x |= (x >> 2);
x |= (x >> 4);
x |= (x >> 8);
x |= (x >> 16);
return x ? clz_table[((clz_magic * x) + clz_magic) >> 27] : 32;
}
/* Count trailing zeros */
static const unsigned ctz_magic = 0xfb9ac52;
static const char ctz_table[] = {
31, 0, 22, 1, 28, 23, 13, 2,
29, 26, 24, 17, 19, 14, 9, 3,
30, 21, 27, 12, 25, 16, 18, 8,
20, 11, 15, 7, 10, 6, 5, 4
};
unsigned ctz (unsigned x) {
return (x &= -x) ? ctz_table[(x * ctz_magic) >> 27] : 32;
}posted by Nate @ 3:25 PM [ 19 December A.D. 2008 ]
» emacs font idiocy
I upgraded to Ubuntu 8.10 and one of the joys that came with that is a new shiny hemorrhaging-edge Emacs. Apparently, somewhere between the last such version I was using (whatever came with Ubuntu 8.04 or so) and this one, fonts were radically overhauled in Emacs internals. I wouldn't mind this so much except that the Emacs developers apparently assumed that everybody has sailed boldly into the brave new world of whatever horrendous TrueType fonts can be found on your typical Linux system.
Not I, for I am a curmudgeonly geek, and use ProFont, a ISO8859-only bitmap font which comes in a restricted range of sizes. I restarted Emacs after installing the new packages (I only did this after getting weird errors about bytecode files, which I assume to be related to the fact that said bytecode files had been removed by the package manager during the course of the upgrade. I suppose it would be too much to ask that upgrades of currently running programs imply that said programs continue to work flawlessy after the upgrade. What is this, Windows?) and was greeted by errors about bad fonts that ended in “fontset-startup”.
Such an error message was greek to me, since I didn't actually ask Emacs to use such fonts and indeed such fonts didn't exist in the X font database. Of course, in this day and age, Google knows all, so I searched and found several bugreports related to my symptoms, several obscure mailing list posts from earlier this decade arguing about obscure technical details about multibyte font support in Emacs, and other miscellaneous bits. Google failed me. It attempted to redeem itself by gesturing at the fontsets node in the Emacs manual. I dare you to actually find useful information in that page or the other pages it relates to, such as the defining fontsets page following.
I attempted to comment out all relevant definitions of ProFont in my emacs startup files (note to self: Emacs now starts like a rusted Model A Ford if you don't byte-compile files), but Emacs was still mysteriously attempting to use this "-*-profont-*mumble*mumble*-fontset-startup" monstrosity even so. (No, I don't have anything defined in X resources! Sit down there, you in the back!)
Really, this whole thing needn't have been a big deal: Emacs was still perfectly usable except for one minor detail: creating new windows, whoops, sorry, frames was totally broken, as Emacs was apparently dependent on this fontset that it couldn't find for creating new frames. Why? You created an initial frame just fine despite these problems, why can't you create another one just like it? Have we heard of fallback code?
Anyway, after becoming slightly more desperate and starting to click though most every Google search result, instead of the ones that appeared relevant, I found this post, ostentatiously about turning off anti-aliasing on Emacs on OS X. So, for the record, if you are having problems with ProFont or any other old-style X font under Emacs and the mysterious "fontset-startup", you want to add something similar to the following to your init files (possibly before you define your faces and such):
(create-fontset-from-fontset-spec "-*-profont-medium-r-normal--12-*-*-*-*-*-fontset-startup, ascii:-nil-profont-medium-r-normal--12-120-72-72-c-60-iso8859-1, latin-iso8859-1:-nil-profont-medium-r-normal--12-120-72-72-c-60-iso8859-1" nil "profont")
So you apparently need a mapping to X fonts per character set, or something. Which makes sense, I suppose, but I would have been nice to spell that out a bit more explicitly somewhere. (Yes, I know that create-fontset-from-fontset-spec is documented on one of the aforementioned Emacs manual pages, and it almost looks like I might have been able to puzzle out what to do from the description. But this is a rant, I should have been in bed an hour ago, and it's my blog anyway, so go away.)
posted by Nate @ 11:54 PM [ 17 December A.D. 2008 ]
» apple product cycle
The Apple Product Cycle is pure win. Samples:
The haters offer their assessment. The forums are ablaze with vitriolic rage. Haters pan the device for being less powerful than a Cray X1 while zealots counter that it is both smaller and lighter than a Buick Regal. The virtual slap-fight goes on and on, until obscure technical nuances like, “Will it play multiplexed Ogg Vorbis streams?” become matters of life and death.
The editors of popular Mac magazines hail the new device as the next great step toward our utopian digital future. Wired News runs exclusive interviews with the Apple design team. Fortune publishes another glowing fluff piece about Steve Jobs, proclaiming him to be the great visionary behind all technological innovation. Newsweek declares the device the new “must have” item for any self-respecting urban technophile. All of this is written before anybody outside of Cupertino has held the new device in his or her hand.
posted by Nate @ 1:16 PM [ 16 December A.D. 2008 ]
» horrible dream
I “retired” from playing World of Warcraft about two months ago. I did this mostly to free up time for reading and to make family life less stressful. Plus I had promised Tricia I would do so if I could consistently raid with the guild until the next expansion pack. (For you WoW-weenies out there, we cleared T5, Hyjal up to Archimonde, and BT up to Bloodboil.) My account has been canceled, but as I understand it, my character(s) remain sitting in archival storage somewhere, ready to be summoned to duty should I ever start playing again.
Two nights ago, I had this awful dream that my character, Poggrid, had somehow been deleted. There was a new Poggrid on my server, a level 18 dwarf (I don't remember his class). He had no idea how to play his class, no sense of style or decency. It was an affront to my character and I frantically scrambled in vain to fix this travesty.
I related this dream to Tricia. Her only comment was, “When you said `I had an awful dream...' I thought it was going to be something important, like your family was in danger.”
posted by Nate @ 10:00 AM [ 8 December A.D. 2008 ]
» doing something wrong
I've read Getting Things Done by David Allen. I've followed 43folders for quite a while. I use org-mode for a made-to-order GTD system. But its usefulness varies from day to day, depending on what sort of programming bits I have to do.
My impression from the literature is that one is supposed to break tasks down into molecule-sized pieces--physical next actions that can easily be accomplished in two minutes or so. What are good next actions for programming? “Investigate issue 782” is not a particularly good one: it doesn't provide you with any idea of what you're supposed to do next and it's not particularly small. All the alternatives are no better, though. “Debug”? “Fix”? “Triage”?
And even if, say, “triage,” is the right action verb to use, there's no way of telling how long this action is going to take. Triaging a bug could take less than two minutes once you get the debugger fired up...or it could be a tarpit that you get sucked into for the better part of the day. If it's the latter, I get thrown out of the GTD routine because I've been wading through C code and have ignored the next action list. Have other programmers made this work for them? Am I missing something important here, or do I just need to maintain focus on the next action list when I get done with something?
On a related note, I see a lot of importance attached to keyboards for programmers. To hear some programmers/computer users talk, they do nothing but type on their keyboards for twelve hours straight, day in and day out. I must bang out significantly less code than some people--I find most of my time is spent thinking about what to do, rather than bashing on my keyboard. Granted, I too often look for the perfect, elegant solution when there's not one to be found, and I sometimes spend way too long convincing myself I understand where all the pitfalls are before jumping in.
But even if I eliminated those personal speed bumps, I don't think I'd be pounding on my keyboard constantly enough for it to matter too much. I type on my laptop keyboard, I type on the Happy Hacking Keyboard Lite 2 I bought a couple of months ago, I type on my dad's Natural Keyboard Pro (one of the old school white ones, not the ugly black ones they sell nowadays), I type on the old IBM keyboard Tricia got with her computer from college (!). It doesn't make a lot of difference, unless I'm having one of my “constantly-flip-around windows while attempting to debug several different things and code several different features” days, and those are few and far between.
I'm not constantly whaling away on my keyboard throughout the day. Am I doing something wrong? Does that make me a bad programmer?
posted by Nate @ 11:06 PM [ 3 December A.D. 2008 ]
» root foundations
Tricia and I watched an episode of Extreme Living this past week which featured a house that was built sitting on an extremely steep hill. And so the engineering requirements were equally extreme--a foundation of nine steel posts driven forty feet into the ground, several times the normal amount of building materials to ensure structural integrity, etc. etc. Fascinating. (The house is reputed to be earthquake-proof despite its precarious positioning.) We also took bets as to how much the house would fetch on the open market today--a pretty penny, no doubt.
The foundation thing in particular got me thinking. I dug up some bushes from our front yard earlier this year that were quite tenacious due to the extensive root system(s) they possesses. Has anybody tried designing foundations modeled after tree roots? Or a machine that laid out foundations in tree root-like manners, but without any explicit pattern beforehand, just letting things grow more-or-less where they will? (Presumably, you'd need a few basic rules on where roots should “grow”...?) Or do we just understand big metal posts driven into the ground too well and the liability for, “Well, sir, it grows this random network of snarled cables beneath the ground,” would be too high, so nobody's tried anything like this?
posted by Nate @ 10:03 PM [ 2 December A.D. 2008 ]
» group singing
The extent of exposure to group singing in modern-day America is limited to watching groups of restaurant employees singing “Happy Birthday.”
posted by Nate @ 5:50 PM [ 30 November A.D. 2008 ]
» not buying a computer
Food for thought: Wendell Berry's Why I Am Not Going to Buy a Computer. Primarily about using the computer for writing, but as he connects his rationale for not buying a computer to a wider sense of what sort of things we should purchase, interesting from a conservationist standpoint as well.
posted by Nate @ 8:23 PM [ 28 November A.D. 2008 ]
» the sacrifice of isaac
The sacrifice of Isaac was the seminal moment that inaugurated, and the image that represents, the rise of the Western world. It was a radical break with the perceptions of the old age of cultic paganism. When God led Abraham up the mountain of Moriah, he was building upon a well-established cultural pattern. Countless men were going up to the high places all around him and were carrying out their intentions to sacrifice their children. But God led Abraham by another way, through the narrow corridors of his thinking, his presumptions about the nature of reality. This was not a typical pagan, greedy for power, for more sons, or for bigger flocks. This was an old man who by his act of obedience would lose everything. He obeyed. An angel stayed his hand, and a new world began. From then on, step by step, God detached him from his old ways of thinking and led him and recreated him, mind and soul. And thus, by losing everything, he gained all. God promised it. Abraham believed it. Upon this hinges everything that followed.
--Michael D. O'Brien, A Landscape with Dragons
Why don't more pastors and more books explain things this way? I first read something like this a year or so ago on a pyschologist's blog, who wanted to explain things in terms of cultic beliefs about hearing the voice of God. He had some compelling arguments, but I was a bit skeptical about the psychological bits. The above paragraph is the same sort of interpretation, but set in a historical framework that makes a good deal more sense. Am I just reading and listening to the wrong things, that I have to wait until now to hear something like this?
posted by Nate @ 10:58 PM [ 21 November A.D. 2008 ]
» life extension
Dear God,
Please keep Donald E. Knuth alive until he finishes his The Art of Computer Programming series. Thanks.
(I have been reading through bits and pieces of the first one--I borrowed it from the library--and find it quite enjoyable. The chapter on compilers is the last one! How cruel is that?)
posted by Nate @ 10:56 PM [ 16 November A.D. 2008 ]
» socks
When family members asked me what they could get me for Christmas this year, I said, “socks.” I feel so old.
posted by Nate @ 10:56 PM [ 13 November A.D. 2008 ]
» writer analogy
Seen in a blog comment: “Ayn Rand is to political philosophy what L. Ron Hubbard is to religion. That applies to both groups of followers as well.” If I had been drinking something at the time, my monitor would have been covered with said beverage.
posted by Nate @ 4:26 PM [ 10 November A.D. 2008 ]