Windowsではテキストエディタに「Mery」を利用しているので、Macにもインストールしてみる。
省略...
brew update
package scalafx.scene.layout | |
import scalafx.scene.Node | |
trait InAnchorPane { self: Node => | |
def topAnchor: Double = AnchorPane.getTopAnchor(self) | |
def topAnchor_=(v: Double) { | |
AnchorPane.setTopAnchor(self, v) | |
} |
<p id="hello">Hello world!</p> |
object Application extends Controller with FilterController { | |
def ValidateFilter = Filter { request => | |
val isValid = // なんかのバリデーション処理 | |
if (isValid) continue | |
else BadRequest | |
} | |
def index = Action { | |
Ok("index") |
// Scala2.10.0のDependent method typesと型クラスを組み合わせた『The Magnet Pattern』がヤバい件 | |
// http://yuroyoro.hatenablog.com/entry/2013/01/23/192244 | |
// 共通 | |
trait Magnet[A] { | |
type Result = A | |
def f(): Result | |
def apply(): Result = f | |
} |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var x = 10; | |
var lazyInt = Lazy.New( () => x + 1 ); | |
x = 20; | |
Console.WriteLine("value: " + lazyInt.Value); // print => value: 21 |
import scala.util.parsing.combinator.RegexParsers | |
case class Indent(i: Int) | |
case class Text(s: String) | |
case class Line(i: Indent, t: Text) | |
object Parser extends RegexParsers { | |
def indent: Parser[Indent] = """^\s*""".r ^^ {in => Indent(in.length)} | |
def text: Parser[Text] = """[^\n\r]*""".r ^^ {s => Text(s)} |
!SLIDE | |
# gist-slide を試してみよう! | |
!SLIDE | |
これで合ってるの?? |
// コンストラクタをプライベートにし、コンパニオンオブジェクト経由でのみ生成させる。 | |
class ClassName[A] private (val clazz: Class[A]) { | |
// toString で、引数に指定されたクラスの名称を返す。 | |
override def toString(): String = { | |
clazz.getName | |
} | |
} | |
object ClassName { |
@echo off | |
if exist build.sbt ( | |
echo [error] Project already exists. | |
exit /b 1 | |
) | |
if not "%1" == "" ( | |
set project_name=%1 |