Swiss Tournament in Ruby
February 3, 2010 - No comments yetBeing a chess player (not a very good one), I’ve always been intrigued by Swiss Tournaments. They are so practical, and ensure that even a lowsy player like myself, can play the same number of rounds as any other player. That’s being inclusive!
I’ve played some knock-out tournaments (to me it meant being kicked off in the second or third round), and, given their nature, not-so-good players tend not to attend these tournaments (since their fun will, almost surely, end before long).
Well, to solve a very similar problem, but not in any game championship, a co-worker suggested we could use a Swiss Tournament system. I liked the idea, but not being sure it could really solve the problem, I had to quickly implement something to test our data with… so Ruby to the rescue!
In no time we were up and running, and apart from minor issues that were being fixed along the way, I guess it’s a pretty good implementation. You can checkout the code to get a feel of it. Of course, it doesn’t follow any rules from any Chess or Go association (Wikipedia, after all, was my guide here), but it serves our goal. Being a “proof-of-concept” code, feel free to improve it (just tell me about it, will you?).
Good tip: Readability
January 28, 2010 - No comments yetFolks at Arc90 have an interesting experiment going on: Readability. That’s a tool you just drag to your bookmarks toolbar to improve readability of anything…
I’ve been using it for some time now, and my experience, specially in news websites, has been greatly improved. If you are like me, that get really bothered by the usual clutter of todays websites, this tool is for you.
Real Life: Programming is about logic and simplicity
January 13, 2010 - No comments yetWhy is it so hard for non-programmers to understand mutex locks?
No… I am not asking non-programmers to understand programming at all. But concepts that we use in programming that came from real-life in the first place? Come on… Programmers learned from real-life, not the other way around!
Let me explain: at the hospital, after a not so clever renovation, we ended up with an employee restroom that is far from work place (in fact, almost in another department). Most of the times it is occupied… So it takes a trip to the restroom just to learn that it cannot be used at that moment! In a busy morning, one of those trips is just what one can do!
As a programmer I suggested a mutex lock: change the restroom door lock and make only one copy of the key, that should be kept in a common place and returned after being used. If you want to use the restroom and it’s occupied, just learning the key is not there is enough to save a useless trip.
Come on… that is not a hard concept! As I said, we, programmers, learned it from real-life, in settings just as the one I described above!
Well, I just got the key (“acquired the lock”, in programmer speech) and went to the restroom. When I unlocked the door I was surprised by someone already using it! How embarassing! Someone had the smart idea of making a copy of the key! What part of the mutex concept did people not understand?
Luckily, most computational mutex algorithms prevent “lock cloning”... :-)
Regressão no atendimento do Banco do Brasil
January 6, 2010 - 3 commentsEu sempre disse que o Home Banking do Banco do Brasil era o melhor. Eu sempre achei muito concisa a apresentação, com uma página inicial personalizável com os links para o que você mais usa bem a mão. Até o pequeno probleminha que o tal do “Teclado Virtual” (em Java) representava não me afetava suficiente para mudar a minha opinião. Mais importante que tudo, funcionava perfeitamente no meu Debian.
Há alguns dias fiquei ainda mais feliz com o sistema, quando substituiram o teclado virtual por uma caixa de texto… Finalmente eu podia digitar a minha senha no bloco numérico do teclado “real”. No entanto essa felicidade acabou hoje…
Hoje tentei acessar a minha conta, como sempre faço nessa época do mês. O acesso era ainda mais importante, já que tenho de fazer uma pequena transferência para saldar uma dívida que vence hoje. Uma transferência entre contas BB resolveria o problema… Mal sabia o que me esperava…
Logo após digitar minha agência e conta recebo o aviso que não foi possível instalar o “Módulo de Segurança”, sugerindo que instalasse o Java, junto com um 0800 caso continuasse com problemas. Liguei às 15:55 e depois de 8 minutos na espera, Luciane me atende. Após as confirmações de agência, conta, etc, eis o diálogo:
BB: O Java está instalado? Eu: Sim (pensamento: obviamente).
BB: Desinstalou e instalou novamente? Eu: (p: não… não estou em Windows.) Sim (menti).
BB: Qual a versão do Internet Explorer? Eu: (p: ahh… ela pensou q eu estava no Windows) Nenhuma, eu uso Firefox.
BB: Firefox… sei… Qual a versão do Windows? XP? Eu: Não. Eu uso Linux (p: isso está ficando chato).
(longos segundos depois…) BB: O senhor precisa instalar o Java então. Eu: (p: ai meu Deus!) Eu já instalei o Java! Tenho a versão 1.6.0.15!
(longos segundos depois…) BB: Mas a última versão é a 1.6.0.17… o senhor precisa atualizar. Como o senhor usa Linux, o senhor não precisa do Módulo de Segurança… é só instalar a última versão do Java e pronto. Eu: (p: pouco provável que faça alguma diferença) Ok… Eu vou instalar o negócio… se continuar não funcionando ligo de volta.
Eu sei… eu sei. Pouco provável que uma sub-sub-sub-versão do Java faça qualquer diferença. Ainda mais considerando que essa versão foi lançada no finalzinho de 2009! E que papo é esse de que “Não preciso do Módulo de Segurança”? Mas, vamos lá…

Muito bem… instalada a versão que o BB quer… Vamos a ligação. Agora são 16:42… fico na espera por mais 9 minutos e sou atendido pela mesma Luciane (espantosamente). Verificações de rotina, dou o número do protocolo de atendimento anterior e eis o curto diálogo:
Eu: Bem, atualizei o Java conforme foi solicitado, mas persiste o mesmo erro. BB: Senhor Pablo, eu vou abrir o chamado para o segundo nível entrar em contato com o senhor por que não temos mais procedimentos.
Eu: E quando eles estrarão em contato? BB: Não sei lhe informar já que é outro setor.
Bem… Longos minutos depois ela me pergunta tudo de novo (qual versão disso, qual versão daquilo, blá, blá, blá), me dá um novo número de protocolo e reafirma que o “segundo nível” vai entrar em contato comigo.
Resultado: não paguei a dívida e resolvi blogar a respeito na esperança que o credor se compadeça de mim e perdoe os juros… Enquanto isso não consigo acessar a minha conta, algo que há apenas 10 dias tinha realizado com sucesso, sem atualizar ou instalar nada.
Pra aderir ao Twitt-speech: BB #FAIL!
Eu volto a blogar sobre isso, se (1) encontrar uma solução independentemente; (2) Voltar a funcionar espontâneamente; (3) Na improvável hipótese de ser contatado por um “segundo nível”. Enquanto isso, se alguém souber a solução, comenta aí!
Debian-RS and Vincent Danjean
December 16, 2009 - No comments yetThe day before yesterday I learned that a fellow Debian Developer was visiting Porto Alegre Federal University to do some work on Parallel Computing: Vincent Danjean. People from local user group organized a last minute get-together at Cavanhas (that served as last meeting of the year) and we had the most pleasant time. Guaraldo registered the moment with his cellphone camera:

Vincent is flying back to France today or tomorrow. Hope he had a great time in Porto Alegre and have a safe trip back home.







