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
| // Welcome to Scala version 2.7.5.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_20). | |
| // Type in expressions to have them evaluated. | |
| // Type :help for more information. | |
| scala> import dispatch._ | |
| import dispatch._ | |
| scala> import oauth._ | |
| import oauth._ |
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
| /* Traits: a simple way to make fake objects for testing. */ | |
| /* Because Mockito is cool but my brain says no to mocking libraries! ;-) */ | |
| /* Here's our simple Foo class with an expensive | |
| call that is network dependent - getFromApi() */ | |
| class Foo { | |
| def getFromApi() { | |
| http(blargh) |
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
| include $(GOROOT)/src/Make.$(GOARCH) | |
| TARG=wsbench | |
| GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=2 | |
| GOFILES=\ | |
| wsbench.go\ | |
| include $(GOROOT)/src/Make.pkg |
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
| .mouse, #preview{ | |
| position: absolute; | |
| background-repeat: no-repeat; | |
| height: 22px; | |
| min-width: 15px; | |
| z-index: 100; | |
| } | |
| .mouse{ | |
| background-image: url('../images/cursor.png'); |
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
| package dining.hakkers | |
| //Akka adaptation of | |
| //http://www.dalnefre.com/wp/2010/08/dining-philosophers-in-humus/ | |
| import se.scalablesolutions.akka.actor.{Scheduler, ActorRef, Actor} | |
| import se.scalablesolutions.akka.actor.Actor._ | |
| import java.util.concurrent.TimeUnit | |
| /* |
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
| """ | |
| (C) Mathieu Blondel - 2010 | |
| License: BSD 3 clause | |
| Implementation of the collapsed Gibbs sampler for | |
| Latent Dirichlet Allocation, as described in | |
| Finding scientifc topics (Griffiths and Steyvers) | |
| """ |
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
| module Main where | |
| import System.Random | |
| import Data.Function | |
| processGuess :: Int -> IO () -> IO () | |
| processGuess answer cont = do | |
| n <- getLine | |
| case compare (read n) answer of | |
| EQ -> putStrLn "Awesome!!!!" |
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
| # 30 minutes Lisp in Ruby | |
| # Hong Minhee <http://dahlia.kr/> | |
| # | |
| # This Lisp implementation does not provide a s-expression reader. | |
| # Instead, it uses Ruby syntax like following code: | |
| # | |
| # [:def, :factorial, | |
| # [:lambda, [:n], | |
| # [:if, [:"=", :n, 1], | |
| # 1, |
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
| #!/usr/bin/env ruby | |
| %w{rubygems hmac-sha1 base64 cgi net/https uri openssl}.each{ |f| require f } | |
| KEY = '<YOUR KEY>'; | |
| SECRET = '<YOUR SECRET>'; | |
| # encodes strings that make twitter oauth happy | |
| def encode( string ) | |
| URI.escape( string, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]") ).gsub('*', '%2A') | |
| end |
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
| /* The world's smallest Brainfuck interpreter in C, by Kang Seonghoon | |
| * http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c */ | |
| s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17 | |
| ?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;} |