Daily Del.icio.us for Jan 31, 2006


Life is beautiful with XMLBeans and XStream

XML creation, parsing and processing with Java has gotten so much easier with tools like XMLBeans, XStream and many other such tools. I personally love XMLBeans and XStream and I try to use them for all of my XML processing needs. While they both consume XML, they solve different problems. XMLBeans allows you to process XML by binding it to Java types using XML schema that has been compiled to generate Java types that represent schema types. XStream on the other hand allows you to serialize objects to XML and back again using special reflective secret sauce.

I’ve been using these tools for many years now and so you tend to forget just how useful and powerful they are and how productive they make you. Case in point – A friend of mine came to me for help. He was building an application that would allow him to resale items from Amazon on his site and he wanted to use the Amazon eCommerce Web Services to search for products programmatically and update a local database that housed his content. Having played with Amazon E-Commerce Service (ECS) before, I offered to write up a simple application that would make the Web Services call, process the results and present them back to you.

Amazon’s ECS is an API that allows you to access Amazon data and functionality through a Web site or Web-enabled application. ECS follows the standard Web services model: users of the service request data through XML over HTTP (REST) or SOAP and data is returned by the service as an XML-formatted stream of text. In addition to the WSDL, ECS also provides XML schemas for validating the XML output of REST requests. So I decide to use XMLBeans to create my type system using the XML Schema provided by Amazon. XMLBeans provides you with a utility (scomp) to compile your schema into Java XMLBeans classes and metadata. To generate the Java code, use the following command:

scomp –jar amznws.jar AWSECommerceService.xsd

This generates a jar file named amznws.jar, which will contain all of the code needed to bind an XML instance to the Java types representing your schema. In my application, I use HttpClient to make my REST request and then use the XMLBeans generated jar file to process the result. Here’s a snippet of code from my sample class:


As you can tell, HttpClient makes the REST call a snap and XMLBeans makes processing the results easy as well. In total, I spent 3-4 hours getting the application working and a lot of the time was spent figuring out the data set returned from Amazon and trying to come up with a meaningful example. Here is a zip file with the IDEA project that has all the stuff needed to make this work including a simple JSP and a JUnit test class.

Links of Interest:

I want the Broadband EVDO Router

I was just reading Scoble’s blog entry that talks about EVDO and his experiences and one of the entries in the comment caught my eye. David Rupp pointed out the Kyocera KR1 Broadband EVDO Router that has built In WiFi and basically rebroadcasts EVDO over WiFi (using 802.11g). In addition, it offers 4 10/100 Ethernet ports and works with a ton of EVDO cards. This is awesome and I can’t wait for these devices and EVDO services to become mainstream

I have been testing EVDO services with Cingular and Sprint using my phone (Bluetooth DUN) and I am getting an average of 300k-400k which is not bad, but it would be nice to keep the phone and have 1MB + bandwidth that the dedicated EVDO cards offer. Best of both worlds.

EVDO, spring, cingular, wifi, bluetooth, evdo+router, kyocera, scoble

Daily Del.icio.us for Jan 29, 2006

DVR Alert – U2 Vertigo 2005 Tour: Live from Chicago on HDNet

I guess the title above says it all – Set your VCR, DVR, PC-DVR or Media Center PC to record U2 in High definition. Director Hamish Hamilton gives you a front row seat for all the excitement from the sold out Vertigo tour. Vertigo//2005 features electric performances of songs drawn from across the band’s entire career. Featuring the hits “Vertigo”, “Sometimes You Can’t Make It On Your Own”, “One”, and “The Streets Have No Name”.

There are several replays of this concert on HDNet – Check the schedule here.

dvr, hd, u2, music, concert, live

Books I’m currently reading

As a recurring feature, I post a list of books that I am currently reading. I am a voracious book collector and (usually) reader as well. With a very demanding job, a wife and a young daugther, I’ve built up quite a backlog and hope to get to most of these books in the next few months. Books I am currently reading include:

Technical Books

Naked Conversations : How Blogs are Changing the Way Businesses Talk with Customers
Robert Scoble, Shel Israel
ISBN: 047174719X
Price: $24.95
Rating: 4.5 (Total Reviews: 15)
Sales Rank: 3000

Pragmatic Ajax : A Web 2.0 Primer
Justin Gehtland, Ben Galbraith, Dion Almaer
Pragmatic Bookshelf; 1 edition (February 1, 2006)
ISBN: 0976694085
Price: $23.07
Rating: This item has not yet been released
Sales Rank: 40,075

My Job Went to India : 52 Ways to Save Your Job (Pragmatic Programmers)
Chad Fowler
Pragmatic Bookshelf
ISBN: 0976694018
Price: $19.95
Rating: 4.5 (Total Reviews: 11)
Sales Rank: 18002

Rapid J2EE(TM) Development : An Adaptive Foundation for Enterprise Applications (Hewlett-Packard Professional Books (Paperback))
Alan Monnox
Prentice Hall PTR
ISBN: 0131472208
Price: $44.99
Rating: 4.5 (Total Reviews: 5)
Sales Rank: 605254

CISSP All-in-One Exam Guide, Third Edition (All-in-One)
Shon Harris
McGraw-Hill Osborne Media
ISBN: 0072257121
Price: $79.99
Rating: 4.0 (Total Reviews: 107)
Sales Rank: 779

Translucent Databases
Peter Wayner
Flyzone Sr Llc
ISBN: 0967584418
Price: $29.95
Rating: 4.0 (Total Reviews: 9)
Sales Rank: 111219

Head First HTML with CSS & XHTML (Head First)
Eric Freeman, Elisabeth Freeman
O’Reilly Media, Inc.
ISBN: 059610197X
Price: $34.95
Rating: 5.0 (Total Reviews: 7)
Sales Rank: 967

Non-technical Books

Some of the non-technical books that I am currently reading (or collecting dust in my new book pile) are:

Freakonomics : A Rogue Economist Explores the Hidden Side of Everything
Steven D. Levitt, Stephen J. Dubner
William Morrow
ISBN: 006073132X
Price: $25.95
Rating: 4.0 (Total Reviews: 767)
Sales Rank: 6

State of War : The Secret History of the C.I.A. and the Bush Administration
James Risen
Free Press
ISBN: 0743270665
Price: $26.00
Rating: 4.0 (Total Reviews: 43)
Sales Rank: 87

Why Do Men Have Nipples? Hundreds of Questions You’d Only Ask a Doctor After Your Third Martini
Mark Leyner, Billy Goldberg
Three Rivers Press
ISBN: 1400082315
Price: $13.95
Rating: 3.5 (Total Reviews: 179)
Sales Rank: 246

Dog Days
Ana Marie Cox
Riverhead Hardcover
ISBN: 1594489017
Price: $23.95
Rating: 3.5 (Total Reviews: 20)
Sales Rank: 2581

Daily Del.icio.us for Jan 28, 2006

I hate Roxio and Nero!

I have had it – I cannot tell you how frustrating it is to burn a simple f***ing DVD on my computer. Roxio and Nero and all the other DVD burning software that I have tried for Windows just suck and I’ve burnt more coasters than.. Ok. Can’t think of a smart or funny analogy here but I’ve burnt a lot of coasters.

Since we’ve had our daughter, my wife and I have been putting our digital camcorder to good use. I typically capture the movies to my computer before burning them onto a DVD with titles, transitions, pictures and music. I typically use Roxio to burn my DVD and the results are usually hit or miss. After installation, Roxio works fine for a few days or weeks and then just starts burning coasters. So I’ll download Nero and try that and that may work fine for a few weeks before it goes into coaster mode. Usually a simple uninstall and a reinstall fixes the problem with Roxio but that is such a hassle. There are times when that doesn’t work and the typical answer from Roxio support is to rebuild my machine. F*** you – Fix your software so that it works and doesn’t require me to rebuild my machine. In Roxio’s defense, I install any piece of software I can find that seems interesting. I do download a lot of software from any development tool, add-on to utility programs and I must be clobbering something but this is just garbage. Why can’t a program protect its own DLL’s or registry settings or whatever is breaking this

My burner machine configuration is a DELL Pentium 4 (ancient) 2 GHz machine with 1 GB of RAM, Windows XP SP2 and an external USB 2.0 Plextor PX-708UF DVD burner. I own Roxio v7.0 and don’t want to upgrade to v8.0 as I may be facing the same issues. This is enough of a hassle to make me want to buy a MAC. Now that Macs are running a real processor with some performance, it might be worth checking out one of those shiny new MacBook Pros. And if I can run OS X and Vista on the same laptop, that’s a pretty good deal. If only Apple made a Tablet!

Is there any other software out there that will let me burn a DVD without these hassles? There has to be an alternative to this nightmare scenario. If you have a solution that’s working for me, please drop me a line or comment below.

Roxio, Nero, Windows+xp, dvd, software, mac, osx, macbook

Daily Del.icio.us for Jan 26, 2006