This file contains hidden or 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
[TestFixture] | |
public class ExampleTests : InteractionContext<Example> | |
{ | |
private List<string> _inputs; | |
private TestSchedulers _schedulerProvider; | |
[SetUp] | |
public void Setup() | |
{ | |
_inputs = new List<string> |
This file contains hidden or 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
lazy val primes: Stream[Int] = | |
2 #:: Stream.from(3).filter(n => primes.takeWhile(p => p * p <= n).forall(p => n % p > 0)) | |
lazy val fib: Stream[BigInt] = 0 #:: 1 #:: fib.zip(fib.tail).map { case(x,y) => x + y } |
This file contains hidden or 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
def fizzBuzzer(entries: Map[Int, String])(nums: Seq[Int]) = { | |
def fizzBuzzify(n: Int) = | |
(n, entries collect { case (key, value) if n % key == 0 => value }) | |
nums map fizzBuzzify collect { | |
case (num, words) if !words.isEmpty => num + ": " + words.mkString(" ") | |
} | |
} | |
val answer = fizzBuzzer(Map(3 -> "fizz", 5 -> "buzz"))(0 to 100) |
This file contains hidden or 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
#!/bin/ruby | |
require 'open-uri' | |
url = "http://us.blizzard.com/store/blizzcon-tickets.xml" | |
ticketsAvailable = false | |
begin | |
contents = open(url).read | |
unless contents =~ /Currently unavailable/ | |
`start #{url}` |
NewerOlder