Archive

Archive for the ‘JAVA’ Category

SVN Tagging.

February 14, 2011 Leave a comment

Tagging을 하기 위해선 release 된 버젼이 있어야한다.

릴리즈된 버젼은 당연히 버젼명에서 “SNAPSHOT” 딱지를 뗀 상태를 이야기한다.


$ svn ci 

$ ls

tags   trunk

$ svn cp /trunk/ tags/PROJECT-NAME_VERSION

 

1. Release 버젼을 commit한다.

2. Release 버젼을 tags 폴더 밑으로 “svn cp”한다.

3. 이후 trunk의 버전에  “SNAPSHOT”를 추가하여 (버전)업하면된다.
(예: 1.0-alpha-1 => 1.0-alpha-2-SNAPSHOT)

4. 필요에 따라 tags 폴더의 “svn up”를 수행한다.

Categories: JAVA Tags: , ,

java.lang.InstantiationError

February 10, 2011 Leave a comment

public class InstantiationError
extends IncompatibleClassChangeError

Thrown when an application tries to use the Java new construct to instantiate an abstract class or an interface.
Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

Since: JDK1.0
See Also: Serialized Form

Categories: JAVA Tags:

Two NetBeans Keyboard Shortcuts That Will Change Your Life (Forever)

January 28, 2011 1 comment

ctrl + ;
ctrl + shift + ;

That’s all.

Detail – Two NetBeans Keyboard Shortcuts That Will Change Your Life (Forever)

try also “shift + enter”.

Categories: JAVA, Tip Tags: , ,

TestNG – Test Class Life cycle

January 26, 2011 1 comment

 

TestNG를 사용하면 테스트 메소드 외의 것들을 지정할 수 있다; @Configuration어노테이션을 사용하여 클래스 안에 설정 메소드라고 하는 특정 메소드를 지정할 수 있다. 다음은 네 가지 유형의 설정 메소드들이다:

  • beforeTestClass 메소드 : 테스트 메소드가 실행되기 전, 클래스가 인스턴스로 된 후에 실행된다.
  • afterTestClass 메소드 : 클래스의 모든 테스트 메소드가 실행된 후 이 메소드가 실행된다.
  • beforeTestMethod 메소드 : 클래스의 모든 테스트 메소드가 실행되기 전에 이 메소드가 실행된다.
  • afterTestMethod 메소드 : 클래스의 모든 테스트 메소드들이 실행된 후 이 메소드가 실행된다.

그림 2는 테스트 클래스의 수명주기 이다.

 
그림 2. 테스트 클래스 수명주기

Lifecycle of a test class

발취 : http://www.ibm.com/developerworks/kr/library/j-testng/

 

Categories: JAVA Tags: , ,

Make it work and then make it fast.

January 26, 2011 Leave a comment
Categories: JAVA, Memo

RTSP URI scheme for DVB services in a MPEG-2 TS delivered over IP sessions controlled by RTSP

January 19, 2011 Leave a comment

A.2
RTSP URI scheme for DVB services in a MPEG-2TS delivered over IP sessions controlled by RTSP


The RTSP URI as defined in RFC2326 [12] is extended in order to reference specific components (e.g. services,program events) in a MPEG-2 transport stream delivered over IP and controlled by RTSP [12].
The URI scheme is defined as follows:

rtsp_URL  =   ( "rtsp:" | "rtspu:" )
                 "//" host [ ":" port ] [ abs_path ]
   host      =   <A legal Internet host domain name of IP address
                 (in dotted decimal form), as defined by Section 2.1

 

Protocol suite: TCP/IP.
Protocol type: Application layer protocol.
Port: 554 (TCP, UDP).
URI: rtsp:
SNMP MIBs:
Working groups: mmusic, Multiparty Multimedia Session Control.
Links:

RFC 2326:

 

https://docs.google.com/viewer?url=http://www.dvb.org/technology/standards/a106_BCG-over-IP_dTS_102539v010301.pdf&pli=1

http://www.networksorcery.com/enp/protocol/rtsp.htm

 

Categories: IPTV Tags: , ,

Get DvbLocator(DVB Locator) from XletContext(Xlet context)

January 19, 2011 Leave a comment

ServiceContext sc = ServiceContextFactory.getInstance().getServiceContext(xletcontext);
Service current=sc.getService();
System.out.println("Service: "+ current.toString());
DvbLocator locator = (DvbLocator) sc.getService().getLocator();
Categories: IPTV Tags: , ,

Singleton pattern

January 13, 2011 Leave a comment

The solution of Bill Pugh
University of Maryland Computer Science researcher Bill Pugh has written about the code issues underlying the Singleton pattern when implemented in Java.[8] Pugh’s efforts on the “Double-checked locking” idiom led to changes in the Java memory model in Java 5 and to what is generally regarded as the standard method to implement Singletons in Java. The technique known as the initialization on demand holder idiom, is as lazy as possible, and works in all known versions of Java. It takes advantage of language guarantees about class initialization, and will therefore work correctly in all Java-compliant compilers and virtual machines.

The nested class is referenced no earlier (and therefore loaded no earlier by the class loader) than the moment that getInstance() is called. Thus, this solution is thread-safe without requiring special language constructs (i.e. volatile or synchronized).

public class Singleton {
 
   // Private constructor prevents instantiation from other classes
   // (외부에서 인스턴스 생성을 막기 위함)
   private Singleton() {
      super();
   }
 
   /**
    * SingletonHolder is loaded on the first execution of Singleton.getInstance() 
    * or the first access to SingletonHolder.INSTANCE, not before.
    */
   private static class SingletonHolder { 
     public static final Singleton INSTANCE = new Singleton();
   }
 
   public static Singleton getInstance() {
     return SingletonHolder.INSTANCE;
   }
 
 }

참고: Wikipedia Link

Categories: JAVA

jni for android with ndk

January 13, 2011 Leave a comment

android 에서 native application 을 이용하기 위해서는 다음과 같은 과정을 거치면 된다.

링크

Categories: Android

Collection To Enumeration

January 7, 2011 Leave a comment

List<String> list = new ArrayList<String>();
for (int i = 0; i < 5; i++) {
    list.add(i + "");
}

System.out.println("use for() loop");</pre>
for (String value : list) {
 System.out.println(value);
}

Enumeration<String> enumeredList = Collections.enumeration(list);
System.out.println("use while() loop"); while (enumeredList.hasMoreElements()) {
 System.out.println(enumeredList.nextElement());
}

Categories: JAVA
Design a site like this with WordPress.com
Get started