Thursday, July 04, 2013

The Modern Java Web Developer


I've decided to make some notes regarding Matt Raible presentations:


Now, I restrict my language set to: Java and JavaScript. There are huge hype around Scala/Play (was Ruby/Rails).
This decision is based on the local job market.

So, the modern Java Web developer should have skills in the next areas:
  • Concepts:
    • High performance web site
    • Security consideration
    • Web for Mobile devices
    • Cloud base deployment
    • Caching
    • Page Speed
    • RESTful Architecture
    • Clustering
  • JavaScript, HTML5, CSS3, LESS
  • jQuery, jQuery UI
  • Twitter Bootstrap
Avoid languages which compile to JavaScript:
  • CoffeeScript
  • TypeScript
  • Dart

Tuesday, July 02, 2013

Concurrency vs. Parallelism Definitions

Recently I had long discussion in scope of  "concurrency" and "parallelism" definitions. That's why I've decided to pick the most trusted sources for these definitions in one place:

From Akka documentation:
Concurrency and parallelism are related concepts, but there are small differences. Concurrency means that two or more tasks are making progress even though they might not be executing simultaneously. This can for example be realized with time slicing where parts of tasks are executed sequentially and mixed with parts of other tasks. Parallelism on the other hand arise when the execution can be truly simultaneous.

From Oracle "Multithreaded Programming Guide":
Parallelism - A condition that arises when at least two threads are executing simultaneously.
Concurrency - A condition that exists when at least two threads are making progress. A more generalized form of parallelism that can include time-slicing as a form of virtual parallelism.

Monday, July 01, 2013

JAI and Image Processing in Java

 

I have minimal experience with Image Processing and when I'm talking about it I mean:
  • read/write different image formats (jpg, png, tiff, ice, etc.)
  • flip, rotate image
  • crop and clip image by defined path
  • convert image's color (e.g. RGB to gray scale)
  • reduce image size
  • find edges
  • image histograms and color counting
  • different operations (e.g. AND, OR and XOR)
  • read image meta info
Of course, I don't want to waist time implementing all these by myself, because it's basic operation in Image Processing (IP) domain. And I believe that all these tasks are pretty much trivial for any engineer who's working in Image Processing.

As usual I have strict restriction regarding the licence of selected library (which can be used in any commecrial product).

So, I've started googling. Here is the initial (and filtered) results:
JAI
This library was developed by SUN. Unfortunately, it's not supported anymore. But, it's very powerful and has nice facilities.
JAI is available for Windows, Linux, Mac OS X, and Solaris, and takes advantage of native acceleration when available. However, you can use the JAI libraries on any platform if you add the following JAR files to your classpath: 
JAI Tutorials, Guides, Sources
Also, you should check the JAI sources. Here is the master JAI project on java.net with several sub-projects:
JAI Licenses. It's very tricky question. Here is the quote from java.net:
As far as I know, the libraries from JAI and JAI Image I/O Tools can be
bundled with a commercial product or can be downloaded on the fly using
the Java Web Start technology.

You might like to take a look at how people have been using JAI and JAI
Image I/O Tools:

http://java.sun.com/products/java-media/jai/success/
As for commercial license, you might like to read the LICENSE and README
files for the binaries:

http://download.java.net/media/jai/builds/release/1_1_3/LICENSE-jai.txt
http://download.java.net/media/jai/builds/release/1_1_3/DISTRIBUTIONREAD...
http://download.java.net/media/jai-imageio/builds/release/1.1/LICENSE-ja...
http://download.java.net/media/jai-imageio/builds/release/1.1/DISTRIBUTI...

and the licenses for the source code (if you make your own build of JAI):
https://jai.dev.java.net/#Licenses
https://jai-imageio.dev.java.net/index.html#Licenses
I'm not sure whether you can include this library into your commercial project. You should answer on this question by yourself. 

ImageJ 
It's a very popular application/library in Java community. I've considered it also. This library has very big community. Also, it has many plugins. Documentation (User Guide, tutorials, wiki, FAQ, etc) are located in one place, easy to find. But, I wouldn't use ImageJ in case of simple image processing operations. 

Other Libraries
I've reviewed the mentioned above other libraries and I must say they have nice features also. But they are too heavy (as well as ImageJ) for the tasks I've been trying to accomplish.

Summary
  • JAI isn't maintained by Oracle. You should be careful when including it in commercial product
  • ImageJ, Commons Imaging, JAITools , and Marvin are providing huge set of IP facilities, but it might be redundant in your case.
  • Plain Java core image library can solve almost all your needs, except TIFF/PDF file  processing.
  • TIFF/PDF file processing should be done by 3d-party libraries (e.g. iText, JAI).
References: