For all of you who use Jira with Mylyn and just switched to Eclipse Mars: there is actually no Jira-Connector available if you ask for in the Mylyn Repository-Dialog. So you have to install it for your own by adding the update-site: http://update.atlassian.com/atlassian-eclipse-plugin/rest/e3.7
Even if the connector is supposed to be used up to Eclipse Luna it also works with Eclipse Mars.
Wednesday, July 22, 2015
Wednesday, April 29, 2015
Testing AngularJS Services with Jasmine
If you write unit test for your angularjs application you may already read the documentation provided by the angularjs website. It has a lot of good information but i missed the description of how to test services that i wrote for my application. For angularjs services the jasmine setup code looks like:
beforeEach(inject(function(_$controller_){
$controller = _$controller_;
}));
The _$controller_ is an internal representation of the angularjs controller service, $controller is a local variable.
So, how does injecting of a custom service work? Well, it is easy...
beforeEach(inject(function(_YourService_){
$localService = _YourService_;
}));
And the service code:
yourAppServices.factory('YourService', [function($http, ESCommons) {
return {...}]);
beforeEach(inject(function(_$controller_){
$controller = _$controller_;
}));
The _$controller_ is an internal representation of the angularjs controller service, $controller is a local variable.
So, how does injecting of a custom service work? Well, it is easy...
beforeEach(inject(function(_YourService_){
$localService = _YourService_;
}));
And the service code:
yourAppServices.factory('YourService', [function($http, ESCommons) {
return {...}]);
Monday, April 27, 2015
Voxxed - News for Java Developers
If you are looking for the latest news about Java and Web-Technologies you might want to have a look at voxxed.com! This site presentates a lot of information about Java and similiar topics (Grooovy, JavaScript, BigData).
Saturday, April 4, 2015
Javaland 2015 - Day 2
Better late then never here it is, my summary of our second day at Javaland 2015 :-)!
After a first day with a lot of interesting talks and fantastic rides with the Black Mamba we started day 2 at Javaland. This day came up with a lot of JavaFX talks. Perfect, because the last Project at work made heavy use of JavaFX. So i decided to take a look how other programmers work with JavaFX.
Hendrik Ebbers from Canoo and Alexander Casall (Saxonia AG) started after the Keynote with "Enterprise Applications with JavaFX". They gave an overview how to build JavaFX Applications that communicate with JEE Backend Systems and gave some best practice tips how to bind data models to their corresponding view (Model-View-View-Model Pattern), and how to synchronize views between two instances of one JavaFX Application. Theyalso mentioned some interessting JavaFX Libraries that addresses the named Topics:
Well, as you can see, Java Developers are not very creativ when inventing a Name for a library ;-)
The trick mainly based on an really tiny RFID-Chip inside every Card. With a Little RFID detector hidden in his Hand, he hovered over the Card with the face down. The RFID-Chip transmitted the type of the Card to the detector. Over a Network the result was transmitted to a RasberryPI and finally send to Google Glasses.
That showed how Network capable devices can communicate with each other.
Bruno Borges and a colleague showed their implementation of 2048 with JavaFX in the next talk. They covered how they did the databinding, the design and the animations with JavaFX to achieve the typical 2048 Feeling. Finally they introduced the port to Android Devices, done with JavaFXPort (http://www.javafxports.org/page/home). You can find the app in the Play-Store https://play.google.com/store/apps/details?id=org.jpereda.game2048
With a lot of examples he showed use cases and best practices.
After a first day with a lot of interesting talks and fantastic rides with the Black Mamba we started day 2 at Javaland. This day came up with a lot of JavaFX talks. Perfect, because the last Project at work made heavy use of JavaFX. So i decided to take a look how other programmers work with JavaFX.
Hendrik Ebbers from Canoo and Alexander Casall (Saxonia AG) started after the Keynote with "Enterprise Applications with JavaFX". They gave an overview how to build JavaFX Applications that communicate with JEE Backend Systems and gave some best practice tips how to bind data models to their corresponding view (Model-View-View-Model Pattern), and how to synchronize views between two instances of one JavaFX Application. Theyalso mentioned some interessting JavaFX Libraries that addresses the named Topics:
- DataFX (http://www.javafxdata.org/)
- mvvmFX (http://jfxlab.com/mvvmfx/)
- SynchronizeFX (https://github.com/saxsys/SynchronizeFX)
- OpenDolphin (http://open-dolphin.org/)
Well, as you can see, Java Developers are not very creativ when inventing a Name for a library ;-)
IoT
Another big Topic at day two was IoT - Internet of things. Maybe you did not know this term you probably get in touch with it. Since not even Computers and Smartphones but also TVs, Refrigerators, Watches and lot more devices can connect to the Internet we talk about the IoT. To get an easy introduction into that Topic i decided to watch "IoT Magic Show" with Stephen Chin (yeah, the men with the Motorcycle :-) ). Stephen and a colleague explained IoT with the help of three Magic tricks. The most impressing one was the first one. Three People from the audience had to choose one gamingcard and Stephens colleague had to guess what gaming they had choosen. As you might guess he guessed right every Card!The trick mainly based on an really tiny RFID-Chip inside every Card. With a Little RFID detector hidden in his Hand, he hovered over the Card with the face down. The RFID-Chip transmitted the type of the Card to the detector. Over a Network the result was transmitted to a RasberryPI and finally send to Google Glasses.
That showed how Network capable devices can communicate with each other.
2048
Need a break after a lot of reading? How about playing 2048 to relax? If you don't know 2048 the game you may want to checkout http://gabrielecirulli.github.io/2048/. It is fun and easy to learn!Bruno Borges and a colleague showed their implementation of 2048 with JavaFX in the next talk. They covered how they did the databinding, the design and the animations with JavaFX to achieve the typical 2048 Feeling. Finally they introduced the port to Android Devices, done with JavaFXPort (http://www.javafxports.org/page/home). You can find the app in the Play-Store https://play.google.com/store/apps/details?id=org.jpereda.game2048
Groovy Traits
A less visited talk but not less interessting was "Traits and their usage inside groovy" by Jochen Theodorou. Jochen talked about the reason why they invented and implemented traits and why it is better to use traits then mixins.With a lot of examples he showed use cases and best practices.
Projector Pattern
Finally we visited "Efficency and Flexibility of the projector pattern" by Dierk König. Maybe you don't know the pattern it is very likely that you already used this pattern when you programmed some GUI Application. In short words the projector pattern is when you work with an API that describes what the GUI should Display, but not how things are displayed. For this reason you use a Projector and only the projector knows how to Display GUI Elements.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 ;-)
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
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.
Labels:
bytebuddy,
Bytecode,
javaland,
jitescript,
jmh,
Performance,
postgresql,
typescript
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.
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
-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!
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!
Subscribe to:
Posts (Atom)