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 java.util.Arrays; | |
/** | |
* int 형과 byte[] 간의 변환. | |
* ByteBuffer 를 사용하는 방법 대신, bit operator를 사용하는 기법. | |
* | |
* Java는 기본적으로 BigEndian이다. | |
* | |
* 참조 | |
* - http://stackoverflow.com/questions/2383265/convert-4-bytes-to-int |
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
/** | |
* 쿼리의 IN 처럼 기준 값을 리스트를 받아서 처리하긴 하지만, 너무 큰 리스트는 | |
* 성능에 부담을 주기 때문에 나눠서 실행해야 할 경우, 자동으로 chunkSize에 따라 | |
* 나눠서 호출해주는 유틸리티. | |
*/ | |
public abstract class ChunkExecutionUtils { | |
public static final int DEFAULT_CHUNK_SIZE = 1000; | |
/** |
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" |
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
/* | |
동영상 파일과 자막 파일의 이름을 맞춰 준다. | |
현재 디렉토리에 동영상 파일과 자막 파일의 갯수가 동일해야 한다. | |
*/ | |
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
<?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
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
#!/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
// 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) { |
OlderNewer