Showing posts from February, 2008

Blogger Backup

Tonight for the first time I realized that all my posts to JRoller and Blogger are all just present on their respective websites, but not as a copy on my local machine or some other backup. While I have full trust in Google's engineers to keep Blogger up and running as well as my data safe, it is never a bad idea to make a copy of your stuff. So I just googled for "Blogger Backup" and found just that: A Blogger Backup tool. It is a .NET based tool that utilizes Google's C# data access libraries. Probably it would have worked with Mono, but as I had a VirtualBox'ed XP instance up anyway I used it there. Once I had downloaded and installed the tool, it was just a matter of a few clicks to get all my posts saved in Atom/XML files locally. One thing has to be noted though: Make sure your blog feed is set to "Full posts", not just the summary. I first got this wrong, so all the backup files just contained at most the first paragraph. Now all 99 posts I po

Back to text mode

Over the past couple of weeks my machine repeatedly just froze - mouse not moving, keyboard dead. I do not know if it was just X11 crashing, because I do not have any remote services active on the machine, so I could not log in remotely. Just as a precaution I did not boot into X11, but now I am in text mode (80x25), backing up my home folder to an external hard disk. After that I will go for a fresh install of Ubuntu 7.10. The current install has seen upgrades from 6.06 to 6.10 to 7.04 to 7.10, spiced and seasoned with some manual tweaks, especially when something did not work in one of the previous Ubuntu versions. So I cannot really tell if something that was need back then now tends to destabilize my machine. It almost feels a little like this "again Windows syndrome" - where people claim that Windows just "needs a reinstall once a year" to remain fast and stable. I am a little reluctant to admit this, so a part of me hopes this is really a hardware problem; th

String.replaceAll() caveat

Sometimes I wonder how it is possible to write Java programs for as long as I have now and still stumble across little gotchas I did not know about. When writing a class that is intended as a utility to write well-formed queries for our persistence framework, I was bitten by a nice little subtlety of the String class. Just a little background: In our application we use a persistence framework with a SQL-like (but still different) query language. Statements in that language are easier to read because they are closer to the business object model, but in the end they get translated into "real" SQL. Unfortunately the query parser is based on simple query strings without support for something like prepared statements which makes it susceptible to injection attacks if you put user-entered values into a query directly. While there is a way to escape the input accordingly it is a little cumbersome and makes the code to assemble the query conditions into the final String hard to r

Sun javac / Eclipse compiler difference

Our primary development environment is Eclipse, set to Java 5 compatibility. However during the nightly builds we use Sun's javac, currently version 1.5.0_12 I believe. Today I noticed one of the builds had failed in this code (reduced to a small test case): public interface Task<V> {} public interface RunnableTask extends Runnable, Task {} public class ProgressMonitorUtil { public <V> V execute(final Task<V> aBackgroundTask) { return null; } public void execute(final RunnableTask aBackgroundTask) {} } public class Test { public static void main(String[] args) { new ProgressMonitorUtil().execute(new RunnableTask() { public void run() {} }); } } Put these classes into an Eclipse project, either with Java 5 or Java 6 compatibility settings. You will see no problems. However compiling this with Sun's javac (also either 5 or 6 will do) leads to this: reference to execute is ambiguous, both method <V>execute(Task<V>)