Stack underflow
After watching THX-1138, I have finally emptied my pila of DVDs.
However, now I'm left with one question: after you escape your futuristic dystopia and go out to Nature and have your shot with the setting sun in the background, how do you survive? Where do you get your food from? Can you fend for yourself after having lived for your whole life under an authoritarian regime that, while it enslaved you, it provided you with everything you had?
Oh, no! I'm again making the mistake of being too practical! :)
Un anuncio para mi web
Si veis este vídeo sabréis qué es lo que hago cuando se me acaban las ideas.
El Rey ensaya el mensaje de Navidad
Este vídeo muestra lo que ocurre "entre bastidores" durante los ensayos del mensaje de Navidad del Rey.
El cineasta
Desde que escribí un artículo describiendo cómo funciona el método para resolver las raíces cuadradas con lápiz y papel, tengo un montón de visitas de gente que llega tras buscar “raíz cuadrada” en Google. Resulta que todos esos quieren saber cómo calcular raíces cuadradas, no cómo funciona el método para hacerlo, así que desde hace tiempo tenía pensado hacer un vídeo explicativo, ya que por escrito iba a resultar en un artículo largo y difícil de seguir.
Recientemente compré una videocámara, así que hoy intenté hacer el vídeo; sin embargo, he visto que, al principio, cuando lo presento, me parezco más bien a José Tojeiro (también inclino la cabeza y hago gestos raros con la cara). Lo mejor va a ser dejarlo de momento, y practicar hasta que sea capaz de salir en un vídeo comportándome con más naturalidad.
Me estoy dando cuenta de que hay que esforzarse bastante para ser natural :)
Dirty jobs
I was still in University, eight years ago, when I read an article by a sysadmin who works in a porn website, which made me think about where I'd be willing to work as a computer techie. I though about the subject again when I saw a reference to it a couple of weeks ago in Jeff Atwood's Coding Horror.
So, I'm listing below some examples of “socially unacceptable” places for computer geeks to work, and my reflection about whether I'd be willing to work there. Take into account that this is my opinion on whether I would do it, not on whether anyone should do it. I'm not passing judgment on anyone who is doing or considering to do any of those jobs.
Type inference in C++
Last week I was on vacation, and I took the time to relearn C++, as it had been very long since I had last worked seriously with it.
In the process I thought that C++'s template system can also serve as a type inference mechanism.
Because what's the difference between having OCaml guess the types as in this snippet...
# let cat a b = a @ b;; val cat : 'a list -> 'a list -> 'a list = <fun>
... and having C++ instantiate the template for the appropriate types in this other snippet?
template <typename List>
List cat(const List & a, const List & b) {
List c = a;
c.insert(c.end(), b.begin(), b.end());
return c;
}(Modulo syntax errors, of course.)
El herrero de canciones
Hace tiempo, Microsoft Research presentó Songsmith, que es un programa que, a partir de una canción, le compone una música de acompañamiento.
Os podéis imaginar que la calidad de las “piezas” resultantes es bastante variable, por decir algo. Por supuesto, la gente de Internet, que es muy mala, se dedicó a extraer las pistas vocales de unas cuantas canciones famosas, pasarlas por el Songsmith, y publicar el resultado.
Algunas veces es gracioso:
Otras veces es extraño:
Otras veces sólo es triste:
¿Habéis visto más? ¿Hay alguna que os haya llamado especialmente la atención?
De vulnerabilidades web
Muchas aplicaciones web están mal hechas. Cualquier página web maliciosa podría realizar acciones en esas aplicaciones web empleando las credenciales de los usuarios que accedan a la susodicha web maliciosa.
Lo comento aquí porque me he dado cuenta de que la protección que Drupal incluye contra esa vulnerabilidad impidió que haya tenido todavía más spam, aunque esa no fuera su finalidad primaria.
Esa vulnerabilidad se llama CSRF (aunque le han dado muchos más nombres), que son las siglas de “Cross-Site Request Forgery”, o, en castellano, “falsificación de consultas entre sitios”. Básicamente consiste en incluir código HTML y/o Javascript en una página web para realizar una consulta HTTP a una URL de otro sitio, y que esa consulta HTTP conlleve una acción (publicar un comentario, votar una historia en Menéame, etc.). Esto puede ser tan simple como incluir una etiqueta “IMG” que apunta a un URL, o tan complicado como crear un formulario, rellenarlo y enviarlo mediante Javascript.
Hay varias maneras de solucionarlo, pero las más efectivas parecen consistir en crear un “token” (un código de un solo uso) y añadirlo al formulario cuando el usuario accede a la página que lo muestra; cuando el usuario envíe el formulario el “token” irá incluido, y sólo se realiza la acción si el “token” correcto está en el formulario.
Como el atacante no tiene acceso al formulario (sólo puede enviar consultas, pero no ver el resultado), tampoco puede obtener un “token” válido, así que la consulta que envíe tampoco será válida, y la acción no se realizará.
Pues bien, revisando mis “logs” he visto muchos intentos de enviar spam desde hace mucho tiempo; sin embargo, éstos no tuvieron éxito hasta hace poco. ¿Por qué? Simple: antes, los spammers sabían qué campos había en el formulario, así que intentaban enviarlo directamente. Sin embargo, no tenían un “token” válido, y esos intentos fracasaban.
Ahora han cambiado el “modus operandi”: ahora descargan el formulario antes de enviarlo, con lo que consiguen el “token” y los comentarios se publican. O, más bien, se publicaban hasta que añadí Hashcash. Como el software de los spammers no soporta hashcash, esos comentarios vuelven a no ser publicados.
Por lo tanto, estaremos libres de spam, básicamente, hasta que los spammers implementen hashcash en su software. Pero bueno, ya cruzaremos ese río cuando lleguemos a él...
Damn spammers
Some people don't rest until they ruin everything.
Today, spammers have posted some 30 comments in my blog full of links to Viagra stuff. Of course, I removed them as soon as I could, but several of those comments were visible for a couple of hours.
Obviously, I don't want any spam in my weblog, but I don't want to remove the possibility to post comments either. Many people would install a “captcha” (one of these images with distorted characters you have to write in a text box to post a comment), but I hate them because they are hard to read for a human (and impossible for someone who cannot see well or at all) and easy to circumvent for a spammer.
Instead, I have installed a system called “hashcash”. Basically, it consists of having the browser perform some calculations before submitting the comment. This, in theory, slows down the rate spammers can send their material (as the calculations take a bit of time to perform) and ensures that it's an an actual browser that sends the comment, not a spam program. The problem is that it uses Javascript and, therefore, whoever doesn't use Javascript won't be able to post comments.
I'm very sorry, but that's life. I know that this is not the final solution to the spam problem (the reasons are so many and so varied, if I started writing them I wouldn't finish today), but it is the best I have right now. Obviously, if someone over here refuses to use Javascript and wants to complain, just post a comment ;)
Contando los segundos
Si vas por la calle y paras a alguien para preguntarle la hora, puedes encontrarte tres tipos de respuesta:
- “Son las tres menos cuarto”
- “Son las quince cuarenta y siete”
- “¡No tengo dinero! ¡No me atraques! ¡No me atraques!”
Por tanto, si no contamos a la gente que se cree todo lo que sale en la tele y vive aterrorizada de sus semejantes, vemos que hay dos tipos de personas: unos se conforman con saber la hora con una precisión de unos tres o cuatro minutos, mientras que los otros quieren tener la hora más exacta posible. Esta historia no va sobre los primeros, sino sobre los segundos (al fin y al cabo, las historias sobre gente con rarezas son mucho más entretenidas que las historias sobre la gente normal).
Recent comments
4 weeks 6 days ago
7 weeks 3 days ago
7 weeks 5 days ago
7 weeks 5 days ago
7 weeks 6 days ago
7 weeks 6 days ago
7 weeks 6 days ago
7 weeks 6 days ago
7 weeks 6 days ago
7 weeks 6 days ago