package test
trait A {
class B {
}
}
You can use test.A#B to access class B in other class, for example:-
import test.A
type B = A#B
val b = new B
When you think you are superior, you are being an idiot...
package test
trait A {
class B {
}
}
import test.A
type B = A#B
val b = new B
sudo apt-get install acpidump
sudo modprobe msr
sudo turbostat
CPU GHz TSC
avg 0.80 2.00
0 0.80 2.00
1 0.80 2.00
2 0.80 2.00
3 0.80 2.00
4 0.81 2.00
5 0.80 2.00
6 0.80 2.00
7 0.80 2.00
while :; do :; done
CPU GHz TSC
avg 2.86 2.00
0 2.77 2.00
1 2.87 2.00
2 2.70 2.00
3 2.74 2.00
4 2.77 2.00
5 2.81 2.00
6 2.76 2.00
7 2.77 2.00
#!/bin/sh
java -Xmx1512M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512m -noverify -javaagent:/opt/ZeroTurnaround/JRebel/jrebel.jar -jar /opt/sbt/sbt-launch-0.7.5.jar "$@"
import sbt._
class WebAppBuild(info: ProjectInfo) extends DefaultWebProject(info) {
val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.14" % "test"
val servletApi = "javax.servlet" % "servlet-api" % "2.5"
override def jettyWebappPath = webappPath
override def scanDirectories = Nil
}
jetty-run
~ prepare-webapp
jetty-run
~ prepare-webapp
mkdir HelloWorld
cd HelloWorld
sbt
Name: HelloWorld
Organization: QQ Enterprise
Version [1.0]:
Scala version [2.8.1]:
sbt version [0.7.5]:
import sbt._
class WebAppBuild(info: ProjectInfo) extends DefaultWebProject(info) {
val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.14" % "test"
val servletApi = "javax.servlet" % "servlet-api" % "2.5"
}
reload
update
import javax.servlet.http._
class HelloWorldServlet extends HttpServlet {
override def doGet(req: HttpServletRequest, resp: HttpServletResponse) = {
resp.getWriter().print("Hello World!")
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>HelloWorldServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>
</web-app>
reload
jetty-run
def errMsgList = domainClassObj.errors.allErrors.collect{g.message([error : it])}