Soluções mágicas

Posted by – 29/04/2012

Todos somos fascinados por soluções mágicas. É da natureza humana acreditar em magia e existem diversas teorias versando sobre a causa desse fenômeno. Esse post não trata de nenhuma dessas teorias. Quero tratar de outro assunto no qual também parece que as soluções mágicas estão em voga durante muito tempo: a ideia de que, para melhorar a Saúde Pública no Brasil, precisamos de mais médicos.

Essa ideia só pode ser advinda de uma impressionante falta de informação. Já se foram os tempos em que o médico era um “lobo solitário”, que sozinho resolvia qualquer problema. Essa transformação da medicina de uma atividade individual para uma atividade coletiva deve-se a diversos fatores que, sozinhos, já renderiam um livro. Para encurtar a história, basta mencionar o ritmo galopante em que as coisas mudam na Medicina, a quantidade de informação necessária para que um médico esteja atualizado e o progressivo aumento da complexidade do tratamento das doenças. Adicione a isso a descoberta de um imenso “filão” de rendimentos representado pelos processos médicos e você tem a situação em que a Medicina se encontra hoje: nenhum médico quer praticar a Medicia sozinho e sem recursos.

Entendendo apenas superficialmente os motivos acima já é suficiente para compreender por que é tão difícil para um médico em início de carreira decidir praticar a Medicina longe das capitais. Coloque-se momentaneamente no lugar desse médico e imagine que você está indo para um ambiente com menos recursos do que os que você dispunha enquanto estava fazendo a sua formação; você dispõe de menos colegas com quem discutir um caso difícil (muitas vezes, no caso dos especialistas, você está indo para um local em que o único que entende de um dado assunto é você! – o que, de quebra, ainda garante uma quantidade de trabalho muito maior); e sobre cada decisão que você tomar nesse ambiente, você está se arriscando a perder tudo o que conseguiu – incluindo a sua reputação – por um processo desses propostos por “advogados de porta de hospital” (no mínimo perdendo a paz durante longos meses de briga judicial).

No lugar daquele médico, você iria para longe da capital?

No entanto, a população parece comprar a ideia que o governo vende de que faltam médicos no Brasil. Ora! Não faltam médicos! Eles estão, isso sim, mal-distribuídos. Concentrados onde sentem segurança de praticar a Medicina com o padrão de qualidade que a população merece.

Não é uma questão de mercado que se pode resolver aumentando a oferta de profissionais! Tudo o que estamos fazendo ao abrir ainda mais uma faculdade de Medicina é reduzir o ganho (já bastante reduzido) dos médicos que atuam nas capitais. Não se enganem! Ninguém vai sair da capital em busca de melhores salários no interior se isso representar ter de praticar uma Medicina de pouca qualidade ou se isso representar se expor aos riscos que descrevi acima.

Tudo isso serve para mascarar o problema e vender uma solução mágica: ao invés de investir em proporcionar recursos para que os médicos assumam com qualidade postos de trabalho fora das capitais é muito mais fácil colocar a culpa na “falta de médicos” e abrir mais uma faculdade de Medicina (e lucrar todos os benefícios eleitorais que tal atitude certamente trará).

Por isso quero fazer eco ao artigo do ex-Ministro da Saúde Dr. Adib Jatene: abrir mais vagas nas faculdades de Medicina, ou criar novas faculdades, não vai resolver o problema da Saúde Pública no Brasil.

Será que não aprendemos com nossos erros? Por quantos planos econômicos heterodoxos o Brasil teve de passar até adotar o caminho da ortodoxia com o plano Real? Nossos governantes têm uma inegável inclinação pelas soluções mágicas… “basta cortar alguns zeros”… “vamos confiscar as poupanças que a inflação vai cair”. Ora! como disse Mário Henrique Simonsen: “o que só tem no Brasil, e não é jaboticaba, é besteira!”. Essa solução de abrir mais vagas de Medicina é exatamente isso: mais do mesmo. Mais uma solução mágica para um problema real.

Por favor! Vamos tentar ser realistas. Admitir que o problema real pelo qual a Saúde Pública passa precisa de uma solução real é um bom primeiro passo.

Fork me on GitHub

Timeout a process in Bash > v4

Posted by – 19/04/2012

Just for reference, this is really useful:

( cmdpid=$BASHPID; (sleep 10; kill $cmdpid) & exec some_command )

Update Apr 20, 2012 @ 16:54: As pointed in a comment by Timo Juhani Lindfors, if “some_command” exits early and the interval is long, another process can reuse its process number and get killed once the sleep runs out. Does anybody know a better way of doing that without using timeout from coreutils (better yet: using just bash)?

Key Signing Party at FISL13

Posted by – 16/04/2012

You know the drill. Official announcement is here (or here in portuguese). Anybody planning to drop by FISL13 should submit a key.

Tem coisas que nem a Philco faz pra você

Posted by – 04/04/2012

Como vocês sabem, troquei de laptop recentemente e descobri que o sistema de recuperação empregava uma partição Debian rodando Partclone Clonezilla, ambos Softwares Livres. Constatei, também, que o código-fonte desses softwares livres não era fornecido junto com a partição, nem era documentado nos manuais que vieram junto com a máquina ou no site da Philco. Na ficha técnica do produto, não há nem menção sobre esses softwares.

Inicialmente não achei nada de mais… Afinal, imaginei que quando contatasse a Philco ela ou iria me fornecer o código-fonte, ou iria me apontar para o site original (segundo bem lembrou o Antonio Terceiro, isso seria insuficiente, mas eu até estava preparado para aceitar isso). Se eles me apontassem para o site do Clonezilla, eu já estaria feliz. Pois bem… nada disso.

Entrei em contato pelo formulário do site… sem resposta. O SAC da Philco não tem email publicado no site, então, entrei em contato com o 0800. O atendente me segurou por 45 minutos antes que eu desistisse. Com o velho e bom whois, descobri um email da Britânia (A Britânia é de fato a fabricante, uma vez que comprou a marca Philco no Brasil), para o qual enviei a seguinte mensagem no dia 28/03/2012:

Olah,

No dia 07/03/2012 comprei um Notebook Philco 14E-P686WP da Ricardo Eletro (NF n. XXXXXX). Deixe-me adiantar que estou achando uma excelente maquina e estou muito satisfeito com a compra. No entanto, eu naum uso Windows (o sistema operacional que vem por padrao na maquina), e usei a particao principal para instalar o sistema operacional que eu uso regularmente.

Ateh aqui naum temos problema algum. No entanto, percebi que existe uma particao de recuperacao que tem a imagem do Windows 7. Eu decidi manter essa particao (em um futuro, caso eu queira me desfazer da maquina, essa particao pode ser util). Qual naum foi a minha surpresa quando percebi que nessa particao estah instalado um sistema operacional livre (Debian) que executa um aplicativo livre (Partclone) que, por sua vez, recupera o Windows. Aqui eh que comeca o problema…

Tanto o sistema operacional Debian quanto o aplicativo Partclone saum softwares livres. O Debian, possuindo diversas partes licenciadas sob a GPL, assim como o Partclone inteiro eh licenciado sob a GPL. Essa licenca obriga aos distribuidores que fornecam o codigo-fonte, de preferencia junto com a distribuicao (no caso, o codigo deveria vir na particao de recuperacao), ou sob solicitacao do cliente.

Em 15 de marco de 2012, entrei em contato atraves do formulario no site da Philco e naum obtive nenhuma resposta. Hoje, entrei em contato com o SAC atraves do 08006458300, aproximadamente as 14:20, e falei com o Cristian. Esse atendente naum soube me responder e me deixou na espera por 45 minutos (antes que eu proprio desligasse). Como naum encontrei nenhum email da Philco, estou entrando em contato atraves desse email para solicitar o codigo-fonte das ferramentas em software livre que estaum embarcadas na particao de recuperacao, em cumprimento com a licenca sob a qual esses softwares livres saum distribuidos.

Obrigado,

Imaginando que algum MUA aceitasse me avisar da leitura, adicionei os headers Return-Receipt-To, X-Confirm-Reading-To, Disposition-Notification-To, Delivery-Receipt-To. Sei que murilo…….@britania.com.br a recebeu no mesmo dia e que paulo……@philco.com.br a recebeu no dia seguinte. No entanto, até agora nada! Eles poderiam me responder simplesmente: “é um Clonezilla padrão, só que usamos como imagem a do Windows 7″ (ainda assim eu ia pedir o código)… mas preferiram me deixar sem resposta.

Aparentemente, tem coisas que nem a Philco faz pra você.

Using Gmail anti-spam with mutt

Posted by – 29/03/2012

OK, this is not another post on how to use Mutt and Gmail. This is just to comment on a feature I found in Mutt that was not obvious, and that helped me to stop running my own anti-spam tool.

So, for a number of reasons, my company stop filtering spams. I was setting up dspam to take over that job when I decided that it was just too much pain for a single account. Besides, although I am spammed a lot, I would never possibly be more efficient than Gmail anti-spam, given the load of emails their users classify everyday.

I am not migrating my old emails over to Gmail, though. And I am pretty comfortable with my current email work-flow… I am simply not going to use a webmail (even one as powerful as Gmail). OK, I am using GNOME 3 after being a Fluxbox and Bluetile user, but everything has a limit…

But how to keep the best of both worlds? And, more important, how to do that with minimum disruption of what I already have (my own IMAP server and Mutt managing my account there as spoolfile)? The answer is a little known trick using the “mailboxes” directive in .muttrc.

This directive accepts a fully-qualified imap mailbox address. So I just added something like:

mailboxes 'imaps://gmail-user:gmail-password@imap.gmail.com:993/[Gmail]/Spam'

and added some shortcuts to save email from my inbox to that mailbox (the same as train-as-spam) and to rescue email from it (the same as train-as-ham):

macro index <F3> ";Wo;Wn;simaps://gmail-user:gmail-password@imap.gmail.com:993/[Gmail]/Spam\n" "Train as SPAM"
macro index <F4> ";Wo;Wn;simaps://gmail-user:gmail-password@imap.gmail.com:993/INBOX\n" "Train as HAM"

and that was it. In my IMAP machine I got a fetchmail downloading emails from Gmail’s INBOX so I can get trained-as-ham and new emails (all emails arrive first in my Gmail account) into my IMAP server. All my sieve rules are in place and nothing changed in my email work-flow.

It’s been working flawlessly for a week now. The only drawbacks are (1) Gmail knowing everything that arrives to me (not a big deal, since unencrypted emails aren’t private anyway), and (2) not getting the spam-count once Mutt is run: I have to change into that mailbox to log-in to Gmail.

Update: Mar 30, 2012 @ 18:15: I just found out that drawback number (2) above can be fixed by adding the following to .muttrc:

unset imap_passive

Annoyed by F10 key in gnome-terminal?

Posted by – 23/03/2012

I am one of those people that like to map Fx keys to special functions. After all, that’s what F-unction keys are for, right?

So, one of the first things I do once I have to configure a new Desktop is disable F10-capture by gnome-terminal. It has been working flawlessly, until I begin using GNOME3. No matter what, F10 was still being captured.

I found that this is a bug and that adding the following:

@binding-set NoKeyboardNavigation {
	unbind "<shift>F10"
}
 
* {
	gtk-key-bindings: NoKeyboardNavigation
}

to ~/.config/gtk-3.0/gtk.css serves as a workaround.

Hope this helps people with the same problem.

GNOME 3 is like Vim.

Posted by – 22/03/2012

You might know that I am testing GNOME 3. So far, so good. I was a little annoyed by the not-obvious and undocumented have-to-add-user-to-pulse-and-pulse-access procedure and the keyboard-shortcut-settings-bad-design-bug, but now sound works and my usual shortcuts are in-place…

I found myself liking the environment, but not sure about why I was liking it. I was always a minimalist user. At one time I convinced myself X11 (or Xorg) served as a terminal multiplexer… but now, GNOME 3 is changing that with its unobstructiveness (is there such a word?).

One thing that might be selling GNOME 3 to me is that it resembles Vim, my beloved text-editor and multipurpose IDE. Just think about the “Overview” mode as a command-mode in Vim. While working in Vim, I focus in one thing at a time, and everytime I want to do some “meta” thing, I Escape to the command-mode. It’s just the same in GNOME 3: “Overview” let me do “meta” things and gives me the whole power of the Desktop in one screen.

I am not sure I am going to keep GNOME 3… But thinking it’s like Vim is a compelling argument.

Time to change Window Manager again?

Posted by – 18/03/2012

Ten years ago I was a fan of NEXTSTEP desktops and a die hard user of Window Maker. I love dockapps, and used to collect them.

Things changed, and, as I moved from Desktops to Laptops, I began using simpler Window Managers. The powerful keyboard-shortcuts Fluxbox along with its capability to join windows with tabbing won me over and I began using it in my Laptop, while preserving Window Maker in my Desktop. In time, Fluxbox were used in both sides.

Then the netbooks came and I bought an EeePC. The screen was so small that even the non-obstructive nature of Fluxbox were not enough. I began to try tiling window managers and I settle for Awesome. I was using Fluxbox in my Desktop and my Laptop, but Awesome was running in my Netbook. Tiling was making a lot of more sense and I could be productive, even in a small Netbook. Eventually, I started using Bluetile in my Laptop. Also, Bluetile was written in Haskell, and I was interested in Functional Languages by that time…

Now I got a new Laptop, and, since it features a Realtek 8191SE Wi-fi card, I had to install Wheezy (in my laptop, I usually run stable). Wheezy comes with the new GNOME 3 desktop, of which I read a lot.

I decided to give it a try. I am missing advanced tiling (it seems that GNOME3 tiling works just in the side-by-side approach)… and I also think that creating custom launchers should be improved… but so far I am not disliking it, which is a good step toward adopting it. I’ll give it a week to convince me. Let’s see how it works its charm on me :-)

Windows Laptop with Debian Recovery Partition

Posted by – 15/03/2012

I was playing with my new Laptop (a Philco 14E-P686WP) that comes with (argh!) Windows 7. I was gathering information in order to avoid surprises with regards to drivers and hardware-compatibility so I can proceed with the Debian installation… By doing that with a new machine, I, usually, peek and poke everywhere, including the Recovery System.

I was shocked to find out that this (argh) Windows 7 laptop has a bootable recovery partition loaded with a customized Debian just to run Partclone which installs a Windows factory image. I was about to take some pictures of the process, but I managed to find some in a forum post.

Debian is being used to re-install (argh) Windows… How sad is that! ;-)

Migrating from Mephisto to WordPress

Posted by – 12/03/2012

Just as I promised yesterday, I pushed a new git repo with my fork of the tool I used to migrate my old Mephisto blog to this new WordPress one.

I forked because the tool have not worked the first time. First of all, I was missing uuidtools gem, and to install it would be a pain inside the jail system I used to run my blog. Too much trouble just to get a UUID we can get by other means… so I just added an environment variable UUIDGEN anyone can use to point to a tool to do the job. I know this have performance implications, but I am not talking about 10-thousand entries…

Then, I found out that, for some odd reason I still have to understand, WordPress was cutting my articles everytime it read a “à” character. I could study the subject, but I just added a #gsub in mephisto-to-wxr code and moved on. I was about to remove it from the repo, but I left it there since it could help other people. Also, since there might be other similar occurrences, leaving it there serves as a heads up.

Also, I added support for Categories and Tags to mephisto-to-wxr, that seemed to be limitedly accepted (I translated Mephisto Sections into WordPress Categories).

All other activities were just clean-up. That tool generated a .WXR with all the articles and comments from my Mephisto blog. Everything I had to do was import it using WordPress import tool.

I am back, again

Posted by – 11/03/2012

Wow! It’s been a lot of time since I last blogged. This have a lot of explanations. It’s quite interesting how things in life tend to happen in clusters. I surely hope the cluster of stressful things has ended and a new cluster of (hopefully) better things is beginning. Never mind… the past is the past.

Nothing better than to change blog engine (again) to mark the occasion. I finally give in and got into WordPress. It was a pain to manage the semi-defunct Mephisto I’ve been using. Please, don’t get me wrong, I still love Ruby (and Rails), but with so many things happening, I finally realized I don’t need the job of managing a blog engine. So I’ll just leave this to the people behing WordPress, since they are doing a great job so far.

The good thing is that WordPress has a theme that looks very much like the Scribbish theme I was already used and became much fond of… so people may not even notice the difference. The migration process has not been perfect though. Some things may still be broken (and if you notice one of these things, please drop me a note about and I’ll try to fix it). In another post I’ll tell how I did the migration, since this information might be useful to someone else.

It’s good to be back…

Swiss Tournament in Ruby

Posted by – 03/02/2010

Being 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

Posted by – 28/01/2010

Folks 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

Posted by – 13/01/2010

Why 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

Posted by – 06/01/2010

Eu 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í!