Life, code and stuff
Posted by Marc Sturlese

30 Jan 09 SeedRocket & EyeOS

Last Tuesday I had the chance to go to one of the SeedRockets talks. I went to listen to the founder of EyeOS. EyeOS is an interesting open source project. We could say EyeOS is a simple operating system in the cloud. It has it’s own file system. Once installed you can edit different types of documents, use widgets and FTP, listen mp3 files, use it from the movile phone, manage processes, read feeds… but if you start going deeper you can install hundreds of applications.

The speech was mainly about how to create a users community and the advantages and disadvantages of giving a project to open source. I found it really interesting and learned some stuff!

eyeos - cloud computing - open source

Tags: ,

Posted by Marc Sturlese

18 Jan 09 HD’s Load cycle count problem with Ubuntu fixed

Today I read in SlashDot a remarcable pice of new. Ubuntu’s compatibility problem that was reducing some HD’s life time has been fixed. The problem appeared turning the powersaving mode on. Once it done, the HD’s load cycle count started increasing at giant steps (more…).
People are still arguing who’s fault was, if hardware manufacturers or software developers (the thing is it was just happening in some hard disks brands).
Long time ago I found a way to solve it, tunning hdparm:
hdparm -R 255 /dev/sdaX
255 is the maximum value it can have, would turn off completely APM.
Neighter that or couple more tricks I found googleing worked for me.
For users of Ubuntu 8.04 or higher, the problem seems to be definitely solved. To download the fix you must use the test repositries as it has just appeared and is not yet in the update repositories.

Tags: ,

Posted by Marc Sturlese

17 Jan 09 MySQL streaming setting fetchSize to Integer.MIN_VALUE

Have you ever experienced a java.lang.OutOfMemoryError: Java heap space
due to too big selects?
We can avoid that thanks to the fetchSize parameter initialized at statement creation time. FetchSize decides how many rows of the select MySQL must store in the buffer before dealing with the data. Setting that parameter to it’s minimum value we will be able to do streaming with all rows.
The minimum value is still pretty odd for me as I thought it would be 1 (thinking 1 was the minum numer of rows to be stored in the buffer) but it is -2^31, the minimum value java can store in an Integer!

Another solution would be to paginate the select setting a limit value. The problem with this is that the more selects we do, the slower MySQL will deal with rows. Doing streamaing with the fetchSize parameter we just need one select and the “rows deal with speed” does not decrease. MySQL will deal with the rows buffering by itself.

The statement creation should look like this:

try {
Connection c = getConnection();
stmt = c.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
stmt.setFetchSize(Integer.MIN_VALUE);

Tags: ,

Posted by Marc Sturlese

13 Jan 09 Opening lucene 2.9-dev indexes with Luke Lucene Index Toolbox

Lately I have started using the developers version of Lucene (2.9-dev). When I wanted to open an index using Luke to check some content it just did not work, I got a “lucene invalid index” error. After a while I realized it was totally normal. The cause of the error is that the latest Luke’s release uses lucene 2.4 libraries. If the index was created using the 2.9-dev libs, Luke will think that the index was malformed. We just need to update the libs to make it work.

First of all I downloaded the Luke’s source code . Opened the lib folder and replaced the 2.4 for the ones of the lucene developers release. Once done I compiled the surce with ant and… that’s it, I could check my indexed data using my compiled version Luke!

Tags: , ,