Kotlin
-
Introduction to Kotlin coroutinesKotlin 2019. 10. 10. 21:39
https://tv.naver.com/v/10353853?fbclid=IwAR0pxy6bkT_WUBUI_pbu9eQ8sPgHiT2j5ibTp-nQxZ-BJk1JnFXbYHFMMno Introduction to Kotlin coroutines NAVER Engineering | 발표자: Svetlana Isakova (JetBrains, Kotlin in Action 도서의 공동저자) 발표월: 2019.8 Introduction to Kotlin coroutines - Kotlin 개발자를 대상으로 Kotlin coroutines에 대하여 설명합니다. tv.naver.com https://www.slideshare.net/NaverEngineering/introduction-to-kotlin-corouti..
-
lateinit / lazy 의 차이점Kotlin 2019. 10. 4. 21:07
lateinit - var 변수에서만 사용합니다. - null 값으로 초기화 할 수 없습니다. - 초기화 전에는 변수를 사용할 수 없습니다 - Int, Long, Double, Float (primitive type) 에는 사용할 수 없습니다. - 변수에 대한 setter/getter properties 정의가 불가능합니다. lazy - val 에서만 사용합니다. - 호출 시점에 by lazy 정의에 의해서 초기화를 진행합니다. - 초기화를 위해서는 함수명이라도 한번 적어줘야 합니다. - lazy을 사용하는 경우 기본 Synchronized로 동작합니다. [참고링크] https://thdev.tech/kotlin/2018/03/25/Kotlin-lateinit-lazy/ Kotlin lazy proper..
-
Exercism - Diamond(with.Kotlin)문제풀이/Exercism 2019. 8. 27. 09:48
[Instructions] The diamond kata takes as its input a letter, and outputs it in a diamond shape. Given a letter, it prints a diamond starting with 'A', with the supplied letter at the widest point. Requirements The first row contains one 'A'. The last row contains one 'A'. All rows, except the first and last, have exactly two identical letters. All rows have as many trailing spaces as leading spa..
-
Exercism - Largest Series Product (With.Kotlin)문제풀이/Exercism 2019. 8. 21. 20:51
[Instructions] Given a string of digits, calculate the largest product for a contiguous substring of digits of length n. For example, for the input '1027839564', the largest product for a series of 3 digits is 270 (9 * 5 * 6), and the largest product for a series of 5 digits is 7560 (7 * 8 * 3 * 9 * 5). Note that these series are only required to occupy adjacent positions in the input; the digit..
-
Exercism - Luhn(with.Kotlin)문제풀이/Exercism 2019. 8. 19. 14:34
[Instructions] Given a number determine whether or not it is valid per the Luhn formula. The Luhn algorithm is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers and Canadian Social Insurance Numbers. The task is to check if a given string is valid. Validating a Number Strings of length 1 or less are not valid. Spaces are allowed in the in..
-
Exercism - Acronym(with.Kotlin)문제풀이/Exercism 2019. 8. 19. 00:37
[문제] Convert a phrase to its acronym. Techies love their TLA (Three Letter Acronyms)! Help generate some jargon by writing a program that converts a long name like Portable Network Graphics to its acronym (PNG). [Solution1] object Acronym { fun generate(phrase : String) : String{ val strList = phrase.replace("-", " ").split(" ").filter { it.isNotEmpty() } val expected = CharArray(strList.size) s..
-
Exercism - Perfect Numbers(with.Kotlin)문제풀이/Exercism 2019. 8. 17. 00:03
[문제] Determine if a number is perfect, abundant, or deficient based on Nicomachus' (60 - 120 CE) classification scheme for natural numbers. The Greek mathematician Nicomachus devised a classification scheme for natural numbers, identifying each as belonging uniquely to the categories of perfect, abundant, or deficient based on their aliquot sum. The aliquot sum is defined as the sum of the facto..
-
Exercism - Difference Of Squares(with.Kotlin)문제풀이/Exercism 2019. 8. 6. 12:31
[문제] Find the difference between the square of the sum and the sum of the squares of the first N natural numbers. The square of the sum of the first ten natural numbers is (1 + 2 + ... + 10)² = 55² = 3025. The sum of the squares of the first ten natural numbers is 1² + 2² + ... + 10² = 385. Hence the difference between the square of the sum of the first ten natural numbers and the sum of the squ..
-
e: [kapt] An exception occurred: java.lang.NullPointerExceptionAndroid/Error 2019. 8. 1. 22:19
e: [kapt] An exception occurred: java.lang.NullPointerException 라는 문제가 컴파일중 발생했을때 Build.gradle 에서 해당 부분을 수정 [수정전] kapt "com.android.databinding:compiler:3.1.4" [수정후] annotationProcessor 'com.android.databinding:compiler:3.1.4' kapt 를 annotationProcessor 로 수정 해주면 된다고 한다. [참고 링크] https://qiita.com/hisakioomae/items/1b6a4f7679d3c9af9faa プログラマの技術情報共有サービス - Qiita Qiitaは、プログラマのための技術情報共有サービスです。 プログラミング..
-
Exercism - Scrabble Score (With.Kotlin)문제풀이/Exercism 2019. 7. 30. 14:35
[문제] Given a word, compute the scrabble score for that word. Letter Values You'll need these: Letter : Value A, E, I, O, U, L, N, R, S, T : 1 D, G : 2 B, C, M, P : 3 F, H, V, W, Y : 4 K : 5 J, X : 8 Q, Z : 10 Examples "cabbage" should be scored as worth 14 points: 3 points for C 1 point for A, twice 3 points for B, twice 2 points for G 1 point for E And to total: 3 + 2*1 + 2*3 + 2 + 1 = 3 + 2 + ..