Older blog entries for cerquide (starting at number 49)

18 Oct 2004 (updated 18 Oct 2004 at 17:26 UTC) »

Happily (and sometimes unhappily) hacking Ocaml. Today I had a problem with the Ocaml binding for gsl that took me about 6 hours to fix. Now it is done!

I keep up with the idea of rewriting Durin in Ocaml. My (inefficiently coded) Perl code is about 40 times slower. Running a set of experiments was about 1 day and a half in a cluster of 20 computers. The Ocaml version is about two ours on my desktop computer. Anyhow, I still have some problems to write Ocaml code that looks clean and easily readable.

After meeting Marcus Hutter in Padova, I got interested in his theory of universal artificial intelligence. I have ordered the book and in order to prepare for it I am reading An Introduction to Kolmogorov Complexity and Its Applications.

Writing from Padova. I am in Discovery Science 2004.

I am running two student projects that use PNL. I have to prepare a quick introduction to Probabilistic Graphical Models for undergrads.

After talking to esteve I have decided to propose a project in Learning in Games, concretely centered in repeated games. The main idea is to develop software that supports in making research in learning in repeated games. That means that the software should be able to:

  • allow the easy definition of a repeated game (including Bayesian games, if possible)
  • allow the easy definition of one (or a set of) players of a repeated game. This includes a library of well known players such as fictitious players.
  • allow the easy definition of an experiment (sampling games from a probability distribution over games).
  • run experiments and show graphs that are illustrative of whether there is convergence, computes averages of performance for different sets of players, etc.
The second step would be to think about creating new players, programming them and making experiments to evaluate their efficiency.

Interesting resources for the topic are:

6 Aug 2004 (updated 6 Aug 2004 at 19:31 UTC) »

I am learning Ocaml by trial and error. I have decided to drop Durin development in Perl and I have migrated most of it to Ocaml refactoring some pieces for consistency. That way ODurin has been born.

Hacking Ocaml provided me mixed feelings. From Ruby, I have noticed a lack of commodity, that turns out in more time developing for the same task. IMHO Ruby is the best programming language I have tried yet. A pitty the interpreter/compiler is not more efficient. Apart from that, I like Ocaml. I feel like there are two kind of languages: C, C++ or Java make it difficult to refactor and freeze your design. Perl is somewhere inbetween. Ocaml and Ruby allow you to quickly modify your design. This means that a single developer can maintain a much bigger project with dynamic specs in Ocaml than in C. Since in research programming specs change a lot. I have decided to stick with Ocaml for a while.

And Ocaml is efficient!!! It really is!!

I have integrated Ocaml with the NTL package using Swig. I spent a whole day until I found out that C++ references are not that simple to work with in the Ocaml-C++ Swig interface and I dropped them all to use pointers.

I am back hacking C++ (migrated from Ruby) due to efficiency reasons. The language has changed fundamentally in the last few years (while I was fundamentally hacking Java and MSWord). STL has established as a fast standard library. The community seems lo be geared towards metaprogramming with heavy use of templates. I have ordered a copy of "Modern C++ Design" by Alexandrescu which seems to be the new "reference book" on C++ style. I have been testing some of the Boost libraries, such as lambda, that gives C++ a functional style, but at the moment I think it is abusing the language.

I am decided to learn Ocaml, because the language seems to provide a good mix of programmability and efficiency.

1 May 2004 (updated 1 May 2004 at 09:56 UTC) »

Many things to note, grouped by categories

Object Oriented Design and Layers

Nowadays everybody knows that a well architectered application consists in a set of layers (such as UI - Model - Database)and a well designed object oriented model. Even I do! Since I am teaching Programming Methodology I have tried to put together some nice tiny examples of object oriented layered architectures, and I have found that actual programming languages are not well suited for this need. If you do a good object oriented analysis, you will end up with an object model. This object model reappears at the three different layers. That, let's say I am implementing a TODO-list management program. I will have a UI layer Task and a Model layer Task, both containing the description of the task. Furthermore, if I make an inheritance hierarchy such that ImplementationTask inherits from Task and so does DesignTask, I have to repeat this inheritance hierarchy at every layer. Sure there will be objects specific for each layer, but most domain model objects will be present in all of them.

After thinking for a while I see two solutions to this:

  • Using a programming language that allows open classes. In Ruby you can think of having one (or a set of) .rb file for each layer. Since we can add functionality to objects, the UI layer will just reopen the model layer objects and add the UI related functionality. Since the model is implemented in separate files, there is no dependence between the model and the UI, but the UI shares the model object model. Drawbacks are that classes are to be open at every layer.

  • Providing usual OO languages such as Java with a construct and semantics to deal with layers and create an IDE that works with such constructs. While decoupling more and more from the filesystem, our way of programming and thinking of independence in programs is still very much influenced by how we store our code into files. In Java, for example, many times we assume everything under the same .java file as interdependant. We can break this by introducing (for example) a layer keyword that separates the different parts of the object that implement services for the different layers. So we will have something like

    public class A {

    layer Model

    //Model functionality

    layer UI

    //UI functionality

    }

    Plus a file layers.xml for the complete application, describing the dependencies between the layers.

    The IDE will know which layer we are working in and will show :

    • The underlying layers as blackbox services (just the methods we can call, not the code)
    • The code of the layer we are working in
    • Nothing about layers that we do not depend on

Mass spectrometry classification

Finally I have found some GNU software and a reasonably well written article about mass spectrometry classification.

Network programming

J2EE sucks.

Reviewing

I have been reviewing papers for several conferences and workshops this week. Undoubtedly, GTDT04 papers were the most interesting and high quality. I will be really sad if I am not able to be in NY.

Family matters

Next Thursday I am driving to Seville to see my little niece. I will be back on Barcelona on Monday.

ZF inconsistent

fxn, I cannot reach the paper. Do this means we can now positively confirm my long time unproven theorem that 2+2=5? :o)

I have done the DanteĀ“s Inferno Test. Here come the results

The Dante's Inferno Test has banished you to the Second Level of Hell!

Here is how you matched up against all the levels:

Level | Score

Purgatory | Very Low

Level 1 - Limbo | Very Low

Level 2 | Very High

Level 3 | High

Level 4 | High

Level 5 | High

Level 6 - The City of Dis | Very High

Level 7 | High

Level 8- the Malebolge | Very High

Level 9 - Cocytus | High

Level descriptions: http://www.4degreez.com/misc/dante-inferno-information.html

Take the test: http://www.4degreez.com/misc/dante-inferno-test.mv

Cleaning

I have spent all Saturday morning cleaning. What a stupid way to start holidays!

Work

Lots of work, as usual.

I have to prepare my UML course at f2i.

The course at Sony was really a nice experience.

I am trying to stablish a reasonable research framework with Oryzon genomics. I think the software we are developing could be interesting both from a research and from a commercial point of view.

I have been asked by Geoff Webb to coauthor a paper about TBMATAN, AODE and other classifiers based on improving TAN. I have accepted

I have been asked to review papers for IEEE SMC and IEEE Intelligent Systems.

Holidays

In a few days I will have my nieces here sharing the holidays with us.

16 Mar 2004 (updated 16 Mar 2004 at 18:59 UTC) »

Today I have been learning C with Alfonso Maestre. We have been trying to understand pointers to functions. It is funny that

int x(int z) {return 0;};

int main() {

if (x == ****************x) {

printf ("I am a pointer to myself\n");

}

}

compiles and says a function is a pointer to itself!!! Isn't it surprising?

15 Mar 2004 (updated 15 Mar 2004 at 17:47 UTC) »
Statecharts

I have offered myself to Dr. Samek, to translate "PSSiCC" to spanish. He has forwarded the request to the publisher, CMP books, to see if there is a market. I think the book is good and deserves a spanish translation. If you look at amazon.com it is approx. 11.000 and "Design Patterns" is approx 6.000. Obviously "Design Patterns" has been translated (late).

Research

I am on the program committee of the Workshop on Game Theoretic and Decision Theoretic Agents GTDT04. And I am quite happy to be. :o)

Sad

What happened in Madrid was awful. There is no point. Today Spain elects its government. I think they should have delayed the voting, because there is too much noise and unknowns floating around. The government is being criticized for hiding information. People is out in front of the government offices asking them to reveal the truth. In Pamplona, a civilian has been killed for dissenting. I do not feel like we are prepared to vote calmly. I hope that whoever wins asks for a second voting once all the unknowns have been sorted out. Anyhow, today I voted.

UML Statecharts

I have discovered UML statecharts. I have always been atracted by mathematical models of computation. Harel's Hierarchical State Machines, that support the concept of "Behavioural Inheritance" look like a very interesting approach. They provide the theory on the basis of UML statecharts. When the time gets tough, that is in real time systems, they are the most useful technique to formalize systems. I am teaching a UML course to the digital TV group in Sony. Obviously, they work on embedded real time systems (a.k.a. digital TVs). This has made me look into parts of the UML standard I disregarded before for being "too detailed". Nothing is "too detailed" if the system is complex enough. I have read "Doing Hard Time" by Douglas and I am reading "Practical Statecharts in C/C++" by Samek. I recommend both. I think "Doing Hard Time" is nice introduction to UML modelling, not just in real time systems. On the other hand, Samek's book introduces C+ as a simple way of translating object oriented constructs into C. It also introduces "Quantum Programming" (quite a hyped name IMHO), that is a way to translate statecharts to C/C++.

40 older entries...

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!