본문 바로가기
[Map] HashMap vs. TreeMap vs. LinkedHashMap [Map] HashMap vs. TreeMap vs. LinkedHashMap -HashMap Key 는 equals 와 hashCode 가 구현되어 있어야 한다. O(1) time complexity -TreeMap ( SortedMap ) Key 가 Red-black tree structure 를 사용하여 ordering 되어 있는 형태의 Map Key 가 Comparable 을 구현해야 한다. 그래야 tree 에서 비교를 할테니... ( 참고로 String 은 Comparable 하다 ) Key 가 정렬되어 있다는 의미는 keys() 나 entrySet() 을 가지고 왔을 때, Comparable.compare 에 의한 정렬결과 순으로 collection 이 구성된다는 것이다. Tree 를 사용했다.. 2019. 1. 11.
[android] 최고의 안드로이드 개발 원칙 [android] 최고의 안드로이드 개발 원칙 https://medium.freecodecamp.com/android-development-best-practices-83c94b027fd3#.fkhdpa3m0cf) 현재 제가 잘 못 하고 있는 것을 빨간 색 마킹 했습니다. ( 결론은 test 군요.. ) -Google 이 추천하는 Android architecture 를 사용하라. -코드 퀄리티를 항상 좋게 유지하라. -Unit test 를 항상 포함하라. JVM 에서 돌 수 있는 Java 코드들은 단말 위에서 테스트하는 것보다 훨씬 빠르다. Android dependency 가 있는 코드들은 Robolectric 을 사용하는 것을 추천한다. Mockito 도 좋다. -Functional UI test .. 2018. 3. 7.
[ios] 32bit, 64bit 이야기 [ios] 32bit, 64bit 이야기 https://developer.xamarin.com/guides/cross-platform/macios/32-and-64/ -전통적인 iOS 는 원래 완전히 32bit 였다.그러나 최근의 iOS 는 모두 64bit 을 지원한다. -64bit 를 사용한다는 것은 사용 가능한 memory space 를 확장한다는 의미 이외에도더 좋은 performance 를 낼 수 있다는 장점도 있다. -32bit only application 은 32bit, 64bit iOS device 모두에서 작동한다. -32bit, 64bit application 은 32bit, 64bit code 모두를 가지고 있다.그래서 시스템이 어떤 녀석을 작동시킬지 결정해서 수행한다. -64bit .. 2018. 2. 18.
[Kotlin] Kotlin 의 숨겨진 비용 #2 [Kotlin] Kotlin 의 숨겨진 비용 #2 https://medium.com/@BladeCoder/exploring-kotlins-hidden-costs-part-2-324a4a50b70 Local functions -local function 의 limit 은 inline 으로 정의될 수 없다는 것 ( 글 쓴 당시까지는, 현재버전에서 꼭 체크해보라 ).그리고 local function 을 가지고 있는 녀석도 inline 이 될 수 없다.fun someMth(a: Int): Int { fun sumSquare(b: Int) = (a+b) * (a+b) return sumSquare(1) + sumSqaure(2)} local function 은 Function object 로 바뀐다.public .. 2018. 1. 17.
[ios/reference] Setting Up Layer Objects [ios/reference] Setting Up Layer Objects https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreAnimation_guide/SettingUpLayerObjects/SettingUpLayerObjects.html#//apple_ref/doc/uid/TP40004514-CH13-SW12 -iOS 앱에서 Core Animation 은 항상 enable 되어 있고, 모든 view 는 layer 가 backed 되어 있다.OS X 는 Core Animation 을 명시적으로 enable 시켜야 한다. -Layer-backed view 는 CALayer 를 기본으로 만든다.그러나 상황에 따라 다른 Lay.. 2017. 11. 21.
[Kotlin] Kotlin 은 Compile time 이 느리다는데.. 사실일까? [Kotlin] Kotlin 은 Compile time 이 느리다는데.. 사실일까? https://medium.com/keepsafe-engineering/kotlin-vs-java-compilation-speed-e6c174b39b5d -위 글을 쓴 필자는 Java base 로 되어 있는 출시된 앱을 전부 Kotlin 으로 전환하여 자신만의 Compile time 을 측정해보았다. -테스트 환경 및 조건 #1 빌드는 총 10번 연속으로 돌려서 평균값 산출Hardware 는 i7-6000 3.4GHz, 32G DDR4, Samsung 850 Pro SSD, Gradle 2.14.1 빌드시마다 매번 clean build or notGradle daemon 사용 or not코드 변경 유무 -Clean bui.. 2017. 9. 26.
[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 #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.
[Kotlin Tutorial] Kotlin 소개 - Kotlin : what and why [Kotlin Tutorial] Kotlin 소개 - Kotlin : what and why 참조 : Kotlin in Action -Kotlin 은 Java platform 을 targeting 한 새로운 프로그래밍 언어.Java 코드와 함께 쓰일 수 있다.Android 개발 뿐만 아니라 Server-side 개발에도 쓰일 수 있다. -Java 의 iib, framework 와 함께 쓰일 수 있고, Java 와 비교해 Performance 도 거의 동일하다. 1.1. A Taste of Kotlin -http://try.kotl.in 을 통해 코드 실습을 할 수 있다. -data class Person(val name: String, val age: Int? = null) fun main(args: A.. 2017. 7. 12.
반응형