Monday, December 29, 2008

Patience, Strength and Discipline

I've just arrived from a short Christmas trip to Bordeaux, France. This city is the capital of a region with the same name, world wide famous for their wines. As beginners in the art of wine appreciation, this place is definitely a very important destination, like India is for meditation, Italy is for food and Brazil is for happiness. We decided to appreciate wines while they are cheap to appreciate and while living very close to a big variety of it. One day, when we go back to Brazil or maybe go far from Europe for a new foreign experience, wine appreciation will become an expensive and rare experience. So, the time is now!

The first impression about Bordeaux was, let's say... shocking! From that we got an important lesson: it isn't a good idea to be a tourist around Christmas's day (December, 24) in Europe. Here, at least during our last two experiences, Christmas is for everybody, including cooks, waiters, cleaners, guides, receptionists, and all other professionals that give some assistance for visitors. So, the city was empty, no restaurants, shops, shows, nothing. The weather was even colder than Belgium and with a dense fog. Then, what Brazilian people usually do when something worse and out of control happens? They start to laugh, laugh a lot about the planned tragedy, about how idiot they were to get in such a situation. Well, at least we could have fun for a while, before a moral hangover all over the evening, thinking how to save our trip from a failure.

December 25, we woke up in a bad mood, but at least we had a great breakfast, there was not fog anymore and we had a plan in mind. "So, if it is all we have, let's use it in our favor and go out there to get some luck", I said. We walked, walked a lot through empty streets, squares, exploring the whole City Center, as if the city was closed just for our delight and for the quality of our pictures. We visited monuments, historical sites, secular churches, and other tips given by our green guide book. We had chosen everything that is possible to do without any professional service during that day, which was indeed a good experience.

Our luck was gradually improving and the rest of the trip was simply perfect. The top of our luck was exactly on the last day, December 27, when we learned great lessons about the three words in the title of this post. And all these lessons were gotten as we learned about wines. We realized that wines have more to give than just the pleasure of drinking it with a wonderful person and a great meal. We were able to buy two of the last places in a wine guided tour to visit two castles, producers of important appellations, in the fields of Bordeaux. After some bottles in many local restaurants, the time for an awesome experience finally came.



At the first stop of our tour we learned the first word: Patience. We stopped on a castle where the wine Chateau Lanessan Haut-Médoc is produced, a controlled appellation of the Bordeaux region, which means a high quality wine with a rigid control by competent authorities. To produce a wine with such quality they have to work a lot, invest a considerable amount of money and wait for a long time, from 1 to 5 years to transform grapes in wine and aging for a minimum period to be well appreciated. All people in the vine know the consequences of their work has a long term impact and there is no space for anxiety. They have to focus on the present, follow the planned schedule and be optimistic about the future. When we think the wine got old enough in the castle to be immediately consumed, they still ask to wait for a few more years. It demands patience and patience is what we need to achieve our dreams.



The process to get grapes in the perfect shape to be collected tells a beautiful story about Strength. The castle guide explained that grapes are like human beings. They are able to get better and stronger after every hard experience of life. That's why the soil to cultivate good grapes should be poor and stony. Those grapes will fight to survive, sharing scarce resources. Soil with abundance of organic material will make grapes lazy, with a weak soul, thus without dignity to give us any pleasure.

Last, but not least, it isn't possible to get a good wine without Discipline. The wine production demands a careful attention of many variables, such as soil, temperature, humidity, seasons, and many others. During the fermentation (the process to transform the grape juice in alcohol), a team of enologists strictly monitors the temperature and pressure. If a single detail goes wrong a considerable part of the production will be lost. That's what could happen with our projects without disciplined habits.

This close contact with a wine culture taught us even more good lessons, but these three words were what I would like to emphasize for you now. This trip was so valuable for us that we may divide our stay in Europe in two parts: before Bordeaux and after Bordeaux. :)

One last tip: If you want to be happy, healthy and not an alcoholic, do like me, drink wine during the meals ;)

Saturday, December 20, 2008

Acessing Resources Inside of Jar Files

A short post to document a special detail in swing applications that causes an annoying waste of time. As a clever programmer, you always distribute your applications in JAR (Java achieve) packages, but you also put nice icons in your application to make it more attractive for final users and put some default configurations for basic initializations. The annoying problem (but easy to solve) is to package images and other files in a JAR file and create portable links to those files.

If you need to access a text file inside a JAR, the code is not self evident, but easy. To load an XML file, for example, you have to use the code below:

ClassLoader cl = this.getClass().getClassLoader();
java.io.InputStream in = cl.getResourceAsStream("properties.xml");


The file "properties.xml" is inside the "application.jar" file, in the same package of the class where it is called. You can put this file in another package, but it will be more difficult to define the exact location of it. It's easier and coherent if you keep the caller and the resource in the same place.

When you want to access images from the jar file the code is a little bit different. The example below shows how to create an image icon to illustrate swing components.

JButton btRemove = new JButton(new ImageIcon(SearchTab.class.getResource("remove.png"));

Again, the figure "remove.png" is in the same package of the class "SearchTab.class".
The Java API doesn't provide one form to change files inside jar files. We can read and manipulate the content, but not save it back in the same file. So, this is a solution for read-only needs.

Monday, December 15, 2008

Meritocracy in Action

"Meritocracy is a system of a government or another organization wherein appointments are made and responsibilities are given based on demonstrated talent and ability (merit), rather than by wealth (plutocracy), family connections (nepotism), class privilege (oligarchy), cronyism, tenurocracy (based in seniority), popularity (as in democracy) or other historical determinants of social position and political power. In a meritocracy, society rewards (by wealth, position, and social status) those who demonstrated talent and competence, demonstrated through past actions or by competition." - Wikipedia (Meritocracy)
I think "Meritocracy" is a very beautiful concept. In my humble opinion, it is a subclass of Democracy, but with highly honest and fair people even with their worse enemies. In a democracy, a person can get higher positions in the society just because she can convince other people about her competence. In a meritocracy, she doesn't have to convince, she has to prove her competence and other skills.

Meritocracy is not perfect, as democracy is nether. To deploy a meritocratic system, a leader should have an open mind, be able to observe people, identify their abilities, understand their weaknesses, recognize every single good action, and, the most important, do not differentiate people by personal affinity. Leaders with this profile are very rare, which makes meritocracy a difficult system to implement or it is implemented in a wrong way. If you want to find meritocratic leaders, keep in mind that they have an unquestionable passion for their dreams and they know that they need very good people around them to support those dreams.

There are also those who deserve or not to be in a meritocracy. If you become very disappointed when your closest colleague is promoted and you are not or you work exactly on the boundaries of your rule or salary, then meritocracy may not be a good social system for you. To be part of a meritocracy is all about entrepreneurship with managed expectations, which means you have to do your best and don't expect for immediate recognition. If you are like that and you are still waiting for recognition, it means that you are a meritocratic in a non-meritocratic system. Then you have two options: quit as soon as possible or adapt yourself to the true reality.



The best example of meritocracy I've ever seen happened in CEJUG in 2008. Before, some previous facts: Years ago, we (the JUG leader team) decided to adopt a meritocratic system, where normal members can become JUG leaders when they show constant contributions to the community and some level of leadership. Our first great example of meritocratic promotion happened in 2007 with Rafael Carneiro, who started to organize monthly events with a religious discipline. Today he is famous because of that. Rafael really deserved that, even being a very good friend of the current leaders.

At the end of 2007, SUN created the Campus Ambassador Program and they selected a student in the Ceará Federal University to promote SUN's technologies with university students. The problem was that SUN did it without asking CEJUG for an indication, recommendation or event a humble opinion. As the third biggest JUG in Latin America (and why not the most active) we felt totally ignored, absent for SUN. When the chosen ambassador joined the CEJUG community and started to promote SUN products there, a long and stressing discussion started between us, SUN Brazil, the international community of JUG Leaders and also SUN International. In January 2008, SUN recognized that it was a mistake, resulting from an internal communication problem, and we resumed our marriage again :) . But the internal problem persisted and we spent 3 months trying to have a deal with the local campus ambassador. We got it, but our relationship was strongly affected.

The best example of meritocracy comes now: that guy, with strong disagreements with the current CEJUG's leadership and our strong disagreement with the Campus Ambassador's philosophy too, was unanimously selected by all current JUG Leaders to become a JUG Leader too. His name is Silveira Neto, who you may know if you carefully follow this blog. In 2008, Silveira just ignored our disagreements and strongly supported all CEJUG initiatives during the year. He helped Rafael to promote CEJUG's local events, he promoted CEJUG in national events and also in international events hosted in Brazil and he produces many artistic works, like the figure below to promote the last event of the year during Christmas time.



This is the spirit of Meritocracy: ignore all differences and recognize people by their competence and abilities. On January 1st Silveira Neto will become a CEJUG leader, which is a strong responsibility and, at the same time, a great personal achievement. Even with some disagreements, Silveira decided to strictly follow all CEJUG's rules, which is a guarantee of continuity and respect to all previous decisions.

CEJUG is an organization where meritocracy really works. I'm very proud to be one of the JUG Leaders who implemented this philosophy there with exceptional results.

Sunday, December 14, 2008

Remembering Good Moments to have Good Moments

It has been 6 months since my DEA defense (June, 18) and I hadn't blogged about that yet. Not because it wasn't a great moment. It was, but sometimes I don't like to promote myself here. However, December is the month that we spend more time thinking about our achievements during the year. At times when we really need an incentive, why not do it myself?

The picture below shows the moment when my DEA adviser, Jean Vanderdonckt, gave me a document that attests me as approved with great distinction in my DEA. This picture represents a lot for me because it shows my first concrete step in my academic experience in Belgium.



The title of my dissertation was "Web Services for Model-Driven Engineering of User Interfaces", which is, basically, the definition and classification of a library of web services to manage an user interface definition language (UsiXML). I'm proud of this work because it was used as the technical basis for an European Project submitted by Mr. Vanderdonckt some time ago, and he just received the great news that the project was accepted at the European level. That's great when you come from a distant city in Brazil to a well established and competitive country like Belgium and directly contribute to a great achievement as a foreign student.

Now I'm running in a new challenge, my PhD, but it isn't time to talk about unfinished achievements yet.

Sunday, December 7, 2008

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!