Archivo

Archivo para la categoría ‘opensource’

¿Como saber el tipo de un archivo? (I)

Sábado, 26 de febrero de 2011

Por alguna razón, este articulo viejo ha tenido algo de tráfico en los últimos días. Me dí cuenta que la idea de usar Java y JNI nunca se materializó, sólo dí unas pistas.

Una forma de hacer esto es llamando a la librería ‘magic’. Magic viene prácticamente en cualquier sistema operativo que se parezca a UNIX que se respete, como BSD, OSX y por supuesto Linux.

Si usted llama a la página man (man 3 libmagic) allí encontrará suficiente información. Por ejemplo, aquí les muestro un pequeño programa que hice en C el cual detecta el tipo de archivo que usted le pase por la línea de comandos:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include 
#include 
 
/*
 * Program that shows how to use the magic library to figure out the type of a file
 * @author Jose V Nunez (josevnz@kodegeek.com)
 * License: BSD
 */
int main(int argc, char ** argv) {
 
        if (argc == 1) {
                printf("[ERROR]: Please provide the file name to check and try again!\n");
                return 1;
        }
 
        // See manpage libmagic for details on what this flags mean
        int flags = MAGIC_SYMLINK|MAGIC_COMPRESS|MAGIC_CONTINUE|MAGIC_PRESERVE_ATIME|MAGIC_ERROR;
 
        magic_t cookie = magic_open(flags);
        if (cookie == NULL) {
                printf("There was a problem opening the magic library!\n");
                return 1;
        }
        int status = magic_load(cookie, NULL);
        if (status != 0) {
                printf("Unable to load magic default database!, %s\n", magic_error(cookie));
                magic_close(cookie);
                return 1;
        }
 
        const char * file_details =  magic_file(cookie, argv[1]);
        printf("Type for file: %s is %s\n", argv[1], file_details);
 
        magic_close(cookie);
        return 0;
}

Para compilarlo les dejo un archivo Makefile:

1
2
3
CPPFLAGS += -O2 -L/Users/Shared/lib -I/Users/Shared/include -lmagic
all: magic.c
        $(CC) $(CPPFLAGS) magic.c -o magic

Y finalmente como se corre:

1
2
3
4
5
auyan:c josevnz$ make
cc -O2 -L/Users/Shared/lib -I/Users/Shared/include -lmagic magic.c -o magic
auyan:c josevnz$ ./magic /Users/josevnz/CTX.DAT
Mime type for file: /Users/josevnz/CTX.DAT is Java serialization data, version 5
auyan:c josevnz$

En la siguiente entrada las prometo como hacer esto desde Java (pista, vamos a utilizar JNI).

–José

c, java, mime magic libmagic jni java, opensource, programación , , , , , ,

And the winner of the JavaFXpert RIA Exemplar Challenge

Lunes, 20 de septiembre de 2010

La aplicación es una belleza, además de que el código y el problema que resuelve son interesantes. Si agregar más nada
And the winner [of the JavaFXpert RIA Exemplar Challenge]

¡Ah, y tiene código abierto!

java, kodegeek, opensource, oracle, programación ,

NetBeans 6.9 ya está afuera, JUnit no incluido en JavaFX

Viernes, 18 de junio de 2010

Para quienes han seguido el asunto de NetBeans (el cual ya salió en su versión final 6.9) y la cucaracha de JUnit, este es el resultado: JUnit no es soportado en proyectos de JavaFX.

Uno de los desarrolladores de NetBeans me mostró en el reporte de la cucaracha en donde está desactivado.

¿Entonces, cual es la solución? Bueno, algo inconveniente pero que funciona, simplemente cree un proyecto de Java (no JavaFX) y entonces desde allí incluya sus pruebas de unidad.

Pero como una foto dice más que mil palabras les dejo el ejemplo abajo, creado con uno de los ‘magos de código’ (wizzards) de NetBeans:


¡Misterio resuelto!

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

NetBeans 6.9: JUnit aún está roto

Domingo, 13 de junio de 2010

Después de probar varias soluciones que leí en la red y de ver como aún la versión 6.9 RC2 aún tiene esta cucaracha me decidí a reportar el problema.

La cucaracha es la 187528.

Si tu eres uno de los afectados te invito a comentar esta cucaracha, de esta manera los desarrolladores de NetBeans le darán más prioridad ;)

–José

java, javafx, opensource, programación

Adios NetBeans 6.9, hola Eclipse Ganymede + Exadel JavaFX plugin

Domingo, 6 de junio de 2010

Instalando el plugin para Eclipse de JavaFX

¿Será que Exadel mejorará el soporte de JavaFX en Eclipse?


La última gota que derramo el vaso; NetBeans 9.6 beta se cayó en medio de una operación sencilla, sin correr ni siquiera JavaFX. Me tiene realmente irritado que ni siquiera puedo crear mis pruebas de JUnit, así que moví todo mi proyecto a Eclipse. Las pruebas de JUnit las hice en un momento pero ahora me encuentro que tengo que montar soporte JavaFX 1.3.

¿Será sencillo?
¿Será mejor que NetBeans 6.9?

No tengo nada en contra de NetBeans, de hecho yo lo utilicé mucho antes que Eclipse (cuando se llamaba Forte). Hay un grupo de gente dedicada a corregir errores, pero quiero ver si al fin puedo terminar este proyecto en vez de pasar el tiempo reiniciando mi IDE.

Como si todo fuera tan fácil; Resulta que el plugin de Exadel para Eclipse se tira 3 peos dando un mensaje de error que dice ‘bad .class version‘.

Vamos a ver si lo resuelvo hoy mismo, ¡sino no me quedará otra que seguir trabajando con JavaFX 1.2!

java, javafx, opensource, programación

¿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 , , ,

Monitoreo de sistemas con Ganglia

Sábado, 13 de febrero de 2010

Bueno, por razones del destino me estoy familiarizando con Ganglia. Ganglia es un sistema de monitoreo distribuido, similar a OpenNMS, el cual además de ser gratuito es extensible.

En mi caso lo tengo corriendo bajo OSX en mi Mac mini, lo cual me trajo ciertos dolores de cabeza en la instalación (sin embargo y como siempre ya alguien se las habia ingeniado para resolver el problema).

Ya les contaré como me va con este nuevo pasatiempo :D

opensource , ,

Oracle y el desnalgue de Kenai.com

Sábado, 6 de febrero de 2010

Esto me está ladillando de sobremanera. Primero Oracle decidió tumbar a Kenai.com en favor de Java.net (e inclusive aconsejó a sus usuarios a moverse a otros sitios para el hospedaje del código). Y resulta que hoy leyendo mi correo me consigo esta perla:

Gentlepeople,

In an effort to get information out to the Kenai community quickly, while trying to manage the integration of our two companies, I think we did a poor job at communicating our plans for Kenai.com to you. I would like to remedy that now.

Our strategy is simple. We don’t believe it makes sense to continue investing in multiple hosted development sites that are basically doing the same thing. Our plan is to shut down kenai.com and focus our efforts on java.net as the hosted development community.

We are in the process of migrating java.net to the kenai technology. This means that any project currently hosted on kenai.com will be able to continue as you are on java.net. We are still working out the technical details, but the goal is to make this migration as seamless as possible for the current kenai.com projects.

So in the meantime I suggest that you stay put on kenai.com and let us work through the details and get back to you later this month.

Thanks for your feedback and patience.

-Ted Farrell
Oracle Corporation

Si entiendo bien significa:

  • No se vayan a Source Forge, Google o GitHub, los queremos en Java.net
  • La migración de los proyectos de Kenai.com a Java.net debería ser más o menos transparente

¡Terminen de decidir que es lo que van a hacer!

Aún así pienso seguir investigando que tan complicado es sacar mi código de Kenai.com. Un mes de incertidumbre es una eternidad para un proyecto Open Source como StupidZombie :)

opensource , , ,

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 , , , ,