Freitag, 19. Februar 2010

zxing - 2D barcode image processing library

zxing is library under Apache License for decode and encode 1d and 2d barcodes. I played with the online demo (not with the Library it self) “QR Code Generation” (this a application that encodes 2d barcodes) and with my mobile phone Nokia N95, which comes with an application to decode 2d barcodes with the mobile phone camera. It’s very cool decode barcodes with the mobile phone works very fast... Try it with the images bellow :-) and your mobile phones …

Here some screenshot what I have done, first I encode a 2d Barcode with QR Code Generation.


Then I can decode the barcode with my mobil phone.


And here the result of the decoded barcode

 

There is also another zxing demo application called Online Decoder, for decode a barcode when you have no mobile phone with a barcode decode application.

When I have time at weekend I will have a look at the Java library to get demos running local in my eclipse…
Links:
- zxing
- Online Decoder
- QR Code Generation

Mittwoch, 17. Februar 2010

My First Eclipse ZEST Demo Application

Eclipse ZEST is a very cool Framework based on Eclipse GEF, for creating graph based software visualization tools for eclipse, with a few lines of code. The PDE Dependency Visualization Plugin for example is based on ZEST, see also my pervious post here.

Good ZEST starting points are the nice examples apps in the Eclipse ZEST CVS.

Here a screenshot of my first ZEST demo application.




Links:
http://www.eclipse.org/gef/zest/
http://github.com/tux2323/bundleviewer
http://www.eclipse.org/gef/zest/snippets.php

Dienstag, 9. Februar 2010

Design by Contract in Spring Roo

In Spring Roo they use a simple approach for Design by Contract (ok not real DBC only preconditions), looks nice for me here a code snippet from Spring Roo source code:

public MailProtocol(String protocolLabel, String protocol) {
 Assert.notNull(protocolLabel, "Protocol label required");
 Assert.notNull(protocol, "protocol required");
...
public AbstractInvocableMemberMetadata(String declaredByMetadataId, int modifier, List parameters, List parameterNames, List annotations, String body) {
 Assert.hasText(declaredByMetadataId, "Declared by metadata ID required");
... 

I think the Spring Roo way is a good hint for Design by Contract / Preconditions as tests in Java, which is not support native in the Java language. The Java asserts can be disabled the spring roo Asserts throws RuntimeExceptions...

Other Java Framework for Design by Contract:
Links:
Languages, which support real Design by Contract: