Search Results: "mak"

22 January 2007

Matt Brown: Open Moko


Taiwanese phone manufacturer FIC, recently announced the timeline for the release of the FIC Neo1973 smart phone. It’s shaping up to be a very cool device. The phone is nice to look at, has a completely open software stack via the OpenMoko project and at US$350 it’s actually relatively cheap! Feature wise the Neo1973 is relatively similar to the iPhone, right down to using a touchscreen for the user interface. It will be interesting to see how many of the people who have been complaining about the restrictive and walled-garden iPhone model migrate over to the OpenMoko platform. The Neo1973 will work with any GSM cellular network in the world (as opposed to only Cingular in the states, and other apple partners elsewhere) and will allow you to run essentially any application that you want on the phone itself. The contrast in approach between Apple and FIC is stark, and I hope that FIC wins out in the end, although it will no doubt be an uphill battle for them to get anywhere near the mindshare that Apple receives. The one feature that really drew my eye to the Neo1973 is the built-in GPS chipset. For a while now I’ve been looking for a device that would allow me to reveal my current location (possibly obfuscated to a certain radius) to selected family and friends. Once the source code is released in a week or two I imagine that it won’t be long before someone (maybe me…) whips up an application to make this possible. Here’s hoping that the phone lives up to the expectations set for it and that I can come up with a suitable excuse to purchase one when they become available in early March! Update: Found a linuxdevices.com post with some good technical detail on the hardware

Evan Prodromou: 1 Pluvi se CCXV

I managed to miss the Igloofest by Piknic lectronik this weekend, which was kind of a bummer since it seemed like it would be such an awesome event. But with a downturn in the temperature -- another -20C day yesterday, with wind chill bringing it down to -28C -- it was just too hard to justify bringing a 1-year-old to an outdoor event. We did manage to do some fun things this weekend, anyways. Saturday was our first day house-hunting. We're planning to buy an apartment or condo in the Plateau Mont-Royal this year, before July 1. July 1 is the traditional Moving Day in Quebec -- the day that every renter in the province either renews their year-long lease or moves to a new apartment. We're going to move out of Renterhood this year altogether, and get into the fun of home ownership. Wish us luck. Anyways, we saw a great place this Saturday, and we plan to do some more house hunting over the next few weeks. We're going to make a decision about whether to stay in our current apartment or not before March 1, when we begin our big road trip down to Austin for South by Southwest. tags:
 

Bruncher This afternoon we had a great bruncher with friends at our (current) apartment. We invited over Jeremy and Lina and their two girls Syvlie and Clea, who arrived at our door like an advertisement for a skiing school. I love talking to the girls -- they're really smart and sweet people. We also had over Maj's friend Emmy and her husband Stef, as well as their daughter Isadora. Emmy is originally from Oaxaca (city), and Stef is German. They moved here a few months ago, and Maj and Amita June met Emmy and Isadora at their playgroup. This was the first time I met Stef; I got to use my German introduction lessons for this week on him. Guten Tag! Ich hei e Evan! Freut Mich! Isadora speaks Spanish with her mother and German with her father. She'll grow up bilingual, but unfortunately not speaking either of the languages of the bilingual city she's living in. My guess is that she'll probably be pretty expert at four languages by the time she's 10 or so. Maj cooked today, and made a really great smoked salmon gratin, white bean vegetable soup, and hors d'oeuvres. I put together a green salad to round it out. We opened up a couple of bottles of crispy vinho verde and had a very nice afternoon time. The kids got along great; Sylvie and Clea are several years older than Amita and Isadora (one day apart!), but they were really gentle and nice with the little ones. tags:

21 January 2007

Steve McIntyre: Why do you work on Debian?

That's a question I've been asked (by myself and others) lots of times over the years I've been involved. Especially over the last few months while I've been wandering around Europe on the BSP and party trail, I've also been asking other people to explain their motivations too. For myself, I must admit that I'm selfish: Obviously, there's also the fun of hacking on a variety of Free software programs. But that's something I could do on my own, or within a multitude of projects out there. But in very few of those would I be able to materially affect how I use my own computers every day. So, my question for the other Debian people: what gets you working on Debian?

Daniel Baumann: Re: Package Maintenance

My last entry is maybe not so well understandable. In a mail between Alberto Gonzalez Iniesta and me, he put it in much better words than I could:
	Date: Sun, 21 Jan 2007 14:05:29 +0100
	From: Alberto Gonzalez Iniesta <agi@inittab.org>
	To: Daniel Baumann <daniel@debian.org>
	Subject: Re: [late]Thanks for your work
	On Sun, Jan 21, 2007 at 01:08:48PM +0100, Daniel Baumann wrote:
	> Hi agi,
	>
	> the orphaning of some packages wasn't ment as a signal to get 'please
	> thank me' or so, nevertheless, thanks for your mail.
	I know it wasn't meant to be that. But I really appreciate the work of
	some DDs, specially those that do their job, mind their businesses AND
	don't make of it a power position. Those hundreds of DDs or the like,
	that simply like this as is, and don't make of it a power struggle or a
	cabal thing. And you are one of them, as others I could name are.
	> I was taking care about 2 to 5 hours every day and nearly all of the
	> weekends to keep my packages in shape. All I got from this is rants
	> withouth any concrete background like 'look at him, he has so much
	> packages, they can't be good. They must be crap, it's impossible for one
	> person'. Also, some people in Debian do have a problem when people do
	> more than they do themself, and they're hating the others for that.
	Yep, that's what I meant. Those that are looking for competition... In
	a free software community. Morons.
	> Now, I'm just tired of that and went down from ~150 to ~100 packages. I
	> think, I did not point that out very clearly.
However, I am not going MIA now. I still care about my packages, but for a smaller number of them (reducing them in a second orphaning round down to ~50 in a few weeks). And don't worry, there will be no more entries about this topic from me. Thanks Alberto and the few others who replied.

Daniel Burrows: How to Breathe, Functionally (part 2)

In a previous post, I pointed out some ways that you can acheive the "compute this, now save it and compute this, ..." style of coding in a functional language such as Haskell without going mad. This is a continuation of that post.

There's one other purely syntactic feature of Haskell that I rather like for readability: Haskell lets you define variables after you use them.


GoToTheNextTrickyBit someVal
where someVal = DoThisAndThisAndThat...


Although it isn't always appropriate to do this, there are times when I find it extremely intuitive to define my variables after they're used. For instance, to take a "practical" example, compare


mailTo customer =
let customerName = getCustomerName customer
customerAddr = getCustomerAddr customer
in
makeMailingTo customerName customerAddr


with


mailTo customer = makeMailingTo customerName customerAddr
where
customerName = getCustomerName customer
customerAddr = getCustomerAddr customer


I don't know about anyone else, but when I read the first definition I mentally go "huh. Why are we extracting the customer name?", then skip down to where the name gets used, and finally re-parse the name in that context. The "where" form lets me write the code in the same order that I would read it, giving the code a natural flow. It's very important, of course, to keep the number of auxiliary definitions small; otherwise you leave too many "open questions" for the reader of your code to carry around as she works her way down to the definitions.

But it isn't all roses at the low syntactic level. IMO, the biggest practical problem with writing Haskell code is the syntactically significant indentation.

Python, of course, also has significant whitespace -- but it works mainly because it's extremely simple. Any line ending in a ":" introduces a new block, and statements within a block have the same amount of indentation. In contrast, Haskell's rule...well, just read that link above. You can write code that has the same meaning under any indentation, but it's not idiomatic to do so -- and worse, since the statement terminators are not obligatory, a missed terminator might work fine, might change the meaning of your code, or might fail to compile in an obscure way.

A side effect of the complicated indentation rules in Haskell is that the Emacs Haskell mode doesn't work very well at indenting my code. It usually chooses an indentation that I don't want, and often one that doesn't even compile. I'm sure Emacs could do better, but I would be willing to live with a little more punctuation if it meant that the code was easier for programming tools to process correctly. Functional coding advocates assert, correctly IMO, that side-effects are problematic because even smart programmers will write more bugs in their presence. I think the same logic should apply to syntax: making the language harder for humans and machines to parse has negative overall effects, even if it is possible with sufficient effort to parse it correctly.

I think that conceptually, Haskell is a great language -- the problems I see with it are issues of syntax, tool support, libraries and speed (laziness has a high price). Oh, and also the fact that, as with most programming languages that are pleasant to use, you can't get a real paying job writing in it unless you have a PhD. :-(

Daniel Burrows: How to Breathe, Functionally (part 1)

David Welton writes that the problem with functional languages is that you don't get to mentally "catch your breath" between computations; piling function invocations on function invocations makes it hard to understand what's actually being calculated. He has an amusing summary of how functional code can become unreadable:


Do this with the result of this with what this produces when given this input that is derived from this function which takes the result of this other thing after calculating the result of something that is derived from the output of a function that ...


Indeed, I've seen functional code like this (much of it written by myself). Here's a particular gem:


f splitPoints = map fst $ tail $ scanl (flip ($) . snd) ([], toSplit) $
map splitAt splitPoints


I wrote this code a year ago, and I don't know what it does! It's hard to read and hard to understand. So, however, is imperative code that says


Add 5 to A, now if B is not zero we jump to where we subtract one from B and if C is less than 3 we add 4 to C otherwise we divide C by 2 and then add it to A, then we ...


The reason both pieces of pseudocode are hard to understand is that they don't use the abstraction features built into the language. Good imperative code uses meaningful variable names, uses the structured-programming primitives the language provides, and abstracts complex operations into functions.

My rule of thumb (which is, heh, not always religiously followed) is that a piece of program structure that does more than about 3-6 things is probably too complicated; it seems like that's about as much local context as I can hold in my head comfortably (and the number is more 3 than 6 these days, if you get my drift). As David puts it,


If you'll bear with a poor comparison, sometimes programming is like a song. You do the tricky section, then you go back to an easier section and catch your breath for a bit.


The problem seems to be that people trained on imperative languages, when they're tossed into the ocean of functional coding, can't find the guideposts and landmarks that would help them impose some structure on the water. Should I put this complicated expression inside a "let", or break it out into another function? When do I use a higher-order function to unify two dissimilar pieces of code? Should I write this code in terms of higher-order library functions or directly? It's easy to wander off down a chain of nested invocations of anonymous higher-order functions, or composed partially applied library functions, just "because you can" and end up forgetting what you were trying to do in the first place.

Luckily, some of the basic rules of keeping your code readable remain more or less the same: assign intermediate results to variables with meaningful names, and abstract complicated operations into separate functions. To tackle David's example:


You get sections with DoThisAndThisAndThatWithTheResultsOfSelectThisFromTableXYZ that you have to slow down to think through.

...

GoToTheNextTrickyBit where ManyThingsHappen.

All in all, you wind up with a sort of ebb and flow that works out pretty well if you're in tune with the code being written, going from intense calculations, to a line or two where you do no more than store things in a variable, take a breather, and prepare for the next important stanza.


The way to "take a breath" in a functional language is generally to assign an intermediate result to a variable, or to extract a complicated operation into a function and give it a meaningful name. One Haskell approximation to David's example is


do DoThis
AndThis
results - SelectThisFromTableXYZ
someVal - AndThat results
GoToTheNextTrickyBit someval


If you're writing pure functional code, you might write


let
results = SelectThisFromTableXYZ
someVal = AndThat results
in
GoToTheNextTrickyBit someVal


Of course, this will become unreadable if you write a huge complicated nested "let" expression in place of "AndThat". For a truly dreadful example of this kind of coding, check out the Gnucash Scheme code that generates the "Cash Flow" report (warning: read this in short bursts, or you WILL go blind). This is exactly analogous to writing too many nested loops and conditionals in imperative code, and the fix is the same: find logically distinct bits of code and extract them into separate functions.

I have a few more thoughts, but this post is getting too long, so I'll inflict them on the world in another post. The rule that short things are easier to understand applies to blog posts as well as code. :-)

20 January 2007

Erich Schubert: The end of the world 2.0 is near.

I'm convinced the Web 2.0 bubble will impact soon. Granted, some will survive, some will struggle - but some will just blow up. Time to sell for these. There are several reasons why I believe this will happen "soon": Many people have been keeping an hungry eye on YouTube, Rapidshare and others. It's just a matter of time until some of these predators goes for the kill. My predictions for the post-web2.0-bubble time:

Eddy Petri&#537;or: HOWTO test PPPoE without having PPPoE (long)

I don't have an ISP which uses PPPoE or more than a laptop on my desk, but still, thanks to free software, I can test PPPoE installations (to some degree).

I have set up with qemu machines a virtual LAN that is made totally in user space via a TCP socket on port 1234. I needed this in order to test the changes I am working on for the ppp-udeb Debian installer module that supports (or should I say, should support) configuration of PPPoE connections.

These are the tools whose authors and maintainers deserve kudos:


This is the tutorial I followed to configure the PPPoE server http://www.freeantennas.com/PPPoE-Server-HOWTO.html, but until then I had to make the network.

In case someone is interested, here's how I did it (these are Debian centric instructions, but I don't see anything that would stop someone to do the same even on a windows machine).
I won't repeat that tutorial, but now I can create a virtual machine (well, I'll use an existing virtual machine) and test my custom D-I images and test the changes done in ppp-udeb.

Rock on!

Evan Prodromou: 30 Niv se CCXV

I just got the Free Your Phone announcement from the OpenMoKo announce list. Looks like they'll have preview versions of the new Linux-based, Open Source phone platform available Feb 11, generally available March 11, and ready for public distribution September 11 (!). FIC is under a lot of pressure to make this product the Open Source answer to the iPhone, and I think they have a very good story. At this point I think the success of the platform is going to depend on three things. First, FIC's execution in getting developer versions out the door and ready to use. If the OpenMoKo platform stays vapourware for much past the first part of 2007, it won't be able to capitalize on the iPhone hype and current excitement. Second, FIC is going to have to resist the temptation to hold back parts of the OS or the application stack as proprietary software. Credibility in the Free Software fanatic community is going to be key for its first wave of usage, and "free enough" isn't going to be good enough for this product. A good cautionary case would be Trolltech's Qtopia. Trolltech's reputation for holding back parts of its stack has probably been the main reason this platform hasn't been taken up by Linux aficionados. Third, and perhaps most importantly, support from more hardware vendors. "Open Source" is sometimes a synonym for "second source" -- it gives customers and developers the security of knowing that the success of a platform is not tied to the success of a particular company. OpenMoKo can take the Free Software niche in the smartphone OS market -- making a place among Symbian, Pocket PC, and Palm OS that appeals to hackers. I think if they can get the hackers, they can get the kind of UI quality and application availability that will get the rest of the population interested. Firefox is an example of an Open Source project that has done this recently. All in all, I think FIC has a lot of challenges ahead -- mostly internal. But I also think that if this is played right, OpenMoKo or something like it could change smartphones the way Linux and the *BSD family have changed servers. tags:

Hillary's In News bulletin: Hillary's In. She's in to win. She's in to win the Big Spin. She's in up to her chin. She's in and so is her twin. She's in with a grin and a tin of aspirin. Hillary's in by the skin of her shin. She's in with the thin fin of an elfin dolphin. So it begins. tags:

MJ Ray: Tipping point

Cutting Free: An interview with gNewSense founders Paul O'Malley and Brian Brazil
"if your hardware reacts badly to gNewSense, is it time for you to examine what the vendor is doing to you? If they offer some piece of hardware in exchange for your freedom and then they don't trust you to run that hardware correctly. They don't trust you, why should you trust them? As you don't have the specifications could it be the case that they are pretending that commodity is really something luxurious? How can you know that?" [note: bad site for the visually-impaired, bad colours and a graphical eyetest for comments]
Chip and SPIN! Examining the technology behind the "Chip and PIN" initiative...
"The purpose of this site is not to provide totally balanced comment on the move, but to give proper airing to the drawbacks. It's a always a tough job for onlookers to assess the truth behind anything controversial, but the greater the quantity of information, and the greater the variety of sources the better."
The Huffington Post: James Love: WIPO and the global consolidation of rights in audiovisual works
"This makes it more difficult, risky and expensive to copy, republish, remix or reuse works, for any purpose. This is a bad idea in general, but an insane idea at the very moment when we are witnessing such an explosion of new ways of creating, using, sharing and re-purposing information."
OPENSOURCE petition to the Prime Minister
"We the undersigned petition the Prime Minister to Improve Open Source use in govenment and local govenment work places."

Martin F. Krafft: No-fly list to be scrubbed?

Nori points me to this article by Bruce Schneier, which seems like good news for me. Does it mean I'll be able to visit the US again sometime in the future? I don't think so; travel to the US is among the most unattractive things I can currently think of. I might reconsider when the US stops treating visitors like terrorists, taking their fingerprints and requiring so-called "Passenger Name Records" to be made available by the airline companies transporting passengers into the US, with the sole purpose to build a criminal file for everyone entering the country, just in case they become a threat to national security or an obstacle in the path of the neo-conservatives to forge ahead. In addition, I'd fear for my laptop, which US immigration officers can now seize without reasons and scrutinise; I do not own a laptop because I can do without one for weeks on end. Furthermore, all my data are encrypted for good reasons. As the old saying goes: "only the guilty have something to hide", I'd surely make it into their prisons as a suspected terrorist (which has happened to people before). What the US doesn't understand is that even though I may be guilty and therefore hiding something, it doesn't mean I am hiding it from them. So no, I don't think I'll enter the US anytime soon. NP: I Love You but I've Chosen Darkness / Fear Is on Our Side

Bernhard R. Link: please add mime-types

Enrico blogged about translating the mime-types of file to a debtags, stating "I&aposm not sure it&aposs a good idea to encode mime types in debtags".

I just want to throw my two cent in here and state that I only once looked into debtooks and gave up because it does not list mime-types but some obscure other specification.

Getting suggested programs that support formats which have the same type of content like the one I want to show, to convert or to create does not help me. I most of the time do not want to edit "a video" or "a spreadsheet", but I first of all have a very specific file I want to do something with, or a specific set of formats I want to create something in. If I have a AbiWord file, Openoffice.org will not help me, and with video or audio formats it is even worse.

So after turning away disappointetly from debtags, I had to do a full mirror scan for /usr/lib/mime/packages/ files and their contents. Having that data cached in debtags would be something that really makes debtags usefull in my eyes. (And the more direct and verbatim the mime-type is encoded, the more useful it would be for me).

Eddy Petri&#537;or: RC bugs, what about important ones?

I was wondering if is right to our users that we are following only the RC bugs before a release. I think not. Don't get me wrong, I don't want important bugs count to be 0, or something similar; that would be insane to have as a goal.

I am thinking that we should (during the freeze) poke more of those important bugs that our and/or others' packages have. If you are like me, you will feel that you can't do anything/too much to improve the quality of the release during the freeze since some of the RC bugs are corner cases, not reproducible on your arch, already taken or you don't have the knowledge to fix them.

Many of the important bugs are broken functionalities that affect the users on a daily basis, and living 2 years with the same set of bugs is a pain. I don't know how that would feel, but I can imagine. I used Woody for only a half an year and after 2 months I started using backports. After 3, I started pulling things from Sarge (at the time it was testing). At the end of that half of year I was using mostly Sarge stuff and decided to go entirely into testing.


So, what do I propose? Maybe we should make some pages in the style of the RC bugs count pages which follow the important bugs.

As a bonus we might see some interesting things like bugs which were downgraded from RC - the RC graph would go down, while the important graph would rise. Of course, that wouldn't mean too much since that would be the product of badly assigned severities or downgraded and judged as non-RC bugs, but it would interesting to follow such tendencies.

Andrew Pollock: [life] On catproofing

Hi Amaya, Yes, we trim their nails. We even got Soft Claws to prevent them from scratching the furniture - once we'd discovered the damage they were doing (here's Stumpy modeling them). Oh, and I can assure you trimming their nails is a walk in the park compared to trying to glue vinyl nail caps on all of their claws... Sure, furniture is replaceable, but I'm talking about the nicest piece of furniture we've ever owned, and it's less than two years old and already trashed. Its like I'm incapable of having nice things and looking after them properly. That's what makes me angry.

Andrew Pollock: [life] Christmas in Vegas

(almost caught up on the blogging backlog) We had five days off over the Christmas period, from Christmas Eve on the Friday through to what we call Boxing Day (America doesn't do it, but Google gave us the day off). We spent the time in Las Vegas with our friends Craig and Sarah and their daughter Kes, in their "fifth wheel" trailer, as we had previously in Glamis. The drive was good. We stuffed around getting away on Friday, so didn't leave Mountain View until around 10am, so Craig and Sarah beat us there, when we were expecting to beat them (they couldn't leave until the end of business on Friday). It took us something like 9 hours to drive there. I think the thing I love the most about California is the diversity you get. We've seen snow, forests, beaches, desert. All without having to leave the state. One of the highlights of the trip was going through Bakersfield, which had heaps of oilwells all over the place. We also drove past one of the commercial aeroplane dumping grounds in the Mojave desert. Vegas itself was something to behold. It had a reality distortion field around it that made Google's pale into insignificance. The strip was great to walk up and down to just take in the architectural wonders that are the casinos on it. The adult industry is incredibly in your face. People are on the sidewalk handing out "calling cards" for what I thought were hookers, but I'm told are technically strippers, with catchlines such as "nude to your door in 15 minutes". What would normally dispense newspapers in any other city gave out free catalogues of what the adult industry had to offer. I thought all of that was a bit seedy. The casinos themselves where all much of a muchness inside. Far too smokey for my liking. I'm not a big gambler. I think blackjack is about the only game I can wrap my head around, and even then you can lose too much money too quickly on the tables, so I mainly played video blackjack with 25 cent bets. It's not a bad way to blow five bucks. The second hand smoke was a great deterrent against staying inside for too long. We caught Zumanity at New York New York, and had a humungous buffet lunch for Christmas Day at Mirage. We were staying in the trailer park attached to Circus Circus. It's pretty cool that there's a trailer park right on the strip. The one thing that I hadn't associated with Las Vegas was the shopping. Every one of the casinos on the strip had a massive shopping mall associated with it, and I mean massive. Paris' in particular took forever to escape from. The Forum Shops in Caesars Palace also felt like they went on forever. I initially thought how they painted the sky with clouds on the ceiling was quite clever, until I discovered that every mall did the same thing. Then it got a bit old. You could go to Vegas just for the shopping and the day spas, and never have to set foot in a casino gaming room. I'd like to make one more trip, and this time stay in a hotel, just for the hotel experience. I think Venice was my favourite looking casino (from the outside). Photos from the trip are here.

Josselin Mouette: Making upgrades faster

Improving the speed of upgrades is a never-ending process. Last year, I worked on GConf schema registration which was painfully slow. Today, the introduction of apt-delay, which compensates for the absence of hooks in dpkg, paves the way for further improvement: single call for gconf-schemas (although we wouldn't gain much now), but also more recently widespread dog-slow stuff like update-mkinitrd and fc-cache. However this approach doesn't work for ldconfig, as this command must be launched before considering the package as configured. Therefore, you can't hook it into apt-delay and hope everything installs fine before running ldconfig. The ldconfig case can be solved by itself, as it is possible to use the simplest caching method by simply looking at the timestamps of the directories it scans. This patch (for glibc 2.5) adds simple checks to see whether the directories actually need to be rescanned before regenerating the cache. The improvement is visible as soon as you upgrade two libraries together - and generally, unstable users upgrade them by packs of ten, if not more. As Aur lien Jarno seemed to agree with the approach, I hope to see it included soon, at least in experimental.

19 January 2007

Enrico Zini: tagminer

Cute things one could do with debtags While answering to a long message in the debtags-devel mailing list I accidentally put together the pieces of a fun idea. This is the bit of message I was answering:
  • It would be very useful if the means for indicating the supported
    data formats was more comprehensive. This could mean a lot of
    expanding in the "works-with-format" section of the vocabulary, which
    doesn't even include formats such as gif or mpg at the moment. I don't
    know how feasible it is to alter underlying debtags functionality, but
    perhaps it would be the easiest to make "works-with-format" a special
    case tag which allows for formats not listed in the vocabulary.
This is my answer:
Good point. The idea has popped up in the past to list supported mime types among the package metadata, so that one could point to a file and get a list of all the packages that can work with it. I'm not sure it's a good idea to encode mime types in debtags and I'd like to see something ad-hoc for it. In the meantime works-with-format is the best we can do, but we should limit it to the most common formats.
This is the fun idea: if works-with-format is the best we can do, what can we do with it? Earlier today I worked on resurrecting some old code of mine to expand Zack's ls2rss with Dublin Core metadata extracted from the files. The mime type scanner was ready for action. Some imports:
import sys
# Requires python-extractor, python-magic, python-apt
# and an unreleased python-debtags from http://bzr.debian.org/bzr/pkg-python-debian/trunk/
import extractor
import magic
from debian_bundle import debtags
import re
from optparse import OptionParser
import apt
A tenative mapping between mime types and debtags tags:
mime_map = (
        ( r'text/html\b', ("works-with::text","works-with-format::html") ),
        ( r'text/plain\b', ("works-with::text","works-with-format::plaintext") ),
        ( r'text/troff\b', ("works-with::text", "works-with-format::man") ),
        ( r'image/', ("works-with::image",) ),
        ( r'image/jpeg\b', ("works-with::image:raster","works-with-format::jpg") ),
        ( r'image/png\b', ("works-with::image:raster","works-with-format::png") ),
        ( r'application/pdf\b', ("works-with::text","works-with-format::pdf")),
        ( r'application/postscript\b', ("works-with::text","works-with-format::postscript")),
        ( r'application/x-iso9660\b', ('works-with-format::iso9660',)),
        ( r'application/zip\b', ('works-with::archive', 'works-with-format::zip')),
        ( r'application/x-tar\b', ('works-with::archive', 'works-with-format::tar')),
        ( r'audio/', ("works-with::audio",) ),
        ( r'audio/mpeg\b', ("works-with-format::mp3",) ),
        ( r'audio/x-wav\b', ("works-with-format::wav",) ),
        ( r'message/rfc822\b', ("works-with::mail",) ),
        ( r'video/', ("works-with::video",)),
        ( r'application/x-debian-package\b', ("works-with::software:package",)),
        ( r'application/vnd.oasis.opendocument.text\b', ("works-with::text",)),
        ( r'application/vnd.oasis.opendocument.graphics\b', ("works-with::image:vector",)),
        ( r'application/vnd.oasis.opendocument.spreadsheet\b', ("works-with::spreadsheet",)),
        ( r'application/vnd.sun.xml.base\b', ("works-with::db",)),
        ( r'application/rtf\b', ("works-with::text",)),
        ( r'application/x-dbm\b', ("works-with::db",)),
)
Code that does its best to extract a mime type:
extractor = extractor.Extractor()
magic = magic.open(magic.MAGIC_MIME)
magic.load()
def mimetype(fname):
    keys = extractor.extract(fname)
    xkeys =  
    for k, v in keys:
        if xkeys.has_key(k):
            xkeys[k].append(v)
        else:
            xkeys[k] = [v]
    namemagic =  magic.file(fname)
    contentmagic = magic.buffer(file(fname, "r").read(4096))
    return xkeys.has_key("mimetype") and xkeys['mimetype'][0] or contentmagic or namemagic
Command line parser:
parser = OptionParser(usage="usage: %prog [options] filename",
        version="%prog "+ VERSION,
        description="search Debian packages that can handle a given file")
parser.add_option("--tagdb", default="/var/lib/debtags/package-tags", help="Tag database to use (default: %default)")
parser.add_option("--action", default=None, help="Show the packages that allow the given action on the file (default: %default)")
(options, args) = parser.parse_args()
if len(args) == 0:
    parser.error("Please provide the name of a file to scan")
And here starts the fun: first we load the debtags data:
# Read full database 
fullcoll = debtags.DB()
tagFilter = re.compile(r"^special::.+$ ^.+::TODO$")
fullcoll.read(open(options.tagdb, "r"), lambda x: not tagFilter.match(x))
Then we scan the mime type and look up tags in the mime_map above:
type = mimetype(args[0])
#print >>sys.stderr, "Mime type:", type
found = set()
for match, tags in mime_map:
    match = re.compile(match)
    if match.match(type):
        for t in tags:
            found.add(t)
if len(found) == 0:
    print >>sys.stderr, "Unhandled mime type:", type
else:
If the user only gave the file name, let's show what Debian can do with that file:
    if options.action == None:
        print "Debtags query:", " && ".join(found)
        query = found.copy()
        query.add("role::program")
        subcoll = fullcoll.filterPackagesTags(lambda pt: query.issubset(pt[1]))
        uses = map(lambda x:x[5:], filter(lambda x:x.startswith("use::"), subcoll.iterTags()))
        print "Available actions:", ", ".join(uses)
If the user picked one of the available actions, let's show the packages that do it:
    else:
        aptCache = apt.Cache()
        query = found.copy()
        query.add("role::program")
        query.add("use::"+options.action)
        print "Debtags query:", " && ".join(query)
        subcoll = fullcoll.filterPackagesTags(lambda pt: query.issubset(pt[1]))
        for i in subcoll.iterPackages():
            aptpkg = aptCache[i]
            desc = aptpkg.rawDescription.split("\n")[0]
            print i, "-", desc
\o/ The morale of the story:

Daniel Baumann: Package Maintenance

For the nearly last 3 years, I was investing all of my spare time into maintaining packages in Debian. I tried to do it as good as I can. However, since about half a year, I got constantly flamed purely for the fact of having about 150 packages in the archive. I never have expected to get any positive feedback or even something like a thank, we all are doing our Debian work on a volunteer basis, because we are able to do it and especially because we want to do it. I can even life with it, when people like to only point to the single two not good things I ever did, reducing me to them to make me look bad, and I also accept that some people are not able to forgive as I do, to forgive when others are making uniquely (unimportant) failures. Today, I decided that I do not longer have the energy to resist those people and to give up that struggle now. In the next few days, I am changing my commitment to Debian by orphaning about the half of my packages. I hope that at least those people who are constantly against me no matter what I do, are confident know: You are the winners and I have failed. Fortunately, I am completely unimportant for Debian and thus easy replaceable by any random other human beeing. I am looking forward to see better times now, having more time for Debian Live, where the fun is, and where the people all are friendly and respectful towards each other.

Benjamin Mako Hill: Digital Citadel

The solution to a crypto puzzle I helped solve during the MIT Mystery Hunt was "ALMOST PLAGIARIZE DAN BROWN WORK." Seth Schoen did this beautifully with an extremely humorous parody of Dan Brown's Digital Fortress. His story, Digital Citadel is extremely funny if you are marginally familiar with Dan Brown and his writing style -- and probably even if you are not. I have not seen a copy of the prize winning entry in the hunt -- a story called The Ikea Code -- but the excerpt I heard was also hilarious.

John Goerzen: Everything Update

It's been very busy lately. So here's an update on lots of things.

We move in to the farmhouse this weekend, starting this evening. It's not completely done, but close enough! That's exciting. But I spent 12 hours out there on Tuesday cleaning out the attic (took the day off work to do that). So I'm exhausted, and the moving hasn't even started yet.

The wood floors are all done and looking nice.

Jacob is starting teething. We have discovered that he likes both the taste and effect of infant tylenol. Though he's been better in the past few days.

More pictures of Jacob and the house will be posted once we have a chance to get them assembled.

My MacBook Pro at work finally can suspend to RAM! 2.6.19.2 with the latest mactel patches makes it work with uswsusp.

We'll probably be without Internet at home for a few days -- at least until I get the place wired up and the firewall set up.

One of our neighbors out by the farm died this week. He was out working with his tractor when it slipped off an icy road and landed on him. His wife had just moved from Tennessee last spring when they got married, and has enjoyed working with all their animals. I didn't know either of them very well, and had only met his wife. But she was interested in our house renovation project and stopped by every so often to check on it and chat (their animals are across the road from us). We were looking forward to getting to know them both.

Next.

Previous.