Skip to main content

Posts

Showing posts from November, 2008

Calling Struts Action by Javascript

To call a struts action by Javascript on an event, you need to write a function which is invoked when the event occurs and this function makes an AJAX call. The AJAX call can send a request to the same URL which is provided in action attribute of form tag or html:form tag.

e.g. In case your action URL is something like
"/registerUserAction.do?action=forgetPasswordForward"
that you provide in action attribute of html:form, you can pass the same url to the mentioned code snippet below:


function makeRequest(url, callbackfunction)
{
var http_request = getXMLHttpObject();
url = url + "isComingFromAjax=true";

if (url.indexOf('?') != -1)
{
url = url + "&" ;
}
else
{
url = url + "?" ;
}

url = url + "isComingFromAjax=true";
http_request.onreadystatechange = callbackfunction;
http_request.open('POST', url.substring(0, url.indexOf('?')), true);
http_request.setRequestHeader('Content-Type', 'application/x-w…

Choosing a LCD

Well, few months back I got confused when I saw so many LCDs of Sony, Hitachi, Philips, Samsung Sansui. I visited many showrooms and what I discovere that in one showroom I found Samsung as the best and in other Sony was the best, if you get confused obviously most people would end up with Sony. But then I realised dealers promote one or the other brand and they keep that unit in best settings.So, I jumped into a shop and got the remotes of all LCDs and when I set all of them on same brightness, sharpness level, it was a minute job for me to go for hitachi. Shopkeepers will tell you about so many factors, but only two are important Contrast ratio and response time, the time taken between the result on screen and when the button is pressed. This is how I decided and its been six months no problems. Till then there are new models but you can use the same approach to decide about a LCD.

Words for Sounds and Expressions - Hindi Comics

I build up this knowledge during my childhood and I found it very funny and hilarious when I visualize and use them today. Here are a few examples:

Chapaak - Sound of falling into water
Dhadaak - Sound of being hit by a wooden material, chair etc which broke after you are hit.
Dharram - Person falling into some wooden or steel material.
Dhaaen - Sound of firing of Gun.
Bu. Hu. hu.. hu... - Weeping
Subak.. Subak - Sobbing
Sarraaat - Motar bike moving.
Gulup.. Gulup.. - Drowing in water
Dhamaka - Blast, they will just make some clouds and right "Dhamaka" in middle.
Sudok.. Sudok.. - Having some liquid with a straw

And finally a big fight between two people:
Make clouds and write on all directions following words - Mukka, Laat, Thappad, Ghussa.
And if the person is being severly beaten write in middle "Dhunae par Dhunae".

Hope this is going to remind you of childhood. If I have missed some of them, please let me know.

Old Honda City - Value for Money

I am crazy about cars, I was always a fan of old honda city ever since it was launched. Finally I owned it, got it in 2004, 40K done and I am so satissfied with the ride, handling and comfort I enjoy driving this car. My hometown is in Jammu and twice I have been there in my old honda city. First time I drove it on my own upto Jammu and was so glad with the comfort and fun I had all the way to my hometown. Second time, I hired a driver who drove me to Jammu and then I got the feeling of comfort and luxury that old honda city can provide on back seat.

Six months back I went to a marriage, a friend of mine has recently purchased a brand new zen, he asked me for a test drive to know why I didnt purchased a new car, reluctantly I gave him keys, we went for a drive of 2 Kms and when he handed me back the keys, he said "Get me one like this, or give your city to me and take away my new zen and tell me how much more you want". What a compliment man !! But, the compliments keep pouri…

Differences between Delete, Drop and Truncate Statements

DELETE, DROP and TRUNCATE statements differ in their nature itself. DELETE statement is a DML (DATA MANIPULATION LANGUAGE) statement.DROP AND TRUNCATE statements are DDL (DATA definition language) statements.A DML action can be rolled back if the data is not committed, but DDL actions cannot be rolled back until Oracle 9i. With Oracle 9i FLASH BACK enabled even some of the DDL statements can be rolled back.DeleteA delete statement deletes the data from a table. A delete statement can have a “where” clause, which need to be satisfied for the data to be deleted from the table.Actions of Delete statementDeletes the data from the current table space.Modifies the undo table space with the delete records. Executes all the before / after statement and row level triggers. Updates the indexes (makes the index empty if the where clause is omitted). Constraint checks are performed before deleting the rows Syntax of a delete Statement:DELETE FROM table [WHERE condition]TruncateTruncate drops all …