
Wednesday, December 12, 2007
Strange thing I learned today in java
Strange thing I learned today [12-12-07] is
This code wont works and my yesterday productivity is spoiled by this error
System.out.println("Data 3 from Synonym table: " + rs_synonym.getString(1) );
word[3]=rs_synonym.getString(1);
and I corrected the error by,
word[3]=rs_synonym.getString(1);
System.out.println("Data 3 from Synonym table: " + word[3] );
I modified almost all the parts of the project without thinking about the following reason J
Reason:
rs_synonym.getString(1) takes value out, so again if u assign value from it to word[3] , it will be error.
This code wont works and my yesterday productivity is spoiled by this error
System.out.println("Data 3 from Synonym table: " + rs_synonym.getString(1) );
word[3]=rs_synonym.getString(1);
and I corrected the error by,
word[3]=rs_synonym.getString(1);
System.out.println("Data 3 from Synonym table: " + word[3] );
I modified almost all the parts of the project without thinking about the following reason J
Reason:
rs_synonym.getString(1) takes value out, so again if u assign value from it to word[3] , it will be error.
Thursday, November 22, 2007
Execute Excel Macros from Java application
We are developing a Java Web application and one of our project features require an excel document to be opened over web page. Once the page (with excel) gets opened a macro should be run automatically and a chart should be shown to user.
Best Solution:
~~~~ ~~~~~~~~
since excel macro is vb code, since we can make a vb script file called from java and it calls excel macro
Example:
make a script file as content is
Dim objXL
Set objXL = CreateObject("Excel.Application")
With objXL
.Workbooks.Open ("File_Path")
.Application.Run "Macro_Name"
.Application.Quit
End With
Set objXL = Nothing
and save it as calling.vbs
in java you can call it as Runtime.getRuntime().exec("cmd /c start calling.vbs");
Best Solution:
~~~~ ~~~~~~~~
since excel macro is vb code, since we can make a vb script file called from java and it calls excel macro
Example:
make a script file as content is
Dim objXL
Set objXL = CreateObject("Excel.Application")
With objXL
.Workbooks.Open ("File_Path")
.Application.Run "Macro_Name"
.Application.Quit
End With
Set objXL = Nothing
and save it as calling.vbs
in java you can call it as Runtime.getRuntime().exec("cmd /c start calling.vbs");
Labels:
application,
execute Excel,
from Java,
Macros,
programming
Wedding Query............. (SQL Style)
Wedding Query............. (SQL Style)
CREATE PROCEDURE MyMarriageBridegroom Male (25) ,Bride Female(20) ASBEGINSELECT Bride FROM India_ BridesWHERE Father-In-Law = 'Millionaire' AND Count(Car) > 20 AND House Status ='ThreeStoreyed'AND BrideEduStatus IN (B.TECH ,BE ,Degree ,MCA ,MBA) AND Having Brothers= Null AND Sisters =Null
SELECT Gold ,Cash,Car,BankBalanceFROM Father-In-Law
UPDATE MyBankAccout SETMyBal = MyBal + FatherInLawBal
UPDATE MyLockerSET MyLockerContents = MyLockerContents + FatherInLawGold
INSERT INTOMyCarShed VALUES('BMW')
END
GO
Then the wife writes the below query:
.
..
.
.
.
..
.
.
.
.
.
..
..
.
.
..
.
.
.
.
.
.
.
.
.
.
.
.
DROP HUSBAND;
Commit;
CREATE PROCEDURE MyMarriageBridegroom Male (25) ,Bride Female(20) ASBEGINSELECT Bride FROM India_ BridesWHERE Father-In-Law = 'Millionaire' AND Count(Car) > 20 AND House Status ='ThreeStoreyed'AND BrideEduStatus IN (B.TECH ,BE ,Degree ,MCA ,MBA) AND Having Brothers= Null AND Sisters =Null
SELECT Gold ,Cash,Car,BankBalanceFROM Father-In-Law
UPDATE MyBankAccout SETMyBal = MyBal + FatherInLawBal
UPDATE MyLockerSET MyLockerContents = MyLockerContents + FatherInLawGold
INSERT INTOMyCarShed VALUES('BMW')
END
GO
Then the wife writes the below query:
.
..
.
.
.
..
.
.
.
.
.
..
..
.
.
..
.
.
.
.
.
.
.
.
.
.
.
.
DROP HUSBAND;
Commit;
Test ur IQ
Subject:1min. Question Paper...try how intelligent u r
R U READY?????????????????????????????????????
R U READY?????????????????????????????????????

Scroll Down for Answer:
.. .. ..
.. ....... .. .. ..
.. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. ..
.. .. ... .. ..
.. .. ..
.. ..
.
.
..
.
.
..

--------------- Moral: Dont Use your brain too much.
DANGEROUS DRUGS HAVE BEEN GLOBALLY DISCARDED BUT ARE AVAILABLE IN INDIA
Dear All,
Make a Check list, check weather this medicine is in our home or weather it has recommended by our doctor... pls do not use it.. Please Read Very Carefully - INFORM ALL YOUR FRIENDS & FAMILY MEMBERS India has become a dumping ground for banned drugs; also the business for production of banned drugs is booming. Plz make sure that u buy drugs only if prescribed by a doctor(Also, ask which company manufactures it, this would help to ensure that u get what is prescribed at the Drug Store) and that also from a reputed drug store. Not many people know about these banned drugs and consume them causing a lot of damage to themselves. We forward Jokes and other junk all the time. This is far more important. Please Make sure u forward it everyone u know. DANGEROUS DRUGS HAVE BEEN GLOBALLY DISCARDED BUT ARE AVAILABLE IN INDIA . The most common ones are action 500 & Nimulid. PHENYLPROPANOLAMINE: cold and cough. Reason for ban : stroke. Brand name : Vicks Action-500 ________________________________________________________________________ ANALGIN: This is a pain-killer. Reason for ban: Bone marrow depression. Brand name: Novalgin ___________________________________________________________ CISAPRIDE: Acidity, constipation. Reason for ban : irregular heartbeat Brand name : Ciza, Syspride ____________________________________________________________ DROPERIDOL: Anti-depressant. Reason for ban : Irregular heartbeat. Brand name : Droperol ______________________________________________________________ FURAZOLIDONE: Antidiarrhoeal. Reason for ban : Cancer. Brand name : Furoxone, Lomofen _____________________________________________________________ NIMESULIDE: Painkiller, fever. Reason for ban : Liver failure. Brand name : Nise, Nimulid ________________________________________________________________________ NITROFURAZONE: Antibacterial cream. Reason for ban : Cancer. Brand name : Furacin ________________________________________________________________________ PHENOLPHTHALEIN: Laxative. Reason for ban : Cancer. Brand name : Agarol ______________________________ __________________________________________ OXYPHENBUTAZONE: Non-steroidal anti-inflammatory drug. Reason for ban : Bone marrow depression. Brand name : Sioril _______________________________________________________________________ PIPERAZINE: Anti-worms. Reason for ban : Nerve damage. Brand name : Piperazine ________________________________________________________________________ QUINIODOCHLOR: Anti-diarrhoeal. Reason for ban : Damage to sight. Brand name: Enteroquinol
Make a Check list, check weather this medicine is in our home or weather it has recommended by our doctor... pls do not use it.. Please Read Very Carefully - INFORM ALL YOUR FRIENDS & FAMILY MEMBERS India has become a dumping ground for banned drugs; also the business for production of banned drugs is booming. Plz make sure that u buy drugs only if prescribed by a doctor(Also, ask which company manufactures it, this would help to ensure that u get what is prescribed at the Drug Store) and that also from a reputed drug store. Not many people know about these banned drugs and consume them causing a lot of damage to themselves. We forward Jokes and other junk all the time. This is far more important. Please Make sure u forward it everyone u know. DANGEROUS DRUGS HAVE BEEN GLOBALLY DISCARDED BUT ARE AVAILABLE IN INDIA . The most common ones are action 500 & Nimulid. PHENYLPROPANOLAMINE: cold and cough. Reason for ban : stroke. Brand name : Vicks Action-500 ________________________________________________________________________ ANALGIN: This is a pain-killer. Reason for ban: Bone marrow depression. Brand name: Novalgin ___________________________________________________________ CISAPRIDE: Acidity, constipation. Reason for ban : irregular heartbeat Brand name : Ciza, Syspride ____________________________________________________________ DROPERIDOL: Anti-depressant. Reason for ban : Irregular heartbeat. Brand name : Droperol ______________________________________________________________ FURAZOLIDONE: Antidiarrhoeal. Reason for ban : Cancer. Brand name : Furoxone, Lomofen _____________________________________________________________ NIMESULIDE: Painkiller, fever. Reason for ban : Liver failure. Brand name : Nise, Nimulid ________________________________________________________________________ NITROFURAZONE: Antibacterial cream. Reason for ban : Cancer. Brand name : Furacin ________________________________________________________________________ PHENOLPHTHALEIN: Laxative. Reason for ban : Cancer. Brand name : Agarol ______________________________ __________________________________________ OXYPHENBUTAZONE: Non-steroidal anti-inflammatory drug. Reason for ban : Bone marrow depression. Brand name : Sioril _______________________________________________________________________ PIPERAZINE: Anti-worms. Reason for ban : Nerve damage. Brand name : Piperazine ________________________________________________________________________ QUINIODOCHLOR: Anti-diarrhoeal. Reason for ban : Damage to sight. Brand name: Enteroquinol
Labels:
AVAILABLE IN INDIA,
Awareness,
BUT ARE,
DANGEROUS,
DISCARDED,
DRUGS,
HAVE BEEN GLOBALLY,
Medicine
Tuesday, September 25, 2007
YOU CAN DO IT
Wise Son
An old man lived alone in Minnesota .
He wanted to spade his potatogarden, but it was very hard work.His only son, who would have helped him, was in prison.
The old manwrote a letter to his son and mentioned his situation: Dear Son,I am feeling pretty bad because it looks like I won't be able to plant my potato garden this year. I hate to misdoing the garden, because your mother always loved planting time. I'm just getting too old to be digging up a garden plot.If you were here, all my troubles would beover.I know you would dig the plot, for me if you weren't in the prison.Love,Dad
Shortly ,the old man received this telegram: "For Heaven's sake, Dad, don't dig up the garden !!That's where I buried the GUNS!!"At 4 a.m.the next morning, a dozen FBI agents and local policeofficers showed up and dug up the entire garden without finding any guns.
Confused,the old man wrote another note to his son telling him whathappened and asked him what to do next.
His son's reply was:"Go ahead and plant your potatoes, Dad It's the best I could do for you from here.
""NO MATTER WHERE YOU ARE IN THE WORLD, IF YOU HAVE DECIDED TO DO SOMETHING DEEP FROM YOUR HEART, YOU CAN DO IT,. IT IS THE THOUGHT THATMATTERS NOT WHERE YOU ARE."
An old man lived alone in Minnesota .
He wanted to spade his potatogarden, but it was very hard work.His only son, who would have helped him, was in prison.
The old manwrote a letter to his son and mentioned his situation: Dear Son,I am feeling pretty bad because it looks like I won't be able to plant my potato garden this year. I hate to misdoing the garden, because your mother always loved planting time. I'm just getting too old to be digging up a garden plot.If you were here, all my troubles would beover.I know you would dig the plot, for me if you weren't in the prison.Love,Dad
Shortly ,the old man received this telegram: "For Heaven's sake, Dad, don't dig up the garden !!That's where I buried the GUNS!!"At 4 a.m.the next morning, a dozen FBI agents and local policeofficers showed up and dug up the entire garden without finding any guns.
Confused,the old man wrote another note to his son telling him whathappened and asked him what to do next.
His son's reply was:"Go ahead and plant your potatoes, Dad It's the best I could do for you from here.
""NO MATTER WHERE YOU ARE IN THE WORLD, IF YOU HAVE DECIDED TO DO SOMETHING DEEP FROM YOUR HEART, YOU CAN DO IT,. IT IS THE THOUGHT THATMATTERS NOT WHERE YOU ARE."
Labels:
Positive living,
Thought is important,
YOU CAN DO IT
Save-Power
The information given below is really very important. This will definitely help to some extent to achieve the target set by our former President Mr. Abdul Kalam.
Most of us in the IT field, used to do one thing before leavingfor the day from office, Press Ctrl+Alt+ Del and leave to home happily.
That means your PC is still on..
One normal PC in the sleeping mode (Hibernation) will consume 35watts/hr.
Based on this we will do a small calculation. For one week 24 * 7 = 168 Hrs
Of this if we consider that we are working for 68 hours, thenthe PC is in sleeping mode for 100 Hrs a week. For one month 4 * 100 =400 Hrs In a normal IT office, if we assume approximately 250 PCs arethere, 250 * 400 = 1,00,000 Hrs (Sleeping Mode)
So the power wasted in an office in a month is 100000 * 35 =3500 KWH or units. If the charge per unit is IRs. 6, then totally the wastage valueis approximately 21000 Indian rupees.
Here the sad thing is not the money loss to the company but thepower loss to the country. (Hope no company is bothered about thisprocedure of keeping the system in sleeping mode)
Apart from the loss to the country we need to think of theefforts people are putting for producing the power in the Mines, ThermalStations, Hydro electric Stations, etc. If this is to continue, the costof unit power will go up & at one stage we will not get power even if weare ready to pay any cost.
So before leaving to home take some time to shut down the PC anddo some favour to the country and the organisation.
If you feel that this point is to be considered forward this to all your friends.
*** Do it once it will become a Habit… I mean Good Habit…Be a good citizen of India… ***
Most of us in the IT field, used to do one thing before leavingfor the day from office, Press Ctrl+Alt+ Del and leave to home happily.
That means your PC is still on..
One normal PC in the sleeping mode (Hibernation) will consume 35watts/hr.
Based on this we will do a small calculation. For one week 24 * 7 = 168 Hrs
Of this if we consider that we are working for 68 hours, thenthe PC is in sleeping mode for 100 Hrs a week. For one month 4 * 100 =400 Hrs In a normal IT office, if we assume approximately 250 PCs arethere, 250 * 400 = 1,00,000 Hrs (Sleeping Mode)
So the power wasted in an office in a month is 100000 * 35 =3500 KWH or units. If the charge per unit is IRs. 6, then totally the wastage valueis approximately 21000 Indian rupees.
Here the sad thing is not the money loss to the company but thepower loss to the country. (Hope no company is bothered about thisprocedure of keeping the system in sleeping mode)
Apart from the loss to the country we need to think of theefforts people are putting for producing the power in the Mines, ThermalStations, Hydro electric Stations, etc. If this is to continue, the costof unit power will go up & at one stage we will not get power even if weare ready to pay any cost.
So before leaving to home take some time to shut down the PC anddo some favour to the country and the organisation.
If you feel that this point is to be considered forward this to all your friends.
*** Do it once it will become a Habit… I mean Good Habit…Be a good citizen of India… ***
Labels:
computer,
electricity,
save current,
sleep mode,
switch off
Story With a Moral
A woman came out of her house and saw 3 old men with long white beards sitting in her front yard. She did not recognize them. She said "I don't think I know you, but you must be hungry. Please come in and have something to eat." "Is the man of the house, home?", they asked.
"No", she replied. "He's out."
"Then we cannot come in", they replied.
In the evening when her husband came home, she told him what had happened.
"Go tell them I am home and invite them in!"
The woman went out and invited the men in"
"We do not go into a House together," they replied.
"Why is that?" she asked.
One of the old men explained: "His name is Wealth," he said pointing to one of his friends, and said pointing to another one, "He is Success, and I am Love." Then he added, "Now go in and discuss with your husband which one of us you want in your home."
The woman went in and told her husband what was said. Her husband was overjoyed. "How n ice!!", he said. "Since that is the case, let us invite Wealth. Let him come and fill our home with wealth!"
His wife disagreed. "My dear, why don't we invite Success?"
Their daughter-in-law was listening from the other corner of the house. She jumped in with her own suggestion: "Would it not be better to invite Love? Our home will then be filled with love!"
"Let us heed our daughter-in-law's advice," said the husband to his wife.
"Go out and invite Love to be our guest."
The woman went out and asked the 3 old men, "Which one of you is Love? Please come in and be our guest."
Love got up and started walking toward the house. The other 2 also got up and followed him. Surprised, t he lady asked Wealth and Success: "I only invited Love, Why are you coming in?"
The old men replied together: "If you had invited Wealth or Success, the other two of us would've stayed out, but since you invited Love, wherever He goes, we go with him. Wherever there is Love, there is also Wealth and Success!!!!!!"
MY WISH FOR YOU...
-Where there is pain, I wish you peace and mercy.
-Where there is self-doubting, I wish you a renewed confidence in your ability to work through it.
-Where there is tiredness, or exhaustion, I wish you understanding, patience, and renewed strength.
-Where there is fear, I wish you love, and courage.
"No", she replied. "He's out."
"Then we cannot come in", they replied.
In the evening when her husband came home, she told him what had happened.
"Go tell them I am home and invite them in!"
The woman went out and invited the men in"
"We do not go into a House together," they replied.
"Why is that?" she asked.
One of the old men explained: "His name is Wealth," he said pointing to one of his friends, and said pointing to another one, "He is Success, and I am Love." Then he added, "Now go in and discuss with your husband which one of us you want in your home."
The woman went in and told her husband what was said. Her husband was overjoyed. "How n ice!!", he said. "Since that is the case, let us invite Wealth. Let him come and fill our home with wealth!"
His wife disagreed. "My dear, why don't we invite Success?"
Their daughter-in-law was listening from the other corner of the house. She jumped in with her own suggestion: "Would it not be better to invite Love? Our home will then be filled with love!"
"Let us heed our daughter-in-law's advice," said the husband to his wife.
"Go out and invite Love to be our guest."
The woman went out and asked the 3 old men, "Which one of you is Love? Please come in and be our guest."
Love got up and started walking toward the house. The other 2 also got up and followed him. Surprised, t he lady asked Wealth and Success: "I only invited Love, Why are you coming in?"
The old men replied together: "If you had invited Wealth or Success, the other two of us would've stayed out, but since you invited Love, wherever He goes, we go with him. Wherever there is Love, there is also Wealth and Success!!!!!!"
MY WISH FOR YOU...
-Where there is pain, I wish you peace and mercy.
-Where there is self-doubting, I wish you a renewed confidence in your ability to work through it.
-Where there is tiredness, or exhaustion, I wish you understanding, patience, and renewed strength.
-Where there is fear, I wish you love, and courage.
Labels:
love,
Love-courage-success,
Story With a Moral,
wife
Tuesday, June 26, 2007

I have found one thing today......
In netbeans Why there is GTA.form file ?
When we click new GUI java code then GTA.form and GTA.java files are created.
This GTA.form file is used to store what are the components and where they are placed.
There is option in netbeans to see CODE or DESIGN. When design is clicked GTA.form file is accessed and using it GUI is drawn and shown by NetBeans.
Yours,
D.Ravikumar MCA.,
--Your dreams have value.
Subscribe to:
Posts (Atom)

