Skip to content

Instantly share code, notes, and snippets.

Keybase proof

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:

@mallman
mallman / ammonite.sbt
Last active September 8, 2017 00:17
SBT Ammonite integration
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
@mallman
mallman / content_similarities.ipynb
Last active April 19, 2016 16:39
Simple content similarity computation in Spark with Jupyter Scala kernel
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mallman
mallman / gist:4845a3c45745e59a4c9d
Created April 14, 2015 19:14
Atomic Scala Summary 2 Exercise 8
class Cell {
var entry = ' '
def set(e:Char):String = {
if(entry==' ' && (e=='X' || e=='O')) {
entry = e
"successful move"
} else
"invalid move"
}
}
@mallman
mallman / SleepingBarber.scala
Created February 3, 2013 21:39
A ScalaSTM approach to the sleeping barber problem.
/*
* 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"
*
*
@mallman
mallman / gist:3015098
Created June 29, 2012 01:17
LA Coding Dojo June 28, 2012
@mallman
mallman / gist:2650457
Created May 10, 2012 02:02
LA Coding Dojo March 28, 2012

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".

@mallman
mallman / coding_dojo_2012-03-28.txt
Created March 29, 2012 02:26
LA Coding Dojo March 28, 2012
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".
@mallman
mallman / gist:1889911
Created February 23, 2012 03:47
LA Coding Dojo, Feb. 22, 2012, Sudheer and Saravana's solution
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
@mallman
mallman / gist:1880924
Created February 22, 2012 02:51
Fourth LA Coding Dojo Solutions