Run with Scala CLI (https://scala-cli.virtuslab.org/):
scala-cli run .
And then go to http://localhost:9991
Happy coding, Scala is great.
Run with Scala CLI (https://scala-cli.virtuslab.org/):
scala-cli run .
And then go to http://localhost:9991
Happy coding, Scala is great.
val scalacOptions ++= Seq( | |
"-encoding", | |
"utf-8", // Specify character encoding used by source files. | |
"-deprecation", // Emit warning and location for usages of deprecated APIs. | |
"-explaintypes", // Explain type errors in more detail. | |
"-feature", // Emit warning and location for usages of features that should be imported explicitly. | |
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred | |
"-language:experimental.macros", // Allow macro definition (besides implementation and application) | |
"-language:higherKinds", // Allow higher-kinded types | |
"-language:implicitConversions", // Allow definition of implicit functions called views |
press F12 on the Dell startup screen
Instructions are here: https://www.ubuntu.com/download/desktop
/* | |
* Copyright (c) 2012, Lawrence Livermore National Security, LLC. Produced at | |
* the Lawrence Livermore National Laboratory. Written by Keith Stevens, | |
* [email protected] OCEC-10-073 All rights reserved. | |
* | |
* This file is part of the S-Space package and is covered under the terms and | |
* conditions therein. | |
* | |
* The S-Space package is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License version 2 as published |
import akka.actor.Actor.Receive | |
import akka.actor.ActorContext | |
import akka.actor.ActorLogging | |
import akka.actor.Actor | |
import akka.event.LoggingAdapter | |
object MyLoggingReceive { | |
def apply(log: LoggingAdapter)(r: Receive)(implicit context: ActorContext): Receive = r match { | |
case _: MyLoggingReceive ⇒ r |
// Run this with scala <filename> | |
/** | |
* A Two-phase commit Monad | |
*/ | |
trait Transaction[+T] { | |
def map[U](fn: T => U): Transaction[U] = flatMap { t => Constant(fn(t)) } | |
def flatMap[U](fn: T => Transaction[U]): Transaction[U] = | |
FlatMapped(this, fn) |
def breakIf[T: ClassTag](assertion: => Boolean, args: NamedParam*): Unit = | |
if (assertion) break[T](args.toList) | |
// start a repl, binding supplied args | |
def break[T: ClassTag](args: List[NamedParam]): Unit = savingContextLoader { | |
val msg = if (args.isEmpty) "" else " Binding " + args.size + " value%s.".format( | |
if (args.size == 1) "" else "s" | |
) |
import akka.actor.Actor | |
import akka.actor.ActorSystem | |
import akka.agent.Agent | |
import com.typesafe.config.ConfigFactory | |
import akka.event.Logging | |
import akka.actor.Props | |
import kafka.utils.Utils | |
import java.nio.ByteBuffer |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
"copy file" in { | |
val fileGenerator = Enumerator.repeat(new java.util.Date.getTime.toString + "\n").through(Enumeratee.take(1000)) | |
//val fileGenerator = Enumerator.repeat(new java.util.Date.getTime.toString + "\n") &>> Enumeratee.take(1000) | |
val f = FileChannel("/tmp/testwrite.txt").delete.writing.create | |
val f2 = FileChannel("/tmp/testwrite2.txt").delete.writing.create | |
fileGenerator // generates data | |
.through(RichEnumeratee.binarize()) // binarizes data to write into File |