About the world

When I was finishing my masters and deciding where to go for a PhD, I did what every student in my position would do: ask around for advice. I talked to some of my professors that did do a PhD to find out about their experiences, where they went and so on. Being a theory oriented person, I could see more attractive opportunities in Europe other than the US, and the programs looked very different (from the duration, style, tuition, etc.). When confronted with these options, I got almost unanimously the same argument:

The quality of education in the US will be better, it is a longer phd but you will leave with more opportunities and more knowledge. It will be expensive, there will be sleepless nights, you’ll have no vacations for a long time and will kill yourself to work, but it is worth it. In Europe things are much more relaxed and you will do a lot of tourism. Sure you’ll end with a PhD, but much less worthy.

I found that somehow strange… This was not too great of a case for the US, nevertheless they wanted me to go and sacrifice some years of my life for a title. Suffice to say that I did not apply for any positions in the US… In the end, I got a position in Vienna, Austria, and that’s where I went to.

Looking back, having finished a PhD in Europe and understanding better how the American programs work, I sort of see their point. I am sure you see it as well, so I will not go over that. My intention here is to say what they have not told me (maybe because most or all of them had got a PhD from an American university). Given the choice, I would *never* exchange the years I spent in Vienna and Paris for a PhD from an ivy-league school in the US. Here’s why.

I moved to Vienna alone. It was the first time I was living outside my parents’ house and I started big: other side of the world in a country whose language I did not speak. I not only had to learn how to manage my own life, but how to manage my life in a society completely different from the one I was used to. And do a PhD on my spare time. In trying to adapt, I started looking at life differently. Suddenly answers like “that’s the way things are” or “it’s just how it works” stopped making sense because here I was at a place where things were not like that and, guess what? Everything still works! (Even better sometimes…) The opportunity to travel a lot (Europe is really very small… and a bunch of different countries are just a 3-hour flight away) has contributed to that feeling. Everywhere there was something curious, something different, a new unsaid rule that everyone followed. And as we try to fit in, we test different behaviors on ourselves, and realize that many “defaults” we have can be changed to something that works better, or to something that is more “you”. It is interesting the moment you feel more at home at a place that is completely different from the one where you were born, simply because that is more in line with your values. I feel like those years were a deconstruction and reconstruction of myself, and I feel much more comfortable in my skin today than I did 6 years ago. Hopefully this will only get better with time 🙂

Sure I did learn a lot scientifically as well, and I did get a PhD, and a job. My professors might think that I got lucky. (I think so too). But even if I hadn’t got a position, and was unemployed in Vienna today, still I would not change a thing. I am a resourceful person and I could get a job eventually, even outside academia. What I have learned and how much I have grown during this experience is beyond any career-oriented measurement of success.

You might argue that the same would happen if I had moved to the US, but I don’t think so. We know too much about them. We get their music, movies, series, news, culture… From what I know, life would not be so much different from the life I had before. Also, I have lived in the US long ago. Back then, I did not realize all the nuances and particularities I noticed last semester, when I was living there for a few months again. Since we know so much, it is a hard place to feel like an outsider. Maybe it will be more comfortable, but less eye-opening.

What I want to show now, specially now, is that going to the US does not have to be the ultimate dream or the best/only choice. The world is a big place, and great opportunities are available everywhere. We just need to remember that opportunities should encompass employment *and* life as well.

Adobe is evil

Here’s why:

  1. They have discontinued Linux versions of many (all?) of their software.
    You might think “I do not use Linux, so what?” Well, do you have a mobile device? Tough luck. Adobe has also discontinued FlashPlayer for mobile devices. Imagine that all of a sudden some websites simply stop working because you do not have (and cannot have!) the latest FlashPlayer. Your loss. Who told you not to be the average user? They have also discontinued Acrobat Reader for Linux, which would not be such a big problem if they did not decide at the same time to invent their own pdf format ¬¬ (see next).
  2. They have created their very own pdf format that (surprise surprise) only works on their reader!
    They have taken a completely open and popular format and tweaked it such that pdfs created with Adobe’s products only work on their own reader. And I am not talking about special pdf features, such as forms, those pdfs cannot even be read by another software. You might find this familiar:
    screen-shot-2016-09-29-at-12-46-08On top of that, the concept of backward compatibility has completely escaped them, and forms created on version 10 only work on Acrobat Reader versions 10+, which, of course, are only available for Windows and Mac.
  3. They bypass OS configurations to prevent users from saving Adobe’s beloved pdf using the original pdf format.
    Once you have Acrobat Reader 10, you can finally open and fill in some stupid form (always a boring task). Then you might want to save it as a regular pdf (even it this means having it no longer editable) to be able to open wherever. It turns out that Acrobat Reader no longer allows you to save as pdf, only as “Adobe pdf”, and goes so far as to bypass the OS configuration and make the option “print as pdf” unavailable. Why would they do that? This is just plain mean.

Unfortunately there are still many businesses using Adobe’s softwares to create forms, and every now and then I need to find a way around it to fill them in and return. It is getting more difficult every time. All I can do is make people aware that they are using a proprietary format for their files, and thus cannot demand that everyone be able to work with the same format. And believe me, I do. If you own a business and need to distribute forms around, please be aware of this problem. Try to use other tools to generate your pdfs (LaTeX! 😉 ) or at least make sure that they are being generated in the original open pdf format.

About programming languages

After just being hired by a group that thinks SML is the only true language, I should probably not be writing this… but here we go.

Today I participated in another programming contest. Nothing official, just for the fun of it. And I decided to challenge myself and solve the first problem (a really easy problem) in a different language. My language of choice for quick and dirty coding has always been C++. It can easily read and write on standard I/O, has a bunch of libraries and data-structures available, and you can compile and have an executable file with a simple g++ code.cpp. No weird keywords or classes, no linking of funny libraries, no console, just a plain binary file ready to be run, and most importantly, run fast!

But there are all these fancy languages around, so I decided to go ahead and see how they would perform (or better how I would perform with them). The problem in question was a simple one. Given a very big number (up to 10¹⁶), we had to transform it in a funny way (reverse and rotate digits — e.g. 6 becomes a 9) and check if the original and the transformed numbers are both primes [1]. The primality test is the first thing that pops out. Maybe I need to implement a fast primality check algorithm? That’s not the case for this problem, the silly one that checks for divisor between 2 and the square root of the number should work just fine (the time limit is 2s). The problem there is the size of the number. Remember that a 32 bit integer can only hold up to 2.147.483.647, a 10 digit number. So we just need to use a 64 bit integer and it should work just fine. Same algorithm.

My first attempt was to implement it on my English of programming languages (not my native language, but another one in which I am quite fluent): OCaml. The code looked nice, apart from some weird castings from int to float and then to int again because, apparently, sqrt and exponentiation only work on floats (what happened to polymorphic functions? wait… it gets worse). After implementing all my recursive functions beautifully, I tested on a few cases and made sure it was working. Then I tested on the biggest possible input and it worked. Great! Submit… runtime error. 🙁 Turns out that, although my machine is 64 bits, the server is 32, so the integers there were overflowing. All I needed to do is use OCaml’s “long int”. I found two libraries: Int64 and Big_int. Since Big_int had more operations (like sqrt and exponentiation), I went for that one. The problem was that, since I was no longer using int, I was no longer allowed to use + or – or /, no no no. I had to use add_big_int, sub_big_int, div_big_int, and so on. My pretty non-verbose functions were ugly 🙁 . With that came a million type errors, I had to add castings everywhere and link a library when compiling. The thing was just horrendous.

This was more than one hour into the contest. So I decided to try a different thing.

Integers of arbitrary precision? Let’s take a chance on my German of programming languages (I cannot quite speak it but really wish I could): Python. It took me an hour to write a 50 line code, since I had to kind of learn everything from scratch, but I had a working program. In the meantime I learned the hard way that Python and recursion do not go together. It was working for the biggest possible input, and it is Python, so if it needed a longer integer it would switch at runtime. Great! Submit… memory limit exceeded. What? Reading here and there I decided that using range() was the thing to blame, so I switched to a strange islice thing. Submit… time limit exceeded 🙁 Come on!

By the time the contest ended I had two beautiful pieces of code in two different languages that just did not work because of technical reasons. Don’t get me wrong, I am sure these languages have their place and are really good for some stuff. But for coding something easy fast and efficiently, I’ll stick with the good old C++.

Out of curiosity I checked what language the other people in the contest were using. Note that these are all people at least 5 years younger than me, possibly 10, still undergrads in CS. And what were they using? C++!! It is quite impressive, since I am pretty sure they learn programming in Python first, and then go ahead to C or ML. They could choose any of the fancy modern languages, but decide to stick with C++. To show that I do not have a biased sample, just check the statistics of websites like codeforces, spoj or UVa.

To think that I learned how to program in Java (it was the latest thing) and nowadays kids are learning how to program in Python (it is the latest thing), the persisting use of C++ says something about it. A colleague referred to C as an honest language. I think C++ is fits this description too. No fancy stuff, it is the thinnest layer between you and assembly code, and it does the job pretty well.

[1] Problem K here.

About obesity

I am taking the opportunity of being at CMU for a semester and attending a course on behavioral economics and public policy. Behavioral economics is a topic that caught my attention a while ago and it’s been interesting to see it under the lens of public policy. The course is quite American-centered, and being a non-American (or “alien”, as the government likes to call me) makes it only more interesting. I am trying to understand what is the mindset, what is the “normal” around here, and I am still in awe every now and then. It’s a good state to be in. But anyway…

Today in class the subject of obesity was briefly mentioned. It is seen as a public health problem, and we were studying ways (read, public policies) to motivate people to loose weight. But that’s treating the symptom, not the cause. I like to treat causes, seems more effective. So, for the reasons why obesity is a problem, it was mentioned: decrease in food prices (specially unhealthy food), lack of time (arguably not true, we just suck at time management), sedentary lives, working parents and larger portions (why America? why??). We might add dining out and drinking soda like crazy to that list, as discussed here. Fair enough. These all look like reasonable reasons for a less healthy diet and consequent increase on obesity. Then I had an epiphany: those reasons are not America-exclusive. People are more stressed everywhere, both parents are working everywhere, sedentary lives are everywhere, cheap fast food and soda is available everywhere. So what creates this enormous demand for big portions of deep fried chicken in America specifically? [1]

Unfortunately I do not have an answer for that. What I know is that the unhealthy eating seems to be an acceptable thing. I never saw so many ads for food as I see it on TV here. Really. If you are ever in the US and have a chance to watch some TV, do it. Even for half an hour. It is an interesting experience (not only because of the food ads). I have the feeling that one in every three ads is about food. And not healthy food: fried chicken, giant burgers, 2 feet (~60 cms) pizza, a burrito stuffed with three types of different melted cheese, pancakes made with buttery croissant dough, chocolate cookies filled with more chocolate and marshmallows… you name it. Ironically, another third fraction of the commercials are dedicated to medicaments. As if it is not enough to bombard people with ads for greasy and processed food, they go to the next level and actually *scorn* healthy eating. Just take a look at this or that. Americans, do you have any idea how absurd it is to have an ad like that? This should have never ever been approved!! I would boycott Domino’s if I ever ate there.

I am not sure if these ads can be counted as a cause or effect of obesity, it is a chicken-and-egg problem. What I know is that regulating such things properly will do no harm, but only good [2]. It’s a no-brainer. On top of motivating people to loose weight, how about cutting on the temptation for eating in the first place?

[1] As a side note, Brazil is also not the healthiest country around. And I lived there, and even so I cannot explain what happens… Seems to be a cultural thing (that needs to change!).

[2] Regulation is needed when people lack the common sense and allow such horrendous ads. Unfortunately, those that make regulations are also people.

About questions

I used to think that people, in general, had problems when it comes to asking questions. What was my surprise when I recently realized that, in fact, we also have problems in *getting* questions! Given the important status questions have for the exchange and construction of ideas [1], it is really a shame that we both don’t like to ask questions or receive them.

You might be very familiar with the feeling of holding back a question because you might sound [insert here whatever adjective works best for you]. But being asked? Yes. It turns out that instead of listening a question as it should be, i.e. just a question, we add our own interpretation to it and reply (or not) to that. We see questions as criticism, as challenges, as disagreement… but have you ever thought that it might be, in reality, *just* a question? (In spite of what your biased self might “notice” about language, tone, etc.)

Try that for a while. Get rid of your prejudices and take the questions as they come. You will see life becomes much much lighter. Answer sincerely (even if it means saying “I do not know the answer”) and ask sincerely (even if you think it’s a [same adjective as before] question). You will notice how communication improves, how it is possible to have an argument without it getting to your head and how everyone feels less intimidated. It’s good all around!

And if it just so happens that someone does have an ill-intended question, you can see the disappointment in their eyes with your honest answer 😉


[1] I must leave here a special thanks to my classmates from grad041, who taught me the importance of argumentation, and that friendship is independent of agreement. There are very few circles where questions are so well received as with these people 😀

O Banco do Brasil é o banco mais seguro do mundo (4)

Na última vez que voltei ao Brasil, me deparei com uma pilha de correspondências do Banco do Brasil pra mim. Não só ele quer que eu vá na agência, mas também me manda carta. É um banco romântico! Não se fazem mais bancos como antigamente…

O que acontece é que, todo mês, o BB manda um extrato de investimentos pra eu saber o que anda acontecendo. Já que eu não consigo ver muita coisa online mesmo naquele site super bem implementado. Eu achei um desperdício aquele tanto de extrato. Desperdício de papel, de tinta de impressora e de tempo do carteiro. Decidi tentar cancelar o serviço.

Primeiro busquei como fazer isso online, mas a gente já viu que o BB não é muito da era tecnológica. Eles gostam mesmo que a gente vá na agência, dê oi pro gerente, conte como anda a vida… Eu dei mais uma chance pro telefone. Liguei lá no 4004 comemorando que eu estava no Brasil e o número finalmente funcionava. Aí ele me pede uma senha de 4 dígitos do telefone. Aí eu digito a senha (que, de novo, por um milagre eu lembrei) e, tádá! senha bloqueada! “Por favor compareça a uma agência para o desbloqueio.” Ok. Dessa vez eles me pegaram. Não tinha como escapar.

Fui da agência (sem o computador dessa vez, aprendi minha lição), peguei a senha e dos 5 gerentes que estavam lá, dois estavam conversando com outros clientes, dois estavam batendo papo entre si e outro estava fazendo não sei o quê. Esperei uns 20 minutos numa fila com duas outras pessoas na minha frente. Afinal de contas, agência cheia né, eles ficam inventando motivo pra gente ir lá… Fui atendida, refiz a senha do telefone (que a essa altura do campeonato já está bloqueada de novo) e pedi pra cancelar o recebimento de extrato.

Não não… Cancelamento de recebimento de extrato é feito no caixa eletrônico. Mentira! Existe mesmo um serviço que é feito *só* no caixa eletrônico e não dentro da agência? Eu quase caí pra trás quando me falaram isso. Vamos ver finalmente como funciona qualquer coisa automatizada nesse banco! Uhuuu!

Saí da agência, peguei outra fila pro caixa eletrônico. Coloquei o cartão, digitei a senha, sílabas, aniversário, ano de nascimento do pai, número do sapato da mãe (não pode sempre fazer as mesmas perguntas né?), três pulinhos e uma voltinha. Voilá! Serviço cancelado. Como eu saí em menos de um mês, não sei de fato se os extratos pararam de ser enviados, ou se meu pai tem queimado eles quando chegam temendo pela minha sanidade mental…

O Banco do Brasil é o banco mais seguro do mundo (3)

Da última vez que estive no Brasil, comprei uma coisa via internet e precisava pagar a conta. Como só tenho um cartão de débito, tive que usar o bom e velho boleto bancário.

Tentativa de pagamento 1: pagamento online, claro. Mais fácil e conveniente, funciona sem sair de casa. Entro no site, peço o código, recebo o código, autorizo o computador… A gente já sabe o esquema. Vou pagar, digito 5 mil números do código de barra e… operação não permitida. Por quê? Não sabemos… nunca saberemos.

Tentativa de pagamento 2: vou em uma agência pagar no caixa eletrônico. Era sábado. Passei pela porta giratória com um detector de metal, fui num caixa… em manutenção. Fui em outro caixa… manutenção. Na verdade nenhum dos caixas onde eu podia realizar pagamentos estava funcionando. Havia um segurança dentro da agência que me informou que os caixas estavam sendo abastecidos de dinheiro. Ele não sabia me dizer quanto tempo levaria. Pessoal trabalhador né… enchendo caixa no final de semana.

Tentativa de pagamento 3: voltei no dia seguinte. Os caixas pareciam estar funcionando, as pessoas estavam fazendo operações normais e tudo mais. Fui feliz com meu boleto em um deles. Coloquei meu cartão, digitei a senha, sílabas (que por um milagre eu lembrei de cabeça), data do meu aniversário, nome do pai, nome de solteira da mãe, endereço do avô, raça do cachorro e tudo mais que ele queria saber (também dei um tchauzinho pra câmera só pra eles terem certeza que eu era eu!). Digito 5 mil números do código de barra e… operação não permitida! Não vamos perguntar porquê. Um colega ofereceu pagar pra mim online mas eu não quis arriscar. Vai que o banco não me deixa sacar o dinheiro pra pagar ele…

Tentativa de pagamento 4: ir num caixa à moda antiga. Era tudo que eles queriam, finalmente me fazer ir a uma agência! Falar com uma pessoa ao vivo e a cores! Nesse dia eu estava com meu computador na mochila, e o computador não cabe na caixinha pra deixar chave e celular que tem do lado do detector de metais [1]. Nessa agência não tinha escaninho. Eu estava literalmente na rua, com uma mochila com computador, tentando passar por uma porta giratória com um detector de metais [2]. Aquilo não ia funcionar. Bati no vidrinho da agência até um segurança me ver, apontei o computador e a porta, e ele apertou qualquer coisa lá que desativou o detector de metais e me deixou passar. Entrei na fila do caixa, passei por uma menina que está lá só pra clicar umas opções bestas numa telinha e me dar um papelzinho com a senha. Minha senha foi chamada. Fui no caixa. A moça do caixa não pareceu tão contente assim em me ver… Paguei a conta. Sucesso!

Agora pensa se eu tivesse dado o azar de precisar pagar alguma coisa não estando no Brasil hein? Afinal de contas, foram apenas quatro tentativas e pronto!

[1] Se pagar uma conta já é difícil, entrar no banco também tem que ser, oras.

[2] Talvez eles tenham problemas com pessoas que usam computador? Olha que é uma boa teoria hein!

O Banco do Brasil é o banco mais seguro do mundo (2)

Mais um conto da série.

Eu tinha mudado pra Viena há pouco tempo quando precisei acessar minha conta do Banco do Brasil online fora do país pela primeira vez. Isso devia ser meados de 2011. Se você está lendo isso na ordem, deve saber pela última história que toda vez que preciso acessar o site do BB, tenho que receber um novo código de autorização do computador no celular.

A primeira vez que isso aconteceu e eu estava fora do país, o único celular cadastrado na minha conta era o meu antigo, que já não existia mais. Tinha então que cadastrar um novo telefone (que só pode ser do Brasil), e pra isso, adivinha? Tenho que ir na agência! Esse pessoal deve gostar muito de atender cliente. Imagino que chegarei lá e estarão todos de braços abertos com um sorriso enorme me esperando…

Com sorte eu tinha deixado uma procuração com meu pai que basicamente dá direito a ele ser eu pra qualquer coisa. Então ele me fez o favor de ir na agência ser eu e cadastrar o número do telefone dele na minha conta. Pelo menos agora eu vou poder acessar minha conta de vez né? Ah vou…

E quando eu precisei acessar a conta e o meu pai estava me visitando fora do Brasil? O celular dele não estava funcionando e portanto não consegui receber o código. Decidi usar o bom e velho telefone, e depois de um bom tempo procurando um número que (1) funcionasse via Skype [1] e (2) não precisasse da senha do telefone que (surpresa!) estava bloqueada, consegui falar com uma pessoa. Após confirmar todos os meus dados, ela me perguntou o que poderia fazer por mim e eu pedi pra ter acesso à conta online. Ela me disse que não era possível. Por que não? Porque não tinha como ela ter certeza de que eu era eu. Você sabe, medidas de segurança né… Vai que tem alguém com um revólver na minha cabeça pedindo pelo amor de deus por um código pra desbloquear o computador pra eles poderem… hmm… ver meu saldo? [2] [1] Números 0800, 4004 e cia não funcionam via Skype.

[2] Parece que essa é a única operação que eu consigo fazer de todo jeito. Terceira historinha aqui.