Register and login to submit your favorite /. comments!

MillionthMonkey's Slashdot Comments

Submitted by Crash on June 26, 2007 - 11:33am.

Re:Not yet
by MillionthMonkey (240664)

First of all you're starting with a weak argument: "what does Bob Dylan know about what music sounds like" is not the sort of position I would prefer to defend.

login or register to post comments
Submitted by Laserwulf on June 22, 2007 - 5:55am.

Copyright infringers are the new child molesters
by MillionthMonkey (240664)

Soon you'll have to register as a copyright infringer for life and people will see your house on copyright infringement Google Maps overlays so they can know to keep their little ones and zeros safe from you.

login or register to post comments
Submitted by samrobb on January 22, 2007 - 1:56pm.

Re:Raises questions
by MillionthMonkey (240664)

I'm being evaluated for a medial temporal lobectomy for epileptic seizures.

I'll let you guys know if I wake up after the surgery to find that I'm altruistic on my left side only. Or maybe I won't care about keeping you informed anymore; I figure it's 50-50.

login or register to post comments
Submitted by veridicus on August 16, 2006 - 9:35am.

Best Hello World ever
by MillionthMonkey (240664)

public interface MessageStrategy {
    public void sendMessage();
}

public abstract class AbstractStrategyFactory {
    public abstract MessageStrategy createStrategy(MessageBody mb);
}

public class MessageBody {
    Object payload;
    public Object getPayload() { return payload; }
    public void configure(Object obj) { payload = obj; }
    public void send(MessageStrategy ms) {
        ms.sendMessage();
    }
}

public class DefaultFactory extends AbstractStrategyFactory {
    private DefaultFactory() {}
    static DefaultFactory instance;
    public static AbstractStrategyFactory getInstance() {
        if (null==instance) instance = new DefaultFactory();
        return instance;
    }
    public MessageStrategy createStrategy(final MessageBody mb) {
        return new MessageStrategy() {
            MessageBody body = mb;
            public void sendMessage() {
                Object obj = body.getPayload();
                System.out.println(obj.toString());
            }
        };
    }
}

public class HelloWorld {
      public static void main(String[] args) {
            MessageBody mb = new MessageBody();
            mb.configure("Hello World!");
            AbstractStrategyFactory asf = DefaultFactory.getInstance();
            MessageStrategy strategy = asf.createStrategy(mb);
            mb.send(strategy);
      }
}

login or register to post comments