묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결쉽게 시작하는 쿠버네티스(v1.35)
만약 컨트롤러에 문제가 생기면 어떻게 될까요?
쉽고 재밌는 설명 덕에 재밌게 강의 수강하고 있습니다. 만약 컨트롤러에 문제가 생기면 어떻게 될까요?
-
미해결1:1채팅 만들기(Android + Kotlin + Firebase)
RecyclerView 7분중 GroupieViewHolder 자동입력과 UserItem을 Implement Members하는법을 모르겠어요.
1:1채팅 만들기(Android + Kotlin + Firebase) RecyclerView 7분 ChatListActivity.kt package com.example.chatting_videoimport androidx.appcompat.app.AppCompatActivityimport android.os.Bundleimport kotlinx.android.synthetic.main.activity_chat_list.*class ChatListActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_chat_list) val adapter = GroupAdapter<GroupieViewHolder>오류코드e: C:\Users\MS\AndroidStudioProjects\chatting_video\app\src\main\java\com\example\chatting_video\ChatListActivity.kt: (12, 23): Unresolved reference: GroupAdapterLoginActivity package com.example.chatting_videoimport android.content.Intentimport androidx.appcompat.app.AppCompatActivityimport android.os.Bundleimport android.util.Logimport com.example.chatting_video.Rimport com.google.firebase.auth.FirebaseAuthimport kotlinx.android.synthetic.main.activity_login.*class LoginActivity : AppCompatActivity() { private lateinit var auth: FirebaseAuth private val TAG = LoginActivity::class.java.simpleName override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_login) auth = FirebaseAuth.getInstance() login_button.setOnClickListener { val email = login_email.text.toString() val password = login_password.text.toString() auth.signInWithEmailAndPassword(email, password) .addOnCompleteListener(this) { task -> if (task.isSuccessful) { // Sign in success, update UI with the signed-in user's information Log.d(TAG, "signInWithEmail:success") //데이터베이스에 유저 정보 넣어줘야 합니다. val intent = Intent(this, ChatListActivity::class.java) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK startActivity(intent) } else { // If sign in fails, display a message to the user. Log.w(TAG, "signInWithEmail:failure", task.exception) } } } }}MainActivity package com.example.chatting_videoimport android.content.Intentimport androidx.appcompat.app.AppCompatActivityimport android.os.Bundleimport com.google.firebase.auth.FirebaseAuthimport kotlinx.android.synthetic.main.activity_main.*import android.util.Log as Logimport kotlinx.android.synthetic.main.activity_main.login_button_main as login_button_mainclass MainActivity : AppCompatActivity() { private lateinit var auth: FirebaseAuth // ... // Initialize Firebase Auth private val TAG: String = MainActivity::class.java.simpleName override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) auth = FirebaseAuth.getInstance() join_button.setOnClickListener { val user = hashMapOf( "first" to "Ada", "last" to "Lovelace", "born" to 1815 ) val email = email_area.text.toString() val password = password_area.text.toString() auth.createUserWithEmailAndPassword(email, password) .addOnCompleteListener(this) { task -> if (task.isSuccessful) { // Sign in success, update UI with the signed-in user's information Log.d(TAG, "성공") val uid = FirebaseAuth.getInstance().uid // Create a new user with a first and last name val user = hashMapOf( "first" to "Ada", "last" to "Lovelace", "born" to 1815 ) // Add a new document with a generated ID val intent = Intent(this, ChatListActivity::class.java) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK startActivity(intent) } else { Log.d(TAG, "실패", task.exception) } } } login_button_main.setOnClickListener { val intent = Intent(this, LoginActivity::class.java) startActivity(intent) } } }여기선 성공 실패 코드를 지운게 있어요. 넣으면 오류가 걸려서 지웠어요. // Add a new document with a generated IDdb.collection("users") .add(user) .addOnSuccessListener { documentReference -> Log.d(TAG, "DocumentSnapshot added with ID: ${documentReference.id}") } .addOnFailureListener { e -> Log.w(TAG, "Error adding document", e) }db.이부분이 빨간색이 되었어요. 어떻게 해야하나요? User ackage com.example.chatting_videoclass User(val uid : String, val username : String)UserItem.kt package Modelimport android.content.ClipDataclass UserItem : ClipData.Item<GroupieViewHolder>(){}여기에서는 GroupieViewHolder라는 명령어가 자동입력이 되지 않고 빨간색이 뜹니다. activity_chat_list.xml <?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/recyclerview_list" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ChatListActivity"> <androidx.recyclerview.widget.RecyclerView android:layout_width="344dp" android:layout_height="572dp" android:layout_marginStart="20dp" android:layout_marginLeft="20dp" android:layout_marginTop="40dp" android:layout_marginEnd="20dp" android:layout_marginRight="20dp" android:layout_marginBottom="40dp" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.761" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.632" /></androidx.constraintlayout.widget.ConstraintLayout> 여기서는 app:layoutManager="android.recyckerview.widget.LinearLayoutManager"를 넣었습니다.activity_login.xml <?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#a6d8fe" tools:context=".LoginActivity"> <EditText android:id="@+id/login_email" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="85dp" android:ems="10" android:inputType="textPersonName" android:hint="login_email" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <EditText android:id="@+id/login_password" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dp" android:ems="10" android:inputType="textPersonName" android:hint="login_password" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/login_email" /> <Button android:id="@+id/login_button" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_marginTop="80dp" android:text="login_button" android:background="#fb7606" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/login_password" /></androidx.constraintlayout.widget.ConstraintLayout>activity_main.xml <?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#a6d8fe" tools:context=".MainActivity"> <EditText android:id="@+id/UserName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="85dp" android:ems="10" android:inputType="textPersonName" android:hint="UserName" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.502" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <EditText android:id="@+id/email_area" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dp" android:ems="10" android:inputType="textPersonName" android:hint="email_area" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.497" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/UserName" /> <EditText android:id="@+id/password_area" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dp" android:ems="10" android:inputType="textPersonName" android:hint="password_area" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.502" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/email_area" /> <Button android:id="@+id/join_button" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_marginTop="32dp" android:text="join_button" android:background="#fb7606" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.473" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/password_area" /> <Button android:id="@+id/login_button_main" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_marginTop="36dp" android:text="login_button" android:background="#fb7606" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.473" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/join_button" /></androidx.constraintlayout.widget.ConstraintLayout>message_list_row.xml <?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="80dp"> <TextView android:layout_width="73dp" android:layout_height="26dp" android:layout_margin="20dp" android:text="name" tools:layout_editor_absoluteX="10dp" tools:layout_editor_absoluteY="30dp"> </TextView> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="20dp" android:text="message" tools:layout_editor_absoluteX="130dp" tools:layout_editor_absoluteY="30dp"> </TextView></androidx.constraintlayout.widget.ConstraintLayout>name messagename messagename message 이게 어떻게 뜨는지 궁금해요. video\app\src\main\java\com\example\chatting_video\ChatListActivity.kt: (12, 23): Unresolved reference: GroupAdaptere: C:\Users\MS\AndroidStudioProjects\chatting_video\app\src\main\java\com\example\chatting_video\MainActivity.kt: (36, 13): Unresolved reference: db이런오류들을 어떻게 해결해야 하나요? val adapter = GroupAdapter<GroupieViewHolder>를 인력하면 빨간색으로 떠요자동입력이 안되요. implementation "com.xwray:groupie:$groupie_version" 2.9.0은 어떻게 입력하는 것인가요? 이걸 그대로 입력하면 오류가 떠요. GroupAdapter와 GroupieViewHolder가 입력되는 부분이 없어서 빨간색 오류가 뜨고, 실행이 안되요. 무슨 코드를 추가해야 이것들이 자동 입력이 되나요? 그리고 수업강의하실때 만들었던 원본 파일있으시면 공유가능할까요? 제거랑 비교하면서 코드를 짜려고요.
-
미해결핸즈온 머신러닝 2
2부 강의에 관련하여
안녕하세요! 최근에 머신러닝에 관심이 생겨 공부하하기 시작한 입문자입니다. 강의 너무 잘 듣고 있습니다 :) 다름이아니라 강의 목록을 보니 현재 1부 강의만 업로드된 걸로 알고 있는데, 2부 강의는 언제 업로드 되는지 알 수 있을까요?
-
미해결
이클립스 lombok @getter @setter 오류 질문합니다 ㅠㅠㅠ 제발 도와주세요
lombok 설치하고 import했는데 @ 을 쓰면 outline에 잡히지 않습니다.. 구글링해서 eclipes.init 파일에다가 추가하라는건 다 추가 했어요..이클립스랑 롬복 재설치도 해봤구요.. 왜 안되는건지 모르겠습니다 제발 도와주세요.. 답답합니다.. lombok버전은 1.18.20 입니다
-
미해결윤재성의 Java 기반 Android 9.0(pie) App 개발 기본 1단계
매 강의마다 나오는 gradle싱크
.지금 api30인데요 강의시 마다 나오는 gradle싱크 마추어줘야 하는거 해야 하는 건가요? 저는 implementation 'androidx.appcompat:appcompat:1.2.0' 이렇케 보이는데 똑같이 해야하나요?
-
미해결윤재성의 Java 기반 Android 9.0(pie) App 개발 기본 1단계
강의시 마다 나오는 그레들 싱크 맞추는 부분
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
-
미해결스프링 시큐리티
디버깅 질문입니다!
안녕하세요 수원님! 좋은 강의 항상 감사합니다. 시큐리티가 디버깅을 할때 로그등이 생각보다 자세하게 안뜨는거 같아서 여쭤봅니다. org.springframework.security: debug 위의 옵션말고 log등을 통해 쉽게 디버깅을 해볼 수 있는 방법이 더 있을까요???
-
미해결자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비
runtime error
안녕하세요. 임시반장 문제 푸는 도중 런타임 에러로 채점이 되지 않아서 문의드립니다. 크게 다른거라곤 BufferedReader를 사용하는 것 말고는 없는 거로 예상되고, 이전 문제는 BufferedReader로도 잘 진행이 되었습니다. 확인해주시면 감사드리겠습니다! import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class Main { public void solution(int n, int[][] arr) { int pick = Integer.MIN_VALUE; int people = 0; for(int i=1; i<n+1; i++) { int count = 0; for(int j=1; j<6; j++) { for(int k=1; k<6; k++) { if(arr[i][k] == arr[j][k]) { count ++; break; } } } if(pick < count) { pick = count; people = i; } } System.out.print(people); } public static void main(String[] args) throws IOException { Main T = new Main(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(br.readLine()); int[][] arr = new int[num+1][6]; for(int i=1; i<num+1; i++) { String[] bf = br.readLine().split(" "); for(int j=1; j<6; j++) { arr[i][j] = Integer.parseInt(bf[j-1]); } } T.solution(num, arr); }}
-
해결됨Vue.js 시작하기 - Age of Vue.js
mode 에 history 를 넣었더니, anchor 가 /login 으로 변합니다.
해쉬를 없애기 위해서 다음과 같이 작성하였습니다. var router = new VueRouter({ mode: 'history', // 페이지의 라우팅 정보 routes: [ // 페이지의 개수만큼 객체 개수가 필요하다. { // 페이지의 url path: '/login', // 해당 url 에서 표시될 컴포넌트 component: LoginComponent }, { path: '/main', component: MainComponent } ] }); 그런데 링크가 .../original/path/to/login, .../original/path/to/main 이 되는 것이 아니라 /login, /main 으로 변해버립니다. (앞의 기존 path 가 사라져서 router.html 파일이 아닌 login, main 이라는 존재하지 않는 파일에 접근하게 됩니다.) 따로 서버를 띄운 것은 없고 크롬 브라우저에서 실행하였습니다. 무슨 실수를 한 것일까요? ㅠㅠ
-
미해결[OpenCV] 파이썬 딥러닝 영상처리 프로젝트 - 손흥민을 찾아라!
Unknown데이터들과 face_compare을 사용하지않고 face_distance를 사용하는것은 비효율적인가요?
캠코더를 통한 얼굴인식을 하고 있는데 캠코더에 있는 사진과 인코딩해둔 피클파일과 distance를 비교해서 그 거리가 일정거리 이상이면 unknown으로 구분하려는데 이렇게하는 것이 그냥 face_compare메소드를 하는것보다 인식률이 떨어질까요? 일정거리 이하라면 그 일정거리 이하인 데이터중 가장 짧은거리의 사람으로 인식하게 되구요
-
미해결[개정판] 파이썬 머신러닝 완벽 가이드
개별 관측데이터에 대한 가우시안 커널함수 적용 파트에서 질문
잘 이해가 되지 않는 부분이 있어 질문드립니다. 해당 파트에서 support로 -4에서 4까지의 범위를 200개로 나누는데 범위와 해당 범위를 몇개로 나눌 것인지는 임의로 정하는 것인지, 그리고 왜 해당 범위를 나누어 줘야 하는 것인지 궁금합니다. 또한 norm.pdf에서 pdf가 정규분포의 확률밀도 값을 구하기 위한 메서드가 맞나요?
-
미해결<1만 시간의 법칙> 웹 페이지 제작하기
CSS- 1부
안녕하세요. CSS-1부(9:12)에 나오는 코드를 똑같이 했음에도 아래의 사진과 같이 나오는데 무엇이 문제일까요?
-
미해결[백문이불여일타] 데이터 분석을 위한 기초 SQL
NOT Like Runtime Error
Whether Observation Station 12에서 아래 코드를 실행하면 런타임에러가 뜨는데요 ㅠㅠ 코드는 같아보이는데 무슨 문제일까요?? SELECT DISTINCT city FROM Station WHERE city NOT LIKE 'a%' AND NOT LIKE 'e%' AND NOT LIKE 'i%' AND NOT LIKE 'o%' AND NOT LIKE 'u%' AND NOT LIKE '%a' AND NOT LIKE '%e' AND NOT LIKE '%i' AND NOT LIKE '%o' AND NOT LIKE '%u'
-
미해결실무에서 바로 쓰는 영어 이메일
공식적인 문서라는 것이 어떤건가요??
맺음말에서 공식적인 문서에는 respectfully / Respectully yours, 라는 표현을 사용한다고 말씀 주셨는데요 공식적인 문서라는 것이 어떤거죠?? 공문 같은 것인가요??
-
미해결스프링 핵심 원리 - 기본편
강의와 무관한 질문입니다.
안녕하세요. ^^ 정말 좋은 강의 잘 수강하고있습니다. 추천해주신 '객체지향의 사실과 오해'라는 책도 즐겁게 탐독하고 있습니다. 혹시 스프링배치에 관한 강의도 곧 나오는지 여쭈어도 될가요? 또는 추천해주실만한 자료나 강의 정보를 들을수 있으면 좋겠습니다. 바쁘신 와중에 글 읽어주셔서 감사합니다. 강의 너무 최고입니다. !!!
-
미해결캐글 Advanced 머신러닝 실전 박치기
previous_application 데이터 가공/모델 학습/평가 null값 관련 질문있습니다.
previous_application 데이터 가공/모델 학습/평가-previous_application 주요 피처 EDA 수행 - 연속형 값 분석 8분 23초에 null값이 5000천개인데 의미를 찾기 어렵다고 하셨는데요 혹시 의미 찾기 어렵다는 기준이 따로 있는건가요?
-
미해결팝스타 공식 뮤비 제작 & 유튜브 2천만 뷰 크리에이터의 애니메이트 X 이모티콘 클래스
선택 도구가 이상해요 ㅠㅠ
삭제된 글입니다
-
미해결HTML+CSS+JS 포트폴리오 실전 퍼블리싱(시즌1)
[Part 02] like 버튼 질문입니다
[Part 02] 쇼핑몰 아이템 UI 호버 이펙트 - 세부 HTML 작성 및 상세 CSS 디자인 31분에서 .like에 왜 굳이 가상클래스 before을 쓴건가요?. 그냥 .like에 전부 css를 작성해도 되지 않나요?
-
미해결팀 개발을 위한 Git, GitHub 입문
안녕하세요
강의는 완경한지 몇인 된 것 같습니다. PPT 자료 공유좀 부탁드립니다. dlrudtn108@naver.com 입니다. 궁금한게 있는데 github에서 fork를 한 뒤 제 로컬 PC에서 소스 주정 후 fork한 저장소에 push까지 완료했습니다. pull request 요청시 master브랜치가 아닌 다른 브랜치로 pull request 요청하는데 master 브랜치와는달리 There isn’t anything to compare. xxxx:aaa and aaa:aaa are entirely different commit histories. 이런 메시지가 나오면서 pull request 요청하는 화면이 안나와서 문의드립니다. base repository가 master인 경우에는 pull request 화면이 잘나옵니다. 중간에 멀 잘못한건지 원인을 잘몰라서 문의드려요. 감사합니다.
-
미해결자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비
강사님과 다른 방식으로 풀었는데 확인 부탁드립니다.
public class Main7 { public static String solution(String str) { String answer=""; //문자를 카운트한다. //문자가 2개 이상일 경우 그 문자를 지운다. ArrayList<Character> list = new ArrayList<>(); for(char a : str.toCharArray()) { if(!list.contains(a)) { list.add(a); } } for(char a : list) { answer += a; } return answer; } public static void main(String[] args){ Scanner in=new Scanner(System.in); String str = in.nextLine(); System.out.print(solution(str)); } } 문제는 통과했지만 시간복잡도?에 대해 궁금한 것이 있어서 질문드립니다. 제가 한 방법은 1.ArrayList<Character> list를 생성 2.주어진 문장 str을 toCharArray()로 변환. 3.for each문을 실행해 주어진 문장을 한글자씩 list에 담지만 list.contains()를 사용하여 list에 문자가 있다면 제외. 4.마지막으로 String 변수에 저장해 출력. 이런 방식으로 풀었는데 저는 for문을 2번 사용했고 강사님은 for문을 1번 수행했습니다. 만약에 시간제한이 있는 문제라면 제 방식은 문제가 있는걸까요? 시간복잡도에 대해 잘 알지못해서 질문드립니다.