본문 바로가기

Language24

[Kotlin] Generics - 공변성(covariant)과 반공변성(contravariant) What is generic? Generic이란 Class 또는 method에서 매개변수에 사용되는 자료형의 정의를 개체 생성시 정하게 하여 타입에 대한 안정성을 높이는 도구를 말한다. 일반적으로 로 표기된다. Generic 사용의 장점 – Type casting is evitable- typecasting을 하지 않고 객체를 사용할 수 있다. Type safety- Generic allows only single type of object at a time. Compile time safety- 런타임 에러를 방지하기 위해 Generics code는 컴파일 타임에 체크된다. 이런 Generic에서 사용할 수 있는 타입의 범위를 지정하는것이 Type Bound이다. Modern Language들은 대부분.. 2019. 10. 5.
[Sphinx/LaTeX] fncychap package로 pdf 문서 챕터 스타일 변경 Inclusion of the “fncychap” package (which makes fancy chapter titles), default '\usepackage[Bjarne]{fncychap}' for English documentation (this option is slightly customized by Sphinx), '\usepackage[Sonny]{fncychap}' for internationalized docs (because the “Bjarne” style uses numbers spelled out in English). Other “fncychap” styles you can try are “Lenny”, “Glenn”, “Conny”, “Rejne” and “Bjornstr.. 2019. 9. 18.
Kotlin Infix Notation (중위 표기법) infix vs. postfix vs. prefix infix(중위표기법) 일상생활에서의 수식 표기법으로 두 개의 피연산자 사이에 연산자가 존재하는 표현방식이다. ex. X + Y postfix 연산자를 피연산자 뒤에 표시하는 방식이다. 옛날에 계산기 과제 할 때 stack 써서 많이 바꾸던 그 방식! ex. X + Y를 postfix로 변환하면 X Y + prefix 연산자를 피연산자 앞에 표시하는 방식이다. Kotlin에서의 Infix Notaion Kotlin에서 infix 키워드를 사용하여 Infix Notation(중위표기법)으로 함수를 호출할 수 있다. 단, 아래 요건을 충족해야 한다. They must be member functions or extension functions. They m.. 2019. 9. 17.
[Sphinx/LaTeX] Sphinx를 사용하여 한글 pdf 문서 만들기 만들어진 API 문서를 pdf로 변환하거나 별도의 매뉴얼 문서를 pdf로 만들고자 할 때 Sphinx와 LaTeX를 사용하여 쉽게 만들 수 있다. Sphinx를 사용해서 만든 pdf 문서의 예시는 Sphinx 매뉴얼 문서를 참고한다. - https://buildmedia.readthedocs.org/media/pdf/sphinx/stable/sphinx.pdf TeX Live와 같은 LaTeX와 한글 글꼴이 미리 설치되어 있어야 한다. TeX Live, 한글 글꼴 설치 TeX Live 설치 - http://wiki.ktug.org/wiki/wiki.php/TeX%20Live%20%EC%84%A4%EC%B9%98%20%28Windows%29 Naver 나눔글꼴 설치 - https://hangeul.nave.. 2019. 9. 16.