Skip to content

Instantly share code, notes, and snippets.

package some.pack;
public class AlreadyMarkedException extends Exception {
public AlreadyMarkedException(){
}
public AlreadyMarkedException(String msg) {
super(msg);
}
package some.pack;
public class Person {
private String name;
private Integer age;
public Person(String name, String age) {
this.name = name;
this.age = age;
import org.scalatest.{FunSuite, BeforeAndAfterEach}
import org.scalatest.matchers.ShouldMatchers
import some.pack.{TicTacToe, Mark, InvalidSquareException, AlreadyMarkedException}
import some.pack.Mark._
class SecondTicTacToeFunSuiteTest extends FunSuite with BeforeAndAfterEach with ShouldMatchers {
private var ttt: TicTacToe = _
override def beforeEach() { ttt = new TicTacToe }
import org.scalatest.FunSuite
class BasicFunSuiteTest extends FunSuite {
test("testing hello world") { println("everything is working :D") }
}
import org.scalatest.{FunSuite, BeforeAndAfterEach}
import some.pack.{TicTacToe, Mark, InvalidSquareException, AlreadyMarkedException}
import some.pack.Mark._
class FirstTicTacToeFunSuiteTest extends FunSuite with BeforeAndAfterEach {
private var ttt: TicTacToe = _
override def beforeEach() { ttt = new TicTacToe }
test("the game should not start finished") {
test("players cannot mark a already marked square") {
ttt.mark(0,0)
evaluating { ttt.mark(0,0) } should produce [AlreadyMarkedException]
}
var timer = require('timers')
var http = require('http');
var urlMatcher = /https?:\/\/([-\w\.]+)+:?(\d+)?(\/([-\w\/_\.]*(\?\S+)?)?)?/
var updateInterval = 10000;
var updateWithNoUseMax = 50;
var cache = {}
function CacheEntry() {
@lucastorri
lucastorri / cannot_find_node-waf.log
Created August 27, 2011 22:09
node-proxy installation error on linode
root@li75-187:/usr/bin# npm install node-proxy
> node-proxy@0.5.1 install /usr/bin/node_modules/node-proxy
> make
BUILDING: C++ Component
/bin/sh: node-waf: not found
cp: cannot stat `src/build/default/node-proxy.node': No such file or directory
make: *** [all] Error 1
npm ERR! error installing node-proxy@0.5.1 Error: node-proxy@0.5.1 install: `make`
@lucastorri
lucastorri / MyScalatraFilter.scala
Created September 1, 2011 15:20
Scalate error when deploying to redhat cloud
import org.scalatra._
import java.net.URL
import scalate.ScalateSupport
class MyScalatraFilter extends ScalatraFilter with ScalateSupport {
get("/") {
<html>
<body>
<h1>Hello, world!</h1>
@lucastorri
lucastorri / error.log
Created September 1, 2011 15:50
RHC scalate error after adding "override def isScalateErrorPageEnabled = false"
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception