Skip to content

Instantly share code, notes, and snippets.

@motlin
motlin / rxvt.bat
Created May 19, 2011 03:53
Launch script for Cygwin
@echo off
C:
chdir C:\cygwin\home\Craig
set SHELL=/bin/bash
set HOME=/home/Craig
set HOMEDRIVE="C:"
C:\cygwin\bin\rxvt -fn "Lucida Console-20" --loginShell +sb
@motlin
motlin / BottomType.java
Created June 5, 2012 03:02
Code example to illustrate bottom types
public class A{}
public class B{}
A a = method();
B b = method();
@motlin
motlin / BottomType.java
Created June 5, 2012 03:17
Code example to illustrate bottom types
public class A{}
public class B{}
A a = undefined();
B b = undefined();
@motlin
motlin / BottomType.java
Created June 5, 2012 03:22
Code example to illustrate bottom types
public class A{}
public class B{}
A a = null;
B b = null;
@motlin
motlin / BottomType.java
Created June 5, 2012 03:23
Code example to illustrate bottom types
public null undefined()
{
return null;
}
@motlin
motlin / BottomType.java
Created June 5, 2012 03:28
Code example to illustrate bottom types
public A undefinedA()
{
throw new RuntimeException();
}
public B undefinedB()
{
throw new RuntimeException();
}
@motlin
motlin / BottomType.java
Created June 5, 2012 03:33
Code example to illustrate bottom types
A a = undefined();
B b = undefined();
public Nothing undefined()
{
...;
}
@motlin
motlin / BottomType.java
Created June 5, 2012 03:37
Code example to illustrate bottom types
public Nothing undefined()
{
return undefined();
}
@motlin
motlin / BottomType.java
Created June 5, 2012 03:39
Code example to illustrate bottom types
public Nothing undefined()
{
return (Nothing) new Object();
}
@motlin
motlin / BottomType.java
Created June 5, 2012 03:46
Code example to illustrate bottom types
public Nothing error(String message)
{
throw new RuntimeException(message);
}
public Nothing undefined()
{
throw new UnsupportedOperationException();
}