Skip to content

Instantly share code, notes, and snippets.

View sfines's full-sized avatar

Steven Fines sfines

View GitHub Profile
@sfines
sfines / ADTMacros.scala
Last active July 16, 2019 18:32 — forked from trbngr/ADTMacros.scala
DynamoFormats for ADT
package com.company.macros
import scala.reflect.macros.blackbox
class ADTMacros(val c: blackbox.Context) {
import c.universe._
def dynamoFormat[T: c.WeakTypeTag]: Tree = {
generate[T] { (tpe, symbols) =>
@sfines
sfines / addNewData.R
Created November 6, 2016 21:07 — forked from dfalster/addNewData.R
The function addNewData.R modifies a data frame with a lookup table. This is useful where you want to supplement data loaded from file with other data, e.g. to add details, change treatment names, or similar. The function readNewData is also included. This function runs some checks on the new table to ensure it has correct variable names and val…
##' Modifies 'data' by adding new values supplied in newDataFileName
##'
##' newDataFileName is expected to have columns
##' c(lookupVariable,lookupValue,newVariable,newValue,source)
##'
##' Within the column 'newVariable', replace values that
##' match 'lookupValue' within column 'lookupVariable' with the value
##' newValue'. If 'lookupVariable' is NA, then replace *all* elements
##' of 'newVariable' with the value 'newValue'.
##'
package com.example.core.application
import com.mongodb.casbah.Imports._
import java.util.UUID
import com.example.domain.{User, Address, Customer}
/**
* Contains type classes that deserialize records from Casbah into "our" types.
*/
trait CasbahDeserializers {
@sfines
sfines / JBOSS-Text.txt
Created August 10, 2011 00:35
JBoss AS deployment error -
2011-08-09 17:24:09,591 ERROR [org.apache.catalina.core.StandardContext] (HDScanner) Context [/notification-services] startup failed due to previous errors
java.lang.RuntimeException: mapped-name is required for java:/notificationDb of deployment notification-services.war
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXmlResourceRefs(WebResourceHandler.java:178)
at org.jboss.web.tomcat.service.injection.WebResourceHandler.loadXml(WebResourceHandler.java:327)
at org.jboss.web.tomcat.service.TomcatInjectionContainer.processMetadata(TomcatInjectionContainer.java:537)
at org.jboss.web.tomcat.service.WebCtxLoader.start(WebCtxLoader.java:158)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4272)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:321)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:145)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDe