Skip to content

Instantly share code, notes, and snippets.

@jackganzha
jackganzha / ModelTest.java
Created February 20, 2012 03:19
A super class for model tests in play 2.0
package models;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.After;
import org.junit.Before;
import org.junit.Assert;
@jackganzha
jackganzha / NaturalSort.java
Created March 25, 2011 04:51
a natural sort implementation using ruby
public class NaturalSort {
public static Integer firstNumberOccurrenceFor(String string) {
java.util.regex.Matcher matcher = java.util.regex.Pattern.compile("^\\D*(\\d+).*").matcher(string);
matcher.find();
return Integer.valueOf(matcher.group(1));
}
public static java.util.List<String> naturalSort(java.util.List<String> items) {
java.util.List<String> sortedItems = new java.util.ArrayList<String>(items);
@jackganzha
jackganzha / pom.xml
Created February 24, 2011 02:03
a maven pom file to akka project
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.forrst</groupId>
<artifactId>akka_forrst</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>question-at-forrst</name>
<repositories>
<repository>