Malaria

Every year i am affected by a Malaria crisis i get exactly what is described on Wikipedia:

Symptoms of malaria include fever, shivering, arthralgia (joint pain), vomiting, anaemia caused by haemolysis, haemoglobinuria, and convulsions. There may be the feeling of tingling in the skin, particularly with malaria caused by P. falciparum. Consequences of infection with malaria include coma and death if untreated—young children and pregnant women are especially vulnerable. Splenomegaly (enlarged spleen), severe headache, cerebral ischemia and hemoglobinuria with renal failure may occur.

I think I got this when I was traveling in 2002 around Mexico in the region of Chiapas which is supposed to be a high risk region for Malaria (cf: here). And I remember that my first crisis was in La Havana in Cuba staying in the bed sick with diarrhea and fever for a week.

I don’t think there is any medicines against that, it’s basically for me every time the same and it’s not that bad as described by Wikipedia article.

Like this Thursday, I was at work pretty normal and by 14h I had a pretty big head each and could not look at my computer screen anymore. I left work and tried to come back by buses but during my bus ride I was feeling worse and worse and had to go at the first stop to take a taxi (it’s a long way from Leichardht to Bondi Beach). I just crash on the bed get crazy fever cold and warm all the day and night long. Until the day after I feel fine and ok.

Anyway stuff are getting ok now and I can move and type on a computer. And since a lot of people are dying from Malaria I am not so much unlucky to have only a couple of days fever each year.

Get size of Postgres DB from filesystem

Get the size accurately from postgres local filesystem, i guess there is some sql stuff that can do that but that does the job as well for me :

#!/bin/bash
/usr/lib/postgresql/8.1/bin/oid2name  -U postgres|while read -a e;do
name=${e[1]}
oid=${e[0]}
[[ $oid == "All" || $oid == "Oid" || -z $oid || -z $name ]] && continue
typeset -a size
size=(`du -s /var/lib/postgresql/8.1/main/base/$oid`)
size=${size[0]}
printf "%-20s %-20s\n" ${name} ${size}
done | sort -n -r -k 2 |awk '{printf "%-20s%20d Mb\n", $1, $2 / 1024}'

svn diff without spaces

I am sic of spaces and having svn diff that does not get the spaces removed. So here is a simple script that does the stuff that you can use as your diff-cmd :

#!/bin/bash
for i in $@;do
echo $i |grep -q ")" && continue
echo $i |grep -q "(" && continue
t="$t $i"
done
diff -bBw $t

X86_64

On X86_64 VM Emulation works way better with Xen 3.0 than with Vmware. Xen is pretty awesome compared to Vmware for my use. The only thing i have to figure out is how to get rpmstrap get it workin on Debian base system.

Damn Throat

I have been sic like hell this weekend with my throat pain me like hell. Hope i did not get a damn infection or whatever. I should get to the doctor but since i don’t have any Medicare or i haven’t be to the doctor since a couple of years i don’t feel too much and hope it will get better by itself.

Python 2.5 Beta

I have been looking at the What’s new of Python 2.5. There is some cool features inside it :

Conditional Expressions:

This stuff basically allow to do standard C idiom (that we found in every kind of derivative language) like

a = condition ? “true” : “false”

the weird part is that Guido Van-Rossum implemented this syntax :

x = true_value if condition else false_value

which we will have to get use to. I am not a big fan of this feature since it makes the code more obscure. But still could be useful for little scripts or quick hack.

Unified try/except/finally:

I like the inclusion of else in a try finally. I use to put everything in the try which was not really very good looked when now i can really try or else something. Make me easier to port some Java code to python as well and respect the logic of the java program.

The with statement:

This one is weird for me it’s basically a closure of variable allowing to do stuff like this :

with expression as variable:

stuff

#expression not here anymore

I am still wondering how and why to use that. But i guess it will come us when i will do some coding in Python 2.5.

Other interesting stuff:

Sqlite3 library default inclusion. The cool thing about this for Linux vendors is that it does not require the libsqlite3 library but link dynamically via the ctypes module (i guess).

Ctypes allow you to call C dynamic functions via python.

A fast new XML parser.

Sounds like fun for the new python and there is a lot of other bugfixes so go read it.