Archivo

Archivo para la categoría ‘java’

¿Amanda se vuelve una solución comercial?

Sábado, 27 de Febrero de 2010

Hoy leyendo mis correos de la lista de Amanda (a la cual estoy metido más por razones sentimentales que otra cosa) me conseguí con esto:

Greetings;

I have taken note that there have been no new snapshots made available in a
bit over 3 weeks now, and other than the downloads page, all of the rest of
the new web pages point to paid support.

What is the future direction of amanda?

No es una sorpresa, yo ya habia visto algo de esto en Community East con ZAmanda. Amanda es en mi opinión el mejor software de respaldo de código abierto que existe hoy en día y su evolución hacia software comercial con raíces de código abierto (como MySQL) es evolucionaría.

Yo realmente creo que el producto va a mejorar, sobre todo que ahora puede ser considerado una alternativa con soporte pago para las empresas (y definitivamente no creo que lo cierren).

java, kodegeek, linux, opensource , , ,

Pervasive computing: Sentilla once again

Sábado, 6 de Febrero de 2010

Ya ha pasado un rato laaaargo desde que juegue con mis motes de Sentilla Lab. La última aplicación que escribí (AguaYFuego) requiere un poco de maquillaje (en aquel entonces lo hice con Swing y JFreeChart). Esta vez voy a probar una nueva dirección.

Ahora que tengo mi servidor Mac mini ocioso creo que es hora de poner a trabajar ese equipo. Por ahora me estoy bajando las actualizaciones para OSX y poniéndole las pilas a los sensores :)

java, programación , , ,

Es oficial: Kenai.com tiene 60 días más de vida

Martes, 2 de Febrero de 2010

Bueno, ya lo habia comentado anteriormente pero ahora es oficial:

Hello fellow Project Administrators,

It’s with a sad heart that we have to announce that the Kenai.com domain will be shutdown as part of the consolidation of project hosting sites now that Sun is a wholly owned subsidiary of Oracle.

Project Kenai has always existed as two different things: Kenai the infrastructure, and Kenai the website (Kenai.com). While it has come time to close the domain of Kenai.com, the infrastructure (which is already used under NetBeans.org) will live on to support other domains in the future.

With this decision from Oracle to close the Kenai.com domain, it is now time for project owners to begin the process of migrating their repositories and content over to other locations. A few things to note as you begin this process:

* More then one forum thread is going on at this time discussing alternative sites for hosting projects; this one appears to be the most active:

http://kenai.com/projects/help/forums/general/topics/2406-Alternatives-for-Kenai-com-

* For Source repositories, SVNSync can be used for Subversion. Git, and Hg are pretty simple by nature to move.

* Wiki source code is available to all project admins and can be cut and paste into any other site that supports the Mediawiki syntax.

* For Issue Trackers and Forum content, we are looking at ways to make that content available, but we have nothing at this time in place. If you can come up with a way to move the content on your own, proceed as such. Please do not wait for us.

The website will be closed to the creation of new projects in the next week. The complete shutdown of the site and the removal of the domain will be completed in the next 60 days (April 2nd 2010). This should provide ample time for all projects to be moved to a new home of the project owners choice.

If you have a private project (only available to Sun internal projects) those projects will continue to exist. We will send information about how to access those in a separate notice.

Any public projects that remain after the 60 day limit (April 2nd 2010) will be removed when the site is turned off.

It has been an amazing ride, and a great pleasure to personally work with so many of you over the last year or so. From the entire Project Kenai Team I want to thank you for all of the feedback, criticisms, and support over our time together.

With much respect,
The Project Kenai Team

No me queda otra que buscarle un nuevo hogar a StupidZombie. ¿Alguien tiene sugerencias? :)

java, opensource , ,

Se acabó Sun, ¿qué viene después?

Viernes, 29 de Enero de 2010

Esta semana ha sido una semana interesante para la gente que alguna vez utilizó productos de Sun Microsystems. Para no repetir lo obvio los dejo con una lista preparada por James Weaver (un fanático de JavaFX) el cual nos dá su opinión de las cosas que vienen.

Como toda transacción de este tipo, hay ganadores y perdedores. Las cosas cambian y la gente decide moverse para hacer cosas distintas. Por ejemplo, Sang Shin ,el creador e instructor de JavaPassion, mandó un correo de despedida en el cual nos cuenta que piensa seguir otras oportunidades fuera de Sun:

As a result of recent Sun/Oracle merger, I’ve decided to
leave Sun/Oracle and decided to pursue a career of teaching
and consulting.

What this means is that the “javafxhomeworks@sun.com”
homework alias will not work anymore from tomorrow.

A new homework alias has been created and it is

javafxhomeworks@javapassion.com (same address with
different domain name)

Please send your homework to the new address above from
now on.

If you already submitted all the homeworks and personal
information to the old homework address, there is NO
need to resubmit since I have the copies.

Thanks.

-Sang Shin

Otra que me pegó de cerca es que Oracle planea descontinuar a Kenai.com. Para mi eso se traduce en que debo migrar el código de StupidZombie a otro sitio, probablemente Source Forge (pese a sus verrugas):

The Future of Kenai.com
With Sun now a wholly owned subsidiary of Oracle, the acquisition is triggering a consolidation process. Part of this process is the phasing out of the public-facing domain used for the Project Kenai Beta site. This action is being undertaken to provide the best project hosting solution for all of our customers into one location. Minimizing the number of current project hosting sites is a start in this direction. The consolidation process is underway and we will post notices about the plans and timeline as they become publicly available. The end-goal is to ensure we provide even more useful resources for all of the Oracle and Java developer communities.

Stay tuned as we work things through.

Ya hay gente que comenzó a irse debido a la adquisición de Sun por parte de Oracle. Charles Nutter (desarrollador lider de JRuby) nos cuenta desde Twitter:

Sounds like the post-merger bloodletting has begun at Sun/Oracle. Already hearing about some friends getting laid off :(

Al mismo tiempo que Jonathan Schwarts se despide de Sun:
As for where life takes me next, you should follow me via Twitter at openjonathan to find out. I’ll also be rehosting this blog (and again, stay tuned to Twitter by following me here). I expect to do my part to keep things interesting.

Thank you for your support and commitment. I wish you all the best of luck building, taking advantage of (and likely wearing) the future!

Jonathan Schwartz
CEO, Sun Microsystems, Inc.
A Wholly Owned Subsidiary of Oracle Corporation.

No todo es malo, el solapamiento de areas entre Sun y Oracle es mínimo y por los menos Java, JavaFX y NetBeans tienen un futuro promisorio. MySQL tampoco se puede quejar (al menos por los momentos) y este año viene un JavaOne.

Tiempos interesantes, los dejo con un enlace de mi experiencia en Java One del 2008. Me pone algo nostálgico :)

java, javafx, opensource, programación , , , ,

Aprendiendo JavaFX: Animaciones

Domingo, 24 de Enero de 2010

Más código del curso de JavaFX. Aún sigo retrazado, la entrega final es el 3 de Febrero pero aún tengo esperanzas de llegar a tiempo :) .

En este caso, estuve trabajando en la lección de animaciones; La idea es hacer que un par de tiburones se paseen por la pantalla de manera indefinida:

Animación de tiburones en JavaFX

Animación de tiburones en JavaFX

El código como siempre se lo pueden bajar desde la página de KodeGeek en Source Forge.

Las gracias a Sebastian (mi hijo de 3 años) ya que me dio una pista sobre como resolver el problema. Hasta que la animación no salió no se fué a jugar con sus juguetes :D

¡Que lo disfruten!

java, javafx, kodegeek, programación , ,

Aprendiendo JavaFX: Lección de interfaz gráfica avanzada

Sábado, 16 de Enero de 2010

Sigo progresando con el curso de JavaFX. En esta ocasión habia dos tareas y me decidí ha jugar con una aplicación que muestra localización usando el lenguaje.

El código se lo pueden bajar desde acá, y la aplicación se ve así:

Localización en JavaFX - Español Venezuela

La bandera animada de Venezuela es cortesía de Animated flag images by 3DFlags.com.

¡Que lo disfruten!

java, javafx, programación , , , ,

Aprendiendo JavaFX: GUI basics II

Domingo, 10 de Enero de 2010

Aqui les dejó el código de la tarea de esta sección del curso de JavaFX en JavaPassion . El resultado se ve como esto:

En este ejercicio el circulo se mueve en sentido contrario al cuadrado proporcionalmente (sólo en el eje X).

Que lo disfruten, pienso seguir agregando respuestas del curso (admito que estoy muy retrasado con respecto a la entrega final, pero no pienso rendirme :) )

java, javafx, kodegeek, opensource, programación , ,

Aprendiendo JavaFX en JavaPassion

Viernes, 8 de Enero de 2010

Este año me decidí a aprender cosas no relacionadas directamente con mi trabajo; En este caso estoy jugando con JavaFX, en particular haciendo el curso JavaFX de JavaPassion, dictado por Sang Shin.

El lenguaje se ve interesante, en particular el concepto de ‘binding’ es muy útil ya que todo el código del patron de Swing ‘listeners’ no es necesario.

Para la muestra, un ejercicio del curso en el cual nos piden hacer una vela usando las primitivas gráficas:


/*
* Main.fx
* Candle proyect
* Created on Jan 3, 2010, 12:51:42 PM
*/

package my_javafx_guibasics;

import javafx.scene.effect.Reflection;
import javafx.scene.Group;
import javafx.scene.paint.Color;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.RadialGradient;
import javafx.scene.paint.Stop;
import javafx.scene.Scene;
import javafx.scene.shape.Ellipse;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

/**
* @author josevnz at kodegeek.com
* License: GPL
*/
var totalWidth = 250;
var xCenterForComponents = (totalWidth / 2) - 50; // Sightly aligned to the left
var candleWidth = 50;
var radiousYflame = 35;
var centerYflame = 50;

var flame = Ellipse {
centerX: bind xCenterForComponents
centerY: centerYflame
radiusX: candleWidth * 0.30
radiusY: radiousYflame
fill: RadialGradient {
centerY: 1.0
centerX: 0.5
stops: [
Stop {
offset: 0.2
color: Color.BLUE
},
Stop {
offset: 0.6
color: Color.RED
}
Stop {
offset: 0.9
color: Color.ORANGE
}
]
}
};

var candle = Rectangle {
height: 150
width: candleWidth
translateX: bind xCenterForComponents - (candleWidth /2)
translateY: (radiousYflame + centerYflame) - 4
fill: LinearGradient {
startX: 0.0,
startY: 0.0,
endX: 1.0,
endY: 0.0
stops: [
Stop {
offset: 0.0
color: Color.WHITE },
Stop {
offset: 1.0
color: Color.BLACK
}
]
}
stroke: Color.BLACK
};

var candlePiecesGrp = Group {

content: [
flame,
candle
]
effect: Reflection {
fraction: 0.9
topOpacity: 0.5
topOffset: 3
}
}

Stage {
title: "My JavaFX GUI Basis"
width: totalWidth
height: totalWidth * 2
scene: Scene {
content: candlePiecesGrp
}
}

Y el resultado
JavaFX candle

Pienso ir colocando el código de los ejercicios para quienes lo quieran bajar y jugar (listo para usar en NetBeans), todo GPL.

java, kodegeek

Migrando KodeGeek de CVS a Subversion en SF.net

Viernes, 25 de Diciembre de 2009

Bueno, creo que ya era hora de hacerlo. Así que lo hice en varios pasos, siguiendo las recomendaciones de SF.net:

  • Hacer un respaldo del código existente en CVS:

    rsync -av rsync://elangelnegro.cvs.sourceforge.net/cvsroot/elangelnegro/* .

    Hasta ahora bien.
  • Crear un vaciado para SVN usando cvs2svn:
    Hmm, no tan rápido:

    auyan:sf josevnz$ ~/Downloads/cvs2svn-2.3.0/cvs2svn --dumpfile=svndump .
    ERROR: cvs2svn uses the anydbm package, which depends on lower level dbm
    libraries. Your system has dbm, with which cvs2svn is known to have
    problems. To use cvs2svn, you must install a Python dbm library other than
    dumbdbm or dbm. See http://python.org/doc/current/lib/module-anydbm.html
    for more information.
    auyan:sf josevnz$

    OK, vamos a ver que tan difícil es de hacer en OSX. Lo primero que hice fué actualizar Python (2.5 -> 3.1.1) usando un paquete pre-compilado:

    auyan:sf josevnz$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
    Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
    [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.

    El script cvs2svn fué escrito en Python 2.5, no 3. Así que lo convertimos con un poco de ayuda:

    auyan:sf josevnz$ /Library/Frameworks/Python.framework/Versions/3.1/bin/2to3 -w ~/Desktop/cvs2svn-2.3.0/cvs2svn
    RefactoringTool: Skipping implicit fixer: buffer
    RefactoringTool: Skipping implicit fixer: idioms
    RefactoringTool: Skipping implicit fixer: set_literal
    RefactoringTool: Skipping implicit fixer: ws_comma
    RefactoringTool: Refactored /Users/josevnz/Desktop/cvs2svn-2.3.0/cvs2svn
    --- /Users/josevnz/Desktop/cvs2svn-2.3.0/cvs2svn (original)
    +++ /Users/josevnz/Desktop/cvs2svn-2.3.0/cvs2svn (refactored)
    @@ -69,7 +69,7 @@

    try:
    svn_main(os.path.basename(sys.argv[0]), sys.argv[1:])
    -except FatalException, e:
    +except FatalException as e:
    sys.stderr.write(str(e) + '\n')
    sys.exit(1)

    RefactoringTool: Files that were modified:
    RefactoringTool: /Users/josevnz/Desktop/cvs2svn-2.3.0/cvs2svn

    Más las librerías de cvs2svn:

    auyan:sf josevnz$ for file in `ls ~/Desktop/cvs2svn-2.3.0/cvs2svn_lib/*.py`; do /Library/Frameworks/Python.framework/Versions/3.1/bin/2to3 -w $file; done
    # Montón de paja omitida por brevedad :)

    Además de unos pequeños cambios en el código (las líneas que requieren edición tienen número por delante):


    1 #!/Library/Frameworks/Python.framework/Versions/3.1/bin/python3
    2 ##!/usr/bin/env python
    3 # (Be in -*- python -*- mode.)
    55 #if not ((2,4) < = version < (3,0)):
    56 # sys.stderr.write(
    57 # version_error + ' version %d.%d.%d.\n'
    58 # % (version[0], version[1], version[2],)
    59 # )
    60 # sys.stderr.write(version_advice)
    61 # sys.exit(1)

    Sin embargo el Python 3 es anal acerca de la mezcla de espacios y tabulación:

    ...
    TabError: inconsistent use of tabs and spaces in indentation

    Traté de arreglarlo rápidamente, pero lo que hice fué empeorar la situación:

    auyan:sf josevnz$ perl -p -i -e 's#\t# #g' /Users/josevnz/Desktop/cvs2svn-2.3.0/cvs2svn_lib/*.py
    auyan:sf josevnz$ ~/Desktop/cvs2svn-2.3.0/cvs2svn --dumpfile=svndump .
    Traceback (most recent call last):
    File "/Users/josevnz/Desktop/cvs2svn-2.3.0/cvs2svn", line 68, in <module>
    from cvs2svn_lib.main import svn_main
    File "/Users/josevnz/Desktop/cvs2svn-2.3.0/cvs2svn_lib/main.py", line 30, in <module>
    from cvs2svn_lib.svn_run_options import SVNRunOptions
    File "/Users/josevnz/Desktop/cvs2svn-2.3.0/cvs2svn_lib/svn_run_options.py", line 40, in <module>
    from cvs2svn_lib.svn_output_option import DumpfileOutputOption
    File "/Users/josevnz/Desktop/cvs2svn-2.3.0/cvs2svn_lib/svn_output_option.py", line 83
    cvsauthor = to_utf8(cvsauthor)
    ^
    IndentationError: unindent does not match any outer indentation level

    No me jodan. Demasiado tratar de que este script funcione con Python 3, ¿será más fácil instalar las librerías faltantes y que Python 2.5 las reconozca?

    Me decidí entonces de usar las librerías compatibles con DBM. Nos las bajamos de Oracle y compilamos:


    auyan:db-4.8.26 josevnz$ pwd
    /Users/josevnz/Desktop/db-4.8.26
    auyan:db-4.8.26 josevnz$ ./dist/configure && make
    auyan:db-4.8.26 josevnz$ cd build_unix/
    auyan:build_unix josevnz$ ../dist/configure && make && make install && export DYLD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.8/lib:$DYLD_LIBRARY_PATH

    Instalé entonces capa de Python que enlaza con DBM, bsddb3 4.8.1:

    auyan:bsddb3-4.8.1 josevnz$ pwd
    /Users/josevnz/Downloads/bsddb3-4.8.1
    auyan:bsddb3-4.8.1 josevnz$ python setup.py build

    Y como todo salió bien:

    sudo python setup.py install

    Pero ¿funcionará ahora?:


    auyan:sf josevnz$ ~/Downloads/cvs2svn-2.3.0/cvs2svn --dumpfile=svndump .
    # Omitiendo salida del comando....
    cvs2svn Statistics:
    ------------------
    Total CVS Files: 362
    Total CVS Revisions: 603
    Total CVS Branches: 0
    Total CVS Tags: 0
    Total Unique Tags: 0
    Total Unique Branches: 0
    CVS Repos Size in KB: 7377
    Total SVN Commits: 228
    First Revision Date: Thu Jan 13 16:10:27 2005
    Last Revision Date: Sat Jul 18 23:49:03 2009
    ------------------
    Timings (seconds):
    ------------------
    2.132 pass1 CollectRevsPass
    0.063 pass2 CleanMetadataPass
    0.009 pass3 CollateSymbolsPass
    0.163 pass4 FilterSymbolsPass
    0.017 pass5 SortRevisionSummaryPass
    0.031 pass6 SortSymbolSummaryPass
    0.089 pass7 InitializeChangesetsPass
    0.095 pass8 BreakRevisionChangesetCyclesPass
    0.092 pass9 RevisionTopologicalSortPass
    0.031 pass10 BreakSymbolChangesetCyclesPass
    0.080 pass11 BreakAllChangesetCyclesPass
    0.062 pass12 TopologicalSortPass
    0.169 pass13 CreateRevsPass
    0.016 pass14 SortSymbolsPass
    0.009 pass15 IndexSymbolsPass
    1.075 pass16 OutputPass
    4.134 total

    ¡Exito! :D

  • Importar el código de nuevo en SVN:

    Ahora no queda otra más que tratar de importar el archivo que fué creado en el paso anterior:

    auyan:sf josevnz$ ls -l svndump
    -rw-r--r-- 1 josevnz josevnz 8600150 Dec 25 20:53 svndump
    gzip svndump

    SF.net tiene una consola especial para estos casos. En este caso cree mi nueva sesión y me dispuse a trabajar:

    auyan:~ josevnz$ ssh -t josevnz,elangelnegro@shell.sourceforge.net create
    The authenticity of host 'shell.sourceforge.net (216.34.181.119)' can't be established.
    RSA key fingerprint is b4:c5:6c:36:f7:ad:2c:23:52:e1:84:3e:77:61:5d:59.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'shell.sourceforge.net,216.34.181.119' (RSA) to the list of known hosts.
    josevnz,elangelnegro@shell.sourceforge.net's password:

    Requesting a new shell for "josevnz" and waiting for it to start.
    queued... creating... starting...
    This is an interactive shell created for user josevnz,elangelnegro.
    Use the "timeleft" command to see how much time remains before shutdown.
    Use the "shutdown" command to destroy the shell before the time limit.
    For path information and login help, type "sf-help".

    [josevnz@shell-23008 ~]$
    [josevnz@shell-23008 ~]$ timeleft
    Time remaining before shutdown: 239 minutes.

    Subiendo el código:

    auyan:sf josevnz$ rsync -aiv svndump.gz josevnz,elangelnegro@web.sourceforge.net:htdocs
    josevnz,elangelnegro@web.sourceforge.net's password:
    building file list ... done

    sent 6067785 bytes received 42 bytes 49132.20 bytes/sec
    total size is 6066914 speedup is 1.00

    Y finalmente el proceso de importación en varios pasos:

    [josevnz@shell-23008 ~]$ adminrepo --checkout svn
    Lock and checkout the svn repository for elangelnegro? [ny] y
    Repository locked -- starting checkout copy.
    ...

    [josevnz@shell-23008 ~]$ ls -l /home/groups/e/el/elangelnegro/htdocs/svndump.gz
    -rw-rw-r-- 1 josevnz elangelnegro 6066914 Dec 26 01:53 /home/groups/e/el/elangelnegro/htdocs/svndump.gz
    [josevnz@shell-23008 ~]$ gunzip /home/groups/e/el/elangelnegro/htdocs/svndump.gz
    [josevnz@shell-23008 ~]$ svnadmin load /svnroot/elangelnegro < /home/groups/e/el/elangelnegro/htdocs/svndump
    ....
    ------- Committed revision 227 >>>

    < << Started new transaction, based on original revision 228
    * editing path : trunk/src/java/main/com/kodegeek/blog/twitter/TwitterPing.java ... done.
    [josevnz@shell-23008 ~]$ adminrepo --save svn

  • Desactivar el soporte de CVS para el proyecto

    Primero verifiqué que podía acceder el nuevo repositorio:

    svn co https://elangelnegro.svn.sourceforge.net/svnroot/elangelnegro elangelnegro

    Y después de eso desactive el acceso a CVS.

Así que de ahora en adelante el código está disponible usando SVN en la siguiente ubicación:

  • svn co https://elangelnegro.svn.sourceforge.net/svnroot/elangelnegro elangelnegro

¡Que lo disfruten!

java, kodegeek, opensource, programación

¿Cual es su patrón de diseño preferido?

Sábado, 21 de Noviembre de 2009

Para mi Observer – Observable es el que más uso, no solamente en aplicaciones Swing sino en aplicaciones que reciben datos de por la red. Factory en segundo lugar y quizas Singleton en tercero.

Por supuesto es muy fácil abusarlos, pero con cuidado simplemente son indispensables :)

¿Y cual es el suyo, y porqué?

java, programación