This file contains hidden or 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
| Company[] companies; | |
| PFont font; | |
| void setup() | |
| { | |
| String[] company = loadStrings("Testdata.csv"); | |
| size(800,800); | |
| background(255); | |
| noStroke(); | |
| smooth(); |
This file contains hidden or 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 org.apache.flink.api.scala._ | |
| object BerkeleyData { | |
| def main(args: Array[String]) { | |
| val env: ExecutionEnvironment = ExecutionEnvironment.getExecutionEnvironment | |
| val path = "/path/to/Berkeley.csv" | |
| case class Admission(status: String, gender: String, dept: String, number: Double = 0.0) | |
| val data = env.readCsvFile[Admission]( |
This file contains hidden or 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
| trait Database[S, T] { | |
| def objectsFrom[U <: Option[Seq[S]]](action: U)(implicit toDTO: S => T) : Option[Seq[T]] = { | |
| action match { | |
| case Some(result) => Some(result.map(toDTO)) | |
| case None => Some(Seq.empty) | |
| } | |
| } | |
| def rowsFrom[V <: Option[Seq[T]]](action: V)(implicit toDAO: T => S) : Option[Seq[S]] = { |
This file contains hidden or 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 := "scalajs root project" | |
| scalaVersion := "2.11.7" | |
| lazy val root = project.in(file(".")). | |
| aggregate(crossedJVM, crossedJS). | |
| settings( | |
| publish := {}, | |
| publishLocal := {} | |
| ) |
This file contains hidden or 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 httpclient | |
| import akka.actor.ActorSystem | |
| import akka.http.scaladsl.Http | |
| import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport | |
| import akka.http.scaladsl.model.StatusCodes._ | |
| import akka.http.scaladsl.model.{HttpRequest, HttpResponse} | |
| import akka.http.scaladsl.unmarshalling.Unmarshal | |
| import akka.stream.ActorMaterializer | |
| import akka.stream.scaladsl._ |
This file contains hidden or 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
| [error] Exception in thread "main" java.lang.ExceptionInInitializerError | |
| [error] at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:14) | |
| [error] at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:9) | |
| [error] at org.nd4j.linalg.jcublas.ops.executioner.JCudaExecutioner.<clinit>(JCudaExecutioner.java:65) | |
| [error] at java.lang.Class.forName0(Native Method) | |
| [error] at java.lang.Class.forName(Class.java:264) | |
| [error] at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5202) | |
| [error] at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5149) | |
| [error] at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:169) | |
| [error] at Main$.delayedEndpoint$Main$1(Main.scala:13) |
This file contains hidden or 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
| lazy val nd4jVersion = SettingKey[String]("nd4jVersion") | |
| lazy val root = (project in file(".")).settings( | |
| scalaVersion := "2.11.8", | |
| name := "nd4sTest", | |
| version := "0.5.0", | |
| organization := "org.nd4j", | |
| resolvers += "Local Maven Repository" at "file:///" + Path.userHome.absolutePath + "/.m2/repository", | |
| nd4jVersion := "0.5.0", | |
| libraryDependencies ++= Seq( |
This file contains hidden or 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 := "GeneticAlgorithm" | |
| version := "1.0" | |
| scalaVersion := "2.11.8" | |
| val processingVersion = "3.2.3" | |
| val joglVersion = "2.3.2" | |
| val processingVideoVersion = "3.0.2" |
This file contains hidden or 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 Duck(x: Int, y: Int, direction: String) | |
| case class Pond(x: Int, y: Int) | |
| object GoldenPond extends App { | |
| def getInput: (Pond, Seq[(Duck, List[String])]) = { | |
| val scanner = new java.util.Scanner(System.in) | |
| val pond = scanner.nextLine.split(" ").toList.map(_.toInt).take(2) match { | |
| case Nil => throw new Exception("Not enough coordinates for pond") | |
| case List(a, b) => Pond(a, b) |
This file contains hidden or 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 := "spark-mllib-test" | |
| version := "1.0" | |
| scalaVersion := "2.11.11" | |
| val sparkVersion = "2.1.0" | |
| libraryDependencies ++= Seq ( | |
| "org.apache.spark" %% "spark-core" % sparkVersion % "provided", |
OlderNewer