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.

Posted in:

A simple django basename template filter tag

Last updated on Thu, 2009-04-16 13:52. Originally submitted by fabio on 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.

Posted in:

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

Last updated on Fri, 2008-06-27 18:12. Originally submitted by fabio on 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]
Posted in:

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

Last updated on Sun, 2010-03-28 19:10. Originally submitted by fabio on 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

Last updated on Tue, 2008-12-02 15:06. Originally submitted by fabio on 2008-03-27 23:20.

UPDATE: the following guide is useful if you are using Xorg 7.3 or previous versions. If you are using Xorg 7.4 there is a guide to configure two fingers scrolling on a regular synaptics touchpad if you are using Xorg 7.4 or superior.

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.

h264 videos on Flash: cool example

Last updated on Fri, 2008-02-15 12:36. Originally submitted by fabio on 2008-01-26 19:04.

Recently I'm playing a bit with the new feature available on the new Adobe Flash Player 9: the support of h264 encoded video for flash videos.

Well.. seems that this will really give us incredible developments as this technology it's really super powerful.

As an example of it you might have a look at this h264 flash video h264 demo (right click on the video to go fullscreen).

The resolution and definition of this video it's really incredible. Even if the video is being downloaded from a website in real time the quality is really high but still it plays without interruptions and smoothly.

And the quality.. it's amazing. Actually higher than lot of divx which are commonly available in Emule and friends.

Wouldn't you pay a couple of dollars to stream online your favorite movies with superb quality and without the hassle of time consuming and bad quality with P2P ? ... Let's see what will happen.

Posted in: