viernes, 21 de febrero de 2014

Nueva web / New site


Hola a todos, sé que este tema no está relacionado directamente con el desarrollo y la programación, pero a nivel personal he estado trabajando en un nuevo proyecto y me gustaría comentarlo.

Se trata del desarrollo de una página web:
http://articulosparaelcazador.com/

Cualquier comentario sobre la misma será bien recibido.

_______________________________________________

Hello, this article is not directly related with development and programming, but I am involved in a personal proyect and I would like to tell to everyone.

It is about a new website (now there is only Spanish version, sorry for inconveniences):
http://articulosparaelcazador.com/

Every comment about the website will be thankful.

martes, 4 de febrero de 2014

Principales diferencias entre las distintas versiones de Java / Main differences between Java versions


 1.4 

  • assert keyword
    x = 1;
    assert (x != 0);

  • Regular expressions
        Pattern p = Pattern.compile("fish");
    Matcher m = p.matcher("one fish, two fish, red fish, blue fish");
    while (m.find()) {
  /*...*/
    }
 
  • IPv6 support
Se modificaron clases para soportar IPv6, como por ejemplo InetAddress, MulticastSocket, etc.

  • Logging
Properties file with all configuration for logs
  • XML parser and XSLT processor (JAXP)
Transformer xmlTransformer = TransformerFactory.newInstance().newTransformer(
         new StreamSource(new StringReader(xsltResource))
      );
_______________________________________
Document doc = parseFile(xmlFileName);
  Node root = doc.getDocumentElement();
 
  • Integrated security and cryptography extensions (JCE, JSSE, JAAS)
SSLServerSocketFactory sslSrvFact = (SSLServerSocketFactory)                  SSLServerSocketFactory.getDefault();
    s =(SSLServerSocket)sslSrvFact.createServerSocket(port);
    SSLSocket c = (SSLSocket)s.accept();
    OutputStream out = c.getOutputStream();
    InputStream in = c.getInputStream();

  • Preferences API
    Preferences myPreferences = Preferences.systemRoot();
  String value = (String) myPreferences.get(key, defaultValue);

 5 (1.5) 

  • Generics 
List<String> l = new ArrayList<String>();
    l.add("string");
  • Metadada (annotations)
@Override
    @MethodInfo(author = 'Pankaj', comments = 'Main method', date = 'Nov 17 2012', revision = 1)
    public String toString() {
        return 'Overriden toString method';
    }
  • Enhanced for loop
for (String s: stringList) {
        System.out.println(s);
    }

  • Enumerations
public enum Currency {PENNY, NICKLE, DIME, QUARTER};
  • Varargs
void printReport(String header, int... numbers) {
for (int num : numbers) {
System.out.println(num);
}
}
  • Concurrency utilities
Classes like: Semaphore, Executors, SynchronousQueue<E>, ... in java.util.concurrent.

 6 

  • Scripting Language Support 
  • Improved Web Service support through JAX-WS
package javax.xml.ws. It's commonly used by axis2 and cxf.
  • [performance improvements]
  • Upgrade of JAXB to version 2.0
  • Support for pluggable annotations 


     7 

    • String in switch
    • Allowing underscores in numeric literals
    • Catching multiple exception types and rethrowing exceptions with improved type checking
    • Lambda (anonymous function)
        Runnable r2 = () -> System.out.println("Hello world two!");
    • Concurrency utilities

        static final int AVAILABLE_PROCESSORS =   Runtime.getRuntime().availableProcessors();
        final ForkJoinPool pool = new ForkJoinPool(AVAILABLE_PROCESSORS);

     8 

    • Lambda expressions
    printPersonsWithPredicate(
        roster,
        p -> p.getGender() == Person.Sex.MALE
            && p.getAge() >= 18
            && p.getAge() <= 25
    );
    • Allows developers to embed JavaScript code (Project Nashorn)
    • Annotations on Java Types
    List<@NonNull Object>
     
    • Date and Time API
         Package java.time