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
val MeatPrice = 137.25D | |
val HipsterMarketPrice = 14.9D | |
val MigrosBecauseHipsterMarketDidntHaveEverything = 56.45D | |
val RedWineTwoBottlePrice = 33D | |
val ChanterellesAightss = 14D | |
sealed class Human(val alreadyPaid: Double) | |
object Human { | |
val values = Set(Fouki, Tristan, Gaspard, Fred, Yoann, Audrey, Ariane) |
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
val MeatPrice = 95.80 | |
val HipsterMarketPrice = 66.0 | |
val CoopBecauseHipsterMarketDidntHaveEverything = 75.3 | |
val RedWinePackPrice = 136.8 | |
val NbBottlesInPack = 6 | |
val PriceForTwoRedWineBottles = 2 * RedWinePackPrice / NbBottlesInPack | |
val TotalPaidByTristan = HipsterMarketPrice + CoopBecauseHipsterMarketDidntHaveEverything + RedWinePackPrice | |
import enumeratum.{ Enum, EnumEntry } |
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
from subprocess import Popen, PIPE | |
computerName = Popen(["scutil","--get","ComputerName"], stdout=PIPE).communicate()[0] | |
print "Hello " + computerName + ", how are you?" |
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
#! /usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
import wget, os, flickrapi, webbrowser | |
from pathlib import PurePosixPath, PosixPath, Path | |
def path(elems): | |
return "/".join(elems) | |
OUT_DIR = "images" |
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 akka.actor._ | |
// These are the messages sent by the Scrutineer | |
case object VoteIsOver | |
case class IssueVoted(val question: String) | |
// These are all the messages sent by an Assembly member | |
case object ImHere | |
sealed trait VoteOption | |
case object Yes extends VoteOption |
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 java.util._ | |
import scala.collection.mutable.MutableList | |
import scala.collection.mutable.Set | |
import scala.collection.mutable.Map | |
// IMPORTANT -- THIS IS INDIVIDUAL WORK. ABSOLUTELY NO COLLABORATION!!! | |
// - implement a (main-memory) data store with OMVCC. | |
// - objects are <int, int> key-value pairs. |
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 relation | |
package compiler | |
import scala.collection.mutable | |
import ch.epfl.data.sc.pardis | |
import pardis.optimization.RecursiveRuleBasedTransformer | |
import pardis.quasi.TypeParameters._ | |
import pardis.types._ | |
import PardisTypeImplicits._ |
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 main.scala | |
object ResultsToHtmlItem extends App { | |
private def offset: Int => String = " " * _ | |
sealed trait HtmlElem { | |
def print(indent: Int): String = "" | |
} | |
case class DtDd(dtContent: HtmlElem, ddContent: HtmlElem) extends HtmlElem { | |
override def print(indent: Int): String = { |
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 main.scala | |
import scala.io.Source | |
object Sheeps extends App { | |
val fullSet = Set('0','1','2','3','4','5','6','7','8','9') | |
val path = "/Users/TristanO/Documents/projects/scalaFun/CodeJam/input.txt" | |
val lineIter = Source.fromFile(path).getLines() | |
val T = lineIter.next.toInt | |
for (i <- 1 to 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
object Solution { | |
val cong = 1000000007L | |
def main(args: Array[String]) { | |
val line = scala.io.StdIn.readLine | |
val tokens = tokenize(line.toIterator.buffered) | |
//println(s"Tokens:\n$tokens\n") | |
val ast = parse(tokens) | |
//println(s"AST:\n$ast\n") |
NewerOlder