dimanche 29 décembre 2013

11 Reasons why products fail in the market

by  on December 29th, 2013 | Filed in: Agile
Source : http://www.javacodegeeks.com/2013/12/11-reasons-why-products-fail-in-the-market.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+JavaCodeGeeks+%28Java+Code+Geeks%29

  • Not having a directed product vision
  • Not enough investments for the products
  • Too late into the market
  • Too early in the market
  • No real unique features
  • Lack of focus
  • Management expectations
  • Not enough R&D investments
  • Lack of adequate technical skills / Product Management skills
  • Not enough value for money
  • Buggy Product

HTML 5 Server Sent Events on Glassfish 4

SSE (Server Sent Events) is a Web Pushing technology which was developed under HTML 5 technology. So, what is Pushing?

Pushing
It is a transmission of data sets which of them are sent at regular intervals or in any time through the server application, in the direction of server – – – >browser, without need for any request of web browser. Serving Twitter updates currently in the web page at regular intervals, appearance of Facebook shares on screen when a new share is available, serving instant financial data (exchange rate of dollar, parity etc.) immediately to users’ screen can be given as examples for pushing scenerio.

Server Sent Events is not a unique technique used for pushing of http resource, in theprevious article, we mentioned how to provide data transmission to the web browser by LongPolling technique. I think this sequencing about Push technologies would not be wrong generally in this order;
Polling –> LongPolling –> ServerSent Events –> WebSocket
ServerSent Events is a technology that its developments is already continues, such as WebSocket technology. For this reason, I would like to mention that it is not useable in every web browser and that’s for sure it is supported by new generation web browsers.

SSE technology has a few additional features unlike other ones, such as automatic connection recovery when the connection is lost, routing the message to an certain function in event/resource broadcasts. For example, you can take a look at to the discussion about the comparison of SSE and WebSocket from the entry in StackOverFlow.
How the SSE works?
The logic of operation of SSE technology can be seen in the picture illustrated below. Ahandshake request is sent to SSE supported server by the web browser and server system returns a handshake response which is “text/event-stream” MIME type. After the handshake committed among web browser and SSE service, SSE service may send any amout of data at any time. jaxrs-sse

lundi 23 décembre 2013

Apache Cordova

Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript

About Apache Cordova™

Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript. Combined with a UI framework such as jQuery Mobile or Dojo Mobile or Sencha Touch, this allows a smartphone app to be developed with just HTML, CSS, and JavaScript.
When using the Cordova APIs, an app can be built without any native code (Java, Objective-C, etc) from the app developer. Instead, web technologies are used, and they are hosted in the app itself locally (generally not on a remote http server).


Read and download : http://cordova.apache.org/


mercredi 18 décembre 2013

The try-with-resources Statement

The try-with-resources Statement

The try-with-resources statement is a try statement that declares one or more resources. A resource is an object that must be closed after the program is finished with it. The try-with-resources statement ensures that each resource is closed at the end of the statement. Any object that implementsjava.lang.AutoCloseable, which includes all objects which implement java.io.Closeable, can be used as a resource.
The following example reads the first line from a file. It uses an instance of BufferedReader to read data from the file. BufferedReader is a resource that must be closed after the program is finished with it:
static String readFirstLineFromFile(String path) throws IOException {
    try (BufferedReader br =
                   new BufferedReader(new FileReader(path))) {
        return br.readLine();
    }
}
In this example, the resource declared in the try-with-resources statement is a BufferedReader. The declaration statement appears within parentheses immediately after the try keyword. The class BufferedReader, in Java SE 7 and later, implements the interface java.lang.AutoCloseable. Because the BufferedReader instance is declared in a try-with-resource statement, it will be closed regardless of whether the try statement completes normally or abruptly (as a result of the method BufferedReader.readLine throwing an IOException).
Prior to Java SE 7, you can use a finally block to ensure that a resource is closed regardless of whether the try statement completes normally or abruptly. The following example uses a finally block instead of a try-with-resources statement:
static String readFirstLineFromFileWithFinallyBlock(String path)
                                                     throws IOException {
    BufferedReader br = new BufferedReader(new FileReader(path));
    try {
        return br.readLine();
    } finally {
        if (br != null) br.close();
    }
}
However, in this example, if the methods readLine and close both throw exceptions, then the method readFirstLineFromFileWithFinallyBlockthrows the exception thrown from the finally block; the exception thrown from the try block is suppressed. In contrast, in the examplereadFirstLineFromFile, if exceptions are thrown from both the try block and the try-with-resources statement, then the methodreadFirstLineFromFile throws the exception thrown from the try block; the exception thrown from the try-with-resources block is suppressed. In Java SE 7 and later, you can retrieve suppressed exceptions; see the section Suppressed Exceptions for more information.
You may declare one or more resources in a try-with-resources statement. The following example retrieves the names of the files packaged in the zip filezipFileName and creates a text file that contains the names of these files:
public static void writeToFileZipFileContents(String zipFileName,
                                           String outputFileName)
                                           throws java.io.IOException {

    java.nio.charset.Charset charset =
         java.nio.charset.StandardCharsets.US_ASCII;
    java.nio.file.Path outputFilePath =
         java.nio.file.Paths.get(outputFileName);

    // Open zip file and create output file with 
    // try-with-resources statement

    try (
        java.util.zip.ZipFile zf =
             new java.util.zip.ZipFile(zipFileName);
        java.io.BufferedWriter writer = 
            java.nio.file.Files.newBufferedWriter(outputFilePath, charset)
    ) {
        // Enumerate each entry
        for (java.util.Enumeration entries =
                                zf.entries(); entries.hasMoreElements();) {
            // Get the entry name and write it to the output file
            String newLine = System.getProperty("line.separator");
            String zipEntryName =
                 ((java.util.zip.ZipEntry)entries.nextElement()).getName() +
                 newLine;
            writer.write(zipEntryName, 0, zipEntryName.length());
        }
    }
}
In this example, the try-with-resources statement contains two declarations that are separated by a semicolon: ZipFile and BufferedWriter. When the block of code that directly follows it terminates, either normally or because of an exception, the close methods of the BufferedWriter and ZipFileobjects are automatically called in this order. Note that the close methods of resources are called in the opposite order of their creation.
The following example uses a try-with-resources statement to automatically close a java.sql.Statement object:
public static void viewTable(Connection con) throws SQLException {

    String query = "select COF_NAME, SUP_ID, PRICE, SALES, TOTAL from COFFEES";

    try (Statement stmt = con.createStatement()) {
        ResultSet rs = stmt.executeQuery(query);

        while (rs.next()) {
            String coffeeName = rs.getString("COF_NAME");
            int supplierID = rs.getInt("SUP_ID");
            float price = rs.getFloat("PRICE");
            int sales = rs.getInt("SALES");
            int total = rs.getInt("TOTAL");

            System.out.println(coffeeName + ", " + supplierID + ", " + 
                               price + ", " + sales + ", " + total);
        }
    } catch (SQLException e) {
        JDBCTutorialUtilities.printSQLException(e);
    }
}
The resource java.sql.Statement used in this example is part of the JDBC 4.1 and later API.
Note: A try-with-resources statement can have catch and finally blocks just like an ordinary try statement. In a try-with-resources statement, anycatch or finally block is run after the resources declared have been closed.

Suppressed Exceptions

An exception can be thrown from the block of code associated with the try-with-resources statement. In the example writeToFileZipFileContents, an exception can be thrown from the try block, and up to two exceptions can be thrown from the try-with-resources statement when it tries to close theZipFile and BufferedWriter objects. If an exception is thrown from the try block and one or more exceptions are thrown from the try-with-resources statement, then those exceptions thrown from the try-with-resources statement are suppressed, and the exception thrown by the block is the one that is thrown by the writeToFileZipFileContents method. You can retrieve these suppressed exceptions by calling the Throwable.getSuppressed method from the exception thrown by the try block.

Classes That Implement the AutoCloseable or Closeable Interface

See the Javadoc of the AutoCloseable and Closeable interfaces for a list of classes that implement either of these interfaces. The Closeable interface extends the AutoCloseable interface. The close method of the Closeable interface throws exceptions of type IOException while the close method of the AutoCloseable interface throws exceptions of type Exception. Consequently, subclasses of the AutoCloseable interface can override this behavior of the close method to throw specialized exceptions, such as IOException, or no exception at all.

mardi 17 décembre 2013

Physical Keys Could Take Away the Pain of Passwords

New Scientist (12/11/13) Hal Hodson 

Facebook, Google, and other technology companies are experimenting with physical keys to take the place of passwords. Google is testing YubiKey, a small cryptographic card that plugs into a USB port and mimics a keyboard entering a single-use password into the authentication field, while Facebook employees are already using such cards for two-factor authentication. Some of the keys will rely on their physical structure to make them unclonable, and could be used not just for computer logins but also to authenticate products that are susceptible to counterfeiting. Meanwhile, California Institute of Technology researchers are developing a system that uses light scattered through liquid crystals, which has the advantage of offering much more scope for randomness than a silicon chip. The researchers say the system is very hard to crack, but also difficult to implement because of the impracticality of storing and exchanging huge keys. Another physical authentication key in development is Verayo's Opal, which contains a microchip with tiny imperfections that arise during manufacturing and are unique to it. The device's battery is activated by shaking it, and the user shakes the device again to have it pair with a nearby computer or tablet via Bluetooth. The system reads the Bluetooth signal and, if it matches a predetermined pattern, accepts the user as a trusted party.

JASPERSOFT 5.5 : LES NOUVEAUTÉS

Jaspersoft logo
La version 5.5 de la suite décisionnelle, sortie fin octobre, propose de nouvelles fonctionnalités aux utilisateurs, notamment en termes d’analyse, de planification et de prise en main de l’outil.
L’aspect d’analyse a été mis en avant, notamment par l’enrichissement des fonctionnalités de visualisation des données et l’augmentation de sa rapidité.
Le bon déroulement de la planification des rapports est renforcé par la création d’un outil dédié qui permet également de les transférer, puis de les stocker dans un répertoire local ou sur un serveur distant via un FTP. L’ajout d’un système de notification en cas d’échec finalise ce processus de transfert.
Jaspersoft 5.5 capture 1
La prise en main de l’outil par des utilisateurs non confirmés et la navigation sont désormais plus accessibles, notamment grâce à la page d’accueil du serveur qui affiche directement le contenu, les tutoriels et les différentes fonctionnalités (sources de données, domaines, rapports Ad Hoc, rapports, etc.).
Jaspersoft 5.5 capture 2
Jaspersoft a également enrichi ses templates de rapports et créé de nouveaux types de graphiques pour le reporting Ah Hoc.
Jaspersoft 5.5 capture 3
D’autres évolutions sont notables, comme l’architecture du serveur, qui a été optimisée grâce à la prise en compte des charges réseau (clusters) ou encore des outils de filtrage qui permettent de paramétrer au maximum les données et donc des analyses sur d’importantes volumétries (problématiques du Big Data).
Enfin, le renouveau de l’outil iReport, désormais basé sur l’environnement Eclipse, qui reste l’outil de conception de rapports : Jaspersoft Studio.

lundi 9 décembre 2013

Free Technology Academy (FTA) materials

The currently published materials used in FTA modules are listed below. More materials will be added in the future. All of them are under a Free Copyleft license.
Book cover
Introduction to Free Software
  • Authors: Jesús M. González-Barahona, Joaquín Seoane Pascual, Gregorio Robles
  • Coordinators: Jordi Mas Hernández, David Megías Jiménez
Book cover
GNU/Linux Advanced Administration
  • Authors: Remo Suppi Boldrito, Josep Jorba Esteve
  • Coordinator:Josep Jorba Esteve
This material is part of the Module 2: "The GNU/Linux Operating System".
Book cover
GNU/Linux Basic
  • Authors:Joaquín López Sánchez-Montañés, Sofia Belles Ramos, Roger Baig Viñas, Francesc Aulí Llinàs
  • Coordinators:Jordi Serra i Ruiz, David Megías Jiménez, Jordi Mas
  • This material is part of the "GNU/Linux Basic".
Book cover
Open Networks
  • Author: Enric Peig Olivé
This material is part of the Module 3: "Network Technologies".
Book cover
Introduction to Web applications development
  • Author: Carles Mateu
  • Coordinator:Jordi Mas Hernández
This material is part of the Module 4: "Web applications development".
Book cover
Economic aspects and business models of Free Software
  • Author: Amadeu Albós Raya, Lluís Bru Martínez and
    Irene Fernández Monsalve
  • Coordinator: David Megías Jiménez
This material is part of the Module 5: "Economic aspects of Free Software".
Book cover
Legal Aspects of the Information Society
  • Author: Malcolm Bain
  • Contributions: Manuel Gallego, Manuel Martínez Ribas, Judit Rius
Book cover
Introduction to Software development
  • Authors: J. Pérez López and L. Ribas i Xirgo
  • Coordinators: Jordi Mas Hernández and David Megías Jiménez
This material is part of the Module 7: "Software development".
Book cover
Implementation of Free Software Systems
  • Authors:
    Amadeu Albós Raya, Óscar David Sánchez Jiménez
  • Coordinator:David Megías Jiménez
  • Licenses: GNU Free Documentation License, Creative Commons Attribute ShareAlike License
  • This material is part of the module "Deployment of Free Software and Case Studies".
Book cover
Tools and utilities in free software
  • Author: Jesús Corrius i Llavina
  • Coordinators:David Megías Jiménez, Jordi Mas, Ana-Elena Guerrero Roldán
  • Licenses: GNU Free Documentation License, Creative Commons Attribute ShareAlike License
  • This material is part of the module "Free Software Tools and Utilities".
Book cover
Software Architecture
  • Authors: A. Bijlsma, B.J. Heeren, E.E. Roubtsova, S. Stuurman
  • Licenses:Creative Commons Attribute ShareAlike License
  • This material is part of the module "Software Architecture".

lundi 25 novembre 2013

Java Code Geeks Weekly: 10 Rules of a Zen programmer, Twitter improves JVM performance, Github is not your CV





Your Weekly Java Code Geeks Dose

Download Whitepaper from Qualys


Continuous Security Monitoring (CSM)

Learn what CSM is, how to implement it, and discover the most applicable use cases in this free white paper.

Given that you can't prevent all cyber attacks, you need to ensure you detect attacks as quickly as possible. The concept of continuous monitoring has been gaining momentum, driven by both compliance mandates (notably PCI-DSS) and the US Federal Government's guidance on Continuous Diagnostics and Mitigation, as a means to move beyond periodic assessment. This makes sense given the speed that cyber attacks can proliferate within your environment.

JCG Partner of the Week


The JCG Partner of the week is:

Manu PK
Manu develops software applications using Java and related technologies. Geek, Tech Blogger, open source and web enthusiast..

Latest Article: A MindMap for Java Developer Interviews

Best of the Week from JCG


21 signs of BAD MANAGERS I met in my career as a software manager (by Ionel Condor)
Bias against action or against planning, simply waiting or postponing for ever; embrace the status-quo, Secrecy, not willing to share information, giving the feeling that having access to information is a privilege reserved to managers, Working very long hours to prove hard work or hide incompetence...

Using serialization to find dirty fields in an object (by Raji Sankar)
Say you are developing a framework to auto-save objects into a database. You need to detect changes made between two saves, so that only modified fields are saved. How to detect dirty fields. The easiest way to do this is to traverse through the original data and the current data and compare each field separately.

What Garbage Collector are you using? (by Nikita Salnikov Tarnovski)
While dealing with the problems in this interesting domain, we thought to share some insights to GC algorithm usage. For this we conducted a study on how often a particular GC algorithm is being used. The results are somewhat surprising. Let me start with the background of the data – we had access to data from 84,936 sessions representing 2670 different environments to use in the study. 13% of the environments had explicitly specified a GC algorithm.

How to Optimize Your Website for Speed (by Mike Dalisay)
Website speed becomes an obsession of search engines like Google and one of the reasons is the rapid growth of mobile internet browsing. If you're working with the web (developers, designers, bloggers and students), it is now a requirement to have knowledge in making a website load fast, and our post for today will give you some ideas on why and how to achieve it.

3 ways of handling exceptions in JUnit. Which one to choose? (by Rafal Borowiec)
In JUnit there are 3 popular ways of handling exceptions in your test code: try-catch idiom, With JUnit rule, With annotation. Which one should we use and when?

Latest JCG Tutorials and Examples


Android Content Provider Example
A Content Provider is used to share and access data from a central repository. Usually android applications keep data hidden from the other applications but sometimes, it is useful to share data across them. So, content provider is a suitable reason to share data with other applications, based on a standard interface. There are many different ways to store data in a content provider but in most cases a SQLiteDatabase is used. In this tutorial, we are going to create our own content provider using SQLite database, in which we will store and handle our friends' birthday.

Create Web Application Project with Maven Example
In this tutorial, we will show you an easy way to create a Java web application project, using Apache Maven. The web application will make use of the Spring MVC and it will be transformed, in order to be recognizable and supported by the Eclipse IDE. In this example, we use the following tools on a Windows 7 platform: Apache Maven 3.1.1, Eclipse Kepler Service Release 1, JDK 1.7, Spring 3.2.3.RELEASE, Apache Tomcat 7.

RESTEasy File Upload Example
In this tutorial we are going to see how In this example we are going to see how you can upload a File to a server using a JAX-RS REST Service using RESTEasy. In this example we are going to use an HTML Form that has one input field of type file. When the HTTP POST request is constructed, it will contain a media type of multipart/form-data.

JUnit Using Assertions and Annotations Example
In this example we are going to create test cases so as to understand the use of assertions and annotations in JUnit testing framework. Also, we will see how to run these test cases from the command line by using the org.junit.runner.JUnitCore. If you prefer running your test cases via Eclipse, you can have a look at JUnit Getting Started Example.

New and Noteworthy from the Community


World of the NoSQL databases
The relational database model focuses on the organization of the data in the form of two-dimensional tables. Each relational table is a two-dimensional array that has the following properties: each element of the table is a data element...

Why GitHub is not your CV
Two days ago, Ashe Dryden published an article I've been desperately wishing someone would write for months: The Ethics of Unpaid Labor and the OSS Community. It's a detailed, well-researched take-down of the seemingly quite popular myth that open-source contributions are a useful way to screen candidates for software jobs.

Why Python Is The Most Powerful Programming Language For Web Applications
Python is among the few programming languages that have become an essential component in Linux, MySQL, Perl, PHP, and Apache along with a packaged LAMP Web Stack. Ever since its inception, Python has grown along with other dynamic programming languages such as Ruby, to substitute the conventional programming languages such as C# and Java.

Hiring Software Developers
I've been reflecting recently on my past few years working as a software developer. During those years I've had a lot of job interviews. I got many rejections, a few job offers and never heard back from some companies. This is a review, from my own perspective, of what works and what doesn't work when it comes to interviews and hiring processes for software developers.

How Twitter Improved JVM Performance by Reducing GC and Faster Memory Allocation
Netty is a high-performance NIO (New IO) client server framework for Java that Twitter uses internally as a protocol agonostic RPC system. Twitter found some problems with Netty 3's memory management for buffer allocations beacause it generated a lot of garbage during operation.

Blast from the Past !


The 10 rules of a Zen programmer
On a rainy morning I found myself sitting on the desk thinking about efficient working. Before I started as a freelancer I had some days were I worked lots but could look only back on a worse outcome. I started with Zen practice back in 2006. What clearly came to my mind before a good while was: the old Zenmasters already knew before hundreds of years, how today programmers should work.

Java Annotations Tutorial with Custom Annotation
Java Annotations provide information about the code and they have no direct effect on the code they annotate. In this tutorial, we will learn about Java annotations, how to write custom annotation, annotations usage and how to parse annotations using reflection. Annotations are introduced in Java 1.5 and now it's heavily used in Java frameworks like Hibernate, Jersey, Spring. Annotation is metadata about the program embedded in the program itself.

Getting rid of null parameters with a simple spring aspect
What is the most hated and at the same time the most popular exception in the world? I bet it's the NullPointerException. NullPointerException can mean anything, from simple "ups, I didn't think that can be null" to hours and days of debugging of third-party libraries (try using Dozer for complicated transformations, I dare you).

mercredi 20 novembre 2013

NetBeans IDE 7.4 is here...

NetBeans IDE 7.4 extends the advanced HTML5 development support introduced in NetBeans IDE 7.3 to Java EE and PHP applications, while offering new support for mobile web development on the Android and iOS platforms, including support for the Cordova framework. Additional highlights include support for preview versions of JDK 8, and continued enhancements to JavaFX, PHP, C/C++, Maven and other features.
NetBeans IDE 7.4 is available in English, Brazilian Portuguese, Japanese, Russian, and Simplified Chinese.

HTML5
  • Cordova application development
  • Support for Android and iOS Browsers
  • Editing support for stylesheet languages: SASS and LESS
  • Browser switcher in main toolbar
  • Saving changes from Chrome Developer Tools
  • Network monitor
    NetBeans IDE Browser Switcher
    Full Screenshot
    JavaScript
    • Editing support for AngularJS, Knockout and ExtJS frameworks
    • Navigator and code folding in JSON files
    • Enhanced code completion with improved accuracy
    JSON Navigator in NetBeans IDE
    Full Screenshot
    Java EE
    • HTML5 features available in Java EE projects
    • Wizards for JSF 2.2 Resource Library Contracts and FacesComponents
    HTML5 Application in Java EE in NetBeans IDE
    PHP
    • HTML5 features available in PHP applications
    • Nette Framework 2 (with Latte templates) and Zend Framework 2 support
    • Atoum testing framework support
    • Editor and Rename type refactoring improvements
    • Static code analysis support
    Nette Framework2 Support in NetBeans IDE
    Full Screenshot
    Java
    • Preview support for JDK 8 features: Profiles, Lambdas
    • Code completion, Hints and Refactoring improvements 
    • Native packaging
    • Updated bundled Ant 1.9.1 and Maven 3.0.5
    JDK8 Preview Support in NetBeans IDE
    JavaFX
    • New FXML File dialog in Maven projects
    • Tighter alignment for JavaSE and JavaFX project types
    • Improvements to Project Deployment options

    C/C++
    • Run/Debug launchers support
    • Find Usages improvements
    • C/C++ formatting style per project
    Find Usages improvements in NetBeans IDE
    Miscellaneous
    • New Tasks Dashboard and Notifications windows
    • Lock Contention for profiling tasks
    • Bugzilla Offline Mode
    • Enhancements to Versioning tools: Subversion, Git, Mercurial
    • TestNG and Junit improvements
    • Improvements to Databases
    Tasks Window in NetBeans IDE

    dimanche 17 novembre 2013

    The Internet of Things Needs a Lot of Work

    IDG News Service (11/12/13) Stephen Lawson 

    Mobile connected devices present too many challenges for users, said industry leaders during a panel at the recent Open Mobile Summit. Frog Design's Mark Rolston notes that users have to link devices, enter passwords, manage home Wi-Fi, and deal with corporate IT departments at work, and are near their limit for babysitting devices all day. The experts say the whole premise of mobile interfaces is wrong, noting devices should be asking users what they want and learning from prior events rather than forcing users to ask. "There's just a million use cases you can think of where today there's [an] interface to try to understand what the user wants, and in the future there should just be action that does the right thing," says Rick Osterloh at Google's Motorola Mobility subsidiary. He says a car should automatically connect to the Internet by itself and automatically turn on the light when the driver reaches home. Rolston also notes that rather than using a phone to control devices in the home, the many connected appliances together should form a computer of their own. "The computer is not this box in the corner, or box in your pocket, it's something you are surrounded by," Rolston says.