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
package retweetrec | |
import scala.xml.XML | |
import java.net.URL | |
import java.io.InputStream | |
object ReTweetRec { | |
def getFollowers(id: String) = { | |
val data = new URL("http://twitter.com/followers/ids/" + id + ".xml").getContent |
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 com.facebook.thrift.{TBase, TDeserializer} | |
import java.io.{BufferedInputStream, DataInputStream, File, FileInputStream, InputStream} | |
import java.util.zip.GZIPInputStream | |
import net.lag.logging.Logger | |
import scala.reflect.Manifest | |
// you'll want to import your generated Thrift package too! | |
class ThriftFileScanner[T <: TBase](implicit man: Manifest[T]) { | |
val log = Logger.get | |
var bufferedIn: BufferedInputStream = null |
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.{BufferedReader, File, InputStream, InputStreamReader, IOException, PrintWriter, Writer} | |
import java.net.{InetAddress, ServerSocket, Socket, SocketException} | |
import java.util.concurrent.Executors | |
import net.lag.logging.Logger | |
import scala.actors.Actor | |
import scala.actors.Actor._ | |
import scala.tools.nsc._ | |
class RemoteDebugServer(port: Int) { |
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.util.zip._ | |
import java.io._ | |
class InMemZip(compressionLevel: Int) { | |
private val _outBytes = new ByteArrayOutputStream | |
private val _zipOutStream = { | |
val s = new ZipOutputStream(_outBytes) | |
s.setLevel(compressionLevel) | |
s | |
} |
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
// Shutdown HawtDispatch GlobalQueue | |
org.fusesource.hawtdispatch.ScalaDispatch.globalQueue.asInstanceOf[org.fusesource.hawtdispatch.internal.GlobalDispatchQueue].shutdown | |
// Clear Thread.subclassAudits | |
val tf = classOf[java.lang.Thread].getDeclaredField("subclassAudits") | |
tf.setAccessible(true) | |
val subclassAudits = tf.get(null).asInstanceOf[java.util.Map[_,_]] | |
subclassAudits.synchronized {subclassAudits.clear} | |
// Clear and reset j.u.l.Level.known (due to Configgy) |
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.collection.mutable.ListBuffer | |
import akka.actor.{Actor,ActorRef} | |
import akka.actor.Actor._ | |
import akka.routing.{ Listeners, Listen } | |
//Represents a domain event | |
trait Event | |
//A builder to create domain entities | |
trait EntityBuilder[Entity] { |
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
package com.earldouglas.remoteakka | |
import akka.actor.Actor | |
import akka.actor.Actor._ | |
case object Greeting | |
case class Jar(val bytes: Array[Byte]) | |
case class RegisterRemote(val name: String, val className: String) | |
object Runner { |