So this is one pain in the neck if you ask me, normally you would expect a smooth installation by the package manager but it WONT ....
so when I tried installing by downloading the debian package from adobe download page, the installation will fail saying
dpkg: dependency problems prevent configuration of adobe-flashplugin:
adobe-flashplugin depends on libnspr4-dev; however:
Package libnspr4-dev is not installed.
adobe-flashplugin depends on libnss3-dev; however:
Package libnss3-dev is not installed.
dpkg: error processing adobe-flashplugin (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
adobe-flashplugin
and then when I would try to install the libnspr4-dev libnss3-dev packages it will throw an error :
The following packages have unmet dependencies:
adobe-flashplugin: Depends: libnspr4-dev but it is not going to be installed
libnss3-dev: Depends: libnspr4-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
So here is a much simpler solution open the downloaded package using archive manager and locate the file libflashplayer.so and simply copy it under you mozillaPath/plugins folder. If there isnt a plugins folder simply create it.
Normally it should be under /home/user/.mozilla/plugins.
Restart the browser and you are good to go.
Tuesday, September 29, 2009
Thursday, July 23, 2009
Recover grub after Installing Windows
So you have installed the necessary evil OS called a windows. I had to... coz the MMORPG I play won't release a linux version. Now Windows will obviously remove grub.
Here is a simple and sure shot way of recovering it:
1. Get a ubuntu live bootable CD and boot from CD. Any version will do.
2. Start console.
3. Create a directory:
4. My defalt linux installtion resided on /dev/sda3 which is pretty common.
5. If you don't know which is yours check by the following command
This should output something like (hd0,2) meaning my partition is sda3
6. Mount the drive
7. Now reinstall grub by this command
8. Now simply re start the PC and it should configure your grub automatically and detect windows.
9. If you want to tweak further /boot/grub/menu.lst contains the list of the boot menu options.
Here is a simple and sure shot way of recovering it:
1. Get a ubuntu live bootable CD and boot from CD. Any version will do.
2. Start console.
3. Create a directory:
$ mkdir /media/tmp
, we will use it to mount the file system.4. My defalt linux installtion resided on /dev/sda3 which is pretty common.
5. If you don't know which is yours check by the following command
$ grub
The grub prompt will appear grub> find /boot/grub/stage1
This should output something like (hd0,2) meaning my partition is sda3
6. Mount the drive
$ mnt /dev/sda3 /media/tmp
7. Now reinstall grub by this command
$ sudo grub-install --root-directory=/media/tmp /dev/sda
8. Now simply re start the PC and it should configure your grub automatically and detect windows.
9. If you want to tweak further /boot/grub/menu.lst contains the list of the boot menu options.
Friday, October 3, 2008
Filtering Data / Using Bit Map Indexes
Lately us(dev team) at the naukri.com were faced by a singular problem: how to filter out records already viewed from a result set.
So what we have here is two sets of data and we needed to do a subtraction of one set from another, a the two sets in question can be arbitrary and not necessarily be same in size.
So we have two sets A, B of IDs. A is the search result set and B is the set of the ID of records already have been viewed.
So basically we want A - B.
Those of you who suggest we use an SQL with condition in WHERE clause
say like WHERE record_id NOT IN (b0, b1, b2,b3, .... bn) can skip reading this post.
Now why do I say the problem is singular,
Now how to go about this problem. What I initially thought of was if we can sort the sets A, B in increasing order. After we have sorted the lists we can find out the most common overlapping part among the both sets.
Say A = { 8374, 4430, 2393, 1002 , 763472, 9878, 10232}
B = {7656, 4532, 2674}
now min(A) = 1002, max (A) = 763472
Min (B) = 2009, Max(B) = 7656
Now we know the end points of the already IDs that are already viewed. Thus in the Set B we can ignore all the values that are outside these boundaries. So all the values in set A lower than min(B) and greater than max(B) can be simply ignored.
After this we are again left with a possibly smaller set of the same initial problem.
The answer hopefully shall be when we discover bit map indexes. The basic theory can be obtained from here.
http://www.akadia.com/services/ora_bitmapped_index.html
So the idea here is using of memory based bit map indexes. Now what we intend to here is create a long stream of bitmaps. This stream of bitmap will be as long as the maximum record
possible. Here I would like to point out that this number is much larger than either Set A or B.
So technically set A, B will be a subset of the super set which contains all the records. Say its length is N.
So we have say a bitmap index N bits long. When this bitmap is loaded in memory it will take approximately 2.5 MBs of space for N = 20 million.
Now we will set all the bits in the bitmap stream to 1 or switch them on.
After this we will traverse the set B and XOR each Bith bit in the bitmap index.
Say for the above example we will XOR the 2674, 4532 and 7656th bits on the bitmap. Now when we display the search results we have this set of values which are already viewed turned as off. This is how far we have gone. I will continue to post once I find a code sample and implement something.
MIT HACKMEM Count
int bitcount(unsigned int n)
{
/* works for 32-bit numbers only */
/* fix last line for 64-bit numbers replace 63 by 1023*/
register unsigned int tmp;
tmp = n - ((n >> 1) & 033333333333)
- ((n >> 2) & 011111111111);
return ((tmp + (tmp >> 3)) & 030707070707) % 63;
}
PS: Thanks to vikasB and anshumG, yawarA for their help.

So what we have here is two sets of data and we needed to do a subtraction of one set from another, a the two sets in question can be arbitrary and not necessarily be same in size.
So we have two sets A, B of IDs. A is the search result set and B is the set of the ID of records already have been viewed.
So basically we want A - B.
Those of you who suggest we use an SQL with condition in WHERE clause
say like WHERE record_id NOT IN (b0, b1, b2,b3, .... bn) can skip reading this post.
Now why do I say the problem is singular,
- The data filtering needs to be done for a web search page so it must be fast.
- I already said both the sets can be arbitrary in size. A < B , A = B, A > B.
Now how to go about this problem. What I initially thought of was if we can sort the sets A, B in increasing order. After we have sorted the lists we can find out the most common overlapping part among the both sets.
Say A = { 8374, 4430, 2393, 1002 , 763472, 9878, 10232}
B = {7656, 4532, 2674}
now min(A) = 1002, max (A) = 763472
Min (B) = 2009, Max(B) = 7656
Now we know the end points of the already IDs that are already viewed. Thus in the Set B we can ignore all the values that are outside these boundaries. So all the values in set A lower than min(B) and greater than max(B) can be simply ignored.
After this we are again left with a possibly smaller set of the same initial problem.
The answer hopefully shall be when we discover bit map indexes. The basic theory can be obtained from here.
http://www.akadia.com/services/ora_bitmapped_index.html
So the idea here is using of memory based bit map indexes. Now what we intend to here is create a long stream of bitmaps. This stream of bitmap will be as long as the maximum record
possible. Here I would like to point out that this number is much larger than either Set A or B.
So technically set A, B will be a subset of the super set which contains all the records. Say its length is N.
So we have say a bitmap index N bits long. When this bitmap is loaded in memory it will take approximately 2.5 MBs of space for N = 20 million.
Now we will set all the bits in the bitmap stream to 1 or switch them on.
After this we will traverse the set B and XOR each Bith bit in the bitmap index.
Say for the above example we will XOR the 2674, 4532 and 7656th bits on the bitmap. Now when we display the search results we have this set of values which are already viewed turned as off. This is how far we have gone. I will continue to post once I find a code sample and implement something.
MIT HACKMEM Count
int bitcount(unsigned int n)
{
/* works for 32-bit numbers only */
/* fix last line for 64-bit numbers replace 63 by 1023*/
register unsigned int tmp;
tmp = n - ((n >> 1) & 033333333333)
- ((n >> 2) & 011111111111);
return ((tmp + (tmp >> 3)) & 030707070707) % 63;
}
PS: Thanks to vikasB and anshumG, yawarA for their help.
Labels:
bitmap index,
mit hackmem,
naukri jobsearch,
search,
vikasbucha
Friday, April 4, 2008
Blogging and you
The Do's and Don't of blogging.
1. Good blogs are written with related posts in chronological order. Keep one either ascending or descending order. Both are acceptable.
2. Grammatical and typing errors are a crime on a blog.
3. Please don't use highly florescent colors or backgrounds. The posts should be readable.
4. Good bloggers never use swear words unless you are an angry teenager. Usage of @#$% is still acceptable. It doesn't apply to ex-lover tribute blogs. :)
5. Avoid making use of local slang or particular jokes as most people will not get the point. Mentioning of local celebrities is an example not to be followed.
6. Religious or racist jokes are a strict no. Don't even argue.
6. Don't give too many examples. Unless it is a blog on mathematics.
7. Be original.
8. Be prepared for hate and spam mail. Why on earth did you leave your email anyways?
9. Use paragraphs and avoid writing 1000 word sentences. Indentation is the word.
10. Keep only one person of speech through out, first or third are preferred. If you don't know what I mean pick up that high school grammar book.
11. Don't spam the blog with pictures. It is highly discouraged to have your passport photo scanned and posted on a blog.
12. It is okay to write all about yourself on your blog, it is your blog after all. That may include worst of your habits.
13. Don't use "I can't disclose what happened" sort of lines more than once in a blog. If you can't disclose it just don't mention it.
14. Humor is welcome unless it surpasses the original point.
15. Use only the most common abbreviations UNICEF and wtf are two such examples.
PS: Casual bloggers, you can still follow the above points and write a casual blog.
PSS: This post will be updated.
1. Good blogs are written with related posts in chronological order. Keep one either ascending or descending order. Both are acceptable.
2. Grammatical and typing errors are a crime on a blog.
3. Please don't use highly florescent colors or backgrounds. The posts should be readable.
4. Good bloggers never use swear words unless you are an angry teenager. Usage of @#$% is still acceptable. It doesn't apply to ex-lover tribute blogs. :)
5. Avoid making use of local slang or particular jokes as most people will not get the point. Mentioning of local celebrities is an example not to be followed.
6. Religious or racist jokes are a strict no. Don't even argue.
6. Don't give too many examples. Unless it is a blog on mathematics.
7. Be original.
8. Be prepared for hate and spam mail. Why on earth did you leave your email anyways?
9. Use paragraphs and avoid writing 1000 word sentences. Indentation is the word.
10. Keep only one person of speech through out, first or third are preferred. If you don't know what I mean pick up that high school grammar book.
11. Don't spam the blog with pictures. It is highly discouraged to have your passport photo scanned and posted on a blog.
12. It is okay to write all about yourself on your blog, it is your blog after all. That may include worst of your habits.
13. Don't use "I can't disclose what happened" sort of lines more than once in a blog. If you can't disclose it just don't mention it.
14. Humor is welcome unless it surpasses the original point.
15. Use only the most common abbreviations UNICEF and wtf are two such examples.
PS: Casual bloggers, you can still follow the above points and write a casual blog.
PSS: This post will be updated.
Subscribe to:
Comments (Atom)
