15 de octubre de 2007

Premio Nobel de la paz

Al Gore, inventor de internet y del cambio climático ha recibido el premio Nobel de la paz junto al IPCC "for their efforts to build up and disseminate greater knowledge about man-made climate change, and to lay the foundations for the measures that are needed to counteract such change", es decir por publicitar su propia invención.

De este modo se convierte en el primer premio Nobel de la paz otorgado a un inventor, algo que se venía echando en falta. Parece que a mucha gente no le ha sentado bien... ¡Si Benjamin Franklin levantara la cabeza!

Desde algunas esquinas polvorientas del IPCC también se han tomado con sorna la noticia.

P.D.: Añadir todos los asteriscos y peros que se quieran :-)

11 de agosto de 2007

Global warming

Up until now I was refraining from writing on global warming, and I won't do so, but I found a slashdot comment, related to a finding that NASA's data on global warming had an error that was silently corrected that pretty much synthesises my thoughts on the matter:

There is no questioning of global warming. It's now a fact. The sun revolves around the earth. To suggest otherwise means you're an idiot.
Let's ignore that CO2 is not the largest part of our atmosphere, and something else (say methane) may be responsible. Let's ignore the fact we're coming off an ice age. Let's the history of "science facts" that the media has trumpeted in the last 40 years or so (remember when we would all die in a massive world-wide starvation as foretold in "The Population Bomb"?, the new ice age they said would come in the by the 80s? The mass extinction caused by DDT?) Let's ignore the fact that Mars is getting hotter too and that it seems to be the Sun's fault. How about that acid rain that would become a blight on the planet making it impossible to go outside while it was raining in the US? And where are those empty south american countries that lost so many trees the planet can't produce enough oxygen to supply all the people in the world.
Is the globe getting warmer? Seems like it. Is it the fault of humans? I wonder. Is it the fault of CO2? I wonder. I don't care if you want to reduce pollution and emissions and such. When I moved to my current location 9 years ago or so, the sky was clear. We now have plenty of smog. Asthma is going up in the US. There are plenty of reasons to do these kind of things. But no one talks about that any more. If we want to cut car exhaust, it's to stop the planet from warming, not so the air isn't brown. If we want to reduce power plant emissions it is to reduce the warming of the globe, not because the plant has been putting a fine layer of soot on everything downwind.
Global warming is the latest media boogeyman. I'm just sick of hearing about it. I'm sick of how it's the US's fault. China pollutes more than us now. Go bug them. Go help them stop burning so many coal blocks for heat. Go help them make cleaner cars affordable. Go help India. Go help Europe (which is getting close to our levels). Fight the BIG sources (that will only grow bigger). When a dam is leaking, you plug the BIG leak that will soon be letting out 20,000 gallons a minute, not 5 little holes that let a few gallons through per day.
I'm sick of this global warming stuff, and how I've basically never seen it questioned in the mass media (except by other people who question it and immediately get called morons for questioning).
Global warming, as it is discussed in the US, seems more like a religion than anything else to me at this point.
Can you give me a good reason why the number from a government scientist who's report was used to "prove" global warming and then later complained he was censored for his actions being disproved shouldn't be reported just as big as the original story?
Remember kids. Call the president a child molester, that's page one. Print the retraction (if at all), that's page 37b in tiny type 6 months later between an ad for Hardee's and Mission Impossible 12.

Amén.

2 de agosto de 2007

Platero y tú

Voy a acabar borracho.


¡Pero qué buenos que son!

Parece que esto se está convirtiendo en un videolog, prometo algo más de texto para la próxima :-)

13 de julio de 2007

¡Mira mamá, mi primer video en youtube!

Como algunos se quejaban de que este blog no tenía colorines (hasta las fotos que pongo son en blanco y negro), he estado currándomelo últimamente para conseguir hacer un video con colorines.



Demasiado verde, lo sé, pero ando esperanzado últimamente :-)

8 de junio de 2007

Antártida

Por Sebastião Salgado

[foto de la noticia]
SOLEDAD

Sin población indígena y, sin embargo, patrimonio de la Humanidad entera, el Sur blanco atrapa todavía hoy, como en el pasado, a muchos exploradores, a aquéllos que han hecho de la Antártida su vida.


[foto de la noticia]
SUPERVIVENCIA

Lucha de titanes por la supervivencia, por lo que es de uno. Los elefantes marinos, que pueden alcanzar las cuatro toneladas de peso, se enfrentan de manera continua y encarnizada.

30 de abril de 2007

Plotting

Making publication-quality plots is one of the ugly parts in the life of a scientist wannabe. In my field there are two main plotting packages in use (besides IDL which i don't have): SuperMongo and PGPLOT.

Both are quite old. I guess the best of them must be SuperMongo, since its lemma is "You can't beat SM.". Joking aside I can't give an unbiased opinion, since all the times that I have tried to use SM, I have hit a wall of uneasiness. The syntax is too different from everything else that I know.

That leaves us with... erm well, PGPLOT and PLplot. Since my main computing environment has come to be Octave running on Ubuntu, I thought that it would be good to give PLplot a drive, after all it has pre-compiled packages and it's supposed to work fine from within Octave. Another advantage is that it's built to be very similar to PGPLOT, which I had used in the past. After fighting with it for some hours I can say that it is not ready for prime-time. Some of the problems I found while using it:


  • The gnome server won't work. That leaves us with the xwin server which is incapable of redrawing itself (a PITA if you are working from a full-screen terminal).

  • Issuing plend() to close the active plotting window will make Octave segfault if actually there's no such window. Hey, I made a mistake! But no need to punish me so hard.

  • The output is... well not-as-good-as-I-would-like. If you print directly to a Postscript device, some Hersey symbols (like the Sun's symbol $\odot$ in LaTeX) won't be drawn. If you plot to the xwin server and then save the output with save_fig, the result is ugly. All the letters and symbols are squashed and o's (supposed to be a round and in fact round on screen) appear as ellipses on the Postscript.



Those were the most important so, repeat after me: "You can't beat PGPLOT (unless you are SuperMongo, of course)". The final result, I'm using PGPLOT from inside Octave with the help of the matwrap tool. No need to make specific programs and compile them to plot your data. Works like a charm, it's much more solid than PGPLOT and the output has that fancy professional look that only SM and PGPLOT can attain.

Now I'm a believer, I won't doubt again about how to make my plots.

19 de abril de 2007

Pelis

Rannulph Junnah: Now, the question on the table is how drunk is drunk enough? And the answer is that it's all a matter of brain cells
Hardy Greaves: Brain cells?
Rannulph Junnah: That's right Hardy. You see every drink of liquor you take kills a thousand brain cells. Now that doesn't much matter 'cos we got billions more. And first the sadness cells die so you smile real big. And then the quiet cells go so you just say everything real loud for no reason at all. That'ok, that's ok because the stupid cells go next, so everything you say is real smart. And finally, come the memory cells. These are tough sons of bitches to kill.

Junnah.- Bien, lo que aquí se ha planteado es cuánto es lo bastante borracho. Y la respuesta es que depende de las células del cerebro.
Hardy.- ¿Del cerebro?
Junnah.- Así es Harvey, con cada vaso de licor que tomas acabas con cientos de esas células. Pero eso no importa mucho porque tenemos millones.
Primero mueren las de la tristeza, así que estás sonriente. Luego mueren las del silencio y todo lo dices en voz alta aunque no haya ninguna razón. ¡Pero eso no importa! No importa porque luego mueren las de la estupidez y hablas con inteligencia. Y por último las células de los recuerdos. Esas son difíciles de matar...



Rob: My desert island, all-time, top-five most memorable breakups, in chronological order, are as follows: Alison Ashmore; Penny Hardwick; Jackie Alden; Charlie Nicholson; and Sarah Kendrew. Those were the ones that really hurt. Can you see your name on that list, Laura? Maybe you'd sneak into the top ten. But there's just no room for you in the top five, sorry. Those places are reserved for the kind of humiliation and heartbreak you're just not capable of delivering.

Rob: Top five things I miss about Laura. One; sense of humor. Very dry, but it can also be warm and forgiving. And she's got one of the best all time laughs in the history of all time laughs, she laughs with her entire body. Two; she's got character. Or at least she had character before the Ian nightmare. She's loyal and honest, and she doesn't even take it out on people when she's having a bad day. That's character.
[holds up three fingers]
Rob: Three;
[long pause, hesitantly]
Rob: I miss her smell, and the way she tastes. It's a mystery of human chemistry and I don't understand it, some people, as far as their senses are concerned, just feel like home.
[shakes his head, recollecting, then looks back and lip synchs 'four' while holds up four fingers]
Rob: I really dig how she walks around. It's like she doesn't care how she looks or what she projects and it's not that she doesn't care it's just, she's not affected I guess, and that gives her grace. And five; she does this thing in bed when she can't get to sleep, she kinda half moans and then rubs her feet together an equal number of times... it just kills me. Believe me, I mean, I could do a top five things about her that drive me crazy but it's just your garden variety women you know, schizo stuff and that's the kind of thing that got me here.

28 de marzo de 2007

My favourite astro-ph papers

I've just added a section on the right called:
My favourite astro-ph papers

There I will be posting (much like this guy) every day the new papers on astro-ph that I find interesting or noteworthy. This is a personal selection based on my research interests. There is a feed available just in case you like my tastes :-)

22 de marzo de 2007

Secret Tape with the Lost Writers



Given the speed that the series is taking, I guess we'll soon see the magic turtle ;-)

ACM ICPC, Problem B

This time in spanish :-)
Bueno, ya he escrito mi propuesta, ha costado un poco más de lo que esperaba y al final lo he hecho en C++. La idea básica es buscar la cadena más larga que sea decreciente, y quitarla. Aplicamos esto recursivamente hasta que se acaben los caracteres.

Bueno, ahí va el código:

#include <iostream>
#include <string>
#include <list>
#include <algorithm>

using namespace std;

int streak(list<char> &sl)
{
list<char>::iterator i=sl.begin(), start=i;
while(i!=sl.end())
{
if(*i<=*start)
{
start=i;
i=sl.erase(i);
}
else i++;
}
return sl.size();
}

int main()
{
string s;
cin >> s;
int line = 1;
while (s != "end")
{
int n=1;
list<char> sl(s.size());
copy(s.begin(),s.end(),sl.begin());
while(streak(sl)>0)
n++;
cout << "Case " << line++ << ": " << n << endl;
cin >> s;
}
}

Y el test de que funciona:

franjesus@altamira:~/tmp$ ./test
ABC
Case 1: 3
CBA
Case 2: 1
CBACBA
Case 3: 2
CCCCCCCCCBBBBBBBBBAAAAAAAAAAA
Case 4: 1
CCCNBBBNAAA
Case 5: 2
CBACBACBA
Case 6: 3
ACMICPC
Case 7: 4
ANABMCAANABMCA
Case 8: 4
end

Me estoy cansando (he estado casi 3 horas con el problemita de marras). El problema C puede que tarde :-)

20 de marzo de 2007

ACM Programming contest. Problem A

I've seen the ACM programming contest 2007 on Barrapunto, and I think I know how to solve some of the problems. The problems are here. Here's the ones that I have thought so far:

Problem A
To solve this problem, I would start by defining an UnorderedSet class, containing element of type T (typical template C++ stuff), but since I don't want to get into the programming details, I will just say that we can deal with unordered sets that have elements that are unique. So let G be the set of all different combinations of alleles possible: OO, AO, AA, BO, BB, AB. Let F be the set of possible alleles for the father, M for the mother and C for the child, with F,M,C ⊆ G.

Our task for the first part would be to derive C from F and M. The second part consists on deriving M (F) from F (M) and C. In the last case the result can be the empty set.

Two basic functions are required to convert from and to our combinations in G to the "observed" genetic characteristics, so D(A) would give a set {AO, AA}, D(B)={BO,BB} D(AB)={AB}, D(O)={OO}. And similarly the reverse relation from elements of G (not subgroups as in the direct relation) towards blood types, we call this function R.

The first part (parents -> child) can be easily solved by taking the cartesian product of sF by sM where the s indicates the "simplify operation", that is taking all the alleles in F or M separately (and eliminating repeated ones), in that way, s{AB} -> {A, B} or s{AO, AA}->{A, O}. Since we are not interested in probabilities this will do. The result (after removing repeated results taking into account that alleles are commutative (AB=BA)) is C. Now just apply R to the elements of C. That is the result.

To solve the second part we need to make another formulation which serves us to solve the first part too, and takes into account the probabilities, so maybe it would be better to start with the second part and use the functions developed to easily solve the first part. It works like this:
  1. We define a function f: G³ ->{0,1} that takes 3 elements of G and returns 1 if it is a possible combination in the sense that f(x,y,z), where x ∈ F, y ∈ M, z ∈ C, is feasible ({AB,OO,AO} is a possible combination, {AO,AA,OO} is not), and 0 otherwise. This function is easily defined just by taking the cartesian product (as in the previous) of x and y and looking for z in the result. More programmatically, we evaluate the cartesian product for the 21 possible combinations (the cartesian product is abelian), or 36 if we don't want to bother with optimisations for such a small problem, of G x G and save the results in a 6 x 6 x 6 matrix (that we call by extension f).
  2. This second step is best explained in pseudocode:

    for i in F
    for k in C
    for j in G
    if (f(i,j,k)==1)
    M.add(j)
    end

    of course, M is a set and the add method avoids having repeated entries.


We're done. The same algorithm could be applied to infer C from F and M (or F from M and C, for that matter). The only job remaining is to apply R to M to get the possible blood types for the mother.

The same algorithm can be applied to the +- alleles (this time the problem is smaller). The results should be the cartesian product of the ABO alleles and the +- alleles.

I haven't tested this solution. There's no guarantee that it will work, maybe it's dead wrong. Any comments are welcome. Problems B, C and I will surely follow when I get time to write them down. The rest... maybe, only if I can solve them :-)
 
Creative Commons License
Este weblog se publica bajo una licencia Creative Commons.