This file contains 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
public Tableau makeArtificial() { | |
Matrix tmp = getA().mergeRight(Matrix.identity(constraints)).mergeRight(getRHS()); //insert identity | |
tmp = tmp.mergeDown(new Matrix(1,vars).extend(0,constraints,1d).extend(0,1)); //add new cost row | |
return new Tableau(tmp); | |
} | |
vs | |
public Tableau makeArtificial() { | |
Double[][] tmp = new Double[height][width+height-1]; |
This file contains 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
case class A(x: Int) | |
implicit object AIsOrdered extends Ordering[A] { | |
def compare(x: A, y: A) = x.x - y.x | |
} |
This file contains 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
object Dynamic { | |
class DynamicBox1(val value: Any) extends Dynamic { | |
override def applyDyamic[@specialized A](name: String, arg1: A): Dynamic = { | |
val method = value.getClass.getMethod(name, arg1.getClass) | |
boxDynamic(method.invoke(value, arg1.asInstanceOf[AnyRef])) | |
} | |
override def as[T] = value.asInstanceOf[T] | |
} |
This file contains 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 P { | |
class A(val v: Int) | |
class B(val v: Int) | |
class C { | |
def getV(x: B) = x.v | |
} | |
} | |
package object P { | |
implicit def a2b(x: A) = new B(x.v) |
This file contains 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
Name: Christopher Hodapp | |
Institution: The University of Alabama | |
Program: Computer Science | |
Graduation: May 2012 | |
Proposal Title: Dynamic Scala | |
Email: [email protected] | |
Phone: +19372199307 | |
About me: I am a 4th (final) year undergraduate Computer Science | |
student at the University of Alabama. I plan to resume my studies at |
This file contains 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
import scala.util.parsing.combinator.RegexParsers | |
/** | |
* Simple parser for a key value string like: | |
* key01 = Value01 key02=value02 key03 =value03 key04= value04 | |
* | |
* The parser does not support whitespace in key or values. | |
*/ | |
object KeyValueParser extends RegexParsers { | |
This file contains 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
%===================================================================== | |
% hw.cls | |
% Provide hw.cls class | |
%===================================================================== | |
%===================================================================== | |
% Identification | |
%===================================================================== | |
\NeedsTeXFormat{LaTeX2e} | |
\ProvidesClass{hw}[2013/1/28 Based on Justin Wilson's Homework Class] |
This file contains 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
// This is an example usage | |
object Test extends App { | |
import Macros._ | |
println(countRefs[Int~Int~String~List[Int]~Double]) // prints 2 | |
println(countInts[Int~Int~String~List[Int]~Double]) // prints 2 | |
println(countDoubles[Int~Int~String~List[Int]~Double]) // prints 1 | |
println(whichArray[Int~Int~String~List[Int]~Double]("_0")) // prints Ints | |
println(whichArray[Int~Int~String~List[Int]~Double]("_2")) // prints References |
This file contains 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 tuple | |
import language.experimental.macros | |
import language.dynamics | |
import scala.reflect.macros.Context | |
sealed trait ~[+A, +B] | |
private[tuple] object TupleMacros { |
This file contains 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
[info] Loading project definition from /Users/clhodapp/gsoc/git/slick/project | |
[info] Set current project to root (in build file:/Users/clhodapp/gsoc/git/slick/) | |
[info] Test run started | |
[info] Test scala.slick.test.memory.DistributedQueryingTest.test1 started | |
[info] Test run finished: 0 failed, 0 ignored, 1 total, 2.836s | |
[info] Test run started | |
[Using test database jdbc:h2:mem:test1] | |
[info] Test scala.slick.test.jdbc.StatementParametersTest.testExplicit[0] started | |
[Using test database jdbc:h2:mem:test1] | |
[info] Test scala.slick.test.jdbc.StatementParametersTest.testImplicit[0] started |
OlderNewer