Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Nischt michael-nischt

View GitHub Profile
@michael-nischt
michael-nischt / VisionGL.java
Created Jun 2, 2011
Convert computer vision camera matrices to OpenGL
View VisionGL.java
/*
* 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 Aug 17, 2011
A simple Frames-per-Second (FPS) counting utility class
View FpsCounter.java
/*
* 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 Mar 18, 2012
Utility to fetch a reference for an instance mapped by a particular key.
View InstanceProvider.java
/*
* 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 Oct 5, 2015
WebGL shader utilities
View glShaderUtils.js
/*
* 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 Jul 18, 2012
Sequential Labeling of Connected Components
View Conected4Test.java
/*
* 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 Jul 19, 2012
accessing a sub-matrix of an unknown multi-dimensional matrix
View submat.m
% 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 Jul 19, 2012
creating record like data structures from arrays grouped by an index cell
View grouped.m
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 Jul 26, 2012
Java class that performs a fixed rate simulation.
View Simulation.java
/*
* 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.
View AliasMethod.java
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 Aug 29, 2015
server side dropbox
View 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