次のようにproject/Build.scala を編集する。
object ApplicationBuild extends Build {
// ...
val appDependencies = Seq(
"commons-daemon" % "commons-daemon" % "1.0.10"
)
// ...
| module Main where | |
| import Control.Monad (forever) | |
| import Control.Concurrent (forkIO) | |
| import Control.Concurrent.Chan | |
| import Data.Pool | |
| import Database.HDBC | |
| import Database.HDBC.PostgreSQL |
| var data = "do shash'owania"; | |
| var crypto = require('crypto'); | |
| crypto.createHash('md5').update(data).digest("hex"); |
| ## Configure eth0 | |
| # | |
| # vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| DEVICE="eth0" | |
| NM_CONTROLLED="yes" | |
| ONBOOT=yes | |
| HWADDR=A4:BA:DB:37:F1:04 | |
| TYPE=Ethernet | |
| BOOTPROTO=static |
細かい点で間違いなどあるかと思います。fork して直していただけると助かります。
Finagle is built using sbt. We've included a bootstrap script to ensure the correct version of sbt is used. To build:
Finagle は sbt を使ってビルドしています。私たちは確実に適切なバージョンの sbt を使うようにブートストラップ用のスクリプトを含めています。このように実行します。
$ ./sbt test
This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
| package object mail { | |
| implicit def stringToSeq(single: String): Seq[String] = Seq(single) | |
| implicit def liftToOption[T](t: T): Option[T] = Some(t) | |
| sealed abstract class MailType | |
| case object Plain extends MailType | |
| case object Rich extends MailType | |
| case object MultiPart extends MailType |
| {--- 余再帰とその利用例 ---} | |
| {- 末尾再帰と再帰と余再帰 | |
| - | |
| - 参考: http://d.hatena.ne.jp/kazu-yamamoto/20091122/1258899591 | |
| - | |
| - 末尾再帰 : 引数に結果を蓄積し、自身へgotoして処理の流れが戻ってこないようにする。正格なデータを処理する時に用いるとスタックやヒープの節約になる。 | |
| - foldl f a [] = a | |
| - foldl f a (x:xs) = foldl f (f a x) xs | |
| - |
| {-# LANGUAGE TemplateHaskell, FlexibleContexts, FlexibleInstances, UndecidableInstances, OverlappingInstances #-} | |
| import Control.Lens | |
| import Control.Monad.State | |
| -- 基本となるオブジェクト | |
| data Obj = Obj { | |
| _pos :: Int | |
| } deriving (Show) | |
| -- Obj型のオブジェクトをもつ抽象的なクラスHasObjを作る |
| -------------------------------------------------------------------------------- | |
| {-# LANGUAGE OverloadedStrings #-} | |
| module Main | |
| ( main | |
| ) where | |
| -------------------------------------------------------------------------------- | |
| import Control.Concurrent (forkIO) | |
| import Control.Monad (forever, unless) |