Skip to content

Instantly share code, notes, and snippets.

View tempredirect's full-sized avatar

Gareth Davis tempredirect

View GitHub Profile
@tempredirect
tempredirect / RandomWeightedSelection.java
Last active August 29, 2015 13:57
Random weighted selection
import java.util.*;
import java.util.concurrent.*;
public class RandomWeightedSelection {
public static void main(String [] args) {
runIterations( 100);
runIterations( 10_000);
@skhatri
skhatri / quality.gradle
Created February 24, 2012 00:45
Gradle Checkstyle HTML Reporting
apply plugin: 'checkstyle'
checkstyleMain {
ignoreFailures = false
reports {
include ( '**/*.java')
xml {
destination "${rootProject.buildDir}/reports/checkstyle/main.xml"
}
}
@tempredirect
tempredirect / bitmapregion.py
Created March 17, 2011 16:04
functions to grab the regions in a bitmap like structure
from collections import deque
try:
set()
except:
from sets import Set as set
@tempredirect
tempredirect / jquery.tooltip-remove.js
Created March 4, 2011 14:52
Hacky plugin to allow removal of the tooltips created by jquery tools tooltip
/**
* hacky plugin to allow removal of the jquery tools tooltip objects.
*
* Doesn't pay any attention to the special event configuration, and will blindly unbind all
* mouse[enter|leave] listeners from the trigger element.
*/
(function($){
var tooltip = $.fn.tooltip,
slice = Array.prototype.slice;