sábado, 24 de marzo de 2012

The Dance of the Bear


Some time ago, I heard this medieval song generally named "The Dance of the Bear", a kind a traditional dance of the Pyrenean region. I was particularly attracted by the song because in that period I was reading a book called "The bear. The story of a decayed king".  Still now when I hear or play that song with my accordion, I like to image an ancient dance of people around a bonfire, exorcising the fear for the visit of the King Bear during the nights.


Some days ago, I visited the traditional Fallas in Valencia. This tradition is steeped in pre-Christian rituals where the fire still retains its symbolic cleansing against the end of the winter and good luck brought by the spring equinox.  There, between fireworks and firecrackers, the song constantly playing was a Brazilian song called "Ai se eu te pego", now the fashion of the moment.



Who knows if in a few hundred years, posterity will think that I was dancing that song around the fire.
Certainly, what I would have expected (or maybe what I would have liked to expect) from the evolution of the Dance of the Bear is much more similar to the music that Meikenut proposes in their Laridé a otto tempi.



References:
- Michel Pastoureau, "L'ours. Histoire d'un roi déchu", http://en.wikipedia.org/wiki/Michel_Pastoureau
- Meikenut : http://italianfolkmusic.blogspot.com.es/2007/08/meikenut-sons-et-suggestions-dautrefois.html

domingo, 11 de marzo de 2012

International Philosophy: Germany vs Greece



Some time ago I was watching this amazing football match Germany vs Greece with a friend of mine. I still remember the lol moment when Archimedes realized what to do! From this video, an interesting discussion started about the suitability of certain languages towards philosophy and in particular, how both Ancient Greek and German may better mold philosophical concepts. We engaged on a very nice discussion about natural and programming languages too. 

Finally, we agreed on these similarities:
 - C/C++ : Latin
 - Java : English
 - Python : Ancient Greek/German

While enjoying some coding this morning, I was back on that concept while  facing with the problem of reading quipus. Without entering too much into the details, the goal is to convert strings like this "XX--XXX-XXXX" into decimal numbers. In this specific case, the string "XX--XXX-XXXX" is equivalent to 234. The number of "-" may change based on positional coherence between different numbers.
Some examples are:

 -XXXXXXX--XX-----XXXXX---    725
 ---XX----XXX-----XXXX----    234
 -XXXXX---XXXXX--XXXXXXXX-    558

The proposed solutions for this problem consist of:
- 30 lines of codes in Java
- 41 lines of codes in C++

If I would have to propose a solution in Python, it might be

[int(''.join([str(t.count("X")) for t in q.split("-") if t != ''])) for q in quipusList]


References: 
- The QuipuReader problem: