In bed, Its 6 AM you close your eyes for 5 min and its 7:45
At school its 1:30; you close your eyes for 5 min and its 1:31
In bed, Its 6 AM you close your eyes for 5 min and its 7:45
At school its 1:30; you close your eyes for 5 min and its 1:31
Looking at ResultSetMetaData api below was my first approach to the problem.
private static String getColDbType(Connection conn, String table, String col) throws Exception {
String query = " select * from " + table + " where 2='9999'";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
ResultSetMetaData rsmd = rs.getMetaData();
try {
for (int i = 1; i < rsmd.getColumnCount() + 1; i++) {
String columnName = rsmd.getColumnName(i);
if (columnName.equals(col)) {
String s = rsmd.getColumnTypeName(i);
if (s.equalsIgnoreCase("varchar")) {
s += "(" + rsmd.getPrecision(i) + ")";
}
return s;
}
}
return null;
} finally {
rs.close();
stmt.close();
}
}
However the column sizes were not accurate; googling helped me understand that ResultSetMetaData is in the context of the result set returned by the query and it need not reflect the actual table details. So below is the 2nd approach that finally worked. Tried this with MySQL 5.x db instance
private static String getColDbType(Connection connection, String table, String col) throws Exception {
DatabaseMetaData metadata = connection.getMetaData();
int i = url.lastIndexOf("/") + 1;
String schema = url.substring(i);
ResultSet resultSet = metadata.getColumns(connection.getCatalog(), schema.trim(), table, col);
while (resultSet.next()) {
String name = resultSet.getString("COLUMN_NAME");
String type = resultSet.getString("TYPE_NAME");
int size = resultSet.getInt("COLUMN_SIZE");
if (type.equalsIgnoreCase("varchar")) {
return type + "(" + size + ")";
}
return type;
}
return null;
}
In middle of difficulty lies the oppurtunity
-Albert Einstein
--
Worry doesnt empty tomorrow of its sorrow;
it empties today of its strength
--
Success seems to be largely a matter of hanging on after others have let go
--William feather
Some people come into our lives and quiickly go,
Some stay for a whhile and leave footprints on our hearts
And we are never ever the same
-QuoteXite.com
Don't expect your genius to be discovered; do what you must do because it gives you joy
-From my friends g-tak status message
Night is a wonderful opportunity
to take rest,
to forgive,
to dream,
to smile and
to get ready for all the battle that you will forgive tomorrow night!!!
-- face book; shared by an old friend of mine
stand for what is right even if you stand alone
--by a fan on Hessler's Facebook page
All dreams are crazy until they come true !!!
When people walk away from you let them go…
your destiny is never tied to anyone who leaves you and it doesnt mean they are bad…
it only means their part of story in your life is over.
"If heaven isn't white, shiny and beautifully designed, it will be now”
--Courtesy Twitter... RIP Jobs...
No i wont! why? because i like andhra regions? Or because i love to see the state united? Or do i think telangana is very well developed that the jist of the moment is missing? NO. None of these!
At the core of this movement is the statement that Andhra guys are over ruling us/ Andhra is plundering our wealth/ Andhra guys are diverting our resources to them. Might be/ Might be not! I wouldnt debate on it. Recently when i came home my sister told they brought down our scluptures on tank bund. I felt so bad. I thought atleast one T guy would come forward saying they shouldn’t have done it. The incedent is very unfortunate. But to my surprise there wasnt even on such statement made. I was shocked. I felt like the complete T supports this.
This is very bad. According to me somebody doing mistake doesn’t give u the chance to do another mistake. If at all u dont agree then i would classify it as animal instinct. I somehow feel the movement is not healthy; the very base line itself.. i dont agree.. added the million march where they bring down the idols.
Today i am early to home from office (@8 pm or so); I enjoyed it so much.. may be because such occasions hardly come?? i dont know.. I saw NGC/ discovery to my hearts content.. and finally few minutes back landed on face book to check the status… I feel so happy.. i feel so relieved.
@Office, things seem chaotic.. i was assigned an assignment.. and when i question back for clarifications.. i see pple are pissedoff… so i thought i will rather leave it there.. let them really fall short of time and then i will start off with the work.. whats the fun in proactively doing when there is nobody to appreciate it?
When ever i get some free time.. i just think.. what can i do now? i dont want to go after pple and ask for work.. can i investigate someting… do i remember something which i thought i will revisit in my past? should i surf for something??? infact this is how i discovered the google reader ( one of my fav and every day viewer).. i go around and check what others are doing/ up to…
Thats all for now… time to go to bed.. need to getup early tomorrow.. its Dusshera. Did i say this.. this time the festival is not lively.. its sad.. on one side the APSRTC is on strike.. govt already warned them they wouldnt get bonus/ they wouldnt be paid for the days they are on strike.. inspite of that they are on strike.. but why??? nobody knows! neither they comeout and declare their demands.. seems very un-healthy! State govt employees are also on strike.. and i heard they are repenting for loosing their Dushrrea bonus and 1/2 month salary.. but not sure if they are continuing on the strike. I am not sure how this will end finally.
Every one is a genius
but if u judge a fish on its ability to climb a tree,
it will live its whole life believing it is stupid
-A Einstein
In a day when u dont come across problem –you can be sure that ur travelling in a wrong path
--swami vivekananada
My road to success is always under construction
Alcohol doesnt solve ur problem, but if u think again neither does milk
Every one has a scheme of getting rich which never works untill u cheat
If at all u dont succeed, destroy all the evidence that u ever tried
Once u have bought something, u will find the same item being sold else where at a cheaper rate
You will pickup the max wrong numbers when u r in roaming
irrespective of the direction of the wind the smoke from the smoker will always follow the nonsmoker
Maintain silence, keep ur phone in Manmohan mode!!
Framing is the process that truly confirms the Biblical statement: “As a man thinketh in his heart [Hebrew for mind] so is he.” If you think of your mind as a playground for ideas – it will be. If you think of it as a prison – it will be.
Silence is one of the hardest arguments to refute
We can use apache to serve static resource; infact apache is meant for this. Apache can cache data so that accessing resources is very quick. Proxy pass is the best way to do this.
<VirtualHost *:80>
ServerAdmin abc@y.com
DocumentRoot /root/cacheContent
<IfModule rewrite_module>
RewriteLog logs/rewrite.log
RewriteLogLevel 3
</IfModule>
ProxyRequests off
ProxyPass /context/css/ !
ProxyPass /context/ http://10.10.11.176:8080/backendContext/
ProxyPassReverse /context/ http://10.10.11.176:8080/backendContext/
CacheEnable disk /
CacheEnable mem /
<IfModule mod_cache.c>
<IfModule mod_disk_cache.c>
CacheRoot /root/cacheContent/
CacheEnable disk /
</IfModule>
</IfModule>
</VirtualHost>
So this is how it works. When ever u get /context on this ip send it to 10.10.11.176/backendContext. When ever u have static resources dont get it from the bakendContext. So in this case it gets it from /root/cacheContext/.
Some people make the world happen;
More watch the world happen;
Most wonder what happened.
Its your choice,
Which group you want to belong to.-prasworld.com
As long as I know myself to be a coward I shall be unhappy.
L. Frank Baum (1856-1919)
At times when debugging ORMs lke hibernate we may need to know what queries are actually hitting the db. MySql gives an easy way to do this. Add the below in the my.cnf file
at times when u import the db it may erase ur userid and pwd. When the java tries to connect to the db it throws exception that this ip is not allowed to connect to the db; in such a case use the below fix. it removes the necessity to have userid and pwd to loginto the mysql
be careful that u dont do this on production dbs
This is generally the case when u try to import a database from a dump. The fix is to increase the max_allowed_packet size follow the below steps
This should do.
suppose we want to search for a string “abc” in a file then we use
grep “abc” /path/to/file/file.txt
but what if u want to search for either “abc” or “xyz”? u need to grep twice. instead use egrep
egrep “abc|xyz” /path/to/file/file.txt
the best use of egrep comes in when we tail a file and want to search for a set of strings in the tail eg:
tail –f /path/to/file/file.txt | egrep “abc|xyz”
getSession() –> the java doc says it will create a new session/ continue with the existing one based on getHibernateTemplate().setAllowCreate(…); set to true/ false.
How ever, i found the things to be diffarent. I had a 2 DAOs one executing: getHibernateTemplate().find(..); the other using getSession().createCriteria(..); They are wrapped by the same transaction interceptor. What i found is when the 2nd DAO runs the hibernate throws illegal state exception.
Why?? The getSession() always tries to crate a new session, if the setAllowCreate is set to false, then it throws illegal argument exception. Why this devaiation??? as always only god knows it.
To get the current session in 2nd DAO, i found the fix: getHibernateTemplate().getSessionFactory().getCurrentSession(); and things went off very fine.
Recently i had to do a query as:
select * from t_table where (t.a=’a’ and t.b=’b’) or (t.a=’aa’ and t.b=’bb’). One way to get over this is via HQL query… which i hate.. i wanted to do it using criterias… finally Conjunction and disjunctions came for resque. Below is the code.
Session session = getSession();
try {
Criteria crit = session.createCriteria(Table.class);
Disjunction conMerOrs = Restrictions.disjunction();
for (AB ab: ABList) {
Conjunction ands = new Conjunction();
ands.add(Restrictions.eq("a", ab.a()));
ands.add(Restrictions.eq("b", ab.b));
ors.add(ands);
}
crit = crit.add(ors);
return crit.list();
} finally {
session.close();
}
let me know if it helped
I hate using non-licensed tools. generally when it comes to code generation for Hibernate, pple tell of myeclipse; and heres the way to do it. Myeclipse usage requires licenses; so this is how pple get around it –uninstall it just before the trial expires and reinstall it again.
I hate all this crappy stuff and wanted a clean way to do it. I have used eclipse helios for this and guess it would work for other eclipse versions as well
Now the hibernate plugin is installed. Below i tell the steps to auto genrate the code
Now the qn: why did they build the plugin so complicated? why not have it a siimple one? all of it done in a wizard??? i donk know…
let me know if it helped you.
Below is the table def that caused the problem:
CREATE TABLE IF NOT EXISTS `T_ABC` (
`id` INT NOT NULL AUTO_INCREMENT ,
`source_col` int NOT NULL ,
PRIMARY KEY (`id`) ,
INDEX `fk_src_col` (`source_col` ASC) ,
CONSTRAINT `fk_src_col`
FOREIGN KEY (`source_col` )
REFERENCES `parent_table` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
and on execution it was giving the error ERROR 1005 (HY000): Can't create table schema.T_ABC.frm
The fix to issue is: that parent_table.id is of bigint type, while this table foreign key is only int; when i changed the source_col from int to big_int things went well.
hope this helps somebody.
So the problem stmt is as follows
Criteria criteria = getSession().createCriteria(CompositeKeyEntity.class);
criteria = criteria.add(Restrictions.in("id.subKey", list));
List<CompositeKey> list = criteria.list();
Let me know if it helps.
Why do we sometimes write 'etc' at the end in the exam?
bcoz it means...
E-End of
T-thinking
C-capacity.
-----------------------------------------
Wht is the Diff b/w
Young Age & Old Age?
*
Simple..
In Young Age
Phone Is Full Of Darlings Numbers..
In Old Age
Its Full of Doctors Numbers..!-
-----------------------------------------
How to Create d Biggest Doubt in ur Wife's Mind 4 u?
?
?
?
?
?
Just Suddenly send her SMS Saying..
"I Luv u too"
GAME OVER.!
-----------------------------------------
When do you knw ur in love?
Ans. When you start searching for the cheapest mobile plan
-----------------------------------------
"Why is Facebook such a hit?
It works on the principle that-
'People are more interested in others life than their own!
-----------------------------------------
A Ques Asked In A Talent Test:
If You Are Married To 1 Of The Twin Sisters, How wud You Recognize Your WIFE?
The Best Answer
- Why d Hell Should I recognise?
-----------------------------------------
V Pronounce 22 as TwentyTwo, 33 as Thirty Three, 44 as FortyFour, 55 as FiftyFive, Why not 11 as TentyOne?
Doubt By last bench association...
-----------------------------------------
What is the diff. between"GHAZAL" &"LECTURE"?
Every word spoken by the girlfriend is "GHAZAL"and Every word spoken by wife is "LECTURE"
-----------------------------------------
What will be the girl's name born on 1st of APRIL? Guess Guess Guess Guess
"FOOLAN DEVI..
-----------------------------------------
Why does d bride & groom xchange garlands at d time of wedding..... B'coz they say each affectionately that :
"DARLING NOW U R DEAD"...........
-----------------------------------------
What is the height of confusion? Two earth worms Playing HIDE AND SEEK in a Plate full of noodles.
-----------------------------------------
Wat is d Biggest Benefit of having a crush in d same college where u study ?
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
100% Attendence... :-P
-----------------------------------------
QUES - Where can u see mangoes? On mango trees? NO.At fruit shop? WRONG
AGAIN....Fir kaha?
ANS - Jaha jaha women go,piche piche Man(goes).
-----------------------------------------
Teacher: What Is The Differnce HIMAMI & TSUNAMI ?
Tintu: HIMAMI is Face Wash,
TSUNAMI is Total Wash.!
-----------------------------------------
Difference between Friend & Wife
U can Tell ur Friend
“U r my Best Friend”
But
Do u have courage tell to ur Wife
“U r my Best Wife?”
-----------------------------------------
Wats d diff btwn Pongal n idly? think.think..think...
U ll get a holiday for pongal but not for idly
If you are not laughing at yourself, then you just didn't get the joke.
Firefox was/ is my fav browser. I was using it extensively 2 years after google chrome was introduced and wanted to stick to it. I love the addons -delicious/ diigo. However when my company changed something on proxy i was smoked out of firefox due to its weird certificate issue. Every time it asks u and how manyever times u permanantly add the cert it only adds it temporarily. HUH! every day morning i used to manually permanantly add them and after 6 months of this mundane rediculous exercise i moved out to google chrome.
I keep track of new releases in FF; and keep checking if the above issue was fixed. Today i got the latest one 4.0 (not beta version); now delicious doesnt work; googled and googled and then got it working in compatibility mode; now i dont see book marks; 15 min of browsing and i see some weird issues with webpages; certificate issue is, however, still there ( i dont know who the idiot had coded to make the permanatly add cert as temporary and how firefox still keeps the bug unfixed)
I think Firefox is heading towards death. Heard that google pulled off from funding it. What ever be it.. i am deeply sorry for whats happening to it.
today i removed my mustach and am observing for feedback; I liked it as i feel little cold under the nose; My mom (this time) wasn't shocked she just smiled and left; father asked me to grow them back; @ office one of my colleague asked me to continue this way he said "when i scraped of my mustach; i looked like a chakka (50-50); but dont worry.... slowly pple will get used to it.. continue this way.. " wow! i liked it... lets see how it goes.
Few days back i happend to visit a temple.. some interesting stuff i found on its walls..
quite interesting nah?
Its very bad/ undigestable of TLeaders for breaking the sculptures of Nannayya, Tikkanna, Yarrapragada, Srikrisha devaraya, Molla. What do they want to convey by this?
Sir Arthur Koton built 'Prakasam Barriage' on river Godavari saving the place from famine/ floods. Pple out there even today praise him (infact have his name in daily pooja -Sandhya vandanam). They recognize his helping hand and dont hate him as the British Monarch.
These great pple have given an image to India;Ramayana and Mahabharatha are still the top epics of the world and are known for their skill; they have given identity to Telugu pple. Shouldnt we respect them? How far is it correct to see them as Lords who plunder Telengana assets?
I was concerned till today of the TMoment and some where had a soft corner.... But now i feel 'its better give off the state... or else what else will we have to see down the time?' I am ashamed & embarrassed!!!
Update:: Asked to comment on police failure to save the statues, DGP K Aravinda Rao said: "We did not want to use force as it could have aggravated the situation."
The other day a tollywood hero was on news and a channel was telling abt a site ihateABCD.com where the site owner created some spoof images of this hero and his immediate friends. In fact the channel showed some of the images as well.. they were sooo funny... i burst out in laughter.. It sems the hero reported and the site is closed..
I see somuch of hatered among people on this guy, his movies.. the kind of stupid/ foolish/ serious/ silly/ things he does which leaves the audiance in shock unable to digest them.. eg: praying the god and reversing a moving train using his meditation powers.... crawling a mountain in few minutes to save a rabbit from an eagle... jumping from 15th floor with out paracutes landing on pillows.. etc etc...
Every time i open the net, i first search for such stuff to figure out what other pple think abt the heros.. their coments on them etc... but why? just like that!
A closed mouth catches no flies.
-Let me put an experience in this context: once i ran into problems with my neighbor here at office. I was severely agitated; i wanted to rebel back and protect my ego, but at the spur of the moment, as always, i went silent and started thinking of a better solution. That evening i called up my friends and one of theirs suggestion : stay calm; dont react impressed me the most. I obeyed it for the next 7 days and then felt so releived. Today somehow i remembered the incident and hence the quote. ;)
Yesterday was Mahasivaratri. I surveyed and found only one person (out of 8) is fasting and keeping awake all the night. Today i see the cubilles empty :D and i am the first guy to be here.
Today morning i thought of coming very late under the pritixt that even i was awake; moreover i guess pple will not expect us to be here on time as well. However I was ready, as anyother day, and didnt want to stay home just to be late. Even though its the working day i think people will be only 50% productive today; then why not the company declares today a holiday? worried of the work? when things are pressing we anyhow stay late nights/ work on the weekends (so the work wouldnt really suffer)
I have learned that the greater part of our misery or unhappiness is determined not by our circumstance but by our disposition.
They can conquer who believe they can!
When u loose every thing, you can do anything, (read few days back on net!)
The big party wants to proove people have faith in them and so called for a bandh today and tomorrow.
The roads are all empty, i havent touched the brake at all, infact i started 15 min late and reached 15 min early to the office. Wow! I remember an incident from my childhood wherein telugu class we all said we are happy for the bandh... things are soooo smooth/ cool. To this my teacher (Somanna sir) responded: "There are many people who make their living from the public; like autorickshaw, kooli, masons, busses agents etc. They all loose their living because of this bandh. You and i are happy but their is other side of the coin aswell which we generally ignore to see." isnt it true? ofcourse it is!
While coming i could see atleast one police vehicle for every 400 meters. Atleast 6-10 constables at every vehiche waiting for instructions. As i see/ understand the most important thing is life. Here, atleast in India a person is very important to the family and his loss cannot be filled. A lot of care is being taken by the govt/ police; I see how much they value the human life.
btw i m against bandhs/ raastha rokos. :)
When life's problems seem
overwhelming, look around and see
what other people are coping with.
You may consider yourself fortunate
in continuation to my previous post.. this is what i see on todays AndhraJyothi (local news paper)
<english> See driver, dont come with me into assembly and un-necessarily dont go to jail </english>
btw: the driver who hit JP is in remind @hyderabad jail now. Why not the MLA who also did the act? i dont know...!!!
This is in the context of the behavior exibited by our leaders at Assembly.
JP is my favourite leader. I haven't heard a speach from him with a mistake/ him personally pointing at a person/ scolding a person or a grouup of persons/ what ever. I follow him very closely on the news channels and often hear appreciations to him from the common man when they make the phone calls. Some of the ideas from his party/ himself are so thought provoking and revolutionary. As the context has come let me cite some examples.
TTD had organized a meeting for ideas to clean up the 7 hills from plastic and keep it hyginic. The so called BIG political parties started poiniting mistakes.. "so and so comission had recomended something and ur govt didnt do it.. its because u dont want the place to be developed.. ur leader is at fault." Immediately the other one took over the mic and started shouting the first partys mistakes and hence they are not eligible to question them. WOW! see the logic. "You doing the mistake certifies me to do another and hence u cannot question me back". isn't it fentastic? Now JP party interrupted and said "lets not scold each other. My points are as follows. Lets make every step of Tirumala an auspicious place, may be by putting idols at various points and people will automatically get aware and stop throwing the garbage. Instead of concentrating on how to clean the garbage, lets see how we can stop it at the first place". The TTD chairman shook his head in agreement and the memebers smiled showing their acceptance.
There are many such cases i can narrate... Even on the separate state he was very clear on his stand and explained the real impact on the common man if at all the state is formed. I dont think he should be condemned for it. He is using his right to speach.
The most disgusting thing happend yesturday: The MLAs started breaking the mics, stopping the governer from continueing, beaking the chairs, protesting openly... (Ok this is not the disgusting thing i was referring.. its generally seen around) and JP was very unhappy in the way they approached the problem and expressed his disgust to the press. After his speach one of the BIG party MLA beat him, most importantly his driver also joined in hitting JP; some BIG party MLAs encouraged them.. This is very very bad. You are stopping a person who represents people of a region from expressing himself; and an MLA who swore to go by constituion shuldnt be doing this.
JP was very calm and nice at the interview in a news channel. In this context i express my appreciation to JP for the way he reacted and discontent to the MLA who did the unfortunate act.
A Post read as follows
London, Feb 17 (IANS) Apple founder and CEO Steve Jobs has terminal pancreatic cancer and may live for just six more weeks, a media report said Thursday.The 55-year-old Jobs in January announced that at his request, the board of directors granted him a medical leave of absence so that he could focus on his health.Since then, employees have said Jobs can still be seen at the company's headquarters in California and is also calling all the strategic shots from his home.Now, new pictures have been published in the tabloid National Enquirer, which suggest things may be worse for the the man behind the iPod, iPhone and iPad.The report said Jobs is stricken with pancreatic cancer and may have just six weeks to live.
I wish some miracle to happen and he survives the disease.
people are dying around cricket... yest i read some 300 cr rupees of betting is estimated around this game in india. The cricketers are actively participating in all telivision advertisements to the extent possible.. kids, youth or to be more accurate all hyderabadies are flocking onto the grounds to play cricket... all colleagues/ friends/ relatives/ news papers/ magazines/ editorials/ hard talks on TV etc etc are all talking about one game: cricket. Even CWG games (inspite of the scams around it) didnt gather somuch of fuss around... cricket is like god in India.
It seems like we have only one game in this world.. and I fell if at all india wins the world cup this time... it seems like nuclearbomb hit Hiroshima and nagasaki of japan. The victory will sweep off all other games and i guess for the next 1000 years it will be only cricket in our minds/ grounds/ what not.
I remember a lesson from my 6th standard.. in which he tells if left leg/ right hand only grows... then its not seen as growth but as disease.. arent we getting into a similar scene now?
We first make our habits, and
then our habits make us."
The greatest things ever done on Earth
have been done little by little.
Yesterday.. the day was great! As usual i woke up late.. went to my friends place.. there we danced and danced and danced.. till we were completely tired/ drenched in sweet. It was sweet/ great!. I haven't noticed the day pass off and it was just like that... i was home at 2pm and was sooooo tired... just fell on bed and slept till evening 7pm. It was very refreshing when i woke up.. ate a little .. went to another friends place and was back by 8:30pm. Did some work at home.. then dozed to sleep on the floor.
The day was great! all hard work.. I worked hard and relaxed great.. i just loved it. I enjoyed the most to the fullest.. Wish the next weekend also to be the same..
till the reality strikes.. Adios,
Google appspot is now unblocked at my office.. i m so exited; lets see what new things i can do ;D
two software engineers meet on a road,
two beggers meet on a railway station;
both have one dialog in common; what is it????
..
..
on what platform are u working... :D
Yesterday evening i had this argument with my friend
He: if u see the last 1000 years or more its the muslim kings that ruled the country. they why are muslims still the minority in India?
me: Hinduism survived their rule.
He: how?
me: inspite of them forcing people to change religion and their rigorous steps towards it, people still had faith in Hinduism that had kept this religion alive and in-fact we are still the majority for the same reason.
he: nice;
-----
Recently I am seeing the way Christianity is spreading in India. Its very in-ethical of the Fathers but yes an intelligent one. I had been to the village Vedurupaaka where i met an auto driver; on enquiring figured out he had recently converted to Christianity; Same is the case in my fathers office –one of the servants their converted to Christianity. I was inquisitive and enquired why they are converting. The answers i get is: “we are paid 25,000 Rs on conversion. We get free education in catholic schools/ colleges; free books clothes”. Wow! What a deal. Who on earth wouldn’t be attracted to this?
I was wondering how religious heads encourage such behavior? Isn’t this very in-ethical? aren’t they supposed to be untouched by worldly things? things like Christianity is the minority? and if they are doing this can we call them the religious heads? If people want to convert they should see credit in the new religion and hence change. It shouldn’t be by money/ some luring.
HUH! Lets see how far this religion percolates into the society.
It is your life, be your self....!!!
--seen on a bike in traffic today morning :)
<html>
<style>
*{margin:4px;}
</style>
<script>
function loaded(){
var cont = document.getElementById("containerId");
var e1 = document.getElementById("heading1");
var e2 = document.getElementById("heading2");
var e3 = document.getElementById("heading3");
//h1= 2+e1.offsetHeight + e1.style.paddingTop + e1.style.marginTop;
alert("moving up:; "+ e1.style.height);
//e2.style.top=-h1;
removeDiv(e1,9999);
}
function removeDiv(e,currheight){
var newHeight = parseInt(e.offsetHeight/1.5);
e.style.overflow='hidden';
if(newHeight < currheight){
e.style.height=newHeight;
}else{
e.style.display='none';
return;
}
setTimeout(function(){removeDiv(e,newHeight)},50);
}
</script>
<body onload="loaded()" >
<div style="position:relative;display:auto; border:black 1px solid;overflow:auto;height:auto;"id="containerId">
<div style="position:relative;border:red;padding:5;">
top one heading
<div id="heading1" style="position:relative;border:purple 1px solid; top:2px;widht:100%;background:red;">
<ul>
<li>one </li>
<li>one </li>
<li>one </li>
</ul>
</div>
</div>
<div id="heading2" style="position:relative;border:purple 1px solid; top:2px;widht:100%;">
<ul>
<li>two </li>
<li>two </li>
<li>two </li>
<li>two </li>
</ul>
</div>
<div id="heading3" style="position:relative;border:purple 1px solid; top:2px;widht:100%;">
<ul>
<li>theree </li>
<li>theree </li>
<li>theree </li>
<li>theree </li>
</ul>
</div>
</div>
</body>
</html>
_______________________________________________________________________________