개발공부

    [Kotlin] 코루틴 Coroutine  - async와 await, LifecycleScope과 ViewModelScope 사용법 및 사용예제- 4편

    [Kotlin] 코루틴 Coroutine - async와 await, LifecycleScope과 ViewModelScope 사용법 및 사용예제- 4편

    [Kotlin] 코루틴 Coroutine - async와 await, LifecycleScope과 ViewModelScope 사용법 및 사용예제- 4편 저번 포스트에서는 coroutine에서 join, repeat, cancel, withTimeout을 사용하는 법을 배웠습니다. 이번 포스트에서는 Async와 await을 활용하여 여러 작업을 동시에 하고 값을 접근하는 법을 배우도록 하겠습니다. 그리고 GlobalScope 말고도 lifeCycleScope , ViewModelScope을 이용한 예제를 다뤄보도록 하겠습니다. 이전 포스트: [Kotlin] 코루틴 Coroutine 제어하기 -Join, repeat,cancel,withTimeout - 3편 [Kotlin] 코 루틴 Coroutine 사용법..

    [Kotlin] 코루틴 Coroutine 제어하기 -Join, repeat,cancel,withTimeout - 3편

    [Kotlin] 코루틴 Coroutine 제어하기 -Join, repeat,cancel,withTimeout - 3편

    [Kotlin] 코 루틴 Coroutine 사용법 및 개념 정리 -Join, repeat, Cancel,withTimeout - 3편 전 포스트에서는 runblocking을 다뤄보았는데요 join, repeat을 쓰기 위해서 runBlocking을 아셔야 하기 때문에 모르신다면 보고 오시는 것을 추천합니다. [Kotlin] 코루틴 Coroutine 사용법 - runBlocking - 2편 [Kotlin] 코루틴 Coroutine 사용법 및 개념 정리 - runBlocking - 2편 [Kotlin] 코 루틴 Coroutine 사용법 및 개념 정리 - runBlocking - 2편 runBlocking 저번 포스트에서 GlobalScope안에 썼었던 delay는 main Thread를 멈추지 않는 걸 확인..

    [Kotlin] 코루틴 Coroutine 사용법 - runBlocking 사용법 및 예제 - 2편

    [Kotlin] 코루틴 Coroutine 사용법 및 개념 정리 - runBlocking - 2편 이전 포스트:[Kotlin] 코루틴 Coroutine 사용법 및 개념 정리 - GlobalScope, Delay, Dispatcher, Coroutine Context - 1편 [Kotlin] 코루틴 Coroutine 사용법 및 개념 정리 - GlobalScope, Delay, Dispatcher, Coroutine Context - 1편 [Kotlin] 코루틴 Coroutine 사용법 및 개념 정리 - GlobalScope, Delay, Dispatcher, Coroutine Context - 1편 Coroutine 개념 Coroutine은 다양한 테스크를 진행할 때 필요한 요소입니다. 스레드(T.. und..

    [Kotlin] LeetCode: Intersection of Two Arrays IISolution 풀이

    [Kotlin] LeetCode: Intersection of Two Arrays IISolution 풀이

    문제 Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear as many times as it shows in both arrays and you may return the result in any order. nums1과 nums2 에서 겹치는 원소를 모아서 intArray로 반환해야 합니다. 예시 풀이 class Solution { fun intersect(nums1: IntArray, nums2: IntArray): IntArray? { //기본값들을 initialize 해줍니다 val list: MutableList = ArrayList(..