Posts

Showing posts from 2010

Saqib Ali for State Senate: An American Story. A True Blue Democrat.

Check out this video explaining why my friend Saqib Ali is running for the State Senate in Maryland. For more information about his achievements as a Maryland State Delegate and his current efforts in running for the Maryland State Senate, visit his blog .

Another sleek device by Apple - Steve Job's Keynote

I do agree to the fact that Steve Jobs states that Netbooks arn't better at anything, they are slow, they arn't better than any laptop, they are just cheaper. And I don't think any one can make good use of such a machine just thinking of portability in their minds while getting one. Let's see how good does iPad do to achieve this, it does look like a giant IPhone but it has 10 hours battery life, no physical keyboard. Wifi and Bluetooth, but I do wonder why they haven't provided any protection for the screen as one would be carrying this pad around.   An overview by the iPad development team itself. I do feel that this device can become a revolutionary portable computing machine, provided that the features that IPhone had such as fast browsing experience, landscape mode for all applications including games, the tilt sensors and above all the App Store. I can't think of any bounds that this device might have considering the fact that there will be tons...

Type casting problem while unmarshalling XML objects using JAXB

While using JAXB to unmarshall objects from a given XML, a very common problem might occur which is the type casting of the unmarshalled object. For instance, for the following code: JAXBContext jaxbContext = JAXBContext.newInstance("user.jaxb"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); user.jaxb.Type myType = (user.jaxb.Type) unmarshaller.unmarshal(new File("myXML.xml")); For the above code, the error: Exception in thread "main" java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast to user.jaxb.Type might occur. The type of the object returned by the unmarshaller is JAXBElement and trying to typecast it to your resepective type directly causes the classcastexecption, whereas, if you get the value of the returned JAXBElement object by calling the .getValue( ) method, and then do the type casting on this object to your respective type, the problem is solved,  as follows: user.jaxb.Type myType = (user.jaxb.Type)...