๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ 87

Java ์ž๋ฐ” List<Integer> ๋ฆฌ์ŠคํŠธ๋ฅผ int[] ๋ฐฐ์—ด๋กœ ๋ฐ”๊พธ๊ธฐ

List ๋ฆฌ์ŠคํŠธ๋ฅผ int[] ๋ฐฐ์—ด๋กœ ๋ฐ”๊พธ๊ธฐ import java.util.*; import java.util.stream.Collectors; class Solution { public int[] solution(int[] progresses, int[] speeds) { List answer = new ArrayList(); ... return answer.stream().mapToInt(i->i).toArray(); } } stream.Collectors๋ฅผ import ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด, mapToInt ๋ฉ”์†Œ๋“œ๋ฅผ ํ†ตํ•ด ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด Integer์˜€๋˜ ๋ฆฌ์ŠคํŠธ๋ฅผ int[] ๋ฐฐ์—ด๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ๋‹ค! ๐Ÿ‘๐Ÿ‘

Java 2021.06.08

์•ˆ๋“œ๋กœ์ด๋“œ ๋ฐ์ดํ„ฐ ๋ฐ”์ธ๋”ฉ(Data Binding) ์‹œ์ž‘ํ•˜๊ธฐ

Data Binding ๋ฐ์ดํ„ฐ ๋ฐ”์ธ๋”ฉ(Data Binding)์„ ์จ์•ผํ•˜๋Š” ์ด์œ  ์•ˆ๋“œ๋กœ์ด๋“œ๋ฅผ ๋ฐฐ์šฐ๋Š” ์ดˆ๊ธฐ์—๋Š” findViewById()๋ฅผ ๋งŽ์ด ์“ด๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ findViewById()๋Š” runtime์‹œ ๋ทฐ์˜ ๊ณ„์ธต์„ ํƒ€๊ณ ํƒ€๊ณ  ๋“ค์–ด๊ฐ€๋Š” ๋น„ํšจ์œจ์ ์ธ ํ•จ์ˆ˜์ด๋‹ค. ๊ฐ„๋‹จํ•œ ์•ฑ์—์„œ๋Š” ์ƒ๊ด€์—†์ง€๋งŒ, ์•ฑ์ด ์ปค์ง€๋ฉด ํšจ์œจ์ด ๋–จ์–ด์ง„๋‹คใ…œใ…œ Data Binding์€ ๊ฐ ๋ ˆ์ด์•„์›ƒ xml๋งˆ๋‹ค binding class๋ฅผ ๋งŒ๋“ ๋‹ค. (activity_main ⇒ ActivityMainBinding) ๊ทธ๋ž˜์„œ binding class๋ฅผ ํ†ตํ•ด ์‰ฝ๊ฒŒ ๋ทฐ์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์–ด์„œ, ์ฝ”๋“œ๋„ ๊ฐ„๊ฒฐํ•ด์ง„๋‹ค. ๋˜ํ•œ, ์š”์ฆ˜ ๋งŽ์ด ์“ฐ๋Š” MVVM ์•„ํ‚คํ…์ณ์—์„œ ์ฃผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค. ๋ฐ์ดํ„ฐ ๋ฐ”์ธ๋”ฉ(Data Binding)์˜ ์žฅ์  findViewById()์˜ ๋น„ํšจ์œจ์„ฑ์„ ๊ฐœ..

Android 2021.06.05

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค Database Inspector์—์„œ DB๊ฐ€ ์•ˆ๋ณด์ผ ๋•Œ

๋ถ„๋ช… ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๊ฐ€ ์กด์žฌํ•จ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ , Database Inspector๋ฅผ ๋ˆ„๋ฅด๋ฉด ์ด๋ ‡๊ฒŒ ๋œฐ ๋•Œ๊ฐ€ ์žˆ๋‹ค. ํ•ด๊ฒฐ๋ฒ• ์•„์ฃผ ๊ฐ„๋‹จํ•จ . . . File -> Invalidate Caches/Restart ๋ฅผ ํ•˜๋ฉด ๋œ๋‹ค!!!!!! ๊ทธ๋Ÿฌ๊ณ  ๋‚˜์„œ ์•ฑ์„ ๋‹ค์‹œ ์‹คํ–‰ํ•˜๋ฉด, DB๊ฐ€ ์ž˜ ๋ณด์ž„!๐Ÿ˜†

Android 2021.06.04

๊ฐ์ฒด ์ง€ํ–ฅ ์ƒํ™œ ์ฒด์กฐ ์›์น™

๐Ÿ™‹‍โ™€๏ธ ๊ฐ์ฒด ์ง€ํ–ฅ ์ƒํ™œ ์ฒด์กฐ ์›์น™ ๊ฐ์ฒด ์ง€ํ–ฅ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ์ž˜ํ•˜๊ธฐ ์œ„ํ•œ 9๊ฐ€์ง€ ์›์น™. ํ•œ ๋ฉ”์„œ๋“œ์— ์˜ค์ง ํ•œ ๋‹จ๊ณ„์˜ ๋“ค์—ฌ ์“ฐ๊ธฐ๋งŒ ํ•œ๋‹ค. else ์˜ˆ์•ฝ์–ด๋ฅผ ์“ฐ์ง€ ์•Š๋Š”๋‹ค. ๋ชจ๋“  ์›์‹œ ๊ฐ’๊ณผ ๋ฌธ์ž์—ด์„ ํฌ์žฅํ•œ๋‹ค. ํ•œ ์ค„์— ์ ์„ ํ•˜๋‚˜๋งŒ ์ฐ๋Š”๋‹ค. ์ค„์—ฌ ์“ฐ์ง€ ์•Š๋Š”๋‹ค(์ถ•์•ฝ ๊ธˆ์ง€). ๋ชจ๋“  ์—”ํ‹ฐํ‹ฐ๋ฅผ ์ž‘๊ฒŒ ์œ ์ง€ํ•œ๋‹ค. 3๊ฐœ ์ด์ƒ์˜ ์ธ์Šคํ„ด์Šค ๋ณ€์ˆ˜๋ฅผ ๊ฐ€์ง„ ํด๋ž˜์Šค๋ฅผ ์“ฐ์ง€ ์•Š๋Š”๋‹ค. ์ผ๊ธ‰ ์ปฌ๋ ‰์…˜์„ ์“ด๋‹ค. getter/setter/ํ”„๋กœํผํ‹ฐ๋ฅผ ์“ฐ์ง€ ์•Š๋Š”๋‹ค. ์ถœ์ฒ˜ ์†ŒํŠธ์›์Šค ์•ค์†”๋Ÿฌ์ง€

Java 2021.05.31

์•ˆ๋“œ๋กœ์ด๋“œ ์ŠคํŠœ๋””์˜ค ํ”„๋กœ์ ํŠธ Java๋ฅผ Kotlin์œผ๋กœ ๋ณ€ํ™˜ (java kt๋กœ ๋ฐ”๊พธ๊ธฐ)

์‹ ๋‚˜๊ฒŒ ์ž‘์—…ํ•˜๊ณ  ์žˆ๋˜ ์–ด๋Š ๋‚  , , ๋ฌธ๋“ MainActivity๊ฐ€ Java๋กœ ๋˜์–ด์žˆ๋Š” ๊ฑธ ๊นจ๋‹ฌ์•˜๋‹ค. ์•Œ๊ณ  ๋ณด๋‹ˆ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ์‹œ ์ž๋ฐ”๋กœ ๋งŒ๋“ค์—ˆ๋˜ ๊ฒƒ,,,,, ๋‚˜๋จธ์ง€๋Š” ์ฝ”ํ‹€๋ฆฐ์œผ๋กœ ๋‹ค ์ž‘์—…ํ•ด๋†”์„œ ๋‹คํ–‰์ด์—ˆ์ง€๋งŒ, MainActivity๋งŒ Java๋กœ ๋˜์–ด์žˆ์–ด์„œ ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋‚˜ ํ•˜๊ณ  ์žˆ์—ˆ๋Š”๋ฐ, ์—ญ์‹œ ํ‚น๊ฐ“ํ‹€๋ฆฐ...๐Ÿ‘ MainActivity์—์„œ ์šฐํด๋ฆญํ•˜๋ฉด, Convert Java File to Kotlin File ์ด๋ผ๋Š” ๊ธฐ๋Šฅ์ด ์žˆ๋‹ค..! ํŒ์—…์ฐฝ์ด ๋œจ๋Š”๋ฐ ๊ทธ๋ƒฅ OK ๋ˆŒ๋Ÿฌ์ฃผ๋ฉด ๋œ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด ์ž ์‹œ ํ›„... ์•„์ฃผ ๋‚˜์ด์Šค ํ•˜๊ฒŒ ์ฝ”ํ‹€๋ฆฐ์œผ๋กœ ๋ฐ”๋€๋‹ค!!!!!

Android 2021.05.28

Github repository ๊นƒํ—ˆ๋ธŒ ์ €์žฅ์†Œ ์ด๋ฆ„ ๋ณ€๊ฒฝํ•˜๊ธฐ

Github Repository์˜ Settings๋กœ ๋“ค์–ด๊ฐ€์„œ ์ €์žฅ์†Œ ์ด๋ฆ„์„ ๋ณ€๊ฒฝํ•ด์ค€๋‹ค. ์ด์ œ ๋กœ์ปฌ๋กœ ใ„ฑใ„ฑ git remote set-url origin "์ƒˆ๋กœ์šด ์ €์žฅ์†Œ ์ฃผ์†Œ" git remote -v git remote ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์ €์žฅ์†Œ๊ฐ€ ์ž˜ ๋ณ€๊ฒฝ๋๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ์ฐธ๊ณ  https://bitcodic.tistory.com/93

Git 2021.05.27

Plugin [id: 'kotlin-android'] was not found in any of the following sources ์˜ค๋ฅ˜ ํ•ด๊ฒฐ

Plugin [id: 'kotlin-android'] was not found in any of the following sources Plugin [id: 'kotlin-kapt'] was not found in any of the following sources plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' } Room ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์“ฐ๋ ค๊ณ  plugin์— 'kotlin-android'์™€ 'kotlin-kapt'๋ฅผ ์ถ”๊ฐ€ํ•˜๋‹ˆ๊นŒ ์ด์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋‚ฌ๋‹ค.๐Ÿ˜ข ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• Project ๋ ˆ๋ฒจ์˜ Gradle ํŒŒ์ผ๋กœ ๊ฐ„๋‹ค. Gradle ํŒŒ์ผ์— ์ž๊ธฐ์˜ ํ˜„์žฌ ์ฝ”ํ‹€๋ฆฐ ๋ฒ„์ „๊ณผ, classpath๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋œ๋‹ค! buildscript ..

Android 2021.05.23

cmder ์„ค์น˜ ๋ฐ ํ•œ๊ธ€ ์„ค์ •, ์ปจํ…์ŠคํŠธ ๋ฉ”๋‰ด ์ถ”๊ฐ€

1. ๋‹ค์šด๋กœ๋“œ cmder.net/ Cmder | Console Emulator Total portability Carry it with you on a USB stick or in the Cloud, so your settings, aliases and history can go anywhere you go. You will not see that ugly Windows prompt ever again. cmder.net ์—ฌ๊ธฐ ๋“ค์–ด๊ฐ€์„œ ์„ค์น˜ํ•˜๋ฉด ๋œ๋‹ค. ๋‚˜๋Š” mini๋ฒ„์ „์„ ๋‹ค์šด ๋ฐ›์•˜๋‹ค. mini๋ฒ„์ „๊ณผ full ๋ฒ„์ „์˜ ์ฐจ์ด๋Š” git์˜ ์œ ๋ฌด! 2. ์„ค์น˜ ์••์ถ•๋œ ํŒŒ์ผ์ด ๋‹ค์šด๋ฐ›์•„์งˆํ…๋ฐ, ๋‚˜๋Š” c๋“œ๋ผ์ด๋ธŒ์— devํด๋”๋ฅผ ๋งŒ๋“ค์–ด์„œ ์••์ถ• ํ•ด์ œํ–ˆ๋‹ค. ์„ค์น˜ ๊ฒฝ๋กœ์— ํ•œ๊ธ€์ด๋‚˜ ๋„์–ด์“ฐ๊ธฐ๊ฐ€ ์žˆ์œผ๋ฉด ์•ˆ ๋œ๋‹ค๊ณ  ํ•œ๋‹ค. 3. ํ•œ๊ธ€ ์„ค์ •..

Git 2021.04.02

๋…ธ๋งˆ๋“œ์ฝ”๋” ๋ฐ”๋‹๋ผJS ์ฑŒ๋ฆฐ์ง€ 8๊ธฐ ์กธ์—… ํ›„๊ธฐ

โš  ์ด ํ›„๊ธฐ๋Š” ๊ฒŒ์œผ๋ฅธ ์‚ฌ๋žŒ์˜ ์ฑŒ๋ฆฐ์ง€ ์กธ์—… ํ›„๊ธฐ์ž…๋‹ˆ๋‹ค. (ํ•œ์‹ฌํ•˜๊ฒŒ ๋ณด์ง€ ๋ง๊ธฐ๐Ÿ˜ฅ) โš  ๋นก์„ธ์ง€ ์•Š์„๊นŒ, ํž˜๋“ค์ง€ ์•Š์„๊นŒ ๊ฑฑ์ •ํ•˜์‹œ๋Š” ๋ถ„๋“ค์€ ์ œ ํ›„๊ธฐ๋ฅผ ์ฝ๊ณ  ๋„์ „ํ•ด๋ณด์„ธ์š”! ๐Ÿ“š ๋ฐฐ๊ฒฝ์ง€์‹ ์ €๋Š” ์ด๋ฒˆ ์ฑŒ๋ฆฐ์ง€๋ฅผ ํ†ตํ•ด ์ž๋ฐ” ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ฒ˜์Œ ์ ‘ํ–ˆ๊ณ , ๋ฐ”๋‹๋ผ JS ๊ฐ•์˜๋„ ์ฒ˜์Œ ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. (์›๋ž˜ ์ฑŒ๋ฆฐ์ง€๋Š” ๊ฐ•์˜๋ฅผ ๋‹ค ๋“ฃ๊ณ  ๋ณต์Šต์šฉ์œผ๋กœ ์ฐธ์—ฌํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค!) ๊ฑฐ๋‘์ ˆ๋ฏธํ•˜๊ณ , ์ €์ฒ˜๋Ÿผ ์ฑŒ๋ฆฐ์ง€๋ฅผ ํ†ตํ•ด ์ฒ˜์Œ ์ž๋ฐ” ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ ‘ํ•˜์‹œ๋Š” ๋ถ„๋“ค์€ 2์ฃผ ๋™์•ˆ.. ๋นก์…€ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ... ํ• ๋งŒํ•ฉ๋‹ˆ๋‹ค!!!!! (ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ 1๊ฐœ๋ผ๋„ ํ•  ์ค„ ์•„๋Š” ๋ถ„๋“ค, HTML, CSS์— ๋Œ€ํ•œ ์ง€์‹์ด ํฌ๋ฏธํ•˜๊ฒŒ๋ผ๋„ ์žˆ๋Š” ๋ถ„๋“ค ๊ธฐ์ค€์ž…๋‹ˆ๋‹ค. ์ด๊ฑธ๋กœ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ์ฒ˜์Œ ์ ‘ํ•œ๋‹ค๋ฉด ๋งŽ์ด ์–ด๋ ค์šธ ๊ฑฐ์˜ˆ์š”.๐Ÿ˜ญ) ๐Ÿƒ‍โ™€๏ธ ์ฑŒ๋ฆฐ์ง€ ์‹œ์ž‘ ์ฑŒ๋ฆฐ์ง€๋Š” 2์ฃผ ๋™์•ˆ ๋‹จ 1ํšŒ์˜..

Web 2021.03.25