This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.actors.Actor | |
import scala.actors.Actor._ | |
import scala.util.Random | |
import scala.collection.{immutable, mutable} | |
val rand = new Random() | |
case class Customer(id: Int) { | |
var shorn:Boolean = false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
require 'cgi' | |
text = "<html><head><title>Delicious2Google</title></head><body>" + | |
"<h1>Upload</h1>" + | |
"<form action='https://www.google.com/bookmarks/mark?op=upload&zx=#{rand(65535)}' method='POST'>" + | |
"<input type='submit'/><input type='hidden' id='data'></form>" + | |
"<textarea id='xml' style='display:none'>\n<bookmarks>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Request<R, E extends Exception> { | |
public R process() throws E; | |
} | |
public class Processor { | |
public <R, E extends Exception> R process(Request<R, E> request) throws E { | |
E lastException = null; | |
for (int x = 0; x < retries; ++x { | |
try { | |
return request.process(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.Random; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.LinkedBlockingQueue; | |
import java.io.Closeable; | |
/** | |
* @author Toby | |
*/ | |
public abstract class ThreadPipeIterator<T> implements Iterator<T>, Closeable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
require 'json' | |
languages = ["java", "c++", "c", "perl", "ruby", "python", "javascript", "html", "css", | |
"scala", "xml", "xslt", "xquery", "php", "actionscript", "flash", "flex", | |
"vbscript", "applescript", "erlang", "objective-c", "smalltalk", "haskell", | |
"c#", "boo", "f#", "go", "processing", "arduino", "pd", "qc", "vimscript", | |
"as3", "assembly", "sh", "obj-c", "sql", "coldfusion", "lex", "yacc", | |
"scheme", "lisp", "bourne", "awk", "tcl", "d", "ocaml", "elisp", "clojure", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
class Node { | |
public: | |
int value; | |
Node* left; | |
Node* right; | |
Node() { | |
left = NULL; |