Wednesday 24 November 2010

Homenatge al viatge a Sweden

Homenatge al viatge a Sweden


M'emporto molts bons moments d'aquest viatge.

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.



Thursday 30 September 2010

Hattrick - Usuarios conectados - DEFINITIVO!

Hattrick - Usuarios conectados - DEFINITIVO!

Hola, voy a dejar un estudio mucho mas preciso de los que hay actualmente:

He recogido datos cada minuto des del día 15/09/2010 hasta el día 30/09/2010.
Se han usado para la gráfica 21570 datos.



Tuesday 28 September 2010

Sortida en moto - Montseny

Sortida en moto - Montseny

La veritat és que ja en tenia ganes. És una sensació impresionant. Com apareix l'adrenalina i la por a la vegada...


A la foto, l'Alfonso (Suzuki GSX 600R) i jo mateix (Yamaha YZF R6) .



















Perque fer vaga?

Perquè fer vaga?

1.-Se amplían las causas para despedir
2.- Se limita la tutela administrativa y judicial de los despidos
3.- Se facilita el despido express por causas objetivas, para eliminar lo salarios de tramitación
4.- Estos despidos pasan a estar subvencionados con recursos públicos
5.- En el despido objetivo, se rebaja el plazo de preaviso y la indemnización en caso de incumplirse
6.- Al legalizarse los despidos, se pierde el derecho a la estabilidad en el empleo, y se produce una reducción sustancial de la indemnización por cese
7.-La reforma del despido afecta sobre todo a los actuales trabajadores fijos con mayor antigüedad
8.-Ante la misma situación en la empresa, ha convertido en más barato despedir a los trabajadores que, simplemente, cambiarles el horario o los días de trabajo, o un traslado a otra localidad
9.- En la práctica, la aportación del Fogasa supone que despedir a los trabajadores fijos cuesta lo mismo que despedir a los temporales
10- Se facilita la utilización del despido express, sin causa y con indemnización rebajada, y sin abono de salarios de tramitación
11.- Se subvenciona el cese de estos trabajadores a cargo del FoGAsA. El ministerio admitirá expresamente que la subvención se abone aunque la empresa reconozca que no tiene razones para el cese y el despido sea improcedente.
12.- La financiación pública supondrá que el despido sin causa tendrá un coste para la empresa de 25 días de salario por año de servicio, en lugar de los 45 días por año del despido improcedente
13.-La empresa tendrá capacidad para suprimir los derechos establecidos en los convenios colectivos sectoriales
14.- Se amplía la capacidad del acuerdo de empresa para fijar un régimen salarial inferior al establecido en el convenio del sector
15.- Se reconoce el poder del empresario para incumplir los derechos establecidos en los pactos y acuerdos de empresa
16.-Se podrán tramitar despidos colectivos y objetivos en las Administraciones Públicas (los que creen que serán más felices si otros trabajadores pierden derechos están de enhorabuena).

(Fuente, http://asaltarloscielos.blogspot.es/)

Eduard Punset a El convidat

Thursday 23 September 2010

Usuarios conectados Hattrick - Lunes

Usuarios conectados Hattrick - Lunes

Tuesday 21 September 2010

Usuarios conectados Hattrick

Usuarios conectados Hattrick

Bueno, aquí tenemos el tan esperado resultado sobre los usuarios conectados en Hattrick.

Podemos observar que debido a la inestabilidad de los momentos en la recogida de datos, se crean picos importantes. Así que podemos deducir que es un tanto irregular, pero no por eso, menos válido.

Podemos compararlo con el estudio anterior, recuerdo que se hizo con una toma de usuarios por hora durante 2 semanas. Lo tenemos aquí:

http://no-suelo.blogspot.com/2010/09/users-connected-to-hattrick.html



Paulatinamente iré publicando los gráficos con los dias de la semana por separado, para que sea mas preciso, y os pueda ayudar, a elegir en que momento poner en venta un jugador.

Os avanzo que actualmente estoy haciendo una recogida de datos cada minuto, y que en breve tendré algunos resultados.

Saludos y gracias a todos los participantes y a todos lo lectores. Pero en especial a -B-J-
que se ha encargado de hacer toda la recogida de los datos del foro.

Tuesday 14 September 2010

How to use xls ( Excel ) files in Java

How to use xls (Excel) files in Java

First, you need the POI library. You can download it here.


To work with a xls File with Java is very easy. Simply, you have to fix in Rows and Cells.













I show you a part of source code, it's more easy to understand.

import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

Workbook wb = new XSSFWorkbook();
FileOutputStream fos = new FileOutputStream("C:\\sample.xlsx");
Sheet sh = wb.createSheet("newSheet1");
sh.createRow(0);

sh.getRow(0).createCell(0).setCellValue("Hours");
sh.getRow(0).createCell(1).setCellValue("Sunday");
sh.getRow(0).createCell(2).setCellValue("Monday");
sh.getRow(0).createCell(3).setCellValue("Tuesday");
sh.getRow(0).createCell(4).setCellValue("Wednesday");
sh.getRow(0).createCell(5).setCellValue("Thursday");
sh.getRow(0).createCell(6).setCellValue("Friday");
sh.getRow(0).createCell(7).setCellValue("Saturday");





for(int k = 1; k<25;k++){
sh.createRow(k);
sh.getRow(k).createCell(0).setCellValue(k-1);
}

for (int i = 0; i <>
for(int j = 0; j<24;j++){
sh.getRow(j+1).createCell(i+1).setCellValue("Row "+j+" Cell "+i);
}
}

To finish correctly you need add this:

wb.write(fos);
fos.close();




















Now, the file already contents the data.

See you.

Yamaha YZF R6 ... se sale

Yamaha YZF R6 ... se sale

Bueno....yo creo que mi nueva joya se merecía ya un post...

No os podéis imaginar lo que es tener este bicho debajo de tu culo...




















Sin darte cuenta vas a 180km/h...si le apretas...solo tu miedo te impide alcanzar la velocidad que quieras...

Suerte!

Friday 10 September 2010

Users connected to Hattrick

Users connected to Hattrick

The moment when a player is selled is very important for the economy of our team.
For that reason, I have made a plot with the days and moments of the connected users.

Maybe, if our selling player finishes at time when a lot of users are connected, we could earn much money, because there are a lot of people looking him.

A plot attached here:



The data have been collected during the last 2 weeks.

Luck!

Making money free without effort - AdSense

Making money free without effort - AdSense

Do you want to make money?

Is very easy. You only need 2 things:

  1. A blog.
  2. A Google AdSense account.
If you have some inspiration or if you want to say something to everybody. Make it, is very easy.
Simply write somthing interesting for the world.

If your blog receives a lot of visits, you will win much money.
For each click in an advert of your blog, you will receive some money.

Good lucky!

How to create a MySQL Trigger

How to create a MySQL Trigger

This is the sintax:
CREATE [DEFINER = { user | CURRENT_USER }]
TRIGGER
trigger_name {AFTER | BEFORE} {INSERT | UPDATE | DELETE}
ON
tbl_name FOR EACH ROW {your_body}

An example:

CREATE TRIGGER sdata_insert BEFORE INSERT ON `sometable`
FOR EACH ROW
BEGIN
SET NEW.guid = UUID();
END
;

Wednesday 8 September 2010

How to install Eclipse SVN

How to install Eclipse SVN

SVN plugin is essencial for our Eclipse

To install it we need to do a few simple steps:

1.- Open Eclipse
2.- Press in the "Install New Software" in the Help tab.



3.- Press Add button: Eclipse will open a new window.
4.- In Name, we can put any name(Recommended a orientative words)
5.- In Location, we have to put this URL: http://subclipse.tigris.org/update_1.6.x



6.- Press OK button: the window will close
7.- In the background window will charge a 3 packages
8.- Mark the 3 packages (Core SVNKit Library, Optional JNA Library, Sublicpse)



9.- Press the next button
10.- Press the next button
11.- Mark the accept terms



12.- If any problem occur, we must accept the certificate(mark it) and press the next button




If you eant visit the official webPage... see this: http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA

Regards

Tuesday 7 September 2010

Calling AJAX with JQuery - Accepted parameters

Calling AJAX with JQuery

AJAX permit us to make calls to a webservice from Javascript. Bear in mind that the Javascript code is executed in the client computer.

Let's see how make an AJAX call using JQuery.

In the Head of our HTML code we have to link the JQuery library. (Google offers us without need to download or add to our project)

src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.js"

In the Javascript code:
The code base to make a call is the follow:

//Option 1.

$.ajax({
type: "GET",
url: URL,
success: allOK(msg),
error: ajaxError
}
);
//function that will be executed if the AJAX call is succesfull
function allOK(data){
alert(data);
}
//function that will be exected if the AJAX call fail
funtcion ajaxError(result){
alert("ERROR: " + result.status + ' ' + result.statusText);
}


//Opction 2.

$.ajax({
type: "GET",
url: URL,
success: function(msg) {
alert(msg);
},
error: function(result){
alert("ERROR: " + result.status + ' ' + result.statusText);
}
);

We can use the 2 notation types to treat the result.

1: Trating the result outside of the call using functions.
2: TTreating the result inside of the call.

A table with all parameter accepted for a AJAX call with the according description attached below.









Regards.

Llamada AJAX con JQuery - Parametros posibles

Llamada AJAX con JQuery - Parámetros posibles


AJAX nos permite hacer llamadas a un servicio web desde javascript. Recordad que Javascript se ejecuta en la máquina cliente.

Veamos pues como ejecutar una llamada AJAX usando JQUERY.

En el head del código HTML debemos linkar la librería JQuery(google la ofrece sin necesidad de descargarla y añadirla al proyecto):

src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.js"

En el código JAVASCRIPT:
El código básico para hacer una llamada es el siguiente:


//Opción 1.
$.ajax({
type: "GET",
url: URL,
success: todoBien(msg),
error: ajaxError
}
);
//función que será ejecutada si la llamada AJAX se ha realizado correctamente
function todoBien(data){
alert(data);
}
//función que será ejecutada si la llamada AJAX ha fallado
funtcion ajaxError(result){
alert("ERROR: " + result.status + ' ' + result.statusText);
}

//Opción 2.
$.ajax({
type: "GET",
url: URL,
success: function(msg) {
alert(msg);
},
error: function(result){
alert("ERROR: " + result.status + ' ' + result.statusText);
}
);

Como véis podemos usar los 2 tipos de notaciones para tratar el resultado:

1: tratar el resultado fuera de la llamada mediante funciones.
2: tratar el resultado dentro de la llamada.

A continuación adjunto una tabla con todos los parámetros que acepta AJAX con su descripción correspondiente.










Un saludo.

Monday 6 September 2010

Error Tomcat " permission denied " calling webservice

Error tomcat permission denied calling webservice

This is a usual error when we work with webServices and Tomcat.
Read all Post before prove the solution.

The solution is:

Go to your Tomcat base directory
Find the file 50local.policy ( usually you can find it in "$TOMCAT_BASE/conf/policy.d/" ) If you haven't this directory structure, I'm sure that you can find the file catalina.policy in directory "$TOMCAT_BASE/conf/". (Both file are OK).

You have to edit one of these. At the final of the file you should type this:

//Grant all permissions to the Your Webservice Name
grant codeBase "file:${catalina.base}/webapps/yourWebserviceName/-" {
permission java.security.AllPermission;
};

Finally save the file and restart the server.

* You must replace the red text with your information.

I hope that this resolve your problem.
Regards.

Friday 3 September 2010

Java: Obtener codigo fuente de una pagina web

Java: Obtener código fuente de una página web

Bueno, pues aquí un sencillo código:

String url = "http://www.google.com";
try{
URL url = new URL(url);
URLConnection conn = url.openConnection();
conn.connect();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String data;
while ((data = in.readLine()) != null) {
//lo que tu quieras hacer con cada linea
}
}
catch (Exception ex){
ex.printStackTrace();
System.out.println("ERROR: "+ex.getMessage());
}
Un saludo.

Estudio Ventas Anotacion Hattrick

Hattrick - Estudio precio de venta de anotación


Bueno, aquí os dejo un gráfico con los precios de venta de los delanteros en 2 semanas de datos.

Hattrick precios medios venta de delanteros según su nivel de habilidad.

How to Disable Gmail Priority Inbox

How to Disable Gmail Priority Inbox

Have you tried the Priority Inbox but for any reason you've decided remove it?

It's very easy diable it, see how:



Thursday 2 September 2010

Perro mas fuerte del mundo


¿Queréis un perro que os protega?

Esta bestia, nunca mejor dicho, se llama Wendy, y está así de cuadrada por un defecto genético. Los médicos estiman que su esperanza de vida sea la mitad que la de un perro de su raza...
Pero de momento...a ver quien se mete con ella... o sus dueños...

Tote King - Redes Sociales

Microsoft Silverlight

Check out this SlideShare Presentation:

The Offspring - You're Gonna Go Far, Kid

Error call AJAX JQuery


Error call AJAX with JQuery

I’m sure that you have ever had this problem.

" Access to restricted URI denied ” code: “ 1012 "

Or the AJAX request with JQuery is correct but it seems that don’t run?

Well, is very important to ensure that the call is being made to a service within the same domain as the AJAX service.

I always do the following: I create a web Service likes a Proxy. This will make the intermediary between the AJAX page and the world.

That is, our AJAX page always connect with our Proxy web Service, and this will implement the necessary calls to Internet.


Once done, our AJAX web and our Proxy web Service always will be together anywhere where we deploy them.

I personally, to create the Proxy web Service, use Java, creating a REST service with the Jersey library help. (this library is used to server and client). https://jersey.dev.java.net/

Later I will post a small tutorial on how to create a web Service REST in JAVA and how call to another web Service from JAVA.

Llamar AJAX xon JQuery: http://no-suelo.blogspot.com/2010/09/llamada-ajax-con-jquery-parametros.html


Regards.

Error llamada Ajax Jquery

Error llamada AJAX con JQuery

Seguro que habéis tenido este problema alguna vez...

" Access to restricted URI denied ” code: “ 1012 "

¿O simplemente la petición AJAX con JQuery és correcta pero parece que no hace nada?

Bueno, es muy importante asegurarse que la llamada se esté haciendo a un servicio dentro del mismo dominio que la del servicio AJAX.

En mi caso siempre hago lo siguiente: Creo un web Service que haga de Proxy entre nuestra página AJAX y el mundo...

És decir, nuestra página AJAX se cone
cta siempre contra nuestro web Service Proxy, y éste a su vez implementará las llamadas necesarias al exterior.

Una vez hecho esto, nuestra web AJAX y nuestro web Service Proxy siempre irán juntitos allí donde los despleguemos.

Yo personalmente para crear el web Service Proxy uso Java, creando un REST con la ayuda de la librería Jersey. (Nos sirve para hacer de servidor y de cliente)
https://jersey.dev.java.net/

Más adelante publicaré un pequeño tutorial de cómo crear un web Service JAVA y de cómo hacer llamadas a otro web Service desde JAVA.

http://no-suelo.blogspot.com/2010/09/llamada-ajax-con-jquery-parametros.html

Saludos.

Wednesday 1 September 2010

English returns!

Bueno, doncs al final m'he decidit a posar-me les piles per treure'm el senyor First Certificate.

M'acabo d'apuntar al British Council (BC) a fer l' upper-intermediate. També he provat sort a l' Escola Oficial d'Idiomes (EOI), però fins el dia 10 de septembre a la nit no sabré si m'ha tocat o no, així que curant-me en salut, aquest any faré anglès. Si em toca la EOI...doncs en faré molt xD.

Intentaré republicar tots els posts en anglès per anar practicant! Podeu corregir-me les errades en els comentaris! S'agraeix...


Record de l'esquiada


Hola senyors, doncs aquí va un POST en honor d'aquella gran setmana que vam passar tots junts i on vaig començar a menjar mandarines...xD

Hacking WII without chip

WII 3.1 E
My Wii has been hacked correctly by this way:
Situation of beginning: Wii with IOS36 Version 3.1 E
Supposing you have the Home Brew Channel(HBC) installed: I installed it by means of Zelda game.

Install the cIOS 249 by Waninkoko, version IOS36 revision 10.
Later, you have to update the cIOS with the cIOS 249 Versión X rev 20b.

You can find both cIOS in this web page: http://wii.scenebeta.com/noticia/cios

Finally, you should install the cfg usb loader: http://wii.scenebeta.com/noticia/cfg-usb-loader

Now, you have your WII prepared to load your iso games from a Hard Disk. You must have a prepared hard disk, that is, having a partition in wbfs format.
You can use the WBFS manager program for this. This program also serves to add the isos from your PC to the WBFS partition of your HD.

Thank you.

Piratear WII sin chip

WII 3.1 E
Lo que me ha funcionado en mi WII ha sido lo siguiente:
Wii con IOS 3.1E (mirarlo en Menu de WII)
Suponiendo que tenéis el Home Brew Channel (HBC): Yo lo instalé gracias al juego Zelda.

Instalar el cIOS 249 de Waninkoko, versión IOS36 rev 10.
Una vez tenemos esto, Atualizarlo: Tenéis que instalar el cIOS 249 Versión X rev 20b.

Podéis encontrar los 2 cIOS en http://wii.scenebeta.com/noticia/cios

Por último, instalar el cfg usb loader: http://wii.scenebeta.com/noticia/cfg-usb-loader

Ya tenemos nuestra WII preparada para cargar nuestros juegos .iso desde un Disco Duro.
Debéis tener el disco duro preparado, es decir tener una partición en formato wbfs.
Podéis usar el pograma WBFS manager para ello. También sirve para pasar las isos.

Gracias