Using Levenshtein distance in Java

Recently I found this for computing Levenshtein distance in Java. With Levenshtein you can calculate the differnece between two strings. This Read more

SQLite with Java

// 0 Installation Download the SQLite JDBC driver. When using Eclipse you can just add the library to the Read more

Touchpad settings Ubuntu 13.10

// The touchpad on my Thinkpad X1 Carbon was way too sensitive. I changed the synaptics settings, to get Read more

Sky Go on Ubuntu 13.10

This is about how to watch Sky Go (Pay-TV) on my Ubuntu 13.10 notebook. With the Pipelight Browser-Plugin you can Read more

e4 application with different layouts and widgets

// Prerequisite: First e4 application Github: e4Layout After you did the your first e4 application you can use different layouts Read more

First Eclipse e4 Application

// The coding of this project is published on github. Here we will create an Eclipse e4 application which Read more

Do Funny Stuff with the Google Charts API and PHP

// I think, whenever we see a chart in a magazine, in books or applications our brain say's Read more

JSON with Java (Jackson)

// Prerequisites: Tomcat 7 with Eclipse Juno Scenario: Several POJOs (player, team, club) Mockup data Create JSON Object in Java using Jackson Use a Read more

Hibernate getting started

// Getting started with Hibernate: Getting started with Hibernate 4.1.8 on Eclipse Juno with Hibernate Tools 3.4.0. My recommendation is to Read more

Android Moving Object

// Here I will show you how to handle a moving object in Android. The object we are talking Read more

Using Levenshtein distance in Java

Recently I found this for computing Levenshtein distance in Java.
With Levenshtein you can calculate the differnece between two strings.

This is the Java code for the Levenshtein distance:

public class Levenshtein {

private static int minimum(int a, int b, int c) {
return Math.min(Math.min(a, b), c);
}

public static int computeLevenshteinDistance(String str1,String str2) {
int[][] distance = new int[str1.length() + 1][str2.length() + 1];

for (int i = 0; i <= str1.length(); i++)
distance[i][0] = i;
for (int j = 1; j <= str2.length(); j++)
distance[0][j] = j;

for (int i = 1; i <= str1.length(); i++)
for (int j = 1; j <= str2.length(); j++)
distance[i][j] = minimum(
distance[i - 1][j] + 1,
distance[i][j - 1] + 1,
distance[i - 1][j - 1] + ((str1.charAt(i - 1) == str2.charAt(j - 1)) ? 0 : 1));

return distance[str1.length()][str2.length()];
}
}

Read more

Posted on by Monte in Java Leave a comment

SQLite with Java

0 Installation

Download the SQLite JDBC driver. When using Eclipse you can just add the library to the classpath of your Java project.

Add External Library to Build Path

Add External Library to Build Path

Select the Jar to the Build Path

Select the Jar to the Build Path

Read more

Posted on by Monte in Java Leave a comment

Touchpad settings Ubuntu 13.10

The touchpad on my Thinkpad X1 Carbon was way too sensitive.
I changed the synaptics settings, to get ride of this annoying problem.

First you need to copy the file 50-synaptics.conf:
Read more

Posted on by Monte in Other Leave a comment