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 bootstrap.liftweb | |
import _root_.net.liftweb.common._ | |
import _root_.net.liftweb.util._ | |
import _root_.net.liftweb.http._ | |
import _root_.net.liftweb.sitemap._ | |
import _root_.net.liftweb.sitemap.Loc._ | |
import Helpers._ | |
/** |
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
class Foo { | |
import scala.collection.mutable.ArrayBuffer | |
val elements = List(1,2,3) | |
def map[T](block: Int => T)(implicit m:reflect.Manifest[T]) = { | |
val vals = ArrayBuffer[T]() | |
elements foreach{ i => vals += block(i) } | |
vals.toArray | |
} | |
} |
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
■■■■■■■■■■■■■■■■■■■■■■■ | |
■■■■■■■■■■■■■■■■■■■■■■■ | |
Scalatra のすすめ | |
Scala + Sinatra = Scalatra | |
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
/** | |
sbt-android-plugin/script/create_project | |
をobjectに定義したもの。 | |
> scalac create_project.scala | |
> scala -cp . CreateProject MyProject .... | |
@see http://github.com/jberkel/android-plugin | |
*/ | |
object CreateProject { |
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
class Rubynizer(n:Any) { | |
def to_s = n.toString | |
def to_i = { | |
if( n.isInstanceOf[Char] ) n.asInstanceOf[Char].toString.toInt | |
else if( n.isInstanceOf[String] ) n.asInstanceOf[String].toInt | |
else throw new NumberFormatException() | |
} | |
} | |
class Bakanizer(n:Int) { | |
implicit def rubynize(n:Any) = new Rubynizer(n) |
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
/** | |
scala.mobileパッケージの使い方を試してみました。 | |
オンデマンドでパッケージをロードして実行するしくみで、 | |
要は、ClassLoaderとJavaリフレクションのラッパー。 | |
コンパイル実行よりも、 | |
scalaコンソールで一行ずつ実行したほうがわかりやすい。 | |
*/ | |
import java.net.URL |
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
import scala.util.parsing.combinator._ | |
/** | |
* expr :: CREATE TABLE tbl_name ( create_definition,...) | |
* | |
* create_definition: | |
* col_name column_definition | |
* | |
* column_definition: | |
* data_type |
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
/* | |
* scala で OpenGLのためし。 | |
* Java OpenGL ライブラリ JOGL を使っています。 | |
* | |
* scalac -classpath \ | |
* "/jogl/lib/gluegen-rt.jar:/jogl/lib/jogl.jar" JOGLDemo.scala | |
* java -Djava.library.path="/jogl/lib" -classpath \ | |
* "./classes:scala-library.jar:\ | |
* /jogl/lib/gluegen-rt.jar:/jogl/lib/jogl.jar" takedasoft.JOGLDemo | |
* |
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
/* | |
* myProjFullSpec.scala | |
* | |
* Specs API 調査版 | |
* http://specs.googlecode.com/files/scaladocs-1.4.1.rar | |
*/ | |
package takedasoft | |
import org.specs._ | |
import org.specs.matcher._ |
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
/* | |
* ftdrop3Spec.scala | |
* | |
* specs for ftdop3.scala | |
* http://gist.github.com/30441 | |
* | |
* require: specs-<version>.jar | |
* http://code.google.com/p/specs/ | |
*/ | |
package ftdop3 |
NewerOlder