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 org.codehaus.groovy.scriptom.* | |
Scriptom.inApartment | |
{ | |
excel = new ActiveXObject('Excel.Application') | |
fileList = ["Book1.xls"] // TODO:カレントからxlsファイルを取得する処理 | |
fileList.each() { | |
book = excel.workbooks.open(new File(it).canonicalPath) | |
book.CheckCompatibility = false |
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
/** | |
Calendarのメタクラスにできてない | |
*/ | |
def toDate = { Date.parse('yyyy/MM/dd', it) } | |
def toStr = { it.format('yy/MM') } | |
GregorianCalendar.metaClass.getThenStep = { | |
cur = delegate.getTime() | |
// delegate.add(Calendar.MONTH, it) | |
// cur |
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
/** | |
Excel.exeが残ってしまった時用 | |
*/ | |
import org.codehaus.groovy.scriptom.* | |
def name = "EXCEL.EXE" | |
Scriptom.inApartment | |
{ |
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 org.codehaus.groovy.runtime.* | |
println "オリジナル" | |
1.step(5,1) {print "$it "} | |
println "" | |
println "AST Browser 上" | |
1.step(5, 1, {this.print("$it ")}) | |
println "" |
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 toDate = { Date.parse('yyyy/MM/dd', it) } | |
Date.metaClass.createMonthRange = { | |
cal = Calendar.getInstance() | |
range = [] | |
(delegate..it).each() { |
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 javax.swing.* | |
// 移動対象 | |
def folderPath = "." |
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 javax.swing.*; | |
// VirtualBoxのパス | |
path = "C:\\Program Files\\Oracle\\VirtualBox\\" | |
// 仮想マシンのリスト | |
list = ['RedMine', 'DokuWiki'] | |
// 引数チェック | |
if (args.size() == 0) { |
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 StopWatch { | |
def lapTimes = [] | |
def startTime | |
def stopTime | |
def cur = { System.currentTimeMillis() } | |
def start = { startTime = cur() } | |
def stop = { stopTime = cur() } | |
def elapsedTime = { stopTime - startTime } | |
def elapsedLapTime = { lapTimes[it].time - startTime } |