766

Knowing that you don’t have to give anything up to love someone is the best feeling in the world. When it’s mutual, it’s simply amazing.

765

I think that part of growing up for me is finding a picture of myself that you really like, and being forced to admit that I am really that pretty. Thank you, vruba.

Anna‘s album “Wake” has the most gorgeous track on it, “Stay”. I am lost in a timeless world at the moment, listening to it.

I love that intensely good and intensely bad experiences can coexist in the same place. It sure beats having things just suck and having no good to be found.

764

It’s snowing now, a shock to my system after the seventy-degree day. My walk from the bus early this morning was chilly but not uncomfortable. On my walk home from work, twelve hours later, it’s cold and miserable, worthy of a week in Boston.

But it’s alright: I have Annie’s, beer, clean clothes, a shower and tea.

763

I’m home safe and sound. I’m tired and a bit cranky. More later.

762

I desparately want a GNOME app that will pop up in less than a second and let me compose and send an email. I want a simple, one-window UI, and I want it to close when I hit send.

I want it to store in my usual IMAP or local sent folder (following Evolution’s configuration would be great).

I’d love to see similar tools for a lot of other tasks, and I’d love to see Logjam have an option to close after submitting a Live Journal post the same way.

761

I had some facial hair removed today by laser. It stung like I’ve heard it does — like a rubberband snap, but not a bad one even for me. In all honesty, it hurts less than a razor does on the same hair. Yay for small victories.

760

So far, so good.

759

I’m also incredibly absent-minded today. I managed to walk into a door, walk into the back of a truck, and have now forgotten my pants. Brillant, Aria.

758

Not that I really feel like it’s my job to save the world, but…

… I wish that sometimes the world would just stay fixed.

757

I’m going to Portland. I’ll be there Monday, leave again maybe Wednesday or Thursday.

Everyone who can, please Write something to Eli★.

Efficiently implementing content-negotiation

The only feature of Apache that I miss using Lighttpd is content negotiation.

In a nutshell, content negotiation takes an abstract resource URL like http://example.org/2005/chart and maps it to the files on the filesystem based on the available files and their mime-types, and the mime-types in the requestor’s Accept: header.

Given that URL, an Accept: header suggesting image/svg+xml; q=1, image/*; q=0.5 and the files /www/example.org/2005/chart.png and /www/example.org/2005/chart.svg, the server would see that there is a image/svg type file, which matches the highest preference, and return that along with a Varies: Accept header.

The efficiency problems come from needing to know the available files and their mime-types. At the most efficient, an expensive scan for available files will happen for one hit, and be cached for subsequent hits. However, cache consistency is a difficult problem, and many of the solutions are as inefficient as no caching at all. Very recent linux kernels support the inotify mechanism which would work to monitor efficiently and keep the cache consistent, but it’s not a generally portable solution.

The simplest implementation would take the URL, and check to see if it’s immediately satisfiable — this is the same efficiency as normal serving, without content-negotiation. If it’s not found, then ir must perform a directory listing (one open call, some read calls). This gets expensive for huge directories. (Directories of over 1000 files, though the expense depends on the type of filesystem). Candidates are selected, mime-types mapped, and selected according to the criteria in the HTTP spec. Unless there are extremely many alternatives or an absurdly large Accept: header, computing this isn’t computationally intensive, on the order of O(m * n).

However, to send Content-Length: headers, at least one stat() call must be made, and to handle dangling symbolic links, a stat() for every file under consideration (though since dangling links are an edge case, this could be implemented as a fallback, not normal operation.).

The biggest issues are the ones dealing with unusually large directories, where a linear scan of the listing can take a long time, and if caching is performed, how to keep cache consistency and still gain from the cache.

Thoughts are always welcome. I’ll probably implement this in Lighttpd at some point.

755

I think true joy is the unshakable feeling that life is wonderful.

754

Miri Ben-Ari knocked my socks off.

753

I would seriously tackle these things about GNOME, given the chance:

  • Add a ‘reveal in file browser’ command to Rhythmbox’s context menu,
  • Make the filename display in Rhythmbox and any program that gets it so horribly wrong into one box rather than two, one for folder and one for name,
  • Make the mouse-during-alt-tab work à la MacOS,
  • Make Epiphany block per-window, not the whole process when a dialog pops up.
  • Make process startup times as low as possible, by delaying initialization as much as possible, and eliminating as much as I can.

752

I need to track down some music by Transglobal Underground.