Skip to content

Instantly share code, notes, and snippets.

View rjeschke's full-sized avatar

René Jeschke rjeschke

  • Viaboxx GmbH
  • Bonn, Germany
View GitHub Profile
@rjeschke
rjeschke / WavWriter.java
Created August 9, 2011 16:24
Redesign of my simple RIFF WAVE writer class.
package allerlei;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
/**
@rjeschke
rjeschke / KeyListenerWrapper.java
Created August 31, 2011 15:26
Workaround for the Linux key repeat quirk.
package thoughts;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.TimeUnit;
import javax.swing.SwingUtilities;
/**
@rjeschke
rjeschke / NeetJavaSound.java
Created September 11, 2011 19:26
Low latency javax.sound.sampled API
package streaming;
import java.util.concurrent.Semaphore;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.Line;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.Mixer;
@rjeschke
rjeschke / weelfuncp.weel
Created January 4, 2012 21:53
Weel functional programming library (clojure-like)
/*
* Experimental clojure-like functional programming library
*/
func map(fn, ls)
local ret = {};
if !ls || !fn then
return ret;
end
@rjeschke
rjeschke / git-push.sh
Created May 31, 2012 21:09
Git-push-current-branch script with safety-net
#!/bin/bash
branch="$(git symbolic-ref HEAD 2>/dev/null)";
branch=${branch##refs/heads/};
echo "Command: git push origin $branch";
while true; do
read -p "Is this correct? [yn] " yn
case $yn in
@rjeschke
rjeschke / gist:2851502
Created June 1, 2012 11:42
Hetzner VQ19 UnixBench results
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: neetsrv: GNU/Linux
OS: GNU/Linux -- 2.6.32-39-server -- #86-Ubuntu SMP Mon Feb 13 23:15:11 UTC 2012
Machine: x86_64 (unknown)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: QEMU Virtual CPU version 0.12.3 (6823.0 bogomips)
x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
13:13:19 up 1 day, 21:06, 1 user, load average: 0.00, 0.00, 0.00; runlevel 2
@rjeschke
rjeschke / Float128.java
Created June 22, 2012 09:37
128 bit floats in software (Java)
/*
* Copyright (C) 2012 René Jeschke <rene_jeschke@yahoo.de>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rjeschke
rjeschke / NJOCLSample.java
Last active December 17, 2015 02:58
OpenCL bindings for Java
import java.nio.FloatBuffer;
import com.github.rjeschke.neetutils.collections.Colls;
import com.github.rjeschke.njocl.Buffers;
import com.github.rjeschke.njocl.CL;
import com.github.rjeschke.njocl.CLException;
import com.github.rjeschke.njocl.CommandQueue;
import com.github.rjeschke.njocl.Context;
import com.github.rjeschke.njocl.Device;
import com.github.rjeschke.njocl.Kernel;
@rjeschke
rjeschke / jb.sh
Last active December 17, 2015 17:09
jnibuild bash script
#!/bin/bash
artifact=~/.m2/repository/com/github/rjeschke/jnibuild/0.1-SNAPSHOT/jnibuild-0.1-SNAPSHOT.jar
if [ ! -f $artifact ]
then
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=http://maven.renejeschke.de/snapshots/ -Dartifact=com.github.rjeschke:jnibuild:0.1-SNAPSHOT
fi
java -cp $artifact com.github.rjeschke.jnibuild.Build $@
@rjeschke
rjeschke / OpenCLKernel.hpp
Last active June 7, 2018 12:57
OpenCL C language feature emulation include file for Eclipse CDT. This header allows OpenCL kernels to be edited in Eclipse using C++ mode with syntax highlighting and auto-completion. The header contains all basic types and functions for OpenCL 1.2. 'Half' support and extensions are not yet implemented.
/*
* Copyright (C) 2013 René Jeschke <rene_jeschke@yahoo.de>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software