Archive for the ‘Improving Free Software’ Category

Spring Security 3 hidden feature

Friday, April 2nd, 2010

These days I’m working with Spring Security 3

SS3 added the Spring Expression Language, a nice way of script boolean conditions into “access” attributes of your URLs and into @PostFilter annotations

The hidden part is that you could have used them even with the security:authorize tag in your JSPs IF they had added the element <expression-handler> as a child of the element <http>
That’s the only missing part since the code to handle it is already there.
So what? I took the spring-security-3.0.xsd, edit it to add the missing element, modified the schemaLocation of my security xml file and voilĂ : SpEL is alive and kicking even on JSPs

I’ve opened a ticket for that: the answer was that they deliberately turned it off for version 3 but no target version is set.

In the meanwhile I’ve also found a problem on the JMX lib of Jetty, and opened a ticket as well. Hope they could fix it asap.

UPDATE: indeed they fixed it! Thx to Michael Gorovoy

glib-2.20.5 b0rks if compiled with plain -O3

Thursday, September 3rd, 2009

Just one more post for the category Improving Free Software: I’ve run into troubles on my laptop when yesterday I upgraded glib, which caused an infinite loop on a dependent software.

Thanks to a suggestion from Gilles Dartiguelongue, I found that the latest glib fails if compiled with a plain -O3 optimization: the problem was solved by disabling the “ipa-cp-clone” optimization (-fno-ipa-cp-clone).

All the details can be found here.

Setting up FoodMart on Mondrian

Monday, August 3rd, 2009

I don’t know either if I’m stupid or if the Pentaho developers are lacking of effort in helping poor conference speakers like me.

If you want to show someone the features of something, you have to set up a demo. And half the times these demos require data. And if you are setting up a demo for a business intelligence tool, data is essential!

Pentaho provides you with a dataset to use in demos and as a playground (thank you), but it’s quite difficult to set it up. An early adopter may judge this as project immatureness, while Mondrian is all but immature!

That’s what you need to set up the FoodMart database on PostgreSQL before demoing Mondrian (don’t try that with MySQL: it will take hours!)

First, locate a copy of these dependencies: log4j, eigenbase-xom, eigenbase-properties, eigenbase-resgen, commons-logging and postgresql-8.4-701.jdbc4.jar (or a suitable postgres jdbc driver): let’s say you have them in folder “mondrian/lib” and that you are in folder “mondrian”

Then write in a console:

java -cp .:lib/mondrian.jar:lib/log4j.jar:lib/eigenbase-xom.jar:lib/eigenbase-properties.jar:lib/eigenbase-resgen.jar:lib/commons-logging.jar:lib/postgresql-8.4-701.jdbc4.jar
mondrian.test.loader.MondrianFoodMartLoader
-verbose -tables -data
-jdbcDrivers=org.postgresql.Driver
-outputJdbcURL='jdbc:postgresql://localhost/mondrian?user=postgres&password=postgres'
-inputFile=demo/FoodMartCreateData.sql

Then wait for a minute.

Bah, maybe it’s just me, too comfy sat on ant and maven.

Speeding Firefox/Thunderbird start-up

Monday, July 13th, 2009

Having found and read this forum thread, I’ve modified the script to:

#!/bin/bash
username=$(whoami)

function check_app {
	proc="$(ps aux | grep $username | grep -v $0 | grep $1 | grep -v grep)"
	if [ "$proc" != "" ]
	then
		echo "!!! Shutdown $1 first!"
		exit 1
	fi
}

function vacuum_mozillas {
	echo "Vacuuming $1..."
	find $2 -type f -name '*.sqlite' -exec sqlite3 {} VACUUM \;
}

check_app firefox
check_app thunderbird
vacuum_mozillas firefox ~/.mozilla/firefox/
vacuum_mozillas thunderbird ~/.thunderbird

echo 'Done!'

While it sensibly improves start up times, don’t expect too much.

KVM: from disk image to LVM

Sunday, May 10th, 2009

In the beginning I was creating virtual machines out of physical ones, overbooking their size to make guests believe they had, say, 30G, while the hard drive just had 20.

With the passing of time, these disk images were growing and growing, and performances went lower and lower.

So I’ve followed this guide, and found a problem at paragraph 8: converting an image file into a raw LVM volume does NOT work, at least with the current version of KVM available on Debian Lenny.

The solution is quite simple, even if time and disk space consuming, and it came from this post.

First create a raw image file:

kvm-img convert disk0.qcow2 -O raw disk0.raw

Then DD it to the LVM volume

dd if=disk0.raw of=/dev/vg01/vm1 bs=1M

VoilĂ !

JRecordBind 2 has been released

Wednesday, January 21st, 2009

JRecordBind 2 is the JAXB of fixed-length files: using XML Schema to describe their structure, it’s able to both produce and consume them, letting the developer focus on the real task, that’s what to do with the data.

This is the final release, ready for production use.

I’ve asked the java.net admins to graduate the project, and I’m waiting for their reply.

Anyway the URL won’t change, so it’s safe to bookmark:
https://jrecordbind.dev.java.net/

JRecordBind goes Jaxb

Thursday, January 8th, 2009

The current stable version on JRecordBind (rev 58) is deprecated: the new version is on its way to stable status!

JRecordBind-2 will be based on JAXB: forget the .properties file and start describing the hierarchy of your fixed length file with XML Schema!

For what I want it to do now, it’s feature complete. It needs a refactoring, since the code is the ugliest I’ve ever written. Once done, I’ll update the documentation, announce the final release and ask java.net admins to get me out of the incubator.

Stay tuned!

IFS 2008-08-24: Cobra

Tuesday, August 26th, 2008

I’ve found and proposed a solution for a bug in the Cobra Toolkit, a HTML parser with a Javascript engine attached.

IFS 2007-06: Cooee (was: Echo2)

Friday, June 15th, 2007

While Echo2 maintainer has never accepted them, on June all my patches for Echo2Extras went into Cooee, the Karora project fork of Echo2 and its related projects. Made two apps with it: real fun and great results!

IFS 2006-07-13: Torque

Thursday, July 13th, 2006

I’ve found and helped solving a bug in the Criteria object of Torque, an easy and intuitive ORM by Apache.