Kernel Idea

Febrero 24, 2009

NO!

Archivado en: Informatica — Etiquetas:, , , , , — JuanBC @ 8:56 pm

No importa que tanto discutan los ignorantes:

Tortoise no es SVN.

Asi como Netbeans o Eclipse no son Java.

Febrero 19, 2008

Tengo Ganas…

Archivado en: Programación — Etiquetas:, , , , , , — JuanBC @ 8:23 pm

…de programar algo interesante… opciones:

A – Un Api de ROL de cros en Python o Java.
B – Terminar el maldito manejardor de fichas terminológicas.
C – Portar a Mono el traductor de WikiSubtitles.

Diciembre 1, 2007

Un aporte a “Google translate api”

Archivado en: Java, Programación, Translation, gpl v3 — Etiquetas:, , , , , , , , — JuanBC @ 4:36 am

He estado usando el google tranlate api, para traducir de un lenguaje a otro. El pequeño problema es que no soporta todas las combinaciones como por ejemplo “Japones a Español”.

Mi solución, hacer una clase que cuando captura una excepción utilice otro lenguaje pasado por parámetro como intermedio; así el “Japones a Español” cambiaría a la forma “Japones a <otro lenguaje> a Español”. Además agregue un método que directamente utiliza el inglés como lenguaje intermedio (“Japones a Ingles a español”).

Para utilizar estos métodos es necesario primero importar el api de google ya que el código para identificar idiomas que utiliza es el brindado por la clase “Languages” de ese paquete.

mi código (Licenciado bajo la GPL v3)

/*
* GoogleConnection.java
*
* Copyright (C) – 27 de noviembre de 2007, 18:18 – juan b cabral
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* this is the code use to tranlate from one language to another when the combination is not soported.
* for example, if I need to translate “from Spanish to Japanese”
* this code will first try to do it directly, and when it gets an exception,will first try to use na intermediate
* language (usually english which is the
* most supported) and after trying with the intermediate language will try with Japanese.
*
*/

import com.google.api.translate.*;

/**
*
* @author Juan B Cabral
* @version 1.0
*/
public class GoogleConnection{

/**
* use as intermediate Language.ENGLISH
* @param String str
* @param String from
* @param String to
*/
public static String translateEnglishIntermediate(String str, String from, String to) throws java.net.MalformedURLException, java.io.IOException {
return getTranslation(str, from,to, Language.ENGLISH);
}

/**
* Try to translate directly the String from “from” language to “to” language
* or first translate from “from language” to “inter” (intermediate) language, and from “inter” language to “to” language
* @param String str
* @param String from
* @param String to
* @param String inter
*/
public static String getTranslation(String str, String from, String to, String inter) throws java.net.MalformedURLException, java.io.IOException{
try{
str=Translate.translate(str,from,to);
}catch(Exception e){
try{
str=Translate.translate(str,from,inter);
str=Translate.translate(str,inter, to);
}catch(Exception e2){
throw e2;
}

}
return str;
}

}

Noviembre 26, 2007

Probando Netbean 6.0 Rc2

Archivado en: Java — Etiquetas:, , , , , — JuanBC @ 6:17 pm

Netbeans 6rc2

Anda mal, anda lento… sus plugins por defecto te chupan todo el ram… tuve que sacar glassfish y el editor de webpages.

Pero es un buen avance… todavía encuentro mejor solucion para uml en Umbrello y para diseño web en Kompozer. Eso sí, tener C/C++ en netbeans me gusto mucho.

A esperar Netbeans 6.0 Version Final

Blog de WordPress.com.