I hereby claim:
- I am mallman on github.
- I am msallman (https://keybase.io/msallman) on keybase.
- I have a public key ASCGCwwK6FmeoEKCPHroUFtGMsuff-PMFl0H8URDY4mvBQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
val ammoniteVersion = "1.0.2" | |
lazy val Ammonite = config("ammonite-internal").extend(Test).hide | |
ivyConfigurations += Ammonite | |
inConfig(Ammonite)(Defaults.configSettings) | |
resourceDirectories in Ammonite += (resourceDirectory in Test).value | |
fork in (Ammonite, run) := true |
class Cell { | |
var entry = ' ' | |
def set(e:Char):String = { | |
if(entry==' ' && (e=='X' || e=='O')) { | |
entry = e | |
"successful move" | |
} else | |
"invalid move" | |
} | |
} |
/* | |
* A ScalaSTM approach to the sleeping barber problem. Build and run with sbt and a | |
* build.sbt file with these lines: | |
* | |
* | |
* scalaVersion := "2.10.0" | |
* | |
* libraryDependencies += "org.scala-stm" %% "scala-stm" % "0.7" | |
* | |
* |
LA Coding Dojo June 28, 2012
-- Zap that Spam!
Today we're training a spam classifier. Introduction and instructions are at https://github.com/a34729t/coding-dojo-ml/blob/master/README.md. Please post your solutions in the comments!
LA Coding Dojo, May 9, 2012
-- Blackjack Reloaded!
We're carrying last time's challenge over to tonight. To review, your task is to build a blackjack player with a winning strategy against a casino dealer. Your player interacts with the dealer through a RESTful Web interface hosted at http://dojo.v.wc1.atti.com/. Here is the API:
Show the "leaderboard".
LA Coding Dojo, March 28, 2012 | |
-- A Game of Blackjack | |
Your challenge tonight is to build a blackjack player to play the dealer through | |
a RESTful web interface. The web service is hosted at http://dojo.v.wc1.atti.com/. | |
Here is the interface: | |
Show the "leaderboard". |
from random import random | |
points = [(random(), random(),) for i in range(2000000)] | |
inside = lambda p: (p[0]**2 + p[1]**2) < 1 | |
i, o = 0, 0 | |
for p in points: | |
if inside(p): i += 1 | |
else: o += 1 | |
print "Pi:", (float(i)/len(points)) * 4 |
Solutions for https://github.com/mallman/monte_carlo
Sudheer and Saravana: https://gist.github.com/1890558
Saravana (One-liner): https://gist.github.com/1896353
James (Ruby): https://gist.github.com/1889965
Charlie and Liz: https://gist.github.com/1890037