Blog

About mankind

Lately I have been feeling more and more grim about life in general. I think this is a culmination of facts: things I learned, things that happened, things I noticed. It has reached a point where I have very little faith in mankind, and I think that if any stupid leader decides to detonate a nuclear bomb and kill us all, the universe will end up a better place.

This might have started with me learning more about global warming and our environmental footprint. We produce *a lot* of garbage, that needs to go somewhere. It typically ends up in the oceans or landfills around the world, contaminating animals, water, plants, and, eventually, us again (but we kind of caused it, so we deserve). Even with recycling, most of the world’s garbage still ends up in one of those places. And recycling is treating the symptom, not the cause. In practice, we can produce less than half of the garbage we produce if we are just conscious about it. It does not hurt to use our own bags for shopping, use both sides of paper sheets, get a glass water bottle instead of buying the plastic ones, close the tap when washing the teeth or the hands, use less disposable items… among other things.

Then I learned about animal cruelty, which involves killing animals for food, but also for fashion items (of quite questionable taste, really). Turns out that farming for animal production is also a big factor on global warming, and turns out we don’t really need all that meat. Nutritionally speaking, we would still be ok if we ate half of the meat we eat on average. With all these different options of food around, it wouldn’t hurt to go vegetarian three times a week. Concerning fashion items, I don’t see the appeal on leather and furs, so regarding such things as luxury items is complete nonsense as it is. Put on top animal killings, it is an easy “no, thank you”. Animals are also used for testing cosmetics, so reducing the amount of those is not only healthier (for the body *and* mind), but better for the animals.

The fashion industry alone has many other problems. Many brands have sweat shops in less developed countries, where they can get things done cheaper, and don’t need to respond about labor abuse. This practice takes advantage of people that desperately need a job, and are willing to work crazy hours for little pay. Companies need profit and this is achieved in two ways: decreasing the cost for producing clothes and increasing the consumption. On this second front, they bombard us with advertisement every week, creating “trends” to be followed, forcing people to recycle their wardrobe every season unnecessarily and to have a million pieces of clothes. We simply need to realize how manipulated we are being, and start to care less about how we look, and care more about what we do.

By the way, the thing with the profit, exploitation and fake trends is not an exclusivity of fashion, but of many other industries as well. We are manipulated every day by advertisements promising more productive, beautiful, modern, meaningful lives, only so that we will buy the latest release, generate more trash, more environmental impact, and more profit. And we are not happier.

As time passed I became more and more aware of life’s randomness, and how not realizing this can lead to social injustice. If we think that all our success is attributed to our hard work (the myth of meritocracy), then we are willing to bet that anyone could have done what we did. The thing is that, not everyone is at the same starting point. Life is unfair and people are born in all kinds of situations. This can be alleviated by some policies that give the less privileged some benefits.

All of these things alone are not really distressing for me. They are problems, and I like to solve problems. I enjoy thinking about each and every one of them, learning their effects and, mostly, their causes. Many times the underlying cause is rooted on greed, on the need to have profit, and on assigning importance to unimportant measures. Many of the effects have to do with increasing the social gap and manipulation. I think that, if we put our heads together, we could take steps in the direction of improving the situation.

The distressing part, the really really distressing part, is to see how little people seem to care. They care a lot about themselves, the “market”, the “economy”. As long as money is moving, as long as they have the best deal, as long as they can satisfy their immediate needs, who cares about something that happens thousands of kilometers  or years away? Out of sight, out of mind. And so we walk towards the abyss.

 

Some sources:

  1. https://theintercept.com/2018/08/03/climate-change-new-york-times- magazine/
  2. https://truecostmovie.com/
  3. http://www.nationearth.com/
  4. https://www.beforetheflood.com/
  5. https://www.imdb.com/title/tt8457074/?ref_=ttep_ep7
  6. https://www.imdb.com/title/tt8457106/?ref_=ttep_ep19

Facebook and Banks

Just read this article: Facebook in talks with banks to expand customer service

First of all, banks do not need facebook to help them improve customer service. Anyone who has ever interacted with a bank can give a handful of suggestions that would be useful and not involve a social network or another corporation getting access to customer data. I know I did my share of filling in “feedback forms”, but these seem to go to a black hole. Instead, banks would rather collaborate with the company that has been the center of a big privacy scandal for the last year. What could go wrong? ¬¬

Second, any decent bank has a chat service for customers, usually in the bank’s website. If American banks do not have that, it is because they are in the stone age of banks. Yes, they are.

Finally, facebook may have access to the account information of some users but will not use that for “advertisement or anything”. Sure, sure…

Adobe and Microsoft

Just got a message from the IT department at work:

Reports have emerged overnight that an Adobe Flash security flaw is being actively used across the Internet to attack and compromise computer systems. The Flash vulnerability affects Windows, Mac, and Linux systems but the exploit is targeting Windows at this time.

The attack comes in the form of malicious Flash content embedded inside an Office document (Word, Excel, PowerPoint) that triggers the Flash security flaw to compromise the computer.

I am laughing inside xD

About the first women in logic workshop

About a month ago I attended the first Women in Logic workshop. I presented the partial results of a paper with Bruno Woltzenlogel Paleo on translations of resolution to sequent calculus proofs. The workshop was open to everyone, but every submission must have been co-authored and presented by a woman. In the end, the audience was composed of mostly women, with one man attending all talks (kudos Francesco!) and another showing up for one of the invited talks. As you may imagine, I’ve had long discussions with different people about this kind of event, before and after. I had my reservations as well. Is closing up in an almost-exclusive event the right thing to do for inclusiveness? What about other minorities? What exactly are we trying to accomplish? If there is a lack of women in logic, what is the root of the problem? I thought it would be worth attending anyway, not only because it was in Iceland, but to see for myself what it would be like. When the program was out, I must say I was a bit disappointed, as there was no space for the discussion of what I thought were the important questions, but only scientific talks. And those were quite diverse (you may imagine the broad range of topics when the only restrictions were logic and co-authored by a woman).

Finally the day came, and as the hours went by and presentations were given, something interesting happened. These women were comfortable. Most of the time, I could not see the usual stiffness, result of nervousness and stage fright, so commonly witnessed during presentations by both men and women in big conferences. The speakers were calm, talking in a usual speed and stopping to explain things on the board or on the slides. They looked confident. The feeling was not that of an aggressive audience, but of a supportive one. So, what changed?

In my view, it was not the fact that there were mostly women in the room. More than that, it was the mindset of the speakers themselves. Somehow they go in front of this audience thinking it will be ok, and then it is ok. Why do they think it will be ok? Maybe because these are other fellow women that get as nervous as they get when presenting to an audience of old white men. Maybe because they can finally relate to the audience. Maybe because they think that women will be less critical and nicer with the questions. Whatever reason you choose, regardless if it is true or not, if it makes you feel more at ease, it works. In the end, it is impossible to predict if the audience will be “nice”, or if you will get mean questions or harsh criticisms (ok, it might become a bit easier to predict once you get to know the people 😉 ). All you can do is think of an “it will be ok” reason to calm you nerves. Here are some suggestions that work with most audiences:

It will be ok…

  1. … it is not my PhD defense.
  2. … half of the people will not pay attention anyway.
  3. … more than half of the people are not experts in this area and I probably know more than them.
  4. … it is only 30 minutes of my life.
  5. … I can always reply honestly that I don’t know.

The usefulness of a workshop such as the women in logic one, in my opinion, is to show women that they can do this. They can go there and present and take the questions and criticisms. It is a bit more scary than presenting to the walls of your bedroom, and a little less scary than presenting at a big conference. The crucial thing is to take the next step, and get out of the women-only shell. The last thing we want is to create a clique inside this already small community of logicians in computer science.

As an after-note, lack of security is hardly a women exclusive issue. This makes me think that a larger part of the academic community could benefit from this kind of friendly low-profile workshop.

As an after-after-note, the lack of security and self-confidence is, in my opinion, the main reason why women sometimes do not pursue the careers they want. I have heard more women than men saying “I don’t think I am good enough for this”, and I say it myself sometimes. This is hard to overcome. It is good to remember that there will be people believing in you even when you don’t. Also, don’t try to do everything alone. Hardly everybody does. Ask for help. Ask for people to proof read your first papers, to listen to and give advice on practice talks, to discuss ideas for your projects… you will see how much people are willing to help, and how much you can learn from it.

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 😀