Search Results: "cas"

11 November 2007

Joey Hess: random tip: per-port naming for identical USB devices

This is another case of a udev rule that took over an hour to figure out, and now seems very clear and obvious. Which probably means it won't next time I need it. I have a bunch of USB to serial adapters, all using pl2303, all so cheap that there's no product ID or any way to tell them apart. This is cheaper than buying actual console server hardware nowadays. So how to know which ttyUSB* device is hooked up to what? The solution is to use the USB bus ID, which corresponds to the usb port the device is plugged into. My /etc/udev/rules.d/z25_persistent_usb_serial.rules:
SUBSYSTEMS=="usb", ID=="3-2", KERNEL=="ttyUSB*", NAME="ttyUSB_front_upper"
SUBSYSTEMS=="usb", ID=="2-2", KERNEL=="ttyUSB*", NAME="ttyUSB_front_lower"
The ID numbers can be found in dmesg.

Stefano Zacchiroli: installed size

Installed-Size?
zack@aquarium:~$ dpkg -s python-django grep Installed-Size
Installed-Size: 7776
zack@aquarium:~$ du -sh /usr/share/python-support/python-django/
7,2M    /usr/share/python-support/python-django/
zack@aquarium:~$ du -shc /var/lib/python-support/python2.*/django/
4,8M    /var/lib/python-support/python2.4/django/
5,0M    /var/lib/python-support/python2.5/django/
9,7M    total
zack@aquarium:~$

Disclaimer: I'm fine with python-support and friends, they've smart architectures. However it's a fact that currently a huge deal of packages in the archive are size-wise not faithfully represented by the Installed-Size field (and the ratio can be quite impressive!). I wasn't here when that field was designed, but I bet an intended use case was to give admins a way of knowing which packages were wasting disk space the most. For sure dpigs relies on Installed-Size and don't have the necessary info to identify stuff like the above.

Daniel Burrows: ANNOUNCE: cwidget

I've just uploaded the first release of libcwidget to Alioth and NEW. libcwidget is a high-level C++ library for developing user interfaces that run in a terminal using curses as the display and input layer. It uses widget abstractions similar (but of course not identical) to those found in GTK+ and Qt, with signals and slots provided by libsigc++.

Background

Back when I started writing aptitude, I had one general goal:

Just because it runs in a terminal doesn't mean it has to suck.


I tried to apply this in the user interface, but I also applied it internally. The curses programs I looked at before writing aptitude all had very ad-hoc UIs. In many cases the code was structured with each "view" that appeared mapped to a custom C function call; if the author was feeling ambitious, similar-looking screens might be abstracted into a single function call, but the basic structure of the interface still reflected the call graph of the program.

aptitude had a primitive interface abstraction layer from the get-go; over the years, I borrowed ideas from GTK+ and restructured this layer into a full widget set. libcwidget is this code, disentangled from the guts of aptitude and slightly cleaned up. Because of its history, it is missing widgets that aptitude doesn't need (like a multi-line text editor), but it provides an extensible base that you can build upon.

Getting cwidget

The cwidget library is available (both as source and as an i386 .deb) from the cwidget Alioth releases page. There is also API documentation automatically generated from the upstream repository, which, while it is woefully incomplete, should provide some information: I've tried to write Doxygen tags into most of the code I've added in the last 4 years or so.

The upstream code repository is in git (because what fun is a new project if you don't learn a new VCS?) and available here. To retrieve a copy of the repository for yourself, run this command:

git clone git://git.debian.org/git/cwidget/head cwidget

10 November 2007

Norbert Tretkowski: MySQL in Debian and Binary Logging

The next upload of the MySQL packages to Debian (both branches, 5.0 in unstable and 5.1 in experimental) will disable binary logging in the default configuration file. I think most users of the MySQL packages in Debian don't really need it, and otherwise (e.g. on a replication master, or for point-in-time recovery) they know how to enable it.

This change only affects you when you're doing a fresh installation of the mysql-server package, or if you're still running the default configuration file shipped with the package. If you modified the configuration file in the past already (which should be the case when using replication, because the server_id line is disabled by default), the change will not be applied during an upgrade without explicit confirmation.

MJ Ray: RAAM 2007 and 4 Days of Milan

SLO2 (FTA 13e) is advertising a sports documentary called RAAM 2007 today (Saturday 10 November) at 1630 CET - that might be the Race Across AMerica and there’s no telling what language it will be in! RAI Sport Sat (FTA 13e)
has coverage of the 4 Days of Milan stage from Montichiari to Castellana on Sunday 11 November at 1700 CET. I can’t find this race on the UCI calendar - does anyone know it?

Christian Perrier: Old pending bugs

A stupid idea that popped up in my head this morning (actually reading the backlog of #debian-devel-fr and a remark by Lucas Nussbaum): it would be interesting to list bugs tagged as "pending" more than, say, one year ago and report them somewhere (-devel or a web page). I think that in the majority of cases, there is probably something broken when a bug is marked pending for more than one year..:-)

9 November 2007

Simon Richter: Hacking, soon.

The plan for tomorrow includes possibly breaking my computer by soldering the JTAG connector onto the CPU board. Then there will be much debugging of mISDN drivers, and hopefully some rejoicing when I find out what makes the kernel hang on loading the layer 1 driver. This will also be an excellent opportunity to clean up my desk to make space for the soldering iron, and to build another Internet router in case anything goes wrong.

Wouter Verhelst: Public Transportation

Christian Perrier blogs about how he uses public transportation to go to work, how that works well, and how that has positively affected his Debian productivity. Personally, I couldn't agree more. I've graduated from school in 2001; and the only time when I commuted to work by car was when I worked at template, where I had a company car because I had to make customer visits. Today, as an entrepreneur, I do everything by public transportation. It is my intention to, eventually, make sure I have a car because doing customer visits by public transportation isn't easy; but it's not impossible, either; you just need to make sure you're prepared. If I have an appointment at a customer, what I usually do is to go to the de lijn website, of the flemish public transportation company that handles buses and trams; they have a schedule online, and a route planner that allows me to do much of what Google Maps does for cars, but then for public transportation—including trains. If I do that on time (that is, earlier than half an hour or so before the appointment), I hardly ever have problems reaching my destination in time. Of course there are days when the system fails, and I'm stuck in a train station for longer than I'd like; but these are the exception, not the rule, especially outside rush hour. And like Christian mentions, the absense of having to pay attention to the road while commuting is a real bonus, in that it allows you to actually get some work done. Or sleep, if it's been a short night. Or look outside the window, if you have nothing better to do. Or hack. In fact, at DebConf7 in Edinburgh, I had a little discussion with Ian Jackson about how the train provides the perfect environment for hacking: nobody around to disturb you (except, occasionally, people to check your tickets, but you can just put your ticket in plain view all the time and they'll be happy without you getting out of deep hack mode), and the view out the window is just perfect to stay concentrated: no still image to get distracted by, but nothing boring either. We theorized that it'd be nice if you could just go to the train station and state "I need a ticket. The destination isn't important, but I want to be waiting as little as possible and end up here again in about 2 hours". The only problem with that, of course, is that train rides aren't free, and that office rent is much more affordable...

8 November 2007

Miriam Ruiz: C and multithreading

Reading mig21’s weblog, in which I often find really interesting stuff, I found Ian Lance Taylor’s article “Single Threaded Memory Model“, which kind of bothers me a bit. It reports a recent discussion on the gcc and LKML mailing lists about how C compilers, gcc in this case, optimize for single threaded code, sometimes leading to counter-intuitive results which won’t work properly in multi-threaded software (leading, for example, to race conditions). The interesting part is that the C language standard, which in general describes a single threaded model, apparently says nothing about when values have to be written to memory. Thus, this kind of optimization seem to be perfectly valid. Linus Torvalds complains about gcc developers taking more care about “what the spec says” than about real problems, but the fact is that if those kind of optimizations are valid according to the specs, there’s no guarantee at all that it won’t happen with whatever C compiler you might be using. To prevent this kind of behaviour in standard C, according to Ian, the variable needs to be marked as volatile, or it needs to use an explicit memory barrier. The moral in this case is that multithreading might not be as easy as it seems and should be handled with caution.

Matthew Garrett

As often seems to be the case, my internet at home vanished shortly after I arrived in Portland. Remote debugging (hurrah for flatmates) revealed that the modem would come up, start a PPP session and then OOM around 30-40 seconds later. This was kind of odd, since running ps in a tight loop showed that it wasn't the PPP daemon that was taking up all the extra RAM. Once we'd pretty much ruled out userland, that left the kernel. Limiting the value in /proc/sys/net/ipv4/ip_conntrack_entries brought stability back, but left us wondering why it had suddenly broken (and, of course, made it difficult to actually route anything...). /proc/net/ip_conntrack showed a bunch of ssh connections. Lots of ssh connections. All coming from one machine inside the network, but targeted at a large number of machines with roughly consecutive IP addresses.

At this point, I remembered a party a month or so ago. One where I'd created an account on the TV machine to let people upload stuff to play. An account I'd cunningly called "media", giving it the highly secure password of "media". I blame vodka from Ikea.

You can guess where this is going.

Unplugging the TV machine resulted in everything rapidly returning to its normal state. I'm sure there's some sort of important lesson here, but I'm sure I don't know what.

7 November 2007

Ross Burton: I Worry

I phoned Camelot and they fobbed me off with some story that -6 is higher — not lower — than -8 but I'm not having it.
As much as I admire your determination Tina, I really do think that you should give in on this (from Manchester Evening News via Good Math, Bad Math). NP: Groove Salad, Soma.fm

Jeff Bailey: Zipcar

In Montreal, we participated in a carshare called Communauto. The goal of Communauto is to have a car at least every 500 metres across the island of Montreal. In practice for areas they serve, they usually had more than that. The Saint-Sacrement location had at least a dozen, and there were clusters of 3 or 4 within a couple minutes walking distance of anywhere on the plateau.

Such a thing does exist here, but not in Silicon Valley at all. If you're in the valley at all and wish you didn't need to have a car for little errands, or are thinking about a second car for those times you just want to go somewhere different from your mate, *please* add your name to the notify list for zipcar:

http://www.zipcar.com/notify-me

The problem this solves is the one that a bus or a bike can get one to work easily enough, or into the city, but the bus is never going to be great for the once-a-week grocery shop, or that trip to Ikea. In that case, you pay the use of the car for an hour (or 4 if it's Ikea...), and then return it. I really believe that it's a critical part of making mass-transit work.

Raphael Geissert: Your message to FOO awaits moderator approval..

After sending 785 reports I received three notification messages about my message awaiting moderator approval.


I find it curious that some lists aren't open for anyone to post but anyways used in the Maintainer field of some packages.

Here are the three emails I received:
Your message to Debian-arabic-packages awaits moderator approval
Your message to Pkg-icecast-devel awaits moderator approval
Your message to Pkg-dia-team awaits moderator approval


Besides that, people already started to react to the reports so it seems like my goal will be accomplished :)

6 November 2007

Enrico Zini: axi-searchasyoutype

apt-xapian-index: search as you type I've recently posted: Note that I've rewritten all the old posts to only show the main code snippets: if you were put off by the large lumps of code, you may want to give it another go. Today I'll show how to implement a very attractive feature for a user interface: search as you type. The idea is that you don't need to press enter to fire up a query: instead, the results materialise in front of your eyes as you type them. The example I created uses curses, but the idea is good on any interactive user interface. The main thing to keep in mind with search as you type is that the last word is likely to be partially typed, unless maybe some timeout expired since the user's last keystroke. Xapian comes into help here, as it allows us to expand the partially typed word into an OR query with all the terms that start with it. This means that if we are typing, for example, "progr", we can turn the query into "program OR programmer OR programming OR programmed [...and so on...]". I won't show the UI code, except a simple input loop that triggers the query at every keystroke:
    def mainloop(self):
        while True:
            c = self.win.getch()
            self.line += chr(c)
            self.results.update(self.line)
The interesting part is in the update function. First we split the line in words and convert the words into a query:
        # Split the line in words
        args = self.splitline.split(line)
        # Convert the words into terms for the query
        terms = termsForSimpleQuery(args)
Then we expand the last word with all possible completions:
        # Since the last word can be partially typed, we add all words that
        # begin with the last one.
        terms.extend([x.term for x in db.allterms(args[-1])])
Now we can build the query. Of course you can add all other sorts of things to the query, for example a boolean expression of tag filter like in axi-query-pkgtype.py; Xapian will cope.
        # Build the query
        query = xapian.Query(xapian.Query.OP_OR, terms)
Finally the query. For bonus points you can do the adaptive cutoff trick to discard bad results. In my case, since I don't implement scrolling of results, I also limit them to what fits in the window:
        # Retrieve as many results as we can show
        mset = enquire.get_mset(0, self.size - 1)
Finally, draw the results on screen:
        # Redraw the window
        self.win.clear()
        # Header
        self.win.addstr(0, 0, "%i results found." % mset.get_matches_estimated(), curses.A_BOLD)
        # Results
        for y, m in enumerate(mset):
            # /var/lib/apt-xapian-index/README tells us that the Xapian document data
            # is the package name.
            name = m[xapian.MSET_DOCUMENT].get_data()
            # Get the package record out of the Apt cache, so we can retrieve the short
            # description
            pkg = cache[name]
            # Print the match, together with the short description
            self.win.addstr(y+1, 0, "%i%% %s - %s" % (m[xapian.MSET_PERCENT], name, pkg.summary))
        self.win.refresh()
That's it, try it out. You can use the wsvn interface to get to the full source code and the module it uses. You can see a similar technique working in goplay, where it is also integrated with an interactive tag filter.

Christian Perrier: RWC: 2nd surprise en 1/4 finals

...and I like that one, as one may expect. With only 30% ball possession, France won against New Zealand. They transformed the very few occasions to score tries and finally, thanks to a magic inspiration by Fred Michalak, relayed by Yannick Jauzion, their last try made them win 20-18. The french defense was....close to heroic (179 tackles, whiles NZ tackled 36 times!), particularly at the end of the match, where the NZ bulldozer was trying to score one very last try. Not everything was perfect in this match (particularly a disaster in line-outs: I have never been fond of Rafael Ibanez, but it seems to be time for him to retire...), and only the courage made them win. I really wish I could have been in Cardiff to celebrate this. Champagne... So, rendez-vous to our English friends next week-end, in Stade de France. Given their match today, that will be though, again. Tomorrow, South-Africa-Fiji (yet another suprise?) and Argentina-Scotland. Eh, why not France-Argentina as final?

Christian Perrier: RWC: RSA-TON, or why I love rugby

If you hadn't the occasion to see RSA-TON, just look around for it, find if it is broadcasted at a later time and watch it. The Tonga team just had 10 minutes of weakness, with South-Africa scoring three tries. But they never gave up, scored two tries and finally ended up 25-30, winning the defensive bonus point and really worrying South-Africa. For sure, the repeated failures of RSA on penalties also helped for this scenario, but Tonga became the stars of this pool and Finau Maka is the star of Tonga..:-) The Bollaert stadium in Lens is more used to the fights of the local soccer team than high level rugby but they supported the Tonga team the very same way they support the "Sang et Or". I think that the Tonga players will remember that one. England can *really* worry.

Christian Perrier: RWC: why did France lose...

...at least, in my opinion (which is obviously biased, let's admit that). There are several reasons for this loss: Some *bad* reasons for the English victory:

Christian Perrier: No institutional pro-corp bias in French NPO (afaik)

MJ, each French NPO is free to establish its own regulation rules, which may include a differential voting system if they want to. That should of course respect the French law (for instance, no discrimination based on sex, religion or any other genetic factor) but, as far as I know, nothing prevents deciding that "personnes morales" (ie non physical people) have a higher or lower vote than others. However, this is certainly not common, but many NPO simply don't have non physical members anyway (some don't authorize non physical people to be members). For those who care, Debian France (which is a NPO, but not regulated by 1901 law, but by the special NPO law for Alsace and Lorraine, inherited from the 1810-1918 years) admits physical and "moral" members with an equal voting right. The only special case is a rule that allows Debian developers to have a veto right on any decision of the organisation. See that official regulation rules of Debian France for details (French only). PS: Debian France is currently inactive, due to a longstanding dispute with the French Tax collecting organisation (Direction des Imp ts) who initially refused to consider us as a non profit organisation...because "we sell an operating system" (doh!).

Christian Perrier: See you in BLR

The talks I proposed for FOSS.in, the major FLOSS conference in India, have been accepted for the Project Days, in the Debian-Ubuntu sessions. Thanks to the event organizers who will sponsor my travel to Bangalore, I'll probably leave as of Sunday Dec. 2nd and attend the entire conference from Dec. 4th to Dec. 8th. During earlier weeks, Sam Hocevar, the Debian Project Leader, also agreed to come to the conference and give two talks there. And, this morning, I had the nice surprise to discover that Lucas Nussbaum, one of our most tireless QA animators in Debian, will also come and give a talk about QA in Debian. So, that should make three French DD attending and, therefore, bring a strong Debian representation in this conference, which is something I definitely find interesting as I invested quite a lot of time and energy last years to increase the Debian presence in South Asia. This will certainly be a great occasion for us to give credit to the few people who contribute to Debian (and related projects) in India, and of course meet them in person. Please check the list of talks to get an idea of talks. Now for the challenge: the organizers expect our slides....by 7 days as of now. I don't know for Sam and Lucas but I have just begun working on one of my two talks (the i18n one, of course...you know: the one with the cute maps....). Would someone have a ready "How to contribute to Debian" talk somewhere? :-)

Christian Perrier: RWC: Deceptive Samoa-Tonga, France logically back

Sunday's matches featured three interesting games. We didn't watch much of Fidji-Canada because it was scheduled at 14:00 but announced at 21:00 on the schedule I had..:-(.. That's too bad because these two teams are the only two I haven't seen during an entire game yet. Fidji won after being menaced by Canada up to the last minute. So Fidji keep their chances of qualifying, which they'll have to win by beating Wales. Samoa-Tonga (15-19) was very promizing and turned out to be a deception for me. We watched only the first half of it (Eurosport wasn't broadcasting it live... suckers!). The suspense was there, particularly at the end of the game, when Tonga were playing only with 13 players for five minutes, while leading by 4 points only. However, Samoa obviously played quite badly and never really succeeded during that match to push their very physical way to play rugby. Tonga keep their chances to qualify, which they'll have to defend against England. France-Namibia was the last match and was obviously eagerly awaited by most of my fellow French supporters. Seen as "the match of revival" (as if losing to Argentina was a shame....), this was indeed a mor ethan easy match, as one would expected. Anyway, France played it well and played it the way it had to be played, so even if 87-10 doesn't really mean anything (particularly when playing against 14 players most of the time), they used all the strength of the team to build that victory and I believe there are still many strength in the French team. Critical rendez-vous against Ireland on Friday. Today (Monday): no match. Tomorrow, only one (Scotland-Romania in Murrayfield: critical match for the Scots). Everybody, us included, is resting.:)

Next.

Previous.