ALTERNATIVAS A JPCAP

Posted: domingo, 3 de octubre de 2010 by Skuarch in Etiquetas: , , ,
0



Como ya lo saben jpcap es una api para poder capturar los datos que pasan sobre las interfaces de red, pues aqui les muestro algunas alternativas:

jnetpcap http://jnetpcap.com/
JNetDev http://netdev.it.rit.edu/
JNetStream http://jnetstream.com/
jpckt32 http://sourceforge.net/projects/jpckt32/

PROCESOS EN PARALELO EN UBUNTU

Posted: martes, 6 de julio de 2010 by Skuarch in Etiquetas: ,
2



Si tienes una computadora con mas de un nucleo esto te puede servir para inicial aplicaciones en paralelo.

sudo update-bootsystem-insserv && sudo sed -i 's/CONCURRENCY=none/CONCURRENCY=startpar/g' etc/init.d/rc && sudo sh -c "echo 'CONCURRENCY=startpar' >> /etc/default/rcS"


espero que te sirva!!!!

CAMBIAR EL COLOR DE TR CON JQUERY

Posted: lunes, 28 de junio de 2010 by Skuarch in Etiquetas: , , , , ,
0



Para no utlizar funciones de javascript y cada vez que se quiera cambiar el color de un tr de una tabla se puede utilizar esto.


$(document).ready(function() {
$(function() {
$('.actionRow').hover(function() {
$(this).css('background-color', '#FFFF99');
},
function() {
$(this).css('background-color', '#FFFFFF');
});
});
});


obviamente agregas jquery a la pagina

LEER ARCHIVOS DE UNA CARPETA CON JAVA

Posted: viernes, 4 de junio de 2010 by Skuarch in Etiquetas: , ,
0



Lectura de archivos de una carpeta


import java.io.File;
import java.io.FilenameFilter;

public class FileFilterTest {

public static void main(String[] args) {

FilenameFilter filter=new FilenameFilter(){
public boolean accept(File dir, String fileName) {
return fileName.endsWith("java");
}
};

File f=new File("D:/Programs/Code");
String [] fileList=f.list(filter);
for (int i=0; i < fileList.length; i++){
System.out.println(fileList[i]);
}
}

}

COMPENDIO DE APIS

Posted: jueves, 3 de junio de 2010 by Skuarch in Etiquetas: , , , ,
0

El objetivo de este post es juntar todas las apis, bibliotecas, frameworks, plug ins y herramientas para que las podamos consultar en un futuro, espero que me puedan ayudar para que la lista crezca. GRACIAS !!

Loggers


log4j http://logging.apache.org/log4j/1.2/ [libreria]
SLF4J http://www.slf4j.org/ [libreria]
commons-logging http://commons.apache.org/logging/ [libreria]
logback http://logback.qos.ch/ [libreria]
Craftsman Spy http://zer0.free.fr/craftsman/spy.php [libreria] logger para jdbc
Houston http://ajax.sourceforge.net/houston/ [libreria]
jLo http://jlo.jzonic.org/ [framework]
jMyra http://www.jmyra.com/ [libreria]
JTraceDump http://jtracedump.sourceforge.net/ [libreria] provides a facility to keep a history of application processing steps in memory and dump it in case of an error. It is not a replacement, but an addition to trace- or debug-loggin
just4log http://just4log.sourceforge.net/ [libreria] Just4Log is a library to enhance dynamically the performance of various logging systems inside a java application
Limpid Log http://www.acelet.com/limpidlog/index.html [libreria] you can register a class of interest and the system will log all important information about the class
Logging Toolkit for Java http://www.alphaworks.ibm.com/tech/loggingtoolkit4j [libreria]
monolog http://monolog.ow2.org/ [libreria]
ObjectGuy http://www.theobjectguy.com/javalog/ [framework]
protomatter http://protomatter.sourceforge.net/ [libreria] includes a logging library that supports logging to the standard syslog UNIX daemon
simple-log https://simple-log.dev.java.net/ [libreria] is a small and simple logging library and requires you to do almost nothing (other than actually logging) to get log output happening.

Chat


jml http://sourceforge.net/apps/trac/java-jml [libreria]
jymsg http://sourceforge.net/apps/trac/java-jml [libreria]

Graficas


jfreeChart http://www.jfree.org/jfreechart/ [libreria]
ChartDirector http://www.advsofteng.com/ [libreria]
jChart http://jcharts.sourceforge.net/ http://www.jchart.com/ [libreria]

XML


jDom http://www.jdom.org/ [libreria]
Sax http://www.saxproject.org/ [libreria]
Castor http://www.castor.org/ [framework]
XMLBeans http://xmlbeans.apache.org/ [libreria]
XStream http://xstream.codehaus.org/ [libreria]
xerces http://xerces.apache.org/xerces-j/ [libreria]
xPath http://www.ibm.com/developerworks/library/x-javaxpathapi.html [libreria]

Redes


RockSaw http://www.savarese.org/software/rocksaw/ [libreria]
commons net http://commons.apache.org/net/ [libreria]
jsch http://www.jcraft.com/jsch/ [libreria]
jpcap http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/ [libreria]
jrtp https://jrtp.dev.java.net/ [libreria]
jperf http://sourceforge.net/projects/jperf/ [libreria]
JCIFS http://jcifs.samba.org/ [libreria]
j8583 http://j8583.sourceforge.net/ [libreria]
mina http://mina.apache.org/ [libreria]

Testing


jUnit http://www.junit.org/ [libreria]
jUnitEE http://www.junitee.org/ [libreria]
testNG http://testng.org/doc/index.html [framework]
jMeter http://projects.apache.org/projects/jakarta_jmeter.html [libreria]

Herramientas


find bugs http://findbugs.sourceforge.net/ [herramienta]
PMD http://pmd.sourceforge.net/ [libreria]
EasyPMD http://gianlucacosta.altervista.org/software/easypmd2/index.php [pluging netbeans]
hudson http://hudson-ci.org/ [herramienta]
Subclipse http://subclipse.tigris.org/ [plug ing para eclipse]
SVN http://subversion.tigris.org/ [herramienta] para el control de versiones
TraceTool http://tracetool.sourceforge.net/ [herramienta] is a logging library and viewer application for different programming environments, including Java.
Drools http://www.jboss.org/drools [herramienta]

WEB


struts http://struts.apache.org/ [framework]
Cobra http://lobobrowser.org/cobra.jsp [libreria]
Play http://www.playframework.org/ [framework]
Spring http://www.springsource.org/ [framework]
Tapestry http://tapestry.apache.org/ [framework]
WebWork http://www.opensymphony.com/webwork/ [framework]
JMesa http://code.google.com/p/jmesa/ [libreria]
Display tag http://www.displaytag.org/1.2/ [libreria]
facelets http://java.net/projects/facelets/ [framework]
myFaces http://projects.apache.org/projects/myfaces.html [framework]
Apache Wicket http://projects.apache.org/projects/wicket.html [framework]
Google web Toolkit http://code.google.com/intl/es-ES/webtoolkit/ [framework]
Smart Gwt http://code.google.com/p/smartgwt/ [framework]
Ext Gwt http://www.sencha.com/products/gwt/ [framework]
JBoss Seam http://seamframework.org/ [framework]
Vaadin http://vaadin.com/home [framework]
Wicket http://wicket.apache.org/ [framework]
icefaces http://www.icefaces.org/main/home/ [framework]
richfaces http://www.jboss.org/richfaces [framework]
primeFaces http://www.primefaces.org/ [framework]
Cocoon http://cocoon.apache.org/ [framework]
Turbine http://java-source.net/open-source/web-frameworks [framework]
Makumba http://www.makumba.org/ [framework]
Stripes http://www.stripesframework.org/display/stripes/Home [framework]
JPublish http://www.josso.org/confluence/display/JOSSO1/JOSSO [framework]
Streak http://strecks.sourceforge.net/ [framework-extension]
AribaWeb http://aribaweb.org/ [framework]
Avil http://njet.org/ [framework]
WebOnSwing http://webonswing.sourceforge.net/xoops.htm [framework]
ThinWire http://www.thinwire.com/ [framework]
Pustefix http://pustefix-framework.org/ [framework]
Vroom http://sourceforge.net/projects/vroom/ [framework]
Induction http://www.inductionframework.org/ [framework]
Chrysalis http://chrysalis.sourceforge.net/ [framework]
Jzeno http://jzeno.org/joomla/ [framework]
Sombrero http://www.sombrerosoft.de/ [framework]
JVx http://www.sibvisions.com/jvx [framework]
Maverick http://mav.sourceforge.net/ [framework]
Sofia http://www.salmonllc.com/sofia [framework]
jaffa http://jaffa.sourceforge.net/ [framework]

Web Services


Axis2 http://projects.apache.org/projects/axis2.html [libreria]
xFire http://xfire.codehaus.org/ [framework]

Criptografia


not-yet-commons-ssl http://juliusdavies.ca/commons-ssl/ [libreria]
BouncyCastle http://www.bouncycastle.org/java.html [libreria]
OpenSSL http://sourceforge.net/projects/openssl-java/ [libreria]

Object-Relational Mapping


hibernate http://www.hibernate.org/ [framework]
OpenJPA http://openjpa.apache.org/ [framework]
JDO http://db.apache.org/jdo/index.html [framework]
eclipselink http://www.eclipse.org/eclipselink/ [framework]
iBatis http://ibatis.apache.org/ [framework]
myBatis http://code.google.com/p/mybatis/ [framework]
Siena http://www.sienaproject.com/index.html [libreria]
Cayenne http://cayenne.apache.org/ [libreria]

JDBC


Connector/J http://www.mysql.com/downloads/connector/j/ [libreria]
sqljdbc http://msdn.microsoft.com/es-es/library/ms378749(v=SQL.90).aspx [libreria]
jtds http://jtds.sourceforge.net/ [libreria]

Pool de conexiones


commons-dbcp http://commons.apache.org/dbcp/ [libreria]
boneCP http://jolbox.com/ [libreria]
c3p0 http://sourceforge.net/projects/c3p0/ [libreria]

Otros


jAlarms http://sourceforge.net/projects/jalarms/ [libreria]
java.util http://www.ifs.tuwien.ac.at/ifs/lehre/eprog/javadoc/jdk/docs/api/java/util/package-summary.html [paquete]
JBPM http://www.jboss.org/jbpm [herramienta]
spy memcached client http://code.google.com/p/spymemcached/ [herramienta]
eric's console http://cs.roosevelt.edu/eric/console.html [libreria]
apache tika http://projects.apache.org/projects/tika.html [libreria]
JYaml http://jyaml.sourceforge.net/ [libreria] serializacion
JRebel http://www.zeroturnaround.com/jrebel/ [libreria] is a plugin for the Java Virtual Machine that enables on-the-fly reloading of changes made to Java class files
JCS http://jakarta.apache.org/jcs/ [libreria] JCS is a distributed caching system written in java. It is intended to speed up applications by providing a means to manage cached data of various dynamic natures.
archiva http://archiva.apache.org/ [libreria]
velocity http://velocity.apache.org/engine/index.html [libreria]
EJB http://download.oracle.com/javaee/6/tutorial/doc/ [framework]
openEJB http://velocity.apache.org/engine/index.html [framework]
apache lucene http://lucene.apache.org/java/docs/index.html [herramienta]

Informes y Documentos de Oficina


JasperReport http://jasperforge.org/projects/jasperreports [libreria]
iReport http://jasperforge.org/projects/ireport [libreria]
POI http://poi.apache.org/ [libreria]
iText http://itextpdf.com/ [libreria]
Pentaho reports http://reporting.pentaho.com/ [libreria]
apache PDFBox http://pdfbox.apache.org/ [libreria]

Compilación


Maven http://maven.apache.org/ [framework]
Ant http://ant.apache.org/ [libreria]
Gradle http://gradle.org/index.php [libreria]
Ivy http://ant.apache.org/ivy/index.html [libreria]

Interoperabilidad


Thrift http://thrift.apache.org/ [framework]

Administracion de Contenidos


Alfresco http://wiki.alfresco.com/wiki/Main_Page [herramienta]
Lenya http://projects.apache.org/projects/lenya.html [herramienta]
KENAI http://kenai.com/ [herramienta]
Riot http://www.riotfamily.org/index.html [herramienta]
Magnolia http://www.magnolia-cms.com [herramienta]

Interfaz Grafica de Usuario


Swing Application Framework https://appframework.dev.java.net/ [framework]
java Foundation Classes http://java.sun.com/products/jfc/download.html [libreria]
Better Swing Application Framework http://kenai.com/projects/bsaf/pages/Home [framework]
GUTS - Guice Utilities & Tools Set http://kenai.com/projects/guts/pages/Home [libreria]

Extenciones de la plataforma


Jython http://www.jython.org/ [lenguaje]
Scala http://www.scala-lang.org/ [lenguaje]
Groovy http://groovy.codehaus.org/ [lenguaje]
AspectJ http://www.eclipse.org/aspectj/ [lenguaje]
Clojure http://clojure.org/ [lenguaje]
ColdFusion http://www.adobe.com/products/coldfusion/ [lenguaje]
Gosu http://gosu-lang.org/ [lenguaje]
JRuby http://jruby.org/ [lenguaje]
Rhino http://www.mozilla.org/rhino/ [lenguaje]

UBUNTU BOTONES DE LADO DERECHO

Posted: miércoles, 2 de junio de 2010 by Skuarch in
0



Para poner los botones del lado derecho en las ventanas, se escribe esto en una terminal


$ gconftool-2 --type string --set /apps/metacity/general/button_layout "menu:maximize,minimize,close"


para regrearlo a su estado normal, osea del lado izquierdo


$ gconftool-2 --type string --set /apps/metacity/general/button_layout "maximize,minimize,close:menu"

CARGAR LIBRERIAS DLL EN JAVA

Posted: jueves, 20 de mayo de 2010 by Skuarch in Etiquetas: , , , , ,
0



Para poder cargar dll's en java se puede tener varios caminos como puede ser

System.loadLibrary("d:\\directoryX\\subDirY\\MyDll.dll")

ó

System.load("d:\\directoryX\\subDirY\\MyDll.dll");


utilizando la clase Runtime
Runtime.getRuntime().load("d:/directoryX/subDirY/MyDll.dll");


especificando a la jvm
java -Djava.library.path=c:/temp JNIJavaHowTo



y la exception que se lanza es java.lang.UnsatisfiedLinkError

fuente
http://www.rgagnon.com/javadetails/java-0318.html

COMANDO PARA BAJAR LA GAMMA EN UBUNTU

Posted: martes, 18 de mayo de 2010 by Skuarch in
0



Asi de facil, con este comando puedes bajar la gamma del monitor

xgamma -gamma 0.75


donde 0.75 es el nivel de gamma que quieres cambiar

BARRA DE DIRECCIONES EN NAUTILUS

Posted: lunes, 17 de mayo de 2010 by Skuarch in Etiquetas: , ,
0



para poder mostrar la barra de direcciones en ubuntu 10.04 se abre una terminal si se coloca el siguiente codigo

gconftool-2 --type=Boolean --set /apps/nautilus/preferences/always_use_location_entry true


para regresarla a la normalidad

gconftool-2 --type=Boolean --set /apps/nautilus/preferences/always_use_location_entry false

APLICACION EN SYSTEM TRAY CON JAVA

Posted: martes, 11 de mayo de 2010 by Skuarch in Etiquetas: , ,
0



la siguiente aplicacion es un ejemplo de SystemTray con java, esta funcionalidad fue incorporada en java SE 6

Este es un ejemplo basado en un codigo de oracle

import java.awt.Image;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public class SystemTrayTest {

    private TrayIcon trayIcon = null;

    public SystemTrayTest() throws Exception {

        if (SystemTray.isSupported()) {

            SystemTray tray = SystemTray.getSystemTray();
            Image image = Toolkit.getDefaultToolkit().getImage("tray.png");

            MouseListener mouseListener = new MouseListener() {

                public void mouseClicked(MouseEvent e) {
                    System.out.println("Tray Icon - Mouse clicked!");
                }

                public void mouseEntered(MouseEvent e) {
                    System.out.println("Tray Icon - Mouse entered!");
                }

                public void mouseExited(MouseEvent e) {
                    System.out.println("Tray Icon - Mouse exited!");
                }

                public void mousePressed(MouseEvent e) {
                    System.out.println("Tray Icon - Mouse pressed!");
                }

                public void mouseReleased(MouseEvent e) {
                    System.out.println("Tray Icon - Mouse released!");
                }
            };

            ActionListener exitListener = new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    System.out.println("Exiting...");
                    System.exit(0);
                }
            };

            PopupMenu popup = new PopupMenu();
            MenuItem defaultItem = new MenuItem("Exit");
            defaultItem.addActionListener(exitListener);
            popup.add(defaultItem);

            trayIcon = new TrayIcon(image, "Sistema de alarmas ConQuest", popup);

            ActionListener actionListener = new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    trayIcon.displayMessage("Alarma",
                            "una alarma se a presentado",
                            TrayIcon.MessageType.WARNING);
                }
            };

            trayIcon.setImageAutoSize(true);
            trayIcon.addActionListener(actionListener);
            trayIcon.addMouseListener(mouseListener);

            //    Depending on which Mustang build you have, you may need to uncomment
            //    out the following code to check for an AWTException when you add
            //    an image to the system tray.

            //    try {
            tray.add(trayIcon);
            //    } catch (AWTException e) {
            //        System.err.println("TrayIcon could not be added.");
            //    }

        } else {
            System.err.println("System tray is currently not supported.");
        }
    }


    public void alertWarining(String title, String message) {
        trayIcon.displayMessage(title, message, TrayIcon.MessageType.WARNING);
    }


    public void alertError(String title, String message) {
        trayIcon.displayMessage(title, message, TrayIcon.MessageType.ERROR);
    }

    public void alertInfo(String title, String message) {
        trayIcon.displayMessage(title, message, TrayIcon.MessageType.INFO);
    }

    public void alertNone(String title, String message) {
        trayIcon.displayMessage(title, message, TrayIcon.MessageType.NONE);
    }
} //end class


la clase SystemTrayTest crea una instancia de TrayIcon y verifica si tiene soporte el sistema operativo. implementa los metodos necesarios y crea un menu para mostrar la salida del programa.

la clase SystemTrayTest contiene los metodos alertWarning(), alertError(), alertNone() y alertInfo() para mostrar mensajes en la pantalla


La clase SystemTrayIcon contiene el metodo principal que crea un objeto de SystemTrayTest, utilizando swingWorker

/**
*
* @author skuarch
*/
public class SystemTrayIcon implements Runnable {

    java.awt.TrayIcon trayIcon;
    java.awt.SystemTray tray;

    /**
     * Construct.
     */
    public SystemTrayIcon() {
        super();
    } //end SystemTrayIcon

    /**
     * @param args the command line arguments
     */
    public static void main(String... args) {
        Thread t = new Thread(new SystemTrayIcon());
        t.start();
    } //end main

    @Override
    public void run() {

        try {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {

                @Override
                public void run() {
                    try {
                        SystemTrayTest stt = new SystemTrayTest();
                        stt.alertWarining("Inicio", "este es un mensaje de inicio");
                    } catch (Exception ex) {
                        System.out.println(ex);
                    }
                }
            });
        } catch (Exception e) {
            System.out.println(e);
            throw new UnsupportedOperationException("Not supported yet.");
        }

    } //end run
} //end class


SystemTrayIcon implementa Runnable y dentro del metodo abstracto se crea el siwngWorker.