Collections and streams

Categories: Java

An interesting way to process a collection is the usage of streams. A stream provides a sequential access to the elements of the collection. Below a code snipped for a simple selection of elements of an existing collection. In this example the dataList contains just some Strings and we want to get a new list […]

Extract URL parameters via JavaScript

Categories: Java

Just a short code snippet that allows the extraction of URL parameters via JavaScript: function get_url_param( name ) { name = name.replace(/[\[]/,”\\\[“).replace(/[\]]/,”\\\]”); var regexS = “[\\?&]”+name+”=([^&#]*)”; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if ( results == null ) return “”; else return results[1]; }  

Liferay-Development for beginners – Part two – Creation of a development environment

Categories: Java, Liferay

The development for the Liferay portal is quite nice by using a local develop environment with Eclipse, Mysql and Liferay. Therefore you should download the following components: Liferay (http://sourceforge.net/projects/lportal/files/Liferay%20Portal/) Liferay Portal bundled with Tomcat Liferay Portal sources Liferay Portal Documentation Liferay Portal SDK Eclipse Eclipse Liferay IDE (downloadable via Eclipse Marketplace -> just search for […]

Liferay-Development for beginners – Part One – Setup your own instance

Categories: Java, Liferay

This little tutorial is written for users that are familiar with the following points, so they are not explained in detail: Working with linux (or any other OS of your choice), an editor like vi, etc. Install and configure a Mysql instance Creation of schema and assignment of user and rights Before you start with […]

Java: Stack vs. Heap

Categories: Java

Stack vs Heap 1. Stack 1.1. Struktur Der Stack stellt einen Speicherbereich dar der in Form eines LIFO Puffers (Last In – Fist Out) organisiert ist. Elemente die zuerst auf dem Stack abgelegt werden liegen unten, die zuletzt abgelegten Elemente liegen oben. Durch die Struktur des Stacks und der hierdurch sehr effizienten Verwaltung, sind Stack-Operationen […]