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 diamondProblem | |
trait A{ | |
def hello() = println("hello from A") | |
} | |
trait B extends A{ | |
override def hello() = println("hello from 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
import java.io._ | |
def delDirNoRecur(dirName: String): Unit = { | |
val dir = new File(dirName) | |
if(dir.exists && dir.isDirectory){ | |
val files = dir.listFiles | |
files.foreach(_.delete()) | |
println(s"delete complete ${files.size} files deleted") | |
}else{ | |
println(s"$dirName not a directory") |
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 scala.concurrent.{ future, promise } | |
import scala.concurrent.ExecutionContext.Implicits.global | |
val p = promise[String] | |
val f = p.future | |
val producer = future { | |
println("producing") | |
Thread.sleep(1000) | |
val r = "produced" | |
p success r | |
Thread.sleep(1000) |
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
//database model | |
case class Account(id: Identifier, owner: User, var balance: Money) | |
object AccountRepository { | |
def lookUp(id: Int):Account = Account("id1", "notyy", 100.0) //just an example | |
} | |
//DCI model | |
class AccountHolder(val account: Account) //adaptor |
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 notyy; | |
public class Option<A> { | |
private final A thing; | |
public Option(A thing) { | |
this.thing = thing; | |
} | |
public <E extends Exception> A getOrThrow(E excetion) throws E{ |
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 base; | |
import java.util.List; | |
public abstract class AbstractBase { | |
abstract protected List getChildren(); | |
} |
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 com.github.notyy.retroboard.util | |
import org.scalatest.FunSpec | |
import org.scalatest.matchers.ShouldMatchers | |
trait Base { | |
protected def getChildren: List[String] | |
} | |
object Base { |
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
https://speakerdeck.com/ryanlecompte/confessions-of-a-ruby-developer-whose-heart-was-stolen-by-scala | |
Practical type mining in Scala ( Rose Toomey ) | |
http://www.slideshare.net/prasinous/scaladays-2013-final | |
Real world akka recepies (Jamie Allen, Björn Antonsson and Patrik Nordwall) | |
http://www.slideshare.net/shinolajla/real-world-akka-recepies-v3 | |
Scala IDE 3.0 - Present & Future ( Mirco Dotta ) |
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 Functor[A, T[_]] { | |
def fmap[B](f: A => B): T[B] | |
} | |
class ListFunctor[A](val list: List[A]) extends Functor[A, List] { | |
override def fmap[B](f: A => B): List[B] = list match { | |
case List() => List() | |
case (x :: xs) => f(x) :: xs.fmap(f) | |
} | |
} |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<script> | |
window.onload = doIt; | |
function doIt() { | |
var oDiv = document.getElementById("div1"); | |
alert (oDiv); | |
//oDiv.removeAttribute("onclick"); | |
} |