Thursday, 28 October 2010

The crab

The crab



Tuesday, 26 October 2010

The double accent virus

The double accent virus


Recently, i have caught the double accent virus. The problem was when i press the accent button in my keyboard, the PC, automatically put two accents: e.g. in Spanish, caf´´e instead of café.

If you have this poblem, first, prove in a console if the problem persist. If don't persist you can be sure that you have this virus. Don't worry, simply, download this program, and analyze your PC. Surely you will have to eliminate 4 or 5 virus, do it and restart your computer. Later the problem will have been removed.

Thanks.

Tuesday, 19 October 2010

How to start with SQLite?

How to start with SQLite?

SQLite is very easy to use, simple and very light. The database is saved in an only file.
SQLite works with MySQL syntax.

The easiest mode to create a database is using a client for SQLite. My recommendation is a plugin fo firefox called SQLite Manager.
You can get it here.

If you want connect your SQLite databse with Java, you will need the SQLite Connector:
You can get it here.
Below I explain the first steps to use it.






Initialize:


try {
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:"+DBpath);
}
catch(Exception e){
e.printStackTrace();
}

Execute query:

String select = "SELECT * FROM CONTENT WHERE ID=?";
PreparedStatement ps = conn.prepareStatement(select);
ps.setString(1, id);
ResultSet rs = ps.executeQuery();
rs.next();
if(rs.getString("CONTENT")!=null){
String path = rs.getString("CONTENT");
}
ps.close();
rs.close();

Execute Update:

ResultSet rs = null;
PreparedStatement ps = null;

ps = conn.prepareStatement("UPDATE CONTENT SET SIZE=?, TYPE=?, TIME=? WHERE ID=?");
ps.setInt(1, Integer.valueOf(size));
ps.setString(2, type);
ps.setDate(3, date);
ps.setString(4, id);
ps.executeUpdate();

ps.close();

Thanks for read me!

Monday, 18 October 2010

How to use UUID?

How to use UUID?



















In java:


First, we have to import the library:

import java.util.UUID;

Finally, we generate a random UUID.

String newId = UUID.randomUUID().toString();

Easy? Yes, a lot.

Friday, 1 October 2010

Leo Messi gana la bota de oro! Ya tocaba!

Leo Messi gana la bota de oro! Ya tocaba!

Felicidades Leo!!

Se la merecía des de hace tiempo!

Ayer estaban dando un resumen de algunos de sus goles, y perdí la noción del tiempo.

Gracias por hacer que éste deporte siga siendo así de especial.

Video de algunos de tus mejores goles.