Wednesday, March 28, 2012

Routing triangle inequality

Despite the years of internet development (or maybe due to it?), the routing problems are still prevalent. In fact, it is quite hard to have a consistent routing behavior. One of the user-visible failures is a "triangle inequality". In triangle inequality, we have three servers A,B,C. A is able to communicate with B and B is able to communicate with C, nevertheless servers A and C are not able to communicate.

You may guess why I am writing this post -- exactly because I encountered such a problem today. And not only once. There seems to be a bunch of sites (dsl.sk, sportujes.sk, websupport.sk, etc.) down here in Switzerland although they are working from Slovakia. The reason is probably some misconfiguration on the way between switch.ch (swiss academic network) and www.six.sk (slovak peering center). Whatever the reason, the results are clear - unhappy customers and a lot of research to do on reliable internet routing protocols!



Monday, March 26, 2012

Restarting desktop computer? What a weird idea!

Dear Microsoft updates and application installers.
I hardly believe my eyes each time I see the famous "restart required" prompt. Especially the annoying ones after automatic updates that can be postponed by max of 4 hours. They pop-up periodically on our lab laptop and try to provoke most awkward situations (laptop restarting in the middle of the presentation). Why would I want to restart my computer? Why would I want to break my work?

The idea of restarting a computer is outdated now. Consider Linux operating system. You can install, update or remove programs without rebooting. You can even update your kernel [http://www.ksplice.com/] without rebooting!
As the proof of my statement about obsolete reboots, consider my desktop computer at school.
It is running over half a year now, it survived moving inside the office, survived changing of external hardware (monitors, keyboard, mouse), it even survived update from gnome2 to gnome3 (although that time I lost my session -- it turned out that running gnome2 months after its removal was not the best idea).

Anyway, to the point -- Today I am celebrating whole 200days of uptime :-)

[ppershing@nslpc19: /usr/research/home/peter ]>uptime
 09:27:12 up 200 days, 19:38, 27 users,  load average: 8.18, 8.36, 8.21

Overconsumption as a away to kill our planet

Dear overconsumers,
let me start with a quote from http://www.ibtimes.com/articles/319115/20120325/iphone-5-rumors-roundup-release-date-features.htm "Last year, Apple managed to sell roughly 30 million iPhones in the last quarter alone. Since it launched theiPhone 4S, it has sold about 20 million units of the handset, making it one of the best sellers in the history of smartphones. The next iPhone, dubbed iPhone 5, is expected to be even more popular. Analysts forecast that Apple will sell about 50 million iPhone 5 units in 2012 and 2013."

It is evident that people are just crazy about iPhone. But why they want this piece of junk? Well, because it is cool! It is a modern style of life and the desire to show others you social status. But unfortunately it is also killing our planet. How many of you are waiting for then new version of iPhone just to replace now outdated iPhone 4S? How many of you are buying a new car each few years? How many of you are buying new clothes for each season just because the new style is different?

It was not more than a few centuries ago when people used their belongings over 100%. There was no waste. People bought shoes and clothes and they used them even after the possibility of repairs. People recycled most of the junk from kitchen to feed animals. Personally I stick with this idiom and try to use my belongings to a maximum degree.

But what about you? You overconsumers buy new shoes, new clothes, new kitchen appliances, new laptops, new smartphones and even new cars each year. This is hardy sustainable, especially because old things need to be somehow removed and they travel to the waste. Recycling is a powerfull word here but who really cares? And even recycling is not 100% effective. So, will you please stop killing our planet?

Sunday, March 25, 2012

Coder classification part II (right coder)




leftcoder
  • sticks to the left of his editor window
  • word-wraps on 40 characters
  • believes that the true power is in simplicity
  • uses variables and functions that are short:
    • int i,j,x,y,a,b;
    • void fn_a2(int n);
  • the optimal program have average of zero characters per line
rightcoder
  • loves to make veeery loooong statements
  • does not have an editor with word wrapping
  • uses variables and functions according to the following scheme
    • for (int myVariableToIterateSimpleCycle=0; myVariableToIterateSimpleCycle < myNumberOfCycleIterations; MyVariableToIterateSimpleCycle++)
    • int calculateAverageOfSuppliedListOfNumbers(vector<int> suppliedListOfNumbers)
  • the example of an optimal program is one-line database server in C++
  • hates Python for not being able to put conditionals,cycles and loops on a single line
  • others fear if he says "that is one-liner"

Friday, March 23, 2012

Coder classification part I (topcoder)





topcoder
  • is lazy to scroll
  • writes his own functions near the beginning of the file
  • hopes that this way he may show everyone how cool his code is
  • makes his functions long so other developers need to scroll a lot
bottomcoder
  • writes his own functions near the end of the file
  • hopes that nobody (especially his boss) will ever look so far into the code
  • have a macro to jump to the end of the file
  • the usual edit to his code by other developers starts with //WTF? or //FIXME



Tuesday, March 20, 2012

Helvetica coding contest II


Thanks Mino for this great idea ;-)

#include <stdio.h>
int main() {
  print(“Helvetica coding contest\n”);
  return 0;
}

#include <stdio.h>
int main() {
  print(“Courier coding contest\n”);
  return 0;
}

#include <stdio.h>
int main() {
  print(“Times coding contest\n”);
  return 0;
}

Helvetica coding contest 2012

Finally, after so long time, I decided to take a test of my coding skills. The Switzerland's hc2 contest is one of the major contests for Swiss high school and university contest. The contest itself is a team contest however. And there is a particular lack of Slovakian ACM team membest here in Lausanne. So I decided to take a wild shot and join Dimitri + one more person from random team-matching. But you know ... plans are usually changing. For such stupid reasons like "washing clothes" (Dimitri somehow failed to reserve washing timeslots in advance and the only ones left were during the competition). 

Therefore, the team (with the random name "The rainbow unicorns") turned out to be formed just by a physicist and me. But I must say it was a splendid combination. During the training session we decided to split responsibilities -- Andrey was being responsible for reading the problem statements and figuring out solutions and I was responsible for transferring them by beating the hell out of the keyboard. And it worked out quite well. In fact, during the first hour, I think we were leading the scoreboard for a while. Anyway, it was a tough competition. 

The moments before the scoreboard freeze (1 hour before the end of the contest) we were on the 4th place with 9 problems solved -- the same number as the second team only higher penalty. The last hour was hectic. We tried to solve different problems but we did not came up with any good solution. Then, after ingenious idea of using apple (taken from free-food area outside of the room) as a model of sphere on which one can draw with a pen (yeah, I was trying a long time to figure out where should I visualize the damn sphere from the problem statement) the idea hit me and we submitted our 10th task. But then nothing. I tried to push one rather-bruteforce solution to the last geometrical task without success (unless you take 9 wrong/time limit exceeded submissions as a success). 

During the final hour and especially before the results announcement (organizers take their time to prepare it) I was getting anxious. What will be the final ranking? How many teams managed to submit the last task during that hour? I was pretty sure that we end up on the fourth place. I was so wrong. At the ceremony, we learnt (from the absence of our name during the backward listing of the teams up to third place) that we actually ended up in top 3. And the surprise after announcing third team was ... hard to describe. It turned out that none of the other teams with 9 tasks before the freeze actually managed to solve something in the last hour. Anyway, thanks organizers for the extremely interesting event and for the tasks -- they were well balanced, not very traditional and very enjoyable. Thanks again!
Silver medal
And the certificate

Friday, March 16, 2012

Literal PhD in computer science

Doing PhD in computer science is like being a novelist. All I have to do for next few weeks is

  • write workshop paper
  • write paper reviews
  • write travelgrant statement
  • write presentations for our meetings
  • write miniproject proposal

Thursday, March 15, 2012

Open letter to Visa Waiver Program site

Dear ESTA (Electronic system for travel authorization) website.

 I really thank you for making my life miserable. But before that, I would like to congratulate you on dropping the support for Internet Explorer. It is a brave step and the implementation quite impressive -- waiting more than 20 seconds before you show me the site is more than IE's timeout on the connection.

But let us go back to the application itself. It was my pleasure to realize that although I need to fill in my country of birth, there is no such country (Czechoslovakia apparently did not exist 25 years ago). Well, I guess that concentrating on the history is too big effort. On the other hand, concentrating on the future where Slovakia does not exists (and virtually any other country including US) does not solve my current problem of travel authorization as well.


Moreover, I would expect that you make you mind -- is the phone number needed or not? And by the way, should I include leading zero for my number? Obviously the number itself cannot be used without that zero.

However, the most worrying fact is that I am not able even to fill in even the simplest questions like "the family name as it appears on your passport". Obviously, I cannot lie and use the name without accent marks as that is not what is on my passport!


As a final thought, one thing which is really baffling me is how do you manage redirecting 3 times in a row, most of the sites are not being able to do it properly a single time.


> wget "https://esta.cbp.dhs.gov/esta/application.html?execution=e1s1"
--2012-03-15 18:07:49--  https://esta.cbp.dhs.gov/esta/application.html?execution=e1s1
Resolving esta.cbp.dhs.gov (esta.cbp.dhs.gov)... 63.167.255.44
Connecting to esta.cbp.dhs.gov (esta.cbp.dhs.gov)|63.167.255.44|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://esta.cbp.dhs.gov/esta/application [following]
--2012-03-15 18:07:50--  https://esta.cbp.dhs.gov/esta/application
Reusing existing connection to esta.cbp.dhs.gov:443.
HTTP request sent, awaiting response... 302 Found
Location: https://esta.cbp.dhs.gov/esta/application.html [following]
--2012-03-15 18:07:50--  https://esta.cbp.dhs.gov/esta/application.html
Reusing existing connection to esta.cbp.dhs.gov:443.
HTTP request sent, awaiting response... 302 Found
Location: https://esta.cbp.dhs.gov/esta/application.html?execution=e1s1 [following]
--2012-03-15 18:07:51--  https://esta.cbp.dhs.gov/esta/application.html?execution=e1s1
Reusing existing connection to esta.cbp.dhs.gov:443.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]


Yours sincirely,
  Visa Waiver Program applicant