본문 바로가기
[Kotlin] Kotlin 의 숨겨진 비용 #1 [Kotlin] Kotlin 의 숨겨진 비용 #1 https://medium.com/@BladeCoder/exploring-kotlins-hidden-costs-part-1-fbb9935d9b62 -“With great power comes great responsibility” 를 기억해야 한다.( 간단한 코드를 짜는 대신 대가가 있다는 얘기다 ) -Kotlin bytecode inspector 를 사용하면 Kotlin 코드가 어떻게 bytecode 로 변환되는지 볼 수 있다.Android studio plugin 으로 접할 수 있다.이를 보면 primitive type 의 boxing, code 에서 보이지 않는 기타 object 들의 instantiation, 그리고 각종 추가 method 들의 추.. 2018. 1. 16.
[Java] Jit Compiler 에 대한 이야기 [Java] Jit Compiler 에 대한 이야기 http://blog.takipi.com/java-on-steroids-5-super-useful-jit-optimization-techniques/ -bytecode 는 original Java 코드를 그대로(dynamic optimization 없이) 나타낸 것이라고 보면 된다.JVM 이 bytecode 를 Assembly로 변환할 때 2가지 mode 가 작동한다. 1.Interpreted mode : JVM 이 bytecode 를 읽고 실행시킨다.2. Compiled mode(byte code to assembly) 이 두가지 mode 를 잇는 것이 JIT compiler 이다. Interpreted mode 가 assembly level 로 최적.. 2018. 1. 14.
[도서 목차 정리] Kotlin in action [도서 목차 정리] Kotlin in action Kotlin in action 을 공부하면서 정리한 내용입니다.Java 를 어느 정도 이해하고 숙달한 사람들이 이해하기 좋습니다.Java 와 동일하거나 너무 당연한 기본적인 내용은 정리하지 않았습니다. Kotlin 소개 - Kotlin : what and why Kotlin 기초 #1 - Chap2. Kotlin basics Kotlin 기초 #2 - Chap2. Kotlin basics 함수 정의하고 호출하기 #1 - Chap 3. Defining and calling functions 함수 정의하고 호출하기 #2 클래스, objects, 그리고 인터페이스 #1 - Chap4. Classes, objects, and interfaces 클래스, obje.. 2017. 9. 25.
[Kotlin Tutorial] 한 차원 높은 함수 : 람다를 parameter 와 return value 로 - Chap8. Higher-order functions: lambdas as parameters and return values [Kotlin Tutorial] 한 차원 높은 함수 : 람다를 parameter 와 return value 로 - Chap8. Higher-order functions: lambdas as parameters and return values 참조 : Kotlin in action 8.1. Declaring higher-order functions -Higher-order function 이란 argument 와 return 으로 다른 function 을 갖는 것을 의미한다.Kotlin 에서는 function 이 lambda 나 function reference 로 표시된다. 8.1.1. Function types -val sum = { x:Int, y:Int -> x+y }val action = { pr.. 2017. 8. 31.
[Kotlin Tutorial] Operator overload 와 convention #2 [Kotlin Tutorial] Operator overload 와 convention #2 출처 : Kotlin in action 7.3. Destructuring declarations and component functions -val p = Point(10, 20)val (x, y) = p // destructuringprintln(x)println(y) -destructuring 도 convention 을 사용한다.componentN 이 호출된다. ( N 은 숫자 )val (a, b) = p // val a = p.component1()// val b = p.component2() -data class 는 compiler 가 primaryConstructor 에 정의된 모든 property 에 .. 2017. 8. 29.
[Kotlin Tutorial] Operator overload 와 convention #1 - Chap7. Operator overloading and other conventions [Kotlin Tutorial] Operator overload 와 convention #1 - Chap7. Operator overloading and other conventions 참조 : Kotlin in action -Java 에는 특정 class 에 결속되어 있는 언어적 기능이 있다.예를 들어 Iterable 를 구현하면 for loop 에서 쓸 수 있고, AutoCloseable 을 구현하면 try-with-resources 에서 사용할 수 있다. Kotlin 도 비슷한 것들이 있다.그러나 specific type 에 결속된 것이 아니라 specific name 에 결속되는 기능들이 있다.예를 들어 plus 라는 이름으로 class 에 function 을 추가하면, + operator 를 해.. 2017. 8. 24.
[android] flood fill algorithm performance tests. android, flood fill algorithm performance tests. 위와 같은 공룡의 엉덩이, 발, 그리고 꼬리에 이르는 부분을 FloodFill algorithm 을 적용하여 색칠해보았다.avg 값은 5회의 결과를 평균 낸 값이다. 1. Very Intuitive and Simple Flood Fill Algorithm Recursive method call 을 이용하여, 한 점을 기준으로 동,서,남,북 pixel 에 대해 recursive call 을 호출하는 방식이다. private void floodFill3(Bitmap bitmap, Point fillStartPoint, int targetColor, int replacementColor){Queue queue = new L.. 2014. 4. 11.
[android] JavaScript Bridge android, JavaScript Bridge JavaScript Bridge 하이브리드 앱을 만들 때 사용되는 방식으로, HTML 에서 어떤 function call 을 하면 android webview 에서 catch 가능하다. WebView.setJavaScriptEnabled( true );WebView.addJavascriptInterface( new MyBridge(), "AppInterface" ); private class MyBridge{public void functionName( String arg ){// do sth..}} function callAndroidFunction(){window.AppInterface.functionName();} 반대로 App 에서 JavaScrip.. 2014. 3. 17.
[VB6] 다른 Form 으로 값 넘기기 다른 Form 으로 값 넘기기 VB6 프로그램의 규모가 커지게 되면, 하나의 Form 으로 모든 것을 해결하지 못하는 경우가 많아진다.이럴 경우는 Form 을 여러개 생성하면서 메인 Form 에서 다루기 힘든 UI 들을Sub Form 에 생성하여 그곳에서 처리하게 하는 경우가 생긴다. 이 때 필요에 따라서 Main Form 에서 Sub Form 으로 값을 넘겨야 하는 경우가 생기는데,그 방법에 대해 알아본다. 먼저 전달받는 값을 저장한 변수를 정의하고,값 전달을 위해 사용될 public 함수를 만든다. Private passedVar As String Public Sub PassVar(newPassedValue As String) passedVar = newPassedValueEnd Sub 사실 Enca.. 2013. 6. 17.
반응형