Friday 19 February 2010

openSUSE Build Server

Damn, I wished I had known about this last summer. Novell has developed a build server with which you can build different Linux distributions to different architectures. Something I used a lot of time on, and couldn't do for others than Intel-based processors since with standard tools you can't produce packages to other processor architectures. Well, now I know if I ever need to create a build system again.

openSUSE Build Server

Tuesday 16 February 2010

MySql with Java in Ubuntu

I had some problems connecting to a MySql database from a Java application in Ubuntu. This a short description on what is needed. This assumes you have MySql and some database set already.

First, you need to install the package:
sudo aptitude install libmysql-java
Then you need to make sure that the classpath is correct:
CLASSPATH=$CLASSPATH:/usr/share/java/
export CLASSPATH
This is a good point to logout/login...

The code to connect to the database looks something like

Wednesday 10 February 2010

Nokia S60 Music Player bug

So I got this new N86 8MP since I wanted a phone with a good camera (and N86 has the best Nokia has to offer) that could also replace my iPod which is breaking down. I think the hard drive is giving up. I went for Nokia because I'm used to them and the T9 works ok with Finnish as well. Other makers' phones tend to have problems with that.

I bought a 16GB memory card and copied some stuff there. The OVI Suite, unsurprisingly, didn't work too well so I reverted to keeping the folders in order by hand. This worked well to start with but then I added a few new albums to the card on the weekend and blast it! The band nor the albums were nowhere to be seen in the library. The tracks were in the track listing, though, so the player could see them.

I spend a good time figuring out the problem, including checking the ID3 tags and trying to fix them. Fortunately I finally found this link and following those instructions the music library was once again updated. This rebuilds the entire library. Fortunately it's that easy so I can just about manage even if I have to do it every time as I don't add new stuff that often.

Sunday 7 February 2010

Small issue with Gitorious

I created a simple project to gitorious.org so that I can easily work on it from several locations. Of course I had issues, from one location I had problems getting through the firewall but I also had a minor issue from home.

Gitorious tells that I can clone the repository with
git clone http://git.gitorious.org/scheator/scheator.git


which worked but when I tried to push I got this error:

fatal: protocol error: expected sha/ref, got '
----------------------------------------------
The git:// protocol is read-only.

Please use the push url as listed on the repository page.
----------------------------------------------'


Reason is that the url for the repository is incorrect in .git/config. It looked like
url = git://gitorious.org/scheator/scheator.git


when in fact it should look like
url = git@gitorious.org:scheator/scheator.git


After I fixed that, it works. I can't figure out why this can't be correct in the first place without the need to fix it by hand.

Wednesday 3 February 2010

NetBeans not finding the main class

Oh man, this was an annoying problem. I suddenly got the error "Main class not found" from NetBeans even though everything was ok (the class was there, so was main(), project properties were correct etc). After some digging I found the simplest of solutions:
touch the main class file, i.e. change the date so that NetBeans detects it has been changed and recompile.


Whew. I was getting worried there for a moment.