Skip to content

Instantly share code, notes, and snippets.

View mmadson's full-sized avatar

Matthew Madson mmadson

View GitHub Profile
@mmadson
mmadson / MaximalRectangle.java
Created March 19, 2014 08:58
Daveed V's Maximal Rectangle algorithm in Java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Stack;
final class Cell {
final int col;
final int row;
@mmadson
mmadson / TheAnswer.java
Last active December 20, 2015 06:28
Awesome unit test
@Test
public void testHelloWorldServiceWithSpecialMessage_returnsTheAnswerToLife()
throws Exception
{
expect().body(containsString("the answer to life the universe and everything")).when().get("/hello/42");
}
package app;
import com.google.inject.Guice;
import com.google.inject.Injector;
public class Main
{
public static void main(String[] args)
{
final Injector injector = Guice.createInjector(new MyAppModule());
@mmadson
mmadson / App.gwt.xml
Created December 22, 2011 18:41
Selenium test for GWT FileUpload, e.g., how to specify a file path using Selenium for <input type="file"...>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0//EN"
"http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-source/core/src/gwt-module.dtd">
<module rename-to="App">
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<inherits name="com.google.gwt.place.Place"/>
<inherits name="com.google.gwt.activity.Activity"/>
<inherits name="com.google.gwt.logging.Logging"/>
<inherits name="com.google.gwt.http.HTTP" />