cognitive science
and more

If you live in a region where terrorist attacks happen with some regularity, you are probably familiar with Facebook's Safety Check, or Marked Safe, feature. This works as follows: When a terrorist attack happens (or another disaster, but this post is purely about terrorist attacks), Facebook determines which of its users were nearby when it happened. Facebook does so based on three sources: your phone or tablet's location, your home city, and the location of your last connection to Facebook (i.e. they check the location of your last IP address). It then asks those nearby users to confirm that they are safe, which is posted on Facebook, thus re-assuring friends and family.

Surely there is nothing wrong with letting friends and family know that you are safe! So why is this—in the format of a Facebook-wide safety check—a bad idea?

First, more than anything else, systematically marking people as safe in this way accentuates the possibility that they may not have been safe, that they were in serious mortal danger and barely survived. It increases the subjective probability that loved ones may get hurt in terrorist attacks. And it increases the feeling that we are all in danger all of the time.

People who are affected by terrorist attacks deserve unconditional sympathy and support. But empathy doesn't have to, and shouldn't, turn into unreasonable fear.

Because fear is exactly what organizations like Islamic State (IS) want to accomplish: They want to look far more dangerous to the …

Read more »

What would a modern constructed language look like?

In El Congreso, a short story by Jorge Luis Borges, the lead character, Alejandro Ferri, sets out to find the perfect language for a secret society whose aim is to create a congress that represents all of humanity. This story is fascinating in many ways; for example, you might ask how a society can be both secret and represent all of humanity at the same time. But I was especially intrigued by the constructed languages that Ferri considers (but not ultimately accepts) as the universal language.

Anyone who's ever learned a second language knows the feeling that language is unnecessarily complex: irregular verb conjugations, cases (i.e. modifying a noun to indicate its role in a sentence), etc. Awful! So what could be more convenient than a rational language that has been designed with a limited and fixed set of rules? A language of reason, or Lingvo de kialo in Esperanto!

Esperanto and Voläpuk are two such languages, both created at the end of the 19th century. Voläpuk, which I'd never heard of before reading El Congreso, doesn't appear to have stood the test of time. But Esperanto is alive and well; it might not have become the universal language that it was designed to be, but it has a small following, its own Wikipedia with over 200,000 articles, and it is supported by Google Translate and Duolingo (a free platform for learning languages).

I've taken a few Esperanto lessons on Duolingo, and it's really easy to learn. The …

Read more »

Scientists publish less than they used to (by some measures)

A fascinating study by Daniele Fanelli and Vincent Larivière was published yesterday in PLoS ONE. It's a bibilometric study (i.e. about how scientists publish their research), and its main conclusion is that scientists do not publish more than they used to—or at least not by all measures. This conclusion is surprising, because it goes against the cynical-but-widespread belief that scientists nowadays try to publish as many papers as possible, with little regard as to whether these papers contribute anything.

Let's start with a basic fact: For decades, and year after year, the total number of scientific publications has been increasing exponentially. You can clearly see this in the figure below, taken from one of my previous blog posts.

So what drives this growth? Multiple things, probably. To start with the obvious: The world's population has grown, and the number of scientists has grown even more rapidly (i.e. it has become more common to be a scientist); as a result, scientists are publishing more papers in total.

But many people would point out another important driver of this growth: the "publish or perish" culture.

Scientists are under a lot of pressure to publish papers—if you don't publish enough, you're out. This pressure is relatively new, or at least it seems to have increased over time; and it stands to reason that scientists would respond to this pressure by publishing more papers. For example, whereas a scientist in the eighties might have worked on a single, important paper …

Read more »

How to write with your mind? (or: Decoding attention through pupillometry)

I'm very excited to announce that our article The Mind-Writing Pupil is now available at PLoS ONE! In this article, we describe a technique that allows you to—literally—write by thinking of letters. This sounds like a wild claim, but it's not; the technique is actually surprisingly simple. In the video below you can see a demonstration:

So how does this work?

First, let's look at the simple case in which there are only two letters: A and B. Both letters are presented on backgrounds that alternate between bright and dark; crucially, whenever the A is dark, the B is bright, and vice versa.

Now imagine that you are looking directly at the B. In this case, your eye's pupil would respond strongly to the brightness of the B (or rather its background); this is the pupillary light response: the constriction (shrinkage) of the pupil in response to brightness, and dilation (expansion) in response to darkness.

So if we would measure the size of your pupil while you're looking directly at the B, we would see that it follows the B's brightness. In this example, the B is initially bright, so the pupil would be small; then the B turns dark, so the pupil would become large; and then the B turns bright again, so the pupil would become small again. Therefore, we could simply measure how pupil size changes over time, and use this to determine with almost 100% certainty which of the two letters you're looking at …

Read more »

A simple explanation of character encoding in Python

Special characters are a pain for programmers, and a source of bugs. Whenever your code contains an accented letter, voil├Ā, funny-looking symbols appear; or, worse, your program crashes with an obscure error. Why does it have to be that hard!?

It doesn't. Character encoding is not that difficult once you understand the basic principles. Let's take a look.

Characters are interpretations

For a computer, there is no text, only bytes. Text is an interpretation, a way to visualize bytes in human-readable form. And if you interpret bytes wrong, you get funky-looking characters, or even an error. A character encoding is one specific way of interpreting bytes: It's a look-up table that says, for example, that a byte with the value 97 stands for 'a'.

Now let's consider these three bytes:


In Python 21, this is a str object: a series of bytes without any information about how they should be interpreted. Don't let the name confuse you: A str is not a string of characters; rather, it's a series of bytes that you can interpret as a string of characters. But the proper interpretation requires the proper encoding, and the problem is: A str doesn't know its own encoding!

Now let's turn to actual Python:

# Mystery string!
byte_string = chr(195) + chr(167) + chr(97)

We have three bytes (195-167-97), but no idea what they stand for. How can we decipher these bytes into actual text? Well, we need an encoding! Let's start by trying the most basic …

Read more »