오픈소스 라이센스의 종류

Posted by epicdev Archive : 2013. 2. 12. 13:09

출처: http://www.zdnet.com/blog/burnette/how-to-pick-an-open-source-license-part-2/131


BSD/MIT

Description: The BSD and MIT licenses are two of the oldest and most liberal licenses available. They basically put no restrictions on how the software can be used. These licenses are used by a wide variety of projects including FreeBSD.

Code is protected by copyright? Yes

Code can be used in closed source projects? Yes 

Program that uses (incorporates) the software can be sold commercially? Yes 

Source to bug fixes and modifications must be released? No

Provides explicit patent license? No

ASLv2 (Apache)

Description: The Apache license is only slightly more restrictive than the BSD/MIT licenses. The main thing it adds is some clauses about patent licensing and termination. You should carefully read all the patent clauses in the licenses that have them because they all have subtle differences. All the Apache.org projects use ASL but it's also in wide use outside Apache (for example Google uses it for GWT).

Code is protected by copyright? Yes

Code can be used in closed source projects? Yes 

Program that uses (incorporates) the software can be sold commercially? Yes 

Source to bug fixes and modifications must be released? No

Provides explicit patent license? Yes

GPL (v2)

Description: This is a very common license that allows people to freely use your software as long as they don't charge for it and use the same license for parts of the program that they wrote themselves. The copyright holder is not subject to these restrictions. Widely used, but largely misunderstood. The canonical examples are Linux and MySQL.

Code is protected by copyright? Yes

Code can be used in closed source projects? No* (except by copyright holder)

[*Note: If GPL code is only used in-house, then the answer is Yes. But if someone uses the GPL code in a derived work, and distributes the work, then the answer is No. I'm assuming distribution for this article. -22jun/ebb]

Program that uses (incorporates) the software can be sold commercially? No** (except by copyright holder)

[**Note: If you take "sold" to mean charge for distributing, charge for bundling and packaging, charge for reproducing, charge for support, and charge for indemnification, then the answer is Yes. This is the Linux distributor model. However if by "sold" you mean "paid a fee for a license to use" then the answer is No. Working at a commercial software developer that does charge such fees, the latter definition is most natural to me, so it's the meaning I'm using for this article. -22jun/ebb]

Source to bug fixes and modifications must be released? Yes [if distributed, see above]

Provides explicit patent license? No (but v3 is supposed to address this)

 

LGPL

Description: A derivative of GPL, LGPL includes an exception that is intended to allow code that is released under other licenses to co-exist with and call the LGPL code. However this exception is a bit fuzzy legally as it's currently written, so some businesses shun it. The author of the licenseencourages people not to use it. Personally I think LGPL is a much better choice than GPL for most software, but that a more modern license like EPL is often even better.

Code is protected by copyright? Yes

Code can be used in closed source projects? Yes (maybe)

Program that uses (incorporates) the software can be sold commercially? Yes (maybe)

Source to bug fixes and modifications must be released? Yes [if distributed; see notes under GPL]

Provides explicit patent license? No 

MPL/CDDL

Description: MPL is used by Mozilla, Firefox, and many other projects. CDDL is based on MPL with a few minor tweaks to make it more applicable outside of Mozilla. CDDL is used by many Sun products such as Solaris. It's expected that Java will be open sourced either under the CDDL or (L)GPL. Note that the patent clauses are not palatable to some businesses, so you may want to consider EPL instead.

Code is protected by copyright? Yes

Code can be used in closed source projects? Yes 

Program that uses (incorporates) the software can be sold commercially? Yes 

Source to bug fixes and modifications must be released? Yes [if distributed]

Provides explicit patent license? Yes

 

CPL/EPL

Description: CPL was derived from the old IBM Public License and was also influenced by MPL. CPL was originally used by Eclipse, but that project switched to EPL. CPL is also used by some Microsoft open source projects on SourceForge. EPL is a newer version of CPL with some improvements in its patent language to make it more acceptable to businesses. For example if there's a patent dispute it will only affect the part of the software covered by the patent and not the whole thing.

Code is protected by copyright? Yes

Code can be used in closed source projects? Yes 

Program that uses (incorporates) the software can be sold commercially? Yes 

Source to bug fixes and modifications must be released? Yes [if distributed]

Provides explicit patent license? Yes

  

우분투 창 버튼 오른쪽으로 옮기기

Posted by epicdev Archive : 2012. 12. 22. 03:09

우분투 12.04에서는 아래의 방법처럼 gconf-editor를 사용해서 창의 버튼들을 오른쪽으로 옮길 수가 있었는데

http://www.sudo-juice.com/move-minimize-maximize-and-close-buttons-ubuntu/

12.10부터는 12.04의 방법이 먹히지 않는다.


12.10에서는 터미널에서 다음의 명령을 사용하면 창의 버튼을 오른쪽으로 옮길 수가 있다.

(출처: http://www.davidgranado.com/2012/10/move-window-buttons-to-right-in-ubuntu-12-10/)




  

Function hook 테크닉 (템플릿 메소드 패턴)

Posted by epicdev Archive : 2012. 10. 8. 21:57

오늘은 Function hook 테크닉을 소개하고자 합니다.

테크닉의 명칭은 제가 그냥 이 테크닉을 알게된 코드의 주석에서 따온 거구요, 이 테크닉에 대한 정식 명칭이 있는지는 잘 모르겠습니다.

이 테크닉은 제가 JDK의 HashMap 코드를 보다가 접하게 되었습니다만 사실 예전부터 그냥 인지하지 못하고 가끔씩 사용하던 패턴이었고,

실제로 다른 분들도 많이 사용하시리라 생각합니다.


업데이트 (2013.03.20)

역시나 이 테크닉 또한 디자인 패턴이었군요. 템플릿 메소드 패턴이라고 불리는 디자인 패턴입니다.

자세한 내용은 아래의 링크를 참고하시길...

http://en.wikipedia.org/wiki/Template_method_pattern


우선 제가 접한 코드를 보도록 하겠습니다.



위의 코드에는 HashMap의 생성자들과 init이라는 함수가 있습니다.

init()은 HashMap의 생성자들의 맨 마지막에 호출이 되는 함수입니다.

그런데 이상하게도 init()의 body는 텅 비어있습니다.

텅 비어있는 함수를 왜 생성자 마지막에 호출하는 것일까요?


init()의 javadoc에는

Initialization hook for subclasses. This method is called in all constructors and pseudo-constructors

라고 적혀있습니다.


즉, 이 init()은 하위 클래스에서 추가적인 초기화 코드가 필요할 경우 init()을 오버라이드해서 사용할 수 있도록 미리 상위 클래스에서 만들어 놓은 함수입니다.

이렇게 하게되면 굳이 하위 클래스에서 모든 생성자를 override해서 초기화 코드를 넣지 않아도 됩니다.

그냥 간단하게 init()이라는 함수만 override해서 초기화코드를 넣으면 되는 것입니다.

이러한 function hook 테크닉은 초기화 코드 뿐만 아니라, 상속 후 기능 확장이 예상되는 부모클래스의 다양한 곳에서 사용 될 수 있습니다.


정리하자면, function hook 테크닉은 어떤 부모 클래스를 만들 때 하위 클래스에서 확장이 필요할 것 같은 부분을 부모 클래스를 설계 할 때 미리 파악해서

하위 클래스가 좀 더 수월하게 부모 클래스를 확장시킬 수 있도록 도와주는 테크닉이라고 할 수 있겠습니다.

'Archive' 카테고리의 다른 글

오픈소스 라이센스의 종류  (0) 2013.02.12
우분투 창 버튼 오른쪽으로 옮기기  (0) 2012.12.22
KAIST 셔틀 for Android  (0) 2012.09.15
Word Cloud 생성기  (0) 2012.09.08
SVN Branch & Merge 헷갈릴 때 참고할만한 글  (0) 2012.09.06
  

KAIST 셔틀 for Android

Posted by epicdev Archive : 2012. 9. 15. 16:35




KAIST의 기숙사 생들을 위한 셔틀버스 App입니다


https://play.google.com/store/apps/details?id=com.epicdevs.kaistshuttle



=====================================================================


카이스트 본원-문지-화암 간 셔틀 시간표 앱입니다.

위젯으로 간단하게 버스 시간을 체크할 수 있고

알람으로 버스 도착 시간을 미리 알려줍니다.


[주요 기능]

- 본원-문지-화암 간 셔틀 시간표 탑재

- 다음 배차까지 남은 시간 확인 가능

- 위젯을 통해서 간단하게 시간 확인 가능

- 다음 배차시간 알람 기능


[상세 기능]

기본적으로 이 앱은 위젯을 기반으로 동작합니다.

위젯은 3가지 버튼으로 구성되어 있으며, 왼쪽 버튼을 누르면 현재 설정된 출발지의 전체 시간표가 화면에 나타납니다. 가운데 버튼을 누르면 동기화가 작동하여, 실시간으로 남은 시간을 업데이트하게 됩니다. 위젯의 동기화가 작동 중인 경우 설정해 놓은 알람 시간에 맞추어 진동 알람 및 알림창이 뜨게 됩니다. 오른쪽 버튼을 누르면 현재 설정된 출발지에서 다른 출발지로 바뀌게 됩니다.

  

Word Cloud 생성기

Posted by epicdev Archive : 2012. 9. 8. 19:52

Wordle(http://www.wordle.net/)이 한글을 지원하지 않기 때문에, 한글 Word Cloud를 생성하기 위해서 재미삼아 만들어 보았습니다.

GitHub: https://github.com/epicdevs/Word-Cloud


몇시간만에 만든거라서 퀄리티는 그렇게 좋지 않지만, Word Cloud가 어떤식으로 만들어지는지는 파악할 수 있습니다.

Wordle혹은 일반적인 Word cloud를 생성하는 자세한 알고리즘을 알고 싶으시면

아래의 문서와 페이지를 참조하시길 바랍니다

http://static.mrfeinberg.com/bv_ch03.pdf

http://mathematica.stackexchange.com/questions/2334/how-to-create-word-clouds/2360#2360






  

SVN Branch & Merge 헷갈릴 때 참고할만한 글

Posted by epicdev Archive : 2012. 9. 6. 05:28
  

출처: http://www.cyberciti.biz/faq/linux-unix-how-to-find-and-remove-files/


Linux or UNIX - Find and remove file syntax

To remove multiple files such as *.jpg or *.sh with one command find, use

find . -name "FILE-TO-FIND"-exec rm -rf {} \;

OR

find . -type f -name "FILE-TO-FIND" -exec rm -f {} \;

The only difference between above two syntax is that first command can remove directories as well where second command only removes files.

  

Java에서 사용되는 System.out의 경우 default는 console로 지정이 되어있습니다.

System.out은 System클래스의 static instance로써 PrintStream object 입니다.

따라서 이 System.out을 다른 PrintStream으로 바꿔준다면, System.out을 console이 다른 곳에 출력하도록 할 수 있을 것입니다.

만약 System.out을 잔뜩 사용해서 화면에 log를 출력하던 프로그램이 있는데

화면에 출력하는 방식이 아닌 파일로 출력하는 방식으로 바꾸어야 한다면

기존에 사용했던 System.out을 하나하나 파일로 쓰는 코드로 변환할 필요없이

System.out 자체를 다른 PrintStream으로 간단하게 변경하여

기존의 모든 코드를 수정하는 번거로움을 피할 수 있습니다.



위의 코드에서는

System.out은 console로 두고 System.err은 로그파일로 두어서

기본적인 내용은 화면에 출력하고, 중요한 에러들은 로그파일에 출력하도록 한 것입니다.

  

Java의 HashMap에서 key값으로 primitive type은 올 수 없다.

그래서 int가 key값으로 필요하다면 Integer를 대신 사용하게 된다.


그런데 여기에서 짚고 넘어가야 할 점이 하나 있다.

HashMap에서는 key의 hashCode()값을 기준으로 entry를 찾기 때문에

처음 HashMap에 entry를 넣을 때의 key의 hashCode()값과

entry를 불러 올 때의 key의 hashCode()값이 같아야 한다.

그래서 HashMap에 entry를 넣을 때의 Integer의 reference를 유지해야,

나중에 HashMap에서 entry를 불러 올 때 사용할 수 있다라고 생각하기 쉽다.



위의 경우 과연 Integer value는 null일까?

단순히 생각해 봤을때 처음 entry를 넣을 때 Integer 객체를 하나 생성했고

entry를 찾을 때 새로운 Integer 객체를 생성했기 때문에 null값이 나올 것이라고 생각할 수도 있다.

하지만 실제로 해보면 null값이 아니라 30을 값으로 지니는 Integer가 반환된다.


그렇다면 왜 그런 것일까?

이는 Java API의 Integer의 hashCode() 부분을 보면 쉽게 알 수 있다.


hashCode

public int hashCode()
Returns a hash code for this Integer.

Overrides:
hashCode in class Object
Returns:
a hash code value for this object, equal to the primitive int value represented by this Integer object.


즉, Integer의 hashCode()를 호출하면 Integer가 표현하고 있는 primitive int 값을 리턴한다.

Integer를 언제 어디서 얼마나 많이 생성하던지간에, Integer가 표현하는 primitive int값이 같다면 모두 같은 instance를 공유하는것이 된다.

따라서 HashMap에서 Integer를 사용할 때 쓸데없이 많은 생각을 하지 않아도 된다.



위와 같은 HashMap의 사용이 가능한 것도 모두 같은 원리로써 설명이 가능하다.

  

Java transient 키워드에 대해 몰랐던 사실

Posted by epicdev Archive : 2012. 8. 26. 19:10

Java에는 transient라는 키워드가 존재합니다. 예를 들어 아래처럼 클래스의 멤버변수를 선언할 때 붙일 수 있는 키워드입니다.



일반적으로 transient 키워드는 단순히 Java에서 serialization을 할 때, 특정 멤버변수가 serialization이 되는 것을 막는 것이라고 알려져 있습니다.

물론 맞는 말이구요. 그런데 곰곰이 생각해 보면 이게 정말 하나의 프로그래밍 언어에서 키워드로 지정해야할 수준의 중요성을 지니고 있는 것인가? 라는 의문이 들었습니다.


그래서 좀 찾아봤더니 실제로 그런 의견들이 있었습니다.


출처: http://stackoverflow.com/questions/910374/why-does-java-have-transient-variables


Serialization systems other than the native java one can also use this modifier. Hibernate, for instance, will not persist fields marked with either @Transient or the transient modifier. Terracotta as well respects this modifier.

I believe the figurative meaning of the modifier is "this field is for in-memory use only. don't persist or move it outside of this particular VM in any way. Its non-portable". i.e. you can't rely on its value in another VM memory space. Much like volatile means you can't rely on certain memory and thread semantics.


그리고 댓글에는


I think that transient wouldn't be a keyword if it were designed at this time. They'd probably use an annotation


요약을 해보면 이 transient라는 것은 옛날에 Java가 만들어 질 때 만들어 진 키워드입니다.

만약 이러한 기능이 지금에 와서 만들어 졌다면, transient같은 키워드가 아닌 Java 5부터 소개된 Annotation(@)을 활용해서 이러한 것들이 정의되도록 설계를 했을 것입니다. 이것은 volatile같은 키워드에도 똑같이 적용될 수 있습니다.


실제로 이러한 transient나 volatile같은 키워드들은 VM마다 다르게 구현이 되어있기 때문에, JVM이 아닌 다른 VM을 쓸 경우 제대로 동작하지 않을 수도 있다고 합니다.

그래서 결론은, transient를 그냥 단순히 serialization을 방지하는 키워드라고 외우는 것보다는, transient라는 키워드의 본질적인 의미인, 이 멤버 변수는 "메모리 안에서만 사용되어야한다"라는 것을 암시하는 키워드라고 알아두어야 할 것입니다. 그래서 이러한 키워드의 의미를 JVM에서는 serialization이 되지 않도록 구현을 한 것입니다. 다른 VM에서는 어떻게 구현을 하던간에 transient의 본질적인 의미만 어기지 않으면 되는 것입니다.

  
 «이전 1 2 3 4 5 ··· 17  다음»