Thursday, April 30, 2009

Converting CSV file to HTML file by using VIM

I wrote a small VIM script to convert CSV file to HTML file.

You can get it from http://www.tnsatish.com/software/csvtohtml.vim

Usage is : vim -s csvtohtml.vim <filename>


After running the above command, the file will contain html code in place of CSV. This script will not work, if there are new lines or commas in any cell.

First row will be taken as header, and the color for that is ff80ff. For all the remaining rows, the color would be changed alternatively (b0ffff and ffff80). You can change the corresponding colors in the script (for bgcolor in tr tag), and the html would be created with the colors given.


Contents of csvtohtml.vim

:%s/^/<tr><td>/g
:%s/\//<br>/g
:%s/$/<\/td><\/tr>/g
:%s/,/<\/td><td>/g
:%s/<td><\/td>/<td>&nbsp;<\/td>/g
:%s/\n/X1X2X3X4X5X6/g
:%s/X1X2X3X4X5X6\(.\{-}\)X1X2X3X4X5X6/X1X2X3X4X5X6\1\r/g
:%s/<tr>/<tr bgcolor="#b0ffff">/
:%s/<tr>/<tr bgcolor="#ffff80">/
:%s/X1X2X3X4X5X6/\r/g
:1 s/bgcolor="[^"]*"/bgcolor="#ff80ff"/
:1 s/^/<table>\r/
:$ s/$/\r<\/table>/
:wq


I have used the above script to create the tables for MLA and MP Contestants at www.tnsatish.com and news.loksatta.org.

Monday, April 27, 2009

Why Advani did not bring black money in Swiss bank when he was in power?


This is the question asked by all the senior congress leaders including Sonia Gandhi and Rahul Gandhi.

Around two years back, Swiss government disclosed the money they had from different countries. They are ready to disclose the account details of the account holders to the government of their respective countries. To get the account details of all the indians, Indian government has to formally ask Swiss government for the details. Few years back, this was not possible, and previous governments could not have done anything in this case.

Instead of asking Swiss government for the details, Congress leaders are criticizing Advani and other leaders for not doing anything when they were in power.

Friday, April 24, 2009

Wipro asks employees to work 2 days a week


Wipro came up with a scheme, Project Enrich for employees who are on bench. It gives an alternative to the employees, by which, they can come to work for 10 days a month, and get pay that is 50 percent of their cost to company (CTC). They will be absorbed back into projects once deployment opportunities come up. The scheme has already enrolled 1000 of their employees.

The company has also introduced Project Rejuvenate, which is though primarily aimed at benched staff, will also be open to some senior employees. The scheme will allow them to take a leave for one to one-and-a-half years, while they will be offered 25 percent of their CTC. Currently, the company has 10-12 percent of overall employees in the bench which will surge as it plans to recruit more 6,000 employees. "They are good resources and we don't want to lose them. We don't want to do anything drastic as well," said Pratik Kumar, Head of Human Resources (HR) at Wipro.

Source: Silicon India

Monday, April 20, 2009

Telangana - Y.S.Rajasekhar Reddy


After a very long time, One politician (Y.S.Rajasekhar Reddy) directly said, we need united Andhra Pradesh, and not two states. Till now, all politicians (Except Loskatta Leaders) said, only by forming separate state for Telangana, it would be developed. They all are talking about the problems of Telangana people and never problems of Coastal and Rayalaseema regions. Now, Y.S.R. has publicly said, he supports united Andhra, and he raised few good points on partitioning of the state.

What happens to the irrigation projects which spans Telangana and the other part of A.P.? After splitting the state, the projects will not continue, due to problems in separation of water between the state. Unless the water is distributed, those projects cannot continue. The distribution may take minimum a decade (after seeing the same between Tamilnadu and Karnataka; A.P. and Karnataka).

K.Chandra Sekhar Rao (KCR) says, he will close all the colleges started by Andhra people in Telangana. According to the constitution, all Indian citizens have equal rights in any part of India (Except Jammu & Kashmir). But, What KCR said is unconstitutional. At that time, no leader other than Dr.JP has criticized that. Only after the elections in Telangana, YSR criticized that.

KCR is asking to implement G.O. 610, for transferring all Non-Telanganaite people to outside Telangana. This is making Telangana similar to Jammu & Kashmir.

I am sure except KCR and BJP, nobody is interested in splitting the state. But, if they want to split, everyone (people of Coastal, Rayalaseema and Telangana regions) should discuss and finalize on how to separate capital, natural resources, government organizations, employees and many other things. Only after discussing and finalizing those, the state should be separated. Otherwise, Andhra and Telangana may become like India and Pakistan or Karnataka and Tamilnadu. I hope all the leaders take care of these things, and make sure that, even if the state is split, still nobody loses anything. I know KCR never bothers about these.

Wednesday, April 15, 2009

The Banana Test


There is a very, very tall coconut tree and there are 4 animals, a Lion, a Chimpanzee, a Giraffe, and a Squirrel who pass by.

They decide to compete to see who is the fastest to get a banana off the tree.

Who do you guess will win?

Your answer will reflect your personality.

So think carefully.... Try and answer within 30 seconds.

Got your answer?

Now scroll down to see the analysis.

.

.

.

.

.

.

.

.

.

.

.

.

.

.


If your answer is:

Giraffe = you're unrealistic.
Lion = you're not honest.
Chimpanzee = you're a complete moron.
Squirrel = you're hopeless.

.

.

.

.

.

.

.

.

.


A COCONUT TREE DOESN'T HAVE BANANAS.

Obviously you're stressed and overworked, You should take some time off and relax!

Source: http://www.funtoosh.com/?dj.php?details=A10~1200

Sunday, April 12, 2009

Nothing is Impossible

In 1980, IDBI bank rejected loan for Ambani.

In 2008, Mukesh Ambani was planning to buy IDBI bank.

this shows nothing is impossible.. .




Now in 2009, HDFC bank rejected loan for me...

but in 2020, I'm planning to....

.

.

.

.

.

.

.

.

.

.

.


Apply for loan again!

Source: http://www.funtoosh.com/?dj.php?details=IND~396

Thursday, April 09, 2009

Windows Sucks


Till Windows XP, Microsoft has been adding features to the operating system irrespective of whether a common user needs it or not. Since Windows Vista, they started removing features or moving from one place to another place, and they claim that, typical user do not need those advanced features. For each upgrade, the user has to spend $4,000 to $20,000 extra.

These are the very few frustrated experiences that I faced while using Windows 2008. For obvious reasons, I cannot write all the frustrated experiences. (Because, if I have to write all, I should write a book, and not an article.)

Windows XP: To change an associated application with a file type, we can go to Tools -> Folder Options -> File Types, and can change the associated application. We can give our own parameters while opening the application.

Windows 2008: One has to go to Control Panel -> Default Programs -> Set Associations. But, in this case, we cannot pass our own parameters while opening the application.

Windows XP: In Explorer, If we want to increase the size of any column, we just need to drag the separator, and you don't need to exactly put the mouse on the separator. Even if you put little before or after, still it works.

Windows 2008: It will really test your precision capability. If you are a good gamer, then probably, you will not find any difference. Otherwise, you will have good time. It checks for absolute precision on the separator, and if you miss it even by few pixels, the column would be moved to different location, and the size will not increase/decrease.

Windows XP: In explorer, in the left window, all the sub-folders are separated with enough spacing. Incase of many nested sub-folders, there is horizontal scroll bar to view it.

Windows 2008: Microsoft may wanted to save some space, and reduced the spacing between the parent folder and it's sub folder. In case of many nested folders, it would become very difficult to use. Not only that, there is no horizontal scroll bar. If you have many nested folders, You would be forced to increase the size of the left window. Otherwise, you will have real fun.

Windows XP: To search for any file, you can select the folder in which you want to search, Right Click -> Search will give the search window. There you can search, and in the search results, it shows the folder name like C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\GLOBAL.

Windows 2008: You have to search in the search box. You don't have control on the folder in which you want to search. (Atleast no direct option. Probably at 100 levels deep, there an option may be available). Once you get the search result, they will show the folder name very intelligently. Like Global (C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE)

They changed everything from one place to another, making a typical software engineer to search in google for each and every small thing, or take quite some time to search where the new feature is.

For example, to uninstall any application, in Windows XP, one has to go to Control Panel -> Add or Remove Programs. In Windows 2008, one has to go to Control Panel -> Programs and Features, and not Control Panel -> Default Programs.

Microsoft follows If You Don't Change the UI, Nobody Notices, and changes UI everytime they do some change, and make users frustrated.

Sunday, April 05, 2009

Why 1 is One? Numbers in Primitve form


I got this as a forward. Eventhough, I, myself not convinced with many, I am posting here just because of ZERO.

I don’t know how true it is...but surely looks interesting..

Have you ever asked questions to yourself like,

Why "1" is one..?

Why only "2" is two..?

Why "3" is three…?

What is the logic that's exists in these numbers?

These are Angles.

Look at these numbers written in their primitive forms and check it up.











And the most interesting....




Thursday, April 02, 2009

Quote of the Day


One person who has studied in both IIT and IIM said,

Having been to both IIT and IIM, I can say that I have never met a bunch of smarter people than at IIT and I haven’t seen a bigger bunch of self important losers than at IIMs.