Skip to content

Instantly share code, notes, and snippets.

@Alcar32
Alcar32 / Spring_Data_JPA_Tutorial.md
Created November 9, 2013 19:46
A Tutorial howto use Spring Data JPA (http://projects.spring.io/spring-data-jpa/). Please be patient, this is build step by step.

Spring Data JPA Tutorial


Requirements

  • Installed JDK JavaSE (1.7 is recommend)
  • Installed Apache Maven
  • Internet connection (to download dependencies by maven)
  • [optional] a IDE like Eclipse or IntelliJ IDEA
@Alcar32
Alcar32 / Maven-Commands.md
Created November 6, 2013 21:40
Some Apache Maven commands
Clean a Maven project, that is developed in Eclipse
mvn eclipse:clean clean
Recreate the project files (.project, .claspath) for Eclipse
mvn eclipse:clean eclipse:eclipse

#####Clean build of a Maven project, that is developed in Eclipse mvn eclipse:clean eclipse:eclipse clean compile

@Alcar32
Alcar32 / LUA.txt
Created September 20, 2013 15:23
All About LUA
### Official Lua community site ###
http://lua-users.org/
### Lua cumunity wiki ###
http://lua-users.org/wiki/
### Lua Documentation ###
http://www.lua.org/docs.html
#### Lua 5.2 Reference Manual ###

How to get the Nexus Book?

Goto http://www.sonatype.com/ and click on 'Resources'. Then click on 'Books' and select 'Repository Management with Nexus'. You can download the pdf file or you can read it online.

How to get the Book 'Maven by Examples'?

Goto http://www.sonatype.com/ and click on 'Resources'. Then click on 'Books' and select 'Maven by Example'. You can download the pdf file or you can read it online.

How to get the Book 'Maven: The Complete Reference'?

Goto http://www.sonatype.com/ and click on 'Resources'. Then click on 'Books' and select 'Maven: The Complete Reference'.

Get the source code and the Plugin of an UI

Press Alt+Shift+F1 during cursor mark a UI-element. (wizard etc.)

Get the source code and the Plugin of a menu

Press Alt+Shift+F2 during cursor mark a menu element.

@Alcar32
Alcar32 / listIterator_Example
Created August 23, 2013 13:11
Iterate reverse throu a list with list listiterator
// Substitute appropriate type.
ArrayList<...> a = new ArrayList<...>();
// Add elements to list.
// Generate an iterator. Start just after the last element.
ListIterator li = a.listIterator(a.size());
// Iterate in reverse.
while(li.hasPrevious()) {
@Alcar32
Alcar32 / example-pom.xml
Created July 30, 2013 13:27
[HowTo] | [Java Service Wrapper],[Maven] How to configure a maven project as a (system) service, by using the java service wrapper maven plugin.
<build>
<resources>
<resource>
<!-- define a folder 'etc' where the resource files a stored -->
<targetPath>../daemon/appassembler/jsw/parameterdb-daemon/etc</targetPath>
<directory>${project.basedir}/src/main/resources/</directory>
<includes>
<include>**/*.xls</include>
<include>**/*.xml</include>
<include>**/*.properties</include>
@Alcar32
Alcar32 / how to add a jar to local repository.txt
Created July 29, 2013 17:32
[HowTo] | [Maven] How to create a local maven repository stored in a maven project and import a jar file in this local repository.
# Example if a jar file called 'maryclient.jar' is stored in 'lib' folder in project root.
# The parameter of '-Durl' need a full path name to local repository
$> mvn deploy:deploy-file -Dfile=".\lib\maryclient.jar" -DgroupId=de.mary.dfki -DartifactId=maryclient -Dversion=1.0 -Dpackaging=jar -Durl="file://C:\Users\domann\workspace\juno\SmartNutritionAssistant\CookingAssistant\repo"
# After the import is finished. The project structure should be like this:
project
|
+--src
package example;
import java.beans.XMLEncoder;
import java.io.ByteArrayOutputStream;
import java.util.Vector;
public class XmlEncodeToString {
public static void main(String[] args) throws Exception {