Skip to content

Instantly share code, notes, and snippets.

10
##### ####
# #
# #
# #
# #
# #
# #
#22223 #
#11111111#
@voidc
voidc / EventBus.java
Created April 23, 2015 18:07
Java Event System
package event;
import java.util.HashMap;
import java.util.Map;
public class EventBus extends Thread {
private EventQueue eventQueue = new EventQueue(8);
private Map<Class<?>, EventListener<?>> listeners = new HashMap<>();
public EventBus() {
@voidc
voidc / Interpolator.java
Created April 14, 2015 17:21
Java Interpolator
package interpolations;
public class Interpolator {
public static final Interpolation LIN = x -> x;
public static final Interpolation SQR = x -> LIN.interpolate(x) * x;
public static final Interpolation CUB = x -> SQR.interpolate(x) * x;
public static final Interpolation EXP = x -> Math.pow(2, x) - 1;
public static final Interpolation LOG = x -> Math.log(x + 1) / Math.log(2);
@voidc
voidc / plotter.html
Last active August 29, 2015 14:15
Simple HTML Canvas Function Plotter
<!DOCTYPE html>
<html>
<head>
<title>Function Plotter</title>
<script type="text/javascript">
function plot(func) {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var axes = {
@voidc
voidc / Parser.java
Last active September 16, 2023 17:09
Java Command Line Parser
package cli;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
public class Parser {
@voidc
voidc / popcorn.js
Created June 27, 2014 14:33 — forked from druu/popcorn.js
/*!
*
* popcorn - let's do this!
* ------------------------
*/
var Arrangement = {
lead: {
notes: [