Tuesday, March 31, 2015

Orbit, a new Akka competitive

Bioware the developer of a lot of famous Computer Games announced an Open Source Project for distributed Applications. This project is used by Bioware itself for there Systems, written in Java and distributed with a BSD Licence.
If you know Akka you instantly feel at home when looking at Orbit and its Documentation. So go on and start into the orbit from https://github.com/electronicarts/orbit ;-)

Sunday, March 29, 2015

Javaland 2015

Javaland 2015


It is only a few days since a colleague of mine and i went to Javaland in Phantasialand near Brühl, so it is not to late to give you a summary of the talks i visited. Hope you enjoy :-)

Day 1

Day 1 started with "Lambdas and Streams, Functional Programming with JDK 8" by Simon Ritter. Even for those that were familiar with Lambdas and Streams Simon came up with some best practices using these new Technologies. He highly recommended to avoid using for-each and showed code examples how to do that while working with streams.

Next there was "Understanding Java Bytecode" with Rafael Winterhalter. He started with an introduction to Java Bytecode so everybody got an idea what that is and how you can use it to enhance your application. In the second part of his talk he introduced his ByteCode Framework "Byte Buddy". Byte Buddy has a fluent pattern based API to generate code during runtime. Check it out on http://bytebuddy.net

For all fans of NoSQL DBs Stefan Hochdörfer had a very interesting talk where he showed how to use PostgreSQL Features to mimic some NoSQL DB behavior. This can be done using one or more in combination of the following PostgreSQL Data types:
  • Arrays
  • hstore
  • JSON / JSONB
  • XML
With a ton full of examples he showed how to access fields of these types and how to manipulate them. It was very interesting to see how to access Array fields or JSON fields in one select Statement. You can find the PowerPoint at http://t.co/Qq9VsG7ugz

Even we visit JAVAland Javascript was subject of a lot of talks. So of "TypeScript, Javascript für Java-Entwickler" ("TypeScript, JavaScript for Java-Developers") by Kai Tödter. TypeScript is developed by Microsoft under an OpenSource Licence and brings known OO Features to Javascript. For more Information and Demos visit http://www.typescriptlang.org/.

After lunch we did a deep dive,  Daniel Mitterdorfer explained in "Make or Break: The Big Impact of Small Changes in Performance" how small changes in Java Code can influence or even break CPU Functionalities like CPU Caches and Branch Predictions. For Performance analysing he used JMH (http://openjdk.java.net/projects/code-tools/jmh/) that showed the differences after small changes. You can find his slides here: http://daniel.mitterdorfer.name/talks/2015/make-or-break/#/

Because Java Bytecode is fun i visited "Programming Java Bytecode with Jitescript" presented by Joe Kutner. Joe gave an introduction to Java Bytecode and ended with some Demos of Jitescript. Jitescript itself is only meant to create new classes during runtime, modifcation of existing Bytecode is not possible. If you are interested in Frameworks that manipulates or analyse Bytecode you should checkout Byteman, Javaassist or DRGarbage.

Friday, March 6, 2015

Your Project Website on github

You have some projects on github and you need some webspace for a small Project Webpage or generated Software artifacts? Then https://pages.github.com/ is something for you. With a few steps you create a new repository at github that hosts all your webpages. A short description guides you through all necessary steps. Have fun!

Saturday, February 28, 2015

Pitfall during first Steps with Grails

Yesterday we started a coding night at our company with the goal to checkout the benefits of seperated programming of backend and frontend code. We were free in choosing technologies so i decided to use Grails for the backend and Angular.js as the frontend technology. The first tries saving an entity failed and i did not explain it to myself why that was happening. A simple Adress Entity with some fields (name, street etc. ) but saving did nothing. The solution came to me after i enabled the SQL Debug Logging in Grails (open DataSource.groovy and add logSql=true to the dataSource Definition). The logging revealed that all fields were non nullable so inserting failed without an error message. Not really nice by Grails :-)

About the result of my experiments i will inform you later, so check my block.

Friday, January 9, 2015

Debug Information when using Java's Printing Services

If you work with javax.print and want to know which parameters are sent to the printing device use following VM parameter to enable some debug information on standard out:

-Dsun.print.ippdebug=true

Saturday, January 3, 2015

Quick Dependency resolving with Grape

Most of the time i use Groovy with the GroovyShell or as a Groovy-Shell Script (remember my Blog-Post in October). Doing it that way you can achieve a lot with some lines of Groovy Script and the Groovy Standard Library Classes. But what if you need some classes from some third party libraries?
If you run your Groovy Script inside the GroovyShell you can simply modify the file groovy-starter.conf (resides in the conf folder of your GroovyShell installation). Add the classpath to the required library and you are done.
But this can get quite difficult if the library has further dependencies and you did not have these ones. Or you have these dependencies but only as maven dependencies, living in a gigantic maven repo on your local harddrive.
To get around this issue Groovy provides a Maven like mechanism called Grape. Grape does all the dependency resolving for you by doing lookups in well known Maven Repositories. So for example, if you like to have the FTPClient class from org.apache.commons.net in your Groovy Script, add the following Grape Statement:

@Grapes(
    @Grab(group='commons-net', module='commons-net', version='3.2')
)


Then add the import statement for the FTPClient class and you are done! The full script with its overwhelming functionality ;-):

@Grapes(
    @Grab(group='commons-net', module='commons-net', version='3.2')
)
import org.apache.commons.net.ftp.*;

FTPClient ftpClient = new FTPClient();


 If the required dependency does not exist in the repositories known by Grape you can tell Grape where to go to find it. Simply add this statement:

@GrabResolver(name='myrepo', root='http://mymavenrepo.org/')

Grape is "supported" by mvnrepository.com. If you look for a dependency mvnrepository.com tells you the grape-code for instant usage!

Sunday, December 14, 2014

Collada Unmarshaller

Hey everybody! I just pushed my Collada Unmarshaller to github. It simply does unmarshalling with jaxb. Not more!

You find the sources here: https://github.com/laubfall/collada-loader