일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- Python
- hbase
- UK
- Italy
- Book review
- France
- programming_book
- Software Engineering
- web
- management
- django
- management and leadership
- Kuala Lumpur
- QT
- Linux
- hadoop
- leadership
- Book
- Spain
- agile
- program
- history
- ubuntu
- Programming
- erlang
- Malaysia
- Java
- comic agile
- RFID
- MySQL
- Today
- Total
목록Programming/Java (38)
//http://programmingexamples.wikidot.com/threadpoolexecutor import java.util.concurrent.*; import java.util.*; class TestThreadPoolExecutor { intpoolSize = 2; intmaxPoolSize = 2; longkeepAliveTime = 10; ThreadPoolExecutorthreadPool = null; final ArrayBlockingQueue queue = new ArrayBlockingQueue(5); public TestThreadPoolExecutor() { threadPool = new ThreadPoolExecutor(poolSize, maxPoolSize, keepA..
instrumentation interface를 이용하는 MemoryCounter의 후속 버전. 아직 jar, javaagent 사용 방법을 몰라 실행해보지는 못했음 -_-; //http://www.javaspecialists.eu/archive/Issue142.html package eu.javaspecialists.tjsn.memory; import java.lang.instrument.Instrumentation; import java.lang.reflect.*; import java.util.*; public class MemoryCounterAgent { private static Instrumentation instrumentation; /** Initializes agent */ public..
//http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html //http://www.javamex.com/classmexer //source 비공개, agent 방식으로 동작 //http://www.vogella.de/articles/JavaPerformance/article.html#runtimeinfo_memory //http://www.javapractices.com/topic/TopicAction.do?Id=83 /* 1.Runtime의 gc()는 API document의 다음 문장을 보면 The method System.gc() is the conventional and convenient means of invoking this m..
//http://www.javaspecialists.eu/archive/Issue078.html import java.lang.reflect.*; import java.util.*; /** * This class can estimate how much memory an Object uses. It is * fairly accurate for JDK 1.4.2. It is based on the newsletter #29. */ public final class MemoryCounter { private static final MemorySizes sizes = new MemorySizes(); private final Map visited = new IdentityHashMap(); private fin..
http://blog.naver.com/PostView.nhn?blogId=kimhw9999&logNo=90063726507&viewDate=¤tPage=1&listtype=0 import java.util.*; public class TestSortSetAndMap { public static void main(final String[] args) { System.out.println("==========\tset sorting by value"); Setset=new HashSet(); set.add(new String("김삿갓")); set.add(new String("홍길동")); set.add(new String("춘향이")); set.add(new String("이도령")); set..
import java.util.Comparator; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; //http://iilii.egloos.com/4537561 public class TestTreeMapComparator { public static void main(String[] args) { Map>String, IntegerString, IntegerString, IntegerString, IntegerString, IntegerString, IntegerString, In..
import java.text.DecimalFormat; //http://stackoverflow.com/questions/1899138/formatting-strings-in-java //http://www.coderanch.com/t/417160/java/java/cut-double-decimal-point //http://www.javaservice.net/~java/bbs/read.cgi?m=devtip&b=javatip&c=r_p&n=931308733 //http://www.javaservice.net/~java/bbs/read.cgi?m=devtip&b=javatip&c=r_p&n=920434490 //유효숫자의 개수에 따라 소수점 위와 아래의 표현할 수 있는 숫자의 개수가 달라짐 //e.g...
import it.unimi.dsi.fastutil.doubles.Double2IntOpenHashMap; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.math.BigDecimal; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator..
//http://stackoverflow.com/questions/744226/java-reflection-how-to-get-the-name-of-a-variable import java.lang.reflect.Field; public class TestReflect { public int i = 5; public Integer test = 5; public String omghi = "der"; public static String testStatic = "THIS IS STATIC"; public static void main(String[] args) throws IllegalArgumentException, IllegalAccessException { TestReflect t = new Test..
public class TestDebugMode { //http://stackoverflow.com/questions/1109019/determine-if-a-java-application-is-in-debug-mode-in-eclipse //public static void main(String[] args) //{ //System.out.println(System.getProperty("java.vm.info", "")); //} //http://www.rgagnon.com/javadetails/java-detect-if-running-in-debug-mode.html public static void main(String args[]) { boolean isDebug = java.lang.manag..