Loading

Author Archives: ruben.laguna

Building Apache Tika 0.6 fails if the locale is not en_US

I tried to build Apache Tika 0.6 yesterday and I couldn’t build it because the tests failed. The failing tests were
testExcelParserFormatting(org.apache.tika.parser.microsoft.ExcelParserTest)
testExcelFormats(org.apache.tika.parser.microsoft.ooxml.OOXMLParserTest)

and the failure had to to with the fact that the locale was “es_ES” and the numbering format differs (“1.599,99” and not “1,599.99“)
$ mvn -version
Apache Maven 2.2.0 (r788681; [...]

JUnit and Netbeans. Injecting in objects in the default Lookup

If you need to unit test classes in a netbeans module and the classes use the Lookup.getDefault() to “lookup” things that you want to mock you probably wonder how you can place the mock objects in the default Lookup
Adding objects to the Netbeans’s default Lookup is relatively simple. Here is the answer:

Replace the Lookup [...]

Connect to the internet via Bluetooth PAN with Mac OS X Snow Leopard

If you want to access the internet via your phone 3G/GPRS connection you can use Bluetooth PAN. In my case I have a Sony Ericsson W715 so the first thing to do is to tell the phone which connection to use Menu > Settings > Connectivity > Bluetooth > Data accounts and select the account [...]

Cancellable tasks and progress indicators [Netbeans Platform]

Progress indicator (indeterminate mode) which allows to cancel the task
The easiest way of having a cancellable progress indicator (Progress API) for a task in Netbeans Platform Application is the one below but it´s only worth for tasks that don’t update the progress indicator (indeterminate mode) until the task is finished. If you want to update [...]

OpenJPA, HSQLDB and proper shutdown

I’m starting to get tired of OpenJPA/HSQLDB setup that I’ve trying: it seems to give more problems than it solves. Now I discovered that the HSQL db wasn’t been properly shutdown and for reasons that I’m investigating, if the HSQL db is not propertly closed (SHUTDOWN command) it’s impossible to reopen it again. It [...]

JTable bound to a database with lazy loading

I’ve been doing experiments with JTables bound to database tables in the past. But I was not satisfied with the result to be honest. The pagination helps but there is still noticeable pauses each time a database query has to be issued. So I started looking into other possibilities.
I come up with the idea [...]

Migrating from Blinklist to Delicious.com: CSV to HTML

Apparently blinklist doesn’t export bookmarks to JSON format any longer and delicious has changed authentication scheme for its delicious API for new accounts (now it forces new users to use the OAuth / Yahoo ID). So the solutions described in this old post of mine doesn’t work.
So given the current state of affairs the only [...]

Two netbeans bugs at the same time

It seems that source attachement for Library Wrapper Modules in Netbeans 6.8 Beta doesn’t work properly. I opened a bug report here https://netbeans.org/bugzilla/show_bug.cgi?id=176800#c9 and it seems that in the process I also spotted that “Swing Layout Extensions” library definition that comes with NB 6.8 it’s also wrong (see https://netbeans.org/bugzilla/show_bug.cgi?id=176800#c7)

Bookmark It

Hide Sites

$$(‘div.d1006′).each( function(e) { e.visualEffect(’slide_up’,{duration:0.5}) [...]

How to handle custom tags using Flying Saucer

If you have a customized xhtml variant, like evernote ENML format and you want to render it with Flying Saucer R8 you must first make sure that the extra element (in ENML case, en-media) is defined as a block-level element. To do that you create your own NamespaceHandler and you make sure that you return [...]

Incorrect track length in iTunes

iTunes was reporting a incorrect track time length for an audiobook that I created concatenating several mp3 together.
I had to reencode the whole thing again to make iTunes recognize propertly the track lenght. I could’t reencode the concatenated file itself as that ended up with a Segmentation fault in lame

cat *.mp3 |lame –mp3input – [...]