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
dojo.forEach(dojo.query('[id*=del-campaign]'), function(single) { | |
dojo.attr(single, "checked", true); | |
}); |
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 uk.ac.shef.wit.simmetrics.similaritymetrics.Soundex | |
boolean isSamePlace = false | |
Soundex soundexAlgorithm = new Soundex() | |
if(distanceBetweenVenues(place1, place2) < 200 && soundexAlgorithm.getSimilarity(placeName1, placeName2) > 0.98) { | |
isSamePlace = true | |
} |
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
/** | |
* Made test of three word comparison algorithms: | |
* JaroWinkler, SmithWatermanGotoh and Soundex | |
* | |
* Based on test result Soundex is chosen to be used in venue title merging algorithm | |
* It is more usable, so that I can say if similarity > 0.98 then is same word | |
*/ | |
void testMergeAlgorithms() { | |
def cafeName1 = "Antonio Cafe" | |
def cafeName2 = "Antonio's Cafe" |
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
double EARTH_RADIUS = 6371 | |
/** | |
* Calculate distance based on Haversine algorithmus | |
* (thanks to http://www.movable-type.co.uk/scripts/latlong.html) | |
* | |
* @param latitudeFrom | |
* @param longitudeFrom | |
* @param latitudeTo | |
* @param longitudeTo | |
* @return distance in Kilometers |
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
properties { | |
/** The maximum number of active connections that can be allocated from | |
* this pool at the same time, or zero for no limit. | |
* Make it '-1' to prevent performance problems with idle connections | |
*/ | |
maxActive = -1 | |
/** | |
* The maximum number of active connections that can remain idle in the | |
* pool, without extra ones being released, or zero for no limit. | |
*/ |
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
JSON.registerObjectMarshaller(new UserClassMarshaller(), 155) | |
JSON.registerObjectMarshaller(new SimpleDomainClassMarshaller(), 150) |
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
class UserClassMarshaller extends SimpleDomainClassMarshaller { | |
private Map ALTERNATIVE_NAMES = ["username":"screenName"] | |
protected List getSkippedFields() { | |
return ["password", "email", "enabled", "accountExpired", "accountLocked", | |
"passwordExpired", "securityQuestion", "securityAnswer"] | |
} | |
protected String getAlternativeName(String originalName){ | |
return ALTERNATIVE_NAMES[originalName] |
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
class SimpleDomainClassMarshaller extends DomainClassMarshaller { | |
protected static final Log log = LogFactory.getLog(BaseDomainClassMarshaller.class) | |
protected ProxyHandler proxyHandler | |
private static List SKIPPED_FIELDS = Arrays.asList("lastUpdated", "dateCreated", "createdBy", "class", "id"); | |
public SimpleDomainClassMarshaller() { | |
this(false, new HibernateProxyHandler()); | |
} |
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 list = { | |
def domainNameInPluralForm = params.domainInPlural | |
def domainName = retrieveDomainName(domainNameInPluralForm) | |
def entity = grailsApplication.getArtefacts("Domain").find { | |
it.getShortName() == domainName | |
}?.clazz | |
def result = entity.list(params) | |
def converter = [domainNameInPluralForm:result] as JSON | |
NewerOlder