Dec
13
Wikipedia Donations
Filed Under Uncategorized | Leave a Comment
So I see that wikipedia is trying to raise $7.5 million. I don’t understand why they don’t just put up ads. Make no sense to me. Instead they are asking people to donate. If I donate money, I don’t get anything in return. If they put up ads, I may purchase something via the ad. Wikipedia gets paid from the advertiser, the advertiser gets my money, I get my purchase. Everyone is happy. And they should use http://admeld.com to optimize all their ad serving!
Nov
18
Backup Encrypted DVD on Linux
Filed Under linux | Leave a Comment
I don’t know much about this stuff, but it looks like ‘copy protected’ dvds have some bad error blocks in strategic places to make backing up or copying the dvd impossible for software that does not know about these copy protection schemes. I would of thought one of the gui dvd burning suites in Ubuntu 9.10 like Brasero or Gnomebaker would automatically require and use libdvdcss, the DVD decryption library. Neither of those worked. It wasn’t until I tried dvdbackup that told me:
joe@joe-laptop:~/dvdbackup$ dvdbackup -M
libdvdread: Encrypted DVD support unavailable.
************************************************
** **
** No css library available. See **
** /usr/share/doc/libdvdread4/README.Debian **
** for more information. **
** **
************************************************
So then I downloaded and installed the deb for my arch at: http://download.videolan.org/pub/libdvdcss/1.2.10/deb/
It finally works.
Nov
3
Ubuntu 9.10 Upgrade and GWT 1.7.0
Filed Under Java, linux | Leave a Comment
For those of you getting libstdc++.so.5/6: cannot open shared object file: No such file or directory when trying to run hosted mode GWT after upgrading to Ubuntu 9.10. The problem is the library is removed. If you are running 32-bit, just install the library. If you are on 64-bit you have to extract the library to /usr/lib32 because as you are probably aware GWT hosted on worked on 32-bit jvms. http://packages.ubuntu.com/jaunty/i386/libstdc++5/download
jtoth@jtoth-desktop:~$ ar p libstdc++5_3.3.6-17ubuntu1_i386.deb data.tar.gz | tar zx
jtoth@jtoth-desktop:~$ sudo cp usr/lib/libstdc++.so.5 to /usr/lib32
Oct
29
Java JAX RS
Filed Under Java | Leave a Comment
I’m working on a project that will use JSON to communicate from the browser (GWT) to the backend. I’ve been looking at the major JAX-RS implementations, jersey and resteasy. Using the default GWT JSON parser on the browser client side.
Jersey
To get Jersey 1.1.5-ea up and running took no time at all. Setup the spring, annotated some classes and was done. Had to create a custom @Provider to use JSON.
@Provider@Provider public class MyJAXBContextResolver implements ContextResolver<JAXBContext> { private JAXBContext context; private Class[] types = { Script.class, ExecuteScriptParameters.class }; public MyJAXBContextResolver() throws Exception { JSONConfiguration conf = JSONConfiguration.natural().rootUnwrapping( true).build(); this.context = new JSONJAXBContext(conf, types); } public JAXBContext getContext(Class<?> objectType) { return context; } }
The first major problem I encountered was when I had a service return a List<Script>. Jersey complained “A message body writer for Java type, class java.util.ArrayList, and MIME media type, application/json, was not found”. To fix this, I added @XmlRootElement to the Script class.
I didn’t like having to annotated my model with @XmlRootElement. In another test, when I returned an empty collection it generated null, so my json client deserialized the object as null instead of an empty collection. Returning a String does not quote the results. Instead of “the value”, I only get the value. GWT’s JSON parser does not like this. There may be a way to configure Jersey to not require @XmlRootElement and generate json how I need it generated, but quickly looking I didn’t find an answer.
RestEasy
Just like Jersey, really easy to setup. Didn’t have to annotate model. Empty collections return empty arrays properly. Same problem with Strings returning only the value and not wrapped in quotes. RestEasy also uses Jackson for JSON marshalling, which is the faster processor I know of.
Also, RestEasy’s client framework is pretty awesome too. You annotate an interface just as you would your rest services. Pass that interface to its builder, it creates an implementation that you can just call the methods as you normally would. Super easy.
Sep
22
Google Chrome on Linux
Filed Under linux | Leave a Comment
So I finally made the switch to start using google chrome on linux all the time. I was previously using firefox 3.5. Chrome is ALOT faster. There are still some bugs to be worked out, but its stable enough for me to be using it now. One problem is dropdowns don’t hide when clicked.
Using v. 4.0.211.2
