Samstag, Juni 27, 2009

mixing Java and Groovy in Eclipse

As a server back end for Greasemonkey calls I use com.sun.net.httpserver.HttpServer. The work is done inside an implementation of the com.sun.net.httpserver.HttpHandler interface. To write the HttpHandler in Java started to take more time as I was willing to spend. So I thought it is a good idea to try out Groovy.

Installing Groovy and the corresponding Eclipse plugin was no problem. Running the first test script was straight forward also. But compiling a Java and a Groovy class inside the same project didn't work.

Therefore I did a test by hand.

  • set JAVA_HOME and GROOVY_HOME

  • compile the Groovy class inside projects src directory:

    1. groovyc PlayHttpHandler.groovy

    2. javac AjaxHttpHandler.java

    3. javac AjaxHttpServer.java


  • start the server: java -cp /Volumes/Macintosh\ HD/Applications/groovy-1.6.3/embeddable/groovy-all-1.6.3.jar AjaxHttpServer


This worked. So try again in Eclipse.

First step was to clean the project. But it still doesn't work. All classes are build twice. In bin the Groovy class has an unresolved compile problem. To me it looks like the class was build with javac. In bin-groovy the Groovy class is OK. Unfortunately the Groovy class used during run time is the one from bin. Not sure how to fix this.

Donnerstag, Juni 25, 2009

Javascript speed of Firefox 3.5

Today I installed Firefox 3.5 RC. The first thing I did was to test the speed of the new Javascript engine. For this I used sunspider. On my machine Safari is still twice as fast as Firefox.

But as long as Safari has no security features like NoScript and CS Lite I will not use it.

Sonntag, Mai 03, 2009

NFS server installation

My last NFS installation must have be nearly 10 years ago - was still using OS/2 on one machine.

On the server I installed nfs-kernel-server as I read about some problems with the user mode server. From the old day's I still remember the files used to configure the server.

  • /etc/exports: /dir ip(rw)

  • /etc/hosts.allow: ALL:ip

  • /etc/hosts.deny: ALL:ALL

This didn't work. Access was denied. The access is controlled by the user and group ID. All users are created separately and not controlled by NIS or LDAP server. The quick solution is to map all access to the local user with anonuid and anongid.

Still not able to connect from the Mac. The user access is granted by the server. The Mac connects with a port number greater than 1024. Therefore insecure is needed.

Help was the nfs howto and this thread about mounting nfs on Mac.

TODO: look into the command exportfs to manipulate the NFS exported file systems.

Montag, April 20, 2009

network file system to use

Two thinks happened at the same time. I had again problems with my Samba/SMB setup and found and old article about OpenAFS.

AFS still sounds good but most of the advantages are not important on a home network. Also all the good features are now part of NFSv4. As it is still not widely used it probably is more difficult to find a already existing solution on the net. This is also true for all the other protocols found on wikipedia.

Therefore it still comes down to SMB or NFS for me. As the new file server I build will use ZFS and run on OpenSolaris NFS might be the way to go. At least I will give it a try and see if I have less problems or run into other disadvantages compared to my use of SMB.

Samstag, April 11, 2009

output caller as Morse code

In CQ DL 4-2009 was a entry about CW for Windows Mobile.This will play information about the caller as Morse code. As I don't have a Windows Mobile phone, I searched for a program like this for my phone. But I couldn't find one.

There is a new phone project for me. The above program started with WAV snippets and then a MIDI file. He was not satisfied with the result and generates now the whole WAV file to play.

Never the less I will start generating a MIDI file. This should be the easiest way to start. Finding the inforamtion about MIDI was not difficult:

I found also a page that generates Morse code via MIDI. The perl script that dose the work is available for download. This will be the starting point for my own program (perlscript repository).

The first attempted, to find information on how to run a program if the phone receives a call, was not successful.

Copying a MIDI file onto the Centro is described here.

During my search I found the following interesting page about learning Morse code with the Koch method.