Monday, December 23, 2013

Using the executorservice to create new Threads on google appengine

Appengine actually allows you to spawn new threads, as long as you follow the rules defined in the docs. Here is how I did it, copy, paste and use it as you wish.

Tuesday, June 4, 2013

Using gae plugin with gradle (gradle + appengine)

Looking for an example project using gradle and appengine? I have used the gae plugin for gradle in this simple webapp and made the sourcecode available for you. Follow this link and build with gradle 1.6 .

Saturday, May 11, 2013

git store password

To make git store your password, simply type

"git config credential.helper store"

to store it locally (for just the current repo), type

"git config --local credential.helper store"

Next time you push to the repo, git will store your password permanently.

Friday, May 3, 2013

Speeding up my build with gradle and some paralell magic

Just posting the results here, will get back to the details and some explanation in a later post.

Multi-module java project, 10 sub-modules, about 10k(?) unit-tests.

mvn clean install:  Total time: 3:52.082s ~ 232 secs
gradle clean build: Total time: 3 mins 20.987 secs
gradle clean build: Total time: 2 mins 17.648 secs (module parallel)
gradle clean build: Total time: 2 mins 0.58 secs ~ 120 secs ( module parallell, 2 threads)
gradle clean build: Total time: 2 mins 26.935 secs ( module parallell, 3 threads)



Sunday, April 28, 2013

Raspberry pi WiFi : dongle and config


  • Buy this dongle from dealextreme. This dongle works out of the box with Raspbian “wheezy” and needs no additional drivers. The chip is the realtek 8188 chip and works perfectly with linux.
  • Edit /etc/networking/interfaces according to the gist below. Replace network name and password with your own:

Halt yor pi, remove any networking cables and restart. Congrats, your pi is wireless online!

Saturday, February 16, 2013

Generate java from Wsdl with gradle

UPDATE: I have made a plugin to do this, just follow the guide on https://github.com/nilsmagnus/wsdl2java .

 The plain simple way to generate java from wsdl is this: add a javaexec task to your wsdl and run. The following code snippet will help you out:

The "wsdlsToGenerate" contains all the arguments for the org.apache.cxf.tools.wsdlto.WsdlToJava class, in the right order.

However, if you have a project like I have with 58 different wsdls, this approach is very time consuming. This is because every time createJavaFromWsdl() is called, a new java process will be started, executed and stopped. Now you have 58 sequential java processes running in your build script(!). 

Instead, why not run everything in the same java process? This can be done with code snippet 2: 


Now, this adds some dependencies to the build-script, but I can live with that.
The runtime from snippet1 with 58 wsdls is 2min 58secons on my laptop. The runtime of snippet2 is 24seconds!