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
| parse_git_branch() { | |
| ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return | |
| printf "${1:-(%s)}" "${ref#refs/heads/}" | |
| } | |
| parse_svn_revision() { | |
| local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //') | |
| [ "$REV" ] || return | |
| [ "$(svn st)" ] && DIRTY=' *' | |
| echo "(r$REV$DIRTY)" |
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.actors.Actor | |
| import scala.actors.Actor._ | |
| import scala.util.Random | |
| /** | |
| * 猜數字伺服器回傳的結果 | |
| * | |
| * @param x 使用者輸入的答案 | |
| * @param a 猜數字遊戲裡的A(數字對,位置也對) |
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 collection.mutable.Queue | |
| import se.scalablesolutions.akka.actor.Actor | |
| import Actor._ | |
| case class Enqeue(msg:String) | |
| case class Deqeue(f : (String) => Unit) | |
| class QueueingActor extends Actor { | |
| private val queue = new Queue[String] | |
| println(queue) |
NewerOlder