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
scala> import dispatch._ | |
import dispatch._ | |
scala> import Http._ | |
import Http._ | |
scala> import json.Js._ | |
import json.Js._ | |
scala> import twitter._ |
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.awt.{ Color, Graphics2D, Dimension } | |
import swing.{ SimpleSwingApplication, Panel, Frame } | |
import util.Random | |
object ASDFFADS extends SimpleSwingApplication { | |
class FernFractalFrame(transformFunction: (Double, Double) => (Double, Double), val width: Int, val height: Int, val max: Int) extends Frame { | |
contents = new Panel { | |
preferredSize = new Dimension(width, height) |
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
scala> val l = List("cat","dog","frog") | |
l: List[java.lang.String] = List(cat, dog, frog) | |
scala> Random.shuffle(l) | |
res8: List[java.lang.String] = List(frog, dog, cat) | |
scala> Random.shuffle(l).take(2) | |
res10: List[java.lang.String] = List(dog, frog) |
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.ArrayList; | |
import java.util.List; | |
import static java.lang.String.format; | |
public class NotifyTest { | |
static final class NotifiableRunner extends Thread { | |
private final int id; | |
// The mutex upon which this thread will wait and respond to notify |
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
"twitter json to Scala class mapper" should { | |
"parsing a tweet" in { | |
TwitterJsonMapper.tweetP(tweetS) match { | |
case Right(t: Tweet) => { | |
implicit def unOption[T](t: Option[T]): T = t.get | |
implicit def unEither[T](t: Either[T,Throwable]): T = t match {case Left(left) => left ;case Right(t) => throw t} | |
"test id" in { | |
true must_== (t.id.get == 228106060337135617l) | |
} | |
"test id_str" in { |
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
options { | |
STATIC = false; | |
SUPPORT_CLASS_VISIBILITY_PUBLIC = true; | |
ERROR_REPORTING = false; | |
JAVA_UNICODE_ESCAPE = true; | |
UNICODE_INPUT = true; | |
NODE_USES_PARSER = false; | |
NODE_DEFAULT_VOID = true; | |
IGNORE_CASE = true; | |
VISITOR = true; |
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
#!/usr/bin/env python2.7 | |
import smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.mime.base import MIMEBase | |
from email import Encoders | |
msg = MIMEMultipart() | |
msg['Subject'] = "Greets from Bryan" |
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
sed -n '/: [0-9]*:/{s_:0.*__;s_: __; p}' ~/.histfile > /tmp/graph.txt | |
cat <<END > ./plot.py | |
#!/usr/bin/python | |
#Python - Tidy and plot | |
from matplotlib.pylab import * | |
import matplotlib.pylab |
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 akka.actor.Actor | |
import akka.actor._ | |
import akka.actor.SupervisorStrategy._ | |
import java.lang.UnsupportedOperationException | |
import java.util.concurrent.atomic.AtomicInteger | |
import java.util.concurrent.{TimeUnit, CountDownLatch} | |
import scala.concurrent.duration._ | |
import scala.UnsupportedOperationException | |
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.zeebox.context.feedsingest.trapit | |
object QueryTermParser { | |
/** | |
* {{{ | |
* A sample... | |
* "type:topic id:asddfasdsfafda Dessert" | |
* type A traps type: Bundle,Topic, or Source. String | |
* id GUID of the trap GUID | |
* }}} |
OlderNewer