Below are 5 reasons why I prefer cats over dogs.
Reason #1:
Reason #2:
Reason #3:
Reason #4:
Reason #5:
[Picture credit, credit, credit, credit, credit.]
22 September 2010
5 reasons why I prefer cats over dogs
18 September 2010
Figuring out the right and wrong women's figures
When it comes to women's figures, the norms keep on changing. It however used to be simple: when sweets were a luxury, fat meant rich and thus was "in". Then it was thin's turn: thin people were the ones who could resist the temptation of tasty food - a kind of saint. That one has been taken too far, up to anorectic chick, and too many deaths later, something seems to be slightly changing. But how exactly?
If you're slightly too thin, there's always someone for you to ask whether you've got anorexia:
Yet, a model's silhouette is still this:
Can you see the difference?
(In reality, if an anorexic person is that skinny, it means that his or her illness has already gone very far and done severe damage. Read more about it on Psychology Today.)
If too thin is sick, what about the other way? There just was a plus-size show at New York Fashion Week:
Does that mean that extra weight is now socially acceptable? I'm not sure: Jessica Simpson has recently been heavily criticized for her weight gain, while she looks good and is far from being obese:
So what's right and what's wrong when it comes to a woman's figure? Go figure!
[Picture source, source, source, source.]
07 August 2010
Silverlight 4 with C# and Python (it's three!)
I recently felt like making a new Silverlight 4 app, but not just any app. I wanted it to have the following features:
- use an existing Python library
- be written in C#.
However, I wanted to do something new and challenging, so I went for C#. Doing it on my own was hard, way harder than just following an "embedding Python in C#" tutorial. Finally, I found that working example and got something starting from there.
What I got is a three on a golden background:

Okay, maybe that's not the right angle to start with. What I did was used the numbthy Python library and used it's gcd function to compute the greatest common divisor of 15 and 3, and it's three!
Getting there was hard. Finding the right libraries to embed Python, importing them the right way were tough tasks for an inexperienced user - some error messages would be very cryptic. Then, the app would hang on the splash screen if something was wrong in the Python code, the debugger wouldn't show where the problem was, and the "problems" in the Python code were:
- the print statement
- a class inheriting from object.
05 August 2010
Yet another personal website
Thanks to my surgery, I recently had a bit of time to spend at home, so I built myself a new personal website. I spent a bit of time investigating the cool new features of HTML 5, CSS 3 and jQuery and ended up using a cool thing called jQuery Masonry, and here is the result:
This time, it's just a single page, because I can't really imagine what more I could share (besides the blog, of course). It's also only in English because... er... because.
Technically, I used some JavaScript not to do any copy-paste between the eight divs but ended up publishing a static html file with the end result.
Artistically, when I compare it to all the great designs featured on Smashing Magazine, I honestly think it sucks, but well, I'm more of a programmer than an artist. Plus, I put a lot of effort into editing it. Html is cheap and my mind has been to many many places, starting with Moroccan souks:
museums:![]()
and texture factories:
All in all, I like it a lot, and I hope you do as well.
[Picture credit, credit, credit.]
26 July 2010
Geek gets surgery
A few days ago, I underwent my first surgery ever. The surgery itself wasn't as much of a big deal as the experience - I have wondered how it felt like since my childhood, when my little brother underwent one and I didn't. My curiosity finally got satisfied.
Wednesday, July 14th
I arrive at the hospital at noon. Waiting, paperwork, waiting, questions, waiting. Boring. They tell me not to eat to be ready the next day at 7h45 - I set my alarm clock to 7h30. I take a nap, then answer some e-mails, then go to bead early. Sleeping is something I'm actually really good at.
Thursday, July 15th
They wake me up at six and tell me to get ready now. I do. Then boredom comes back and I get back to sleep. (I guess there should be a part when I'm worried, but I'm really better at sleeping.) They wake me up just before eight. "Come on, it's time to go. (...) Okay, now the door on the right. No, on the right! But I can see you're smiling - that's the spirit!" When they lie me on the table, that's when I start to get nervous, but not for long: within a few minutes, I am asleep again.
I wake up to a doctor calling my name. Phew, I made it! Something is hurting me in the head. It must be the hair elastic I'm lying on. The algorithm to solve that problem is simple: lift head, move elastic, lay head back down. Ouch - lifting my head hurts. Oh yeah, they had to cut through my neck so now I can't really move it. I mange to pull the elastic away. Now what? Let's get back to sleep.
I wake up quite a few times that day and it's not pleasant. I miss Marcin, take a look at the clock and count the hours down to his visit on the following day. I want to drink - they give me a 9 ml bottle. I want to go to the bathroom. I want to cough. I want to lie on my side. I want to see Marcin. None of these are possible, but the deprivations are really bearable, as within a few minutes I am asleep again. I pass those minutes by observing all the IO interfaces I am connected to.
Friday, July 16th
I am back in my room at the hospital and am encouraged to start moving. I get to the promised land of the bathroom. I enjoy my position: no work obligations, no school ones, no social ones. I don't have to do anything. I can sleep all I want - and hell, I do! Visitors brighten my day, but I can't stay awake for the whole four hours when visits are allowed. As soon as they leave, I am asleep again.
Saturday, July 17th
Time to go! My stitches and all my IO interfaces get removed. I go to my Mom's for the week-end and spend most of the time - you guessed it - asleep.
Later on
I get two weeks of sick leave from work. So cool. So much time to sit at the computer, and, of course, so much time to sleep.
[Picture credit]
26 June 2010
I got my masters degree!
Two months after having my first defense and getting my bachelor degree in computer science, I am happy to announce I also got a master's degree in mathematics.
I now need to find a thesis subject in computer science, and besides that, I'm free for the summer!
05 June 2010
Rijndael S-box Sage implementation
It's no secret I like Python and Sage a lot. Today, I had the pleasure of working with Sage again: as a school assignment, I was required to show the calculations that prove that the value of the Rijndael S-box in row 2, column d, was indeed d8. While I am able to invert a polynome of this size by hand (let alone apply an affine transformation), I see no reason to do it, as a suitable tool is available.
So, here we go, the Rijndael S-box in Sage:
F.<y> = GF(2, name='y')[]
K.<x> = GF(2**8, name='x', modulus=y^8 + y^4 + y^3 + y + 1)
bin_digits = lambda h: [((int(str(h), 16))//(2^i)) % 2
for i in range(3, -1, -1)]
bin_poly = lambda n : sum([b * x^(3-i)
for i,b in enumerate(bin_digits(n))])
b1 = 2
b2 = 'd'
s = x^4 * bin_poly(b1) + bin_poly(b2)
p = (1/s).polynomial().coeffs()
p.reverse()
b = [0]*(8 - len(p)) + p
b.reverse()
c = [1,1,0,0,0,1,1,0]
d = [int((b[i] + b[(i + 4) % 8] + b[(i + 5) % 8] +
b[(i + 6) % 8] + b[(i + 7) % 8] + c[i]).n()) % 2
for i in range(8)]
d.reverse()
s1 = sum([d[i] * 2^(3-i) for i in range(4)])
s2 = sum([d[i+4] * 2^(3-i) for i in range(4)])
print hex(s1), hex(s2)
I admit: the above is code, not calculations, but I did the calculations in class and worked hard on the code. My main problem was the bit order. Nowhere in the original publication did it say to reverse the bytes. Adding all the reverses was a moment of desperation, and imagine my surprise when it worked. I wonder how much credit that solution will get me.
A great Friday night it was.
03 June 2010
Xen virtual machines are the creepiest thing ever
Among the things that have always creeped people out are all kinds of ghosts and zombies, for one simple reason: since they are already dead, you can't kill them.
Along that line, here's what creeps me out: Xen virtual machines.
See what Wiki says about them:
Administrators can "live migrate" Xen virtual machines between physical hosts across a LAN without loss of availability. During this procedure, the LAN iteratively copies the memory of the virtual machine to the destination without stopping its execution. The process requires a stoppage of around 60–300 ms to perform final synchronization before the virtual machine begins executing at its final destination, providing an illusion of seamless migration.Imagine that. On a traditional machine, if it was doing something you did not want it to do, you would slam the keyboard. On a VM, you'd kill the monitor. Then you'd pull the host's plug. Something would work. But here, as you try to kill the guest, it floats through the air to another host. There's no stopping it. There's nothing you can do but watch it do its evil.
Next, the robots revolt against us and it's Battlestar Galactica all over again. Brrr.
03 May 2010
Music in me: longest album titles ever
Have you ever wondered what was the longest music album title ever?
Until today, I thought the record belonged to Fiona Apple. It did for a long time and was even mentioned in the Guinness Book of Records for 2001. Ladies and gentlemen, it's When the Pawn!
When the pawn hits the conflicts he thinks like a king
What he knows throws the blows when he goes to the fight
And he'll win the whole thing 'fore he enters the ring
There's no body to batter when your mind is your might
So when you go solo, you hold your own hand
And remember that depth is the greatest of heights
And if you know where you stand, then you know where to land
And if you fall it won't matter, cuz you'll know that you're right.
You can also listen to it here, told by the author herself - I recommend checking it out.
Fiona Apple held the record for quite a few years, until 2007. Then came Soulwax with an album of remixes, Most of the Remixes, with a title of 552 characters:
The following year, Chumbawamba went even further, 865 characters in The Boy Bands Have Won:
I only quoted the first one, as the two others have pretty clear covers (or you can read them on the Wikipedia pages). Plus, Fiona's one is way more creative: it's a real poem with lots of rhymes, structure, and most importantly, a deep message. Soulwax's title is like a long explanation of what to except from the album, written in a very casual tone: I except more artistic value and sweat and tears in the creative process. Chumbawamba is not poetic either, but definitely does carry a message, and an interesting one, although the words "the boy bands have won" almost discouraged me from reading the rest. (Last time I listened to a boyband was when I was eleven and a friend made me a mix tape, then I totally moved on to the Spice Girls, so I don't really feel like the boy bands have won anything with me.)
Giving your album a very long title is an easy way to attract attention to it (honestly, I have never heard of Soulwax before and here I am blogging about them), but it doesn't make it automatically remarkable. To me, Fiona's one is definitely the longest great album title ever.
02 May 2010
China gymnastics 2000 medal revoked
Remember how back in 2008, I was wondering if the China olympic female gymnastics team had cheated by sending underage girls? Remember how while investigating the matter, I found that a gymnast from the 2000 team had admitted to cheating the same way?
Well, I learned recently that China's 2000 team medal got revoked! One of the gymnasts, Dong Fangxiao, was found to have falsified her age. (It's not the one I was writing about two years ago. Yang Yun is considered innocent due to lack of proof.) The team taking the spot is U.S.
Well, I'm happy. I'm not happy for the Chinese girls themselves, as they were just put in the middle of such a situation. You can't really put all the blame on a fourteen-year-old for anything: it's also the parents, the coaches, the teachers who are co-responsible. Plus, the incident doesn't change the fact that both Dong and Yang put thousands of hours into perfecting their skills. But, so did other girls, and competition should be fair: putting younger girls against older ones is not. China nor any other country should be allowed to cheat that way.
[Article, picture credit]

