2012-01-20 19:44

Living in Zork

You are in an open field west of a big white house with a boarded
front door.

There is a small mailbox here.


We live in the golden age of text. People write more than ever before. People read more than ever before. Only a few short years ago, the preferred mechanism to contact other people was voice based "phone calls". How quaint that appears to the modern person, that types messages through any of today's jungle of mesaging systems.

Sure, we also take more pictures than ever before. And more video than ever before. Because we are, in general, in an information golden age. But people expected that.

Who expected, 20 years ago, that kids would prefer to type short messages to each other instead of having long phone calls? Who expected that people would want to read the messages they got, instead of listening to them? Or watching them?

Which is strange, since for as long as I have a memory, I have been reading that the younger folks can't read or write as well as the oldest generations (of which I am now part of). The dreaded lack of "written text comprehension", meaning kids simply did not understand what the heck they were reading. Sure, they could form the words in their minds, but the complex aspects (plot, etc) simply didn't catch.

But why are those kids who could not read writing and reading so much? Is that a paradox? Or is it just that they didn care about what they were reading, and when, later in life, they decided to pay attention, they did get it?

Or maybe it is that understanding long plots is not what reading is about nowadays. That reading is about getting many small nuggets of data, and the whole correlation is done in our heads, instead of having it spelled out in long, comprehensive texts.

> open mailbox

Opening the mailbox reveals:
A leaflet.

Maybe the problem with long texts and reading comprehension is that they are too specific. Once you explain everything, maybe it's boring, and people's mind wander off. Maybe you need to keep things short and open-ended. Maybe the reader wants to fill in the blanks.

> read leaflet

Welcome to Zork (originally Dungeon)!

Dungeon is a game of adventure, danger, and low cunning. In it
you will explore some of the most amazing territory ever seen by
mortal man. Hardened adventurers have run screaming from the
terrors contained within.

So, maybe the right way to write in the 21st century is short and evocative, instead of clever and wordy. Maybe the gaming component of reading needs to be amped up, and the user will win imaginary badges whenever he gets some insight from what he is reading, like one of those whatevervilles that give you meaningless awards for meaningless tasks accomplished with meaningless effort.

> go west

You are in a forest, with trees in all directions around you.

Or maybe it's the other way around. Maybe reading (or writing) is becoming split into two different things. Maybe we are developing a high and a low reading. A high reading that is what traditionally was called reading, and a low reading that is short and functional and not all that interesting.

> go west


And maybe this means we will get things like China Miéville's novels, full of weird for weird's sake, and fun, and things like twitter, snippets full of whimsy and connection and wit (hey, I follow interesting people), and blogs full of disjointed miscelanea, and 9gag full of things that should not, in all honesty, be funny.

> reset

Starting over.

PS: http://thcnet.net/zork/index.php

2012-01-19 18:14

PyQt Quickie: QTimer

QTimer is a fairly simple class: you use it when you want something to happen "in a while" or "every once in a while".

The first case is something like this:

# call f() in 3 seconds
QTimer.singleShot(3000, f)

The second is this:

# Create a QTimer
timer = QTimer()
# Connect it to f
# Call f() every 5 seconds

Simple, right? Well, yes, but it has some tricks.

  1. You have to keep a reference to``timer``

    If you don't, it willget garbage-collected, and f() will never be called.

  2. It may not call f() in 5 seconds.

    It will call f() more or less 5 seconds after you enter the event loop. That may not be quickly after you start the timer at all!

  3. You may get overlapping calls.

    If f() takes long to finish and re-enters the event loop (for example, by calling processEvents) maybe the timer will timeout and call it again before it's finished. That's almost never a good thing.

So, you can do this:

def f():
        # Do things
        QTimer.singleShot(5000, f)


What that snippet does, is, calls f() only once. But f itself schedules itself to run in 5 seconds. Since it does it in a finally, it will do so even if things break.

That means no overlapping calls. It also means it won't be called every 5 seconds, but 5 seconds plus whatever f takes to run. Also, no need to keep any reference to a QTimer.

Final tip: You can also use QTimer to do something "as soon as you are in the event loop"

QTimer.singleShot(0, f)

Hope it was useful!

2012-01-17 18:46

Every US presidential candidate is a moron or sleazy

  1. They all claim that evolution doesn't work
  2. They all claim the world is less than 10000 years old

So you have now two choices:

  1. They believe they are saying the truth, which means they are morons.
  2. They believe they are lying, and only saying obviously false things because that will help them win, which means they are sleazy.

Have a fun future, US!

2012-01-17 18:37

Antonio María Delgado is an ignorant

Antonio María Delgado writes for the Miami New Herald. I would dare guess he's supposed to know english, even if he writes in spanish.

Let's backtrack a bit. The Economist publishes (as it has done for a while), something called the "Misery Index", which attempts to capture the countries where people are feeling miserable, and rank them.

So, Mr. Delgado goes, reads that, sees Venezuela near the top, and I can imagine the idea lightbulb brightening to a dazzling 0.5 watts, his scream of "political angle!" and the rush to write this:

"Venezuela se ubicó el año pasado en el segundo puesto del "Indice de Miseria" elaborado por la revista británica The Economist..."

The problem, dear english reader, is that "miseria" doesn't mean "misery". It means "poverty". In fact, it means "extreme poverty". And thus, Mr. Delgado makes it seem as if the Economist is saying Venezuela is the second poorest country (in some sense).

While I personally dislike Chavez, this is either ignorant, or stupid. Your call.

2012-01-17 15:14

Demetrio Fernandez is an idiot

Spain is a country. Córdoba is a place in Spain. In Córdoba there are churches. People go to churches. The people who attend church in Córdoba, Spain, are under the spiritual guidance of Demetrio Fernandez, bishop.

Just so we are clear: You are supposed to greet him by kissing his hand.

On the other hand, Demetrio Fernandez is an idiot who said this:

"The Minister for Family of the Papal Government, Cardinal Antonelli, told me a few days ago in Zaragoza that UNESCO has a program for the next 20 years to make half the world population homosexual. To do this they have distinct programs, and will continue to implant the ideology that is already present in our schools."

I rest my case. Demetrio Fernandez is an idiot. Cardinal Antonelli is an idiot. And if you go to church in Córdoba, Spain, knowing about this, and kiss the idiot's hand, you are an idiot.

2012-01-14 01:19

Idioms are not your friends

Using idioms is a double-edged sword. One side lets you cut to the point. You say a phrase, and it's so loaded of meaning, it's a shortcut to what you mean. One side can cut you, if you just use it and you use it wrong.

Let's consider Beatriz Sarlo, a respected argentine intelectual. She writes op-ed columns in a newspaper. She wrote one today. It ends:

Total, Boudou, sin bromita alguna, debe adecuarse a lo que le toque, obedeciendo el viejo refrán de que a un caballo regalado no hay que examinarlo para ver si viene completo.

Which I translate as:

In any case, Boudou, jokes aside, has to accept what he gets, followingthat old advice about not examining gift horses to see if they are whole.

One peculiar thing here is that we have almost the exact same saying in spanish and english. In english you don't look gift horses in the mouth. In spanish you don't check the teeth of gift horses. The problem here (if I may be so pedantic (yes you may (thanks other me! (my pleasure)))) is that Ms. Sarlo has no freaking clue of what that means.

Suppose you are buying a horse. You would check the mouth because you want to see if the horse is young or old (citation needed? Here is google's first result). That's important when you buy a horse. It's, on the other hand, really useless and rude when you are getting a horse as a gift:

Nice guy: Hey, here's a horse!

Rude moron: (looks in the mouth) No thanks!

That's why you don look gift horses in the mouth. And that's also why you don't check amazon to see how much the book you got costs.

On the ther hand, if you were a Tamarian, you could look at the horse's mouth and say "Temba, at rest".

2012-01-14 00:28

UFO For Ever

My dad was born in the province of Chaco, and migrated (very slowly) some 1500km to the south. The migration was slow enough that he managed to have two different local football teams to like.

The one he liked when I met him was Unión de Santa Fe, but the team of his childhood and youth was the remarkably obscure Chaco Forever. And of course, because it's what people do when their teams have no chance of ever winning anything, he liked one "big" team just to have some chance to celebrate (Boca Juniors, in his case).

Once, at the end of the 60s, he was driving north, towards Resistencia, the home of Chaco Forever, with my mom and my big brother, maybe a year old sitting in my mom's lap, no seatbelts. Those were the 60s and children survived because lead poisoning seems to be an antidote for second hand smoke and car crashes.

Then, his car stalls. That was hardly unusual. Our usual average speed on long trips was about 20km/h once you accounted for the stops to add water to the radiator, change flat tires, get a mechanic to see why the lights didn't work, and arriving at the wrong town. My dad liked cars, but cars hated him.

But before the car stalled, they had seen a light by the side of the road, up high. A light that seemed to follow them. And the car didn't start. That road in those times was lonely, and dark, and in bad maintenance. So stopping in the middle of it was a recipe for being killed by a truck.

A little later, the car starts, and the light appears again, and again it stops. Here, according to my mother, my dad got out of the car, and started shouting at the aliens to stop being idiots, that they were going to get him killed. After that, the light disappeared, and they continued traveling without further mechanical issues.

And a few days ago, this happened: A UFO appeared over a football practice. The football team? Chaco Forever.

2012-01-13 03:42

Some things don't translate well

Corriendo en la lluvia con Tato, pasó lo inevitable. Pisé una baldosa floja y me empapé la otra pierna. Como dice el tango "igual que baldosa floja, salpico si alguien me pone el pie". Y porque tengo que pensar todo el día en inglés por el laburo, mi software cerebral de traducción instantánea se tildó.

¿Como miércoles le haría entender esa frase a un estadounidense? Es casi imposible. Allá nadie camina, menos abajo de la lluvia. Casi no hay veredas. Las veredas que hay no son de baldosas. Las baldosas seguramente no estarían flojas.

Para poder traducir algo, no alcanza con traducirlo, hay que traducirlo y que quede algo que habría dicho alguien en el idioma de destino. Para que signifique lo mismo, tendría que estar hablando de algo que podría pasarle, por ejemplo, a un argentino y a un ruso, a un bosquimano y a un lapón. Sospecho que no es posible traducir en general. Que lo que vemos por ejemplo en este blog, que intenta, los demás días, ser bilingüe, es una colección de casos particulares más o menos afortunados.

Hace un tiempo empecé a traducir una novela de Cory Doctorow (lean acá si quieren) y abandoné porque al releer lo que escribí, no parecía una novela de Doctorow, parecia otra cosa, una cosa peor. Y no vale la pena leer cosas peores.

Y de esa forma cuando programo el programa nunca es lo que yo quise, es una versión peor, escrita en un lenguaje extranjero, por un no-nativo. Programar es traicionar la visión para producir lo tangible. Escribir es más o menos lo mismo. Hablar es más o menos lo mismo. Ni siquiera mi voz que vos escuches es mi voz que yo escucho.

Vivimos cada uno encerrados en un iglú, tratando de charlar con mapuches que nos miran a través del hielo. A veces funciona. Saludos.

2012-01-11 19:31

You know more math than you think: non-decimal numbers

Yes, you do. If you are a frequent reader of this blog, then you probably already know about binary numbers, hexadecimal numbers, and sundry non-decimal numbers. You know, the kind we nerds know about. The ones that make us confuse thanksgiving and christmas because oct(31) == dec(25).

But how about normal people (or as I like to call them: people)? Well, they may look at you confusedly if you tell them that they use way more exotic things every day.

Let's start with the time. When you say "it's 10:30? well, that's a base-60 number.

If we add days, it gets harder, because days are base-24. So "2 days, 10 hours and 30 minutes" is just a difficult way to say 2*24*60 + 10*60 +30 minutes. It's a numerical system with two different bases.

Sure, it doesn't do the cutesy thing hex does of having extra symbols, like A meaning 10, but it's exactly that, except 20 is written "20" or "8PM".

And how about January 11th, at 5:20 PM? Well, that is also another way to express a number of minutes, in an even more complicated mixed-base system!

January = 0 months = 0 days = 0 hours = 0 minutes
11th = 11 days = 251 hours = 15060 minutes
5PM  = 17 hours = 1020 minutes
20 = 20 minutes

Total: 16100 minutes

That way to express a date uses a mix of base 60, base 24, and base 365 (if we can, please, ignore leap years) or maybe base 60, base 24, base ~30 and base 12

I don't know if numerical systems with non-fixed bases have a name in mathematics, yet you use them, random non-math-person!

And you can even do arithmetic on them! Yes, you! You know what exact time it will be at "Jan 9th 2:10 + 12:15". You can even do multi-base arithmetic in your head.

And I have not mentioned seconds (base 60 again), years (multiple base 10 digits) and second fractions.

Yet, when hex and binary are explained to people in school, it's incredibly hard to make them "get it". And once they get that if you try to explain, say base-3 numbers, it's confusing again.

2012-01-10 20:29

The pain of having seen something once

It must be horrible to have said something smart, maybe even insightful, once, and be labeled for life as a visionary, or a pundit, or some other similar insult.

Consider Clay Shirky's comments on this article. It's absolute nonsense, based on random guessing.

I promise this: this blog will have no insight on anything as long as I write it. I couldn't handle the pressure.

Contents © 2000-2019 Roberto Alsina