๋ถ๋ฅ ์ ์ฒด๋ณด๊ธฐ (387) ์ธ๋ค์ผํ ๋ฆฌ์คํธํ [Kotlin Coroutines] @ExperimentalCoroutinesApi kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-experimental-coroutines-api/ ExperimentalCoroutinesApi - kotlinx-coroutines-core ExperimentalCoroutinesApi annotation class ExperimentalCoroutinesApi (source) Marks declarations that are still experimental in coroutines API, which means that the design of the corresponding declarations has open issues which may (or m.. [Design Pattern]Producer-Consumer Pattern ์์ฐ์-์๋น์ ํจํด ๋ฐ์ดํฐ๋ฅผ ์์ฐํ๋ ์ฃผ์ฒด(producer, ์์ฐ์), ๋ฐ์ดํฐ๋ฅผ ์ฒ๋ฆฌํ๋ ์ฃผ์ฒด(consumer, ์๋น์), ๋ฐ์ดํฐ ๋ชฉ๋ก(Channel, buffer ๋ฑ ๋ค์ํ๊ฒ ๋ถ๋ฅด๋๋ผ)์ผ๋ก ๋ถ๋ฆฌ. ๋ฐ์ดํฐ ์์ฑ, ์ฒ๋ฆฌ ๋ถ๋ถ์ ์ค๊ฐ ์ฐ๊ฒฐ ๊ณ ๋ฆฌ๋ฅผ ๋๋ ๊ฒ. ๋ฐ์ดํฐ์ ํ๋ฆ ์์ฐ์ > ๋ฒํผ(๋ฐ์ดํฐ ๋ชฉ๋ก) > ์๋น์ ์์ฐ์๊ฐ ์์ดํ ์ ์์ฐํ๊ณ ๊ฐ ์์ดํ ์ ๋ฒํผ๊ฐ ๊ฐ๋์ฐฐ ๋๊น์ง ๋ฃ๋๋ค. ๋ฒํผ์ ์ฌ์ ๊ณต๊ฐ์ด ์๊ธฐ๋ฉด ์์ฐ์๊ฐ ๋ค์ ์์ดํ ์ ์์ฐํด ๋ฒํผ์ ๋ฃ๋๋ค. ์๋น์๊ฐ ์์ดํ ์ ๋ฒํผ์์ ๊บผ๋ด ์๋นํ๊ณ , ๋ฒํผ์ ์์ดํ ์ด ์์ผ๋ฉด ๋๊ธฐํ๋ค. ๋ฐ์ดํฐ ์์ฐ ์ฃผ์ฒด์ ๋ฐ์ดํฐ ์ฒ๋ฆฌ ์ฃผ์ฒด๋ฅผ ๋ถ๋ฆฌํ๊ธฐ์ ์ฝ๋์ coupling์ ์ค์ธ๋ค. ์์ฐ์๋ ์๋น์์ ๋ํด ์ ๊ฒฝ ์ธ ํ์๊ฐ ์๋ค. ์๋น์๋ ์์ฐ์์ ์ ๊ฒฝ ์ธ ํ์๊ฐ ์๋ค. ๋ฉํฐ์ฐ๋ ๋ ํ์ฉ์ ์ฌ์ฉํ๋ ํจํด.. [Network] 443 80 http ๊ธฐ๋ณธ ํฌํธ : 80 https ๊ธฐ๋ณธ ํฌํธ : 443 johngrib.github.io/wiki/why-http-80-https-443/ http์ ๊ธฐ๋ณธ ํฌํธ๊ฐ 80, https์ ๊ธฐ๋ณธ ํฌํธ๊ฐ 443์ธ ์ด์ ๋ ๋ฌด์์ผ๊น? 80์ ์ฒ์๋ถํฐ ์ง์ , 443์ ๋์ค์ ์์ฒญ์ ๋ฐ์ ๋น ๊ณต๊ฐ์ผ๋ก ์์๋๋ก ๋ฐฐ์ johngrib.github.io ์์ธํ๊ฒ ์๊ฐํด ์ฃผ์ จ๋ค. [SonarQube] SonarQube ์ค์น ๊ทธ๋ฆฌ๊ณ ์ค์น ํ์ธ ์ฐ๋นํํ SonarQube ํํ์ด์ง์์ ๋ค์ด๋ก๋ ํ๋ฉด์์ Community๋ฅผ ์ ํ. Download for free. ZIP ํ์ผ๋ก ๋ค์ด๋ก๋๋ ๊ฒ์ ํ์ธ docs.sonarqube.org/latest/setup/get-started-2-minutes/ Try Out SonarQube | SonarQube Docs From the zip file Download the SonarQube Community Edition zip file. As a non-root user, unzip it, let's say in C:\sonarqube or /opt/sonarqube. As a non-root user, start the SonarQube Server: # On Windows, execute: C:\sonarqube.. [Java] Version ๊ต์ฒด Java 8์์ Java 11๋ก ๊ต์ฒดํด์ผ ํ ํ์๊ฐ ์๊ฒผ๋ค. ํ์ฌ Java ๋ฒ์ ํ์ธ java -version : ์๋ฐ ๋ฒ์ ํ์ธ javac -version : ์๋ฐ ์ปดํ์ผ๋ฌ ๋ฒ์ ํ์ธ ๊ธฐ์กด Java 8 jdk๋ฅผ ๋จ๊ฒจ์ผ ํ ๊น, ๋ง์์ผ ํ ๊น ๊ณ ๋ฏผ ์ข ํ๊ณ . ์ผ๋จ ์ง์ฐ์ง ์๊ณ ๋จ๊ธฐ๊ณ Java 11์ ๋ค์ด๋ก๋ ๋ฐ๊ธฐ๋ก ํ๋ค. Java SE Development Kit 11 ๋ค์ด๋ก๋ ์ค๋ผํด Java Download ํ์ด์ง ๊ฐ์ ๋ด PC Windows OS์ ๋ง๊ฒ Java SE Development Kit 11 ์ ํํด ๋ค์ด๋ก๋๋ฐ์๋ค. ๋ค. ๋์ํฉ๋๋ค. ์ค๋ผํด ๊ณ์ ๋ก๊ทธ์ธ ๋ค์ด๋ก๋ ํ์ธ JDK ์ค์น exe ํ์ผ ์คํ ๋ค์ ์ค์น ์์น ํ์ธ ํ ๋ค์. ์ค์น ์๋ฃ ๊ธฐ๋ค๋ฆผ. ์ค์น ์๋ฃ ํ Close ๋ฒํผ ํด๋ฆญ. ํ๋ฉด ์บก์ณ๋ฅผ.. [Programming] ๋ฉฑ๋ฑ(ๅช็ญ, idempotent) ko.wikipedia.org/wiki/%EB%A9%B1%EB%93%B1%EB%B2%95%EC%B9%99 ๋ฉฑ๋ฑ๋ฒ์น - ์ํค๋ฐฑ๊ณผ, ์ฐ๋ฆฌ ๋ชจ๋์ ๋ฐฑ๊ณผ์ฌ์ ์ํค๋ฐฑ๊ณผ, ์ฐ๋ฆฌ ๋ชจ๋์ ๋ฐฑ๊ณผ์ฌ์ . ๋ฉฑ๋ฑ๋ฒ์น(ๅช็ญๆณๅ) ๋๋ ๋ฉฑ๋ฑ์ฑ(ๅช็ญๆง, ์์ด: idempotent)์ ์ํ์ด๋ ์ ์ฐํ์์ ์ฐ์ฐ์ ํ ์ฑ์ง์ ๋ํ๋ด๋ ๊ฒ์ผ๋ก, ์ฐ์ฐ์ ์ฌ๋ฌ ๋ฒ ์ ์ฉํ๋๋ผ๋ ๊ฒฐ๊ณผ๊ฐ ๋ฌ๋ผ ko.wikipedia.org ๋ฉฑ๋ฑ๋ฒ์น, ๋ฉฑ๋ฑ์ฑ ์ฐ์ฐ์ ์ฌ๋ฌ๋ฒ ์ ์ฉํด๋ ๊ฒฐ๊ณผ๋ ๊ฐ์ ์ฑ์ง ๋ฉฑ๋ฑ์ฑ์ด ์๋ ํจ์๋ ๋ฉฑ๋ฑ ํจ์(idempotent function)๋ผ๊ณ ๋ถ๋ฆ ๋จํญ์ฐ์ฐ ๋จํญ์ฐ์ฐ f, ์ด๋ค ์งํฉ S์ ๋ชจ๋ ์์๋ x f(f(x)) = f(x) ์ดํญ์ฐ์ฐ ์ดํญ์ฐ์ฐ โ , ์ด๋ค ์งํฉ S์ ๋ชจ๋ ์์ x xโ x = x ํ๋ก๊ทธ๋๋ฐ์์ ๋ฉฑ๋ฑ์ฑ ํจ์๋ฅผ ์ฌ๋ฌ๋ฒ ํธ์ถํด.. [Library] Moshi Converter github.com/square/retrofit/tree/master/retrofit-converters/moshi square/retrofit A type-safe HTTP client for Android and the JVM. Contribute to square/retrofit development by creating an account on GitHub. github.com ์์ private fun getRetrofit() = Retrofit.Builder() .baseUrl(BASE_URL) .addConverterFactory(MoshiConverterFactory.create()) .build() Gson ๋ณด๋ค Moshi๊ฐ ๋์ ์ : www.reddit.com/r/androiddev/.. [Java] Class.java public boolean isAssignableFrom(Class<?> cls) java.lang.Class public boolean isAssignableFrom(Class cls) ํด๋น ํด๋์ค(๋๋ ์ธํฐํ์ด์ค)์ Class object ๊ฐ ํ๋ผ๋ฏธํฐ cls(ํด๋์ค ๋๋ ์ธํฐํ์ด์ค) Class์ ๋์ผํ๊ฑฐ๋ cls์ superclass ๋๋ superinterface์ผ ๊ฒฝ์ฐ true๋ฅผ ๋ฐํํ๋ค. ์๋ ๊ฒฝ์ฐ false ๋ฐํ. ์ฆ, ํด๋น ํด๋์ค/์ธํฐํ์ด์ค๊ฐ ๋งค๊ฐ๋ณ์์ ํด๋์ค/์ธํฐํ์ค์ ๊ฐ๊ฑฐ๋, ๋งค๊ฐ๋ณ์์ ํด๋์ค์ ๋ถ๋ชจ ํด๋์ค/์ธํฐํ์ด์ค์ธ์ง ์ฌ๋ถ๋ฅผ ๋ฐํ. {์์ ํด๋์ค}.isAssignableFrom({์์ ํด๋์ค}) -> true {์์ ํด๋์ค}.isAssignableFrom({๋ถ๋ชจ ํด๋์ค}) -> false {๋ถ๋ชจ ํด๋์ค}.isAssignableFrom({์์ ํด๋์ค}) -> fals.. ์ด์ 1 ยทยทยท 45 46 47 48 49 ๋ค์