묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결Python 입문자를 위한 강의
수업잘듣고있습니다, 파이썬이 처음이라 몇가지질문좀드리려구요~~!
사내에서도 강의가있어서 조금보기시작했는데, vscode, cmder 요런건뭘까요?? jupyter notebook 이외에도 코딩시 필요한 환경이 더있는걸까요?? 너무 초심자 문의라 죄송합니다 ㅠ
-
미해결이펙티브 자바 완벽 공략 1부
[과제] EnumMap, EnumSet
## EnumMap Javadoc에 따르면 "when the map is created. Enum maps are represented internally as arrays. This representation is extremely compact and efficient." -> hashmap 은 key를 bucket에 저장하고각 bucket이 linked list를 참조 하고 있음. (linkedlist에는 hash(key)가 같은 element가 들어감) 그런데 enummap 의 경우 key로 사용할 값이 제한되어 있으므로, 그 갯수만큼 길이를 가진 array를 선언하고. 해당 index에 값을 넣으면 됨. ## EnumSet Javadoc에 따르면 "when the set is created. Enum sets are represented internally as bit vectors." -> hashset은 hashmap 과 같은데 map의 value가 있다 없다를 표현하는 지시자 같은 값이 들어감. enumset은 값이 있다 없다만 표시하면 되니까 enummap 처럼 array로 구현하지 않고 10101011 같은 bitvector로 구현이 가능.
-
해결됨배달앱 클론코딩 [with React Native]
Module 'FirebaseCore' not found
packagej.json { "name": "ulex", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", "lint": "eslint ." }, "dependencies": { "@react-native-community/push-notification-ios": "^1.10.1", "@react-native-firebase/analytics": "^15.2.0", "@react-native-firebase/app": "^15.2.0", "@react-native-firebase/messaging": "^15.2.0", "react": "17.0.2", "react-native": "0.68.2", "react-native-push-notification": "^8.1.1", "react-native-webview": "^11.22.7" }, "devDependencies": { "@babel/core": "^7.18.6", "@babel/runtime": "^7.18.6", "@react-native-community/eslint-config": "^3.0.3", "@types/react-native-push-notification": "^8.1.1", "babel-jest": "^28.1.3", "eslint": "^8.19.0", "jest": "^28.1.3", "metro-react-native-babel-preset": "^0.71.3", "react-test-renderer": "17.0.2" }, "jest": { "preset": "react-native" } } 해본것들은 다음과 같습니다. rm -rf node_modulesnpm i cd ios rm -rf Podsrm -rf Podfile.lock 마지막으로 다음과 같이 Core도 Pod로 추가해 봤지만 동일하네요. config = use_native_modules! pod "GoogleUtilities", :modular_headers => true pod 'Firebase/Core' pod 'Firebase/Messaging' # Flags change depending on the env values. flags = get_default_flags() use_react_native!( :path => config[:reactNativePath], # to enable hermes on iOS, change `false` to `true` and then install pods :hermes_enabled => flags[:hermes_enabled], :fabric_enabled => flags[:fabric_enabled], # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) 제가 뭘 잘못 보고 있는걸까요?.
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
address, order 클래스
domain밑에 Member클래스 생성 후 domain밑에 address와 Order클래스를 만들었는데 private Address address;private List<Order> orders = new ArrayList<>();에서 Address에 '기본' 속성 타입은 'Address'일 수 없습니다. Order에 '기본' 속성 타입은 컨테이너일 수 없습니다. 오류 메세지가 나옵니다.
-
미해결[파이토치] 실전 인공지능으로 이어지는 딥러닝 - 기초부터 논문 구현까지
LSTM 평가 코드
LSTM 평가를 위해 교재의 4-1 Neural Networks 상 평가 코드(아래와 같음)을 붙여넣기 해서 출력한 결과 [can't convert cuda:0 device type to numpy. Use Tensor.cpu() to copy the tensor to host memory.]라는 오류가 뜹니다. 조치방법이 어떻게 되는지 궁금합니다. def evaluation(dataloader): predictions = torch.tensor([], dtype=torch.float) # 예측값을 저장하는 텐서 actual = torch.tensor([], dtype=torch.float) # 실제값을 저장하는 텐서 with torch.no_grad(): model.eval() # 평가를 할 때에는 .eval() 반드시 사용해야 한다. for data in dataloader: inputs, values = data outputs = model(inputs) predictions = torch.cat((predictions, outputs), 0) # cat을 통해 예측값을 누적 actual = torch.cat((actual, values), 0) # cat을 통해 실제값을 누적 rmse = np.sqrt(mean_squared_error(predictions, actual)) # sklearn을 이용하여 RMSE 계산 return rmse 평가 시 .eval()을 사용해야 하는 이유# 평가 시에는 온전한 모델로 평가를 해야하는데 .eval()이 아닌 .train()인 경우 드랍아웃이 활성화 되어 있다.# 따라서 드랍아웃이나 배치 정규화 등과 같이 학습 시에만 사용하는 기술들을 평가 시에는 비활성화 해야만 한다. train_rmse = evaluation(trainloader) # 학습 데이터의 RMSEtest_rmse = evaluation(testloader) # 시험 데이터의 RMSE print("Train RMSE: ",train_rmse)print("Test RMSE: ",test_rmse) # 예시를 위한 단순 비교입니다. 실제 연구에서는 디테일한 비교가 필요합니다.# 20번의 평가 결과의 평균으로 결과값을 산정 했습니다.# 데이터를 무작위로 나누고 모델의 초기값도 random initial parameter를 사용했기 때문에 학습을 할 때 마다 결과가 다르게 나올 수 있습니다.# 이 강의에서는 학습의 흐름(for문)과 모델(Regressor) 부분을 주의 깊게 보시면 됩니다.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
Attribute name cannot be null or empty 오류 해결이 안됩니다!
오류 메시지 구글랭 해봤는데 저랑 비슷한 케이스를 찾지 못해서 결국 질문 올립니다. 뭐가 잘못된 걸까요?
-
해결됨[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
네이버 뉴스 본문 링크 질문
안녕하십니까,뉴스본문 기사 크롤링 중 질문이 있습니다. 첨부사진을 보시면, 첫번째 a태그의 class가 info press인데,명령어를 입력하실 때 그냥 links = article.select("a.info")로 info만 입력하셨습니다. 띄어쓰기 전의 한 단어만 class 명으로 보는 것인지 궁금합니다. 아래는 강사님을 따라한 코드입니다(크롤링 결과는 잘 나옴) # 1. 삼성전자를 검색하고, 네이버 뉴스 본문의 링크만 가져온다 response = requests.get("https://search.naver.com/search.naver?where=news&sm=tab_jum&query=%EC%82%BC%EC%84%B1%EC%A0%84%EC%9E%90") html = response.text soup = BeautifulSoup(html, "html.parser") articles = soup.select("div.info_group") # 뉴스 기사 중 div가 info_group인 것을 선택해라. # info_group이 총 몇개인지 확인하니까, word에 나와 있듯이 총 기사가 10개임을 확인했다. for article in articles: links = article.select("a.info") # article의 a태그 중 class가 info인 녀석들을 가져오자. if len(links) >= 2: # 가져온 결과값은 리스트 형태이고, word에 나와 있듯이 네이버 뉴스는 a태그 2개로 구성되어 있다. 따라서 links의 리스트 중 len함수를 통해 리스트가 몇개인지 파악하고, 링크가 2개 이상인지 확인한다. url = links[1].attrs["href"] # 우리가 가져올 건 link 중 2번째 요소니까, [1]을 입력한다(리스트 인덱스는 0부터 시작하니까!) # print(url) 본문 링크만 가져온다면 여기서 마치면 되지만, 우리가 원하는건 본문 내용이다. # 2. 네이버 뉴스 본문 내용 가져오기 response = requests.get(url, headers={'User-agent' : 'Mozila/5.0'}) # 방금 만든 url에 다시 requests를 사용!, 봇으로 인식되는걸 피하기 위한 header도 넣자. html = response.text soup = BeautifulSoup(html, "html.parser") # print(soup)를 통해 제대로 본문을 가져오는지 확인해보자 content = soup.select_one("#newsct_article") # 네이버뉴스의 본문을 모두 포함하는 것은 id newsct_article 이다. print(content.text)
-
미해결AWS EC2 클라우드 서버로 홈페이지 구축하기
xampp 설치 오류
EC2 웹 서버 설치 과정에서 파워 셀에 xampp 설치 링크를 입력하면 404 에러가 뜹니다 링크가 변경되어서 그런걸까요?
-
미해결
주피터 노트북 커널 죽음
주피터 노트북으로 GAN CNN 실습중입니다. 가상환경 설정 잘 해놔서 GAN 모델이 잘 돌아가서 데이터 생성 잘했는데요 어제 CNN모델 생성해보니깐 커널이 계속 죽더군요 문제를 해결해보려고 구글링해서 max_buffer_size도 바뀌봤고요 그래도 문제가 해결되지 않아서 조금 냅뒀다가 다시 실행해보니깐 또 돼서 메모리 문제인가 싶었습니다 문제는 CNN 모델을 실행이 되니깐 이제 GAN 모델을 또 다시 돌리려다 또 다시 커널이 죽어버렸어요 메모리를 초기화해주려고 다른 창 다 꺼서 용량 충분히 확보해줬는데도 잘 안되네요 그리고 RAM 용량이 16gb 짜리라 메모리 용량도 충분하다고 생각했는데 이상해요ㅠㅠㅠ 저 같이 주피터 노트북 커널 죽었을 때 해결법 아시는 분 계신가요?..
-
미해결스프링 프레임워크는 내 손에 [스프1탄]
스프2탄 질문있습니다.
취업을 할때 포토폴리오로 자신이 만든 사이트 URL을 기재해야되는데 locallost:8081말고 다른사람도 접속 할수 있는 도메인 만들어 보고싶은데 어떻게 하는지 잘모르겠습니다. 혹시 스프2탄에서 도메인 만드는것도 배워 볼수있을까요
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
windows kafka 정상 작동하는 버전 제공문의
윈도우에서 kafka, connect 정상작동하는 묶음을 제공해주셨으면 어떨까요 모든 설정이 되어 있어 다운받아서 바로 사용가능한 환경이면 좋겠습니다. confluent-6.1.0 이틀째 삽질중인데 connect실행시 >bin\windows\connect-distributed.bat etc\kafka\connect-distributed.properties[2022-07-22 13:45:11,800] WARN could not get type for name org.easymock.IArgumentMatcher from any class loader (org.reflections.Reflections)org.reflections.ReflectionsException: could not get type for name org.easymock.IArgumentMatcher confluent-5.5.2 bin\windows\connect-distributed.bat etc\kafka\connect-distributed.properties [2022-07-22 15:40:07,240] WARN could not get type for name org.osgi.framework.BundleListener from any class loader (org.reflections.Reflections) org.reflections.ReflectionsException: could not get type for name org.osgi.framework.BundleListener 이런 메세지 때문에 더이상 나가질 못하고 있네요 구글 드라이브에 제공했던 버전은 이제 제공이 안되나요? 파일이 없다고 나오더군요
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
페치 조인의 where절에 대하여 궁금한 것이 있습니다
=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 우선 기본적으로 페치 조인 대상에 대해선 (ex. SELECT t FROM team t join fetch t.members에서 members) on 조건을 줄 수 없다고 이해했습니다. 그리고 where 절에 대해서는 team에 대해서 조건을 줘도 되지만 members에 대해서는 조건을 주면 안된다고 이해했습니다. 그 이유에 대하여 자세히 알고 싶습니다. 1. team에 대해서는 조건을 줘도 team에 대한 데이터의 일관성이 깨지지 않기 때문에 가능한건가요? (team 자체에 조건을 주었기 때문에) 2. members에 조건을 줄 경우 직접적으로 team에 조건을 주지 않았음에도 team에 대한 데이터(컬렉션) 일부가 필터링됨으로써 데이터의 일관성이 깨지기 때문에 지양해야 하는건가요? 비슷한 질문들에 대해 찾아보고 읽어봤지만 확실하게 이해되지 않는 부분이 있어 질문 드립니다.
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
html 파일 글씨 색깔 변경
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. 안녕하세요! hello.html 파일의 p태그 부분이 강의 화면과 다르게 단색으로 표시되는데 설정을 변경할 수 있는 방법이 있을까요? 강의 9:13에 나오는 것처럼 ${data}를 눌렀을 때 관련된 java 파일로 이동되게끔 바꾸고도 싶습니다..!
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
D-DAY 카운팅 앱을 만드는 도중에 에러가 레이아웃 파일에서 에러가 발생했습니다.
아래는 코드입니다. 참고로 activity_main 파일입니다. <?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" tools:context=".MainActivity"> <TextView android:id="@+id/textView" android:layout_width="match_parent" android:layout_height="wrap_parent" android:gravity="center" android:text="D-day Counter" android:textSize="20sp" android:textStyle="bold" app:layout_constraintTop_toTopOf="parent" /> <ImageView android:id="@+id/imageView6" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="50dp" android:scaleType="fitXY" android:src="@drawable/tt" app:layout_constraintBottom_toBottomOf="parent" /> <TextView android:id="@+id/finaldate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="0" android:textColor="@color/black" android:textSize="50dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/textView" /> <Button android:id="@+id/startbtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="20dp" android:text="시작일" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" /> <Button android:id="@+id/endbtn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="20dp" android:text="시작일" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" /></androidx.constraintlayout.widget.ConstraintLayout>//이런 식으로 코딩을 했는데//18번째줄에 android resource linking failed 이라는 오류가 발생했습니다.//해결 방법이 궁금합니다. 항상 감사드립니다!!
-
미해결남박사의 파이썬으로 실전 웹사이트 만들기
파일(이미지)접근 문의 드립니다
강의 내용 29분 정도 내용입니다 from flask import send_from_directory@bp.route("/images/<filename>")def board_images(filename): return send_from_directory(app.config["BOARD_IMAGE_PATH"], filename) 이미지가 , 작업 폴더 밖에 위치하다보니 send_from_directory를 사용 하여서 접근 하였습니다 그럼 이미지가 작업폴더 안에 위치한다면 os.path.join 으로 접근 하면되는건지 궁금합니다 아니면, 작업폴더 안에 있어도 send_from_directory를 써야 할까요?
-
미해결ARM Cortex-M 프로세서 프로그래밍
.libs_sector 에 대해서
s334 강의에서 .libs_sector 가 링커스크립트에서 .data 섹션에 위치할 수 있도록 설정해 주어서 ram 영역에 존재한다고 말씀하셨는데, 그럼 링커스크립트에서 따로 설정해 주지 않는다면 libs_sector 레이블 부분은 flash메모리인 .text 섹션이나 .rodata 섹션에 존재한다고 이해하는 것이 맞나요?? 제 생각이 맞다면 정확히 어느 섹션에 위치하는지 알려주시면 감사하겠습니다!
-
미해결워드프레스 기초부터 쇼핑몰까지
강사님 궁금한 것이 있습니다.
사이트를 다 만들고 난 뒤에 구글, 네이버에서 제가 만든 사이트를 서치를 하면 제가 만든 사이트가 나오게 하고 싶은데 어떻게 해야 하나요? Yoast SEO와 구글 서치 콘솔을 활용을 한다는 것은알겠는데 키워드를 검색을 어떻게 넣고 키워드를 검색을 할 때 구글, 네이버에서 제 사이트가 나오면 좋겠는데 어떻게 해야하는지 모르겠습니다. 그게 되야 쇼핑몰에서 수익이 발생이 될 것 같아 이렇게 글을 올립니다. ㅠ
-
미해결스프링 DB 2편 - 데이터 접근 활용 기술
쿼리
궁금한게 19분19초쯤 insert랑 update쿼리 나오는데 order.setUsername("정상"); 이 코드는 insert쿼리에 그리고 order.setPayStatus("완료"); 이 코드는 update쿼리에 쓰이는 건가요
-
미해결Python 입문자를 위한 강의
zip 예제
안녕하세요 zip 예제 jupyter notebook에서 해보려고 하는데 출력하면 TypeError: 'zip' object is not callable 이라고 나오는데 왜그러는건가요...?
-
미해결Vue.js 시작하기 - Age of Vue.js
vue cli v5.x 은
안녕하세요. vue cli를 설치하려고 보니 전 5점대인데요. 선택은 뭐로 해야 하나요?