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
trait A { | |
def a: String => String | |
} | |
trait B { | |
//TypeOf is something magical | |
def b: TypeOf[A.a] | |
} |
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
val validInt: String => ValidationNEL[String, Int] = s => | |
for { | |
validStr <- (allDigits(s) |@| maxSizeOfTen(s))((_,x) => x) | |
i <- toInt(validStr) | |
} yield(i) |
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
def lineToOffer(line: String, headers: List[String]) : Validation[NonEmptyList[String], Offer] = { | |
({commaSplit(_)} andThen {extractFields(_: List[String], headers)} apply line) :-> | |
{(v) => Offer(v._1, v._2, v._3, v._4)} | |
} | |
def commaSplit(l: String): String => List[String] = l.split(",").toList | |
def extractFields(x: List[String], headers: List[String]): Validation[NonEmptyList[String], (String, String, String, String)] = { | |
notEmpty(x(headers.indexOf("offer_name")), "No offer name specified on line:" + x.mkString(","))) <|***|> ( | |
notEmpty(x(headers.indexOf("email")), "No email specified on line:" + x.mkString(",")), |
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
val xml = <dependencies> | |
<dependency> | |
<groupId>javax.persistence</groupId> | |
<artifactId>persistence-api</artifactId> | |
<version>1.0</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>net.sf.oval</groupId> | |
<artifactId>oval</artifactId> |
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
/* | |
* Created by IntelliJ IDEA. | |
* User: tstevens | |
* Date: 4/30/11 | |
* Time: 3:50 PM | |
*/ | |
package com.oletraveler.bmapz | |
import xml.{NodeSeq, Elem} |
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 WiredUser { | |
val userToWire = (Users.userForDisplay or userDetail.currentValue).get | |
private object User { | |
val entity = ValueCell(userToWire) | |
val edit = ValueCell(false) | |
val email = edit.lift(b => entity.lift(_.getEmail.asScala.headOption).get) | |
} |
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 com.gaiam.gcsi.util; | |
import javax.jms.Connection; | |
import javax.jms.ConnectionFactory; | |
import javax.jms.JMSException; | |
import javax.jms.Message; | |
import javax.jms.MessageProducer; | |
import javax.jms.Queue; | |
import javax.jms.Session; |
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
type OurApp[A] = Coproduct[Auth, Interact, A] | |
type OurAppPlus[A] = Coproduct[OurApp, ThirdAlgebra, A] | |
type ACoyo[A] = Coyoneda[OurAppPlus,A] | |
type AFree[A] = Free[ACoyo,A] | |
def point[A](a: ⇒ A): FreeC[OurAppPlus, A] = Monad[AFree].point(a) |
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
4702 30248 0.1 19.5 1449112 721088 ? Sl Jul01 8:49 /usr/java/jdk1.7.0_09/bin/java -cp /opt/glassfish3/glassfish/modules/glassfish.jar -XX:+UnlockDiagnosticVMOptions -XX:PermSize=64m -XX:MaxPermSize=192m -XX:NewRatio=2 -XX:+LogVMOutput -XX:LogFile=/opt/glassfish3/glassfish/domains/gcsi/logs/jvm.log -Xmx512m -client -javaagent:/opt/glassfish3/glassfish/lib/monitor/flashlight-agent.jar -Dfelix.fileinstall.disableConfigSave=false -Djavax.net.ssl.keyStore=/opt/glassfish3/glassfish/domains/gcsi/config/keystore.jks -Djava.awt.headless=true -Dfelix.fileinstall.poll=5000 -Djava.endorsed.dirs=/opt/glassfish3/glassfish/modules/endorsed:/opt/glassfish3/glassfish/lib/endorsed -Dfelix.fileinstall.bundles.startTransient=true -Djavax.net.ssl.trustStore=/opt/glassfish3/glassfish/domains/gcsi/config/cacerts.jks -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as -DANTLR_USE_DIRECT_CLASS_LOADING=true -Djava.security.auth.login.config=/opt/glassfish3/glassfish/domains/gcsi/config/login.conf -Dgosh.args=--noint |
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 com.gaiam.gcsis._ | |
import com.gaiam.gcsis.util.Logging | |
class Boot { | |
val log = Logging.logger(classOf[Boot]) | |
def boot: Unit = { |
NewerOlder