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 X { | |
def hello(){println "hello wow"} | |
def invokeMethod(String name,arg){ | |
println "$name $arg" | |
} | |
} | |
x = new X() | |
x.hello() | |
x.hello(1,2,3) |
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 clo = {f,c,skey-> | |
def r=[] | |
new File(f).text.trim().splitEachLine(/\t/){ r<<c(it) } | |
return [ | |
r.first().join("\t"), | |
r.tail().sort{it[skey]}*.join("\t").join("\n") | |
].join("\n") | |
} | |
println clo("data.csv",{[it[0],it[2],it[1],(it[3].isNumber())? it[3].toInteger()+1:it[3]]},0) |
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 数字 = "〇一二三四五六七八九" | |
def 範囲 = 数字.collect{漢数字->数字.indexOf(漢数字)} | |
println 範囲.collect{段-> | |
範囲.collect{掛-> | |
(段*掛)!=[].size()?(段*掛).toString().collect{数-> 数字[数.toInteger()]}.join() | |
.padLeft(数字.indexOf("二")," ")+" ":"" | |
}.join() | |
}.join("\n") |
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("org.grails:grails-docs:1.2.0.RC2"), | |
@Grab("radeox:radeox:1.0-b2"), | |
@Grab("ant:ant-nodeps:1.6.5"), | |
@GrabConfig(systemClassLoader=true) | |
]) | |
import grails.doc.ant.* | |
new AntBuilder().sequential { | |
native2ascii(src:"conf",dest:"src/docs",includes:"**/*.properties",encoding:"UTF-8") |
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
default.doesnt.match.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、[{3}]パターンと一致していません。 | |
default.invalid.url.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、有効なURLではありません。 | |
default.invalid.creditCard.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、有効なクレジットカード番号ではありません。 | |
default.invalid.email.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、有効なメールアドレスではありません。 | |
default.invalid.range.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、[{3}]から[{4}]範囲内を指定してください。 | |
default.invalid.size.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、[{3}]から[{4}]以内を指定してください。 | |
default.invalid.max.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、最大値[{3}]より大きいです。 | |
default.invalid.min.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、最小値[{3}]より小さいです。 | |
default.invalid.max.size.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、最大値[{3}]より大きいです。 | |
default.invalid.min.size.message=クラス[{1}]プロパティ[{0}]の値[{2}]は、最小値[{3}]より小さいです。 |
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
//Events script for the grails app-engine plugin 0.8.5 to support | |
//system-properties stringchararrayaccessor.disabled=true | |
import groovy.xml.StreamingMarkupBuilder | |
import groovy.xml.MarkupBuilder | |
includeTargets << new File("${appEnginePluginDir}/scripts/_AppEngineCommon.groovy") | |
eventStatusFinal = { msg -> | |
def appXmlFile = new File("$stagingDir/WEB-INF/appengine-web.xml") | |
def xml = new XmlSlurper().parse(appXmlFile) |
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 jp.grails | |
import javax.persistence.* | |
import org.datanucleus.jpa.annotations.Extension | |
//import org.hibernate.annotations.* | |
@Entity | |
class Comment implements Serializable { | |
static belongsTo = [todo:Todo] | |
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
# Step.1 | |
http://dist.codehaus.org/grails/grails-bin-1.1.1.zip | |
#Grailsの設定 | |
export GRAILS_HOME=/opt/grails-1.1.1 | |
export PATH=$GRAILS_HOME/bin:$PATH | |
#appengine-javaの設定 http://code.google.com/appengine/downloads.html | |
export APPENGINE_HOME=/opt/appengine-java-sdk-1.3.0 |
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
import com.google.appengine.api.users.User; | |
import com.google.appengine.api.users.UserService; | |
import com.google.appengine.api.users.UserServiceFactory; | |
class AppEngineTagLib { | |
static namespace = "appengine" | |
def ifLoggedIn = { attrs, body -> | |
def userService = UserServiceFactory.getUserService() | |
if (userService.isUserLoggedIn()) { | |
out << body() |
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
<appengine:ifLoggedIn>ログインしているときに表示</appengine:ifLoggedIn> | |
<appengine:ifNotLoggedIn>ログインしていないときに表示</appengine:ifNotLoggedIn> | |
<appengine:ifAdminLoggedIn>管理者がログインしているときに表示</appengine:ifAdminLoggedIn> | |
<appengine:ifAdminNotLoggedIn>管理者がログインしていないときに表示</appengine:ifAdminNotLoggedIn> | |
<a href="appengine.loginUrl()">ログインURL</a> | |
<a href="appengine.logoutUrl()">ログアウトURL</a> | |
<appengine:userNickname/> | |
<appengine:userAuthDomain/> | |
<appengine:userEmail/> |
OlderNewer