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(group='io.github.http-builder-ng', module='http-builder-ng-apache', version='1.0.3') | |
@Grab(group='org.slf4j', module='slf4j-simple', version='1.7.25') | |
]) | |
import static groovyx.net.http.HttpBuilder.configure | |
def sonarqubeHttp = configure { | |
request.uri = 'http://sonarqube.example.com' | |
} |
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
/* | |
MySQL 5.6의 DATETIME 타입에 대한 밀리세컨드 부분 절삭 버그 재현 | |
MySQL 5.6.4 ms 지원 : http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html | |
MySQL 5.6 DATETIME 타입에서 ms 반올림(round) 버그 : http://bugs.mysql.com/bug.php?id=68760 | |
MySQL Connector/J 5.1.22 까지는 Date 객체의 ms 부분을 미리 절삭해 전송하는 버그 있음 | |
MySQL Connector/J 5.1.23 부터는 Date 객체의 ms 부분도 함께 전송 -> MySQL 5.6 서버의 ms 반올림 버그 유발 -> 초,분,날짜가 바뀌는 현상 유발 | |
** 아래코드를 반올림 버그가 있는 MySQL 5.6서버에서 JDBC 드라이버 바꿔가며 실행한 결과 |
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
// MySQLQuery와 JPASQLQuery 를 참조해서 만든 MySQLJPASQLQuery : QueryDSL 3.x | |
public class MySQLJPASQLQuery extends AbstractJPASQLQuery<MySQLJPASQLQuery> { | |
private static final Joiner JOINER = Joiner.on(", "); | |
public MySQLJPASQLQuery(EntityManager entityManager, SQLTemplates sqlTemplates) { | |
super(entityManager, new Configuration(sqlTemplates)); | |
} | |
public MySQLJPASQLQuery forceIndex(String... indexes) { |
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
#!/usr/bin/env python | |
import gtk | |
import sys | |
''' | |
X Window left/right edge margin reservation tool | |
Other windows cannot overlap the margin area. | |
Usage: screenmargin.py left|right pixel | |
# reserve left side 100 pixel | |
screenmargin.py left 100 |
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 kr.pe.kwonnam.guavatest.cache; | |
import com.google.common.cache.CacheBuilder; | |
import com.google.common.cache.CacheLoader; | |
import com.google.common.cache.LoadingCache; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.TimeUnit; | |
/** |
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
<?php | |
$server = "localhost"; | |
$port = 11211; | |
/** | |
* Taken directly from memcache PECL source | |
* | |
* http://pecl.php.net/package/memcache | |
* | |
*/ |
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 usage() { | |
println 'Usage: groovy movie_subtitle_match.groovy 동영상확장자 자막확장자' | |
println "동영상 파일과 자막 파일의 갯수가 동일해야함" | |
} |
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
@GrabConfig(systemClassLoader=true) | |
@Grab(group='mysql', module='mysql-connector-java', version='5.1.25') | |
import groovy.sql.Sql | |
Sql.withInstance('jdbc:mysql://localhost/employees?useUnicode=true&characterEncoding=utf8', | |
'root', 'root', 'com.mysql.jdbc.Driver') { sql -> | |
def times = 1000 | |
def start = 0 | |
print "##### 일반 조인 " |
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
if (args.length < 2) { | |
println "Usage groovy smi_timing filename milliseconds-to-adjust [encoding:default cp949]" | |
System.exit(-1) | |
} | |
def smi = new File(args[0]) | |
def millis = Long.parseLong(args[1]) | |
def encoding = args.length == 3 ? args[2] : "cp949" | |
println "$smi, $millis, $encoding" |