Tag Archives: music

Calculating Your Level of Naughtiness

To motivate his students, a computer science teacher of the Federal University of Ceará has challenged his class to develop an algorithm to calculate how naughty you are based on your birth date. The challenge is very silly, but it became a Brazilian hit.

The teacher said his original intention was to teach students to call functions from other functions, which is as much silly as the goal of the challenge, but no doubt that the idea is pretty effective on motivating young students.


The problem consists on writing a function that calculates the percentage of naughtiness and the remaining level of innocence of a person based on his/er birth date. The formula to calculate the level of naughtiness is:

naughtiness = incremental_sum(month) + (year / 100) * (50 - day)

where incremental_sum is a function that, given a number, calculates de sum of all numbers from 1 to the informed number included. The solution below is written in Clojure:

(defn inc-sum [num]
  (reduce + (range (inc num))))

(defn naughtness [day month year]
  (let [naughty (+ (* (- 50 day) (/ year 100.0)) (inc-sum month)) 
        angel (-  100 naughty)] 
    {:naughty naughty 
     :angel angel}))

(naughtness 10 9 78)
=> {:naughty 76.2, :angel 23.8}

The formula has absolutely no sense and doesn’t have any scientific foundation, but the result of the function is great fun to play with friends! Maybe the subject can push you to learn Clojure, doesn’t it?! 😉

Thank You For The Music

Some time ago I declared : “I will ALWAYS pay for music. No matter how much it costs. Music saved my day and it has a great value for me. So, I’m extremely grateful!”. I’m here again to reinforce this message and say that it becomes more and more true in my life every day.

Actually, two special facts motivated me to write this post. The first fact is about a movie that I watched last week. The movie was Mama Mia! that I really recommend. The point about this movie is that it can transform an ordinary admirer of ABBA’s songs into a great fan of the band. At least, it happened to me. Right after the movie I ran to iTunes and I bought the whole disco collection of ABBA, composed of more than one hundred songs. I started to appreciate songs that I had never heard before, just because of the magic behind the lyrics.

The second fact was an amazing production of a Belgian TV, which surprised a lot of people in the train central station of Antwerp last month. How I wanted to be there to see that unexpected scene! You can see in the video below the emotional impact of such event on the mood of people around it. Even a rock fan was moved to clap his hands to “The Sound of Music” (do, re, mi):

This video must have touched you, hasn’t it? I definitively agree with ABBA when they sing:

“So I say
Thank you for the music, the songs I’m singing
Thanks for all the joy they’re bringing
Who can live without it, I ask in all honesty
What would life be?
Without a song or a dance what are we?
So I say thank you for the music
For giving it to me”

Thank you for the music

Reviewing My Position About Brazilian Music

This post doesn’t change my main position about the quality and complexity of the Brazilian music, but I think my last position was a little bit selfish and it’s time to fix this.

In a previous post I said:

“The Brazilian music + lyrics has the incredible ability to describe your moment. Sometimes you can find more than one music to describe the same moment, each one by a different perspective. (…) it’s very difficult to find something similar in other cultures.”

I’m writing this post now to review my previous idea, because I’ve just realized how unfair I was with other cultures. This Saturday I was surprised by a song that tries to prove my previous point (three times more efficient :O), but from an American (USA) culture’s point of view. This song is “Killing me softly” originally sung by Roberta Flack in the 70s. Read part of the lyric to understand:

Strumming my pain with his fingers
Singing my life with his words
Killing me softly with his song (x2)
Telling my whole life with his words
Killing me softly with his song

Isn’t it magic? The whole lyric is about a listener describing the talent of the composer when describing his/her feelings or moments. Exactly the point I was trying to prove previously, but with music from Brazil. So, if Charles Fox and Norman Gimbel (composers) had the same idea as mine at that time, they actually had the same perception inside that culture.

In the video below you can watch, listen and sing together with Roberta:

Of course I changed my radio station to Roberta Flack. Check it out!

Brazilian Music is an Emotional Wave

Lucky you, who can listen to Brazilian music and don’t understand Portuguese. At the same time, unlucky you who can listen to Brazilian music and don’t understand Portuguese. Yes, this is ambiguous, but totally true. I’m suspect to talk about that, but I think I have enough arguments to explain my point of view.

I have been observing people who like Brazilian music, but don’t speak Portuguese. They usually have eclectic taste, listening to a variety of rhythms, from jazz to rock. On the other hand, I’ve never seen a rock fan dancing while listening to our beats, as well as a teenager, in love, listening to our romantic music. Therefore, for those who don’t understand Portuguese, Brazilian music is a cultural experience, a Latin expression, a good music to release their sensuality, or just relax after a hard working day. Who listens to Bossa Nova or MPB knows what I mean when mentioning Latin expression and relaxation. Who listens to Samba, Lambada or Reggae knows what I mean when mentioning cultural experience and sensual expression.

So, if you don’t know Portuguese, then you will probably just fell happy, sensual, fun or relaxed, but if you know… Wow! Guys, you and me actually live in an emotional wave… suuurfing on it! Yeah! The Brazilian music + lyrics has the incredible ability to describe your moment. Sometimes you can find more than one music to describe the same moment, each one by a different perspective. That’s why I’m saying you are unlucky. Because it’s very difficult to find something similar in other cultures. This was, indeed, a motivation to write this post, because I have read many lyrics and all I found was small sentences describing my feelings, unlike Brazilian composers, who write so well about emotions that you might imagine them almost as witnesses of what happened.

This girl above is Ivete Sangalo. She has a special ability to describe your moment when you are happy :D, when you want to be happy :), when you are sad 🙁 and even when you want to be sad ;(. She is Bahiana (born in Bahia) and who is Brazilian knows how humble and loved she is.

Ivete is the new generation and you probably don’t know her. But your eclectic taste most have already introduced you at least to one of these three guys below. Caetano Veloso, who composes music using complex Portuguese sentences and when you realize the real meaning behind the words you begin to laugh unexpectedly and start using that expression to feel that same feeling in a special moment. The second guy, Tom Jobim, has the ability to do the same as Caetano, but with simple sentences that everybody understands and uses to be explicitly clear. The last one, Roberto Carlos, I don’t like him ;D. I’ve kept him to avoid interfering on the talented work of Batistão, a famous caricaturist in Brazil. But Roberto has his value. He is not a composer but sings very well and moves crowds there.

I have material to write a book ;), but this is just a blog and its intention is just to excite your curiosity. You are invited to listen to some Brazilian Music in my new radio on the right dedicated to Ivete Sangalo.

New gadget: Bryan Adams Radio

This post is to celebrate a new gadget that I’m adding in my blog. You can see it just on the right, with the title “To Inspire”. This special gadget is offered by last.fm, which promotes music of many artists playing them in an aleatory way. All we have to do is to define the style of the radio, choosing a singer/composer with that style and all the music played will be very similar to that style. For instance, if I choose Mozart as the composer of my radio then many classical music will be played including music composed by Mozart, Bach, Beethoven, and others.

I’m following the example of my friend Vasco Furtado, who redefines his radio periodically in his blog. I’m starting this practice too with a talented artist, Bryan Adams, who sings a classic, All For Love (lyric), in the video below with two other stars, Sting and Rod Stewart. Enjoy it!

To listen to music similar to All For Love, just press play on the new gadget above.