Wednesday, June 30, 2010

Search Engines and Je L'ai Dit :-)

I was recently wondering whether search engines would be able to pick my blog up and decided to perform an analysis by egosurfing. First of all, what is egosurfing? It is a term that i have picked up recently, it means browsing the internet about yourself to see how famous you are online :-)

Search Engines and Je L'ai Dit


Here are the results from google. (Read it as "query - result")


  • Je L'ai Dit - 8th result in 2nd page (17th overall)

  • "Je L'ai Dit" (with quotes) - 7th result

  • geekiest to craziest - 10th result

  • "geekiest to craziest" (with quotes) - 1st and the only result

  • from geekiest to craziest - 5th result

  • "from geekiest to craziest" (with quotes) - 1st and the only result

  • vignesh foamsnet - 1st result

  • irctc tcp ip - 16th result

  • google caffeine vignesh - 1st result

  • "chennai and its laws" - 1st result



As my access logs say, yahoo and bing haven't picked up my blog at all yet. I strongly feel this is where google stands out. My blog doesn't get linked from anywhere apart from my facebook and twitter posts. Yet google somehow managed to locate and index it. For now, google is crawling my blog at a very low frequency rate. Hope it increases as i start posting regularly. :-)

-Vignesh

Thursday, June 24, 2010

Google's Funky Secure Search ;-)

Google has been one company which has always have been a dream of every IT professional. They always have a unique approach in everything they do, right from search to mail to docs. If there was one thing for which google was always under the spotlight, it was for privacy (A tit bit: google search privacy policy has approximately 2000 words in it - run this command to verify if you are in linux "wget http://www.google.com/privacypolicy.html > /dev/null 2>&1 && wc privacypolicy.html && rm privacypolicy.html" - it will print the number of lines and the number of words in google's privacy policy). Google has always faced issues regarding privacy.

Ok first of all, lets define privacy with respect to internet. Defining privacy is simple, when you are on the internet, noone else should be bothered about what you are doing. The service provider's job in the internet is just to give you what you ask for and nothing else. You don't expect the service provider to develop an intelligence about your needs. They should just serve you and get lost. This is totally fine from your perspective. But the service provider thinks this way, he gives you what you want now and then collects information about whatever you ask him. Later when you are unsure of what you want, he suggests you with something based on the information he has. You are really happy that the provider is able to assist you. Now here comes the question of privacy, how do you trust the provider? What if he gives the information that he possesses about you to someone else, thereby revealing your personal self.

Not just google, the internet always had privacy concerns right from the moment it started growing (for example, the exponential growth of the size of facebook privacy policy over the past few years). If you have been following news, Google China Controversy has been a central point of talk (even in indian news channels). Google has always been criticized for not respecting the users privacy. There has even been a group of google employees who quit google and formed their own search engine with literally 100% privacy (Visit Cuil Here).

After a really long time, google has introduced the concept of secure search. First and most important of all, secure search does not imporve your privacy relations with google. Privacy issues directly between you and google remains the same. Its just that, intermediate nodes between you and google will not be able to capture any information about you. Google made gmail secure by default earlier this year and now search is secure too. And google is also looking of making search compatriots like (image search, video search, etc.) to be secure soon too.

Google Secure Search :-)


Google secure search operates in https://www.google.com. There is an interesting point to note about this URL. I will come to that in a while. Before that, I will talk about a point that secure search can cause. Academic institutions and companies block certain websites (most of the academic institutions block urls with words facebook, orkut, etc.). Now that google secure search is introduced, it can bye pass the filters set by the network administrator. For example, your network administrator says, dont allow any queries containing the word "porn". Now this filter fails while using secure search as the query is encrypted, it never matches the filter.

A simple solution to this problem is to block secure search as well. This means the network administrator will have to block any URL that starts with https://www.google.com. This solves the aforementioned problem. But here comes the funky point about the URL i was talking about. Google uses the same url for all the websites that are being authenticated by a Google Account (gmail, orkut, youtube and almost all the google products). If you had noted before, gmail's login page URL will start with https://www.google.com/Accounts followed by some other stuff (if not just goto gmail's login page and see it now). So, if the network administrator decides to block all the URL's beginning with https://www.google.com, then the users in the network will be denied access to almost all of google's services.

Nevertheless, google has thought of this problem only after the launch of secure search and is aiming to fix it by moving secure search to some other domain (something like secure.google.com may be). Here's a link to the post in google's official blog that talks about this issue.

UPDATE: Google has fixed this now and have moved their secure search to https://encrypted.google.com :-)

This post was just to explain the funky problem that google has caused the network administrators all over the world (especially in academic institutions like PSG Tech :P). Comments welcome as always :-)

-Vignesh

Tuesday, June 22, 2010

Simple but interesting problem :-)

I recently came across this interesting problem and i thought its worth posting it.

Given an array A as input, produce an output array B such that every element of B, B[i] is the product of all the elements of A, except A[i] (E.g.: Suppose A is of size 4, then B[0] will be A[1]*A[2]*A[3] and B[1] will be A[0]*A[2]*A[3] and so on).

Sounds like a basic question right. Obviously there are more constraints. Rather just two constraints, do it in O(n) time without using the division operation.

Any innovative solutions welcome :-)

-Vignesh

Sunday, June 13, 2010

IRCTC and the TCP/IP Protocol Stack :-)

"Indian Railway Catering and Tourism Corporation (IRCTC) is a subsidiary of Indian Railways that is responsible for handling catering, tourism and online ticketing operations of the indian railways"
- Wikipedia.

We all know IRCTC as we see it whenever we book a ticket, we drink tea/coffee in a railway station, etc. In this post, i am going to talk about one of the ever existing nightmares of indian train travellers - Tatkal ticket booking.

Indian railways has a famous system known as Tatkal (which in sanskrit means instant) reservation scheme which allows us to book tickets two days before the departure of the train throughout the year. This is like the golden gem for last minute planners. Oh this seems great, i can book a ticket two days before? Of course its not as simple as it sounds and there are loads of hassles around. Since tatkal bookings open only two days before the date of departure of the train, bookings are opened by 8 AM (IST of course :P) and you might by now be thinking, 8 AM - No big deal. I can be in the railway station booking counter by even 7 AM. You're still not doing good as there are many people who are already in the booking counter queue waiting from 3 or 4 AM in the morning or probably from even the previous night (yes, it happens!).

Ok, so the booking counters are flooded by persons on morning, i even have a better way now, i am a very modern person, i don't go to the booking counters and stand in queue for booking rail tickets, i just boot up my system, point my browser to irctc.co.in and voila! I have the ticket booked in a matter of seconds. Well, this process seems to be fairly trivial and simple. But unfortunately there are even bad hassles involved in this process.

First of all the website itself. People who travel a lot by train might always be cursing the government website irctc.co.in for screwing up their last minute travel plans almost all the time. The website server is either down (meaning the website is unaccessible) or doesn't provide service as expected (which is an obvious requisite). The following is the timeline of what generally a layman does for booking a tatkal ticket in irctc.co.in:

  • 7.45 AM - Open all possible browsers (internet explorer, firefox, chrome, safari, opera, etc.) and login a session in every browser

  • 7.46 AM to 7.59 AM - Try to fill in some fake forms and keep all the sessions active by clicking on some link or the other so that you don't get the "Sorry your session has expired, possible reasons are...". At this timeline you might also see the "Sorry e ticket can be booked only after 8.00AM" alert message frequently

  • 8.00 AM - With all tension and hurry, type in all the travel details (probably in the quick book form) and click on "Go" to just see the loading mouse icon or more probably the "Service Unavailable" error page

  • 8.00 AM to 8.15 AM - After lots of refresh in various browsers, at last you have seen a blue color page in one of the windows and in excitement you type out all the travel details and after encountering a few more "Service Unavailable" error messages, you might at last get until entering the payment gateway credentials (yet going beyond this point is still a question mark)

  • 8.15 AM to 8.30 AM - Totally unexpecting it, either you have got the "Service Unavailable" error message again or there are no more tickets available in the train you wanted

  • 8.31 AM - You spend a minute grumbling and scolding irctc.co.in website and think of it as yet another tatkal booking attempt that failed and you look for other alternatives (most of the people goto www.kpntravels.in by 8.32 AM)


IRCTC and the TCP/IP Protocol Stack


Second of all, even if the website was really good and if it could offer everything travelers want, the load that is built on the irctc.co.in webserver is enormous during the 7.55 AM to 8.30 AM period. Hence, booking a ticket online now, becomes a matter of luck.

For people who don't get how it is about luck now, let me explain further. Consider you are in a bar wherein a bartender gives away drinks to random people. There are way too many people than the bartender can handle and the bartender does not have any intelligence and hence he simply gives away drinks to random people as long as it is available. Thus, if you are lucky enough, you'll get a drink. The same is the case here where the bartender is the irctc web server and your ticket booking requests are the requests made to the bartender for drinks.

And one more thing about this online booking is that there are agents available in various parts of the country who assure that they can book a ticket for you. I'm still not sure how that is possible violating the pigeon hole principle ( simply stating - according the pigeon hole principle (probably a stricter version of it), if there are only x tickets available, only x persons can travel but there are quite easily much more than x agents all around the country ). So that is one glitch that if you can just pay how much ever extra the agent asks, are you sure you'll be travelling on the required train? The answer is no. I have seen many cases where the agents too fail to book a ticket for you in the required train (and you're forcefully redirected to kpntravels.in again or may be to jetairways.com if you are rich).

Ok, so whats the point in all this? The point i wanted to say is, today (not exactly today, sometime in the past few days) i came up with a dry thought of doing something so that you can escape the threatening "Service Unavailable" error messages. Now going back to the bartender example, the bartender does not have any intelligence and hence you think you can do nothing about it. But what if you can slip in an extra few bucks so that bartender is sure to give you the drink before its done. Ok, this is fine for the bartender example, but how do we bring this into picture with a web server in the place of a bartender?

Seems impossible !! Thats when my TCP/IP knowledge kicked in and made me think about the flags in a TCP packet (non technical people [or even some technical people :P] might not be able to follow this, but read on as i'll try to give another simple example later). Yeah, if you are a networks expert, you might have probably guessed the thought that i had in mind by now. There are eight bits allocated in a TCP Header that are known as flag bits. Our hero (i mean the one we are interested in) is a flag called URG flag or the URGENT flag. As the name suggests, this flag helps us to override the routine queuing done by the TCP/IP stack of the operating system.

Hey stop all this crap. I dont get a word. - Ok, let me give an example again. Consider a courier service office where they receive many parcels of letters daily and process them in the order they arrive (i.e.) a parcel of letters coming in by 7 o clock will be processed before the parcel that came in at 8 o clock. Now, there is a special override for this that if a parcel carries a red flag in it, then it will be processed immediately irrespective of the time it came in.

This is the same kind of scenario that i am talking about. The operating system's TCP/IP stack processes all the packets (requests sent by you to book tickets) in the order they arrive except for the only exception that is the packets with URG flag set will be processed first irrespective of the other unprocessed packets (requests sent by others to book tickets) in the queue which had came in earlier. A question might be raised here that what if the other requests also has the URG flag set (or what if all the parcels have the red flag in them) ? The answer to this question is, as long as people/agents use only a web browser to book tickets, there is no possibility that the URG flag will be set in the packets that are sent from the browser as it is disabled by default. Also, i think this might be a good approach as it is in the transport layer, it is not possible for the application to override this behavior (because this is the behavior of the TCP/IP protocol stack of the operating system).

So, my high level idea is that, there could probably be an application developed, that simulates the web browser in requesting the irctc web server (maintaining login sessions, etc) and at the same setting the URG field in every packet sent. For TCP/IP experts, of course there are implementation issues like where will the urgent pointer point to and much more which can be answered only when such a system is implemented. (And yes, i have plans of implementing one such system).
Ok now what? As usual, any comments are welcome. And anyone who could go ahead and implement such a system in a jiffy are welcome to do it. For more details, pings are always welcome.

P.S.: I really enjoyed writing this post as everything was getting into its place with a great flow and i love the way i have organized this post. :-)
-Vignesh

Friday, June 11, 2010

Google Caffeine ( A complete idiots guide?? ) :P

The recent buzzword from Google. So what the hell is it?

Ok first of all, Caffeine has nothing to do with the visibility of google. If you've heard this term and you go to google and type a query and think everything seems to be the same and nothing has changed, its because caffeine is purely a backend (something that is not very apparent to a layman user) change and if you had noticed it, probably you might be seeing better results for your search query (or atleast different ones than you saw last time for the same query).

Before looking into google caffeine, lets first see how basically google works. When you search for something in google, it doesn't actually search the web, it searches the index of the web that it has stored in its exabytes of memory (1 exabyte = 1024 petabytes, 1 petabyte = 1024 terabytes, 1 terabyte = 1024 gigabytes). So what exactly is an index? Index is something like you find at the back of every book. Its a set of keywords along with page numbers, except that its web urls in this case instead of page numbers.

WOW! An index for the entire web !! Thats pretty huge and interesting. So how did google manage to build it? Thats not the question i'm gonna answer here as that infrastructure has evolved over years since its inception. The problem with this approach is that a book is static and once its printed nothing ever changes after. Whereas the world wide web is highly (probably the best example of) dynamic. Url's keep changing. Millions of pages are added and removed every day. Now comes the buzzword into picture, the process by which google lives up to the dynamic nature of the world wide web is known as indexing (the process of finding newly added pages is known as crawling).

Ok enough of background stories, come to the point. Google Caffeine, is the new algorithm that is gonna govern how google carries out its indexing process. The thing is is, they had an old layered architecture (for example, one layer for each type of content like text, image, flash, etc.) in which every layer was refreshed at a certain rate and the information was available to us only when the entire layer has refreshed. That means a significant delay in the time at which the information was actually updated by google and the time at which the information was actually available to us via google search. Whereas with caffeine, they are eliminating the layered architecture and converting it into several smaller portions so that the delay between information retrieval and availability is significantly reduced.

Which is clearly depicted in the image from the official google blog:


Here is an excerpt from google's official blog:

"Caffeine lets us index web pages on an enormous scale. In fact, every second Caffeine processes hundreds of thousands of pages in parallel. If this were a pile of paper it would grow three miles taller every second. Caffeine takes up nearly 100 million gigabytes of storage in one database and adds new information at a rate of hundreds of thousands of gigabytes per day. You would need 625,000 of the largest iPods to store that much information; if these were stacked end-to-end they would go for more than 40 miles."

Whether caffeine makes a difference to search results and relavence today or not, it is sure to govern the future of the world wide web wherein data is tending to change to the oftenest possible and smaller partitions of processing means better local search results.

Points to note about Google Caffeine:

  • Google announced the plan for Caffeine around the same time Bing was launched (fishy, they probably had something in mind then ?)

  • Google Caffeine might force the Search Engine Optimizers to change their existing models very significantly (some blogs say that Google has been hinting about it all the time)

  • A nice site that compares the new and old results for any given query and displays it side by side (there seems to be a good difference after all !!) - Compare Caffeine

  • Unlike Google's other search features, google has offered developers preview for webmasters and power searchers and asked them about their feedbacks

  • With yahoo out of search soon, here is a post in mashable comparing old google, new google and bing - Mashable Caffeine Review


Comments welcome as usual. But i guess i wont get any (as usual) ;-)

-Vignesh

Thursday, June 10, 2010

Chennai and its laws :-)

I am currently in Chennai for a six month internship. How i came here was itself a big story. Will definitely have to write about it later. For now, in the past one and odd months, i am giving up what i feel distinct about chennai and its people. How life in Chennai is and all that.

  • Law of Extremities: No matter how extreme in the side end of the road you drive, there is always someone who is driving extremer than you !! (Even if you are balancing your vehicle with one leg on the pedestrians platform, there is someone driving on the platform !!)

  • 0 or 1: (In velachery) either you walk or you swim, there is nothing in between.

  • Solitaire:You will be able to even finish a game of solitaire if you can drive at evening 6:30 in either mount road, sardar patel road, lattice bridge road andespecially in panagal park.

  • Murphy's first law of chennai local trains: No matter how free the other compartments are, most of the crowd in almost all the stations will always get into the compartment you are in.

  • Murphy's second law of chennai local trains: No matter what your destination is, there will be at least two trains in the opposite direction before you get a train in your direction

  • Law of drinks: When you are thirsty, there will always be a local shop when you look around where you can get ice cold flavoured drink. (mango, orange, lemon, fruit mixture, rose milk, badam milk, butter milk)

  • Police's law of two wheeler driving: No matter what rule you violate, Police will never catch you if you are driving between 8:00 to 10:00 in the morning and 5:30 to 8:00 in the evening.

  • Law of traffic signals: Either the traffic signal timer wont work, or it will show you the maximum time possible when the red light is on and you're staring at it.

  • Law of fights n screams: Everyday when you commute, you will see atleast one typical chennai tamil fight between someone or the other. (After all nature obey's newton's laws).


(Especially chennai ppl) Share your thoughts on comments :-)
-Vignesh

Wednesday, June 9, 2010

The First Computers I Saw :-)


People these days call me a computer freak. It is quite true that computers have been always a part and parcel of my life. Earlier i talked about my F.R.I.E.N.D.S, now i talk about the computers i first saw.


It was during my 5th standard (1997-1998) when i first sneaked into my dad's office (National Textile Corporation – Electronic Data Processing (EDP) Division, a central government concern). The office was not very big. The first thing i liked there was the cold climate inside the office due to the air conditioners, which i have seen only on advertisements in television before, which were present there. Coming to the computers part, the office had nearly ten computers, two of which were running on Windows 95 and the rest were running on Unix. Only one of those unix computers had a mouse(Now i wonder why a unix machine needed a mouse..!!) (A black color IBM machine).


It was two days back my teacher (Ms.Salomey) had showed a demo on how to move a mouse and place it over objects and click it (They had some software in school to accomplish that). They allowed only one guy in the class to touch the mouse and hence i was denied a chance of operating the mouse. So, i was in much of an eager to try out that in one of the windows machines. I described my dad what i saw in school and i asked him that i want a similar one here. He replied back that the same software is not available here and instead he opened MS-Paint and handed over the system to me. I was way too enthusiastic. I remembered one of my senior class students working with that in the school lab the previous day. I was just learning to use the mouse and to click on it.


After some struggle, i finally drew something which looked like a sun in between two mountains. When i was trying to color it, my dad called me for lunch. I was worried if the entire work would have to be done again once i switch off the system when i go to lunch. That was when my dad came, and told me to “save” the work and then switch off the system. I was wondering, because previously i had heard the word “save” as in “save money”, how do i save the painting like i save money? Then my dad explained me what exaclty “save” means in computers. He then saved the painting and switched off the computer. I did not have a nice lunch, because i still wasn't convinced that i would be able get back my painting after switching off the system. Finally, the lunch was over and i was running back towards the machine. I was pestering my dad, who was busy with some work, to get me back my painting. He did it and wow!! I was wonderstuck.


The machines there had two floppy drives and a cd drive in their CPU. One of the floppy drive was a traditional 3½ inches floppy drive (1.44MB) whereas the other one was a 5¼ inches floppy drive (1.30MB). One of my dad's colleagues was copying some data from a bigger floppy (5¼”) to a smaller floppy (3½”) . The light was blinking on the drives alternatively. He called me and explained me that, the computer is reading from the disk in the bigger drive and writing it to the disk in the smaller drive.


The manager of that section was frightening me by showing some chip and telling that it was a bomb. I was very afraid at that time as i had never seen a chip before. From then, whenever i saw him, the chip would flash in my mind and i was moving away from him all the time.


That is where it all began and from then on, i used to visit my dad's office often and spend my time in ms-paint and testing the correctness of windows calculator (The computer won always :-( ).



More coming up in the next post.. :-)


-Vignesh

Tuesday, June 8, 2010

F.R.I.E.N.D.S (I'll be there for you !!)

"So no one told you life was gonna be this way, Your jobs a joke, you're broke, your love life's D.O.A.

Looks like you're always stuck in second gear, when it hasn't been your day, your week, your month or even your year...

I'll be there for you, when the rain starts to pour,
I'll be there for you, like i've been there before,
I'll be there for you, Cuz you're there for me too...
"

Life would always have been very different without friends. Taking me to where i am now, there have been a substantial contribution from all my friends right from elementary school to higher secondary school to college. If there is something that i have learnt from my past experiences, this is it. Friends are always an essential part of anyone's life. Everybody needs someone to be around them all the time. Though i might prefer ode in solitude, it can never beat the fun of even just hanging out with friends.

So now, i take this time out, to write a small (but meant) paragraph about my various pals who have been there through all my happiness, sorrowness, craziness, sleepiness, joblessness, etc, etc. P.S.: I am not mentioning any names.

To begin with, I start with a person who is often called kannadi (not very famous, but by some), who has been there althrough my elementary schooling. We were typical childhood friends who use to hangout all the time together. We went to school together, we went to play together, we went everywhere together. I cannot forget to mention this, we went to computer classes together (which my college mates used to kill me for). Nevertheless, we had all the best times together. It has been amazing how well we have grown up to be friends till now even thought we weren't the kind who used to talk/sms daily, etc. We hardly talked once a month (or once in two months may be), but we still have that wavelength that is keeping us together. Hope it remains the same forever.

Next, aargh, a tough choice, he's a short little guy whom i have known for probably from my very young age of say seven or eight (!!!). Well there's not much to write about him as he is the most cooolest one i have ever been with. Very reasonable in everything he does. To give a hint for ppl who are wondering whom i am talking about, he's currently undergoing training with cognizant (mentioning the name is a violation of corporate policy i guess :P). No wonder things with him will never end.




Next, yeah, from short little guy to a short little girl. She got introduced to me during her higher secondary schooling (some ppl may be knowing it was in madurai). Wierd about the fact that i first talked to her in orkut (orkut was the craze among ppl at that time). We talked and thanks to my cousin's cell phone at that time, which got us close. From then on its no looking back. We have had all possible incidents happening between us that could possibly happen between two friends :-) (nothing to regret for though). All the times i have been with her has been really wonderful.

Whose next? Yeah, it will be the guy from college with whom i spend most of college time with. The one thing about him that i need to mention is that no matter what the situation is, he is always ready with a response before even the question is asked. Trip to delhi, All the iv's, Login trips can never be forgotten. Especially all the saturday night walks without even knowing what we are talking about, will always be cherished in my everlasting memory. And yeah the so called project, i could not have had more fun in anything in college other than that.

Following is another guy from college, (who hails from the same city (village??) of vellore as the previous one), he is a conceptual friend of mine whom i came to know very well during our project (??) days in madurai and from then on we hit it right along. Again, the saturday night walks without knowing what we are talking about are indispensable. And the operation concepts concepts, we will never forget in life.

I cant miss the girl whom i tell as my cousin to everyone. Actually she isn't, she's just a close friend who calls me as bro (and whom i call as sisy). Again, we've known each other through online and sms from where we built a huge fort of friendship. Every moment with her has been awesome and there's always something more coming up. She has recently had her happiest moments in life (will be a point to talk later i guess !!). Nevertheless, she has been a great company whenever i needed one (i used to call her whenever i walk to a bus stand, railway station, shop, etc. :P). Fun aside, she has been laughing even at times when i pricked her nerves and pulled her legs to the extent possible (she probably got used to it).

I cannot end this post by saying thats it. Because i have not listed about everyone here, i have just listed about people in the time i got. Doesn't mean that nobody else has influenced mine. Apologies for all those about whom i have not written here and thanks for making my life happier.

Oh dear god, wait a minute, how could i end this post without mentioning one person who mattered the most. We were friends once (past tense intended). But now, hope you would have guessed it right by this pause. Anyways, i did my higher secondary schooling with her. Didn't know much of her during the school days. Got to know her through a mutual friend. Thats when things went well and we became good friends. We got into the exact same wavelength (though we realised later that we were 180 degree out of phase in everything). We were really the best and closest. I'll always cherish those wonderful moments i have had/having with her. To end this post, its not always being just F.R.I.E.N.D.S will do. There is always one step more in life with someone really special :-)



-Vignesh