Saturday, December 23, 2006

Waiting for 2 AM

Here's another reason why BSNL sucks: It spoils your sleep patterns.

The last few nights I've been staying awake late trying to make my downloads start peacefully at the strike of 2.

Automated scripts do exist. But the things you can automate to download are limited. (For instance doing an apt-get upgrade, may require user intervention. apt-get upgrade -y may be dangerous. And how do you go about downloading stuff from a Gnutella[LimeWire] network from a script?) Anyway, I've saved a few nights thanks to Shreevatsa's script that restarts the modem - I then can do wget kind of downloads.

Ok. Its 2. Here I go.

Tuesday, December 19, 2006

Two days that just weren't my days

This post is about how I travelled to Coimbatore for the ICPC. For information on the contest see my previous post


I had to go to Amrita (its an engineering college run by "Amma" 's devotees) at Coimbatore for the ACM ICPC.

Although I knew I can easily get to go by bus without reserving tickets beforehand, I still went to the transport stand and enquired. There was a Super-fast which had reservation at 6 AM, which reached Coimbatore at 10.30. I wasn't sure whether 10.30 was good enough (I didn't have the ICPC schedule with me), and I'd prefer this bus to the 2.30 AM bus for obvious reasons. So I booked a ticket. Rs. 112.

When I did realize that 10.30 is not enough I couldn't do anything - I didn't cancel it thinking it was a small amount, and I might be able to squeeze it out of CMI.

So I finally took the 2.30 AM bus. Rs. 107.

On the way, from the loud arguments between the conductor and many passengers, I come to understand that this guy does not like stopping the bus at arbitrary places. So early morning when I asked him what time it reaches Amrita, and when he said that there's no stop there, I quietly retired back to my seat and kept on the lookout for Ettimadai, where I have been just once before.

It must've already passed by then, or I must've dozed off, or I just did not recognize the place. Because soon I found myself in the city.

So I get down at this stop called Gandhipuram, and tried getting an auto (yeah, I had had enough of buses for the day - although, as I later found out, Kshitij and Nivedita had just left that bus stop some 10 minutes ago). The tamil here seemed a lot different (as confirmed by Nivedita later, she said she herself had trouble understanding) and I had trouble bargaining - I found myself agreeing to 250 for the auto (and he finally took 270).

So I reach Amrita for around Rs. 500. Almost five times what I should've spent. Its going to be hard to squeeze that out of CMI.

Contest over. Lets get back to Ernakulam


I started my journey back at around 7 PM. Well I take a bus to Palakkad and from there to Trissur. Now things get interesting. I'm a little sleepy, for some reason I was thinking of how I missed my stop at Coimbatore, I suddenly read എറണാകുളം (Ernakulam) on this one bus - and wow! - there did not seem to be any rush for it (The other Ernakulam/Thiruvananthapuram bound buses had a great rush). I got in. On the seat to my right a passenger asks another: ഇത് അമല വരി എലെ പോഗനെ? This goes via Amala?. The reply was something to the effect: Yes. Did you not read the name before entering?

While statements like this should've made me check the route again, maybe ask someone, I somehow did not. Perhaps I felt that it would upset my pride if I show that I'm not sure of what I'm doing. I did not know where the hell Amala was, I just thought it was somewhere on the way to Ernakulam and this young man was travelling for the first time and needed assitance.

Half an hour later the bus started. The conductor took a lot of time to come. In my mind I was wondering whether it was possible to get away with buying tickets on transport buses. Hmm.

The conductor finally arrived. I now had to pay. One Ernakulam, I asked. The look of amusement on his face told me everything. I paid up for a ticket and got down at dear old Amala. Amala Hospital and Research center. The conductor and the two fellow passengers (who were discussing the route of the bus) told me how to get back to Trissur. Ernakulam was in the opposite direction. (So where did I read Ernakulam on the name plate? It could well have been a stop it had already visited)

Since it was almost midnight, the road was deserted. During the long wait for the bus, I kept imagining how interesting it would be to spend the night on the road side if I don't get a bus. Soon I decided to take an auto. This auto guy had come with his auto to eat at the small restaurant behind me. And so when I he took me in (Bah! for Rs. 60. He first said 70. I blatantly told him: I have no idea of the rates, but I'm sure you are asking too much. Lets agree at 60). God then sent a bunch of auto walla's from the nearby auto stand to come and make a hugh fuss (Ah! don't you know the way these auto unions work? They are not supposed to take customers from near auto stands). During the heated argument I get my bus, and run away and save Rs.55.

(As a side note: On the bus, the conductor talks of a hartal [in Trissur, later mentioned by Dad]. Since now, after the day's incidents, I'm very much paying attention to the world around me, I imagine how I would spend the day at Trissur bus stop if it becomes tomorrow by the time I reach there and the buses stop plying)

At 0000 hrs, I finally got my (crowded) bus home. Needless to say, I struggled to keep my eyes open. I've had enough with missing stops, and gettin on wrong routes. I read every board that passed by me.

And finally at 0130 hrs, I spend Rs. 50 for an auto from the ernakulam transport stand back home.

Hmm. Was an expensive journey for a T-shirt and a bag.

P.S. About the title. On Day One of the ICPC, Kshitij, with reference to my expensive journey and a lot of walking I had had to do within the campus said that that wasn't my day.

Monday, December 18, 2006

ACM ICPC 2006, Coimbatore Regionals

I intend to describe the contest details in this little blog, and will put up another one on how I had two days of bad travelling a little later:)

So for the uninitiated this is the ACM International Collegiate Programming Contest Regionals, held at Amrita Viswa Vidyapeetham in Coimbatore. Its a team event and Team CMI was Kshitij,Nivedita and myself.

Accomodation, Food blah blah blah


Admittedly all that was good.

Warning: Technical terms follow. Meant for Contest Coders only.

The Contest


There were two practice sessions on Saturday. We sort of skipped the second so that we could get some sleep. The systems were set up in a highly insecure manner: We were given the same system during the two practice sessions and the final contest. The same username and password. And none of the files that we created during the practice sessions were deleted! We had a car(Compile and Run), kar(a Kshitij car), and a code template in place.

So then came the contest. 7 problems. 4 of them simple to implement brute-forces. 1 ultra simple DP. 1 that made no sense at all. At least they had 1 apparently good problem (I don't have a solution till now).

Oh! So you think we did the easy five. Ha! Think again! Trust Amrita to mess things up.

Firstly, consider the fact that there were a lot of typos. In problem D, in the sample input a line read 63 which was crossed off by pen and replaced by 705 on all the question papers. Although being one of the simplest to code, we coded it a little late. By then a lot of people had submitted queries to the judges telling them that the answer should be 63 and not 705. They adamantly said that their test data was correct. We too got 63. And we stopped working on it. Later they sent a Judge warning saying "Please stop working on Problem D, until further clarifications." A long time later they fixed it. This was just one of the errors we encountered there were many others. And most of the time the judges took ages to admit their mistakes.

When you make a submission and you get a runtime error whose description is "close $fd", what do you expect? What do you expect when you get your status as "Invalid Function" (No, not as a runtime error - but as a submission status). What do you expect when the contest environment docs don't mention such things ANYWHERE!?

Lets go through this again. We got the close $fd, on a very simple code which simulates a brainvita game. It was obvious that this was a line from the Mooshak (that was the contest environment software) scripts. Hmmm. Something to do with files?

We didn't come close to guessing it was due to a SIGABRT until the last 5 minutes.

I distinctly remember the day before during the practice session, they had some wrong testdata and in order to test whether it was a testdata problem, we used an assert. As expected the assert failed and we got a Runtime Error with description "SIGABRT".
They seem to have tried to hack Mooshak, or as we had asked the judges during the contest - Are you using a beta version of Mooshak?

The Invalid Function. Well this was got by Kshitij on the DP problem. It sounds so much as though we are using some system call. Ok, so lets remove #include <cassert> and try. Nope not that. Lets ask the judges. Oh you know their reply - something like "Please check your code." Fuck you. What the hell are we supposed to be looking for??? Invalid Function!? We asked something similar to them. We can understand P.E. or W.A. but THIS!?

We spent time debugging, we tried looking for god-knows-what. In the last 15 minutes, we changed the strategy. We were out of the race. We binary searched on the code by commenting and submitting, and eventually found that "Invalid Function" was because of too much output. Wha...!!?? During the course of binary searching an assert failed, we now got "close $fd". We at last found out what they meant in the last five minutes of coding. And why the hell is the error description for SIGABRT changed so drastically from the practice session!!??

It was a very dissapointing day. We were no where near the tops.

Xtc++, the team of Pradhan, Shankar and Rahul from IIT Madras who came second in the Kanpur ACM regionals, were also very far from the top. They had done four problems. They too encoutered one of the "close $fd" or "Invalid Function" problems. Maybe they can still get through using a wildcard because of the Kanpur ACM.

We have to be contented with a crappy T-shirt and bag.


During the "prize distribution" ceremony, one of the guys behind it made a small speech where he said something to the effect: "Last year we had lot of problems with evaluating submissions on time. I think our greatest achievement this year was that all submissions were evaluated immediately." Agreed. I don't think he is aware that most other contests have it that way. I remember last year submissions took more than half an hour to evaluate. Rumours are that the submissions were checked by hand.

Anyway congrats to acmesolvers for coming first.

In the feedback form Kshitij wrote: Either you conduct it properly, or don't conduct it at all. And in my feedback form I controlled myself from using obscene language.

Xtc++ suggested that we all mail some ACM big-guy (I forgot the name they used) and tell them about the Amrita ACM. We don't want an Amrita ACM next year.

Friday, December 15, 2006

Finally! No more Essentials!

Snipped from Sripathy's mail. At least we are going to have good food next month onwards at Siruseri:

<quote>

The Hostel mess.

There will be a new caterer supplying food in our hostel beginning
next semester. Towards this we are setting up a very modern kitchen
in the hostel. The kitchen will be ready by the end of December
2006. CMI is also subsidising a part of the mess charges.

</quote>

Wednesday, December 13, 2006

Nurse(s?) are hot! (Part 2)

I had to go back to the hospital today...

Remember I told you how I thought the nurses there were hot? Well, in particular I had one nurse in mind - though most of them are quite pretty (I'm giving up on ``hot''. It makes me look like a pervert). And then I asked you to guess what I'm thinking?

Well I was thinking that maybe those nurses were, in fact, nursing students.

It turns out I was right.
Today the nurse in question comes in spends some half an hour with grandma... told us that grandma is her patient - as in, she was in charge of her. And so wanted to know her entire medical history and stuff like that.

She has this b-e-a-youtiful smile. So neatly dressed. I kept wondering whether it would be ethical to stare at her for sometime.

Anyway, during the course of the conversation when grandma asked her something about the treatment, she said she was not too aware of it because she was a nursing student and they are not told that much.

God, I love you.

There were things that stopped me from flirting.

Grandma ill.

I - a little tensed. The thought that I need to speak without breaking in Malayalam included.

And you know how these movies give you the impression - that might be true - that girls like sensitive guys. Probably more true in the case when the girl's a nurse. Trained to be sensitive. It turned out I couldn't play the sensitive-guy card...

She kept asking me the questions when Grandma couldn't answer. I kept nodding my head - No, I have no idea, I would say in my depressing Malayalam (more on that later). I haven't being staying with Grandma, and haven't been told of all her medical conditions - how am I supposed to know? At least she didn't show any sign of disgust. But I'm no longer Mr. Sweet Helpful Grandson who doesn't mind spending his morning with Grandma.

I'm also probably considered Ameer baap ka bigda hua beta.
Why? Well I took my laptop there yesterday - I did need to spend my time. And many of them would ask me what I'm doing. In Chennai, pseudo-strangers would ask me where I work even if I don't have my laptop with me - its not too often someone asks me where I study. I like it that way. Here however the nursemaar asked me (today) പടികുകയാനോ? Studying? അദെ. Yes. I awaited the worst. It came. What am I studying? BSc. Mathematics and Computer Science. Oh, that didn't exactly sound quite glamorous for someone touch-typing on a laptop. Ameer baap ka bigda hua beta.Rich Dad's Spoilt Son. Failed in engineering - took up BSc. Playing games probably. Show off.

In other stories, when the doctor came on his rounds he made an astounding discover about me: ഇയാള്ടെ മലയാളം ശരി അലളോ. This guys Malayalam is not right.

Tuesday, December 12, 2006

Nurses are hot!

I was at the Shree Sudheendra Medical Mission today (despite the glamorous name I suppose its just a hospital), as my Grandma was admitted there for some tests.

It struck me, that nurses are hot. (We shall define, for the time being, nurses to be female nurses).

Some of them looked quite young too - a google search lists this place as a Nursing school. Hmmm... Guess what I'm thinking... :p

Oh well. Anirbit had once called me an imbecile pervert (along with a set of adjectives that need looking up in the dictionary). By writing this here, I think I've proven him right. ;D

Monday, December 11, 2006

Java, GPRS modem, and other stories...

I've been doing Java programming for a day or two now, and I've made a few successful submissions on Spoj. Personally, I feel Java sucks - but at least the Java libs provide a BigInteger for contest code ;)

In other stories, I've successfully been able to detect my dad's K510i as a GPRS modem via bluetooth with the help of this article. Although not on wvdial, KPPP is now able query the modem. I'm not able to dial (yes, I don't have an a subscription yet... but I can try to dial). It gets stuck at Initializing Modem.... The log remains empty, so it hasn't sent any of the commands yet. Bluetooth is definitely being used since the kbluetoothd icon lights up.

I intend to try it out tomorrow, as I'm going to need GPRS internet as I'll be out of the house. Airtel, at least in Chennai, has this 24hrs for Rs. 20 thing thats gonna be so useful. Don't know about Kochi - I'll call up Airtel Service after some time. I'll update this post with more information later.

Sunday, December 10, 2006

Am a Yellow!

Last night's TopCoder contest was great. I didn't do the 900, though it looked simple - I did the 250 for a mere 171 points, but made 4 challenges. I ended up Rank 124 at the end. I am now a yellow at 1500 points.

Friday, December 08, 2006

Using chroot to fix bootup issues...

Yesterday when I upgrade my Ubuntu Edgy via apt-get, it told me that I can safely remove sysvinit as it is no longer required, and told me to use apt-get autoremove for that. I thought maybe the Ubuntu team has decided to replace sysvinit with upstart for good, so I did as it told me and removed sysvinit.

Some time later, when I had to reboot my system because of a system crash (kinda like to blame those on Beryl). And then Ubuntu tells me it can't find /bin/init, and takes me to a BusyBox shell. It took me some time to realise that this was not a hard disk crash, and just because I uninstalled sysvinit without installing upstart.

The Fix.


Ok, so what do I do? I figure that I have to install sysvinit somehow, and I need to use apt-get or dpkg somehow. But I can't boot up my system to call commands!

I have never used chroot in an administrative situation before. I tried chrooting from the BusyBox shell, but my root was mounted readonly by default. And my /dev/ device files were missing - I tried creating them using mknod - but I wasn't too sure about the what are the major and minor numbers that I have to enter.

So I booted it up from a Ubuntu 6.06 LTS CD, and then did the required work:

# sudo mkdir /r2
# sudo mount /dev/hda1 /r2
# sudo chroot /r2

I'm now almost like being in my old system, my /var/cache/apt/archives/ show a sysvinit package, so I don't think I'll need to setup a network connection. I just do
# sudo apt-get install sysvinit

and it works.

I reboot and I'm back into my trusted Ubuntu system.

Thursday, December 07, 2006

Adsense has no sense!!!

I just put up AdSense on my CMI homepage. Incredibly the ads that are coming up refer to Arnold Schwa...gger and body building... hmmm...

I'm drowning in Google Accounts!

Ok, Google is now an integral part of my life! cool.

And am drowning in Google accounts. Let me start my long sad story.

Way back in 2000, or maybe December of 1999, when people were so excited about the coming of the new millenium and when I first used the net at a cyber-cafe running on dial-up and charging Rs. 45 per hour or half-hour, I created my Rediff e-mail id, my first email id: arn_2000 AT rediffmail DOT com.

That stayed as my primary email id for a long time to come, and I used it for my first Google Account.

Much later when I started orkutting, I used my rediff account to sign up for that. I had by then created a Gmail account, arnold.backup AT gmail DOT com, which was meant for, as the name indicates, backup.

Now then Rediff started taking action to improve its web-clients interface, and although it was all for the good, there were months of total irritation, while the interface was still in developments.

Then I decided to switch to gmail: arnstein87 AT gmail DOT com.

Whats the big deal you ask?
Well I orkut, and I use gmail. orkut uses my rediff ID, and gmail uses - well - my gmail id. And as any orkut user, who uses gmail, knows this causes a whole lot of cookie mashups. In effect I can't do the "Rememeber me" thing on both. So my login procedure involves the following:
  • open www.gmail.com: it logs me in directly.
  • open www.orkut.com: It asks me for arnstein87@gmail's password. I click "Sign in as other user".
  • I login with my rediff ID.
  • I go to my gmail tab and then click inbox, it logs me out
  • Now I login again with my gmail ID

For some reason, the logins now stay. I've been doing this for the past many months, especially since I got my laptop, it usually does not matter, I keep myself always logged in (ahh! how I love suspend to memory!). But recently, I've had lots of crashes (mostly due to Beryl) and I've got to login too often.

Now with my starting blogging, I like to keep myself logged into blogger (Another Google service!) too - and I use my arnstein87 account. Guess what that means? I still haven't figured out the right permutation of logging ins to gmail, orkut and blogger that keep me logged on in all.

Interestingly there don't seem to be any Firefox extention meant for this. There's cookie-swap, but I couldn't get it to work the way I wanted :(

Sometime back, orkut had asked me whether I'd like to associate my account with a Gtalk account. Happily I said YEA!!! and the blood sucking thing said I have to create a new google account. Ha! Welcome arnold.noronha AT gmail DOT com.

My Gaim's overflowing now: I've got my jabber account, one MSN, two yahoo accounts, this new orkut account. I avoid logging on my gmail account - yeah I use the GMail interface for chatting on that.

Tuesday, December 05, 2006

Emacs22 in Ubuntu

I've been a Emacs fan ever since I was told to read the entire Emacs tutorial (i.e. ever since I learnt how to use it). Emacs is a marvelous concept. Emacs rulz.

But emacs font support is bad, that is not news. I find that the strain on my eyes is little too much. And I've always wanted to use Bitstream Vera Sans Mono on Emacs. That is a darling font for coding.

I installed emacs-snapshot through the ubuntu repos, unfortunately it does not seem to have Xft support by default (that gives anti-aliased fonts). But I can use BVSM through the command line:
 emacs-snapshot -fn '-*-bitstream vera sans mono-medium-r-*-*-*-*-*-*-*-*-*-*'


But the font rendering is dissapointing, I guess BVSM does not look that great without anti-aliasing. When I get time I'll get the CVS snapshot - maybe emacs23 - and compile it with Xft support - but I'm afraid of doing that since emacs is my editor for contest coding, and I don't want to find bugs at critical times.

So what are the most obvious new features that I like: It has an optional GTK based interface - nice integration with gnome. Finally it has a window icon! Strange as it may seem, a window icon is critical during TopCoder contests, since Topcoder applet windows don't have icons and it becomes difficult to distinguish between emacs and them. It has a greedy delete option in C++ mode... I've seen this somewhere - I think KDevelop. Greedy delete deletes indent characters with a single backspace stroke, its logical: enter key adds a newline and some 2-3 tabs for indenting, therefore backspace should delete all of them. Also, I can now make the cursor not blink, blinking cursor is an irritation especially when we close brackets.

My wishlist: I'm still wanting line numberling on the left (like KDevelop, Kate etc). Drop down autocompletion (KDevelop, Eclipse, and ahem... Visual Studio) its nice to know all valid member functions, a nice project browser (Speedbar is only very minimal) - infact making it a full fledged IDE like eclipse would be cool.

Monday, December 04, 2006

Dad's K510i

Cool so finally we (nope, actually Dad) got a digicam... at least in the guise of the Sony-Erricson K510i. I and my bro went about buying that today evening, and it seemed to the best thing that fitted our budget and the only thing that fitted our (and my) stringent requirements:

  • Camera
  • Bluetooth
  • GPRS

And our original budget was 5K to max 5.5K. I said no to K310 because of lack of bluetooth, and Roshn wanted 1.3 Megapixel camera instead of the VGA. Finally I decided to chuck out some of my own money to get the 510 at 6.2K.

The camera's great, and file transfers work out of the box using the provided data cable in ubuntu. I had some trouble with bluetooth, I don't why - I've done file transfers before. Anyway, I finally got it to work after installing some bluetooth related packages and rebooting (Yeah that rebooting is important).

I still haven't tried using it as a GPRS modem, that'd be interesting to try out.

(As of today, the pic in my profile is taken with the K510 by big bro)

Improving my Laptop's wireless speed

Wow! I've just discovered I can increase my wireless speed by actually decreasing it!

See its like this (or so I think): when the speed is set high, there seems to be lotsa collisions and packet loss, so eventually I get a low speed.

When my connect to my local wireless network (a BSNL provided Quidway WA1003A), the default bitrate chosen is 24 Mbps. But when transferring files to my desktop connected to the ethernet I get like 30-80 kBps. When I reduce the speed using
sudo iwconfig eth0 bitrate 6M auto
(i.e. 6 Mbps) I get around 500 kBps. The auto is to allow Ubuntu/ipw2200 to automatically chose the lower speeds if better (Hah! it doesn't do that too well though).

There have however been times when without all this effort I've got 1-2 MBps. Would be glad if someone told me what I should do, googling hasn't been too much of a savior.

(Btw, since 1001 hrs today I've been shifted to the Home500 plan. Yaay!)

Saturday, December 02, 2006

DataOne... Day 2

Day 2, and am still waiting for that DataOne upgradation...

Friday, December 01, 2006

DataOne, Kochi and other stories...

Aargh! Sometimes BSNL gets on my nerves. Today I got our home dataone connection upgraded to the 500 plan, and they told me they'll do it by today. But their damn servers seem to be down and I can't even see whether my plan has been changed or not... I had these great plans of downloading the few missing episodes of Friends...

Kochi hasn't changed too much in the last four months. Last time when I had came for summer I was really surprised to see the new developments... I was expecting the pace was going to be maintained...