After the fever

After four months of hell, the fever withdrew deep within,

Past the point of no return, and now it was impossible

to remember how it had filled Earth,

like a balloon gorging with fresh air.

Far ahead the traffic thinned out – so we sat

on the front porch enjoying the silence.

We listened to Edith Piaf press her voice,

till it quivered against the microphone.

The heavy book I held between my hands

was there to stay, never opened;

it was there only to keep me dry.

When the last song ended, the notes dropped

from their grandstand back into the soil.

Then early in the day the sky grew noticeably darker.

Advertisements

Visualizing your friends’ activity on Messenger

Sometimes I don’t like Facebook. For instance, I’ve never understood why they basically force you to display your active times on Messenger (to all your friends). This is typically the kind of sneaky behavior I wish never existed.
To show the entire world how easy it is for any of your friends to track your Messenger activity, I wrote a small Python script that calls Selenium, logs into my personal Messenger account every 10 minutes, and records the last active times of my friends. The data is stored locally in a JSON file. The full code is available on GitHub.

Disclaimer: Let’s be clear: I do not encourage personal use of this tool. I have decided to publish it for educational purposes only. Most of my friends and family are simply not aware of how much of their private information is being shared online without their knowledge. As such, the goal of this utility is certainly not to spy on your friends but to raise awareness about privacy concerns on Facebook.

I ran this script for one full week, then I analyzed the results. And I shared them with some of my friends who were interested in seeing their own logs. For instance, viewing her log helped my sister estimate how much time she spent on Messenger daily, and gave her fairly accurate information about when she went to sleep and woke up! It even make my little sister decide that she’d have to reduce the time she spends online on Messenger, which is a prowess in its own right.

Now let’s have a look at the anonymized log of one of my Facebook friends:

log

On this example, you can guess that the person goes to sleep around 11pm on weekdays, and she seems to have a habit of being active around 3am. She is generally active for 1-2 hours per day. This last estimate I built from the information I scraped every 10 minutes, so it should be taken with a grain of salt.

In this post I have shown how easy it is to track your friends’s online Messenger activity. Given that many people check Messenger just after waking up and just before going to bed, this should give direct access to their sleeping habits. I have no idea what Facebook is doing with this data, but I can only imagine…
I certainly am not the first person to think about this. In 2016, Danish software developer Søren Louv-Jansen built a similar tool (with a more elaborate graphical interface), and then published an article about it.

What can you do to prevent this? First, and this may seem like an obvious recommendation, but it helps to only have people who you really know as Facebook friends. Secondly, it turns out that there are ways to hide your activity, at least when you are using a computer (e.g. the Chrome extension Unseen ). For an iPhone user, following the steps here might work, but I have not been able to confirm them by myself. That being said, there may be ways to tweak your phone’s internet settings and block the Facebook URLs used to send the activity requests, but I’m not aware of any simple way to do this (and certainly not on an iPhone). The most effective solution may well be… to stop using Messenger altogether.

A puzzle by Andrei Zelevinsky

While I was reading Tanya Khovanova‘s blog I came across this problem which Andrei Zelevinsky reportedly put in his list of important problems that undegraduate students should think of. The problem reads:

Consider a procedure: Given a polygon in a plane, the next polygon is formed by the centers of its edges. Prove that if we start with a polygon and perform the procedure infinitely many times, the resulting polygon will converge to a point.

I’d like to present one solution in the rest of this post.

One way to solve this problem is to use complex coordinates. Denote by z_1,...z_n \in \mathbb{C} the points. One iteration of the process yields the points (\frac{z_1+z_2}{2},\frac{z_2+z_3}{2},...,\frac{z_{n-1}+z_n}{2},\frac{z_n+z_1}{2}). More generally, the m-th iteration yields the points \Big( \sum_{l=1}^n a_{i,l}^{(m)} z_l  \Big)_{1\leq i\leq n}, where
a_{i,l}^{(m)}= \frac{1}{2^m} {\displaystyle \sum_{\begin{array}{c} 0\leq k\leq m\\ i+k\equiv l[n]  \end{array} }}\binom{m}{k}.

Now we can prove that the a_{_i,l}^{(m)} tend to \frac{1}{n} as m\to \infty, independently of i and l. To see this let us take the example of i,l=0, WLOG. A straightforward calculation using the m-th roots of unity gives a_{0,0}^{(m)}=\frac{1}{2^m}\sum _{0 \leq k \leq n-1}(1+\omega ^k)^m=  \frac{1}{K}{\displaystyle \sum_{k=0}^{n-1}}\cos^{m}\frac{k\pi}{n}e^{\frac{ik\pi m}{n}};

This means that the procedure converges to a unique point which is the barycenter of the n original points, which concludes the proof.

In the next variation, instead of using the centers of edges to construct the next polygon, use the centers of gravity of k consecutive vertices.