Archive for August, 2007

eclipse crashes upon license agreement dialog when trying to create a dynamic web project

Sunday, August 26th, 2007
The last two days I have been trying to figure out what the heck was going on with my freshly installed Eclipse 3.2.2 on my freshly installed Feisty Fawn box. Eclipse kept crashing just when I was trying to create a Dynamic Web Project. A dialog with some License Agreement was showing up for less than a second and before I can do anything the JVM was crashing with a Segmentation Fault.

I searched on the web and I found some forums talking about that, they were saying something about increasing the memory of the JVM. I did that, but same shit. I tried again by downgrading from Java 6 to Java 5, but same shit, too. I even tried with GCJ, but guess what: same shit.

And what was the ultimate solution? I removed all installed eclipse-related packages from my Ubuntu box, and then I got Eclipse Europa for Java EE Developers, and my hard times were gone...

eclipse to use Sun's jvm on Ubuntu

Friday, August 24th, 2007
Does your eclipse IDE runs terribly slow on your Ubuntu box? Probably that's because it runs using gcj, a GNU java implementation. In order to improve your eclipse's performance you have to run it using Sun's java.

To see whether you are running your eclipse on gcj or not, go to your eclipse IDE and from the menu go to Help About Eclipse SDK Configuration Details. Then search the virtual machine in use, it is the program right after the -vm argument:

*** System properties:
eclipse.buildId=M20070212-1330
eclipse.commands=-os inux
-ws tk
-arch 86
-launcher usr/lib/eclipse/eclipse
-name clipse
-showsplash 00
-exitdata 3800c
-install usr/lib/eclipse
-vm /usr/lib/jvm/java-gcj/bin/java
eclipse.ee.install.verify=false
eclipse.product=org.eclipse.sdk.ide
eclipse.startTime=1187974381902


If your virtual machine is /usr/lib/jvm/java-gcj/bin/java, like in the example above, then you most likely have found the source of your eclipse's slow performance. Close the Eclipse IDE for now.

Right after, you have find out what Sun java runtime environments are installed in your system. Try out this command:

giannis@giannis-desktop:~$ ls -1 /usr/lib/jvm
java-1.4.2-gcj-4.1-1.4.2.0
java-6-sun
java-6-sun-1.6.0.00
java-gcj


If you are able to see a directory that matches the java-*-sun pattern, then you have a Sun JVM installed. Otherwise you will have to install one. To install Sun's JVM run the following command:

$ sudo apt-get install sun-java6-jdk

When your new JVM is installed, you have to configure eclipse to use this one instead. Run this command:

$ sudo gedit /etc/eclipse/java_home

Edit the file and make sure to insert the installation directory of your new JVM on the top, like this:

# This file determines the search order the Eclipse Platform uses to find a
# compatible JAVA_HOME. This setting may be overridden on a per-user basis by
# altering the JAVA_HOME setting in ~/.eclipse/eclipserc.

/usr/lib/jvm/java-6-sun
/usr/lib/jvm/java-gcj
/usr/lib/kaffe/pthreads
/usr/lib/jvm/java-1.5.0-sun
/usr/lib/j2se/1.5
/usr/lib/j2se/1.4
/usr/lib/j2sdk1.5-ibm
/usr/lib/j2sdk1.4-ibm
/usr/lib/j2sdk1.5-sun
/usr/lib/j2sdk1.4-sun


Save the file and run Eclipse again. It should be using Sun's JVM by now. However, to make sure everything was done right go once more to Help About Eclipse SDK Configuration Details and check out if the virtual machine setting is now correct. Performance should be improved by now.

convert encoding with iconv

Friday, August 24th, 2007
Most Unix-like systems are equipped with a powerful program called iconv. This program enables you to convert any file from virtually any encoding to another. The syntax of the command is as follows:

iconv -f from-encoding -t to-encoding input-file

For example, this command

iconv -f WINDOWS-1253 -t UTF-8 input.txt

will convert the contents of the input.txt file from windows-1253 encoding to utf-8. The output will be sent to standard output. If you want to write the converted output to a file you should use redirection:

iconv -f WINDOWS-1253 -t UTF-8 input.txt > output.txt

If the input-file parameter is omitted, standard input will be used.

To get a list with all the encodings supported in your system by iconv, run this command:

iconv -l

If you are interested in iconv but you are a Windows user, the good news is that iconv is included in GnuWin32.

JasperException: Expecting "jsp:param" standard action with "name" and "value" attributes

Thursday, August 23rd, 2007
If you are constantly and inexplicably getting a JasperException with the message Expecting "jsp:param" standard action with "name" and "value" attributes from Tomcat, when trying to include another page from a JSP, then you are probably trying to use an empty <jsp:include> tag, like this:

<jsp:include page="..."></jsp:include>

Although this code may not produce syntax errors in your IDE (at least, that's the situation in my eclipse), it is not agreeable by Jasper, Tomcat's JSP compiler. Jasper requires that between the opening <jsp:include> tag, and the closing </jsp:include> tag, there is at least one <jsp:param> tag. If you do not have to pass any parameters to pass to the included page, then you must use the single tag version, which is:

<jsp:include page="..."/>

If you don't know the exact number of parameters to be passed at the time of authoring, for example, if you are passing parameters from a HashMap object, you should include both versions, and distinguish which one to use with an if-then-else statement. Like this:

<% HashMap<String,String> params;

// ...

if (params.size() > 0) { %>
<jsp:include flush="true" page="page.jsp">
<% for (String name : params.keySet()) { %>
<jsp:param name="<%=name %>"
value="<%=params.get(name) %>"/>
<% } %>
</jsp:include>
<% } else { %>
<jsp:include flush="true" page="page.jsp"/>
<% } %>


enable write NTFS support on Feisty Fawn

Wednesday, August 22nd, 2007
This is how to enable write NTFS support on Ubuntu 7.04 (Feisty Fawn). It is very easy to do in this version. At the command line type the following:

giannis@giannis-desktop:~$ sudo apt-get install ntfs-config
Password: *******
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
fuse-utils libfuse2 libntfs-3g0 ntfs-3g
The following NEW packages will be installed:
fuse-utils libfuse2 libntfs-3g0 ntfs-3g ntfs-config
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 308kB of archives.
After unpacking 1159kB of additional disk space will be used.
Do you want to continue [Y/n]? y
. . .


When everything is installed, go to: Applications System Tools NTFS Configuration Tool.

screen of NTFS Configuration Tool


Make sure to enable write support for both internal and external devices, and click Ok. Your NTFS file systems should be automatically re-mounted with write enabled by now.

funny google images search

Monday, August 20th, 2007

a funny google images search screenshot


A greek speaker should get the joke already... For those who need a translation, in the above screenshot, we are searching the Greek Google Images search engine for βυζιά (boobs) and we tell Google to show όλα τα μεγέθη (all sizes). You cannot reproduce this any more since Googlers changed the text to Όλα τα μεγέθη εικόνας (all image sizes), so it's not funny any more, but it is still working in the German site... alle Größen!

How safe is "quick format"?

Friday, August 17th, 2007
I just finished assembling the parts my brother's new computer and I am installing Windows XP right now, and for N-th time in my life I was asked by the Windows Installer whether I wanted a "quick" NTFS format or a regular one. For one more time, and for no particular reason, I chose the regular format. For a 320GB (~305GiB) Western Digitial drive, it took more or less two hours...

I know that a quick format would take only a couple of minutes. This time I seriously considered the possibility of wasting my precious time, all these years, with these slow regular formats. So, I did some research on the net, and I discovered that the major (if not the only) difference between quick and regular format is that regular format checks for bad blocks while quick format does not.

It seems reasonable that, in my case -with a new hard drive right out of its wrapper- it should be highly unlikely to have bad blocks on the disk. Thus, quick format would do just fine. If you're in doubt, too, I suggest that next time you will have to choose between regular and quick format, take in account the condition of your hard drive. If it is a brand new or less used drive, it would be fair enough to go with quick format. If you hard drive has been through a lot, maybe it should be wiser to go the regular way, but make sure you find something to keep you busy the next couple of hours...

empty game list on gxmame

Thursday, August 16th, 2007

screenshot from Ms. Pac Man


Yesterday, I installed gxmame version 0.34 on my Ubuntu box, which I downloaded from the gxmame's site at SourceForge.net. I started the front-end but for some reason the game list was empty, while the directories were perfectly fine. As I discovered later, version 0.34 is not the latest one, and it has a bug that causes this empty list problem. Version 0.35 fixes the bug, and you can get it from here. It seems that they uploaded the new version but forgot to update the links. Download and install the package and make sure to Rebuild Game List.

mass resize images on ubuntu

Wednesday, August 15th, 2007
If you want to resize a large number of images and you are using Ubuntu, then the task will be very easy for you.

Open the directory containing the images to be scaled with Nautilus and select the images you want to resize. Then, right click and choose Open with "gThumb Image Viewer". When the program opens, press Ctrl-A to select all the images. Then, from the menu select Tools Scale Images... You will be presented a dialog that will ask you to specify a number of parameters like the new size, destination folder, etc. When done press the Scale button, seat back and enjoy the show.

If your images are not all of exactly the same size, remember to scale them using a percentage rather than a fixed pixel number.

Give your computer a blow!

Tuesday, August 14th, 2007

my new chinese blower


I wanted one of these blowers for years, since the time I was fixing PCs for living and I first saw one... I finally made it to blow all this cumulated dust and cat hair out of my computer, printer and keyboard. They are now clean and shiny!

You really should get one, too, and give your computer a blow sometimes! I got mine from a local Praktiker store. Well, it may be made in china, but it does great job. It blows tons of air, it makes tons of noise, it consumes tons of energy (500W)... for €12.50 I think the price is right.