Skip to content

Instantly share code, notes, and snippets.

View muuki88's full-sized avatar
😘
Taking care of my daugther

Muki Seiler muuki88

😘
Taking care of my daugther
View GitHub Profile
@muuki88
muuki88 / esnextbin.md
Last active March 1, 2016 10:21
esnextbin sketch
private static FloatMatrix multiply(FloatMatrix A, FloatMatrix B, boolean local) throws IOException {
if (A.getColumnDimension() != B.getRowDimension()) {
throw new IllegalArgumentException("Matrix inner dimensions must agree.");
}
CLContext context = JavaCL.createBestContext();
CLQueue queue = context.createDefaultQueue();
int resultLength = A.getRowDimension() * B.getColumnDimension();
Pointer<Float> aPtr = matrixToPointer(A);
@muuki88
muuki88 / gist:4244719
Created December 9, 2012 12:52
CoinFlip
package de.mukis;
import java.text.DecimalFormat;
import java.text.NumberFormat;
/**
* Generates all possibilities for a coinflip.
*
* @author muki
*
@muuki88
muuki88 / gist:4007904
Created November 3, 2012 17:00
SBT and Pax Exam

Hi,

I'm trying to create integration tests for the akka project (akka/akka#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
@muuki88
muuki88 / install-akka-into-maven.sh
Created July 29, 2012 22:41
Installing Akka snapshots to local repository for tycho
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 / AddPluginDependecies.java
Created July 12, 2012 13:57
Editing Java MANIFEST.MF
/**
* @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 / contact.db
Created April 10, 2012 09:22
This is a sample file database for the scala tutorial
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 / gist:1694204
Created January 28, 2012 12:54
Custom Scalatest Matchers
//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 / IReportingService.java
Created January 9, 2012 22:07
IReportingService draft
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