Search Results: "ron"

26 September 2009

Pablo Lorenzzoni: Ruby versus Python

This is not another rant to praise one in spite of the other (an everybody knows I love Ruby, so it would not be impartial), but sometimes people seems to live in another world and do things for the wrong reasons. I just read this blog post by Kanwei Li in which he gives 2 or 3 reasons he ditched Ruby in favor of Python. First of all, both are great languages and, although I favor Ruby, I use Python for some projects and they are not all that different. Of course, everyone is free to choose which language one favors, but Kanwei seems to be ditching Ruby out of not knowing much about it, or out of preferring one style over the other His first reason is that in Python white spaces matter. I used to think this is just a matter of style, but every now and then mandatory alignment hurts me (just try to put together a code generator and you ll notice it). Although my code is always correctly aligned, I like that it s done so because I want it that way, and not because some language demands it. Rants and more rants have been written about Python s mandatory alignment (or other languages lack of it), and I am not going through all of it Just I don t think it s a good reason to ditch Ruby After, he makes a big deal out of Ruby s ternary if. As written by him, he prefers

#python
if len(a) > 0:
        v = a[0]
        a = a[1:]
else:
        v = None
over Ruby s ternary if

#ruby
v = a.empty? ? a.shift : nil
Hey! Come on Ruby s ternary if is not mandatory It was copied from C just as a syntax sugar. You can do without it, just as in Python:

#ruby
if ! a.empty?
    v = a.shift
else
    v = nil
end
Better yet! you can use if s return as v value:

#ruby
v = if ! a.empty?
    a.shift
else
    nil
end
How beautiful is that! Python lacked ternary if for a long time, and when it finally acquired one via PEP 308 its syntax was made different from every other language! Although I don t think that is a problem, some people might think it would be better not reinventing the wheel. Next, Kanwei goes over a famous problem of Ruby: the lack of a sum method for Array. I admit it s strange, but that is completely coherent: Ruby s Arrays are ordered collection of objects and not mathematical arrays. How do you sum objects that are not numbers? Many different people will have many different answers to that, so Ruby leaves this decision for the programmer and provides basic methods to deal with collections of anything (that can be used to apply sum to numbers, if wished). So, in Ruby you have to use Array#inject to perform a sum:

[1,2,3].inject(0)    sum, value  sum + value  
Array#inject (actually Enumerable#inject) was borrowed from Smalltalk and allows you to loop through an array, building up an accumulator value as you go. When it s done, the final value of this accumulator is returned. Very useful for combining array elements, whether by summing them, building up a pretty display string, whatever. In the example above, I am initializing the accumulator with 0. If you use Array to mathematical operations and you want your arrays to work that way, you can always add a sum method to Array class:

class Array
    def sum
        self.inject(0)  sum, value  sum + value 
    end
end
Maybe it would be better if you just use Arrays as containers (as it was intended to) and implement that sum inside your own class I completely agree with Reg Braithwaite here. Kanwei also mention Python is faster than Ruby. That is true, but was more true some time ago. First of all, Python is older and has had more time to improve its speed. Ruby, ITOH, just now acquired a good VM and improvements to it finally can run parallel to improvements in the language itself, so I am expecting this to be less true every release. Python is already not getting much faster between releases, unlike Ruby (the differences between 1.8.7 and 1.9.1 are really impressive!). IMHO this is not a good reason to choose one instead of the other: if you really need speed, go for C :-) Now this is something I find interesting Kanwei has mentioned: Python is more production ready . He argues that Google is using it, so it must be good. Well I cannot argue against that: Google is really using Python. But IBM, Oracle, EA, Cisco, Siemens, etc are using Ruby so that is just a matter of preferring one or another company. Both are production ready I agree, though, that Ruby 1.9.1 has many differences from 1.8.7, and that that may be seen as some inconsistency, but Python also has changed a lot since its 2.0 version, for that matter. And the changes to Ruby brought many benefits I think they worth it. At last, Kanwei compares Python and Ruby docstrings. Here I also have to agree with him: Ruby docstrings sucks. Actually that s why everybody uses rdoc instead (and that is much more powerful than Python s docstrings). Again, I don t think that is reason enough to ditch Ruby (actually, the existence of rdoc, rubygems & friends should bring people to Ruby instead), but that is a matter of personal taste. Surely, Kanwei s reasons were easy to argue against. There are areas were Python shines much more than Ruby (and vice-versa), but those Kanwei mentioned are not among them. I think both languages are powerful enough, and both are way better than Perl or PHP, so either one you choose would be fine. Better if you don t have to choose and use both ;). If you have to, ITOH, pay more attention on how you feel while coding in each one, and not to some cheap reasons such as above. If you are a programmer, what matters most is that you ll spend a lot of time coding with any given language let that be something pleasant then.

25 September 2009

Julian Andres Klode: APT2: config parser testing


If you have an amd64 system, install the apt2 package from deb http://people.debian.org/~jak/debian/ unstable/ and run the apt2-config command. Make sure that the parser reports no errors, otherwise send me an email or leave a comment here. One known exception is that all values must be quoted in the configuration file, I have no plans to fix this (probably just deprecate unquoted strings in APT instead). The parser is not as strict as cupt s parser, but it gives you more help if something wents wrong. We also ignore most semicolons for now (they will be turned into warnings or errors later on). It is using GScanner from GLib for parsing the files. apt2-config replicates the functionality of apt-config. It currently do not read the configuration files in the correct order, so don t expect apt2-config dump to produce exactly the same output as apt-config dump . To build APT2 yourself, you need a patch for waf from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=548329. Posted in APT2

Jose Luis Rivas Contreras: Bug? Mispelled? What? Passing arguments on a bunch of scripts

I really have a complicated environment for building my packages that only I understand (and maybe no one should try to understand if wants to maintain mentally stable). So I was building with git-buildpackage that points to a script gbp-builder that builds with pdebuild and which got its debbuildopts with and I was passing more args with a local variable (EXOP) with and guess what. It was -v5.05-3+nmu1 and I got that argument OK on dpkg-genchanges for my source.changes but not to my i386.changes. I had to put in my gbp-builder script debbuildopts with and everything got OK. I frankly don t understand what happened, why the args passed until that point and not to the last dpkg-genchanges but hey! it works now! I hope nobody pass trough this and waste 2 hours finding what was wrong and it only were a pair of . BTW, now I m DD! Second in Venezuela :D

Michal Čihař: Enca 1.11

After month of collecting little fixes flying around, I release Enca 1.11. If you don't know Enca, it is an Extremely Naive Charset Analyser. It detects character set and encoding of text files and can also convert them to other encodings using either a built-in converter or external libraries and tools like libiconv, librecode, or cstocs. The full changes are short: You can download from http://dl.cihar.com/enca/.

Christine Spang: principle of most surprise

A python example in ipython:
In [1]: for i in range(10):
...:     print "i in loop:", i
...:
...:
i in loop: 0
i in loop: 1
i in loop: 2
i in loop: 3
i in loop: 4
i in loop: 5
i in loop: 6
i in loop: 7
i in loop: 8
i in loop: 9
In [2]: print "i out of loop:", i
i out of loop: 9
This bit me last night while writing some code for a digital communications lab assignment. I typed the wrong variable name, which was from an inner loop when I meant to use the element from the outer loop. Is there actually a sane reason for a loop variable not to go out of scope when the loop ends? Tell me there's a good reason for it. It took me completely by surprise.

Tiago Bortoletto Vaz: Irony


almost sleeping during a pathetic Microsoft s talk, so an email arrives: New Debian developer Tiago Bortoletto Vaz . Oh god! Couldn t this ticket be closed in a better moment? Of course not! :) ) Posted in english

24 September 2009

Christine Spang: FSF Women in Free Software Mini Summit

I was one of the participants invited to the FSF's Women in Free Software mini-summit which happened on the same day as Software Freedom Day this year. That was this past Saturday, September 19th. I was feeling hesitant going in, given the controversy over "why would the FSF run a closed event about such an important topic" and just a general burnt out feeling about the subject on my part. Honestly, I've tended to avoid being much of a feminist in the past and simply hope that people will stop bickering and leave me to my code, especially in the aftermath following well-publicised incidents. This is despite the fact that the thing that got me involved with free software originally was Debian Women, back in late 2004/early 2005. I needed a hook, and yet I haven't felt confident enough to reach out to others now that I'm in. I see now that there are valid reasons for having an event that is purposefully small. We all fit in a nice conference room at the FSF office, the atmosphere was very intimate, we got to learn everyone's names (and even remember them). I met some great local free software people who I hadn't met before. Food was take out from My Thai, an excellent vegan restaurant in Boston's Chinatown. While it sucks to be exclusive, in my opinion the small size really had an effect on what we got done and how we felt at the end. The official minutes from the meeting are online here, and there's a picture and brief blog post from Deborah here. The picture was taken using Cheese! I'm in the middle wearing my ever-popular Best Practical "my free software runs your company" t-shirt. There are only a few things I want to highlight myself.
  1. It was a great idea to invite someone who is involved in freedom movements but is not necessarily heavily involved in free software in particular. Hillary brought fresh insights and helped us draw parallels and come up with ideas that I don't think we would have thought of otherwise. It's easy to get used to parts of a community as being "normal" and I am so happy that we have allies who can show us where we've internalised or just have learned to ignore sexist parts of the community. Women in free software are already in free software and we need to learn to reach out to others who aren't in already.
  2. Cooperative power. There are groups of people that just aren't attracted by FOSS marketing that challenges you to "prove yourself the best" or similar. Just because someone doesn't like coding at 3am doesn't mean he doesn't like coding. If we want to succeed at our mission, we need to stop thinking win-lose and start thinking win-win. This applies to being more inclusive in general, not just for women. It also applies to valuing contributions from those who don't code. We need them too.
  3. There are times when I don't speak up and I should. There are times when I don't blog (or participate in discussions via other media) because I don't feel like dealing with potential community backlash. I am very careful about not stepping on peoples' toes, because I've seen other people get trampled on and am not particularly excited about experiencing that myself. While I'm trying to cultivate courage in myself, it was good to have a reminder that it's not just me.
The current plan is to hold a bigger event that is open to all in the spring. I am so excited about the momentum we are building! I think the biggest thing that I took out of this is that there are still things wrong with the community and that I shouldn't be afraid to speak up and be an activist. Watching people like Deborah and Hillary talk perfectly seriously about making very long-term plans and reaching parity was incredibly empowering. We can do so much better. The time to do it is now.

Matthew Garrett: Intel IGD opregion and GMA500

A while back, Intel defined a specification for binding ACPI-defined methods for controlling hardware to the OS-specific driver, ensuring that the two don't get out of synchronisation. I added support for this to the in-kernel i915 driver last year, and after a couple of awkwardnesses it works well now. One consequence of this that showed up slightly later is that it's necessary to do some of the setup from the i915 driver rather than the ACPI driver, which meant that we had to defer the ACPI driver from binding until the drm driver had done that setup.

The problem with GMA500 is that it also implements the IGD Opregion spec, and the ACPI video driver detects this and refuses to bind. But the GMA500 kernel driver doesn't implement support for the spec and so doesn't call the function that triggers the ACPI video registration. Working around this is simple - just add acpi_video_register() to the init function of the GMA500 drm. But note that this means that you're failing to implement the spec properly, and there's potential for stuff to be broken. A full implementation of the spec for GMA500 wouldn't be especially difficult, but there's no docs and I have no hardware so I'm not going to do it myself.

The reason I bring this up is that various people have been approaching this problem in a different way. It's easy to assume that the check in the acpi driver was naively assuming that all Intel hardware was driven by i915 and that this patch was broken. It's actually entirely correct and the (out of tree) GMA500 driver was broken. If Intel had made the effort to get their code properly upstream, it'd have been fixed there when the original change was made and nobody would ever have had a problem. Just say no to out of tree drivers.

Adrian von Bidder: IPSec: Hopelessly confused

Yes, this is a dear lazyweb... I'm more and more confused about IPSec on Linux. Has anybody done a more or less recent summary about IPSec and Linux? All I find is quite old and probably doesn't apply anymore... About the only thing I'm sure about is that FreeS/WAN is officially dead. But otherwise? Openswan vs. strongSWAN vs. KAME (or is that ipsec-tools?) And what about the kernel side? Are they now all using the same code or are there still patches? It would probably best if the hypothetical knowledgeable person would not comment here but insert a relevant notice at the top of http://wiki.debian.org/IPsec, to avoid having yet another obscure page (mine) show up in Google...

Biella Coleman: I Pity the Fool



I Pity the Fool, originally uploaded by the biella.
When I fly, I often do so with Continental Airlines because 1) I tend to like their international flights 2) they have many flights at convenient times to San Juan, PR where I head to around 4-6 times a year. Like most airlines, their food is nothing to be desired but their gluten free option is about some of the worst food I have ever tasted. The chicken is cooked to death but otherwise entirely buck naked. Like there is nothing on it, they throw some rice in the container, and sometimes (and only sometimes) a packet of Mrs. Dash. The best part of the meal, is a coconut macaroon. After about five years of this meal (usually putting it to the side but sometimes forgetting my food and suffering from hunger) I decided it was high time to take action; I could no longer confront the bleak reality of nude rubbery chicken. So I wrote them letter. I kept it brief and knew boring would not advance My Cause, so I just decided to add some rhetorical flourish and, naturally who else came to mind than the grand master of rhetorical flourish, Mr. T. After providing the basics, like describing the truly offensive nature of nude and rubbery chicken, I drove the nail deep into wood by stating : I pity the fool that has has to survive through their gluten free meal and that naked chicken sucked more than the word suck could ever really convey (though I did duly note my appreciation for the gluten free option and that I generally liked their service). After sending off the letter I forgot about it almost immediately nor did I fly with them again for many months (not because I boycotting, I just found cheaper flights). I recently flew to Puerto Rico and lo and behold have found the gluten free option has taken a drastic turn for the better. In fact, not only was the chicken no longer naked it was in fact, fully clothed, blackened chicken, spiced to no end. And the cherry on top was a gluten free blueberry muffin and some nice fruit. Go Continental. I will never know if my letter touched the soul of some Continental office employee, working in some nameless faceless, practically windowless office park, one whose life of labor is a bit like that gluten free chicken that I so despised, rubbery and naked, in other words with no flavour or spice. But I will forever think that a dash of spice, that with the aid of the badassery that is Mr. T, one can lightly kick corporate ass to take action.

Biella Coleman: I Pity the Fool



I Pity the Fool, originally uploaded by the biella.
When I fly, I often do so with Continental Airlines because 1) I tend to like their international flights 2) they have many flights at convenient times to San Juan, PR where I head to around 4-6 times a year. Like most airlines, their food is nothing to be desired but their gluten free option is about some of the worst food I have ever tasted. The chicken is cooked to death but otherwise entirely buck naked. Like there is nothing on it, they throw some rice in the container, and sometimes (and only sometimes) a packet of Mrs. Dash. The best part of the meal, is a coconut macaroon. After about five years of this meal (usually putting it to the side but sometimes forgetting my food and suffering from hunger) I decided it was high time to take action; I could no longer confront the bleak reality of nude rubbery chicken. So I wrote them letter. I kept it brief and knew boring would not advance My Cause, so I just decided to add some rhetorical flourish and, naturally who else came to mind than the grand master of rhetorical flourish, Mr. T. After providing the basics, like describing the truly offensive nature of nude and rubbery chicken, I drove the nail deep into wood by stating : I pity the fool that has has to survive through their gluten free meal and that naked chicken sucked more than the word suck could ever really convey (though I did duly note my appreciation for the gluten free option and that I generally liked their service). After sending off the letter I forgot about it almost immediately nor did I fly with them again for many months (not because I boycotting, I just found cheaper flights). I recently flew to Puerto Rico and lo and behold have found the gluten free option has taken a drastic turn for the better. In fact, not only was the chicken no longer naked it was in fact, fully clothed, blackened chicken, spiced to no end. And the cherry on top was a gluten free blueberry muffin and some nice fruit. Go Continental. I will never know if my letter touched the soul of some Continental office employee, working in some nameless faceless, practically windowless office park, one whose life of labor is a bit like that gluten free chicken that I so despised, rubbery and naked, in other words with no flavour or spice. But I will forever think that a dash of spice, that with the aid of the badassery that is Mr. T, one can lightly kick corporate ass to take action.

Daniel Stone: luis's t series

Luis, If you can still find the ThinkPad T43 around, it would seem to be a perfect fit for your needs. It's 1400x1050, has an ATI X300 SE in it (supported by Free drivers, including DRI), and the wireless is Centrino, which only has the firmware problem. The only thing wrong with it is that it's a behemoth both in size and weight compared to my dainty little X40, but I guess that's what you wanted if you were asking for T series recommendations.

While I'm here, you all get a bonus picture of the moon over the Baltic:
Low red moon over the Baltic sea

If you zoom in, you can see that it's roughly four picodegrees over the sea. Brilliant.

Paul Wise: Adobe CMap and AGLFN data now free software!

In March 2009 I contacted Adobe about the self-contradictory nature of the license for the Adobe Glyph List For New Fonts (AGLFN) data. I did so because one of the upstreams I am involved in (fonttools) embeds a copy of aglfn.txt and I noticed the license was a bit strange. An Adobe employee by the name of David Lemon replied to say that the license would become less free than it was. I then asked him to consider using a free software license for both the Adobe CMap and AGLFN data. We discussed the benefits and drawbacks of doing this for both Adobe and the free software community. David was initially skeptical about the balance between benefits and drawbacks for Adobe and I was feeling pessimistic about the situation. The conversation ended and several months passed, with me sending the occasional ping and David being busy. Then in June he told me a new license was coming in a month. So I sent another ping on September 20th to find out what the status of that was. A couple of days later I received a mail saying that the Adobe CMap data has now been released under the BSD license and that the Adobe AGLFN data will soon follow! Please note that while this means that modifications are technically allowed, they are still strongly discouraged for compatibility reasons. Adobe has assigned an emailable maintainer (currently Ken Lunde) for these files so there is no reason that modifications should not be done upstream. You can also edit the wiki to document things or post in the forum. If you happen to meet David, Ken or Dave McAllister (who manages the Open@Adobe program) somewhere, please thank them and offer beverages. So, what does this mean for free software projects? Debian CJK users will be able to read many more PDFs with CJK characters without using any non-free packages once the new CMap files reach main. I will need to package the new AGLFN data for Debian. I will need to remove the embedded AGLFN from fonttools upstream and adapt it to use the packaged one if available or suggest the user download it if not. GNU Classpath and the other software projects using AGLFN data might like to do the same. I may consider writing a library for loading the AGLFN data, mainly as an exercise in learning how to write a good library though. Oh, and perhaps I can convince (Kenshi MUTO) my minimal level of involvement in this is worth a beer if I ever meet him :D

22 September 2009

Zak B. Elep: 0x19

zakame++;
I have much to be thankful for reaching a quarter-century, so me and my family went to Naga city to give thanks to $DEITY and our patron (which just had its 300th year feast this weekend.) This past year saw me moving on from my old job, doing odd bits here and there, and letting me rediscover my interests. And to top it off, I found a new job. :-) I'm looking forward to what the next quarter-century brings to me, and what I could bring to it. I already have a few in the works ;) Thanks, $WORLD!

Robert Collins: Python unittest API : Time to fix it


So, for ages now I ve been saying that unittest is, at its core, pretty sound. I incited a talk to this effect. I have a vision; I dream of a python testing library that:
  1. Is in the python core
  2. Is simple
  3. Is extensible
  4. Has tests take care of testing
  5. Has results take care of reporting
  6. Aids communication from test to test reader
Hopefully those are pretty modest and agreeable things to want. However we don t have this: nose is lovely but not in the core [and is a moderately complex API]. py.test is also not in the core, and has previously tripped my too-much-magic alerts. I must admit to not having checked if this is fixed yet. unittest itself is in the core but has some cruft which we should clean up, but more importantly is not extensible enough, which leads to extensions such as the zope testrunner having to muddy the waters between testing and reporting. The point Aids communication from test to test reader is worth expanding on: automated testing is something that doesn t need observation until the unexpected happens. At that point some poor schmuck such as you or I ends up trying to guess what went wrong. The more data that we gather and communicate about the event, the greater the chance it can be corrected without needing a repeat run under a debugger, or worse, single stepping through the code. There is a problem with assertFoo methods in unittest, something that I m not going to cram into this blog post. I will say, if you find the tendency of such methods to crawl to the base class frustrating, that you should look at hamcrest it and similar things have been very successful in the Java unit testing world; we can learn from them. Going back to my vision, we need to make unittest more powerfully extensible to allow projects like nose to do all the cool things they want to while still being unittest compatible. I don t mean that nose can t run unittest tests; I mean that unittest can t run nose tests: nose has had to expand the contract, not simply add implementations that do more. To that end I have a number of bugs which I need to file. Solving them piecemeal will create a fractured API particularly if this is done over more than one release. So I am planning on prototyping in other projects, discussing like mad on the testing-in-python list, and when it all starts to come together writing up a PEP. The bugs I have are:
  1. streams nicely: countTestCases must die/be made optional. This function is inherently incompatible with generative tests or anything beyond the simplest lightweight environments
  2. no way to wrap code around a single test. This would permit profiling, debugging, tracing, and I m sure other things more cleanly. (At the moment, one must turn on the profiler in startTestCase, and turn it off in stopTestCase. This is much more awkward than simply being in the call stack). Some care will be needed here, particularly for generative tests.
  3. code that isn t part of the implementation in the core needs to be able to work with the reporting code; allowing an optionally wider API permits extensions to be debuggable. This needs thought: do we allow direct access to TestResults? Do we come up with some added level of indirection and events ? I don t know.
  4. More data than just the backtrace needs to be included when an outcome is reporter. I ve started a discussion on the testing in python list about this. I m proposing that we use a dict of named content objects, and use the HTTP content-type abstraction to make the content objects introspectable and reliably handleable without tying the unittest object protocol to any given wire format loose coupling is good!
  5. The way we signal outcomes between TestCase and TestResult the addFailure etc methods is concerning: there are many grades of outcome that users of the framework may usefully wish to represent; in fact there are more than we probably want to put in the core. Finding a way to decouple the intent of a particular outcome from how its signalled would allow users more control while still being able to use the core framework. One particular issue in this area is that its possible with the current API to have a single test object succeed multiple times. Or fail (addFailure) then succeed (addSuccess). This causes no end of confusion, as test counts can mismatch failure counts, and so on.
I ve got some ideas about these bugs, but I m approaching a kiloword already, and I hope this post has enough to provoke some serious thought about how we can fix these 5 bugs, compatibly, and end up with a significantly better unittest module. We ll have been sucessful if projects like Trial, nose and the zope testrunner are able to remove all their code that duplicates standard library functionality or otherwise worksaround these bugs, and can instead focus on adding the specific test support needed by their environments (in the Trial and zope cases), or on UI and plug-n-play (for nose).

Martin-Éric Racine: mailx implementation that won't barf on UTF-8 encoded GECOS information?

Dear Lazyweb, I've been having problems with cron jobs that mail their output, because they always manage to garble non-ASCII characters into some unreadable crap. Upon closer inspection, the real culprit seems to be mailx: no single mailx implementation out there seems to have come to terms with the fact that most contemporary operating systems have their GECOS information encoded in UTF-8, rather than in ASCII. I had very high hopes for the Heirloom implementation of mailx, except that it, too, fails at encoding mail headers in UTF-8. I'm thus wondering if there's anything I might have overlooked, perhaps a mailx setting that would enforce encoding of the From, To and Subject lines to UTF-8, or otherwise another mailx implementation that in fact does acknowledge the fact that most operating systems these days have their GECOS information encoded in UTF-8?

Uwe Hermann: Using CRM114 for spam filtering on Debian GNU/Linux

I've been using CRM114 as spam filter for a while now, and I'm quite happy with it. Due to bug #529720 though (incompatible upstream file format changes) I decided to start my setup from scratch with a recent CRM114 version from unstable. Here's a short HOWTO, hope it's useful for others. First you need to install crm114 and set up a few files in your $HOME directory.
  $ sudo apt-get install crm114
  $ mkdir ~/.crm114
  $ cd ~/.crm114
  $ cp /usr/share/doc/crm114/examples/mailfilter.cf.gz .
  $ gunzip mailfilter.cf.gz
  $ cp /usr/share/crm114/mailtrainer.crm .
  $ touch rewrites.mfp priolist.mfp
Edit ~/.crm114/mailfilter.cf and set the following variables (some are optional, but that's what I currently use):
  :spw: /mypassword/
  :add_verbose_stats: /no/
  :add_extra_stuff: /no/
  :rewrites_enabled: /no/
  :spam_flag_subject_string: //
  :unsure_flag_subject_string: //
  :log_to_allmail.txt: /no/
The :log_to_allmail.txt: /no/ option should probably stay at "yes" for the first few days until you have tested your setup and everything works OK. The ~/.crm114/allmail.txt file will contain all your mails, in case something goes wrong. Now set up empty spam and nonspam files like this:
  $ cssutil -b -r spam.css
  $ cssutil -b -r nonspam.css
Test the setup by invoking mailreaver.crm as follows, typing some test text and then pressing CTRL+d:
  $ /usr/share/crm114/mailreaver.crm -u ~/.crm114
  test
  [CTRL-d]
  ** ACCEPT: CRM114 PASS osb unique microgroom Matcher **
  CLASSIFY fails; success probability: 0.5000  pR: 0.0000
  Best match to file #0 (nonspam.css) prob: 0.5000  pR: 0.0000
  Total features in input file: 8
  #0 (nonspam.css): features: 1, hits: 0, prob: 5.00e-01, pR:   0.00
  #1 (spam.css): features: 1, hits: 0, prob: 5.00e-01, pR:   0.00
  X-CRM114-Version: 200904023-BlameSteveJobs ( TRE 0.7.6 (BSD) ) MF-35EB8B9A [pR: 0.0000]
  X-CRM114-CacheID: sfid-20090920_151224_574131_D290E589
  X-CRM114-Status: UNSURE (0.0000) This message is 'unsure'; please train it!
The output should look similar to the above. If there are errors instead, you should check your settings in ~/.crm114/mailfilter.cf. Now you have to setup a procmail rule for crm114:
  :0fw: crm114.lock
    /usr/share/crm114/mailreaver.crm -u /home/uwe/.crm114
  :0:
  * ^X-CRM114-Status: SPAM.*
  IN.spam-crm114
In my case this rule is also followed by a spamassassin rule, so all my mail goes through two different spam filters (will look into dspam and bogofilter also I guess, the more the better). Finally, in .muttrc I have the following configs so I can press SHIFT+x to mark a mail as spam, and SHIFT+h to mark it as non-spam (ham).
macro index X '  formail -I X-CRM114-Status -I X-CRM114-Action -I X-CRM114-Version   /usr/share/crm114/mailreaver.crm -u /home/uwe/.crm114/ --spam'
macro index H '  formail -I X-CRM114-Status -I X-CRM114-Action -I X-CRM114-Version   /usr/share/crm114/mailreaver.crm -u /home/uwe/.crm114/ --good'
macro pager X '  formail -I X-CRM114-Status -I X-CRM114-Action -I X-CRM114-Version   /usr/share/crm114/mailreaver.crm -u /home/uwe/.crm114/ --spam'
macro pager H '  formail -I X-CRM114-Status -I X-CRM114-Action -I X-CRM114-Version   /usr/share/crm114/mailreaver.crm -u /home/uwe/.crm114/ --good'
Important: crm114 is most effective if you start with empty CSS files (as shown above) and only train it by marking mails as spam/ham when it gets them wrong. The process will take a few hours or maybe a day (depending on how many mails per day you get), then the misclassification rate gets very low... Update 2009-09-23: Changed --spam/--nonspam to the correct options for mailreaver/mailtrainer, --spam/--good.

Fabio Tranchitella: Distro Summit 2010: Call for Papers

The Call for Papers for the Distro Summit 2010 is still open!

Distro Summit 2010 is a one-day technical conference with a strong focus on collaboration between Free Software distributions hosted at the linux.conf.au 2010.

We are looking for proposals from any Free Software distribution, from the typical full distributions (both linux and non-linux) to the niche market derivatives.

In spite of the strong focus on collaboration between Free Software distributions, topics may include packaging, maintenance, relationship with upstream developers, release management and QA.

To submit a proposal, or get more information, please write to cfp@distrosummit.org.

21 September 2009

Andrew Cater: Slowing down?

Trends are deceptive - but I haven't come back to this blogging in a while :)

I did my first Windows XP install for a while today for friends. Their machine had slowed to a crawl and _needed_ a disk format and reinstall. Three sets of media to find, three sets of 20 digit codes to type in. Printer software not found - so they'll have to go and download a huge program bundle from the manufacturer's site. [And it always takes an alleged 39 minutes from first reboot irrespective of the actual speed of the hardware :) ]

New hardware put in - a DVD writer to replace a CD writer which had lasted ten years and moved between at least two machines - that's spectacular in this day and age. The new drive is also 10% of the cost of the old one - 17 instead of about 200.

Total time to put on Windows XP, an AV product, get Firefox and to get part way through an Office 2007 install was about three hours. That's without setting up any accounts, shared directories (or network - the attached wireless router didn't need any changes).

I could do a Debian install onto the 40G disk in well under half that to include X windows, openoffice.org, iceweasel and a desktop environment. It would also run far better in 512M which is what this machine has.

Thankfully, they have data backups and an older laptop which has been the family workhorse - and a new netbook which attached to the network readily, has more disk than all other machines in the house combined, and cost less today than the "big machine" cost ten years ago at about 3 x the performance.

Intelligent questions were asked about Linux - I _wish_ I'd known about Ken Starks' radio advert or had it to hand at the time. See the Blog of Helios at http://linuxlock.blogspot.com for details - it's Free/Libre/Open Source under a CC Atttribute Share-alike 3.0 licence, and is available in a short version used in the radio advertisement .ogg or .mp3 or the longer version (.ogg .mp3 All in all, a balanced and a reasoned argument for switching based on nearly everybody's real life experience :(

[UPDATE] - The owner of the machine was up until 1 a.m - 11 hours total - because the machine decided to do a defrag. :(

20 September 2009

Stefano Zacchiroli: gdebi needs you

please help out with gdebi - a history of why Short summary: if you are looking for a way to help Debian become a bit more user friendly, please take care of gdebi in Debian. I'm rather upset. So beware, rant ahead. The reason dates back to the beginning of this afternoon, when a friend of mine, GNU/Linux newbie, mailed me asking for help with his brand new (to my astonishment) Debian Lenny installation running the GNOME desktop environment. The request was simple and common to a lot of our users: "how can I see videos on YouTube and use Skype"? Surely, the first (brief) explanation I gave was why those pieces of software are not in Debian, because they are pieces of evil proprietary software. Fair enough, usual song and dance, that gets the message through. But than, given that I personally care about releasing a completely free operating system, but not necessarily in inhibiting the usage of any non-free bits of software, I wanted to actually solve my friend's problem. Regarding flashplugin-nonfree, unfortunately it is not in Lenny. Two solutions to that: either point him to http://www.backports.org and explain how to use them from synaptic (not particularly hard). Or give him a direct download link of the .deb coming from backports.org. It turns out that for Skype there is no such choice. Once there used to be an APT-gettable repository for their debs, but it seems to have vanished (or else I can't find it). Still, there is a page from which you can download Lenny .debs. Given that for Skype the choice is forced, I was tempted to simply reply to him with a couple of link to .debs and solve his problem rather easily. But wait. Once he has the two debs, how can he install them? First attempt: "just click on them in Nautilus" (my hope: "synaptic will do the right thing ). No way, it will fire up file-roller. Second attempt: "install gdebi (using synaptic), right-click on the deb, and choose ;open with gdebi'". Seems to work, but no, you will be hit by bug #493352. (BTW, the reason why you need the right click is bug #421096). What makes me upset is that both bugs were there way before the Lenny release and slipped through our QA knots. Nobody's fault, the maintainer apparently lost interest (or time) package and stopped caring about it. Happens all the time. But damn!, we will lose a user the moment I tell him "you know, you need to open up a root terminal". A few remarks: this rant is not about "we should invite user to use non-free software"; it is not even about "we should be more attractive to newbies"; it is just about the pity of losing users like this, dumbly. Concluding:
  1. dear lazyweb, any idea of what can I suggest to my friend to install the debs I'll point him to, without needing the knowledge of a terminal?
  2. gdebi in Ubuntu is ahead of lots of version wrt Debian, I'm convinced that it fixes most outstanding issues (given that upstream author is a Canonical employee). If you have some free Debian-time slots (I currently don't) and you care about newbie-accessibility, please consider helping out with gdebi. He needs you.
EOR (end of rant)

Next.

Previous.