Search Results: "xam"

2 January 2007

MJ Ray: Debian: Society

Another problematic meme is the idea that no-one need tolerate anyone - even those who are tolerant (known as the Rabid Right meme). When someone has no tolerance for others (for example, flaming people who expect any attempt at fairness, or who follow different social interaction patterns) then they have no place in a community such as Debian. They should clear off to some hard-hierarchy project - it's not like there's any shortage of Rabid Right hackers in this world. </sarcasm> For what it's worth, I believe life should be fair (idealism) and life is not fair (pragmatism). It is possible for those two beliefs to coexist. Expulsion could be fair, but (IIRC) every expulsion proposed so far would have been unfair and based on personal issues, rather than repeated offences: we may be reaching the point where a fair expulsion could happen. It seems a shame none of those who hold them are willing to use the smaller penalties in a Non-Discriminatory way. The "can't take their job away" meme seems more myth than meme, but it does need sorting out in the few places where it occurs. I doubt it will happen under this DPL.

1 January 2007

Marc 'Zugschlus' Haber: About bugs that have been filed a long time ago

I recently had an issue where a remote host would frequently run out of memory after a number of processes had been invoked from remote. I looked in the wrong direction first, but finally found out that each process invocation leaves two sshd processes hanging around, which are eventually exhausting the memory on the box. Next step was finding out what happened for the sshd processes not to properly terminate. Eventually, I remembered that the incoming ssh connections were not invoked directly, but via a third host with “proxycommand ssh other-host socket %h %p”. Looking on other-host quickly showed a number of socket processes being around, and killing them made the sshds on the low-memory host vanish as well. Short-term remedy was therefore to set ClientAliveInterval in the low-memory host’s sshd configuration. I then searched for reasons why ClientAliveInterval is not set by default at least in Debian’s sshd configuration. I didn’t find a reason and proceeded to file a wishlist bug request againnst openesh-server for this option to be set by default. Before filing this bug, I routinely visited the BTS, just to find out that the bug was already filed. By me. One year and 285 days ago. And that the openssh maintainer(s) didn’t even bother to reply to it yet. Guys, this is a textbook example how to discourage people from filing Bugs against your packages. Please, give them at least the appreciation of a short ACK if you don’t get around to fixing the bugs in reasonably short time. Having a bug rot away uncommented and unfixed in the BTS for two years is simpy not acceptable. Yes, that goes even for a wishlist bug.

31 December 2006

Russell Coker: memes that damage debian

The Debian project is afflicted with several damaging memes. One that is causing problems at the moment is the idea that life should be fair. Unfortunately life is inherently unfair, it's not fair that those of us who were born in first-world countries (the majority of Debian developers) have so many more opportunities than most people who are born in "developing" countries, and things just continue to be unfair as you go through life. Unfair things will happen to you, deal with it and do what is necessary to have a productive life!

When one developer has regular long-term disputes with many other developers the conclusion is that the one person who can't get along is at fault. We can debate about whether one or two significant disputes are a criteria for this or whether having a dozen developers disagreeing with them is the final point. But the fact is that if there is a large group of people who work together well and an individual who can't work with any of them then there is only one realistic option, the individual needs to go find some people that they can work with - they can resign or be expelled. The fact that something slightly unfair might have happened a year ago is no reason for pandering to an anti-social developer. The fact that expelling a developer for being anti-social is unfair to them is no reason for damaging the productivity of all Debian developers.

Another problemmatic meme is the idea that we have to tolerate everyone - even those who are intolerant (known as the Limp Liberal meme). When someone has no tolerance for others (EG being racist or practicing sexual discrimination) then they have no place in a community such as Debian. They need to be removed sooner rather than later. All Debian developers know the problems caused by deferring such expulsion.

The final damaging meme that I have observed is you can't force a volunteer to do any work. On it's own that statement is OK, but the interpretation commonly used in Debian is you can't take their job away from them either. The most common example of this is when a developer is not maintaining a package and someone else does an NMU (non-maintainer upload) to fix a bug, the developer then flames the person who did this (usually to fix a severe bug). It seems to be believed that a Debian developer owns their packages and has a right to prevent other people from working on them. This attitude also extends to all other aspects of Debian, there are many positions of responsibility in Debian that are not being adequately performed and for which volunteers are offering to help out but being refused.

The idea of the GPL is that when a program is not being developed adequately it can be taken over by another person. However when that program is in a Debian package the developer who owns it can refuse to allow this.

30 December 2006

Wouter Verhelst: f-spot vs digiKam

Since I have been having a digital camera since a few weeks now, I've had a need for an application to manage my pictures. The two applications that people have pointed me to are f-spot and digiKam, which also seem to be the most popular applications in this category for Linux. Since I use neither KDE nor GNOME as my user interface, it doesn't matter much to me which I install; so I've tried them both. Their feature set is quite different; unfortunately, though, they both have some features which the other doesn't, which makes choosing for one or the other rather hard. Since their on-disk format is rather different, it's impossible to use them both at the same time—at least not if I don't want to enter commentary and tags each and every time; so I'll have to choose one or the other based on their features. Since that requires me to actually compare them, I thought I might as well make a blog post out of that. Note, though, that this comparison is in no way intended to be complete; it only compares those features which I really care about. Features digiKam F-spot My opinion After having used f-spot for a few weeks before I tried digiKam, I have to be honest and say that I don't like the concept of albums. They do not add value; everything they allow you to express can equally well be expressed with tags. Additionally, one can categorize a picture in only one album, whereas it's possible to categorize pictures in as many tags as you would want. Just creating one album which contains all my pictures, with tagging used for categorizing, doesn't help either; that way, digiKam would store all my pictures in a single flat directory, which would become problematic when the number in the picture filenames wraps around. I do love the scoring thing in digiKam. A favourites tag just doesn't cut it; and creating five tags for scoring would make things like find all pictures that have a score of three or above rather cumbersome, and sort by score outright impossible. However, the fact that it's not possible to filter by score makes it all rather useless. The export to gallery function in digiKam is horrible. I have to select my pictures blindly; none of the metadata which I tack on them can be used to help select which pictures I want. Workaround: use whatever filtering is available to select the right pictures and add them to a temporary album from which I then upload all pictures, but that's silly (and requires disk space for no good reason). Additionally, there seems to be a bug in the interface, which means that I have to babysit an upload (with no workaround). And I can't even view my pictures to spend the time waiting. Bah. F-spot isn't without problems of its own. Due to a bug in mono, it crashes rather often on my PowerPC laptop. When that happens, it can't be restarted until the X server is restarted. Workaround: use Xnest, but that makes it impossible to view pictures in full-screen mode. Also, since f-spot is a GNOME application, its options dialog is as helpful as a pair of soccer shoes when you're out swimming. No surprises there. Conclusion Which one do I prefer? I'm not sure. The digiKam upload interface is positively annoying, especially the bug which requires me to click continue after every picture. For that alone, I might ditch it. On the other hand, it has a slew of interesting features (the scoring, to name one) that f-spot lacks, and that pull me more towards digiKam. I guess I'll have to give it a few days of thought. But hey, at least I know where I stand now.

27 December 2006

Lars Wirzenius: Random hacks: Notetak

I always spend my Christmas with my parents, and for the past few years, I've always started some new little hobby hacking project or another. Three years ago I started writing a new text editor, sex.py. I still use it, although I haven't had much time to improve it further. This year, I wanted to see if I could come up with a little something to jot down random little notes easier, to keep track of said notes, and to help me manage a GTD workflow better. Last summer, I started dabbling with the "Getting Things Done" method by David Allen. It's basically a way of keeping track of things that you need to do. A bit more sophisticated than a simple todo list, without getting seriously bureaucratic or tedious. So far, whenever I follow the method, it seems to be working, although I'm not sure if it is because of using this particular method, or because I'm a method at all. GTD requires keeping a few lists of things: todo items that can be done now (assuming suitable context, but with no unfilled dependencies), todo items that might be done some day, etc. The tool I chose for this last summer is Gjots2. It's a GUI outliner tool that works adequately, but is not smooth enough to prevent me from looking at better tools. One of the things missing from Gjots2 is a good search facility. You can't do things like "show me all items containing the words 'Debian' and 'upload'", for example. Some time ago, while browsing 43Folders, I learned about a small application for MacOS X, called Notational Velocity. I don't have a Mac, so I can't try it out myself, but it works by keeping track of small text-only notes, each with a title, and has a user interface geared at searching. Instead of having a tree or a list of notes, it has a title bar where you enter some words, and it shows you a list of the notes that match those words. You can then either select something from the list, or press Enter to create a new note, with the text you entered as a title. This sounded intriguiging to me, and I thought it might be interesting to experiment with it for my note taking and GTD needs. So I spent one night at my parent's writing a first approximation of a prototype. I'm calling it Notetak.
Notetak screen shot Notetak, first prototype. The drop-down menu shows the notes that contain the word "notetak", in upper or lower case.
I've today switched from Gjots2 to Notetak, and it's already clear that it's a completely different approach to things. So far I like it, but I'll have to experiment with this for a few days or weeks to see if it really works. I'm pretty sure the basic approach would benefit from having additional tags for notes, or possibly having stored searches. I keep finding myself searching for, say, "@next" a lot to get a list of GTD next actions. The source (and a preliminary .deb) is on my home page, in case you're interested. Please note (ahem) that this is highly experimental and may eat your data. I may abandon it at any moment, if I decide that it's not worth it, but if not, it might also change frequently. If you do use it, I'd be happy to receive any bug reports, suggestions for improvements, and patches you may come up with.

26 December 2006

Russell Coker: google reader

From a suggestion on my previous blog entry I decided to test out google reader.

The first problem was that it caused Konqueror to SEGV in etch, I filed a bug report and switched to Firefox.

Next to add my feeds I had to either export them in OPML format or add them one at a time, there is no support for pasting in a list of URLs. If I was writing a RSS syndication program I would also make it parse the config files of some of the common programs, parsing a Planet config file is pretty easy.

I added a feed for a friend who's server seems to be down. While doing so I tried to add another feed, the google reader accepted the command to add the second feed but didn't actually do so - it was fortunate that I was pasting it in not typing it...

The killer issue is that it seems to be impossible to merge feeds. I want to read both Planet Linux Australia and Planet Debian, there are some people who are on both planets (EG me). So it makes no sense to do anything other than display both of them in the same view.

At this time it seems that google reader is unsuitable for my use. However it is a fairly slick system and I imagine that it would work quite well for people who have different needs to me. If you want to read the blogs of a few friends then it probably works really well. It just seems not to work well for a set of meshed communities (Debian developers and Linux users in Australia for example).


Please let me know if I somehow missed some configuration options to make google reader do what I want.

David Nusinow: Document Writing And Programmer Tools

I love that one of the benefits to working on free software is that it exposes you to tools that you wouldn't normally be aware of. A prime example is software that you can use for writing documentation, like LaTeX and revision control systems. At work I've been writing up a fairly long document. Normally at work I'm forced to use OO.o or word because I have to trade the file back and forth with my boss, but this time since I'm doing all the actual writing, I've been using LaTeX and git to manage the thing. In addition, I need a bibliography and references, so I basically needed something like LaTeX. I send my boss an rtf (made with latex2rtf) and pdf (made with pdflatex) when I want comments, and I can still use the highly structured style of LaTeX to make sure that things like my lists get formatted properly every single time. Trying to do this in Word was both frustrating and time consuming.

The best part about the experience has been using revision control though. Having atomic changesets with a log message is something we tend to take for granted in free software work, but compare it to the change tracking in OO.o and Word. It's amazing how much easier it makes it. I can actually see what I was thinking a few days ago, which was the last time I had been revising the document. Being able to visualize the changes and history with tools like qgit are even nicer. And tags... I don't think OO.o or Word lets you tag specific revisions, but I know that when I do this with Word, I end up with a ton of documents labeled "DavidRev1" and so forth, and I always mess up the revisions by using "Save" instead of "Save As".

And this doesn't even touch on the things I haven't done yet. I haven't done any branching, for example. I'm sure that when I write my thesis, I'll end up using that, but just knowing that it's available is exciting. The thing I wish I could do most though is actually put the repo up somewhere and have me and my boss actually use it the same way a normal shared source code repository is used.

The standard sorry ending to this story is that getting these things in broad use is basically a pipe dream. It continually amazes me that people will put up with Word or Powerpoint when it's so often the wrong tool for the job. The simplest things, like being able to look at a document's history and the diff and know in a minute exactly what you were thinking when you put down your work a week ago, help so much. It's sad because the technology problem has been largely solved (a small GUI frontend would be the last piece), but the evangelism problem remains. One thing is for sure, I'm not looking forward to writing my next paper in Word.

25 December 2006

Stefano Zacchiroli: use filetype hooks luke

Xmas Vim tip: use ~/.vim/after/ftplugin/XXX.vim Jose Carlos posted some Python tips for vim. I haven't yet looked thoroughly at the code, but still here is my Xmas Vim tip:
Avoid putting filetype-specific customizations directly in your ~/.vimrc using au groups which rely on specific filename extensions. It's better to put filetype-specific customizations for the filetype XXX directly in the file ~/.vim/after/ftplugin/XXX.vim (in the example it would be ~/.vim/after/ftplugin/python.vim), this way they would be loaded even when you manually do "set ft=XXX" on a file with whatever extension.
For the interested reader the "after" path step is justified by the vim "runtimepath" we use in Debian (cfr. /usr/share/vim/vimcurrent/debian.vim). It ensures your customizations will be loaded after system-wide customizations so that they can be overridden. Oh-Oh-Oh, Merry Christmas.

Erich Schubert: On memory protection

Merry Christmas! I'm catching up with some RSS feeds, including the Linux Weekly News (LWN). This is a high-quality news site for Linux, and being issued just weekly is a nice feature for all those suffering from information overload. They had an interesting article some weeks ago on Virtual Machines and Memory Protection. If you are interested in system and application security, this is an interesting read. SELinux has permissions called "execmem" and "execstack". Basically these allow applications to map some memory executeable, or execute their own stack. Back in the assembler days, some techniques relied on this, but it has lately become frowned upon: most buffer overflow and other attacks used by viruses and worms relied on an executable stack or memory. Recently, Intel and AMD added support for "non-executable" bits for memory maps, i.e. hardware support to enforce these permissions; this was sold as an achievement in application security. Though this is mostly true - tons of attacks rely on this permission - it's not that easy. Modern programming languages such as Java and C# rely on so called Just-In-Time compilation for fast execution. (And future version of perl and python will probably do that, too.) And JIT requires executable memory, because it basically compiles the VMs bytecode into (optimized) machine code, and executes it. Now you could say: okay, let's just grant mono and java the execmem permission; (which is also what SELinux does) - and this will probably be okay unless there is some grave error in the mono or java runtime. Or any other native library they use. And this is where the problems start: both Mono and Java rely to a certain extend on native libraries. For example the GTK libraries for the UI. Mono applications can also use gstreamer, gnome-vfs, zlib, libpng, libjpeg, ... That means, security issues in these libraries that need execmem and would not work on native applications can suddenly be exploitable in mono and java apps. Since we can't do without execmem for Java and Mono: the executable bit for memory does add some extra layers, but doesn't give you full protection from this kind of attacks, sorry. No magic "my computer is no longer hackable because I have the NX bit".
With an NX Bit capable operating system such as Windows XP SP2, harmful viruses are stopped before it can cause any damage to the system.
... unless you're using .NET or Java applications.

Erich Schubert: On memory protection

Merry Christmas! I'm catching up with some RSS feeds, including the Linux Weekly News (LWN). This is a high-quality news site for Linux, and being issued just weekly is a nice feature for all those suffering from information overload. They had an interesting article some weeks ago on Virtual Machines and Memory Protection. If you are interested in system and application security, this is an interesting read. SELinux has permissions called "execmem" and "execstack". Basically these allow applications to map some memory executeable, or execute their own stack. Back in the assembler days, some techniques relied on this, but it has lately become frowned upon: most buffer overflow and other attacks used by viruses and worms relied on an executable stack or memory. Recently, Intel and AMD added support for "non-executable" bits for memory maps, i.e. hardware support to enforce these permissions; this was sold as an achievement in application security. Though this is mostly true - tons of attacks rely on this permission - it's not that easy. Modern programming languages such as Java and C# rely on so called Just-In-Time compilation for fast execution. (And future version of perl and python will probably do that, too.) And JIT requires executable memory, because it basically compiles the VMs bytecode into (optimized) machine code, and executes it. Now you could say: okay, let's just grant mono and java the execmem permission; (which is also what SELinux does) - and this will probably be okay unless there is some grave error in the mono or java runtime. Or any other native library they use. And this is where the problems start: both Mono and Java rely to a certain extend on native libraries. For example the GTK libraries for the UI. Mono applications can also use gstreamer, gnome-vfs, zlib, libpng, libjpeg, ... That means, security issues in these libraries that need execmem and would not work on native applications can suddenly be exploitable in mono and java apps. Since we can't do without execmem for Java and Mono: the executable bit for memory does add some extra layers, but doesn't give you full protection from this kind of attacks, sorry. No magic "my computer is no longer hackable because I have the NX bit".
With an NX Bit capable operating system such as Windows XP SP2, harmful viruses are stopped before it can cause any damage to the system.
... unless you're using .NET or Java applications.

24 December 2006

David Welton: Apples, Oranges, and Culture

Apples and Oranges A number of people wrote irate comments after my article about Ruby's eBay API beating PHP hands down. They complained that I was comparing apples to oranges, because the Ruby library I was using was nicely crafted, whereas the PHP one was some crufty crud that just happened to be one of the first things you find when you go to developer.ebay.com. First things first, let's look at some better PHP code:
require_once 'EbatNs/EbatNs_ServiceProxy.php';
require_once 'EbatNs/EbatNs_Logger.php';
require_once 'EbatNs/GetItemRequestType.php';
require_once 'EbatNs/ItemType.php';
$session = new EbatNs_Session('config/amd.ebay.config.php');
$cs = new EbatNs_ServiceProxy($session);
$cs->setHandler('ItemType', 'handleItem');
$req = new GetItemRequestType();
$req->setItemID(5652664344);
$req->setDetailLevel($Facet_DetailLevelCodeType->ReturnAll);
$res = $cs->GetItem($req);
echo "<pre>";
if ($res->getAck() != $Facet_AckCodeType->Success)  
echo "we got a failure<br>";
foreach ($res->getErrors() as $error)
 
    echo "#" . $error->getErrorCode() . " " .
    htmlentities($error->getShortMessage()) . "/" .
    htmlentities($error->getLongMessage()) . "<br>";
 
  else  
//#type $item ItemType
$item = $res->getItem();
echo "ShippingTerms : " . $item->getShippingTerms() . "<br>";
print_r($item);
 
versus our Ruby code:
require 'rubygems'
require 'ebay'
include Ebay
include Ebay::Types
require 'localconfig'
ebay = Ebay::Api.new
begin
  response = ebay.get_item(:item_id => '110011765264')
  puts "ShippingTerms : # response.items.shipping_terms "
rescue Ebay::RequestError => e
  e.errors.each do  error 
    puts error.long_message
  end
end
So, they get closer with that, but the Ruby code is still clearer and more concise. If you look around at some PHP5 based examples, they start to be decent as well. As one tutorial writes:
These components combine to create a kick-ass tool that PHP 4 can't replicate without lots of work, if at all.
Leaving aside the fact that a lot of people are still more or less stuck on 4, I think there is something more important to be learned. Culture There are a lot of really smart people who work with, and on PHP. As much as anyone grumbles about any language, it's not easy to create one, let alone create one and make it as popular as PHP. However, as I've said elsewhere, one of the things that made PHP so successful was its ability to "scale down". Part of its value is that it made it much easier for more people with less advanced skills to create things. That is, without doubt, a very fine accomplishment, but it does bring some baggage with it. Namely, that there are a great deal of PHP programmers who do not write very nice looking code. Going back to the eBay example, the code featured on their site is not very tasteful, if you ask me. My bet is that in Ruby-land, that sort of code would not be displayed very prominently. Why? It's not the computer, it's the culture that has grown up around the different languages. Computers do not care one bit about programming languages. They interpret bits and bytes, whatever language is used, so it's really all the same to them. Programming languages matter only to people, because they are the tool we use to comunicate our instructions to machines. This means that they are a very human thing in some ways, and that human aspects of them matter a great deal. What this means is that it's important not only to design a cool language, but to create a good culture around it. To take aim at something nearer and dearer to me than PHP, one of the major failings of the Tk toolkit was that there was little to no attempt to create a good design culture around it. Anyone who was using Linux 10 years ago will surely remember some of the truly horrible things that were created with Tk. Why? Tcl and Tk made creating a GUI an order of magnitude easier than with C and Motif (or whatever windows used at the time), and turned them loose with no instructions or idea whatsoever of how to go about creating a good, intuitive user friendly one - the Tk docs themselves make little to no mention of usability, and even the best Tcl/Tk books pay almost no attention, even in the form of recommended reading, to what to make with this beautiful tool whose hows are explained very well. The unixy community also wasn't exactly a wellspring of creativity and critique in terms of good guis, either. So, yes, I know that it's possible to write good, clever, readable PHP (or Perl, or FORTRAN) code, and bad Ruby (or Tcl, or Python, or whatever) code. However, I'm also convinced that culture counts. People who value clean, beautiful code gravitate to cultures, and, where possible, workplaces where they find other like-minded people. Others, not having as many options, find themselves staring at 13000-line PHP files that grow malignantly by dint of cut and paste, wondering how to tame that which others have wrought!

Erich Schubert: Website meta langauges

Zack asked for website meta languages for redoing his homepage. Well, I redid my homepage last february, using XML and XSLT. A monster XSLT stylesheet, because I wanted to keep my template outside of the stylesheet. I can not recommend XSLT. Using it for templating is quite messy. XSLT is okay if you want to transform one representation of the data to another; it's not if you want to add a lot of surrounding markup and things like a sitemap and similar navigation tools. This is next to impossible in pure XSLT, it gets better once you have some extensions (dubbed EXSLT, and supported by pretty much any xslt processor) or maybe with XSLT2. String manipulation is also a pain (at least with XSLT1); I gave up on generating a nice "last modified" date from my subversion tag. Supposedly XSLT2 has some functions that could make this easier (i.e. for parsing and printing datetime information), but the common approach with XSLT is to only supply the required minimum of function you need, and I'm not aware of an easy way to add custom functions, not to mention any large standard library that can efficiently be used (which is the true strength of Java, Python and C#, that they bring a huge collection of pre-written ready-to-use code with them). Of course there are some efforts to write XSLT libraries (especially for XSLT2), and this aforementioned EXSLT is some kind of standard library that even might be efficiently implemented in some interpreters - you can't rely on it to be there and to just work. XSLT isn't useless, but when it comes to presenting data to humans or writing clean, compact code it's not satisfactory at all. I'd give you my Makefile and XSLT file, if they weren't that messy... too many features; I'm generating two languages, a partially expanded navigation menu, etc. - my XSLT is 10k, my sitemap currently 4.5k, the template file is 5k. Anyway. Half a year ago, my favourite templating language was KID templating. I used it for some small projects such as my DNSoupdate tool to edit DNS zones via the DNS protocol (requires a nameserver such as bind which has support for DNS update, uses encryption). It was a perfect match for such tiny pages, but I'm no longer that convinced I still like it for larger projects. What's good about Kid: XML templating language, Python based, easy to use in whichever way you want by writing a few lines of python (i.e. easy to write a Makefile to generate a static version of you homepage) What's not good about Kid: only works with a Python interpreter. I'd prefer to have a templating language that can be used from multiple languages. However the Kid syntax relies on Python, which is really bad. Also I'd prefer to have some component-render model for more complex websites. The current setup is IMHO okay if you have one default layout and one content layout; but if you have multiple components that could be combined differently on the pages, it gets too messy. With my turbogears experiments, Kid was also not very performant (but that might as well be Turbogears fault). Right now, I'd probably still go with Kid. But I've been having a look at JSP 2.1, and JSF / Facelets in particular. There are some things about facelets that I really like (for example, that they use a proper XML syntax, instead of this bastardized almost-XML that JSP usually (ab-)uses). There is also some stuff that I don't like (e.g. the massive overengineering of everything surrounding it), and I have no idea how easy it will be to generate static pages in a scripted fashion, i.e. using it without a real webserver. Or I might just write it all in python, which is a nice language for manipulating XML, usually. Please don't just send me an email with your favourite templating engine. Like zack, I'm only interested in XML-based templating engines, which does not apply to most templating solutions out there. Clearsilver for example is another bastardization of XML. I'm aware of TAL/METAL, and find them quite interesting, but they were also not having this kind of componentization that I'm usually thinking in. [Update: some people have pointed me to Genshi, which is mostly Kid compatible. However, it still has mostly the same problems, e.g. the templates being not reusable in other languages than python, and that certain constructs are a pain to do (e.g. the page_specific_css recipe with more than one css file). Others have pointed me to smarty, but it's string-based and doesn't ensure valid XML output. (Which is very useful for e.g. generating atom or rss output) For example this is probably valid in smarty: if 0 <b> /if </b> - allowing errors is bad. Oh, and smarty is PHP, which is broken by design, a no-go. The best match to my ideas so far is XML::Template (for Perl, Python, Ruby, PHP) which is pretty close to what I've been doing manually when not using a templating solution. I don't know yet how well it handles recursion - I need recursive templates for the navigation menu on my homepage.]

23 December 2006

Manoj Srivastava: Mail Filtering With CRM114: Part 1

The first step is to configure the CRM114 files, and these are now in pretty good shape as shipped with Debian. All that I needed to do was set a password, say that I'd use openssl base64 -d, and stick with the less verbose defaults (so no munging subjects, no saving all mail, no saving rejects, etc, since I have other mechanisms that do all that). The comments in the configuration files are plenty good enough. This part went off like a breeze; the results can be found here (most of the values are still the upstream default). The next step was to create new, empty .css files. I have noticed that creating more buckets makes crm114 perform better, so I go with larger than norm crm114 .css files. I have no idea if this is the right thing to do, but I make like Nike and just do it. At some point I'll ask on the crm114-general mailing list.
    % cssutil -b -r -S 4194000 spam.css
    % cssutil -b -r -S 4194000 nonspam.css

Now we have a blank slate; at this time the filter knows nothing, and is equally likely to call something Spam or non-Spam. We are now ready to learn. So, I girded my loins, and set about feeding my whole mail corpus to the filter:
 /usr/share/crm114/mailtrainer.crm               \
   --spam=/backup/classify/Done/Spam/           \
   --good=/backup/classify/Done/Ham/            \
   --repeat=100 --streak=35000                  \
         egrep -i '^ + train Excell Running'

And this failed spectacularly (see bug #399306). Faced with unexpected segment violations, and not being proficient in crm114's rather arcane syntax, I was forced to speculation: I assumed (as it turns out, incorrectly) that if if you throw too many changes at the crm114 database, things rapidly escalate out of control. I went o to postulate that as my mail corpus was gathered over a period of errors, the characteristic of Spam drifted over time, and what I consider Spam has also evolved. So, some parts of the early corpus are at variance with the more recent bits. Based on this assumption, I created a wrapper script which did what Clint has called training to exhaustion -- it iterated over the corpus several times, starting with a small and geometrically increasing chunk size. Given the premise I was working under, it does a good job of training crm114 on a localized window of Spam: it feeds chunks of the corpus to the trainer, with each successive chunk overlapping the previous and succeeding chunks, and ensuring that crm114 is happy at any given chunk of the corpus. Then it doubles the chunk size, and tries goes at it again. All very clever, and all pretty wrong. I also created another script to retrain crm114, which was less exhaustive than the previous one, but did incorporate any further drift in the nature of Spam. I no longer use these scripts; but I would like to record them for posterity as an indication of how far one can take an hypothesis. What it did to was have crm114 learn without segfaulting -- and show me that there was a problem in the corpus. I noticed that in some cases the trainer would find a pair of mail messages, classify them wrongly, and retrain and refute -- iteration after iteration, back and forth. I noticed this when I added the egrep filter above, and was not drowning in the needless chatter from the trainer. It turns out, I had very similar emails (sometimes, even the same email) in the Ham and the Spam corpus, and no wonder crm114 was throwing hissy fits. Having small chunks ensured that I had not too many such errors in any chunk;and crm114 did try to forget a mail differently classified in an older chunk and learn whatever this chunk was trying to teach it. The downside was that the count of the differences between ham nd Spam went down, and the similarities increased -- which meant that the filter was not as good at separating ham and Spam as it could have been. So my much vaunted mail corpus was far from clean -- over the years, I had misclassified mails, been wishy-washy and changed my mind about what was and was not Spam. I have a script that uses md5sums to find duplicate files in a directory, and found, to my horror, that there were scores of duplicates in the corpus. After eliminating outright duplicates, I started examining anything that showed up with an ER (error, refute) tag in the trainer output; on the second iteration of the training script these were likely to be misclassification. I spent days examining my corpus and cleaning it out; and was gratified to see the ratio of differences to similarities between ham and Spam css files climb from a shade under 3 to around 7.35. Next post we'll talk about lessons learned about training, and how a nominal work flow of training on errors and training when classifiers disagree can be set up.

Enrico Zini: amis-character-list

Character list for the Amis language We mapped the available glyphs and accents for the Amis language. The letters in alphabetical order:
    a c d f n  h i k l m n o p r s t u w y
Everyone of them can get an acute, grave or circumflex accent on top. Literally on top: i would get the dot PLUS the accent on top. The only exception is for the letter n , which gets the dot on top of the g replaced by the accents. Some accent combinations are missing in Unicode, like accented d, f, h and k, and i with dot and accents. So we need an extension of Unicode. Then we need an input method that would insert n instead of g and allow to type all the accent combinations. Here is the full character set:
    a              
    c       ?      
    d       ?  ?  ?
    f       ?  ?  ?
    n       ? n  n  [1]
    h       ?  ?   
    i       ?  ?  ? [2]
    k       ?     ?
    l       ?     ?
    m       ?     ?
    n             ?
    o              
    p       ?     ?
    r       ?     ?
    s       ?      
    t       ?  ?  ?
    u              
    w              
    y              
[1] the gliph for 'n ' is actually missing, because it needs to be a single character: since it is a letter, backspace and delete need to erase all of it in a single shot. [2] missing because of the accent on top of the dot. Question marks mark where a character is currently missing in Unicode. We have a problem because Unicode would not want anymore latin accent combinations, so we will need to use character combinations and hope that fonts and applications display them well. This raises the issue that hitting delete or backspace on a character built using combining accents would delete only half of it. For consistency of interaction, it can make sense to use combining accents for all the combinations, even if an accented letter does exist in Unicode. This would avoid backspace and delete to have different behaviors, for example, on s-grave and s-acute. The accents are not taken into account when sorting. Uppercase letters are not used.

21 December 2006

Erich Schubert: On military usage of FLOSS.

Sergey raised the issue of restricting use of software to non-military use, and Alan pointed out how much they've given back to the FLOSS community. However, I'd like to point out that any such restriction violates rules for opensource used by both the FSF and Debian. Debian is pretty clear about it in the social contract:
No Discrimination Against Fields of Endeavor

The license must not restrict anyone from making use of the program in a specific field of endeavor. For example, it may not restrict the program from being used in a business, or from being used for genetic research.
And in the GNU Free Software Definition:
The freedom to run the program, for any purpose (freedom 0).
So any such restriction would mean your software is no longer free software. It's not that I'm in any way pro military, but allowing usage restrictions will cause a huge mess. Next we'll have some application which may not be used by religious zealots (of any kind), paedophiles, and at some point end up with a huge licensing mess (maybe even full of discrimination). ("No, I can't sell you a web server, because your brother-in-law is in the military."?) Actually disallowing any military use is some kind of discrimination, too. Military is not only used to kill someone, but it can serve humanitarian purposes, too. Rescue people in flooded New Orleans etc. - if you are unhappy with what your government is using your military for, vote accordingly and do politics. It's fine if you as the author point out that you disapprove of any use of it to harm anybody, or commit crimes; but don't put up restrictions you couldn't verify anyway. (As if the military would care much for any such restriction, anyway.) Always remember: it's only the good guys playing by the rules. There is no use in disallowing use of some software for cracking, is there?

20 December 2006

Clint Adams: Horses never die enough

Wouter, there are many parallels between Vancouver and dunc-tank. For example:
  • Both were the result of small groups of people deciding that they were better than the rest of us, and therefore, by conspiring and plotting in secret, they could make an enormous mistake into a good idea.
  • Both were met with hostility and opposition when the peasants were told what the landed gentry had planned for them.
  • In both cases, the backers continued to press on even in the face of widespread disillusionment and loss of morale.
  • In both cases, apologists insisted that, because the eventual result changed from its original conception, there was clear evidence of conciliatory nature and a willingness to compromise.
  • Both are enormous mistakes.
  • The supporters are unlikely to learn from either endeavor.
  • The supporters are even less likely to admit that they exercised poor judgment.
I could go on, but insects are gnawing on my legs.

19 December 2006

Manoj Srivastava: Mail Filtering With CRM114: Introduction

I have a fairly sophisticated Spam filtering mechanism setup, using MIMeDefang for SMTP level rejection of Spam, grey-listing for mails not obviously ham or Spam, and using both crm114 and spamassassin for discrimination, since they compensate for each other when one of them can't tell what it is looking at. People have often asked me to write up the details of my setup, and the support infrastructure, and I have decided to oblige. What follows is a series of blog posts detailing how I set about redoing my crm114 setup, with enough detail that interested parties can tag along. I noticed that the new crm114 packages have a new facility called mailtrainer, which can be used to setup initial css database files. I liked the fact that it can run over the training data several times, it can keep back portions of the training data as a control group, and you can tell it to keep on going until it gets a certain number of mails discriminated correctly. This is cool, since I have a corpus of about 15K Spam and 16K ham messages, mostly stored on my previous train-on-error practice (whenever crm114 classified a message incorrectly, I train it, and store all training emails). I train whenever crm114 and spamassassin disagree with each other. This would also be a good time to switch from crm114's mailfilter to the new mailreaver, which is the new, 3rd Generation mail filter script for crm114. It is easier to maintain, and since it flags mails for which it is unsure, and you ought to train all such mails anyway, it learns faster. Also, since the new packages come with a brand new discrimination algorithms which are supposed to be as accurate but also faster, but may store data in incompatible ways, I figured that it might be time to redo my CRM mail filter from the ground up. The default now is "osb unique microgroom". This change requires me to empty out the css files. I also decided to change my learning scripts to not send command via email to a 'testcrm' user, instead, now I train the filter using a command line mode. Apart from saving mails incorrectly classified into folders ham and junk (Spam was already taken), I have a script that grabs and saves mails which are classified differently by crm114 and spamassassin from my incoming mail spool and saves it into a grey.mbox file, which I can manually separate out into ham and junk. Then I have a processing script, that takes the ham and junk folders and trains spamassassin, or crm114, or both; and stashes the training files away into my cached corpus for the future. In subsequent blog postings, I'll walk people through how I setup and initialized my filter, and provide examples of the scripts I used, along with various and sundry missteps and lessons learned and all.

Sven Mueller: IP addresses

Wouter and Russel: Wouter is right that 0.0.0.0 (or 0 in short) is not an alias to 127.0.0.1 (aka localhost). There are interesting things about specifying IP addresses though. As Matt said in a comment to Russel’s entry, 0.0.0.0 can be shortened to just 0. That’s right and also, 127.0.0.1 can be shortened to 127.1 with any software which implements parsing of IP addresses correctly. Actually, 2130706433 (127*256 +0*256 +0*256+1) would be an alternate alias to 127.0.0.1. A different example would be http://1426782553/ or http://85.719193/, which should take you to my blog at http://blog.incase.de/ (at IP:85.10.249.89) - Except that my Apache doesn’t seem to be able to handle the request with that hostname.
Update: a working example is http://1208933736/ or http://72.974184/ which takes you to google.

18 December 2006

Lucas Nussbaum: Features vs. Freedom

Jono Bacon wrote a long blog entry on Planet Ubuntu about his vision of freedom, and how it applies to the proprietary drivers. This is a good opportunity to write sthing I wanted to write for a long time. Ubuntu’s bug #1 is “Microsoft has a majority market share“. Well, I think that this should be of severity minor or wishlist, not critical. A better bug #1 would be “our priority is our users” (does it ring a bell ?). I find it far more important to improve the satisfaction of people already using a Linux distribution, than to try to convince others to use it. Most users of Windows have very good reasons for using Windows, like proprietary applications that have no equivalent in the Free Software world. I don’t think that “Linux doesn’t have a 3D desktop” is the major blocker for people not using Linux. Windows doesn’t have a 3D desktop. Many Mac OS X users don’t use the 3D features. I haven’t felt the slightest need to try a 3D desktop, and I’m using GNOME/metacity, so the jump wouldn’t so hard to make to compiz. I’m not saying that a 3D desktop is not a good idea. Of course, it would be nice to have LiveCDs that just work and start a 3D desktop, so we could show off at conferences. But I haven’t even bothered to google for such LiveCDs. Sometimes, proprietary drivers are more needed on Linux, for example for people who bought a Wifi card without checking first if it was supported. But I don’t think that 3D graphic drivers are that important. I still hope that Ubuntu will not ship proprietary software by default, and that Ubuntu will try to help the free drivers instead. Update: I forgot to close the comments when publishing this entry. They are closed now, but trackbacks are open if you want to write your own blog about this (I don’t think it’s necessary, all arguments have been reharsed many times already. Ah, and for the records, the free ati driver works perfectly fine and fast (using MergedFB) in my dual-screen setup (2560*1024), with xv on both monitors.

Manoj Srivastava: I am now an Ikiwiki user!

Ikiwiki
Well, this is first post. I have managed to migrate my blog over to Ikiwiki, including all the historical posts. The reasons for migration was that development on my older blogging mechanism, Blosxom, entered a hiatus, though recently it has been revived on sourceforge. I like the fact that IkiWiki is based on a revision control system, and that I know the author pretty darned well :-). One of my primary requirements for the migration was that I be able to replicate all the functionality of my existing Blog, and this included the look and feel (which I do happen to like, despite wincing I see from some visitors to my pages) of my blog. This meant replicating the page template and CSS from my blog. I immediately ran into problems: for example, my CSS markup for my blogs was based on being able to markup components of the date of the entry (day, day of week, month, etc) and achieve fancy effects; and there was no easy way to use preexisting functionality of IkiWiki to present the information to the page template. Thus was born the varioki plugin; which attempts to provide a means to add variables for use in ikiwiki templates, based on variables set by the user in the ikiwiki configuration file. This is fairly powerful, allowing for uses like:
    varioki =>  
      'motto'    => '"Manoj\'s musings"',
      'toplvl'   => 'sub  return $page eq "index" ',
      'date'     => 'sub   return POSIX::strftime("%d", gmtime((stat(srcfile($pagesources $page )))[9]));  '
      'arrayvar' => '[0, 1, 2, 3]',
      'hashvar'  => ' 1, 1, 2, 2 '
     ,

The next major stumbling block was archive browsing for older postings; Blosxom has a nice calendar plugin that uses a calendar interface to let the user navigate to older blog postings. Since I really liked the way this looks, I set about scratching this itch as well; and now ikiwiki has attained parity vis. a vis. calendar plugins with Blosxom. The calendar plugin, and the archive index pages, led me start thinking about the physical layout of the blog entries on the file system. Since the tagging mechanism used in ikiwiki does not depend on the location in the file system (an improvement over my Blosxom system), I could layout the blog postings in a more logical fashion. I ended up taking Roland Mas' advice and arranging for the blog postings to be created in files like:
 blog/year/month/date/simple_title.mdwn

The archives contain annual and monthly indices, and the calendar front end provides links to recent postings and to recent monthly indices. So, a few additions to the arch hook scripts, and perhaps an script to automatically create the directory structure for new posts, and to automatically create annual and monthly indices as needed, and I'll have a low threshold of effort blogging work flow for blog entries, and I might manage to blog more often than the two blog postings I have had all through the year so far.

Next.

Previous.