User Tools

Site Tools


java:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
java:index [2014/04/13 12:06] rlunarojava:index [2022/12/02 22:02] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Apuntes de Java ====== ====== Apuntes de Java ======
  
-Varias notas sobre java. Al que quiera entender, que entienda+Varias notas sobre java. 
  
-  * [[http://docs.oracle.com/javase/specs/#251530|ESTANDAR JAVA]] + 
-  [[http://wiki.metawerx.net/wiki/Web.xml]] - toda la documentación sobre "web.xml" +<WRAP column 30%> 
-  * [[howToMakeALinkLookLikeAButton|How to make a link look like a button]] +**Application servers** 
-  * [[webdav|Java webdav]] + 
-  * [[javadoc|Javadoc made easy]] +  * [[Jboss|Jboss]] 
-  * [[jsp|JSP]]+  * [[Tomcat|Tomcat]] 
 + 
 +**Frameworks and Tools** 
 + 
 +  * [[eclipse|Eclipse]] 
 +  * [[NotasSobrePluginsEclipse|Mis notas sobre plugins eclipse]]
   * [[maven|Maven]]   * [[maven|Maven]]
 +  * [[jsf|JSF]]
 +  * [[jsp|JSP]]
 +  * [[JUnit4|Junit4]]
   * [[spring|Spring]]   * [[spring|Spring]]
   * [[hibernate|Hibernate]]   * [[hibernate|Hibernate]]
 +  * [[log4j|Example of configuration of log4j]]
 +  * [[log4j:notProcessSafe|Log4j is not process safe]]
 +
 +**Standards**
 +
 +  * [[http://docs.oracle.com/javase/specs/#251530|ESTANDAR JAVA]]
 +  * [[http://wiki.metawerx.net/wiki/Web.xml]] - toda la documentación sobre "web.xml"
 +  * [[webxml|Web.xml]]
 +  * [[javadoc|Javadoc made easy]]
   * [[javaBeans|Java Beans]]   * [[javaBeans|Java Beans]]
-  * [[jsf|JSF]] 
-  * [[JUnit4|Junit4]] 
-  * [[eclipse|Eclipse]] 
-  * [[Jboss|Jboss]] 
-  * [[Tomcat|Tomcat]] 
-  * [[Ayuda|Ayuda]] 
-  * [[JDBC|JDBC]] 
-  * [[ficheros|Ficheros]] 
   * [[MimeTypes|MimeTypes]]   * [[MimeTypes|MimeTypes]]
-  * [[NumerosAleatorios|Números Aleatorios]]+</WRAP> 
 + 
 +**Recipes** 
 + 
 +  * [[howToMakeALinkLookLikeAButton|How to make a link look like a button]] 
 +  * [[http://java67.blogspot.com.es/2015/07/how-to-stop-thread-in-java-example.html|How to stop a thread]]
   * [[DevelopmentMode|Configurar modo desarrollo]]   * [[DevelopmentMode|Configurar modo desarrollo]]
-  * [[webxml|Web.xml]] +  * [[NumerosAleatorios|Números Aleatorios]] 
-  * [[Infocenter|Setting up an Infocenter -or help system- for project]] +  * [[concurrentQueue|A concurrent version of queue]] 
-  * [[log4j|Example of configuration of log4j]] +  * [[writingErrorsInLog|Writing properly errors in log file]]
-  * [[log4j:notProcessSafe|Log4j is not process safe]]+
   * [[durationToText|Convert a time duration into a text]]   * [[durationToText|Convert a time duration into a text]]
-  * [[java7onLinux|Install java 7 on linux by hand]] 
   * [[javaService|Create your own java windows services using the Jboss service wrapper]]   * [[javaService|Create your own java windows services using the Jboss service wrapper]]
-  * [[writingErrorsInLog|Writing properly errors in log file]] +  * [[javaServiceLinux|A simple script for creating service in linux]]
-  * [[concurrentQueue|A concurrent version of queue]]+
   * [[searchInsideAJarFile|How to search inside a Jar file]]   * [[searchInsideAJarFile|How to search inside a Jar file]]
   * [[allAvailableTimeZones|List all available timezones that are in your JVM]]   * [[allAvailableTimeZones|List all available timezones that are in your JVM]]
-  * [[NotasSobrePluginsEclipse|Mis notas sobre plugins eclipse]] 
   * [[CreateMd5HashInJavaWithSpring|Create a md5 hash in java with eclipse]]   * [[CreateMd5HashInJavaWithSpring|Create a md5 hash in java with eclipse]]
 +
 +**Projects**
 +
   * [[TestPi4J|TestPI4J: A testing framework for your PI4J Projects]]   * [[TestPi4J|TestPI4J: A testing framework for your PI4J Projects]]
   * [[MiningTheSocialWeb|Mining the Social Web]]   * [[MiningTheSocialWeb|Mining the Social Web]]
 +  * [[2by2RubikCube|The Rubik's cube 2 by 2]]
 +
 +
 +**Miscellaneous**
 +
 +  * [[Ayuda|Ayuda]]
 +  * [[JDBC|JDBC]]
 +  * [[ficheros|Ficheros]]
 +  * [[Infocenter|Setting up an Infocenter -or help system- for a project]]
 +  * [[java7onLinux|Install java 7 on linux by hand]]
   * [[http://www2.sys-con.com/ITSG/virtualcd/Java/archives/0612/mair/index.html|Xproperties]]   * [[http://www2.sys-con.com/ITSG/virtualcd/Java/archives/0612/mair/index.html|Xproperties]]
   * [[Minecraft|Minecraft]]   * [[Minecraft|Minecraft]]
-  * [[2by2RubikCube|The Rubik's cube 2 by 2]]+  * [[Sonar|Sonar]] 
 + 
 + 
  
 ==== About software tools to synchronize with subversion ==== ==== About software tools to synchronize with subversion ====
Line 81: Line 107:
 </code> </code>
  
- 
-==== ¿Qué tarda más??? ==== 
- 
-Con frecuencia veo construcciones como ésta:  
- 
-<code java> 
-if(logger.isInfoEnabled()){ 
- logger.info("Prueba de log"); 
-}  
-</code> 
- 
-En el código Java de otros. "Es para que vaya más rápido" me dicen. Muy bien. Vamos a comprobarlo: he hecho un programa de prueba (ver abajo) a ver qué construcción tarda más: si con el isInfo or isDebug o lo que sea, o sin él.  
- 
- 
-Me he llevado la sorpresa de que es más rápido sin el ''if''... justo lo que yo pensaba.  
- 
-Otra mas: para el ejemplo del programa (1.000.000 de ejecuciones) la diferencia es de un segundo. Es decir, la comprobación tarda un microsegundo en hacerse. 
- 
-**No merecería la pena, aunque el resultado fuera al revés:** la legibilidad del código es mejor cuanto más simple.  
- 
-<code java> 
-import java.io.File; 
-import java.util.Date; 
- 
-import org.apache.log4j.Logger; 
-import org.apache.log4j.PropertyConfigurator; 
- 
- 
- 
-public class App { 
-  
- 
- public static final int ERROR_CODE = -1; 
- public static final int OPERATION_OK = 0; 
- 
- /** 
- * @param args 
- */ 
- public static void main(String[] args) { 
- String log4jFile = "c:/workspace/LogTester/src/log4j.properties"; 
- // deletes the log file prior to do the test 
- File deleter = new File("c:/temp/logtester.log"); 
- deleter.delete(); 
- 
- // start the logger tester 
- Logger logger = Logger.getLogger("tester"); 
- PropertyConfigurator.configure(log4jFile); 
-  
- Date start1 = new Date(); 
- for( long count1 = 0; count1 < 1000000; count1++ ) 
- { 
- if(logger.isInfoEnabled()){ 
- logger.info("Prueba de log"); 
- }  
- } 
- Date end1 = new Date();  
-  
- Date start2 = new Date(); 
- for( long count2 = 0; count2 < 1000000; count2++ ) 
- { 
- logger.info("Prueba de log"); 
- } 
- Date end2 = new Date();  
-  
-  
- System.out.println( "con comprobacion tardó: " + (end1.getTime() - start1.getTime())/1000 + " segundos " ); 
- System.out.println( "SIN comprobacion tardó: " + (end2.getTime() - start2.getTime())/1000 + " segundos " ); 
- } 
- 
- 
-} 
- 
-</code> 
  
  
Line 246: Line 199:
  
 ~~DISQUS~~ ~~DISQUS~~
- 
- 
- 
java/index.1397383595.txt.gz · Last modified: 2022/12/02 22:02 (external edit)