Saturday, September 24, 2011

Of Neutrinos, Tunnels and Ministerial Stupidity

It's simply true! Experimental evidence says that lightspeed is not an universal limit. But if Theory of Relativity will need a fix to comply with these new findings, Einstein has not to worry so much, because Italian Ministry of Research demonstrated another of his theories, the one about Human Stupidity.

From Gran Sasso and CERN researchers say that after 6 months of checks and reviews looking for measurement errors, it seems that Neutrinos travel a bit faster than that almost confortable universal limit, which was the pivot of 20th century Physics: c, the speed of light, 299 792 458 m/s in perfect vacuum (Google It!).

But the best was yet to come! Few hours after the announcement, just in time for getting the credit for the result (which is described like a victory ?!?!) italian Minister of Research Mariastella Gelmini sends her congratulations to the scientists in a Press Release:

Here you are the translation of the absurd part:
Italy contributed with an investment esimated in about 45 million € to the construction of the tunnel between CERN and Gran Sasso, in which the experiment was conducted.

Yes... you understood correctly! According to the minister and her staff, the experiments with Neutrinos have been possible thanks to a 732 km straight tunnel from Geneva to Gran Sasso (Central Italy) with a maximum depth of 11.4 km into the ground!

We as Italy, contributed with "about 45 million €" for its construction!
A few bucks if you consider that the just finished Gotthard Base Tunnel in Switzerland - the longest to date with its "poor" 57km in length - had a cost of 10 billion dollars.

Of course, we could ask for the minister resignation and for the idiots at the ministry press office to be fired. But we are in Italy, and nothing will happen... at least until meritocracy and professionalism will become, for the Italian People, common values.
This change is the key for any real economical and cultural growth for Italian society and for a better country... finally outside the tunnel of nonsense!
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein

Tuesday, September 6, 2011

Marinelli 3, Drupal 7: HTML entities shown in banner image_title and image_description

Today I was beginning to create new content on a website in Drupal I renewed updating to D7 and installing the great Marinelli Theme (7.x-3.0-beta11)
I noticed that some characters in banners title and description showed as HTML entities (i.e. & #039; for the single quote symbol).

I digged in the code and I fixed the issue in a quite rude but effective way.
Learning more about the t() funcion from Drupal I found what was the meaning of Parameters give to that function
  • !variable: Inserted as is. Use this for text that has already been sanitized.
  • @variable: Escaped to HTML using check_plain(). Use this for anything displayed on a page on the site. 
The generation of banner title and description string is there made with the @ parameter. Unfortunately somewhere else in the code a further check_plain() call is made on the same strings. This second application of check_plain() function simply converts the symbols into HTML entities and this is the cause of the issue.

My solution was to replace the @ parameter with the ! one in t() function calls into marinelli_banner_markups()
This function in marinelli/logics/

Here you are the code snippets:

'alt' => t('!image_desc', array('!image_desc'=>$banner['image_description'])),
'title'   => t('!image_title', array('!image_title'=>$banner['image_title'])),


'longdesc' => t('!image_desc', array('!image_desc'=>$banner['image_description']))

Keep on hackin' ;-)