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
@Grapes([ | |
@Grab('redis.clients:jedis:1.5.1'), | |
@GrabConfig(systemClassLoader=true) | |
]) | |
import redis.clients.jedis.* | |
performTest("unencoded", null) {n, e-> | |
n.toString() | |
} |
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 r = new Random() | |
def num = r.nextInt(12000000).toString() | |
println num | |
println num.bytes.length | |
println encodeNumber(num, getEncoder()) | |
println encodeNumber(num, getEncoder()).bytes.length | |
def getEncoder(){ | |
['1','2','3','4','5','6','7','8','9','0','-','=','!','@','#','$','%','^','&','*','(',')','_', | |
'+','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', |
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 tests = 5000 | |
def enm = {n, e-> encodeNumberMap(n, e).toString() } | |
def dnm = {n, e-> decodeNumberMap(n, e).toString() } | |
performTest("map", tests, getEncoderMap(), getDecoderMap(), enm, dnm) | |
def en = {n, e-> encodeNumber(n, e).toString() } | |
def dn = {n, e-> decodeNumber(n, e).toString() } | |
performTest("list", tests, getEncoder(), getEncoder(), en, dn) |
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
/* | |
* Copyright 2011 the original author or authors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* | |
* Copyright 2011 the original author or authors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 serviceSoapTest = { | |
String addBusinessPartner = "", helloWorld = "" | |
Boolean isConnected = false, isAlive = false, addBP = false | |
GetDataTableResult getDataTableResult = null | |
Exception soapServiceException = null | |
Address address = new Address(address1: "22575 Highway 6 South", address2: "Navasota, Texas", postalCode: "77868") | |
BusinessPartner businessPartner = new BusinessPartner(cardCode: "C00570", | |
cardName: "Select Sires", | |
groupCode: 1, |
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
<g:if test="${isAlive && isConnected}"> | |
<BR><BR> | |
<span style="font-weight: bold;">Is Alive:</span><span class="name">${isAlive}</span><BR> | |
<span style="font-weight: bold;">Connected B1:</span> <span class="name">${isConnected}</span><BR> | |
<span style="font-weight: bold;">Hello World:</span><span class="name">${helloWorld}</span><BR> | |
<span style="font-weight: bold;">GetDataTableResult:</span><span class="name">${getDataTableResult}</span><BR> | |
%{--<span style="font-weight: bold;">Add BP1:</span><span class="name">${addBP1?.getProperties().values()}</span><BR>--}% | |
<span style="font-weight: bold;">Soap Service Exception</span><span class="name">${soapServiceException}</span><BR> | |
</g:if> |
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
@Grapes([ | |
@Grab('redis.clients:jedis:1.5.1'), | |
@GrabConfig(systemClassLoader = true) | |
]) | |
import redis.clients.jedis.* | |
import groovy.json.JsonBuilder | |
import groovy.json.JsonSlurper | |
import groovy.transform.EqualsAndHashCode |
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
includeTargets << grailsScript("_GrailsDocs") | |
target(main: "Copy controllers, services, domain and views from svn excluded grails-app dirs to the answers dir and create gdoc from them in ref sidebar") { | |
//make sure they all compile | |
depends(compile) | |
//closure to include or exclude certain file types | |
def filesetToInclude = {directory -> | |
fileset(dir: directory) { | |
include(name: '**/*.groovy') |
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
gruntFunction = (grunt) -> | |
gruntConfig = | |
coffee: | |
app: | |
src: ["js/**/*.coffee"] | |
options: | |
bare: true | |
preserve_dirs: true | |
testjs: |
OlderNewer