Thursday 29 April 2010

Found shared references to a collection hibernate

 Today when i was working on my project i saw a very strange bug saying "Found shared references to a collection hibernate" with a long stacktrace. After wasting a long time browsing through different sites. I started seeing the code, there i found a very small thing which solved my problem and it was that i initialized the variable before starting FOR loop and was trying to add multiple objects of the same memory reference again and again. For e.g.

ArrayList list = new ArrayList();
String str= new String("test");
for(int i=0; i
    list.add(i);
}
here you will get the same Found shared references error. Therefore i simply brougth the initialization into the FOR loop and it got resolved

Thursday 22 April 2010

Disable the parent page when thickbox opens using jquery

I faced a problem that when the thickbox opens i can still TAB through the links by pressing tab button despite the model=true and all the stuff i can do through thickbox. After searching long i found that this is the issue all thickbox like libraries are facing that they cant block their parent page while the child div is open. So i did a workaround hope so that it will be useful for someone else too.

$('#content').live('keydown', function(e) {
  var keyCode = e.keyCode;

  if (keyCode == 9) {
    e.preventDefault();

  }
});

$('#footer').live('keydown', function(e) {
  var keyCode = e.keyCode;

  if (keyCode == 9) {
    e.preventDefault();

  }
});

$('#header').live('keydown', function(e) {
  var keyCode = e.keyCode;

  if (keyCode == 9) {
    e.preventDefault();

  }
});

This thing allows tabbing to be done in the child page while not allowing to tab on the parent page. Content, footer, and header are the id's of the divs in which i had my main content. footer and header

Tuesday 13 April 2010

Google launching android powered gpad

Google launching Android-based gPad???
After starting competition with Apple’s iPhone by throwing Nexus One into the market and giving the minimum standards what does Android based phone should have and showing that what can an Android based phone can do - does now Google thinking to launch Android based slate???
After seeing success of iPad, Google has started quickly working on Android based tablet which will be using Google’s branded hardware as Nexus One did.

Reports saying that Google has finally decided to launch its own Android-powered tablet which is right now in secrecy mode. The manufacturer yet is unknown but the people which are working on the project says that Google is testing with a few companies to explore delivery of books, magazines and other content on a tablet.