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
/** メインフレームのIBM EBCDIC半角カタカナを英小文字に変換するmetaClass操作*/ | |
// before:アイウエオカキクケタチツテトナニヌネヘホマミムメモヤ | |
// after: abcdefghijklmnopqrstuvwxyz | |
String.metaClass.kana2ei = { -> | |
return delegate.tr('アイウエオカキクケタチツテトナニヌネヘホマミムメモヤ','abcdefghijklmnopqrstuvwxyz') | |
} | |
assert "ネオカオネオトウオ クイ0020 オトエ-ウアツツ".kana2ei()=="reference hb0020 end-call" | |
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
// Removing trigraph notation in the source code | |
//---------------------------------------------------------------------------- | |
//| trigraph | replacement | trigraph | replacement | trigraph | replacement | | |
//---------------------------------------------------------------------------- | |
//| ??= | # | ??( | [ | ??< | { | | |
//| ??/ | \ | ??) | ] | ??> | } | | |
//| ??’ | ? | ??! | | | ??- | ? | | |
//---------------------------------------------------------------------------- | |
// From To | |
// ??= # |
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
@REM Recursively list office files modified today ( Word Excel Powerpoint text) | |
FORFILES /P . /S /D %DATE% /M *.*x* |
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
// g100pon #67 実行中のクラス/メソッド名を取得 | |
def getMyInfo() { | |
def the_thisClassName = getClass().getName() | |
def the_inThisObject = new Throwable().getStackTrace().findAll { | |
the_stackTraceElement -> | |
the_thisClassName.equals(the_stackTraceElement.getClassName()) | |
} | |
println "className = "+ the_inThisObject[0].getProperties().className | |
println "methodName = "+ the_inThisObject[0].getProperties().methodName |
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
// g100pon #19 為替情報の取得 | |
@Grab(group='net.sourceforge.nekohtml', module='nekohtml', version='1.9.14') | |
import org.cyberneko.html.parsers.SAXParser | |
class dummy {} // ver1.6 互換の為の class annotationとしての@grap | |
url = 'http://ja.exchange-rates.org/converter/JPY/BRL/100' | |
def parser = new XmlSlurper(new SAXParser()) | |
def HTML = parser.parse(url) |
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
// Top command: | |
// Windows依存です、CPU負荷の高い順に10プロセス表示します | |
def command = "cmd /c tasklist.exe /v> output.txt" | |
command.execute() | |
List rated=[] | |
List cputime=[] | |
new File("output.txt").eachLine{line -> | |
cputime=line.split(' +') | |
rated.add(cputime) |
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
// 文字列の拡張メソッド | |
// 元々の文字列の並び順をランダムに並び替える | |
String.metaClass.randomize = { -> | |
Math.random() | |
return delegate.toList().sort { Math.random()}.join() | |
} | |
println "abcdefg".randomize() |
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
@Grab('net.java.dev.jna:jna:3.4.0') // since Java does not have directory moving function | |
import com.sun.jna.*; | |
import com.sun.jna.win32.*; | |
interface Kernel32Library extends StdCallLibrary { | |
Kernel32Library INSTANCE = Native.loadLibrary("kernel32", Kernel32Library.class); | |
boolean SetCurrentDirectoryA(String dir); | |
} |
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 groovyx.javafx.* | |
key = '<YOUR Google+ API KEY HERE>' | |
uid = 110611905999186598367 // user ID | |
url = "https://www.googleapis.com/plus/v1/people/$uid?key=$key".toURL() | |
json = new groovy.json.JsonSlurper().parseText(url.text) | |
GroovyFX.start { | |
def sg = new SceneGraphBuilder() |
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
new AntBuilder().sequential { | |
echo "Conflict files of Dropbox will be moved" | |
move(todir: /c:\var\DUPLICATED_DROPBOX/, //Target Directory of Conflict files | |
verbose:true) { | |
fileset(dir: /c:\Dropbox/, // Directory of Dropbox | |
includes: '**/*conflicted*copy*', | |
includes: '**/*上の問題のあるコピー*', | |
excludes: '**/*dropbox*cache*' | |
) | |
} |
OlderNewer