blog.rupamsunyata.org

Decklin’s excuse for some blogging software. Est. 2006.

I suppose I could go read the docs again, but fuck that shit.

dpatch-edit-patch: doesn't work.

quilt refresh: works.

Mikey likes it!

kthxbye

Brown paper bag bugs cause you to scramble to get a fixed version out as soon as possible, which causes more bugs and that causes more grief, which causes you to screw up the upload. I suck. Maybe we should discourage being your own upstream.

I have a line in my ~/devel/TODO under aewm that says “UPDATE THE FUCKING VERSION NUMBER IN aewm.h YOU DOLT”. Will I remember to read it? Who knows?

I just installed Bitlbee and added 14 lines to said file for that, but the one line for ghosd has priority.

<decklin> but that will actually be FUN unlike hacking gaim which is AWFUL

Yeah, that’s why, mainly. I think I just need to be more professional.

Actually, this code *was* written in 1995

Buffer overflows, man. I'm fixing fucking buffer overflows. Gag me with a spoon.

Koan

Whoo

So I’ve gotten the roux rewrite running, finally. Not doing anything useful, but running. I can’t believe I was using a pull parser and generating the Atom 0.3 by hand(!) before. Ugh. Totally, completely, hideously embarrassing.

Anyway last time I got distracted on the way to making it useful and just said “screw this, I’ll put some regular expression crap in” and it’s been hobbling along on that (basically no better than the million other screen-scrapers out there). But. I had a brainwave about how to implement what I was really looking for (the “civilized” bit), which works on simple cases at this point; I just need to think about making it extendible. Should be fun.

Enabling domain-specific languages seems to be a theme with all this recent stuff. I don’t know why.

I got lost

You know it’s bad when writing several screenfuls of recursive fuzzy tree matcher in Python is fun and doing a tiny bit of tree and Makefile maintenance on a C project so you can push out fixes from last year is a chore you’ve been putting off for weeks.

Constants of the universe

One of the few annoying things about free software is simply finding it. You can get a very good idea of what is to your taste or not from people around you, but if you don't know or care (or want to care!) about some particular problem, generally people whose opinions you trust don’t like any of this crack either.

In particular, Web Frameworks(tm). Lots of people love them. I’ll take vanilla. After paging through several manuals last weekend for things which I might be able to use a templater from, and finding that despite all the other features, no one seemed to even care that much about even doing inheritance sanely, I got annoyed and grumbled something about how they all sucked and figured I could just factor that logic out myself and use what I was already using for the boring bit.

However, Erich pointed out that that sucked too. And if you care about being correct (says me who serves all these pages with the XHTML mime type despite it breaking Internet Explorer and Google), you should probably assume that if you give your users (including yourself!) something fragile, they’re inevitably going to break it (and if they’re the sort of users that have been crawling out of the woodwork these days, well...). So I checked out Kid, to which I am giving yet another link here because it’s just that good. I’ve seen attempts to implement the “it’s all valid XHTML” thing before and they were rather blah. This one seems to actually fit with its being hosted on lesscode.org. And I am nothing if not a sucker for less code. And for things being pleasant to read.

So I ported my templates over and added the four lines I alluded to, and now (since I know my output is provably valid), although I have not put them live yet, I have a starting point for making them be a little less crack (really, it’s very bad). Has anyone registered lesscrack.org yet?

XML

OMG! I just remembered I own a copy of the elephant shrew book!

...Somewhere.

I would have had no idea that’s what those were if not for this page. (This is a blog, I have to make a link somewhere. Read the articles; they made me smile at least.)

Entry love

Evan thinks about the nature of the commons.

svn status

(16:57:39) Decklin: I'M NOT READY TO COMMIT

Mnemosyne speed tests

I decided to grab a large Maildir from my actual email and run it through Mnemosyne for shits and giggles. For 1184 messages: 1:49 to build from scratch, 0:14 to verify that nothing has been touched. No tags, just archives. (This wouldn't be a half-bad way to archive a mailing list, really...)

This is with reST off, though, because docutils likes to die “SEVERE”-ly if you just throw random garbage at it. However, the published result is cached (during each run), so that will only grow linearly.

In the common use case... this entry will hit nine pages (three of which are tags), and assuming stuff is actually filled up, index will cache everything that day and permalink need, year/month/tagindex don't use content at all, and the only really expensive thing will be republishing every old entry for each tag that it hits. I can live with that. And for all the recursion overhead, optimizing how much of the Maildir we really need to care about shouldn’t be very hard.

I just need some actual users to bitch at me about other stuff.

Hate

I truly, truly hate email. First you have the __getitem__ and __setitem__ that work nothing like a dict (no KeyError ever, just returns None, despite there being a get, silently fails to overwrite an existing value, no update). But of course they're just as stupid as a dict if you change the content, instead of associating the type with that object. And then. decode_header. Does this:

[('Foo', 'utf-8'), ('Bar', None)]

Hint: ('Bar', None) is not a valid list of arguments for creating a unicode object. I don’t even want to create it myself. I just want the thing decoded. Ugh, ugh, ugh. Everything that possibly could have sucked here has sucked. Lots.

One of the reasons I decided to use Maildir is because it takes two lines of code to turn it into a structured list of objects. Except of course both of the standard modules that make that possible are horribly designed. I really don’t want to reimplement this shit. I really don’t want to go to a “real” database backend where suddenly you can't use any standard unix tools to do anything and you have to write them all from scratch.

All software sucks. Down, not across.

Mnemosyne stats

Since this blog thing is kind of functional, let’s see how much fat I’ve been able to avoid. Lines of non comments/blanks/continued-docstrings:

Code: 204 modules + 21 command = 225
Blog: 6 conf + 60 layout + 142 style = 208

433. Eh. I can do better. It’s still ugly. Hopefully getting it clean enough to not be embarrasing can involve removing some more code, and not adding too much. DRY. That’s the principle here.

There are more examples to add, of course. A good procmail recipe definitely. And my blog is slightly more complex than the example.

Update at the end of the next day-ish: 445. Lots of ugliness replaced. Wrote 120 more lines of README. Not bad.

Habits

So I’ve been good about putting new projects into version control. What I’ve been bad about is not putting new projects into version control until they actually run and I'm no longer tearing them up from top to bottom every time I add something. Like all milestones, the definition of “run” just keeps getting pushed further back the harder you look at it.

Crackpot idea

I’m big on code being clear and succint and self-documenting, so I like to put some thought into variable and function names. It’s a bit like writing prose. You might think of one word initially, but it’s not the “right” word, so you refer to a dictionary, a thesaurus, or another piece of writing.

In programming, there are not very good resources for this. Most reference texts intentionally have simplified examples because they’re trying to provide information about a language or library and not the expressitivity of the contrived problem at hand. Existing real-world code generally sucks.

Generally, I don’t want to explain the how, I want to explain the what and why. What I wish existed is something like a thesaurus of abstractions and design patterns—not someone’s idea of what they should be, but a wiki where everyone could share what sort of complex thing they were trying to make obvious and what solutions they considered, rejected, or were satisfied with.

There’s quite a bit in the original WikiWikiWeb about this, but that wiki’s scope is much larger so most of the enlightenment you can get from it is in other areas.

Generated by Mnemosyne 0.9.