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]

27 April 2010

I'm a Bachelor of Science. Computer Science.

As I was writing a little bit before yesterday, I recently had the opportunity to defend myself, and I'm very happy to announce that I succeeded: I now am a Bachelor of Science in Computer Science. (On the other hand, I don't really know what I should capitalize here, but it sure looks great that way.)

Boy was I stressed. Well, I kinda mentioned it already. Plus, it's evident: it was my first defense, but most importantly, I hadn't revised everything I wished.

My stress was quickly relieved, however. I came to school over two hours earlier for some last revisions on-line and was drinking a vanilloccino when one of my professor asked me whether I was free. Without thinking too much, I said yes and got taken to a room where defenses were taking place. I took the exam and was free two hours earlier than expected - lucky me!

Next defense, coming soon! This time, in mathematics.

20 April 2010

Tomorrow

Tomorrow, I'm defending my Bsc in computer science.

Which means I'm revising my eyes out. And napping.



That's totally a good thing, because Lifehacker keeps saying how cool naps are.

Two things I'm not doing are procrastinating (I'll do that later) and panicking. It's weird. I should panic. If I take the list of requirements, the speed I'm revising them, the amount of time left and do the math, I've got reasons to panic. Just not the time, I guess. I need 2-3 more days of 100% focus on studying, but that thing is tomorrow.

Unless it isn't, because I need some signature here, something else here and the professor I need them from doesn't have any classes this semester, so he's kinda hard to catch. Honestly, I wouldn't be too disappointed if tomorrow's defense wasn't to happen.

[Picture credit]

06 March 2010

Random linkage: Cat Ladders

There are blogs about absolutely anything these days. Today, I'll feature Cat Ladders, a blog about - you guessed it - cat ladders! The site features over 800 pictures of cat ladders from 29 countries.

Most posts feature simple solutions, like this one from Poland:


There's also something for the big cats:


... and something for not cats:


My personal favorite is this one:


Pure royalty! I wonder if it has a little red carpet on it.

If you want to learn more about cat ladders and Cat Ladders, there's also an interview with the blog's author. Enjoy!

13 February 2010

Life geekified:Tetris stuff for the house

Tetris time, everybody! I have gathered today some cool Tetris stuff for the House.

Let's start with the bathroom. Here are Tetris tiles, avaliable at Tertis-tiles.com:


GadgetHer presents a Tetris mirror:


This beautiful bookshelf is designed by Brave Space Designs:


But if you feel like making your own, Instructables has a tutorial:



Plus, a tutorial for a matching lamp is also included:


Finally, this Tetris furniture looks really cool:


On my wishlist: all of the above!