XXIII Colombian Programming Contest – Second place!

As I had said, last saturday was the XXIII Colombian Programming Contest. It took place simultaneously in 6 cities of Colombia with a total of 93 competing teams. This competition was the qualification round to participate in this year’s International Collegiate Programming Contest (ICPC). The Top 40 teams have advanced to the next contest that will take place next October 24th in Bogotá, to compete against Venezuela and Ecuador and decide who will advance to the World Finals in China.

We ended second, solving 4 of the 10 problems. Here’s how it went.

Continue reading →

Convert string to integer in Javascript

var s = "1337";
alert(parseInt(s) * 2);

My university has been hacked!

More precisely, the Computer Science Department of EAFIT University has been owned. My mate just showed me its webpage. And all you can see right now is this:

DIS EAFIT owned

H-U-H? err, I mean, K-U-H? What happened here? Then my friend showed me this, the website of the IEEE Medellín subsection (click to enlarge):

ieeemedellin

Googling a little, I found out about who seem to be the responsibles, some dudes who call themselves the Kosova Unknown Hackers. Kosova? WTF? I don’t even know where that is. I think I’m going to found the CCCC and take revenge. The CCCC, you know? Colombian Cocaine Consumers Crackers. We are going to be bad and deface some third world country’s universities’ webpages!

I guess what I wanted to say is that I feel so insecure. Seriously, how come this happens? If this is the security of the Computer Science Department, I can’t image how secure is the site of the Bussiness Management Department.

Time Javascript operations

Sometimes I need to time how long a Javascript operation takes. It’s very easy if you are using jQuery.

   console.time("longOperation");
   for (var i=0; i<1000; ++i){ var j = i*i; } //do something complicated
   console.timeEnd("longOperation");

Then, you’ll see the result in the Firebug console:
Time Javascript operations

Getting ready for the fight

This saturday is the 23rd. Colombian National Programming Contest. I’m very excited! I can’t wait to feel the adrenaline of the 5 hours timer. Last year we finished sixth, which was not very satisfying. That time I couldn’t attack the keyboard since my left hand was killing me of pain in a plaster cast. It had been in surgery after a rather scary accident.

Let’s hope I can manage to live this week without breaking any more windows and have a fair fight this weekend!

How to replace all pixels of one color with another color using the GIMP

Open the image using GIMP. Then go to Select > By color. Set the threshold to 0 and click a pixel of the color you want to replace.

Set the threshold to 0

Set the threshold to 0

This will select all pixels of the clicked color. Then simply use the Bucket Fill Tool to fill the selection with a new color.