Search Results: "spa"

4 July 2008

Daniel Burrows: CWidget tutoral 1: 'Hello, world!'

Late last year, I spent some time disentangling aptitude's internal UI library and packaging it as a separate library, which I named cwidget. This article is the first in what will hopefully become a series describing the basic concepts and APIs of cwidget. It applies to the versions of cwidget currently available in Debian sid and lenny, 0.5.11-1 and 0.5.12-1. Autogenerated documentation of cwidget can be found here (but beware that as of this writing it is somewhat incomplete).
In this tutorial, I will walk through a simple program (hello.cc) that initializes cwidget, displays a simple message box, and then terminates the program when the user confirms the message. I assume a basic familiarity with C++. Screenshot of the 'Hello, World' program The first thing to do is to include the portions of cwidget that our program will use. Most importantly, we need the top level cwidget routines. These are the global routines that initialize cwidget, shut it down, and control its main loop (among other things).
#include <cwidget/toplevel.h>
cwidget comes with a collection of stock dialog boxes for things like displaying messages to the user. To access the routines that build these dialogs, we write:
#include <cwidget/dialogs.h>
All the symbols provided by the cwidget library are in the cwidget namespace. Using the full library name means that there's a reasonable chance that its names will not conflict with the names provided by other libraries; however, it's a real pain to type cwidget over and over. Since this is the only namespaced library we are using in this program, it's handy to define cw as an alias for cwidget:
namespace cw = cwidget;
Now we're ready to write the main routine. The first interaction of client code with the cwidget library is to initialize it. This will initialize the ncurses library and put the terminal into a mode suitable for a full-screen curses program.
cw::toplevel::init();
Next, we create a dialog box that will be displayed to the user. There are two things to note about this code:
  1. cwidget is Unicode-aware and the ok() routine expects the message string to be a wide-character string. In this case, that means that we need to pass in a wide-character string (indicated by typing L in front of the string).
  2. The second argument tells cwidget what to do when the ok button is pressed. The expression
      sigc::ptr_fun(cw::toplevel::exitmain);
    
    creates a slot using libsigc++. Briefly, a slot is a reference to a function or to a method of a class instance. When invoked, this particular slot will call cwidget::toplevel::exitmain(), which causes the main cwidget loop to exit. The slot is wrapped in cwidget::util::arg, a utility function that handles passing slots as optional arguments.
cw::widgets::widget_ref dialog =
    cw::dialogs::ok(L"Hello, world!",
                    cw::util::arg(sigc::ptr_fun(cw::toplevel::exitmain)));
Now that we have a widget, the next step is to arrange for it to appear on the terminal. In cwidget, control of the terminal is assigned to a single top-level widget: whatever it displays is what gets displayed on the terminal, and all user input is passed directly to it. In a real program this widget will typically manage a collection of sub-widgets and assign each one a screen region, but for now let's just display the dialog box we created:
cw::toplevel::settoplevel(dialog);
With everything initialized, we're ready to start the main loop. mainloop() will keep the display up-to-date and dispatch incoming events (for instance, keystrokes and mouse presses) until exitmain() is invoked.
cw::toplevel::mainloop();
When the user presses Enter or clicks on the Ok button in the dialog, exitmain() will be invoked by the binding that we set up earlier. Once this happens, we need to shut down cwidget in order to restore the terminal to its original state. If you skip this step, the terminal will be garbled and will not work properly when your program exits.
cw::toplevel::shutdown();
And that's it! To compile the program, change to the directory containing hello.cc and run:
$ g++ -o hello hello.cc $(pkg-config --cflags --libs cwidget)
Of course, you'll need to have the g++ and libcwidget-dev packages installed for this to work!

Jordi Mallach: Marc Belzunces' conscience objection fight

Yesterday, my friend Marc had to visit a court in Barcelona, after being accussed for an electoral penalty. Marc has always had a strong Catalan sentiment, and fights for the independence of his country from the French and Spanish states in as many ways he finds convenient. In this direction, he's been involved in countless activities promoting independence, in the Internet and in the streets. For now, he has to deal with living in the Spanish state, and recently this became a legal problem. Spain held parlamentary elections in March, and Marc was appointed to serve at one of the polling stations in Barcelona. Believing he had nothing to do with an election process to elect the Spanish parliament, he conciously refused to take his seat during that Sunday, infringing the Spanish electoral law. He presented his allegations to the officer, and refused to declare anything else. He now faces a fine ranging from 180 to 1800 or community work (which he would, again, object to perform). The officer told him that he's apparently the first Catalan to object like this, so what will happen next (besides he'll have to sit in court and see how it goes) is unprecedented. While Marc and I don't share many of our political views, I admire his dedication and his solid defence of his ideals. If I had been called to serve in a polling station last March, I would most probably have had my own personal debate on what to do, but suspect I would have ended going there to avoid creating these kind of situations, and would have had to participate in a process that I consider broken, unfair and undemocratic. I admire and support Marc for being stubborn enough to get this far. His case has had quite some echo in the Catalan blogsphere and some Catalan media like VilaWeb. Some people have started a campaign to collect money to help Marc pay the fine. The response so far has been surprisingly positive. Marc, molta sort i una abra ada!

Andrew Pollock: [life] It's official: I am married to the crazy cat lady

We currently have fifteen cats in the house. Only three of them are ours. When Sarah was contracting at Google, she started an informal, but company-endorsed trap/neuter/release program, because the basement of buildings 40-43 had a bit of a stray/feral cat infestation. Since she left Google, she's continued doing trappings on an on and off basis. She got a call a couple of days ago about a litter of kittens behind one of the other buildings, so she headed off last night with one of her crazy cat lady friends, and they proceeded to catch one of the kittens. She brought that home, and I went back with her, and the mother, which seems fairly feral, had been caught in a trap. The rest of the kittens seemed to have managed to secrete themselves away inside a generator behind the building. This morning, with some help from various facilities types, she managed to extract the other four kittens from the generator. So that put the mother plus five kittens in the spare room (in a large cage). At more or less the same time, Sarah got news of a litter of six kittens that need rescuing from down Gilroy way (some woman in a trailer park didn't seem to realise that boy cat + girl cat = kittens), so after grabbing the other four kittens this morning, she headed off to Gilroy to grab them. So the current plan is to get the mother cat of what we'll call the Google litter desexed on Tuesday and then release her back where she came from. Her five kittens are young enough (~8 weeks) that they can be socialised and won't be feral. The six Gilroy kittens are from non-feral parents, and are about 11 weeks old. All of the kittens are old enough to be desexed as well, but Sarah can't get them into Palo Alto Animal Services for desexing for a couple of weeks, so I suspect we're stuck with them in the interim, unless Sarah can find foster homes for them. To cap it off, we're going to Sacramento for the weekend, so we have to get one of our friends in the complex to take care of them all. The sad thing is the Gilroy Six seem to be in worse condition than the Google Five. They've got pretty poor coats, and seem to have some diarrhoea. Hopefully with a better diet they'll pick up. They're all very cute. The first one of the Google Five that Sarah caught last night is particularly cute. I expect Sarah will get some photos of them all up soon. If anyone is in the Bay Area is interested in a kitten, we've got them by the near-dozen.

3 July 2008

Antti-Juhani Kaijanaho: SF encyclopedic wiki?

I sometime wish I had access to an encyclopedia, written in wiki style so that it could be updated by anybody, that had an article about every SF story and novel ever written, and every fictional concept (like ansible, hyperspace etc) ever used in an SF story, and which crosslinked these in a useful manner. Often, once I’ve had a worldbuilding idea, I want to go read some of the key stories that use the same or a similar idea, so that I could see what others have already done with the idea. Only it turns out there are no indexes that tell me “antigravity has been used in these ways in SF stories, and it is a central concept in these stories” etc. Anybody know of something like this?

Christine Spang: Summer Conferences

The usual suspects apply: too expensive for me especially without a guarantee of sponsorship, etc. Maybe next year! It turns out that due to a weird collision of circumstances I am going to GUADEC, however. I will probably be doing more Istanbul-exploring than talk-attending, but I will certainly be around for evening socialization. I am also currently in Cambridge, UK, and will be here until mid-August. This is the summer of last-minute plans, apparently.

Biella Coleman: On Anthropology, Participant Observation, and Non-Places

When you are in a foreign city, Dakar, Tunis, Tokyo, the spaces and sights are disorienting for they unfamiliar. But there are a few spots (hotels, supermarkets), that bring you back the familiar and these places have been theorized by French Anthropologist Marc Auge as non-spaces. Here is a ...

Reinhard Tartler: ffmpeg-uploaded

Finally ffmpeg version 0.svn20080206-9 was uploaded to unstable and is currently waiting to get out of NEW . Special thanks go out to Fabian Greffrath, for testing, reviewing and pushing me, to L oc Minier, for his thoughts on the package renaming and handling of potential unstripped replacement packages and Darren Salt for his work on the debian/rules file. This upload is targeted lenny. Highlights of that upload include:
  • introduction of ffmpeg-doc 438369
  • build flavors (read more below)
  • renaming of the source package to ffmpeg-debian
  • DEB_BUILD_OPTIONS=noopt now compiles the package with -O0 (and works!)
  • ffmpeg-config has been removed. please port your packages to use pkg-config instead, cf. 487917 and 487922.
As for the build flavors: The debian/rules file was refactored so that flavors can easily be added. The flavors are architecture specific. All architectures support a static and a dynamic flavor. The following architectures support the following flavors:
  • i386: cmov (an i686 optimized flavor using the cmov instruction)
  • powerpc: altivec (requires G4 or better)
  • sparc: vis (uses v9 instructions)
If you are interested how we manage these build flavors, have a look at our debian/rules file. I remember that this was recently discussed on debian-devel at some point. Anyway, if you need/want additional flavors, please file wishlist bugs.

2 July 2008

Romain Francoise: Musings on the FriendFeed API

I use the FriendFeed API (launched in March) to build the blog widget mentioned in my previous post, and I'm rather disappointed to see that the data it exports is not the same as the data FriendFeed shows on my profile page (which is collected from the various services linked to my account). The Flickr service data in particular has two problems:Annoying. Now, I can't think of a good technical reason that would prevent FriendFeed from exporting my data properly over their API. Are they doing this for anti-competitive purposes? It's weird. I'm a big fan of data aggregation, but not if it's lossy like that!

Andrew Pollock: [tech] On microblogging

Now that Tim Connors has taken the lid off it, I feel I should opine on the matter. Microblogging is just not terribly exciting for the reader. I don't see the point in aggregating it. I don't particularly find Mikal's blatherings terribly exciting reading. I don't find Stewart's twitterings much fun either. I think Facebook's status updates are a better way to poll such things, myself, and it's where I confine my "microblogging" to. I think one of the things that used to make reading blogs more worthwhile than reading mailing lists was the high signal-to-noise ratio. Back in the day, there was a bit of a "cost" or barrier to entry for writing a blog post. For most blogs, it wasn't as easy as writing an email. I still hand-craft my blog posts in HTML, so for me to write something, I have to have enough inclination to fire up an editor and write the words. Often I run out of motivation half way through a blog post, and just end up scrapping it. I'm sitting on a few more lengthy posts that I haven't managed to summon up the energy to write at all yet. I think some of the "push-button publishing" out there is rapidly commoditising blogging, to the point where it becomes as easy or easier than writing an email. And we all know what happened to email... Blogging for me is essentially a journal. I like to use it to refer back to. To share what I'm doing with others. Occasionally it can be cathartic. Often it's a substitute for going to work and telling my co-workers about what crazy geeky thing I've done in my spare time. Mostly it's for me. The fact that I choose to share it with the world is not really a primary motivating factor for me, it just makes it more accessible for me, and sometimes helpful for others.

Russell Coker: LUV Meeting July 2008

At the last two meetings of LUV [1] I’ve given away old hardware. This month I gave away a bunch of old PCI and AGP video cards, a heap of PC power cables, and some magnets (which I received for free because they were in defective toys that could seriously injure or kill children). One new member was particularly happy that at the first meeting he attended he received some free hardware (I hope it works - most of that stuff hasn’t been tested for over a year and I expect that some would fail). Also there was another guy giving away hardware, so I might have started a trend of giving away unused hardware at meetings (he was giving away some new stuff in the original boxes, mostly USB and firewire cables). For a long time (many years) at LUV meetings there have been free text books given away. One member reviews books and then gives them away after he has read them. At the meeting Ralph Becket gave a presentation on the Mercury functional language. It was interesting to note that Mercury can give performance that is close to C (within 80%) on LZW compression (which is apparently used as a benchmark for comparing languages). Given the number of reasonably popular languages which don’t give nearly that level of performance I think that this is quite a good result. After the meeting Richard Keech demonstrated his electric car. It’s a Hyundai Getz which has had the engine replaced by an electric motor but which still uses the manual gearbox. Richard did a bit of driving around with various LUV members as passengers to demonstrate what the car can do. Unfortunately I didn’t get a chance to be involved in that, so I’ll have to do so next time I meet him. One thing to note is that Richard’s car was not built that way by Hyundai, it was a custom conversion job. The down-side to this of course is that it would have cost significantly more than a vehicle with the same technology that was manufactured. One design trade-off is that Richard had batteries installed in the place for a spare tire. Last year the RACV magazine published a letter I wrote suggesting that small cars should be designed without a spare tire and that owners of such cars should rely on the RACV to support them if they get a flat tire [2], my option has not changed in the last year, I still think that cars which are driven in urban areas don’t really need spare tires so I don’t think that Richard is losing anything in this regard. The motor driving Richard’s car runs on three-phase AC and a solid-state inverter is used to convert 185V DC to about the same voltage at three phase AC (I didn’t write notes so I’m running from memory). Apparently on long drives the inverter gets cooler rather than hotter - I had expected that there would be enough inefficiency in the process of converting DC to AC that it would get hot. In a previous conversation Richard told me that he can drive his car 75Km on one charge and that it takes him 8 hours to charge when using an Australian mains (240V) plug rated at 10A. When designing such a vehicle it would be trivial to make it use a 20A plug for a 4 hour charge or even a two-phase plug for even shorter charging (I’m sure that Richard could have requested these options if he wanted them). But an 8 hour charge allows the vehicle to be completely charged during a working day and the use of the most common type of plug (the type used in every home and office) means that it can be charged almost anywhere (the standard mains circuit used in Australia is rated at 15A so special wiring is needed for a 20A socket). There is such a power point mounted on the outside of my house not too far from where a visitor could park their car. I anticipate that in a few years time it will not be uncommon for people who visit me to charge their car during their visit. Richard’s ratio of an hour of charge to almost 10Km of driving means that someone who visits for dinner could get enough charge into their car to allow for 30Km of driving before they leave. 30Km is about the driving distance to go from my house to a location on the other side of the city that is just outside the main urban area, so probably at least half of Melbourne’s population lives within a 30Km driving distance from my house. Not that I expect friends to arrive at my house with their car battery almost flat, but it does make it easier to plan a journey if you know that at point A you will be able to get enough charge to get you to point B. I think it’s a good thing to have members of LUGs give things away to other people and to demonstrate technology that is of wide interest. I hope to see more of it.

Paul van Tilburg: Preparing for GUADEC

I am in the process of packing my stuff for my holidays. Tomorrow, I will fly to Istanbul to attend GUADEC 2008. Because GUADEC does not start before the 7th, it will give me some time to roam around Istanbul itself and do some sightseeing, probably with some of the Collabora guys. I’m flying on July 3 at 12:00 (+0200) from Schiphol with KLM (flight KL 1615) and arrive at Istanbul Atat rk International Airport at 16:20 (+0300). I’ll return on July 13 at 17:15 (+0300), again with KLM (flight KL 1616), and land on Schiphol at 19:55 (+0200). In Istanbul I will be staying in the Saint Sophia Hotel in Sultanahmet. I’m looking forward to it, although it doesn’t feel like holidays to me yet. I should have an Internet connection over there, and probably Jaiku via cell phone will work fine too. So I will keep you up-to-date. It is also clear that I will be skipping DebConf this year. This is unfortunate, because I wanted to work with the Debian/Ruby team to advance some of our goals. However, I’m happy to catch at least one free software conference.

1 July 2008

Axel Beckert: Conkeror in the Debian NEW queue

I already mentioned a few times in the blog that I’m working on a Debian package of the Conkeror web browser. And now, after a lot of fine-tuning (and I still further new ideas how to improve the package ;-) Conkeror is finally in the NEW queue and hopefully will hit unstable in a few days. (Update Thursday, 03-Jul-2008, 18:13 CEST: The package has been accepted by Jörg and should be included on most architectures in tonight’s updates.) Those who could hardly await it can fetch Conkeror .debs from http://noone.org/debian/. The conkeror package itself is a non-architecture specific package (but needs xulrunner-1.9 to be available), and its small C-written helper program spawn-process-helper is available as package conkeror-spawn-process-helper for i386, amd64, sparc, alpha, powerpc, kfreebsd-i386 and kfreebsd-amd64. There are no backported packages for Etch available, though, since I don’t know of anyone yet, who has successfully backported xulrunner-1.9 to Etch. Interestingly the interest in Conkeror seems to have risen in the Debian community independently of its Debian packaging. Luca Capello, who sponsored the upload of my Conkeror package, pointed me to two blog post on Planet Debian, written by people being fed up with Firefox 3 already and are looking for a more lean, but still Gecko based web browser: Decklin Foster is fed up with Firefox’ -eh- Iceweasel’s arrogance and MJ Ray is fed up with Firefox 3 and its SSL problems. Since my previously favourited Gecko based web browser Kazehakase never became really stable but instead became slow and leaking memory (and therefore not much better than Firefox 2), I can imagine that it’s no more an candidate for people seaking for a lean and fast web browser. Conkeror has some “strange” concepts of which the primary one is that it looks and feels like Emacs: Footnotes *) I just noticed that there is now also muttator, making Thunderbird look and behave like vim (and probably also mutt), too. Wonder into which e-mail client the Emacs community will convert Thunderbird. GNUS? RMAIL? VM? Wanderslust? What will it be called? Wunderbird? Thunderslust? (SCNRE ;-)

30 June 2008

Russell Coker: The History of MS

Jeff Bailey writes about the last 26 years of Microsoft [1]. He gives Microsoft credit for “saving us from the TRS 80″, however CP/M-86 was also an option for the OS on the IBM PC [2]. If MS hadn’t produced MS-DOS for a lower price then CP/M would have been used (in those days CP/M and MS-DOS had the same features and essentially the same design). He notes the use of the Terminate and Stay Resident (TSR) [3] programs. As far as I recall the TSR operation was undocumented and was discovered by disassembling DOS (something that the modern MS EULAs forbid). Intel designed the 8086 and 80286 CPUs to permit code written for an 8086 to run unchanged in “protected mode” on an 80286 (as noted in the Wikipedia page about the 80286 [4]). Basically all that you needed to do to write a DOS program with the potential of being run directly in protected mode (or easily ported) was to allocate memory by requesting it from the OS (not just assuming that every address above your heap was available to write on) and by addressing memory only by the segment register returned from the OS when allocating memory (IE not assuming that incrementing a segment register is equivalent to adding 16 to the offset). There were some programs written in such a manner which could run on both DOS and text-mode OS/2 (both 1.x and 2.x), I believe that such programs were linked differently. The term Fat Binary [5] is often used to refer to an executable which has binary code for multiple CPUs (EG PPC and M68K CPUs on the Macintosh), I believe that a similar concept was used for DOS / OS/2 programs but the main code of the application was shared. Also compilers which produce object code which doesn’t do nasty things could have their object code linked to run in protected mode. Some people produced a set of libraries that allowed linking Borland Turbo Pascal code to run as OS/2 16bit text-mode applications. The fact that OS/2 (the protected-mode preemptively multi-tasking DOS) didn’t succeed in the market was largely due to MS. I never used Windows/386 (a version of Windows 2.x) but used Windows 3.0 a lot. Windows 3.0 ran in three modes, “Real Mode” (8086), “Standard Mode” (80286), and “Enhanced Mode” (80386). Real Mode was used for 8086 and 8088 CPUs, for 80286 systems if you needed to run one DOS program (there was no memory for running more than one), and for creating or adjusting the swap-file size for an 80386 system (if your 80386 system didn’t have enough swap you had to shut everything down, start Real Mode, adjust the swap file, and then start it again in Enhanced Mode). Standard Mode was the best mode for running Windows programs (apart from the badly written ones which only ran on Real Mode), but due to the bad practices implemented by almost everyone who wrote DOS programs MS didn’t even try to run DOS programs in 286 protected mode and thus Standard Mode didn’t support DOS programs. Enhanced Mode allowed multitasking DOS programs but as hardly anyone had an 80386 class system at that time it didn’t get much use. It was just before the release of Windows 3.1 that I decided to never again use Windows unless I was paid to do so. I was at a MS presentation about Windows 3.1 and after the marketing stuff they had a technical Q/A session. The questions were generally about how to work around bugs in MS software (mainly Windows 3.0) and the MS people had a very detailed list of work-arounds. Someone asked “why don’t you just fix those bugs” and we were told “it’s easier to teach you how to work around them than to fix them“. I left the presentation before it finished, went straight home and deleted Windows from my computer. I am not going to use software written by people with such a poor attitude if given a choice. After that I ran the DOS multi-tasker DesqView [6] until OS/2 2.0 was released. Desqview allowed multitasking well written DOS programs in real mode, Quarterdeck was the first company to discover that almost 64K of address space could be used above the 1MB boundary from real-mode on a 80286 (a significant benefit when you were limited to 640K of RAM), as well as multitasking less well behaved DOS programs with more memory use on an 80386 or better CPU. OS/2 [7] 2.x was described as “A Better DOS than DOS, a Better Windows than Windows”. That claim seemed accurate to me. I could run DOS VM86 sessions under OS/2 which could do things that even Desqview couldn’t manage (such as having a non-graphical DOS session with 716K of base memory in one window and a graphical DOS session in another). I could also run combinations of Windows programs that could not run under MS Windows (such as badly written windows programs that needed Real Mode as well as programs that needed the amount of memory that only Standard or Enhanced mode could provide). Back to Bill Gates, I recently read a blog post Eight Years of Wrongness [5] which described how Steve Ballmer has failed MS stockholders by his poor management. It seems that he paid more attention to fighting Linux, implementing Digital Restrictions Management (DRM), and generally trying to avoid compatibility with other software than to actually making money. While this could be seen as a tribute to Bill Gates (Steve Ballmer couldn’t do the job as well), I think that Bill would have made the same mistakes for the same reasons. MS has always had a history of treating it’s customers as the enemy. Jeff suggests that we should learn from MS that the freedom to tinker is important as is access to our data. These are good points but another important point is that we need to develop software that does what users want and acts primarily in the best interests of the users. Overall I think that free software is quite well written in regard to acting on behalf of the users. The issue we have is in determining who the “user” is, whether it’s a developer, sys-admin, or someone who wants to just play games and do some word-processing.

Riku Voipio: Creating community friendly embedded systems

Netgear has jumped the bandwagon and released Open Source Wireless-G Router (WGR614L). Like the earlier Linksys WRT54GL, it's an existing model with a Linux "L" added to end. It does not really add any hardware to make it community friendly, the "open source" part feels like just a marketing gimmick.

With just a couple of small features, these devices could really become community friendly:



Not as necessary, but nice to have features for a community-oriented product:

Decklin Foster: Consolation Prize

I spent some time banging my head against SSL certificate stuff this weekend in the hopes of implementing a Really Awesome Solution to this awful Firefox security theater thing everyone was complaining about, but I didn't get anywhere. However, I noticed something interesting: Mozilla does not trust the CAcert root certificate. A number of useful sites, like Freedesktop.org's bug tracker, use a CAcert-signed certificate rather than a self-signed one. I really know nothing about this organization, but they seem to have their stuff together, and if you run a largish free software project, you could potentially save a lot of people the trouble of checking yet another self-signing CA. Around the lab, or in one of my tiny projects, I don't think I'd bother, but it is free. Anyway, we ship their root CA thing in Debian, and OpenSSL stuff picks it up fine. Mozilla's process is somewhat more mysterious. There's an apparently hardcoded list of the usual thugs from the Verisign/Thawte/etc protection racket, and then there's a database in each user profile for whack-a-mole stuff. There is not, shockingly enough, somewhere for an operating system to set system certificate policy. (I guess there is not much room for an operating system in the Mozilla world-view at all). So you have to shove it in there once for every user times every single profile. Here is the command to do it.
  1. apt-get install libnss3-tools
  2. certutil -d $HOME/.mozilla/firefox/$HLAGHLLAGHGAAHLGALHHGHLAGH.default -A -n 'CA Cert Signing Authority - Root CA' -t CT,C,C -i /etc/ssl/certs/root.pem
It's only slight pain relief, but it's something. You can also not install certutil, and click through ten million dialog boxes to import it, but screw that. UPDATE: A commenter points me to StartSSL, another service that may deserve a look here, and is on Mozilla's good side. It appears to be an unholy mix of things that sound awesome (client-side certs for OpenID, web-of-trust identification) and things that seriously skeeve me out (trademark symbols everywhere, Aladdin dongles). They, uh, also have a Linux distribution. No, really. UPDATE 2: James Andrewartha points out that we should eventually see Mozilla move this stuff out of libnssckbi.so and into SQLite, which sounds like a big win for us. Hopefully before that time I will figure out how to get sqlite(1) to work on my cookies.

Decklin Foster: You keep using that word. I do not think it means what you think it means.

I always feel like tar ought to say:
tar: data.tar.gz: inconceivable time stamp 1969-12-31 19:00:00
But it never does.

Russ Allbery: Git, Debian, and upstream

I'm in the process of converting all of my software repositories to Git, but to date I've only converted either Debian packaging repositories for software I don't personally maintain or repositories for software without a corresponding Debian package. But next on my list to tackle are pam-afs-session and pam-krb5, for which I'm both packager and upstream. Currently, the upstream development is in bzr and the Debian packaging is in svk. What I used to do, with Subversion, is keep the upstream development and Debian packaging in the same repository. I'd exclude debian/* when doing releases and then export it into an unpack of the release tarball to do Debian package builds. That worked great for me, but had some significant drawbacks: the Subversion repositories generally weren't public (I don't want to host upstream development on Alioth), and manual work is required to get the upstream tarball to use with the Debian package build. pristine-tar, which lets you commit a tarball to a Git repository in a space-efficient manner by basing it off of an upstream branch, is awesome. It's one of the best ideas in revision control since DVCSes. Debian package builds can be done using only the information in the repository without bloating the repository with huge binary blobs. And for upstream development, I can capture in the repository exactly what I released. However, for pristine-tar to work properly, I need to have a branch that represents the full release tarball, including the stuff that I don't want to normally track in the repository for regular development (generated files like configure that are created with make dist). I could let all that stuff be added with an xdelta, but I think that's ugly and won't be space-efficient. That means that when I combine Debian packaging and upstream development into one repository, I can't easily use the upstream development branch as the basis for the Debian packaging and pristine-tar, since it's missing all those generated files that are part of the tarball release. I could use two separate repositories, but that makes it harder to cherry-pick upstream commits and also requires that I have two separate directories for working on the same package, which I don't like. What I'm leaning towards doing at the moment is doing development on master, importing released tarballs into an upstream branch that shares no common commits with master, checking in the release tarballs under both the upstream release name and the Debian .orig.tar.gz name using pristine-tar based on the upstream branch, and branching a debian branch off of upstream instead of master. It's a little weird to have two separate lines of development that share no common ancestor but have the same files, but it's the solution that seems to work best for what I want and lets me store space-efficient tarballs and use git-buildpackage to do Debian builds without needing anything outside of the repository.

29 June 2008

Sune Vuorela: What I done this weekend

Ana guessed slightly wrong when trying to guess next update of kde4.1 in debian, but her howto still works. Give it a bit for the autobuliders to catch up though. But I guess I should find a rich uncle to give me newer hardware - my computer was only idle a few hours since friday evening. I do hope that plasma people soon reaches a stable ABI. And by the way:
I\'m going to akademy
Thanks to frisoftware.dk

Eddy Petri&#537;or: when printouts don't help to revoke a GPG key

It's official, I am revoking my gpg key because after my laptop returned from service[1] I realized is a bad idea to change the passphrase just before a long break away from a routine that would help the brain to cement the new passphrase. In other words, I forgot the passphrase.

So, let's get the revocation certificate printout and revoke that gpg and generate a new one. All is good and fine until you realize that I (capital i) and l (low case L ) look very much the same on paper. Oops!

So, what do you do? How many I/l -s are there in the certificate? Let's find out...


0 eddy@bounty ~/tmp/revoke $ cat template
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: A revocation certificate should follow

iEkEIBECAAkFAkbYOQUCHQIACgkQY8Chqv3NRNquGgCgxdMDrhycNcoJsaeeg7hk
8vVJZzsAnRicsfjcZnUtmLIsys6KK48FbJ4h
=I5o9
-----END PGP PUBLIC KEY BLOCK-----


Well, I'm not going to count, I'll remove the header and footer and see from there...

0 eddy@bounty ~/tmp/revoke $ cat template.in tr -d '[a-zA-HJ-Z0-9=]'
II
I
I


Ok, so we have 16 possible combinations, not that many.

0 eddy@bounty ~/tmp/revoke $ for i in l I ; do for j in l I ; do for k in l I ; do for l in l I ; do cat template.in sed -e "s#I#$i#" -e "s#I#$j#" -e "s#I#$k#" -e "s#I#$l#" > $i$j$k$l.mid ; done ; done ; done ; done
0 eddy@bounty ~/tmp/revoke $ md5sum *.mid
eab3a5e312bc0314ac2b3d4536bda2f6 IIII.mid
63a9dd10e381b8ff5c758ab3467a5c45 IIIl.mid
63a9dd10e381b8ff5c758ab3467a5c45 IIlI.mid
919d8494c9990c68f50bc9df61f269bc IIll.mid
63a9dd10e381b8ff5c758ab3467a5c45 IlII.mid
919d8494c9990c68f50bc9df61f269bc IlIl.mid
919d8494c9990c68f50bc9df61f269bc IllI.mid
919d8494c9990c68f50bc9df61f269bc Illl.mid
63a9dd10e381b8ff5c758ab3467a5c45 lIII.mid
919d8494c9990c68f50bc9df61f269bc lIIl.mid
919d8494c9990c68f50bc9df61f269bc lIlI.mid
919d8494c9990c68f50bc9df61f269bc lIll.mid
919d8494c9990c68f50bc9df61f269bc llII.mid
919d8494c9990c68f50bc9df61f269bc llIl.mid
919d8494c9990c68f50bc9df61f269bc lllI.mid
919d8494c9990c68f50bc9df61f269bc llll.mid


Oops, that's not ok... I guess I've been replacing some of the characters more than once.

Take 2:
0 eddy@bounty ~/tmp/revoke $ for i in l I ; do for j in l I ; do for k in l I ; do for l in l I ; do cat template.in tr 'Il' '-' sed -e "s#-#$i#" -e "s#-#$j#" -e "s#-#$k#" -e "s#-#$l#" > $i$j$k$l.mid ; done ; done ; done ; done
0 eddy@bounty ~/tmp/revoke $ md5sum *.mid
eab3a5e312bc0314ac2b3d4536bda2f6 IIII.mid
eab3a5e312bc0314ac2b3d4536bda2f6 IIIl.mid
eab3a5e312bc0314ac2b3d4536bda2f6 IIlI.mid
eab3a5e312bc0314ac2b3d4536bda2f6 IIll.mid
7150fa775c83c276223a30d373671333 IlII.mid
7150fa775c83c276223a30d373671333 IlIl.mid
7150fa775c83c276223a30d373671333 IllI.mid
7150fa775c83c276223a30d373671333 Illl.mid
63a9dd10e381b8ff5c758ab3467a5c45 lIII.mid
63a9dd10e381b8ff5c758ab3467a5c45 lIIl.mid
63a9dd10e381b8ff5c758ab3467a5c45 lIlI.mid
63a9dd10e381b8ff5c758ab3467a5c45 lIll.mid
919d8494c9990c68f50bc9df61f269bc llII.mid
919d8494c9990c68f50bc9df61f269bc llIl.mid
919d8494c9990c68f50bc9df61f269bc lllI.mid
919d8494c9990c68f50bc9df61f269bc llll.mid


Oops, that's not good either. Doh, sed works on lines.

Take 3:

Make a one line out of the template and try again:

0 eddy@bounty ~/tmp/revoke $ cat template.in
iEkEIBECAAkFAkbYOQUCHQIACgkQY8Chqv3NRNquGgCgxdMDrhycNcoJsaeeg7hk8vVJZzsAnRicsfjcZnUtmLIsys6KK48FbJ4h=I5o9

0 eddy@bounty ~/tmp/revoke $ for i in l I ; do for j in l I ; do for k in l I ; do for l in l I ; do cat template.in tr 'I' '-' tr 'l' '-' sed -e "s#-#$i#" -e "s#-#$j#" -e "s#-#$k#" -e "s#-#$l#" > $i$j$k$l.mid ; done ; done ; done ; done
0 eddy@bounty ~/tmp/revoke $ md5sum *.mid
66ab0a0bed219db8499debabb9a41c0b IIII.mid
e02c1751c4491ce5db1ebe9e64d8eadc IIIl.mid
c96a33f821d3fba84f655aa986084320 IIlI.mid
998c5c4219a5afdd77f82c9fc9818f6f IIll.mid
e08fe6c5380765d12c4f5e4090a7d9c6 IlII.mid
24241b58c231900b02ebb0410183983e IlIl.mid
72040a77e7cca9a91abf2bb0d51c00dd IllI.mid
a02e8645f3593f5c3549b49adef04bc2 Illl.mid
99a1a47c853ed760ef1f58cba7b75916 lIII.mid
c48bf75f30be46ec576a46a1d5664a93 lIIl.mid
717e9dfdc0d3fba973ba66ccb57d69dc lIlI.mid
3e9a2c937fd269d85c09b449b4da17de lIll.mid
4d283333d1d62086328dbc72425a645d llII.mid
542a7c00e99aad5137975581e57a92c9 llIl.mid
ef0e0a2daad7a933b620331a86455c23 lllI.mid
bdf852887308830475a506f8daad9624 llll.mid


That's better. Now let's put those lines back in place:

0 eddy@bounty ~/tmp/revoke $ for I in *.mid ; do cat $I sed -e 's#\(eeg7hk\)#\1-#' -e 's#\(K48FbJ4h\)#\1-#' tr '-' '\n' > $I.good ; done


And revoke that key...

0 eddy@bounty ~/tmp/revoke $ for I in *.mid.good ; do echo "$I:" && (cat header $I footer) > template && gpg --import -a template ; done
IIII.mid.good:
gpg: CRC error; 73689A - 239A3D
gpg: read_block: read error: invalid keyring
gpg: import from template' failed: invalid keyring
gpg: Total number processed: 0
IIIl.mid.good:
gpg: CRC error; 73689A - 979A3D
gpg: read_block: read error: invalid keyring
gpg: import from template' failed: invalid keyring
gpg: Total number processed: 0
IIlI.mid.good:
gpg: key FDCD44DA: "Eddy Petri or
" revocation certificate imported
gpg: Total number processed: 1
gpg: new key revocations: 1
gpg: public key 67D8E867 is 987014 seconds newer than the signature
gpg: public key 67D8E867 is 987014 seconds newer than the signature
gpg: public key 67D8E867 is 987029 seconds newer than the signature
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 2 signed: 139 trust: 0-, 0q, 0n, 0m, 0f, 2u
gpg: depth: 1 valid: 139 signed: 667 trust: 138-, 0q, 0n, 1m, 0f, 0u
gpg: next trustdb check due at 2008-10-09
IIll.mid.good:
gpg: CRC error; 239A3D - 979A3D
gpg: read_block: read error: invalid keyring
gpg: import from template' failed: invalid keyring
gpg: Total number processed: 0


Cool!


[1] I know is almost a half a year, but I've been busy and hoping

Steve Kemp: The problem with the English language is all those pesky words

There exist many bayasian/statistical spam filters, ranging from products such as spambayes, and spamassassin, to crm114. Each of them works in their own way. Having used and tested almost all of them I've noticed a common flaw. The vast majority of spam-filters struggle to correctly classify "419 scam" mails, lottery fraud, and similar mails. Why is that? In general, having read hundreds of these mails, I can see several things that are common in these kind of the mails: Whilst none of these individually are indicative of a scam mail it is interesting to count their combined occurance. I've written a toy program to count these things, and so far the success rate is >60% which is a reasonable start - providing this kind of detection occurs after normal filtering. I may experiment further, but I figured a public query on scam detection might be appropriate. Whilst the detecting a scam mail is a subset of detecting a spam email there are probably simplifications that may be made, and exploring those wouldn't be a bad thing. ObQuote: Buffy.

Next.

Previous.