Skip to content

Instantly share code, notes, and snippets.

View michael-nischt's full-sized avatar

Michael Nischt michael-nischt

View GitHub Profile
@michael-nischt
michael-nischt / VisionGL.java
Created June 2, 2011 18:37
Convert computer vision camera matrices to OpenGL
/*
* Copyright (c) 2011 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@michael-nischt
michael-nischt / FpsCounter.java
Created August 17, 2011 16:33
A simple Frames-per-Second (FPS) counting utility class
/*
* Copyright (c) 2006 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@michael-nischt
michael-nischt / InstanceProvider.java
Created March 18, 2012 19:17
Utility to fetch a reference for an instance mapped by a particular key.
/*
* Copyright (c) 2012 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@michael-nischt
michael-nischt / glShaderUtils.js
Last active October 5, 2015 15:58
WebGL shader utilities
/*
* Copyright (c) 2011 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@michael-nischt
michael-nischt / Conected4Test.java
Created July 18, 2012 20:08
Sequential Labeling of Connected Components
/*
* Copyright (C) 2007/2011 Michael Nischt
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@michael-nischt
michael-nischt / submat.m
Created July 19, 2012 00:10
accessing a sub-matrix of an unknown multi-dimensional matrix
% if ndims(A) == 3
% submat(A,i) = A(:,:,i)
% alternative use:
% submat(A,i:j) = A(:,:,i:j)
function B = submat( A, i )
s = size(A);
@michael-nischt
michael-nischt / grouped.m
Created July 19, 2012 00:10
creating record like data structures from arrays grouped by an index cell
function [ grouped ] = grouped( indices, varargin )
if iscell(indices)
I = indices;
else
I = grouped_indices( indices );
end
if isempty(varargin)
grouped = I;
@michael-nischt
michael-nischt / Simulation.java
Created July 26, 2012 08:34
Java class that performs a fixed rate simulation.
/*
* Copyright (c) 2012 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
package net.monoid.util;
import java.util.*;
/**
* based on:
* http://www.keithschwarz.com/darts-dice-coins/
* http://www.keithschwarz.com/interesting/code/?dir=alias-method
*/
public final class AliasMethod {
@michael-nischt
michael-nischt / dropbox
Last active August 29, 2015 13:57
server side dropbox
#!/bin/sh
### BEGIN INIT INFO
# Provides: dropbod
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Dropbox Service
### END INIT INFO