Saturday, May 16, 2009

Selection Sort Vs Insertion Sort

selection   sort
Selection Sort: Given a list, take the current element and exchange it with the smallest element on the right hand side of the current element.
insertion   sort Insertion Sort: Given a list, take the current element and insert it at the appropriate position of the list, adjusting the list every time you insert. It is similar to arranging the cards in a Card game.
Time Complexity of selection sort is always n(n - 1)/2, whereas insertion sort has better time complexity as its worst case complexity is n(n - 1)/2. Generally it will take lesser or equal comparisons then n(n - 1)/2.
Any suggestion to improve this article is always welcome!

Below you can find the Ruby code snippets:-
Selection Sort
Insertion Sort

Quickly ping Google/Yahoo to know your Connection Status.

1. Open notepad and jot down ping -t 209.85.171.100. Close and rename it as *.bat file. This is the IP address* of Google.

2. Send shortcut to your Desktop.Change icon(Optional).

1.ping   bat file 2.ping   shortcut

Note: Don’t use IP address of Microsoft.com/Amazon.com, etc as they don’t respond to ping command.

ping   google

For my broadband connection ‘Round Trip Propagation time’ of around 300-400ms(seen in snapshot above) indicates a fairly good connection speed. If you see reply from remote server, close the batch process.

*why use IP address? If the connection is not ok, the batch process will fail to execute if you simply write ping -t google.com, so you won’t be able to find the problem.

Thursday, May 7, 2009

ADSL Splitter Connection.

Last night I shifted my modem and laptop to another place, so I had to disconnect all the phone and modem connections. After reconnecting my router ‘line state’ was showing ‘Down’ rather than ‘Showtime’.

wrong   splitter   Adsl   connection

I tried to figure out the problem but was unable to do so. In the morning after much of the troubleshooting I finally figured out that the problem was with the splitter connection. Damn!!!

I have interchanged the modem and phone lines while reconnecting… what the hell?

 

splitter reverse  + splitter

Monday, May 4, 2009

Ubuntu 8.1 delivered.

Today I received my Ubuntu CD’s  which I ordered sometime back. It has come all the way from ‘The Netherlands’.

ubuntu delivered

I am so Happy :).

RSS + FeedDemon + Google Reader

rss I am not gonna tell you what is RSS? To have a quick overview see this Video.

 

I will just show how to make it work for you. Download and  install FeedDemon. If you are already using Google reader for RSS feeds just synchronize it with FeedDemon. If you are new follow the instructions below :

Open a website you want to subscribe. If you open it in Firefox RSS button will be present in the address bar itself.

RSS   FeedDemon   firefox   google   reader

or else you will find it in the website as shown below :

image

Just configure FeedDemon as your default feed reader.

feedDemon3

Now subscribe all your favorite websites and stay tuned. Happy feeding!