Tuesday, September 16, 2008

Decisiones complejas y reflexión

Voy a ver si me sale plasmar acá un monólogo recurrente, que sale de tanto en tanto en mi vida, así que prepárense para algo largo y tedioso, and mates, remember to go to the loo.

Todo comienza, en general, con una visita al médico. Aquellos que me conocen saben que no soy de ir muy asíduamente, y siempre que voy se me plantea una misma duda existencial:

(I wish I had latex here...)
1) Existe A, tal que A pertencece a nuestra sociedad Y A es boludo.
2) Existe B, tal que B pertenece a nuestra sociedad Y B es médico.
Como verán, en el conjunto de permutaciones posibles y dado que no se forman conjuntos disjuntos, tenemos que A y B pueden ser iguales en muchos casos.

Entonces, llegás al médico y te encontrás con un tipo que no hace bien su trabajo, como uno no es médico no tiene herramientas para juzgarlo a priori, así que todo el conocimiento que podemos tener es siempre a posteriori. De todas maneras esto no tiene nada que ver con que no me guste ir al médico.

A qué viene todo esto? a que en la ecuación falta un gris que está dado justamente por la monotonía de las decisiones complejas.

Exhibit A:

Ayer tuve un día malo y las cosas no venían demasiado bien tampoco, así que luego del trabajo en vez de irme directo a casa me fui a dar unas vueltas en bici por ahí (nótese que voy a trabajar en bici). En total hice alredeor de 35 km. bastante intensivos, mucha velocidad, saltos y maniobras. Alrededor de la mitad del entrenamiento me comienza a molestar la rodilla derecha. Cuando llego a casa y se me enfrían las piernas el dolor en la rodilla se hace más intenso y la siento "rara", como que si no hiciera mucha fuerza con los músculos para mantenerla en su lugar, se iría para cualquier lado, efecto "flancito". Hoy me siguió molestando y decidí ir a que me saquen una radiografía porque ya me había pasado antes con la rodilla izquierda y resultó estar esguinzada, con el ligamento casi roto. Después del trabajo fui hasta el Sanatorio Mater Dei (amén) donde *no* me pude atender porque no encontré lugar para estacionar. Tenía que ir a Renault Minuto para cambiar el filtro de aire del auto así que después me crucé enfrente donde está el Sanatorio Güemes, maaaaaala decisión, es un pésimo lugar. Omitiendo el mal rato que me hicieron pasar los muchachos de seguridad por estar entrando una laptop al edificio, me atiende un traumatólogo que me dice "Qué te pasa?" con cara de pocos amigos, y se da la siguiente conversación muy poco amena:
Traumatólogo: Qué te pasa?
Juan: Me duele la rodilla, ayer hice un mal movimiento y ... (historia de lo sucedido con la bicicleta)
T: No debe ser nada.
J: Pero me duele, me podés sacar una placa?
T: No, la radiografía no te dice nada.
J: Ehm, sí dice, al menos así supieron qué tenía cuando me esguincé la rodilla izquierda.
T: A ver, sentate en la camilla. Ahí te duele?
J: No
T: Ahí te duele?
J: Si!!!
...
J: Sacame una placa.
T: No.
J: Firmame en algún lado que está todo bien.
T: Ok, te lo cargo en la ficha "Rodilla estable". Tomate un analgésico y listo.
J: Portazo.


Analicemos el caso, como bien dijimos antes el tipo puede ser un boludo, en cuyo caso encontramos la solución. Otra solución trivial posible es que el boludo sea yo, pidiendo algo que no tiene sentido, pero dado que ya me había pasado lo mismo antes, algo se sentido tiene.

Entonces? qué pasó? El médico tuvo que tomar una decisión compleja pero monótona, en la mayoría de los casos no pasa nada y la decisión tomada es buena. Si me tomo un analgésico y me quedo tranqui va a estar todo bien; aunque hay un par de variables que parecen habérsele escapado al muchacho, a saber:

1) Soy chueco y mi rodilla tiende a irse de lado a lado estirando los ligamentos en un movimiento antinatural.
2) Estaba pensando en volver a entrenar Kung Fu en el corto plazo.

Por lo tanto si mañana voy a un entrenamiento y a la mitad de la clase, con los músculos cansados tengo que hacer un salto, digamos, cayendo desde una altura de 30 cm (seamos buenos) con unos 80 kg acelerados a 10m/s2, todo sobre los ligamentos de mi pobre rodilla derecha, no cabe ninguna duda de que se rome feo.

Ahí el muchacho estaría en problemas, tal vez no tan graves debido a la justicia Argentina, pero problemas al fin.

Por qué no me sacó la placa? tal vez por política del sanatorio, recordemos que estuvo en quiebra hace algunos años y jamás logró recuperarse. Ahora, el tipo este arriesga su ética profesional por una placa de rayos X?

Como ejercicio, siempre extrapolo estos casos a mi vida, como para ver qué se siente. Si en mi trabajo cometo un error así pueden pasar dos cosas, que un colega lo note antes de que sea demasiado tarde o que alguien termine perdiendo plata. En el primer caso mi calidad como profesional se ve afectada, en el segundo no sólo eso sino que alguien va a estar muy enojado dependiendo la cantidad de dinero en juego. De este razonamiento sale mi conocida frase de frustación: "Pero flaco, te das cuenta de lo que estás haciendo?? A mi por menos que esto me despiden en mi trabajo!"

Dónde quedan la ética profesional, los valores y el amor propio cuando empezamos a descuidar decisiones complejas por el hecho mínimo de que sean monótonas?. Bueno, en general en el mismo lugar, por la falta de reflexión. Si uno no reflexiona la calidad de lo que uno hace baja sin notarlo. En el caso de los médicos esto se ve muy bien por el tremendo impacto de sus decisiones sobre la vida de la gente, ya que las necesidades que tratan son bastante básicas.

Cuando hago una entrevista de trabajo siempre valoro mucho la capacidad reflexiva, opinar sobre uno mismo, sus acciones y reacciones, una frase típica es "Contame algo que hayas hecho y te haya salido muy mal, cómo te diste cuenta, cómo lo arreglaste y por qué no te pasa más o te sigue pasando".

El boludo carece de capacidad reflexiva, aunque el recíproco no es verdadero. Muchas veces, y este es el gris que me preocupa, la gente pierde interés (o nunca lo tuvo) en lo que hace y eso no está bueno a nivel personal ni social.

Así que este post termina siendo un llamado al ejercicio de la reflexión diaria, sobre decisiones importantes, para nosotros y para otros. A mirar el mundo con otras lentes, pensar escenarios donde estamos en lo correcto y donde nos equivocamos y tratar de asociar esas simulaciones a lo que termina sucediendo en la realidad más objetiva que podamos conseguir.

Nadie es perfecto, y eso es genial porque significa que siempre podemos mejorar, pero no hay que ser un freak de la perfección para mantener siempre un nivel decente de calidad y ser felices con ello.

Seguiría un rato largo, pero me tengo que ir, se salvaron, por ahora.

Monday, September 8, 2008

More on theoretical physics coolness

Safari kicks ass, again

Sometimes, while at home, I really miss working so I bring work to home . So, this time was the turn of a cross-browser JavaScript madness, the problem manifests like this:

There's a grid, big one, in which each cell has 3 image/buttons, each image has 2 states and they are exclusive, as in Low, Med, Hi, get the picture? Well, when the grid gets big (my HTML file right now has about 20.000 lines) performance goes down a lot, that means that when a user clicks a button the state change takes a noticeable second to happen, in IE 6 and 7.


I didn't code that so I had no idea of what was causing the problem so I asked the guys working in that project to email me a static version of the page so that I had something to fill my evening with .

Besides the JavaScript in that page is painfully awful (I'm sorry guys, I had to say it) I managed to isolate the piece of code that was causing trouble. Many of you geeks might already be blaming some obscure for(;;) over every single element, or a diabolic recursion; well my friends this is not the case, or at least the for(;;) is not where you think it is, read on.

The offending code was merely a dozen of document.getElementById() calls. But wait, think about it, getElementById in 20.000 lines worth of elements, that's something we should handle more efficiently, well yes and no. Yes, you should narrow your element "universe" and work with subsets as much as you can, and also use CSS selectors to get your target. And No because the browser's engine could do us the favor of optimising it, can't it? That seems to be the case for Safari, whose performance is not affected *at all* by this experiment, and remains as snappy as always. Next in the podium is Firefox, whose performance degrades slightly, regarding the button state change, but fails terribly at the very beginning when it almost hangs up while loading the page. At the bottom of the podium (if any) there's IE6 which fails in every single aspect, and degrades much more with a much lesser number of elements.

Very well then, what have we learned with this? You have to code well, don't trust the browser's engine too much, Firefox is really good but it still has some issues and that IE6 sucks at rendering web pages and executing javascript code.

I just wanted to share my findings on this noble area of knowledge. Your comments are more than welcome.

Oh god, I really need a pint right now, make it a brown ale please.

Particle physics is getting cooler

If your senses have detected a sudden explosion of nerd activity, this might be the cause. The LHC is getting even closer to its operational status.

From the engineering point of view, all the magnets and most circuits must reach a superconducting state only possible at extremely low temperatures -2 kelvin and lower-. So that's the big news, the LHC is cold and almost ready for the first experiments which are expected to take place on 10th Sept., yay!

Why is this cool? Because it's the biggest and most important experiment(s) in the history of mankind, period.

If you've never heard about the LHC before I invite you to browse their fine website.

Saturday, September 6, 2008

1 carry-on item + 1 personal item + mum's scrambled eggs

Reading this post took me back in time a year and a half ago when I had to spend some time working in Glasgow, Scotland (aye mate, wundrful plaice).

I like to think of myself as an "easy traveler" because I kind of tend to get used to different cultures and usually enjoy the process, so when I read the above post my first thought was: "Well, some people just miss home sweet home, and some don't", but after a while I realised that is not the case at all, exhibit no. 1:

After a couple of weeks of living as a proper McPereyra in a flat in front of the Glasgow Park, every morning I tried to have a proper british breakfast, that is, if there was enough time: eggs, bacon, sausage and even some haggis, however, if I was running late -as was often the case, some habits will live with us forever- I used to buy a couple of donuts buns, or a scottish pie when I was feeling a bit more suicidal. Anyway, this might sound like a bit too much, or something you can't get used to but I did somehow. Most argentinians can't live without decent meat, mate and dulce de leche for long periods of time.

However, I went on vacation and my first destination was Paris, it was there where it happened: I actually got emotional when I got served for breakfast: (Proper)Coffee with milk, croissants, toasts, butter and marmalade, 'twas just like being at home.


So, even when I wasn't actually missing anything I really liked to have a little something from back home, in this case breakfast and ham and cheese sandwiches where tokens from home while being far, far away.

Coca-Cola® OpenSource

Coca-Cola® -or Coke® for some of you- has for long time been one of the most popular soft drinks out there and many have fantasised about beholding its might formula. Well, now you can at least have a glance at Coca-Cola's GPL version here. I found this while reading through my subscriptions so credit for the fine findings must go to this guy.

I'll probably continue buying my coke at the local market, or not buying it at all, but it's nice to know that you can go opensource with it too :D.

Thursday, September 4, 2008

Good boy, good boy...

Well, - as expected - Google came to its senses and retracted from their crazy EULA, that's it, here's the full story.