A fix for broken (physical) buttons and dead touch area on Android phones

My old Android smartphone fell too many times and had its physical buttons (back, home, recent apps) not working, which was problematic to do anything. You can go back with in-app buttons most of the times, but there is no way to switch app or to go back to the desktop.

One good fix is to use an app that will put the back and home button functions as touch gestures, for example swiping from the borders of the screen. To this avail I suggest Fluid Navigation Gestures. In case you absolutely needed to trigger the home button, for example, you can connect the phone to the computer, enable ADB, and trigger any key you would like with it.

Navigation gestures are a good fix until you realized that not even the spacebar (or the whole lower row of keyboard keys) would not work. So in the end, the real solution is to prevent Android from drawing anything in the bottom part of the screen (or, at any rate, the broken part, wherever it is — as long as it is on some side and not central). And it turns out it is actually possible to resize the screen area in Android!

Continue reading

FOSS Android Apps and my quest for going Google free on OnePlus 6

A while ago I decided I did not want to be a product anymore, and start paying for services. I started by breaking free from all the free-but-commercial company services such as Dropbox and Gmail, and ultimately ended up ditching all non open source software on my phone, doing away with anything that was Google-run.

There is an alternative: follow through as we embark on the journey of moving to Free and Open Source Software (FOSS) for Android.

Easy replacement for essential services

The problem with non-open source software is that they have to keep building new features into their products, or the market will tag them as dead. They have to keep moving, and some occasional bugfixing is not enough. On the other hand, open source software does often not have this drive. These projects’ maintainers just tend to make sure their software runs smoothly and that it has all it should have.

So, after Dropbox kept implementing useless features and, most of all, would force me to move my folder to a partition formatted with ext4 instead of ntfs, I was fed up. My first step was thus to self-host an instance of Nextcloud. I chose self-host because I wanted control and because I already had a server to host it on, but there are options where you can rely on someone else’s instance and register for a share, pretty much as Dropbox does.

And Nextcloud is really, by all means, a valid alternative to Dropbox. There are clients for all operating systems, including mobile ones, with all the needed features, and they are actively maintained. Actually, it’s more than an alternative to Dropbox! I started with just file hosting, but there are countless apps that can boost your Nextcloud instance. I added Notes and did away with Google Keep, but most importantly Contacts and Calendar so that I could sync my phone contacts and meetings not with Google, but with my own server (using the DAVx Android app, freely available on F-Droid). I also tried the Passwords app to ditch Lastpass, but the Firefox addon was not working super well (end thus ended up signing up for Bitwarden instead).

I then scouted for (paid) privacy-focused email services. First to grab my interest was Tutanota, but after using it a few days it was clear to me that they were still far from being something one could rely on as a power user (no conversations, no option to receive mails from other domains, and more missing). I then went with ProtonMail, which I am very happy with — true, some features miss there as well, but they are minor. I now have a primary protonmail address, and (as a paying user) I could link my other addresses so I handle all from one dashboard. It came with a subscription to ProtonVPN as well, so that was a nice addition. And so Gmail was gone as well.

Continue reading

The spiritual similarities between playing music and table tennis

As a fellow table tennis player and piano player, I have noticed some interesting spiritual similarities between the two arts. I’m pretty sure they are also common to other sports anyway.

Always think ahead: the next stroke, the next note

In table tennis, one should not think about scoring a point with the current stroke, but rather be prepared for the next. What ball will I get back given my current playing? What do I expect? How am I going to handle it? If we do not think ahead, we will always fall short when the ball comes back, we will not be prepared. In a similar fashion, when playing an instrument, it is vital to know what the next note will be, what the next musical phrase will be. Giving meaning to a speech is impossible if we do not know how it goes on beyond the very current moment.

Mistakes do not matter. If you make them matter, you lose

It is a common phenomenon to make a mistake followed by more mistakes, mostly in the attempt of correcting that mistake/with the case of overthinking the mistake that has already happened. It does happen to make the wrong choice when playing table tennis, or to not get our best stroke, as much as getting a note wrong. This is not a problem as long as we are able to go on and forget that single mistake. Instead, if we focus on that, we end up stressing it and it becomes much heavier.

Continue reading

FEniCS differences between Function, TrialFunction and TestFunction

The FEniCS project allows for simple solution of partial differential equations. However, getting started from examples is so quick, it is easy to miss how the inner-workings of it behave. This should not happen (especially if it is a PhD project). There are three vital pieces of the puzzle that it might not be clear what they are for, and the documentation does not help here: the functions TrialFunction, TestFunction, and Function.

The thing is that, in the usual Finite Element Methods, we only have the distinction between the trial function u \in V_h and test function v \in V, and even then the distinction is often blurry. In fact, technically, the spaces V_h and V can be different. However, most of the time we take them to be the same (for example, the same discrete space of piecewise linear functions). The names we give them is just to have clearer in our heads what role they play in the game, but we could as well say “two functions in V“. Then why would FEniCS have even a three-fold difference? You can quickly check for yourself that, for example, if you swap the TrialFunction for a Function, FEniCS will complain.

There is no documentation on the topic as far as I have found, so these are my (maybe mistaken) deductions.

The meaning of the TrialFunction is to let FEniCS know what function we are solving for. In fact, when we call

FEniCS expects to find a TrialFunction in A, which is supposed to be the function we are looking for. On the other hand, u_ is the symbol in which the result will be stored, and this needs to be a Function (not Trial, not Test, just a regular Function).

Continue reading

How to give a scientific talk

I have listened to so many talks in so many different fields and topics, that I feel confident enough to provide advice on how to give a proper talk. I have listened to talks ranging from public speaking contests to PhD level seminars. I draw mainly from science talks, but this pretty much applies to any field, really.

0. Prepare your talk

If you do not feel like preparing for your talk, then please just refrain from giving one and save the people from the hassle of listening to a terrible talk. Everybody needs preparation for a talk – their experience may make the preparation quicker, but it is still needed. No preparation, no talk.

1. Define your audience

Who is your talk for? This is the single most important question you need to ask yourself. Who are you speaking for? What background can you expect them to have? Always remember that you are giving a talk for people, so they should be your first focus. Not your work, your presentation, your show – the audience come first! Two presentations on the very same topic can turn out pretty different, if they are aimed at different audiences. If you do not plan for the right audience, you are likely to give a talk that is just wrong (and useless to the world).

The most common mistake is to make the talk too hard and high level with respect to the audience it will be delivered to. This is most usually a lack of confidence, which results in the perceived need of making something difficult to understand so that
a) people can believe the speaker is very smart;
b) make people believe that the subject is worth.
The latter is based on the widespread implicit assumption that anything that is hard to understand is worth, which is just bullshit. Beware of anything you do not understand.
It is also easy to just copy and paste some formulas or graphs and show those off, without giving away any real understanding.

So, when your talk is ready, revise the material and make sure it can be understood (to a good extent!) by a person having the background you expect from the audience. Most importantly, avoid all jargon unless it is really strictly required. And even then, question your choice of using it. It is fine to use some jargon at advanced talks, just bear in mind that if a listener has to pause and ponder about the meaning some word, you have lost them for the time being. Thus, all jargon used should be sufficiently ingrained in people’s head to come without thought.

2. Define what you want to take across

What content are you trying to deliver (if any)? List around 3 points and make sure they are thoroughly covered, and that your audience clearly understands those basic pieces of information. A good measure of success is whether 90% of the audience went home with the ability of re-telling those 3 points with clarity and sufficient detail. If not, then the talk was a failure.

Always make a point of cutting out non-essential stuff. It is true that you might be telling a year worth of work in just 30 minutes, and you may be tempted to detail all the things that make it look like you have done a lot of work, but again ask yourself: is this useful to the audience’s understanding? 95% of the times the answer is a sharp no.

3. Bring the material together and tell a story

The fact that you are communicating some objective piece of science does not mean that your talk should be dull. Of course, you should not aim for entertainment for its own sake. But still, strive to link all your material together and build a narrative with it, make clear to the audience how each piece is linked to the others. Aim to be a storyteller.

Also, a good question to cover, from the point of view of the audience, is “why should I care?”. Do not just show your work, make it meaningful to the audience.

Continue reading

The need of teaching and learning more languages

For a second, stop to think about how many languages you know. With languages, I do not mean verbal languages: rather, any means of expressing thoughts and feelings, or of expressing a dialogue. I am here do advocate for the learning and teaching of more than just one.

Our western culture is based on the verbal language – the one you can speak with your friends, read in novels, and write in essays. We educate kids in that, and yet I would argue that very few of them end up being proficient in the verbal language. Speaking a language does not make you proficient in it: that skill is a much higher level one, and involves deep knowledge of the structure of the language, exposure to thousands examples of both good and bad usage of the language, and effortful practice throughout years. Often, people who venture in learning a new language (a verbal one) do not even ever get comfortable with their mother-tongue. What I mean is that although everybody can talk in their own language, few of them have a real mastery of it. Few people, for example, are able to tell a story (and not because of lack of ideas, but for inability of structuring it), and even fewer are able to read one out loud in a way that is vaguely engaging (for example, they cannot look away from the book to the audience, and fill in any gaps in their reading my making up appropriate fill-ups).

But even if people were proficient in the verbal language, this is just one means of expression. It is barely minimum. And even though we study several different subjects at school, they are all taken across through the same verbal language. But what about other, different languages?

Musicians, on the other hand, can rarely express the feelings and the moods of a musical piece through words. They have a different alphabet, one that does not have translation to the verbal one. The fact that sometimes, some situation reminds them of a tune, or inspires them a tune, rather than words, is a clear example that the musical language is different altogether. It is incredible that we are still studying Latin and we are not all studying music.

Sports is another example where a different language is in place. The main difference between experienced and beginners in table tennis, for example, is in how they frame/live the unfolding of a point. Experienced players see a dialog in it, a conversation that ultimately leads to scoring a point. But it is exactly this sense of structure, this ability to realize how each stroke is connected and what each of them can have as consequence, that gives experienced players an unmatchable advantage. They know what is going to happen, and they know it because they are building something with that language.

Continue reading