TODO: Fill in the problem statement
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
println("Configuring data sources") | |
dataSource { | |
pooled = true | |
driverClassName = "com.mysql.jdbc.Driver" | |
dialect = "org.hibernate.dialect.MySQL5InnoDBDialect" | |
} | |
hibernate { | |
cache.use_second_level_cache = true | |
cache.use_query_cache = false | |
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' |
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
// This can be used in lieu of changing the metaclass in the constructor, | |
// but affects _all_ classes, which can be a big overhead | |
// ExpandoMetaClass.enableGlobally() | |
class RobotDog { | |
String name | |
RobotDog() { | |
// Make the metaclass an expando so that we can cache behavior better | |
def mc = new ExpandoMetaClass(RobotDog,false,true) |
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
// isPalindrome - ignore cases, spaces and punctuation | |
// Empty string is false | |
// O(1) space, cant modify original string | |
[1,2,3,4,5,6].each { | |
println "Running isPalindrome${it}" | |
assert !"isPalindrome${it}"("") // False | |
assert !"isPalindrome${it}"(" !,! ") // False | |
assert "isPalindrome${it}"("M") // True | |
assert "isPalindrome${it}"("MM..M") // True |
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
// isPalindrome - ignore cases, spaces and punctuation | |
// Empty string is false | |
// O(1) space, cant modify original string | |
[1,2,3,4,5,6].each { | |
println "Running isPalindrome${it}" | |
assert !"isPalindrome${it}"("") // False | |
assert !"isPalindrome${it}"(" !,! ") // False | |
assert "isPalindrome${it}"("M") // True | |
assert "isPalindrome${it}"("M.") // True |
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
var empty_list = function(selector) { | |
return selector(undefined, undefined, true); | |
}; | |
var prepend = function(el, list) { | |
return function(selector) { | |
return selector(el, list, false); | |
}; | |
}; | |
var head = function(list) { |
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
dependencies { | |
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g. | |
// Allows connecting to MySQL DBs | |
runtime 'mysql:mysql-connector-java:5.1.22' | |
// For JodaTime plugin | |
compile "org.jadira.usertype:usertype.jodatime:1.9.1" | |
// So that spock can work with Grails 2.2 |
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 edu.wisc.radiology.performanceevaluations | |
import grails.converters.JSON | |
import grails.converters.XML | |
import grails.plugins.springsecurity.Secured | |
import grails.validation.Validateable | |
@Secured("hasRole('ROLE_USER')") | |
class RequestPeerEvaluationController { |
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 MyDomain { | |
... | |
static constraints = { | |
items(validator: requiresAtleastOne) | |
} | |
} |
NewerOlder