I hereby claim:
- I am iande on github.
- I am iande (https://keybase.io/iande) on keybase.
- I have a public key ASAAZLXxLfI56JPzKX02tjCdOJwekL22WGsEiHzJyTU1LQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| // The bounded type parameter dictates the kinds of Box instances we can create. | |
| public class NumberBox<T extends Number> { | |
| private T _number; | |
| public NumberBox() { this(null); } | |
| public NumberBox(T toStore) { | |
| set(toStore); | |
| } | |
| public T get() { return _number; } |
| public class Box<T> { | |
| private T whatsInTheBox; | |
| // Creates a new box that holds nothing of value | |
| public Box() { this(null); } | |
| // Creates a new box that holds the given T instance. | |
| public Box(T store) { | |
| this.set(store); | |
| } |
| import java.util.ArrayList; | |
| public class Main { | |
| public static void main(String[] args) { | |
| ArrayList<Integer> myList = new ArrayList<Integer>(); | |
| myList.add(new Integer(10)); | |
| myList.add(new Integer(11)); | |
| myList.add(new Integer(12)); |
| public class Triangle { | |
| public int width; | |
| public int height; | |
| } | |
| public class Rectangle { | |
| public int width; | |
| public int height; | |
| } |
| public static void main() { | |
| // Java provides a "default" no-argument constructor for us. | |
| MyCoolShit coolShit = new MyCoolShit(); | |
| // But, NEVER rely on it! | |
| System.out.println("Bool: " + coolShit.aBool); | |
| System.out.println("Int: " + coolShit.anInt); | |
| System.out.println("Double: " + coolShit.aDouble); | |
| System.out.println("Char: " + coolShit.aChar); | |
| System.out.println("String: " + coolShit.aString); |
| public class Rectangle { | |
| public static int COUNTER = 0; | |
| public int width; | |
| public int height; | |
| private int myX; | |
| private int myY; | |
| public Rectangle(int x, int y, int w, int h) { | |
| // Position and dimensions were given, so we construct a rectangle at (x,y) |
| #!env ruby | |
| require 'bundler' | |
| Bundler.setup | |
| require 'ircbgb' | |
| bot = Ircbgb::Client.new do |c| | |
| c.servers = 'irc://pinkhair.gudefrends.net' | |
| c.nicks = ['iande', 'ian-2', 'ian-3'] |
| // Line 174 of jcart v1.3 | |
| // Add an item to the cart | |
| $('.jcart').submit(function(e) { | |
| add($(this)); | |
| e.preventDefault(); | |
| }); | |
| // Try replacing or adding: |
| # Note: MyFinalApproach defines a block that takes a block, | |
| # which only works with Ruby >= 1.9. To work with 1.8, you'll need | |
| # to take that bit out. | |
| # Also, I think 'eigen' contains more phonetic badassery than | |
| # 'singleton', which is the real reason I prefer it. | |
| require 'forwardable' | |
| class SomeClass | |
| def self.my_eigen_method; 42; end |