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 base; | |
import java.util.List; | |
public abstract class AbstractBase { | |
abstract protected List getChildren(); | |
} |
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 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 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 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 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"); | |
} |
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
#!/bin/sh | |
exec scala -nc "$0" "$@" | |
!# | |
import scala.io._ | |
val source = if(args.length>0) Source.fromFile(args(0)).getLines else Source.stdin.getLines | |
val pattern = """([a-zA-Z]+)-(\d+)""".r | |
source.flatMap(pattern.findFirstIn).toList.distinct.foreach(println) |
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
cond = "false" | |
if cond then true else false end | |
=> true |
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
def match_type param | |
if param.kind_of? Integer | |
puts "it's a Integer" | |
end | |
if param.kind_of? String | |
puts "its a String" | |
end | |
if param.kind_of? Array | |
puts "its an Array" | |
end |
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
def postProcess int_list | |
int_list.map{ |i| i - 2}.each{|l| puts l} | |
end | |
list = [1,2,3,4,5] | |
rs = list.map{ |i| i * 2 }.map{ |i| i + 3 }.reject{|j| j > 10}.map{ |i|i.to_s} | |
postProcess(rs) |
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
def postProcess int_list | |
int_list.map{ |i| i * 2}.each{|l| puts l} | |
end | |
list = [1,2,3,4,5] | |
rs = list.map{ |i| i * 2 }.map{ |i| i + 3 }.reject{|j| j > 10}.map{ |i|i.to_s} | |
postProcess(rs) |