Setup a local macports repository

(Update: Official Guide Local Repositories)

Setting up a local macports repository is quite easy:

- create a repo folder, like:

sudo mkdir /opt/local/var/localports

- update the config

sudo vim /opt/local/etc/macports/sources.conf

adding

file:///opt/local/var/localports

- create your port mirroring the model in

/opt/local/var/macports/sources/

- update the index with:

sudo portindex /opt/local/var/localports

- install the new port!

Ho trovato un buggettino a cElementTree!

Giorni fa ho trovato il mio primo bug in un codice sorgente “serio”!

Playing with PyInstaller I have found that the final part of _elementtree.c:

Index: Modules/_elementtree.c
===================================================================
— Modules/_elementtree.c      (revisione 59540)
+++ Modules/_elementtree.c      (copia locale)
@@ -2780,7 +2780,10 @@

       );

-    PyRun_String(bootstrap, Py_file_input, g, NULL);
+    if (PyRun_String(bootstrap, Py_file_input, g, NULL) == NULL) {
+        m = PyErr_Occurred();
+        return;
+    }

    elementpath_obj = PyDict_GetItemString(g, "ElementPath");

execute a bit of python code without checking the return value.
That can lead to weird things playing with import hooks,
for example an assert like this can fail:

Continue reading

Quality in Ranking

A good ranking is what all searchers wants back from a query.

A widely used measure for prediction are Precision and Recall.

In a few words:

- Precision measures the hit rate over the times you shoot. More you shoot, more easily you can hit, but you have a low Precision
- Recall measures the hit rate over the hittable. You can reach the maximal Recall hitting all the targets, no problem how many tries you did.

It is quite obvious that shooting a lot you can have a good Recall and a bad Precision, on the opposite side, shooting only a few good slugs you will have a good Precision, but a small Recall.

Continue reading

Mouse Feedback

Stavo pensando… ma se non ci vedessi, che cosa farei?

Allora mi è venuta in mente una banale estensione del mouse che potrebbe aiutare i non vedenti, un mouse-feedback, che vibra quando il puntatore passa su zone contrastate del monitor.

Stai entrando in un bottone? *bzz*

Non ci vuole neanche tecnologia da fantascienza…

Filmografia alternativa

Ve ne cito un pezzettino:

Ommariuolo: posso proporti allora film come harry potter e il server sql
Ommariuolo: oppure die hard with a sql programmation
Ommariuolo: oppure pulp injection
Cougar: sin sql!
Ommariuolo: il server del peccato
Ommariuolo: o se preferisci, r for replica

Per il resto: [Cougar: Welcome home (Sanitarium)](http://cougar.altervista.org/blog/archives/2006/11/13/welcome-home-sanitarium/)