Tuesday, August 24, 2010

So, I`ve cycled to Finland again last weekend. 3 of us rode the train to Vyborg and cycled all the way to Laapenranta to visit our friend in there. Had a great time for 2 days, which included bit of sight-seeing, sauna and swimming in a Saima lake right after, some barbeque and of course a fair bit of alcohol consumption.

All in all wonderful weekend, thanks to our friend Tommi Halonen.

Tuesday, July 6, 2010

Wednesday, May 26, 2010

CPL filter for dummies

Okay, I got myself a nice cheap Massa 77mm circular polarizing filter and tried it out today.

Few facts that I discovered for myself about CPL filters:

  • They remove some of light reflections
  • They darken the image
  • The image greatly depends on filter rotation on the lens

Here are two simple pictures that illustrate the principle behind the filter ( taken here ):



Now it must make sense that to achieve the desired "remove reflections" effect one must rotate the filter on the lens and asses the image in the viewfinder. Usually the filters are made that way so they can be rotated after being mounted on lens.

At last - couple of dummy images, one taken with and one taken without the CPL filter:



Note the sky reflections removed from windows of the building.

Monday, May 17, 2010

Amazing stuff - OpenStreetMap, NaviComputer, Holux M1000C

I bought a chineese Holux M1000C GPS reciever / logger and set up my prehistoric Acer n311 to run NaviComputer on it. OpenStreetMap is an amazing thing, as much as NaviComputer is.

I hope my problems of finding my way around are gone for good. I`ll make sure to toss it into a car and will also take it on my trips for sure.

For now this is my typical track from home to work that i cycle twice a day on weekdays ( unless I`m too lazy and take subway instead )

http://www.everytrail.com/view_trip.php?trip_id=621780

Interesting fact: My average speed on a bicycle is 1 km/h more than it is when I`m struggling with traffic in my car! And it is 30% faster to cycle than take a subway.

Saturday, April 10, 2010

Sun Tech Days 2010


Whats new in JEE 6 ( except CDI )


Overview

We were lucky to visit both days of Sun Tech Days 2010 event, listened to news regarding JAVA related technologies, had a chance to talk to some Java evangelists and of course participated in the freebies frenzy that followed the lectures on day one. Overall impresstion is that although now owned by Oracle, JAVA and related technologies will be going forward and none will be left behind. Sun tries to keep up to and even stay ahead of competition in a wide variety of fields. I`d like to focus this post on whats new in JEE 6. 
JEE6 is available with set of profiles, outlining subsets of functionality for ease of use. Most of the new features in JEE 6 Web Profile are presented below, except for CDI. Web profile for JEE6 is supported by Glassfish v.3 ( released December 2009 ) and is of production quality - Sun recommends it for using in real life production environments. All the topics below have samples and tutorials with code to explain the new features, available here: https://svn.kenai.com/svn/beginningee6~src

Managed beans 1.0 


http://jcp.org/aboutJava/communityprocess/final/jsr316/index.html

Managed beans are basically "Container-managed POJOs"  that support some basic functionality via annotations, such as: Injection (@Resource...); Life-cycle management (@PostConstruct,@PreDestroy); Interceptor (@Interceptors, @AroundInvoke); 
There are few specifics and requirements regarding Managed Beans: 

  • public default constructor for basic implementations
  • annotated with @javax.annotation.ManagedBean
  • not implementing serializable, not final, abstract or non-static inner class. 
  • method invocations on a Managed Bean execute in the same thread as the caller
  • Managed beans are optionally named by strings passed to the MangedBean annotation
  • container must make beans available using JNDI portalbe names specific to application or module namespaces


JPA 2.0



  • Better Map support - Basic, Embeddable, Entity as keys. Annotations: @OneToMany(mappedBy="..."); @MapKeyColumn, etc
  • Derived Identifiers for OneToOne and ManyToOne relationships
  • Nested embedding - Embeddable types having Embeddable members
  • New collection mappings - Support for collections of Basic or Embeddable types.
  • Ordered List mappings - Support for maintaining an index column in any collection relationship using a List.
  • Pessimistic Locking
  • Cache APIs - @Cacheable
  • Criteria API accessible via CriteriaBuilder class, allowing use of dynamic queries via class names, checked at compile time.
  • Richer JPQL - more JOINs, etc
  • All connection options in persistence.xml - standard configuration


Servlets 3.0



Main changes since Servlets 2.5 specification were targeting Ease of Development, Pluggability, new Async. operations support.

  • Lots of new annotations making web.xml totally optional.
  • Listeners specs and such can now be put into web-fragments ( parts of web.xml ) and shipped with .jar = easier framework development
  • Listener ordering
  • New async support through @WebServlet(asyncSupported=true) for long running requests. 
  • Per servlet security via @ServletSecurity


EJB 3.1


http://jcp.org/aboutJava/communityprocess/final/jsr318/index.html

  • Elimination of requirement for EJB component interfaces for session beans - interfaces are now optional
  • @Asynchronous support, methods returning void or Future 
  • TimerService, using @Schedule (dayofweek="..", ... ) annotations
  • @Singleton support, implements singleton pattern in application / JVM, works with @PostContruct & @PreDestroy
  • API for programmatic container management
  • Ability to run in Java SE environment - tests run times greately improved
  • Web profile for JEE 6 supports EJB 3.1 Lite
  • Too much more to cover here... check JSR 318


JSF 2.0



  • Take two at usable MVC framework
  • Adopts Facelets as VDL
  • web.xml, faces-navigation.xml are now optional
  • Introduces JSF Composite component for easy component development
  • AJAX support inspired by Richfaces, Icefaces, etc... use of to ajaxify exisitng pages.
  • Numerous minor improvements: Validation moved to BeanValidation 1.0, easier resource and error management, Groovy support 
  • Also have a @javax.faces.beans.ManagedBean annotation, not to confuse with one specified by Managed Beans 1.0 


Bean Validation 1.0


http://jcp.org/aboutJava/communityprocess/final/jsr303/index.html

Main objective of Bean Validation 1.0 is to allow developers to follow "Constrain Once, Validate Everywhere" approach, allowing to specify validation rules once and have data validation on every stage of information processing: persitence layer, controller and view.

  • Enables declarative validation through the application via @NotNull, @Size, @Valid annotations. @Valid instructs recursive validation for specified fields.
  • Integrated with JPA 2.0 and JSF 2.0
  • Easy development of validator classes applicatble in standard way
  • Partial validation
  • Internationalization support 
  • Validation Ordering

 

JAX-RS 1.1


http://jcp.org/aboutJava/communityprocess/mrel/jsr311/index.html

  • POJOs exposed as webservices via annotaions such as @Consumes@Produces, @Path, etc
  • Mapping HTTP verbs to certain API classes and annotations
  • Integrates with JEE 6 EJBs



  Also managed to take couple of snapshots during the conference, below are Simon Ritter and some others..


And finally a line of dukes ready to take over the world!