Pages

Thursday, June 3, 2010

JAZOON 2010, Day 2

JAZOON 2010 started with the keynote "Total Cost of Ownership and Return on Investment" by Ken Schwaber, co-developer of the scrum process.




The overview of the keynote speech is available at JAZOON website.


For me the day started with Václav Pech's presentation about concurrency - Unleash Your Processor(s). Tremendous! It was so interesting!

Multithreaded programs today work mostly by accident!

Václav talked about jsr166y, asynchronous background tasks, parallel collections, fork/join strategy, friendly deadlocks and many more. He also mentioned a number of libraries that can help implement actors in Java (Jetlang, for instance). He also explained how do the persistent data structures work and why they are trees in nature. Also, Václav is a big contributor to gpars project for groovy, but he didn't talk about it much as there was a dedicated talk to this topic.

The next presentation I attended was about HTML5 WebSockets, which was also very interesting. I think websockets is the thing we were really missing for many cases and therefor had to build some nasty workarounds to make the things work. Peter Lubbers from Kaazing showed some interesting examples how the new technology compares to Comet, and he also used wireshark to make the evidence. Nice presentation overall.

GPars was next on the list of me. Dierk König from Canoo was giving a talk about parallel programming concepts for the JVM in Groovy. Actually it wasn't a presentation but rather one big demo. Unfortunately, Dierk has to give the demo in groovyconsole as the best IDE in the world crashed (probably because of some 3rd-party plug-in?).


After the references from Václav and Dierk groovy was actually blasted by Nikita Ivanov who was giving a talk cloud computing with Scala and GridGain. I absolutely agree with Nikita about the poor performance of current Groovy, but I'd definitely disagree with the claim that Scala is more concise compared to Groovy. Groovy is extendable the same was as Scala and you can hook into AST of Groovy to alter the syntax if you absolutely need it. Nikita was talking so much and so fast I started to worry about the demo he promised, but he managed to build the example live without any copy-pasteing. Unfortunately there were no time left for more advanced things.


Nikita also introduced Scalar which is an internal DSL for Scala to be used for GridGain. What is nice about it is that with one line of code once could describe the expected behavior of GridGain cluster, instead of writing 10 times more Scala code.


...... to be continued ........

Tuesday, June 1, 2010

JAZOON 2010, Day 1

So here I am at JAZOON2010 conference. The venue is perfect and the content of the conference is quite good to say the least.

The first day has started with a keynote by Danny Cowards, called "Java SE and JavaFX: The Road Ahead". The first question Danny was asked was about the new life in Oracle after Sun's acquisition. I was really disappointed by the politically correct answer...


He also showed an interesting video with James Gosling about the star7 experimental device - this is where Java roots are.



Frankly, I was still so tired because of the flight, so after the 3rd slide I got asleep and I woke up just in time when the talk was finished. Too bad as I suppose that the talk should have been quite interesting, at least the first slides were.

The other talks I have attended were "Pattern Driven Security Design for Web Tier" and "Web Frameworks and how they kill traditional security scanning" (quite a security-oriented day). I wouldn't say that I learned really something new from there, but I definitely have more structured knowledge in my head now, especially what concerns the terminology and pattern names. Also, quite an interesting approach to security scanning was presented, which is advocated by Armorize.

Objects of Value by Kevlin Henney was quite inspiring but too philosophical too me. The only practical value I got from the talk is the 2 books titles:

Problem Frames: Analysing & Structuring Software Development Problems
Pattern-Oriented Software Architecture


The next talk was from Neal Ford about Construction Techniques for Domain Specific Languages. This is a talk that I have seen on various videos, but haven't seen it live yet. Compared to the older versions of the talk, it was almost the same, but just with some improvements - Neal added a couple of slides with referring to some OSS frameworks that do DSL stuff, like easyb. But the general idea is still the same, the examples are the same, and techniques for DSL construction are the same.

The talk about classloaders from Jevgeni Kabanov from ZeroTurnaround was very interesting. Jevgeni presented several examples from the errors that may appear within container, either ClassNotFoundException, NoSuchMethodFoundError or ClassCastException.




The examples started with the very basics and finished with more weird errors which cause memory leaks, especially on application redeployment. Also you may find some interesting articles at ZeroTurnaround's blog about classloaders:

http://www.zeroturnaround.com/blog/reloading-objects-classes-classloaders/
http://www.zeroturnaround.com/blog/rjc201/
http://www.zeroturnaround.com/blog/rjc301/


The closing keynote of the day was by Kelvin Henney - 97 Things Every Programmer Should Know. The problem with that, is that I read the book beforehand :) So I decided to spend some time for networking instead.


Overall:

+ perfect venue
+ very comfortable chairs at the audiences
+ very good organization
+ yummy food
+ good content so far
+ laptop plugs available

- weak wi-fi
- not that many companies are presented this year (compared to 2008), and Google is missing




looking forward for Day 2!

Thursday, April 22, 2010

Running OpenPortal on Jetty

While running OpenPortal's portlet container on Jetty I've encountered the following error on a portlet deployment attempt:

SEVERE: PSPCD_CSPPD0023
java.lang.IllegalArgumentException: contextHandlerCollection should have been initialized in Jetty config
at com.sun.portal.portletcontainer.admin.deployment.JettyWebAppDeployer.deploy(JettyWebAppDeployer.java:88)
at com.sun.portal.portletcontainer.admin.mbeans.PortletAdmin.deploy(PortletAdmin.java:127)
at com.sun.portal.portletcontainer.driver.admin.PortletAdminDataImpl.deploy(PortletAdminDataImpl.java:78)
at com.sun.portal.portletcontainer.driver.admin.UploadServlet.deployPortlet(UploadServlet.java:149)
at com.sun.portal.portletcontainer.driver.admin.UploadServlet.uploadFile(UploadServlet.java:119)
at com.sun.portal.portletcontainer.driver.admin.UploadServlet.doPost(UploadServlet.java:80)


To fix this, I've added the following lines to my jetty.xml:
<Call 
  class="com.sun.portal.portletcontainer.admin.deployment.JettyWebAppDeployer"  
  name="setHandlerCollection">
    <!-- assuming that Handlers are configured by default -->
    <Arg><Ref id="Handlers"/></Arg>
</Call>

Friday, April 16, 2010

uCertify promotional codes

I have done reviews for uCertify PrepKits previously:

1) uCertify's PrepKit for SCJP6.0
2) uCertify's PrepKit for SCBCD5.0

Now, uCertify is giving out 20% discount on all its PrepKits. Use promotional code SPRING during the checkout to avail this offer. This offer is valid until 20 April, 2010 and it will work on all uCertify PrepKits. Full details of the sale can be found here.


Overall, it is a good investment if you're preparing for a professional certification. Good luck!

Saturday, February 20, 2010

Agile Saturday #1 in Tallinn

Agile Estonia has held its 1st event, called Agile Saturday. Here's the speech by Vasco Duarte (Agile Finland), the agile coach at Nokia:

Agile Saturday #1 Keynote by Vasco Duarte from Anton Arhipov on Vimeo.


See the other videos from the event at agile.ee.

Sunday, January 17, 2010

Continuing the BigDecimal's Game: Scala vs Clojure

After studying the issues with decimal types in Groovy and JRuby, with lafy, we discovered some funny things in Scala and Clojure as well.


Consider, if you need to accumulate 0.1 until the result is one. Groovy does it as expected


0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 = 1.0


Just because 0.1 is BigDecimal in Groovy.


In Clojure, the example is not that nice:


(+ 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1) results in 0.9999999999999999.


Basically, the problem is solved when you add the M qualifier to each of the numbers in the expression, like 


(+ 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M 0.1M) = 1.0


Or use rational numbers:

(+ 1/10 1/10 1/10 1/10 1/10 1/10 1/10 1/10 1/10 1/10) = 1.0


The hypothetical problem is that, if a number (say, some money amount) is stored in the database, and the calculation is configured by the user in business rules via some DSL, then a user could create a calculation that   could lead to a loss of precision. For instance:


(* 100M 1.1) = 110.00000000000001
(class (* 100M 1.1)) = java.lang.Double


Double there is!!!


The same kind calculation gives BigDecimal as a result in Scala:


scala.BigDecimal(1.5) * 1.5
BigDecimal = 2.25


The question is what is the rationale behind such behavior and which result is correct? To me, when writing an application which operates with monetary amounts, it is the Scala which is correct.





Disqus for Code Impossible