Passport Status Updated

Passport status
It was stuck at 'Waiting For Police Report' for the past three weeks.

A welcome change.

I need to

  • Become an SCJP
  • Design a kickass personal homepage
  • Help grandad get home
  • Road to fitness - take the first step
  • Do the AOL Advanced course, before which I do my kriya for 7 days in a row without too much flinching
  • Solve all the problems in the CodeChef practice set, post the solutions/code for those problems on the Internet
  • Get passport and all other documents required for TCS ready
  • Read all books in dad's DeBono collection
  • Fix dad's old Nikon
  • Fix the Sony Cybershot
  • Start a photoblog
  • Fix the timer in the desktop
  • Learn how to program in assembler
  • Pick up where I left off with C
  • Consolidate all my blogs into one familiar web resource, so that all my friends don't have to chase me around the web
  • Learn the art of self-defense (karate seems like a good option)
  • Learn how to fold shirts like mother
  • Learn how to put on a tie
  • Make a killing in the stock market
  • Develop a nice portfolio monitor for dad
  • Develop that game I came up with in mid-pee

Thoughts On The Long Wait For TCS

What prompted this?
I've found myself asking at times "Oh, mera number kab aayega!?" when I open my inbox and a bunch of new emails in which everybody has torn to pieces the latest bit of news that some college somewhere else, which nobody'd ever heard of had been batched. Anguish, disappointment, outrage.

While I was sucked into it initially, by and by I learnt that nothing but the disappointment of unmet expectations would come from this.

So, I thought about it, and asked myself...

Why worry?
Why worry about a date that could be 4 days from now, or even 4 months from now?

Why worry, when clearly, TCS has got far more important matters, like for instance keeping an organisation with a headcount larger than the population in a lot of countries running smoothly, all while adding more people at the same time?

Why worry, when you're dealing with a company that's got a lot of history, a well-respected organization which has time and time again kept up its promises?

Why worry, when you're young?

Why worry, when there are so many other opportunities out there besides thisto fall back in case it doesn't work out?

Sure, you've lost a lot of time, but 6 months isn't the rest of your life. It will seem like a tiny blip when you look back on it 40 years from now.

It's not our problem to figure out "When?" It's theirs.
Screw it! that's what I'm saying. They'll batch us when they can, and need us.

Continued harassing of the people at TCS is certainly not going to help the situation.
They're a big organisation, and since there are orders being passed down a chain of command taller than Mount Everest, there are differing levels of awareness at each level. The HR people like Arun keep getting calls from us, and all he can do is pacify us and stall for another 5 minutes before the next call, because there is very little he can do without the approval of 10 other managers across various departments - finance, recruitment, and so on...

What can I do in the meantime?
If you took a few moments and thought about it, this is time that you have been given to do some amazing stuff.

Go out and learn a new language. Go clubbing. Dance. Figure out how to write a word processor in assembly language. Solve a problem. Write a poem. Be silly. Do everything that you've wanted to do all when you were stuck attending dull lectures at college. Travel. Do all of this and more. Because if you think about it, this is time that you'll never ever get.

This surely isn't the time to be whining about whether the harrassed HR people at TCS are going to chalk off CMRIT on their big training blackboard. It really isn't.

A problem/solution approach:
If you can't help but think about this, then look at it as a problem that needs a solution. The problem can quite simply be described as uncertainty arising from a lack of information. What is a solution to this?

Communication - regular, and reliable.

TCS needs to have a blog of sorts where they put down a list of colleges that have been batched so far, and the next probable set of colleges to be batched. It'd be simple and effective. And at least, the amount of confusion regarding which grade each person's college falls into can be avoided.

Even a twitter profile should do the trick. Believe me, one thing they won't have is a shortage of followers.

Something easily accessible, they can even put it on NextStep if they want to restrict it to just students.

Right now, there are groups on social networking sites like orkut and facebook, that are relied on for information. But these are unofficial, and I'm just a little sceptical when it comes to relying on the information posted here.

It's particularly sad that there is nobody I've found at TCS making use of social networks to send information out to students. Maybe I've not searched hard enough, but they really should start something on those lines. It would definitely reduce the number of calls handled by the people at HR.

They should really think about this.

My position as of now.
Sometimes, there's some good news, and while I'm happy for the people who have been batched so far, and more recently, the non-CS* students from our college, for having been given a chance at something that's really going to be a possible future vertical that TCS is going to be involved in, and like all the CS students, I'm still left clutching at straws when it comes to my future with TCS.

But I've gotten some things crossed off my list. Not a lot, but it is definitely a start.

While, I'm not going to be happy now about not having anything but "Sure, January or February (or any month in 2010)" as an answer each time I'm asked "When?", I'm pretty sure the answer is soon in coming.

Till then, stop worrying, and start living. Life and the time-of-your-life is too precious to be wasted in worrying about some day in the future.

Just have a little faith, and enjoy yourselves. That's all I'm saying.

Apologies on the length of this, but I do hope you gained some perspective on this. This is not a definitive guide on how to spend 6 months while waiting for a joining date, that guide will be written by you, for you.

* I've seen the term non-CS take on some kind of discriminatory shade. Not good. They're engineers just like the rest, and they've worked equally hard (possibly more( to get through 4 years of VTU. Same goes for the grading of colleges. Does it even remotely matter who is better? And believe me, that is probably a subjective definition based on internal company policy. Which we can't figure out. So, why make assumptions?

Se7en

Probably has nothing to do with this. Just probably.

There's a guy named Tomek (I'd be surprised if there isn't something puzzley about that) who has 1337 (and this one too) friends on Facebook. Now he wants them to join in a big circle of hand-holding togetherness to celebrate the launch of Karmic Koala. (You Windows people throw house parties, we hold hands and look up at the sky. It's just the way we do it. (And yes, we are cooler!)

So, while on one of these weird hand-holding orgies, Tomek decides that they should bring an element of fun into the ritual (about time somebody did that!) and he starts playing a game of 7UP (no, this event is not sponsored or endorsed in any way by the popular brand of carbonated beverage!) where people count up from 1 up to infinity.

Now there's a twist to Tomek's game of 7UP. Counting goes upward continuously clockwise from whoever calls out 1 to begin the game. So, if person 1 calls out 1:

person 2 calls out 2

person 3 calls out 3

and so on...

till person 7 calls out 7

and person 6 calls out 8

person 5 calls out 9

and so on...

till person 1337 at the end of the circle (does that make any sense?) calls out 14

and then...

person 1 calls out 15

person 2 calls out 16

So, to end the counting and summarize the rules of the game:

  1. Each person calls out a number. The next person calls out the next number. The number to be called out is always incremented by one.


  2. The direction of counting starts clockwise from 1 to 1337.

  3. Direction reverses when a number that is:


    1. divisible by 7 (eg 7, 14...)

      OR


    2. contains the digit 7 (17, 27, 455677221, 7000)




So, those are the rules of the game.

Now, Tomek's a weirdo, (or we wouldn't be having this problem), so he wants us to write a program that can tell him where he has to stand if he wants to call out his favourite number.

So, if you were Tomek, what would your favourite number be? That's what we're writing this program for.

I came across this problem on the CodeChef website initially. And at the time I attempted to solve it, nobody had been able to submit a successful solution owing to length of time allotted for calculation a very generous ONE SECOND.

It does help if you look at that as ONE THOUSAND MILLISECONDS. A little.

So, I went to work on it. It sounded simple enough to write, but little did I realise that the number of elements to be processed would be HUGE if I merely brute forced this.

Imagine processing 100,000,000 elements checking each for divisibility and presence of 7! That's not good enough. And the running times proved it. When Tomek's favourite number is 100,000,000,000 we have around 3.5 minutes processing time. And to think that the size of the input can go up to 10100! We have something serious on our hands.

So, the question now is, could we optimize the algorithms used to determine divisibility and presence of 7 further or should we simply observe the state of the program over a period and see if there are any patterns that we can exploit? Which is simpler? Or more effective?

The answers to those questions are:

the first approach one is simpler, since there are plenty of well documented algorithms for that. Wikipedia has plenty of them. I used that one instead of using the standard % 7 == 0 test, since it increases the time required to process as the count goes up. But the first approach can only help so much.

The second approach brings maximum effectiveness since skipping over a bunch of elements which you know will anyway not contribute to the final answer eliminates the divisibility/presence tests associated with them.

So, your problem input size is probably reduced in size by half. And after much thought I decided to take a raw dump of the program as it worked. And ended up with a HUGE file after 3 test cases.

Will have to figure out the quirks and optimize.

The source for the program is attached. Documentation is something I'd love to do some more work on, but a work in progress is just that, it's a work in progress. This is the part where most programmer's like to spend time trying to play with code rather than document, so, I've tried explaining wherever I can. Links are also there to the pages where I got the algorithms from.

Will be posting a set of links here when I find the time.

How To Hurry Tomek's Ass Up (aka possible optimizations):



1. Who cares about the 70s, or the 700s, or the 70000000000000000000000000000000000000000s!


aka the remove the 7s way

Last night, as I was thinking about ways to optimize this, I realised that the processing required for complete blocks of the input could simply be eliminated.

Inputs of the form:

d* 7+ d* (d is any digit from 0-9)

viz. any range of concurrent numbers known to contain 7 in the same place. For example:

70 - 79


Here 10 numbers can be eliminated by simply adding 10 the count and keeping the direction of count the same. The counter does not change since the number of reversals is even as in:

caller 1 at 70

caller 1337 at 71

caller 1 at 72

caller 1337 at 73

and so on...

caller 1337 at 79

caller 1 at 80

caller 2 at 81

caller 1 at 82

and so on...

So, in effect, the person to call out the first number in the series is the person who counts the last number of the series. The direction of counting remains the same.

For larger inputs 7000-7999

caller 1 at 7000

caller 1337 at 7001

...

caller 1337 at 7999

caller 1 at 8000

1000 inputs skipped.

So, skip formula:

((10place of 7)) elements skipped and added to count. So the larger the input, the larger the skip.


After running some timing tests, this is what I found:


Test run without the remove 7s optimizations with an input of about 10,000,000,000 ran for 1 minute and 49 seconds.



And this is with the optimization:
1 minute and 12 seconds.



There is an improvement, definitely.
So, for such large inputs, we have a 1/3rd cut in running time.

While not as large an improvement as I expected, I am pleased to say that something worked.

Hotlinked. Oops!

I've not posted here for weeks. I noticed today that every time I was coming to the blog, I was being redirected to the wikipedia article on bandwidth theft. I spent some time puzzling over how this was happening. I was pretty sure I hadn't coded the page to do anything of that sort.

Then I realised it was a JS document.window.open() call, the target being the default, current window.

I found the source of the redirect being Kent Brewster's JS code snippet that had been changed since I put it on here. I hardly used it, it being here for just experimental purposes.

But as it turns Mr. Kent Brewster seemed to be getting a lot of traffic from people embedding identica badges on their websites. I didn't realise I was being irresponsible.

My apologies.

Sixteen

I find this odd. I have nothing to write about today. Let's try reasoning it out.

  • I've spent more than 5 of my 12 waking hours asleep (contradiction)
  • I've spent about an hour of the remaining hours consuming food
  • I've spent roughly two hours socialising, both online and offline
  • An hour running to and fro between home and stores
  • An hour on the TV
  • An hour on Need For Speed: Most Wanted
  • Close to an hour reading that new Java book I bought yesterday






Well, that chart should clear things up! It clearly shows I'm not GTD in a day. Even if I don't hit GTD-nirvana I'd like to say, I GSDT (Got Something Done Today).

Time to rethink my whole approach to doing things. This will simply not work out.

I've been thinking about performing some analysis on how I spend my time during my waking hours. And waking hours here, includes all the time I spend, staying up late into the night (up till the point when it's really really early in the morning), barely awake and unable to think. Of course, I could use that data to track how lack of sleep affects my productivity.

(Of course, that means that I now have to come up with some way to measure my productivity, how would I do that. This requires some thought)

This is interesting. I could also measure the effect of meditation on my productivity. (and maybe that would help me be more regular in my practice)

Interesting, times of meals. The time I wake up. The temperature. The weather. The news. How I feel. Sick/unwell. It could all be documented and measured against productivity...

This sounds like the beginning of a very fun experiment.

And if I could build a system that considers all this data.

Oh my god.

Let's get cracking.

Fifteen

Listening to the latest episode of twit again.

Once you get into the habit of doing something a certain way, you get used to doing it that way. If your webhost seems to support all the things that you throw onto its servers, then you get used to stuff working just like that. (I wouldn't say that for the laconi.ca install, but still, most of it just worked out of the tarball!)

I stopped checking requirements pages long ago. I assumed that since Wordpress 2.7 worked, WP 2.8 would also work.

So, what is the difference between PHP v. 5.2.10 and 5.4.3?
x10hosting.com uses PHP v. 5.2.10. WP needs v. 5.4.3. I never actually bothered to check whether x10 fulfilled the reqs. Which cannot parse the code WP 2.8 uses to connect to the database. I wish they'd use some legacy code for the DB connection! Oh well. That's the price of progress, I suppose.



UPDATE: I was wondering whether the earlier releases of WP MU were to be found. Guess I should have looked at the trac: Wordpress MU 2.7

UPDATE: I can't stay up any longer, bed time now. It's 1:42 AM!

Fourteen

And I finally have an alternative to Facebook: extensible, awesome, and Open Source. [EDIT] ELGG is written in PHP and is completely open source. And it comes with some excellent documentation all well written and covering a wide range of topics to get everyone the help they need - whether you're just trying to install ELGG or write plugins for it, or contribute code for the next version.

Here's a comparison with Facebook:


sadly, there are limits to how good a face I can present.

Plugins. Themes. Customization.

Everything you've wanted to ask Facebook for, but were afraid to.

Update: There are even themes to mimic the whole facebook look. I have not been able to customize the instance as much as I want to because I'm having trouble finding my way through the documentation. Maybe today just isn't the right day to wend my way through pages and pages of documentation. There are some kinks to be worked out. Clicking on a link to list pages in the Installation category took me to an error page stating that I did not have the required privileges to edit the page.

But there are various examples of ELGG instances that have been customized to look nothing like the default install I currently have up.

Also, I doubt anybody who still uses Facebook daily without any concern for their IP policy will really find any reason to move to an ELGG instance. That includes most of my friends. Maybe making the interface more click-whiz-popup-ish will change that. Right now, it's very much new-page-loading based. But it's a great system nonetheless. I am amazed by the fact that this is all very very open source (I haven't been able to find a mention of the license it's been released under, still, maybe I actually need to look into the code, UPDATE: Wikipedia says it's GPL v2)

Maybe I've been spoilt by Anil Dash and his pushbutton web post. Maybe I'm just hoping for something better than Facebook right now. Anything would do.

I'm even trying to set up a Wordpress MU instance now. And yes, it's for BuddyPress. Right now, I can't seem to get past the wp-config.php stage. Will update when I do.

Thirteen

is a number. You may think of it as lucky, unlucky, or just a number. Whatever your opinion on thirteen is, I'd simply nod my head and say, "Sure, it's exactly as you say! It's ! I mean, why shouldn't it be!"

So, here I am two nights after I started installing ELGG and I'm still not done with the install, I'm struggling to catch a bug in the install. It has something to do with the mod-rewrite module in apache being a problem. And also ELGG requires it. I can't turn off the need for mod-rewrite and even if I could, I can't change the configuration of the webserver in my hosting provider's thing.

Ah, well, more swine flu cases being reported with increasing frequency. Maybe it's the heavy rains we've been having for the past three days. I think this:

As If Swine Flu Wasn't Enough, Now an Earthquake

is going to become a familiar sight. I hope not, but still, I hope not.

I've got a list of things to do, so, I'd better head out. I'm attempting a second go at ELGG. If it can get a lot of my friends off Facebook, then it should be worth it.

I'm not all for !fuckfacebook but there's a lot about Facebook that can be improved. Beginning with how it forces page reloads whenever somebody comments on a post right after you comment on it. And coming to FB page reloads, they're slow, and painful to wait through when all you're interested in is about 100 characters of text. Very inefficient. They've got the push notifications part down pat, but they need to implement the pushed content part of it also. I'm pretty sure they've got enough engineers doing that for them.

They can implement a controlled system of pushed content, only enable these on walls of people on posts with less than 10 active commenters. Instead of forcing a reload, it could simply drop the comment there in the page, I don't know how AJAX works, but you could show a refresh button along with the post. Users click on this to make the comment show up.

While identi.ca doesn't do this either (replies don't show up inline), they do allow you to post notices very quickly by not forcing page reloads. I don't know about ELGG, but I hope they do fill in some of the gaps that Facebook has left.

Facebook is very well developed, I'm sure, but it's these little things that they need to take care, in addition to the other stuff like their policy of IP content squatting.

I guess even free always comes with a cost. I find myself gradually drifting towards the "Free as in !facebookfree movement."

Will get back and try my hand at getting ELGG to work.

Twelve

Checking out this free alternative to Facebook called ELGG. And it does resemble Facebook in a lot of ways, and the best part, in some ways even better than Facebook. All this without multi-million dollar stock-swaps and what not.

While most people wouldn't have the time (the kind of people who aren't there) or they wouldn't have the knowledge to (I'm assuming you don't do legalspeak) parse Facebook's Terms of Service, Privacy Policy and what they're now calling Statement of Rights and Responsibilities (SRR).

That's pretty evident from the number of people who've liked it! Seriously, did any of you 3000+ people actually bother to go through the first two clauses of the document that pretty much says in clear terms that Facebook has a right to anything and everything that you put on Facebook:

In order for us to use certain types of content and provide you with Facebook, you agree to the following:
1. For content that is covered by intellectual property rights, like photos and videos ("IP content"), you specifically give us the following permission, subject to your privacy and application settings: you grant us a non-exclusive, transferable, sub-licensable, royalty-free, worldwide license to use any IP content that you post on or in connection with Facebook ("IP License").
And then, but, ah, ooh, wait for it, wait for it,
This IP License ends when you delete your IP content or your account (except to the extent your content has been shared with others, and they have not deleted it).
Okay, I see that the last bit acts as a relief, to be exempt from this agreement, you simply have to not be on Facebook. It's a binary choice, right?! So, if you share a note or post a picture, or post a comment on the picture, or post a tag on the picture about the comment that you're going to write about the tag, then you'd better make darn well sure that you're okay with giving Facebook rights to milk it for all that's it is worth as well.

Although from what I've seen on Facebook, I don't know why and I can't see how they'd even think off profiting off this

Google's done something similiar to this with their Picasa Web Albums service: (their ToS is the same that applies for all Google services)
11. Content licence from you

11.1 You retain copyright and any other rights you already hold in Content which you submit, post or display on or through, the Services. By submitting, posting or displaying the content you give Google a perpetual, irrevocable, worldwide, royalty-free, and non-exclusive licence to reproduce, adapt, modify, translate, publish, publicly perform, publicly display and distribute any Content which you submit, post or display on or through, the Services.
But they do add a clause here stating clearly what they intend to do with that license:
This licence is for the sole purpose of enabling Google to display, distribute and promote the Services and may be revoked for certain Services as defined in the Additional Terms of those Services.
And here comes the Share and Share Alike (with an exception clause for anybody profiting in the process):
11.2 You agree that this licence includes a right for Google to make such Content available to other companies, organizations or individuals with whom Google has relationships for the provision of syndicated services, and to use such Content in connection with the provision of those services.
It's almost like a BY licence! Except that's not what it's called! Really, they should use those familiar and comforting logos that CC uses,

but to convince us that, "Yes, that's exactly what we're going to be doing, except, we're making money of it. After all, there should be something in this for all of us. You've found your timesink. And we've got our moneyplant!"


They really should make these terms clearer to people instead of having non-lawyers like me (although my grandfather is one, and he's not even into IP law) parse it. I thought Google would be one of those forward thinking companies who'd actually put a short summary of the legal terms before the actual diatribe so that people would at least be inclined to know what they're getting into. Because you know, once Google gets into it, almost every other service is likely to follow their model. That's why they're Google. They set the (dodge)ball rolling into the Foursquare. (Although I never missed Dodgeball because I never got to use it, it would have been fun to link to their website just now. Oh wait!)

Funny, Dodgeball sounds like the service my friend Rahul and I were planning to implement as a final semester project. I remember proposing the '@' symbol as a check-in symbol. And while I'd heard references made about Dodgeball, I'd never actually done much research into in detail. And the best part, I'd even proposed using email-over-SMS as a method for client-server interaction. Amazing coincidence.

Our only worry was how we'd go about implementing the service. We'd have to buy a two-way SMS gateway to begin with. And then there was the problem of not knowing how this thing would work. We're not telecom engineers here. :-) But it would have had mass appeal. I still think we can implement it. And text messages are used far more than anything else here. Infact at a cost of no more than INR 60 a month, we could have users checking from all over the city.




And the best part: it'd all be for free. Wonder if anybody's done it already.

Okay, huge rathole, I don't know how I got into it, but let's continue. Or let's just end it here. I'll test out ELGG and post and update.

Maybe I'll even call over a few of my friends from Facebook and see if they agree with fuckfacebook. (C) that you douches! Ha! Wait, I'll post this on Facebook.

On second thought, it's time to go sleep.

Later then. Pubsubhubbubzzz.