Search Results: "enrico"

27 March 2007

Enrico Zini: dpl2007

My ballot for the DPL 2007 voting Everyone is posting their votes on Planet Debian, as if lots of Debian Developers vote by copying and pasting random votes from their web browsers. I wondered for a minute how come on Planet Debian we tend to see the weirdest votes ever; but then I thought: if one has a perfectly normal, sane vote to vote, why blog about it? Is this a competition for the weirdest vote? I want to play.
- - -=-=-=-=-=- Don't Delete Anything Between These Lines =-=-=-=-=-=-=-=-
3f-bfe6d532d7c-eq9-b070310 87ac
[ 8 ] Choice 1: Wouter Verhelst
[ 7 ] Choice 2: Aigars Mahinovs
[ 4 ] Choice 3: The Pony
[ 4 ] Choice 4: Sam Hocevar
[ 0 ] Choice 5: Steve McIntyre
[ 2 ] Choice 6: Rapha l Hertzog
[ 1 ] Choice 7: Hello Kitty
[ 1 ] Choice 8: Enzo Catania detto Turbominchia
[ 5 ] Choice 9: None Of The Above
- - -=-=-=-=-=- Don't Delete Anything Between These Lines =-=-=-=-=-=-=-=-
(get it from http://people.debian.org/~enrico/polygen-debian/)

14 March 2007

Michael Prokop: Maintain /etc with mercurial on Debian

Based on Bart Trojanowski’s blog article “etc snapshots with git” I removed one further item from my todo list: maintain /etc with mercurial on my Debian systems. First step is creating the repository and securing access to the repository. As mercurial stores all its files within one single directory named .hg you won’t have any further directories within /etc besides /etc/.hg, rocking - right? ;-)
cd /etc
hg init
chmod og-rwx .hg
Ignore a few files:
cat > .hgignore << EOF
syntax: regexp
(^)*.dpkg-new
(^)*.dpkg-old
(^)blkid.tab( .old)
(^)mtab
# add other files if necessary, depends on your setup...
EOF
Now commit the current state:
hg add
hg ci -m "initial checkin"
We want to commit the changes automatically when using apt-get/aptitude so let’s write and include a wrapper for it:
cat > /etc/apt/hg-snapshot-script << EOF
#!/bin/sh
set -e
caller=$(ps axww   mawk '/aptitude apt-get/  for (i=5; i<=NF ; i++) printf ("%s ",$i); printf ("n")  '   head -1)
hg add 1>/dev/null
STATUS="$(hg st)"
if [ -n "$STATUS" ] ; then
   echo "hg-snapshot-script: found changed files:"
   hg st
   hg ci -m "snapshot from $LOGNAME after: $caller"
else
   echo "hg-snapshot-script: nothing to be done"
fi
EOF
chmod +x /etc/apt/hg-snapshot-script
cat >> /etc/apt/apt.conf << EOF
DPkg  
  Post-Invoke  "cd /etc ; ./apt/hg-snapshot-script"; ;
 
EOF
Finally track the two files too:
hg add
hg commit -m "apt will track /etc automagically using hg"
That’s it. :-) Oh BTW: users of subversion might want to point their browser to /etc under svk (by Enrico Zini).

12 March 2007

Erich Schubert: What made Debian cool

Debian used to be the cool kid among Linux distributions. Because our stuff worked much better, was easy to install and especially to upgrade. Dependencies would be automatically resolved while others were fighting dependency chaos, and our menus would have all the apps in it, where others had to fill their menus on their own. And at the same time, Debian was very flexible and could be customized to become e.g. Knoppix. Our bugtracking was great and we were openly discussing bugs and all this stuff. Many of these Debian achievements are now common among distributions. Especially among Debian-derived distributions. Debian however has become a reliable 'stable' distribution often even called 'stale', while others stand in the spotlight of innovation. Other distributions have come up with maybe more advanced bugtrackers (I'm not talking bugzilla, which IMHO is overengineered) and other tools. Technically, this isn't completely true. There are still many fields where Debian is technically leading. But our focus has recently been a lot about individual packages or components (e.g. the installer). Maybe we should try focusing more on infrastructure again. In fact, Debian still has some very good infrastructure components others might be lacking. Our QA tools (including bug counters, tracking which versions are affected by which bugs, all kinds of graphs, wotomae) are great. All our update-* commands are missing in many other distributions, also things like invoke-rc.d. We have a solid Python policy to support multiple Python versions and precompilation (judging from the SELinux policy, none of the other distributions has that yet). We're able to use dash as a minimal shell instead of bash in most places (which does make a speed and memory difference). We have Debtags. But these projects don't play a key role in Debian anymore AFAICT. Trying to start a major infrastructure thing requires a LOT of engagement, maybe too much. I'd love to see better SELinux support in Debian, but I can't do it on my own, it's just too much. And I find it very hard to find people to help me with that effort. If Enrico hadn't been pushing Debtags again and again (and with a lot of code), it would also have gone stale. Despite being IMHO something that can take Debian on top again (making it a lot easier to find appropriate software). One of the reasons why Debian is still living pretty much outside is that it would be a huge effort to get maintainers to add the corresponding Tag information to their packages and so on. I've always balked at even trying that, fortunately Enrico got some tag information added via overrides to the Packages file already. Another thing that should have been happening within Debian (but happened at Ubuntu) is 'upstart'. There have been a couple of packages dealing with new init systems, but none ever managed to get support into other packages (nor is there any package in Debian with upstart support that I'm aware of). Getting SELinux strict support into init ramdisks is another big thing I'm too scared of to even attempt... i.e. I doubt that I'll be able to do that on my own, yet even to get it into the actual packages... DPL candidates: any ideas on how to be come more agile in such points (e.g. adding support to sysvinit+upstart+initng+runit to all packages with init scripts)? It took us already ages to get LSB headers added to many init scripts. Or on any of the other transitions we should do (SELinux support, Debtags, ...), or even why we've lost this flexibility? The one idea I have for that is to try to do some hackfests. Like an init transition day, where a group of people tries to NMU most of the packages that have init scripts. Or adds "Homepage:" to most packages, which some important package metadata we only have on some packages. Or adding 'watch' files. Some of these would be easier if we had a common way of packaging and a central SVN repository. That would make it both easier to prepare the transition (e.g. committing init scripts beforehand) or especially for adding Homepage metadata and watch files without actually interfering with the maintainers work by not doing an upload immedeately, but just adding them to SVN so the maintainer includes them on his next upload. (Sorry, no comments enabled in my blog.) P.S. another thing I'd really love to see is a (semantic) PackageWiki for Debian, that has a Wiki-like structure with a page for each (Source-) package. Including things like e.g. Screenshots, Homepage link, Link to the Freshmeat page of the package, support lists/groups ... Kind of like the QA pages, but for the actual users, and editable by visitors.

6 March 2007

Enrico Zini: why-free-software

A reminder on why we do Free Software Some months ago I needed to find out if proper forward-only cursors were implemented in the ODBC driver for MySQL. I didn't go very far with the documentation, but I've been diving in its source code and within 30 minutes I knew everything there was to know about the subject. Now, after years I haven't touched proprietary software at all, I've been asked to port dballe to use the Oracle ODBC driver. I had a similar problem: find out how to use scrollable cursors with Oracle's ODBC driver. The release notes (a file called ODBCRelnotesUS.htm that I probably can't put online without their consent) say that they're implemented since ages, but SQLSetStmtAttr always tells me that the driver does not support it. Maybe I have to enable it somewhere? Maybe it's a bug? I could have found out with one hour browsing this driver's source code, but that wasn't available. Instead, I had to spend a whole day of trial and error, google searching with all sort of keyword combinations, looking at strings output on the .so libraries, and in the end I still don't know. That porting project is now stuck indefinitely, and my customers had to pay for a full day of fruitless work. So, here's the reminder: If you base on 3rd party proprietary software, you can't provide a serious service.

2 March 2007

Mike Hommey: DPL platforms summaries

Enrico, you forgot your own advanced ways of wasting time (and have some fun). ;) Here are the summaries of the candidate DPL platforms, in one sentence each: 93sam
Once we don’t Select a friendly community where the packages towards a lot of software, community are most noticeable use to show their packages towards a problem good job.
aigarius
While I were elected DPL, I have to time leave Debian Developers Corner Site, map Search about it should not have not be Even if he has, the NM; process is before.
ajt
Ideally, I’d expect that we ought to make It work together in Linux and a DPL review of the community and October firmware resolutions recall vote maybe That’s been some of stuff I’ve been a server near you United States.
hertzog
The sponsorship, principle.
sho
I believe admit volunteers to scratch our bug tracking system I do what I would like LowThresholdNmu to happen again; Admit it has rhymes with a few of it Debian; is to be really like to automatically see them.
sjr
To the web site, map Search Not Published Yet Back to the Debian Project Select a server near you United States; the web Site, map Search Not Published Yet Back to the debian For other contact information, See the Debian Project Select a server near you United States.
stratus
It is today in the web team, the users: and waited supergroups i will that any Debian support: this change our major Desktop, with Lenny development website, we’ve now almost our official status and how a statistics page.
svenl
To the ban.
wouter
I am of a native Dutch is not an area where possible.
These summaries have been generated by the following script:

for i in 93sam aigarius ajt hertzog sho sjr stratus svenl wouter; do
  echo $i
  lynx -dump -nolist http://www.debian.org/vote/2007/platforms/$i dadadodo -c 1 - 2> /dev/null
done
It is somehow subobtimal, as aigarius and sjr’s summaries show: the headers and footers of the page have some influence, but well… it was fun anyways.

Jacobo Tarr&#237;o Barreiro: And now, for something completely the same

Enrico: if you extract the platforms using lynx -dump -nolist (or w3m -dump ), you’ll only extract the text, with no HTML, and the keywords will vary slightly:

1 March 2007

Enrico Zini: dpl-platform-keywords

Representative keywords of DPL platforms The DPL platforms are too long and you could use a very, very short executive summary? No problem, I have the technology for it. After the results you can find the kit to build yourself an extractor in the comfort of your home. The results Acquiring the data
for i in 93sam aigarius ajt hertzog sho sjr stratus svenl wouter
do
    wget http://www.debian.org/vote/2007/platforms/$i
done
Tokenizing
#!/bin/sh
for file in "$@"
do
    lynx -dump -stdin < $file   tr -c '[a-zA-Z]' ' '   tr '[A-Z]' '[a-z]'   sed -e 's/ /\n/g'   sed -e '/^$/d' > $file.tok
done
Extracting the most representative keywords
#!/usr/bin/python
import sys, math
def read_tokens(file):
    "Read all the tokens from one file"
    return [ line[:-1] for line in open(file) ]
# Read all the "documents"
docs = [ read_tokens(file) for file in sys.argv[1:] ]
# Aggregate token counts
aggregated =  
for d in docs:
    for t in d:
        if t in aggregated:
            aggregated[t] += 1
        else:
            aggregated[t] = 1
def tfidf(doc, tok):
    "Compute TFIDF score of a token in a document"
    return doc.count(tok) * math.log(float(len(docs)) / aggregated[tok])
# Output the top 5 tokens by TFIDF for every document
for name, doc in zip(sys.argv[1:], docs):
    print name, sorted(set(doc), key=lambda tok: tfidf(doc, tok), reverse=True)[:5]
Errata Jacobo suggests to use lynx -dump -nolist or w3m -dump for a more tokenizer-friendly text expansion.

Enrico Zini: suggestions-gz

Package suggestions I tried generating a list of 10 suggested packages for every package in the archive. You cat get it at http://people.debian.org/~enrico/Suggestions.gz and build nice things with it. Generation took two hours of a nice 18 process on the busy gluck, but it can be run in any faster/less busy machine that has a local copy of the unaggregated popcon data. This is (roughly) the generating algorithm:
  1. Take a package P.
  2. Query P on a Xapian index that indexes popcon submissions as documents and their packages as words.
  3. Get the first 20 resulting popcon votes.
  4. Score each package mentioned in those 20 results by a combination of how many votes mention it, its TFIDF scores in the various votes and the Xapian relevance score of the resulting votes.
  5. Take the top 10 packages as suggestions for P.
The code can be fetched with:
bzr branch http://people.debian.org/~enrico/2007-01/popcon/

27 February 2007

Enrico Zini: only-one-way

Python: "There's Only One Way To Do It"
import array
import numarray
import numeric
import numpy
They're all almost the same, but not quite. When google gives you an online piece of documentation, it's hard to say what it refers to. And different scientific modules use one or the other, more or less unpredictably. Maybe in the future numpy will replace them all. In the meantime, if I hear someone saying "There's Only One Way To Do It", I will spank their cheeks with a wet fish.

25 February 2007

Yves-Alexis Perez: FOSDEM

I'm now just back from FOSDEM in Brussels. Well I was back few hours ago, but now I've eaten, I've send the signed keys from the KSP, pictures are on their waythere, it's time to post.

First, I'd like to really thanks Wouter for the Hosting near Brussels, Madcoder for the trips, and everyone in FOSDEM organization. From my point of view, it was flawless. We had wifi when they promise it, and it works great during all the weekend, we had food and beer at good prices, people were kind etc. Really really thank you.

It was my first "international" meeting, one month after my first "national" meeting at Solutions Linux. First time I met so much FOSS developers, and especially Debian ones. Lot of people I didn't know, lot of people I still don't know, but which I was glad to hear of, to see talks...

I was especially interested by sunday talks, netconf from madduck, and Debian Internals by Enrico, which were really nice (and netconf seems promising).

It was really short, and exhausting, but it made me want to go to Edimburgh for Debconf7, but I really don't know if I'll be able to do this. (nor if I would want to leave for a week 'alone' ...)

In the end, it was a quite improvised week-end, but a really nice one.

21 February 2007

Arnaud Fontaine: pmnew-gui announcement

These last weeks, Enrico and me have worked on a GUI frontend for pmnew. At the moment, the prototype is limited to the task of finding new packages to install. The goal of pmnew-gui is to have every little detail designed to be as smart as possible: for example, the list of packages shows at the top the packages that the system thinks you are interested in having comparing your system to thousands other systems. Screenshots http://people.debian.org/~enrico/2007-02/sshot-startup.png
http://people.debian.org/~enrico/2007-02/sshot-audio.png
http://people.debian.org/~enrico/2007-02/sshot-games.png Get it
bzr branch \
http://people.debian.org/~enrico/2007-02/pmnew-gui/
Setup The README gives some details about the setup. In short you will have to do the following steps:
apt-get install python-debian python-deb822 python-xapian \
python-apt python-glade2 python-gtk2
./update-data
./pmnew-gui
It works better if you have a network connection, and if you have popularity-contest installed and running. Feel free to send us feedbacks about the GUI. Links

20 February 2007

Enrico Zini: maskedarray-performance

Performance of numpy masked arrays This is the code:
import time, numpy, MA
start = time.clock()
a = numpy.ones(1000000)
cur = time.clock()
print "numpy create", cur - start
start = cur
for i in xrange(1000000):
    a[i] = i
cur = time.clock()
print "numpy fill", cur - start
start = cur
a = MA.array(numpy.empty(1000000), mask=1)
cur = time.clock()
print "MA create", cur - start
start = cur
for i in xrange(1000000):
    a[i] = i
cur = time.clock()
print "MA fill", cur - start
start = cur
This is the output:
numpy create 0.01
numpy fill 0.39
MA create 0.15
MA fill 17.06
/me cries

5 February 2007

Enrico Zini: pmdraft-commandline

Second generation package manager - First shellish prototype As you know, I'd like to experiment with prototyping some new interface concepts for package managers. I put together a prototype backend and hacked a cmd-based shell interface for it. You should be able to fetch it with:
bzr branch http://people.debian.org/~enrico/2007-01/popcon/
The files involved are pm.py, pmnew and a very little bit of anapop.py. You run it with ./pmnew. The commands are: This can be an example session to try:
tags
search toy
tags
packages
tags
desired 1
packages
info 3
If you: then the list of available packages will be sorted using my recent web interface prototype for popcon-based suggestions. Matt Good and Thomas Viehmann volunteered to have a try at a GUI. This can only be fun.

2 February 2007

Enrico Zini: swig-doxygen-docstring

Generating Python docstrings from Doxygen with swig I found that there is a way to autogenerate Python docstrings from Doxygen documentation when creating bindings with swig:
  1. Instruct doxygen to output XML (this is different than GENERATE_TAGFILE):
    # If the GENERATE_XML tag is set to YES Doxygen will
    # generate an XML file that captures the structure of
    # the code including all documentation.
    GENERATE_XML           = YES
    
  2. Use either a python script or an XSLT transformation to extract information from the Doxygen XML into a swig .i file with %feature("docstring") commands.
  3. Include the resulting .i file in your master .i file:
    %include "../doc/dballe-doc.i"
    
This is all. Now you can fire up ipython, import your new library and get online help.

Enrico Zini: pmdraft

Second generation package manager I have created many prototypes for advanced package manager features. Erich Schubert also made a tag cloud prototype. Recently, I wrote:
We have lots of interesting, usable metadata; we have algorithms; we have prototypes; we have ideas for lots of cool, implementable features. The question is, are we able to write applications that just combines what is needed from all this treasure to provide the right interface(s) for our base(s) of users?
Most of the back-end code is already implemented in Python, and I'm thinking of putting it together into a working prototype for a new concept of a file manager. This could be even implemented quickly, if someone joins me who is good at: What follows is a sketch description of what I have in mind. The user
Debora is 34, working as a web designer in a small enterprise. She has a laptop running Debian which she uses both for work and at home. She likes Debian for the wide range of software, that allows her to be always able to access the best tools for the job, even in a highly changing environment like the one of web design. At home she enjoys the various tools for photo editing and management, and of course, having a husband and a 6 years old son, the selection of games.
The tasks Looking for new software Use the smart tag search for searching: it allows a Google-like search interface, which afterwards allows categories to be used to semantically refine the results. This last step is conceptually very simple, as it maps to a sequence of "more like this" and "less like this". The search results can be sorted using popcon suggestions, that are very effective at showing software not in the system that many other people use. Looking at what is installed Let's see if this package does what I need Given an installed pacakge, show the contents of its bin/ directories and showing manpages as the details for the bin/ file: thanks to the Debian Policy, executables are all in /(usr/)?s?bin/ and they must have manpages. For packages that are tagged as interface::3d, interface::text-mode or interface::x11, allow to run them directly from the interface. Also show the contents of /usr/share/doc/pkgname and /usr/share/doc/suggested-and-recommended-pkgnames and allow to open documentation with the appropriate software. If there is an html directory which contains an index.html, only show that and not all the other HTML files. Find info documentation and allow to open it into a proper info browser. If there are manpages that don't have a corresponding executable, show them as extra documentation. What was that nice package I installed yesterday? List installed packages sorted by when was the last time they have been installed. Let's get rid of the cruft There are also some "unusefulness" scores one can compute, but I haven't yet been playing with them yet: Task filter Have a look at the popcon suggestion page: there is a "Suggestion type" box. Of course the same idea can be used in a package manager to restrict it to a significant subset of the packages. More filters, as you can imagine, can be easily created. This is how it is implemented:
case "any": $filter = "'!role::shared-lib'"; break;
case "gui": $filter = "'!role::shared-lib && role::program && (interface::x11   interface::3d)'"; break;
case "devel": $filter = "'!role::shared-lib && devel::*'"; break;
case "game": $filter = "'!role::shared-lib && role::program && game::*'"; break;
default: $filter = ""; break;
The same filter can be gived to Debtags:
debtags search '!role::shared-lib'
debtags search '!role::shared-lib && role::program && (interface::x11   interface::3d)'
debtags search '!role::shared-lib && devel::*'
debtags search '!role::shared-lib && role::program && game::*'
Conclusion As I said:
There is so much really cool stuff to be written, just within reach.
So?

31 January 2007

Enrico Zini: popcon-play

Playing with popcon data Check out http://people.debian.org/~enrico/popsuggest.php. You can upload there the popcon results of your system and have them compared with all the other submissions. It will show the results grouped by the most relevant tags found in your system, and you can filter the results based on various package types that map to debtags expressions. Credits also go to Eric Evans, for the continuous very useful and supportive discussions during all the development. As I said, there is so much really cool stuff to be written, just within reach. Some random notes taken during the development:

26 January 2007

Enrico Zini: pkgwalk

A stroll among Debian packages Can Debtags be used to show a list of packages similar to a given one? Yes it can:
#!/usr/bin/python
#
# Copyright (C) 2007  Enrico Zini <enrico@debian.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# From python-debian
from debian_bundle import debtags
# From python-apt
import apt
aptCache = apt.Cache()
pkg = 'debtags'
# Read the debtags database 
db = debtags.DB()
tagFilter = re.compile(r"^special::.+$ ^.+::TODO$")
db.read(open('/var/lib/debtags/package-tags', "r"), lambda x: not tagFilter.match(x))
# Get the tags of the package
tagset = db.tagsOfPackage(pkg)
# Get the list of packages that have some tag in common with pkg
nextpkgs = set()
for pkg, tags in db.iterPackagesTags():
    if tagset & tags:
        nextpkgs.add(pkg)
# Score every package by the number of tags it has in common with pkg
def pkgscore(pkg):
    score = 0
    for tag in db.tagsOfPackage(pkg):
        if tag in tagset:
            score += 1
    return score
# Show the top 20 related packages in reverse score order
display = sorted(nextpkgs, key=pkgscore, reverse=True)[:20]
for num, pkg in enumerate(display):
    aptpkg = aptCache[pkg]
    desc = aptpkg.rawDescription.split("\n")[0]
    print "%2d) %s - %s" % (num + 1, pkg, desc)
Now, imagine an application that allows you to move from package to package using the list of similar packages. You are using this application and moving from tag to tag. Can the list of previous packages you visited be used when computing similar tags to make the selection even smarter? Have a look:
#!/usr/bin/python
#
# Copyright (C) 2007  Enrico Zini <enrico@debian.org>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# From python-debian
from debian_bundle import debtags
# From python-apt
import apt
aptCache = apt.Cache()
# Read the Debtags database 
db = debtags.DB()
tagFilter = re.compile(r"^special::.+$ ^.+::TODO$")
db.read(open(options.tagdb, "r"), lambda x: not tagFilter.match(x))
# Maximum number of previous packages to remember 
maxlen = 3
# Initial package selection
trail = [ 'debtags' ]
# Loop until the user chooses to quit
done = False
while not done:
    # Compute a package weight according to how old it is in the
    # trail
    pkgweight =  
    for idx, pkg in enumerate(trail):
        pkgweight[pkg] = 1.-(idx/maxlen)
    # For every tag, find the number of packages in trail that have the tag
    tagscores =  
    for pkg in trail:
        for tag in db.tagsOfPackage(pkg):
            if tag in tagscores:
                tagscores[tag] += pkgweight[pkg]
            else:
                tagscores[tag] = pkgweight[pkg]
    # Divide every tag score by the number of packages in the trail,
    # obtaining a 'tag weight'.  A package can be later scored by summing
    # the weight of all its tags.
    for tag in tagscores.iterkeys():
        tagscores[tag] = float(tagscores[tag]) / float(len(trail))
    # Find the merged tagset of the packages in trail
    trailtags = set(tagscores.keys())
    # Get the list of packages whose tagsets intersect the trail tagset
    nextpkgs = set()
    for pkg, tags in db.iterPackagesTags():
        if trailtags & tags:
            nextpkgs.add(pkg)
    # Score every package by the sum of the weight of its tags
    def pkgscore(pkg):
        score = 0.0
        for tag in db.tagsOfPackage(pkg):
            if tag in tagscores:
                score += tagscores[tag]
        return score
    # Show the first 20 packages in reverse score order
    display = sorted(nextpkgs, key=pkgscore, reverse=True)[:20]
    for num, pkg in enumerate(display):
        aptpkg = aptCache[pkg]
        desc = aptpkg.rawDescription.split("\n")[0]
        print "%2d) %s - %s" % (num + 1, pkg, desc)
    # Ask the user to choose a new package
    while True:
        ans = raw_input("> ").strip()
        if ans[0] == 'q':
            done = True
            break
        elif ans.isdigit():
            num = int(ans) - 1
            if num < len(display):
                # TODO: on a different kind of interface, display the full
                # description of pkg
                trail = [display[num]] + trail[:maxlen]
                break
            else:
                print "The number is too high"
Who wants to make a GUI out of this?

24 January 2007

Enrico Zini: package-managers

Improving package managers I noticed two posts on improving package managers none of which mentions Debtags. Daniel Burrows mentions various issues: David Nusinov mentions that the ideal package manager should look like Google, where you search for things using just a simple one line text entry and pick from the results what you want to install. I should probably do a bit of recap of things that have been going on. I'll go through that list again:
  • The current sections in Synaptic are useless
Agreed. This used to be a bug about this, which has been closed by Debtags more than one year ago. We now have much more useful category data for about 73% of the archive (including experimental), but what we lack is software using it. Here's a quick trick to try:
  1. install debtags, and this gives you an easy to read text file in /var/lib/debtags/package-tags.
  2. from that file, pick packages that have the tags role::program, scope::application and interface::x11.
  3. display the results, and use the tags works-with::* and use::* to navigate the results.
There is a python-debian package in experimental that has a debtags module you could play with. Why is that that so far noone has written a simple package manager just for gamers, which uses only the game::* tags? Do you think Debtags gives you too many tags? Then check out: To summarise so far, we not only do have better categories, but also a number of cool algorithms to use them, and some interface prototypes as well. Just don't expect me to write a package manager as well: that's a job that so far I decided to leave to someone else. adept gave it a try, with positive results.
  • there are better keyword search technologies than strstr()
Indeed, Xapian for example. I use it as part of the backend of the Debtags smart search, and here's our Xapian-powered normal keyword based package search interface which does stemming, indexing and all you want to ask from a serious full text index. In that page you don't see all the nice features of Xapian, but only the ones that I needed for my Debtags evil plans. Have a look at the documentation and give it a try. Here is a way to see Xapian's similarity matching in action:
  1. go to the Go tagging! page
  2. click on a random untagged package
  3. the system gives you a rather relevant selection of tags
  4. look at it again: the package was untagged: how could the web engine possibly figure those tags out?
What is happening under the scenes is that:
  1. I ask Xapian: "what packages are similar to this one?".
  2. I aggregate the tags of the resulting packages.
  3. I rank the tags by how many resulting packages have them.
While we are on this topic, why don't we decide that we maintain a Xapian index of our package descriptions in, for example, /var/lib/apt/fulltext/, so that various applications can share it? Indeed. Anyone would like to implement this little "popcon" tool? Having the data easily accessible locally can encourage people to use them. The Debtags Go tagging! page already uses popcon data to show the most common untagged packages at the top, with double reason: it shows packages that more people are likely to know (and therefore likely to categorise) and it pushes for the most common packages to be tagged more urgently. Indeed. Anyone volunteers to implement a prototype? The full unaggregated (but anonymised) popcon data are accessible to every Debian Developer on the host gluck.debian.org in the directory /org/popcon.debian.org/popcon-mail/all-popcon-results. Ideally one can do many interesting things with this concept: besides tag suggestions, one could identify the packages that are most representative of an installed system, and also offer negative suggestions like: "people who have packages like yours usually don't have this package: would you like to remove it?". There is more than all this that could be done. Recently, almost by accident, I had the idea of querying packages by example, like pointing to a file and find packages that can work with it. I've asked Jeroen to have Mole collect info on all files that could possibly get installed in /usr/lib/mime/packages/ (as suggested by Bernhard R. Link), to see if that prototype can be made more accurate. Query by similarity would be nice: I don't like this program, but what else do we have that does the same job? This is best implemented using Debtags data, since it directly maps to semantic properties. Note that you don't have to show a single tag to the user to implement this kind of interface. Do we have a way to point at the X window of an application and get the name of the package that installed it? Wouldn't it be about time to have it? Why don't we have a system updater utility that shows the Debian weather? Why aren't more people playing with semantic web? But more generally, the problem with package managers is that we seem to be irrationally compulsive in wanting to make the one and only big easy and complete interface for everyone. Other more reasonable people would tell you that if you have two very different kinds of users you may want to consider having two different user interfaces. Ubuntu for example installs by default 3 package manager interfaces: Synaptic; the thing that you access from the application menu to add applications to it; and the update manager. Does it sound like a waste? To me it makes lots of sense. We have lots of interesting, usable metadata; we have algorithms; we have prototypes; we have ideas for lots of cool, implementable features. The question is, are we able to write applications that just combines what is needed from all this treasure to provide the right interface(s) for our base(s) of users? Even if my English in 2004 wasn't easy to understand, a read here might still be useful. There is so much really cool stuff to be written, just within reach.

21 January 2007

Enrico Zini: avoid-flamewars

Fourteen ways in which you can avoid starting a flame war on a Debian mailing list On an IRC brainstorming on what talk I should give at FOSDEM, liw suggested:
"Fourteen ways in which you can avoid starting a flame war on a Debian mailing list".
In the end I went for something more technical, but I've never stopped thinking about liw's challenge. I ended up writing talk notes about such a potential talk. Here they are. The classics The radicals The radicals, applied selectively The From tricks The naggers The conscience ticklers The subtle The subtle, 1 week later

Enrico Zini: python-module-commands

Python "commands" module The standard python library has a module called commands with three nice simple functions to run a command and get its output and its status. The first one is called commands.getstatusoutput(cmd), it runs the given command and returns its exit status and its output. The second one is called commands.getoutput(cmd), it runs the given command and returns its output, ignoring the exit status. The third one is called commands.getstatus(cmd), it runs the given command and returns its exit status, ignoring the output. Actually, no. The third one is called getstatus(file), it runs the command ls -ld file (with proper shell escaping) and returns its output. Seriously.
>>> commands.getstatusoutput("echo ciao")
(0, 'ciao')
>>> commands.getoutput("echo ciao")
'ciao'
>>> commands.getstatus("echo ciao")
'ls: echo ciao: No such file or directory'
>>> commands.getstatus("/bin/echo")
'-rwxr-xr-x 1 root root 19304 2006-08-31 14:25 /bin/echo'
Every time I think of this getstatus, I quickly convince myself that I misread the documentation. Then I rerun the example above.

Next.

Previous.