In my last post i mentioned a word Random Surfer. It was purely under my subconscious mind. When I just started reading that post again, my concentration suddenly turned towards this word. Who is this Random Surfer?? It was a very familiar word to me and decided to write about it. Its gonna be a bit technical kindly excuse. Last semester in my semantic web course I had to implement a paper titled "Ranking Knowledge in Semantic Web". It was very interesting paper where i came to know about the concept behind Search Engines and the way they rank the result pages. The famous page rank algorithm used in search engines like Google is based on the Random Surfer Model. The code of the surfer is very simple. Whenever a surfer views a page he has certain probability to click a link in that page or to jump to a some other page. This is usually the famous 90-10 rule where the probability to click a link on the page is 0.9 and to jump to a random page is 0.1. The page rank will be a summation of all this probability. To sum up if a page has lot of inbound links it has the greater probability to be visited and hence has a higher page rank. In the real web this is more complex because the actual page rank will also depend upon the page rank of the page from which it has a inbound link. This will seem too complex and it is complex reallly. Imagine the graph or matrix the search engines has to maintain to establish the relationship between these pages(Thats awesome Isn't it?). They achieve this type of computing power very easily using grid computing.
Now if you are really curious and want to know the number of inbound links you have just click here and enter your blog or website and findout. To get more information on Random Surfer Model and Page Rank Calculation Click here
Showing posts with label My Technical. Show all posts
Showing posts with label My Technical. Show all posts
Thursday, February 26, 2009
Friday, June 8, 2007
Re: Bit Hacks
Previously i had post on the Bit hacks.. I got those from a site and was quite interested in it. I want people to know that, so i posted a couple of things. One of my senior santhosh popularly known as santy who read my blog asked me about the one which i posted.. It was to find the absolute value of an integer. I worked it out, but could not find it out. can anyone go through it and work it out for me it will be great
note: The CHAR_BIT is normally take as 8
note: The CHAR_BIT is normally take as 8
Wednesday, May 23, 2007
Bit Hacks
I would like to present some of the interesting Bit Hacks..
Determining if an integer is a power of 2
unsigned int v; // we want to see if v is a power of 2Note that 0 is incorrectly considered a power of 2 here. To remedy this, use:
bool f; // the result goes here
f = (v & (v - 1)) == 0;
f = !(v & (v - 1)) && v;
Compute the integer absolute value (abs) without branching
int v; // we want to find the absolute value of v
int r; // the result goes here
int const mask = v >> sizeof(int) * CHAR_BIT - 1;
r = (v + mask) ^ mask;
Swapping values with XOR
#define SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) This is an old trick to exchange the values of the variables a and b without using extra space for a temporary variable. On January 20, 2005, Iain A. Fleming pointed out that the macro above doesn't work when you swap with the same memory location, such as SWAP(a[i], a[j]) with i == j. So if that may occur, consider defining the macro as (((a) == (b)) || (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b)))).
For many other bithacks click here
Subscribe to:
Posts (Atom)