Older blog entries for arauzo (starting at number 5)

Today I've detected and reported a bug in GIMP.

Also I have been preparing a simple form for people to reserve a seat in a free bus from Granada to the Open Source World Conference. And trying to cope with the many intermediates we have between the trip organizer and our LUG.

4 Feb 2004 (updated 4 Feb 2004 at 20:09 UTC) »
Efficiency of Python vs. C++

Obviously I am not going to give the final answer to such a question like which one is faster. It depends on what you are programming and their requisites, and if you need maximun speed you may need to use C++, C or even assembler. But I want to share with you my little experiment.

I wrote a small C++ library for handling tables of data of diverse types. I did it aiming to clarity and usability, and so I used many inheritance and virtual methods. I recognize efficiency was not my priority.

Then I needed to convert ascii files of tabbed data with different formats to mine. I needed to write too much code in C++ (and I wanted to learn python I must confess) so I wrote a python script to do that (with a Gtk interface thanks to lgs).

Fascinated by the simplicity of Python code (as I told you on 29th) I decided to wrote in Python a feature selection algorithm I had previously wrote in C++. Today I have decided to test their speed and these are the results:

  1. Python: 29 minutes
  2. C++: 33 minutes

Well, it is not a very scientific experiment, and I cheated C++ because it is loading the table 32 times (it takes just a few seconds). But, hey! I expected C++ to win by large.

Good (coding is simpler now) and bad news (it took long time to wrote C++ lib) for me. But definitely a BIG surprise!

3 Feb 2004 (updated 3 Feb 2004 at 07:36 UTC) »

I am a bit upset with media saying that we, the free software advocates, are creating viruses (MyDoom). There is no doubt someone want us to be seen like dangerous terrorists.

SCO, and all companies that try to make money by sueing other companies instead of really producing things, have many enemies. Why don't they say that the IBM workers are developing viruses? Will it be because IBM can take actions against being defamed? Should we take legal actions against the media defaming us?

The virus had probably been created by a person or two. Why blaming an entire community for that?

If I known the person who created MyDoom I would state him/her clearly that s/he is making much harm to free software, that s/he is supporting ms war on free software just like terrorists are supporting George W. Bush antidemocratic politics.

Rarely a free software supporter may want to do that...

Yesterday I finished reading "Stupid white men ... and other sorry excuses for the state of the nation!" by Michael Moore. Great book.

29 Jan 2004 (updated 3 Feb 2004 at 07:05 UTC) »

I did this code a few weeks ago, but I still fascinated the simple and clean it looks in python with iterators:

 
def powerset(set):
  for size in range(len(set)+1):
    for subset in powersetOfSize(set, size):
      yield subset

def powersetOfSize(set, size): if size > 1: for i in range(len(set) - (size-1)): for subset in powersetOfSize(set[i+1:], size-1): yield [set[i]] + subset elif size == 1: for i in set: yield [i] else: yield []

As you may have guessed, given a set of elements as a python list, this code allows you to iterate through the elements of its power set in increasing set size order.

You may be thinking this guy is mad if he thinks that iterator recursive code is simple. But hey! If you look an example, and think how you would write that in another programming language, you will probably agree with me.

The promised clarification example:

 
>>> l = [1, 2, 3]
>>> for i in powerset(l):
...   print i
... 
[]
[1]
[2]
[3]
[1, 2]
[1, 3]
[2, 3]
[1, 2, 3]

Parece interesante el proyecto advogato, al menos curioso. Bueno, pues esto es una primera entrada de diario a esto que parece ser un blog...

It seems interesting advogato project, at least curious. Well, this is my first diary entry here. I suspect this is a kind of blog...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!