Skip to content

Instantly share code, notes, and snippets.

Avatar
😘
Taking care of my daugther

Nepomuk Seiler muuki88

😘
Taking care of my daugther
View GitHub Profile
@muuki88
muuki88 / AutoPlugins.scala
Last active Aug 29, 2015
SBT Native Packager - Auto Plugins
View AutoPlugins.scala
// API proposal # 1
lazy val root = project(file(".")
.enablePlugins(SbtNativePackager, JavaServerArchetype)
.settings(
"maintainer" in Debian := "Your Name <your.name@your-company.com"
)
)
// Implementation may look like
object SbtNativePackager extends AutoPlugin
@muuki88
muuki88 / loadInstancesAsXML
Created Jan 7, 2012
Load Instances via PatientService and store into XML (XRFF)
View loadInstancesAsXML
import weka.core.converters.Loader;
import weka.core.converters.Saver;
import weka.core.converters.ArffLoader;
import weka.core.converters.XrffSaver;
IPatientService ps = ... //get IPatientService
Data d = ... //get Data entity
Path pathToArff = locateFile(Data d);
Path pathToXML = ... //get it!
try(InputStream in = Files.newInputStream(pathToArff); OutputStream out = Files.newOutputStream(pathToXML) {
@muuki88
muuki88 / IReportingService.java
Created Jan 9, 2012
IReportingService draft
View IReportingService.java
package de.lmu.ifi.dbs.medmon.medic.core.service;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Path;
import java.util.Map;
public interface IReportingService {
//TODO Maybe one more parameter to determine if the report should be rendered as html, pdf, etc
@muuki88
muuki88 / gist:1694204
Created Jan 28, 2012
Custom Scalatest Matchers
View gist:1694204
//Copied from ShouldMatchers and Matchers
private object ShouldMethodHelper {
def shouldMatcher[T](left: T, rightMatcher: Matcher[T]) {
rightMatcher(left) match {
case MatchResult(false, failureMessage, _, _, _) => throw newOverridenTestFailedException(failureMessage)
case _ => ()
}
}
}
@muuki88
muuki88 / contact.db
Created Apr 10, 2012
This is a sample file database for the scala tutorial
View contact.db
1;person;Lars;Vogel;10;20;
2;person;Marcel;Bruch;10;22;
3;person;Martin;Odersky;11;21;
4;person;Jonas;Boner;11;21;
5;person;Victor;Klang;11;21;
10;company;vogella;
11;company;typesafe;
20;group;android;
21;group;scala;
22;group;eclipse;
@muuki88
muuki88 / AddPluginDependecies.java
Created Jul 12, 2012
Editing Java MANIFEST.MF
View AddPluginDependecies.java
/**
* @see http://www.eclipsezone.com/eclipse/forums/t116172.html
*/
public void addPluginDependency(String plugin, String version, boolean reexport, boolean overwrite) throws BundleException {
String requireBundleHeader = "Require-Bundle";
String bundleVersionAttr = "bundle-version";
String rexportDirective = "visibility";
Manifest manifest = new Manifest();
assert (plugin != null);
@muuki88
muuki88 / install-akka-into-maven.sh
Created Jul 29, 2012
Installing Akka snapshots to local repository for tycho
View install-akka-into-maven.sh
mvn install:install-file -DgroupId=com.typesafe.akka -DartifactId=akka-actor -Dversion=2.1-SNAPSHOT -Dpackaging=jar -Dfile=/home/muki/Development/target_platform/typesafe/akka/akka-actor/target/akka-actor-2.1-SNAPSHOT.jar
mvn install:install-file -DgroupId=com.typesafe.akka -DartifactId=akka-osgi -Dversion=2.1-SNAPSHOT -Dpackaging=jar -Dfile=/home/muki/Development/target_platform/typesafe/akka/akka-osgi/target/akka-osgi-2.1-SNAPSHOT.jar
mvn install:install-file -DgroupId=com.typesafe.akka -DartifactId=akka-osgi-aries -Dversion=2.1-SNAPSHOT -Dpackaging=jar -Dfile=/home/muki/Development/target_platform/typesafe/akka/akka-osgi-aries/target/akka-osgi-aries-2.1-SNAPSHOT.jar
mvn install:install-file -DgroupId=com.typesafe.akka -DartifactId=akka-akka-slf4j -Dversion=2.1-SNAPSHOT -Dpackaging=jar -Dfile=/home/muki/Development/target_platform/typesafe/akka/akka-akka-slf4j/target/akka-osgi-2.1-SNAPSHOT.jar
@muuki88
muuki88 / gist:4007904
Created Nov 3, 2012
SBT and Pax Exam
View gist:4007904

Hi,

I'm trying to create integration tests for the akka project (https://github.com/akka/akka/pull/589) with Pax Exam. However I got stuck. I will post the three options I tried and the errors I get in each. You can try this on your own, pulling this repository: https://github.com/muuki88/akka and run:

> sbt
> test-only akka.osgi.test.LocalActorTest
View gist:4244719
package de.mukis;
import java.text.DecimalFormat;
import java.text.NumberFormat;
/**
* Generates all possibilities for a coinflip.
*
* @author muki
*