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 object Ball | |
case object SmashedBall | |
case object PleaseServe | |
case object YouWin | |
class Ping(pong: ActorRef) extends Actor { | |
override def receive = { | |
case PleaseServe => | |
println("Serving") |
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
% Exercice 1.1 | |
ident33 = eye(3,3) | |
diag_inc = diag([1 2 3]) | |
zeros33 = zeros(3,3) | |
M = rand(4,3) | |
T = reshape(M,6,2) % it takes them column by column |
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 org.apache.spark.SparkContext | |
import org.apache.spark.SparkContext._ | |
import org.apache.spark.SparkConf | |
import org.apache.spark.rdd._ | |
object Project1 { | |
def charsetFix(s : String) : String = s.filter(Character.isDefined) |
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") |
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
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 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
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
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
#! /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" |
OlderNewer