Hints and tricks for developers

Martins Amazon Wunschliste

Maven-Konfiguration mit Eclipse 6. December 2016

Damit Eclipse mit der Maven-Verzeichnisstruktur arbeitetn kann muß man Maven innerhalb von Eclipse kongigurieren.

Als erstes muß man maven auf sein Sytem kopieren und ein paar Umgebungsvariablen einstellen.

M2_HOME: C:/Programme/Apache Software Foundation/apache-maven-2.2.1
JAVA_HOME: C:/Programme/IBM/SDP/jdk
Path: %M2_HOME%bin

Installation von Maven muß ein einem Verzeichnis ein.

das zweite bild

zweites bild

No Comments on Maven-Konfiguration mit Eclipse
Tags: ,
Categories: Maven

WordPress Migration

how to save legcy data

  • Save your old wp-config.php from you legacy installation

Man sollte sich die Datei wp-config.php vom dem Alt-System sichern.
Sicherung des upload-Verzeichnis (Dort wurden die upgeloadedten Dateien von WordPress abgelegt).
Evt. Sicherung des alten Themes.
Export über der Datenbank über phpMyAdmin.
Anpassung des Export-Files. Hinzufügen von use ´dbname´.

Installation of new WordPress-System

  • Download des Zip-Archives das WordPress enthält.
No Comments on WordPress Migration
Categories: Tools Uncategorized

Nützliche Links

Nützliche Links

Firewall C:\Windows\System32\Firewall.cpl Windows7

AppWizzard C:\Windows\System32\appwiz.cpl windows7


%SystemRoot%\SYSTEM32\rundll32.exe dsquery,OpenQueryWindow

No Comments on Nützliche Links
Tags: ,
Categories: Windows

Function to calculate amount of labour days between two dates

To determin the eleapsed time in days for in insurence company we had to dynamicly
calculate them.

In an earlier project we realized that it wasn’t a good idea to run a batch thats precalculates the values.

The almausr.feiertag table is used to save holidays.
(It’s the german word for holiday).

No Comments on Function to calculate amount of labour days between two dates
Tags: ,
Categories: DB2 SQL

SimpleProxyServer 5. December 2016

You need a Proxy-Server to track the traffic.
But you are not allowed to install one.
All you have is Java.

Here ist the a solution.

No Comments on SimpleProxyServer
Tags: ,
Categories: Java

Replace tabs with whitspaces 6. October 2016

Our code was analysed by the sonar tool. One rule says that you should not use tab-characters.
So I needed to replace all tab-characters by 4 spaces

I used the sfk.exe .

converts the tabs of all Java-Files in the src-directory to 4 space-character.

No Comments on Replace tabs with whitspaces
Tags: ,
Categories: Uncategorized

Maven 5. February 2016

validate – validate the project is correct and all necessary information is available
compile – compile the source code of the project
test – test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
package – take the compiled code and package it in its distributable format, such as a JAR.
integration-test – process and deploy the package if necessary into an environment where integration tests can be run
verify – run any checks to verify the package is valid and meets quality criteria
install – install the package into the local repository, for use as a dependency in other projects locally
deploy – done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

create eclipse project of your pom.xml

mvn eclipse:eclipse
No Comments on Maven
Categories: Java Maven

PreparedStatementWrapper 23. April 2015

No Comments on PreparedStatementWrapper
Tags: ,
Categories: DB2 Java

highlight form elements with jquery

//highlight form elements....

document.styleSheets[0].insertRule("::-webkit-input-placeholder { color: green; font-weight: bold ;  background-color:rgba(255,255,255,1); border: 1px solid green}", 0);

$.each($("input"), function() {
	if ($(this).attr('name')) {
		$(this).val("");//evtl inhalte loeschen
		//if ($(this).attr('hasDatepicker')) {
			//wenn Datepicker, dann Felder vergroessern


$.each($("select"), function() {
	if ($(this).attr('name')) {
		$(this).css({ color : "green", fontWeight: "bold" }).val($(this).attr('name'));

$.each($("input[type=radio], input[type=file]"), function() {
	if ($(this).attr('name')) {
"+ $(this).attr('name') +"
"); } }); $.each($("input[type=hidden]"), function() { //nur elemente die ein name attrib haben.. if ($(this).attr('name')) { $(this).removeAttr("type"); $(this).before("
"+ $(this).attr('name') +"\n(hidden)
"); } });
No Comments on highlight form elements with jquery
Categories: Uncategorized

Start WebSphere Portal 24. February 2015

c:\IBM\PortalServer\AppServer\bin>startserver WebSphere_Portal
ADMU0116I: Toolinformationen werden in der Datei
ADMU0128I: Das Tool wird mit dem Profil wp_profile gestartet.
ADMU3100I: Die Konfiguration des Servers wird gelesen: WebSphere_Portal
ADMU3200I: Der Server wurde gestartet. Es wird auf den Initialisierungsstatus

No Comments on Start WebSphere Portal
Categories: Uncategorized

Gute Einfürung in Graphviz 19. February 2015

No Comments on Gute Einfürung in Graphviz
Categories: Uncategorized

mobaxterm 18. February 2015


F11 = full screen

No Comments on mobaxterm
Categories: Uncategorized

graphviz windows mac

mac – commandline.

dot -Tsvg -o meinedatei.svg

No Comments on graphviz windows mac
Tags: ,
Categories: Tools

i18n for php 13. February 2015

Good example can be found.

Install homebrew

download the tools

execute them

/usr/local/opt/gettext/bin/msgfmt messages.po

No Comments on i18n for php
Categories: php

Cross join

Cross join mostly used:

By learning sql you will soon get in touch with joins.
The following examples show this type of join which is called cross join.
The result is a Cartesian product between the two tables.

select * from a, b

In more complex queries you have to use the ansi syntax to make the query more readable.
This makes it easier to understand the query later – or if someone else tries to understand what
you are doing.

ansi syntax of cross join

select * from a
cross join b

This was just an example the see how it works.
This is an example where you about what I’m taking about

select * from a
cross join b
join c
on = c.b_id
join d
on = d.c_id

So don’t forget. That there are not only

  • joins (with join condition)
  • left joins
  • left outer joins

but also the cross join.

No Comments on Cross join
Categories: Maven

Maven Release Plugin 11. February 2015

mvn release:clean
mvn release:prepare
mvn release:perform


Installation eine hpi_Datei- die hat den gleichen Aufbau wie ein war.

No Comments on Maven Release Plugin
Categories: Maven

maven-scm-provider-svnjava 3. February 2015

If you whant to use a pure java implementation of a cvs client you got to download
the latest version of it.

No Comments on maven-scm-provider-svnjava
Categories: Maven

Sonar Postgresql 30. January 2015

Do you want to use Sonar with postgresql?
Then read the following articel.

This can be very handy if you want to use the maven sonar pluging.
All results of the scan will be stored to this DB.

No Comments on Sonar Postgresql
Categories: Uncategorized

Continuous delivery 29. January 2015


  • XXX-build (executes test and builds the current snpashot
  • XXX-deploy (creates a package and deploys it to nexus)
  • XXX-deliver (deploys the release-package to test-server)


  • Executes the JUnit Tests.
  • Perform Sonar checks.
  • creates an snapshot-package.
  • deploys the snapshot-package to nexus.

This Job is executed on every commit.
The time leak is 5 mins.

The build can be executed manually by pushing the “Jetzt bauen”-Button



skips the JUnit-Tests.
Skkps the Sonar checks.
creates an release package.
deploys the release-package to nexus.

This Job is executed by pushing the “Perform Maven Release”-Button.
Hudson screenshot



The Hudson/Jenkins server executes a script over ssh that downloads the latest release package and restart the server. The script itself just executes a Java-Program that does all the nasty work.

  • determin the package version of the artifact
  • downloads the artifact to filesystem (e.g. /srv/stage/mywebapp.war
  • deploys the webapp in the Applicationserver

This Job has to be executed manually in Jenkins.

version overview

You should inform yourself about the current Versions.
It’s a good idea to do this before an after the deivery of your software.

Bildschirmfoto 2015-01-29 um 07.01.04

test overview

You should inform yourself about the current Versions.
testergebnisseIt’s a good idea to do this before an after the deivery of your software

No Comments on Continuous delivery
Categories: Uncategorized

log4j – where are my logs?

Create a Servlet that shows you the log4j-configuration

String configurationOptionStr = OptionConverter.getSystemProperty(
String configuratorClassName = OptionConverter.getSystemProperty(
writer.write("configurationOptionStr:" +configurationOptionStr+"n");
writer.write("configuratorClassName:" +configuratorClassName+"n");
No Comments on log4j – where are my logs?
Tags: ,
Categories: Java
Martin Rocks