Wednesday, July 1, 2009

Rendering HTML tags in blog

To render HTML tags in blog we need to use

to render '&' we have to use &
to render '<' we have to use &lt;
to render '>' we have to use &gt;

Similar all the other HTML tags can be displayed in the blogs.

Tuesday, June 30, 2009

InnerHTML vs InnerText ASP.Net

InnerHTML renders the html.
InnerText does not render html. It just assigns the value to the specified node.

Sample:

string myContent = "<p>Some HTML markup 3 &lt; 5 text </p>";
myDiv1.InnerText = myContent;
myDiv2.InnerHtml = myContent;

myDiv1 will be rendered as "<p>Some HTML markup 3 &lt; 5 text </p>"
myDiv2 will be rendered as "Some HTML markup 3 < 5 text" in a para.

Wednesday, June 24, 2009

Javascript Multiplication Error

When we try to multiply a decimal value with another decimal number or integer, javascript does not seem to handle this well.

for eg: 38.23 * 100 returns 3822.999999999995 instead of 3823.00

To solve this issue we need to use Math.round function

Solution:
Multiply the number by 1000, round it and then divide by 1000. This will give the expected result.

Math.round(1000 * 38.23 * 100) / 1000

Hope this solves the multiplication issue present in javascript and also your time.

Sunday, April 26, 2009

Getting Ration Card in Bangalore

Hello All,

  I am writing  my experience of getting ration card in Bangalore. 

We require 2 documents
1.   NOC from home town saying "I dont have a ration card @ my home town" or saying "Name has been deleted from the ration card @ home town".
2.  Address Proof of the current residencial address (House Rent Agreement etc.)

With these 2 documents, we need to go to the Food and Civil Supplies Department. As I was staying in Domlur area, I had to go to Food and Civil Supplies Department located @ St. Johns Road.

I filled a form, which was totally in Kannada, and then submitted the document along with the above 2 documents along with Rs. 10/-. It would be more helpful if we take a guy who can read kannada.

Then I was asked to come after 1 month time to collect the ration card.

When I went after 1 month to the Department, I collected my ration card. My photo was taken and my ration card got printed in about 15 mins time. I had to give Rs. 45/- as lamination charges to the guy who printed the ration card and had it laminated.

So, if we have the NOC then getting the ration card is pretty simple.

Over all I would say it was a pleasant experience..even though I had some rough time finding the Department in St.Johns Road.

Hope the above experience would be useful to you all.

hem@nth

Tuesday, March 17, 2009

Power Points Switches in 3rd AC Compartments Trains

Hello All,

I would like to share my experience while travelling to Kharagpur from Bangalore on Feb 20, 2009 in Yeswantpur Howrah Express.

I had taken a 3rd AC ticket, and was wondering if there would be Power Points in the individual cabins or not. I tried reading lot of blogs, forums but could not get any info.

While going from Bangalore to Kharagpur, our compartment had Power points for all the cabins (8 seats group). While the adjacent 3rd AC coach had power points in every alternate cabin.

This is mainly intended for charging of mobile phones, though even laptops can be charged with this. If the circuit breaks because of over load in the compartment, ask the attender to pull the switch again so that all power points are funcional again.

However while returning my coach (3rd AC) has power points at every alternative cabin.

The railways has really improved a lot over the last couple of years.

If you are planning to travel for a long distance with the airfare rates going so high, travelling in train is not a bad option at all.

Cheers

Friday, January 30, 2009

Javascript ASP.Net

Always use ID instead of name to refer to controls in the ASP/ASP.Net page. If we use name, then the control cannot be idetified in javascript. 

If the control has only name and ID is not associated with the control, then add the ID to the control and then use this ID to identify the control in javascript

paying road tax in RTO Bangalore

I am sharing one more experience of my friend who paid his road tax directly with out any agents

He had all the documents required. He had been to the RTO office for 3-4 continous SATURDAY's to find out that 2nd SAT is holiday for RTO people. 

He paid the road tax directly along with change of address.  He brought his NOC from Hyderbad for his bike.

He was made to wait for 2 hours near his bike for the inspection, and atlast he paid his road tax as well as was able to get a change of address. 

paying road tax in RTO Bangalore

I went to pay road tax at RTO Indira Nagar.

There are 2 ways in which we can pay the road tax

1. Through Agent
2. Directly

The second option is more difficult one, as the people in RTO office talk only in Kannada. So it is always nice to take a friend of yours who knows Kannada. Also you need to all the documents required else you need to keep on visiting the RTO office. 

Here I am sharing my experience with all of you. I have read in many reviews that NOC for bike is not required while paying road tax for my bike. I moved from Hyderabad to Bangalore. But when I went to the RTO office, the scenario was entirely different. The officer was insisting on NOC even though I did not want to change my address or registration number. I was asked to fill Form 14. This form is completely in Kannada.

The Officer told me that without NOC I will not be able to pay road tax for my bike. I did not know what to do next. Immediately next to me was an agent standing who said, that he would pay the road tax on my behalf and asked for Rs.750 as commission. As I did not have NOC with me, I had no other option but to say "yes" to the agent and atlast we negociated the amount to Rs. 500. The agent took initial Rs 200 to give it to the officers sitting inside to get the signature on my application. 

Then he asked me to get a DD for the amount that the RTO Officer has written on Form 14. I got the DD for a nearby bank, and was able to pay the Road tax. Thanks to the corrupt system, I finally paid the road tax and now I am able to drive my vehicle without any fear of being caught by the police.

Localization Convert Date from UK to US


Use the method

Convert.ToDateTime(somestring, System.Globalization.CultureInfo.CreateSpecificCulture("en-US"))

To convert date to a specific US culture

Thursday, January 8, 2009

Error - Did not pass the digital signature check

While trying to install VS 2005 SP1, I got this bug.
This is a bug in Windows Server 2003, and hot fix has been released.

Download the hotfix from

http://www.microsoft.com/downloads/details.aspx?FamilyId=8EFFE1D9-7224-4586-BE2B-42C9AE5B9071&displaylang=en

and install the same.

Then try to install VS 2005 SP1.

This should succeed.

Wednesday, January 7, 2009

Registering a DLL returns error "return code was 0x80020009"

We may get this error while trying to register the dll.

0x80070005 is the Return code for not having administrative credentials.

Looks like 0x80020009 is a generic error.

If it is a permission problem...HKEY_CLASSES_ROOT is the key that you want.

Try this...
Reset the registry permissions
As soon as you have found the registry subkey that has the incorrect permissions, update the permissions for that subkey.
To update the permissions of the registry subkey, follow these steps:
a. Click Start, click Run, type regedit and then click OK to startRegistry Editor.
b. Locate and right-click HKEY_CLASSES_ROOT:and then click Permissions.
c. Under Group or user names, click Administrators.
d. Under Permissions for Administrators, make sure that the Allow check boxfor the following entries is selected:* Full Control * Read *
e. Click Apply and then click OK.
f. On the File menu, click Exit to quit Registry Editor.

Now try to register the dll again using regsvr32 command