El laberinto del fauno (Pan's Labyrinth): my personal review

Submitted by fabio on Wed, 2008-11-19 01:29.

El laberinto del faunoEl laberinto del fauno

I don't usually blog about the movies I see.. anyway I think that this one actually worth it.

In order to prepare myself for the DELE superior exam I'm watching a lot of Spanish movies.

I randomly went across Guillermo del Toro's "El laberinto del fauno" (Pan's Labyrinth).

Back Home

Submitted by fabio on Sat, 2008-10-11 18:57.

For those who care about me.. I'm back home in Torino, Italy, three weeks ago.

The Las Palmas Erasmus experience was incredible. I've been away for 13 months.. probably the best year of my life.
I plan to write a post about this experience soon.

My plans for next months are: studying, studying, studying.

I want to finish university as soon as possible. I only have 6 exams left to get my MS and I plan to finish for July and start working on a thesis on Summer.

Meanwhile I will have the DELE Superior Exam on November, that's pretty difficult. Let's see what happens.

A simple django basename template filter tag

Submitted by fabio on Fri, 2008-08-29 12:42.

I'm using Django, a python coded framework to develop web applications, to implement a project for the University.

During the development I needed to have a template tag which, given a path to a file, just returns its basename (just as it do the python os.path.basename).

So I implemented it. Following you have the code for it.

Drupal: how to clear the filter cache

Submitted by fabio on Tue, 2008-07-15 16:10.

A filter is a Drupal feature, usually implemented by some contributed modules, which substitutes parts of a node text with some other text.

Eg: if you use the Path filter module you can insert links like:

<a href="internal:node/25">hello!</a>

and the string internal:node/25 will be substituted by something like http://www.example.com/node/25 where www.example.com is your website url.

Drupal 6: get parent nid of a book child page

Submitted by fabio on Fri, 2008-06-27 18:07.

I had to get the parent nid of a book child page for a website which already uses Drupal 6.

Seems that the book module logic has changed deeply between version 5. The new stack implementation of the parent-child relationships is pretty complex, at least for me. I have to say that I did not studied it a lot thought.

So.. this is the code to do that:

<?php

if(isset($node->book)) { // book page
      $parent = book_link_load($node->book['plid']);
      $pid = $parent['nid'];
}

?>

Hope this helps.

Python: call a function with more arguments on each element of a list

Submitted by fabio on Wed, 2008-06-25 12:13.

I'm recently working a lot with Python because I understood it perfectly fits my needs being powerful, clean and fast to develop with it.

If you program with it there are good chances that you will end up using lot of lists which are pretty well designed and powerful in Python.

A really useful function in Python is map() which let you execute one function on each element of a list:

L = [0.1, 0.4, 0.7]
L2 = map(round, L)
print L2

#output [0.0, 0.0, 1.0]

A firefox search plugin for Drupal 6 apis at api.drupal.org

Submitted by fabio on Wed, 2008-06-04 13:41.

Some time ago I created a api.drupal.org firefox search plugin for Drupal 5.x and submitted it to the Mycroft Project for indexing.

Well, I've been requested to do the same for Drupal 6 Apis.

So.. I did it. There is now a Drupal 6 Apis search plugin available at Mycroft.

You can get it from the list of search plugins I created.

Serial RS232 connections in Python

Submitted by fabio on Thu, 2008-05-08 14:18.

Here at ULPGC I'm following a Robotics course. In the practical part of the exam we have to write some applications to operating some didactics robots we have (Rhino XR-4 and SCARA Robots).

Each robot is connected to a Controller (Rhino Mark-4) which can be connected to a PC to send commands to the Controller in order to let the robots do things.

The PC to Controller connection is a serial RS-232 connection.

Serial RS232 connection in DOS dosemu

Submitted by fabio on Thu, 2008-05-08 13:49.

Recently I had to play with serial RS232 connections in order to control a robot we have here in the Robotics course at the ULPGC.

We have some pretty old (1989!!!) applications to control and configure the robots which used to run under DOS. I tried to run them under dosemu: unfortunately it didn't work. Maybe because the code the applications use is not really good (direct access to the hardware, incorrect driver usage etc..).

linux how-to: two fingers scrolling on a regular synaptics notebook touchpad

Submitted by fabio on Thu, 2008-03-27 23:20.

One of the features I really love about Apple's notebooks is the two fingers scrolling enabled touchpad they have.

It's easier and faster to use than the regular side scrolling available on normal notebooks.

So.. I recently had a look at the synaptics documentation (synaptics is the driver which manages the touchpads under Linux).

Well.. After some reading and a bit of google searches it turns out that is possible to enable two fingers scrolling on recent synaptics touchpads even on normal/regular notebooks (not Apple Macbooks).