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
| def time[R](opname: String)(block: => R) = { | |
| val start_time = System.nanoTime() | |
| var success = true | |
| try { | |
| block | |
| } catch { | |
| case ex: Throwable => { | |
| success = false; | |
| throw ex | |
| } |
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
| // Apache 2 license | |
| public static void main(final String... args) throws GeneralSecurityException, IOException | |
| { | |
| if (args.length != 4 && args.length != 2) | |
| { | |
| System.err.println("Usage: Decrypt [-alg algorithm] KEY FILE"); | |
| System.exit(1); | |
| } |
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
| val sns: Option[SNS] = // configure SNS | |
| implicit def pimpActor(actor: LiftActor) = new { | |
| def >(implicit s: SNSSerializer[T]) = sns match { | |
| case Some(service) => service ! Publish(s.write(msg)) | |
| case _ => actor ! msg | |
| } | |
| } |
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
| trait SNSSerializer[T] { | |
| implicit val formats = DefaultFormats | |
| def json(t: T): JObject | |
| def write(t: T): String = Serialization.write(json(t)) | |
| } | |
| implicit object ChatFormat extends SNSSerializer[Chat] { | |
| def json(c: Chat) : JObject = ("msg" -> c.text) | |
| } |
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
| def handler : SNS.HandlerFunction = { | |
| case s => for { | |
| json <- JsonParser.parseOpt(s) | |
| JString(msg) <- json \ "msg" | |
| } ChatServer ! Chat(msg) | |
| } |
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 org.xml.sax.InputSource | |
| import xml.parsing.{NoBindingFactoryAdapter, FactoryAdapter} | |
| import xml.factory.XMLLoader | |
| import xml.Elem | |
| object ResolvingXML extends XMLLoader[Elem] { | |
| override def adapter: FactoryAdapter = new NoBindingFactoryAdapter() { | |
| override def resolveEntity(publicId: String, systemId: String) : InputSource = { | |
| // use CatalogResolver here | |
| } |
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
| tmp$ mkdir weird | |
| tmp$ cd weird/ | |
| weird$ cp -r ~/Downloads/lift-lift_25_sbt-b9779cc/scala_29/lift_blank ./blank_210 | |
| weird$ vi blank_210/build.sbt | |
| blank_292$ cd ../blank_210/ | |
| blank_210$ sbt package | |
| Listening for transport dt_socket at address: 5005 | |
| [2013-02-10 16:04:54] | |
| [2013-02-10 16:04:54] ############################################################# | |
| [2013-02-10 16:04:54] |
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
| geronimo> 2013-02-10 17:08:11,646 ERROR [[/hello]] Exception starting filter LiftFilter | |
| java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/BaseNCodec | |
| at net.liftweb.util.Helpers$.<init>(Helpers.scala:34) | |
| at net.liftweb.util.Helpers$.<clinit>(Helpers.scala) | |
| at net.liftweb.http.LiftRules.<init>(LiftRules.scala:165) | |
| at net.liftweb.http.LiftRules$.prodInstance$lzycompute(LiftRules.scala:77) | |
| at net.liftweb.http.LiftRules$.prodInstance(LiftRules.scala:77) | |
| at net.liftweb.http.LiftRulesMocker$$anonfun$9$$anonfun$apply$2.apply(LiftRules.scala:64) | |
| at net.liftweb.http.LiftRulesMocker$$anonfun$9$$anonfun$apply$2.apply(LiftRules.scala:64) | |
| at net.liftweb.common.EmptyBox.openOr(Box.scala:644) |
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
| diff ~/tmp/29 ~/tmp/210 | |
| 2,15c2,15 | |
| < MD5 (./WEB-INF/classes/bootstrap/liftweb/Boot$$anonfun$1.class) = 5702b8f62a75ac382b09a02d87f23395 | |
| < MD5 (./WEB-INF/classes/bootstrap/liftweb/Boot$$anonfun$boot$1.class) = ec0fa6681ab8a769fc64adcc046cd69c | |
| < MD5 (./WEB-INF/classes/bootstrap/liftweb/Boot$$anonfun$boot$2.class) = d1937ff461a5b85110457a7ff030e259 | |
| < MD5 (./WEB-INF/classes/bootstrap/liftweb/Boot$$anonfun$boot$3.class) = d8c0d3b43db55b07538972f535b16729 | |
| < MD5 (./WEB-INF/classes/bootstrap/liftweb/Boot$$anonfun$boot$4.class) = b57ac4f65de770e3e1253b5b926dc843 | |
| < MD5 (./WEB-INF/classes/bootstrap/liftweb/Boot.class) = 24adfed5e0fc30da00447eb85d451ed7 | |
| < MD5 (./WEB-INF/classes/code/lib/DependencyFactory$.class) = af9b4100381bcf5b17fe3c0019df7925 | |
| < MD5 (./WEB-INF/classes/code/lib/DependencyFactory$time$$anonfun$$init$$1.class) = 52770f75a0323d4bd8e3efce56a50f59 |
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
| [Loaded org.apache.geronimo.jmxremoting.Credentials from file:/Users/richard/tmp/weird/geronimo-tomcat7-javaee6-3.0.0/repository/org/apache/geronimo/framework/geronimo-jmx-remoting/3.0.0/geronimo-jmx-remoting-3.0.0.jar] | |
| [Loaded javax.security.auth.login.LoginContext from /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/jre/lib/rt.jar] | |
| [Loaded javax.security.auth.login.LoginContext$1 from /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/jre/lib/rt.jar] | |
| [Loaded javax.security.auth.login.LoginContext$ModuleInfo from /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/jre/lib/rt.jar] | |
| [Loaded javax.security.auth.login.LoginContext$2 from /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/jre/lib/rt.jar] | |
| [Loaded javax.security.auth.login.LoginContext$SecureCallbackHandler from /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/jre/lib/rt.jar] | |
| [Loaded javax.security.auth.login.LoginContext$4 from /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Con |