Global Warming




Posted by
balakrishnan
at
11:32 PM
4
comments
Labels: Global Warming
Posted by
balakrishnan
at
10:26 AM
0
comments
Labels: Kamal
Many of us face the problem of breaking the string which is dynamically generated, in html / jsp.For example the following the code will give you the problem of not wrapping the sentence in the table cell.
<table><tbody><tr><td>Name:</td> <td>BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN; </td></tr></tbody></table>
The reason is html engine wraps the content when there is a space in between the words. To avoid this just add this style in your table cell style="WORD-BREAK:BREAK-ALL;"
Modified code is
<table><tbody><tr><td>Name:</td> <td style="WORD-BREAK:BREAK-ALL;"> BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN;BALAKRISHNAN; </td></tr></tbody></table>
Posted by
balakrishnan
at
3:15 AM
0
comments
Labels: JSP
Whenever i implement a seializable interface to my class it gives me a warning to add a SerialiazableUID. I just add it with default value to make my class looks no warning message in eclibse IDE. I thought that this id will be useful in deserializing. So i tried an example to find out the real purpose for this id.
Consider this basic Employee view Class with one private varialble name..
package Serializable;
import java.io.Serializable;
public class EmployeeView implements Serializable {
private String name;
public String getName() {
return name;
}
public void setName( String name ) {
this.name = name;
}
}
Then i write a class to serialize this class
package Serializable;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class SerialiaztionTester {
private static String fileName = "SerTest.txt";
public void writer() {
ObjectOutputStream out = null;
FileOutputStream fos = null;
EmployeeView e = new EmployeeView();
e.setName( "bala" + System.currentTimeMillis() );
System.out.println( "In Writer Employee Name is " + e.getName() );
try{
fos = new FileOutputStream( fileName );
out = new ObjectOutputStream( fos );
out.writeObject( e );
out.close();
}
catch ( Exception ex ){
ex.printStackTrace();
}
}
public void reader() {
ObjectInputStream in = null;
FileInputStream fis = null;
try{
fis = new FileInputStream( fileName );
in = new ObjectInputStream( fis );
EmployeeView e = ( EmployeeView ) in.readObject();
in.close();
System.out.println( "In reader employee name is "+e.getName() );
}
catch ( Exception ex ){
ex.printStackTrace();
}
}
public static void main( String a[] ) {
SerialiaztionTester test = new SerialiaztionTester();
test.writer();
test.reader();
}
}
In writer method just serialize my EmployeeView class to a SerTest.txt file. And in reader method just deserialize my EmployeeView class. Hope you guyz know what is serialization and deserialization. Just for reminder,
Object serialization is the process of saving objects state as a sequence of byte for rebuilding the objects original state at a future time. Rebuilding the object from this sequence of bytes is called deserialization.
when you run the above code you got the following output
In Writer Employee Name is bala1183102973513
In reader employee name is bala1183102973513
Now i am just writing the object,
public static void main( String a[] ) {
SerialiaztionTester test = new SerialiaztionTester();
test.writer();
// test.reader();
}
output is
In Writer Employee Name is bala1183103114211
Adding a new variable age and setter , getter methods in employee class
package Serializable;
import java.io.Serializable;
public class EmployeeView implements Serializable {
private String name;
private int age;
public String getName() {
return name;
}
public void setName( String name ) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge( int age ) {
this.age = age;
}
}
then i call the reader method from the main class without writing. keep in mind that when i serialized my class which consists of only name variable. now it has name as well as age variable
public static void main( String a[] ) {
SerialiaztionTester test = new SerialiaztionTester();
// test.writer();
test.reader();
}
My output for this
java.io.InvalidClassException: Serializable.EmployeeView; local class incompatible: stream classdesc serialVersionUID = 6513632082659324604, local class serialVersionUID = -6641931785738549045
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:459)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at Serializable.SerialiaztionTester.reader(SerialiaztionTester.java:35)
at Serializable.SerialiaztionTester.main(SerialiaztionTester.java:47)
From the error itself you can easily have an idea why this error is occured
java.io.InvalidClassException: Serializable.EmployeeView; local class incompatible: stream classdesc serialVersionUID = 6513632082659324604, local class serialVersionUID = -6641931785738549045
Whenever you implement the serialiable it will be assigned a serialVersionUID by default. This unique id should be match when you are deserialzing the object.
To avoid this you can assigned a SerialVersionUID like this
package Serializable;
import java.io.Serializable;
public class EmployeeView implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private int age;
public String getName() {
return name;
}
public void setName( String name ) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge( int age ) {
this.age = age;
}
}
Now whenever you change or add a variable it wont throw any exception until unless you remove the implementation Serializable.
Want to know more about Serialization check out this article
Posted by
balakrishnan
at
6:30 AM
0
comments
Labels: JAVA
Though i have two years of experience as a software engineer, i have never ever written a oracle procedure, function etc.... These things are handled by my onsite client. So i didn't get the chance to write those. Now-a-days i have find time to read. I use this time to read those things, As usual i would like to share the learning with you.
My first oracle block:
Assume that emp is the table which has two columns. 1. employee_id and 2. employee_name
SQL> declare
2 employee_id emp.EMPLOYEE_ID%Type;
3 cursor emp_cursor is select * from emp;
4 begin
5 open emp_cursor;
6 fetch emp_cursor into employee_id;
7 dbms_output.put_line(employee_id);
8 close emp_cursor;
9 end;
10 /
Good. I love to get the error, Then only i can learn too many things.
fetch emp_cursor into employee_id;
ERROR at line 6:ORA-06550: line 6, column 1:
PLS-00394: wrong number of values in the INTO list of a FETCH statement
ORA-06550: line 6, column 1:
PL/SQL: Statement ignored
Now we will analyse the code.
First thing is declaring a cursor ( cursor emp_cursor is select * from emp ) which fetch all the columns of the emp table.
Now i want to fetch the column into employee_id ( fetch emp_cursor into employee_id ). But here emp_cursor has two columns, the first column Employee_id of emp is assigned to employee_id but the Employee_name is not yet assigned to any value. This throws PLS-00394: wrong number of values in the INTO list of a FETCH statement
So PL/SQL Statement ignored.
This is the modified code for the above program,
SQL> declare
2 employee_id emp.EMPLOYEE_ID%Type;
3 cursor emp_cursor is select employee_id from emp;
4 begin
5 open emp_cursor;
6 fetch emp_cursor into employee_id;
7 dbms_output.put_line(employee_id);
8 close emp_cursor;
9 end;
10 /
Here i have selected only employee_id as cursor.
Note :
I got this PLS-00225: subprogram or cursor 'EMP_CURSOR' reference is out of scope error when i tried to call the fetch emp_cursor.employee_id into employee_id; Cursor is nothing more than a pointer to a piece of memory
To resolve this error we have to declare a variable which is same as cursor's rowtype
SQL> declare
2 employee_id emp.EMPLOYEE_ID%Type;
3 cursor emp_cursor is select employee_id from emp;
4 emp_val emp_cursor%ROWTYPE;
5 begin
6 open emp_cursor;
7 fetch emp_cursor into emp_val;
8 dbms_output.put_line(emp_val.employee_id);
9 close emp_cursor;
10 end;
11 /
By doing this we dont mind about how many columns will be fetched by cursor. If multiple columns are fetched then we would be able to reference them via emp_val variable.
Posted by
balakrishnan
at
7:07 AM
7
comments
Labels: Oracle
Would you like to have a software which will be helpful to find out when you lost your mobile?
"Guardian" is the new antitheft system for Symbian Series 60 devices. Whenever you switch on your mobile phone this software ask for authentication of the inserted sim card. If authentication fails for the inserted sim card then this software send a SMS message to your predefined telephone no which you have configured during the installation of the software.
Guardian is free to download.
The following Mobiles are compatible with Guardian
Nokia: 3230 / 6260 / 6600 / 6620 / 6630 / 6670 / 6680 / 6681 / 6682 / 7610 / n70 / n72 /n90
Panasonic: X700 / X800
Samsung: SGH-D720 / SGH-D730
Lenovo: P930
Check out the below link to download Guardian
http://www.symbian-toys.com/guardian.aspx .
Posted by
balakrishnan
at
2:39 AM
0
comments
Labels: Mobile
Would you like to free up your cell phone bill?
mGinger.com pays you to read ads on your cellphone! These ads are only about your interests. Not only that, you get to decide when you want these ads.
Based on my calculations I can easily make enough money to free up my cell phone bill. Check out this Link
See how much you can make.
Have fun calculating...and sign up.
You will like it...
Posted by
balakrishnan
at
10:39 PM
0
comments
Labels: Earn Money
For those of you who use the Alt+Tab key combination to switch between open windows on your desktop, I am sure you have encountered times when you cannot distinguish one window from the other due to having more than one instance of the same program open.
Microsoft became aware of this draw-back after releasing the XP operating system and subsequently released a "Power Toy" to resolve this issue.
The Power Toy resolves this issue by replacing the program icons with actual screenshots of your open windows. This way you can locate exactly which window you wish to switch to, which is immensely useful when navigating between several SAP windows at one time.
Here are pictures of using the Alt+Tab key combination both pre- and post- installation of the Power Toy:

Here it is impossible to differentiate between the IE instances and the SAP instances by looking at the icons.

This screenshot clearly differentiates
the windows.
Here are the instructions to install:
-Click this Link
-Choose "Run" from pop-up dialog box
-Choose "Run" a second time, this will kick-off the installation of the Power Toy
-Once you get the "Installation Complete" dialog, the toy is successfully installed.
No need to reboot your PC.
There are lot of tools are available like this for windows. Check out this link
Posted by
balakrishnan
at
3:56 AM
0
comments
Labels: Microsoft
Posted by
balakrishnan
at
10:30 PM
0
comments
Labels: Google
Did you know that sexual activity can keep you looking good as
you age? Studies conducted in Sweden have shown that elderly
people who have sexual partners have much more vitality and a better
memory than those who do not.
So don’t let your golden years deprive you of the pleasures of
sex !
Just forget about the obsession of having to “perform” - the final
result is less important than the stimulation itself.
Posted by
balakrishnan
at
6:39 AM
0
comments
Labels: Health Tips
Without iron, there would be no hemoglobin in the blood.
Hemoglobin gives red corpuscles their color. And it is the
hemoglobin that carries oxygen to all parts of the body.
If you lack iron, an insufficient supply of oxygen in your
hemoglobin will produce sensations of fatigue, headaches and
shortness of breath.
Men don’t have to worry too much: most men have a reserve of
iron stored in their body that could last 3 years !
But women, because of the menstrual cycle, need twice as much
iron as men.
And the amount is even higher for pregnant women. Vitamin C
doubles the amount of iron the body absorbs: so it is a good idea to
add a glass of tomato or orange or grapefruit juice to every meal.
On the other hand, tea reduces the amount of iron absorbed by
50% and coffee by about 39%.
Posted by
balakrishnan
at
6:39 AM
1 comments
Labels: Health Tips
Research has shown that people whose diet is rich in potassium
(vegetarians for example) are less likely than others to develop high
blood pressure.
Calcium is also beneficial. Fortunately, potassium and calcium
are abundantly present in a large variety of foods.
Fruits, vegetables, beans, fish, fowl and lean meats are full of
potassium.
Calcium is a little more restricted. Foods rich in calcium usually
also contain large amounts of sodium and fat, which can increase
blood pressure.
However, moderate amounts of milk are recommended, as well
as yogurt, almonds, bananas, grapes, broccoli, potatoes, beans, tofu
and sardines.
Posted by
balakrishnan
at
6:38 AM
0
comments
Labels: Health Tips
Radical liberals are not a political group, but a kind of very
active molecule that is suspected of being one of the causes of cancer.
How can you protect yourself? Diet plays an important role here,
especially in the absorption of anti-oxidants. The strongest
anti-oxidizing agent is Vitamin E, which is found in wheat germ oil
and sunflower seeds.
Next comes Vitamin C (oranges, grapefruits, lemons, red peppers
etc.).
Beta carotene also absorbs large amounts of radical liberals.
This substance seems to act as a protecting agent against most types
of cancer.
Where do you find it? In red vegetables (like tomatoes), orange
ones (carrots), yellow (squash), and dark green (broccoli). All these
are rich in beta carotene. So make them a regular part of your menu!
Posted by
balakrishnan
at
6:37 AM
0
comments
Labels: Health Tips
First make sure you are sleeping enough.
Is your nutrition sufficient? In general women need at least 1200
calories per day and men 1500.
Avoid monotony: a varied diet will be more likely to provide the
nutritive elements you need to conserve your energy.
The sensation of fatigue may be stress-related, especially when
you experience emotional stress. Do you feel tense at work or at
home?
Lastly, don’t neglect physical exercise. Tired or not, get out in the
fresh air every day. Walking is the minimum effort necessary for
staying in shape.
Posted by
balakrishnan
at
6:36 AM
0
comments
Labels: Health Tips
Everyone has heard about how good a sauna feels, and of the
relaxing effect of a steam bath which bathes you in hot vapor.
But there are other heat treatments which are equally beneficial.
Heat relaxes the muscles and ligaments. When applied locally, for
example, with hot towels, it can ease muscle spasms. It can also
reduce arthritic pain. Heat dilates the blood vessels, which in turn
activates circulation.
Applied to a wound, it can prevent infection by helping white
blood corpuscles and fresh oxygen surround the area more quickly.
Posted by
balakrishnan
at
6:35 AM
0
comments
Labels: Health Tips
As much as possible, avoid coming into close contact with
infected persons, especially if they cough or sneeze.
A person with a cold is extremely contagious: he or she fills the
air with fine particles of saliva or mucous which transport the virus
microbe. Even if the person is careful to wipe his nose with tissue or
a handkerchief, the microbes will be transported to his hands.
And studies have shown that these viruses are transmitted through
hand contact. So if you have to shake hands with someone who has a
cold, you would better wash soon after!
What can you do if you do catch a cold?
It is useless to take antibiotics: they have no effect on viruses.
However, there are certain substances found in alcohol which help
decongest sinuses, that is why a good hot toddy can work wonders.
But take care of your liver: a toddy is just as good with a little rum as
with a lot.
You don’t have to get drunk to get better. You don’t even have to
drink it - just sniff some strong alcohol like cognac or brandy and
breathe in the fumes.
Posted by
balakrishnan
at
6:32 AM
0
comments
Labels: Health Tips
To reduce the intensity of menstrual symptoms, you can change
your diet:
· Less sugar, and slightly more protein.
· Diuretic foods such as eggplant, cucumbers and parsley can help
diminish water retention.
· Calcium supplements (1 gram per day) and magnesium (500
milligrams) can help reduce anxiety (always take both).
· Vitamin B-6 (not more than 50 milligrams per day) can alleviate
symptoms of anxiety and tension.
· Vitamins E and C also help reduce the intensity of cramps.
· Aspirin has a mildly soothing effect.
· And once again you can turn to plants to relieve your pains:
* ANGELICA in infusion: 3 1/2 tablespoons of root per quart of
water.
* MATRIX (derived from the Latin for womb): 2 teaspoons of
flowers per quart of water.
* MILFOI OR YARROW which soothes and reduces overly
abundant menstruation: about 5 1/2 tablespoons of flower tops per
quart of water.
* SAGE in infusion: I 1/2 tablespoons of dried leaves per quart
of water.
In extreme cases, ask your doctor for medication to alleviate
pain.
Posted by
balakrishnan
at
6:28 AM
0
comments
Labels: Health Tips
There is a plant for each type of digestion problem.
· AIGREMOINE is useful when the stomach problem is
accompanied by enteritis, diarrhea and/or chronic liver infection. It
helps tone a lazy digestive system. And it also helps regularize acidity
and soothe ulcers by improving metabolism. 3 or 4 cups a day. 3 1/2 to 4 tablespoons per quart of water.
· ANGELICA is a digestive, an aperitif, a stimulant, a tonic. It
decongests and soothes stomach pains and swelling.
Prepare an infusion (tea) preferably using the fresh plant: 3 1/2
tablespoons of roots per quart of water. If your stomach is very
swollen, prepare and drink 3 cups per day made of 5 tablespoons of
seeds per quart of water.
· ANISE is a soothing digestive. It aids digestion and the
elimination of intestinal gas, it soothes stomach cramps, aerophagy,
dyspepsia (contractions of the digestive organs, dizziness and a heavy
feeling after eating). 2 or 3 cups per day, after meals: 2 tablespoons of seeds per quart
of water.
· CAMOMILE: a digestive, sedative, anti-inflammation agent
and tonic. It helps painful or difficult digestion, stomach cramps,
gastro-intestinal spasms, loss of appetite, and it helps expulsion of gas
(carminative). Particularly recommended for persons who suffer from
stomach cramps (and/or who are irritable, temperamental, angry etc.)
One cup of infusion, a half hour before meals, or one hour after.
To prepare the infusion, add 5 1/2 tablespoons to a quart of boiling
water and let stand for five minutes.
· CHERVIL: digestive, depurative and diuretic. It also acts as a
stimulant. For difficult digestion, drink 2 or 3 cups per day. Prepare
an infusion with one teaspoon of dried leaves per cup of water, and
let stand for 10 minutes.
· SAGE: The ancients had a saying - “Why die when your garden
is full of sage!” It is a digestive, diuretic, antispasmodic and helps
combat hypoglycemia.
It stimulates the appetite, fortifies the stomach and aids digestion,
especially when digestion is difficult. It is also a general tonic. 2 or 3
cups of infusion per day. 1 1/2 tablespoons of dried leaves per quart
of water. (Practical Guide No. 6, Vol. II).
Posted by
balakrishnan
at
6:26 AM
0
comments
Labels: Health Tips
To reduce cholesterol:
· First cut down on saturated fats. To do this:
· Eat lean meat. Select lean cuts and ask your butcher to cut off the fat.
· Drink skim milk instead of whole milk.
Do the same for all dairy products. Note that vegetarians have a
much lower cholesterol level (almost twice as low as average) which
is perfectly understandable, since cholesterol is only found in
products derived from animals.
· Alcohol - in moderation. Not more than two glasses a day.
However, it does appear that drinking a moderate amount of alcohol
raises the number of HDL lipids (the good ones!), which break down
cholesterol. (Moderation = two 4 oz. glasses of wine or two 12 oz.
beers.)
· Do regular exercise, for example walking.
· Take Vitamin E. It reduces the risk of coronary disease.
· Calcium brewer’s yeast, Vitamin C and Vitamin B-6 also
combat the accumulation of cholesterol. And don’t forget lecithin,
which helps fight excess cholesterol, arteriosclerosis, hypertension
and angina (as well as psoriasis, anxiety and diabetes - and reduces
the likelihood of contracting cancer). Losing weight is a good way to
raise your HDL level.
· Use poly-unsaturated, non-hydrogenated, cold pressed oil: corn
oil, sunflower seed oil, soy, flax etc. A mono-unsaturated oil like
olive oil can even raise your HDL level.
· Daily consumption of fish would be ideal for preventing
cardio-vascular problems, as demonstrated conclusively in a number
of studies on fish-eating populations (Eskimos for example). Ideally,
you would eat fish twice a day. And as strange as this sounds, you
should select the fattest kinds: mackerel, sardines, herring, salmon etc.
As for the oil in the fish, it is used to treat arterial disorders. Its
effects can be felt in about six weeks. Fish oil contains two
poly-unsaturated fatty acids which are very beneficial for the arteries.
Posted by
balakrishnan
at
6:18 AM
0
comments
Labels: Health Tips