묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨자바 ORM 표준 JPA 프로그래밍 - 기본편
@ManyToMany에서 mappedBy
안녕하세요 선생님, 이번에 "다대다 [N:M]" 강좌 - 6:00 를 듣다가 헷갈리는 부분이 생겨서 질문드립니다. . 일단 @ManyToMany를 사용해서 Member, Product 테이블 모두 외래키를 갖고 있지 않고, 중간 테이블인 Member_Product 테이블이 외래키를 갖고 있는 상태라 가정하고 질문을 드리겠습니다. . 질문: 1. 다대다의 관계에서는 Member_Product가 연관관계의 주인이 되는건가요? 만약 그렇다면 Member, Product 모두 mappedBy를 설정해줘야 되는거 아닌가요? 2. Member에만 mappedBy를 표기했는데 그 이유가 뭔가요?
-
미해결
크롬 브라우저에서 출력되는 메시지 윈도우를 제어할 수 없습니다
안녕하세요. 인터넷에서 셀레니움을 통해 부동산등기부 자동발급 프로그램을 만들고 있습니다. www.iros.go.kr 웹 사이트를 로그인하고 등기부등본 결제를 한다음 열람을 하게되면 크롬 브라우저에서 RPTRegisterXCtrl을 선택하는 메시지 창을 출력합니다. 메시지 윈도우는 다음과 같습니다(이 메시지 윈도우에서 RPRTRegisterXCtrl을 클릭하여 다음으로 진행하고 싶은데... 방법을 찾지 못하고 있습니다). 크롬 브라우저를 포함한 전체 화면의 스크린 샷은 아래와 같습니다. -- 그런데 이게 일반적인 크롬 메시지 윈도우는 아닌 것 같습니다. res_msg = Alert(driver) msg.accept() 등을 이런 방식의 코드로는 전혀 접근이 안 됩니다. -- pywinauto를 통해 제어하려고 spy++로 확인해도 되지를 않습니다. app = Application().connect(class_name="....")과 같은 형태로 접근하려 해도 NotFound 에러가 납니다. pyautogui를 통하면 좌표로 클릭하면 됩니다만, 백그라운드 실행을 목표로 하고 있습니다. 따라서 이 방법 이외의 구현 방안을 찾고 있습니다. -- pywinauto나 다른 방법을 통해 구현하고 싶습니다. 여러 방안을 찾아보는데 찾지를 못해 메시지를 넣습니다. 해결을 위한 어떤 실마리라도 찾았으면 좋겠습니다. 그럼 정말 감사합니다. 꾸~~~~벅.
-
미해결
크롬 브라우저에서 출력되는 메시지 윈도우를 제어할 수 없습니다.
안녕하세요. 인터넷에서 셀레니움을 통해 부동산등기부 자동발급 프로그램을 만들고 있습니다. www.iros.go.kr 웹 사이트를 로그인하고 등기부등본 결제를 한다음 열람을 하게되면 크롬 브라우저에서 RPTRegisterXCtrl을 선택하는 메시지 창을 출력합니다. 메시지 윈도우는 다음과 같습니다(이 메시지 윈도우에서 RPRTRegisterXCtrl을 클릭하여 다음으로 진행하고 싶은데... 방법을 찾지 못하고 있습니다). 크롬 브라우저를 포함한 전체 화면의 스크린 샷은 아래와 같습니다. -- 그런데 이게 일반적인 크롬 메시지 윈도우는 아닌 것 같습니다. res_msg = Alert(driver) msg.accept() 등을 이런 방식의 코드로는 전혀 접근이 안 됩니다. -- pywinauto를 통해 제어하려고 spy++로 확인해도 되지를 않습니다. app = Application().connect(class_name="....")과 같은 형태로 접근하려 해도 NotFound 에러가 납니다. pyautogui를 통하면 좌표로 클릭하면 됩니다만, 백그라운드 실행을 목표로 하고 있습니다. 따라서 이 방법 이외의 구현 방안을 찾고 있습니다. -- pywinauto나 다른 방법을 통해 구현하고 싶습니다. 여러 방안을 찾아보는데 찾지를 못해 메시지를 넣습니다. 해결을 위한 어떤 실마리라도 찾았으면 좋겠습니다. 그럼 정말 감사합니다. 꾸~~~~벅.
-
미해결초보를 위한 도커 안내서
-v 경로 관련 질문
지정하신 경로 2개는 중 앞 경로는 git 경로이신거고뒤 경로는 컨테이너 내부의 경로인 건가요? 로컬에서 똑같이 테스트 할때는 어떻게 지정하는게 좋을지 잘 모르겠어서요.
-
미해결파이썬 입문 및 웹 크롤링을 활용한 다양한 자동화 어플리케이션 제작하기
안녕하세요 선생님 유튜브 댓글 강의 7-1 관련하여 질문드립니다.(오류관련)
import sys import io sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8') sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8') # 시간 처리 관련 import time # bs4 from bs4 import BeautifulSoup # selenium 관련 임포트 from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.keys import Keys # 크롬 옵션 chrome_options = Options() # Headless 모드 관련 chrome_options.add_argument("--headless") # 사운드 뮤트 chrome_options.add_argument("--mute-audio") # webdriver 설정(Chrome) - Headless 모드 # browser = webdriver.Chrome("C:/Django/workspace/python-class1/section7/webdriver/chrome/chromedriver.exe", options=chrome_options) # webdriver 설정(Chrome) - 일반 모드 os.chdir('C:\\Users\\limdongseung\\desktop\\chrome')#크롬드라이버.exe가 있는 폴더불러오기 browser = webdriver.Chrome('./chromedriver') # 크롬 브라우저 내부 대기 browser.implicitly_wait(5) # 브라우저 사이즈 # minimize_window() : 최소화 # maximize_window() : 최대화 browser.set_window_size(1920, 1280) # 페이지 이동 browser.get('https://www.youtube.com/watch?v=8CHp4j6bbaQ') # 5초간 대기 time.sleep(5) # html 포커스 주기 위한 코드 # Explicitly wait(명시적 대기) WebDriverWait(browser, 5).until(EC.presence_of_element_located((By.TAG_NAME, 'html'))).send_keys(Keys.PAGE_DOWN) # 2초간 대기 time.sleep(2) # 페이지 내용 # print('Before Page Contents : {}'.format(browser.page_source)) # 페이지 이동 시 새로운 데이터 수신 완료위한 대기 시간 scroll_pause_time = 4 # 현재 화면 페이지 높이 # IE : document.body.scrollHeight last_height = browser.execute_script("return document.documentElement.scrollHeight") print() # 모든 댓글 데이터가 수신(렌더링) 완료 될 때까지 반복 while True: # 스크롤바 이동 browser.execute_script("window.scrollTo(0, document.documentElement.scrollHeight)") # 대기 time.sleep(scroll_pause_time) # 스크롤바 이동 -> 새로운 데이터 렌더링 -> 현재 높이를 구한다. new_height = browser.execute_script("return document.documentElement.scrollHeight") # 이전 높이와 새로운 높이 비교 print("Last Height : {}, Current Height : {}".format(last_height, new_height)) # 새로운 데이터 렌더링이 없을 경우 종료 if new_height == last_height: # While 종료 break # 높이 변경 last_height = new_height # bs4 초기화 soup = BeautifulSoup(browser.page_source, "html.parser") # 통계 리스트 선택자 top_level = soup.select('div#menu-container yt-formatted-string#text') # 댓글 리스트 선택자 comment = soup.select('ytd-comment-renderer#comment') # HTML 소스 확인 # print(soup.prettify()) print() print() # 전체 추천 카운트 print('Total Like Count : {}'.format(top_level[0].text.strip())) print('Total DisLike Count : {}'.format(top_level[1].text.strip())) # Dom 반복 for dom in comment: print() # 이미지 URL 정보 img_src = dom.select_one("#img").get('src') print('Thumbnail Image URLS : {}'.format(img_src if img_src else 'None')) # 작성자 print('Author : {}'.format(dom.select_one('#author-text > span').text.strip())) # 댓글 본문 print('Content Text : {}'.format(dom.select_one('#content-text').text.strip())) # 좋아요 print('Vote Positive Count : {}'.format(dom.select_one('#vote-count-middle').text.strip())) print() # 브라우저 종료 browser.quit() --------------------------------------------------------------------------- UnsupportedOperation Traceback (most recent call last) <ipython-input-36-aaeea3227e03> in <module> 2 import io 3 ----> 4 sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8') 5 sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8') 6 UnsupportedOperation: detach실행을 하면 이런 오류가 생기는데원인이 무엇인지 잘 모르겠습니다.강의에서 하는 코드 그대로 따라 했고 드라이버 경로만 바꿔서 그대로 수업시간에따라한건데..ㅠ 뭐가 문제일까요?ㅠ 답변부탁드립니다^^
-
미해결실전! 웹사이트제작! Step By Step! _Basic (한화캐미컬_반응형웹)
5강에서 view:after 와 view:hover
안녕하세요 인강들으면서 공부하고 있습니다! 궁금한 점이 있는데요, view more부분에 hover했을때 색깔 덮는 부분에서 section.main .mainTitle .view:after{content:''; width: 0; height: 100%; background: red; position: absolute; left: 0; top: 0;} section.main .mainTitle .view:hover:after{width: 100%; transition: all 0.3s;} 이렇게하신 이유가 있나요? section.main .mainTitle .view:hover {~} 이렇게만 해도 될것같은데요..
-
미해결[텐서플로2] 파이썬 머신러닝 완전정복 - 마라톤 기록예측 프로젝트
머신러닝 코랩 질문
머신러닝을 제 노트북으로 하려니 너무 시간이 오래 걸려서 코랩을 이용하여 하려고 하는데요, 코랩에서는 Tkinter가 지원이 안된다는데, 그럼 혹시 제공해주시는 코드에서, 애니메이션 효과나 Tkinter 빼고 단순 실행결과 같은것만 보고 싶으면 어떤 부분을 주석처리해야하나요?
-
미해결모든 개발자를 위한 HTTP 웹 기본 지식
캐시를 웹브라우저가 아닌 경우에도 사용하나요?
캐시와 관련된 헤더 강의에서 항상 예제로 사용해주신 시나리오가 웹브라우저와 서버간의 통신을 전제로 설명해주셨는데, 실무에서 서버간에서 API를 사용해 연동할때도 캐시나 유사한 개념을 사용하는 경우가 있을까요?
-
미해결[개념부터 실습까지] 추천 시스템 입문편
requirements.txt
requirements.txt의 내용이 위처럼 나오는데 pandas 이전의 것들만 지우고 사용해도 되나요?
-
미해결[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part4: 게임 서버
서버쪽 OnRecvCompleted에 SocketError.ConnectionReset
프로그램을 실행한 뒤에 조금 시간이 지난 뒤에 서버 쪽 OnRecvCompleted 함수에서는args.BytesTransferred는 0, args.SocketError는 SocketError.ConnectionReset이 뜨고 클라이언트 쪽 OnRecvCompleted 함수에서는args.BytesTransferred는 0, args.SocketError는 SocketError.Success가 뜨면서 서로 Disconnect가 됩니다.... 코드를 확인해봤을 때는 강의에 적은 것이라 동일한 것으로 확인이 되는데 혹시 다른 이유가 있을까요?
-
미해결Vue로 Nodebird SNS 만들기
v-btn 에 nuxt property 질문!
강의와 관련있는 질문을 남겨주세요.• 강의와 관련이 없는 질문은 지식공유자가 답변하지 않을 수 있습니다. (사적 상담, 컨설팅, 과제 풀이 등)• 질문을 남기기 전, 비슷한 내용을 질문한 수강생이 있는지 먼저 검색을 해주세요. (중복 질문을 자제해주세요.)• 서비스 운영 관련 질문은 인프런 우측 하단 ‘문의하기’를 이용해주세요. (영상 재생 문제, 사이트 버그, 강의 환불 등) 질문 전달에도 요령이 필요합니다.• 지식공유자가 질문을 좀 더 쉽게 확인할 수 있게 도와주세요.• 강의실 페이지(/lecture) 에서 '질문하기'를 이용해주시면 질문과 연관된 수업 영상 제목이 함께 등록됩니다.• 강의 대시보드에서 질문을 남길 경우, 관련 섹션 및 수업 제목을 기재해주세요. • 수업 특정 구간에 대한 질문은 꼭 영상 타임코드를 남겨주세요! 구체적인 질문일수록 명확한 답을 받을 수 있어요.• 질문 제목은 핵심 키워드를 포함해 간결하게 적어주세요.• 질문 내용은 자세하게 적어주시되, 지식공유자가 답변할 수 있도록 구체적으로 남겨주세요.• 정확한 질문 내용과 함께 코드를 적어주시거나, 캡쳐 이미지를 첨부하면 더욱 좋습니다. 기본적인 예의를 지켜주세요.• 정중한 의견 및 문의 제시, 감사 인사 등의 커뮤니케이션은 더 나은 강의를 위한 기틀이 됩니다. • 질문이 있을 때에는 강의를 만든 지식공유자에 대한 기본적인 예의를 꼭 지켜주세요. • 반말, 욕설, 과격한 표현 등 지식공유자를 불쾌하게 할 수 있는 내용은 스팸 처리 등 제재를 가할 수 있습니다. Vue 로 NodeBird 만들기 1-5강 3분 쯤 보면 <v-btn text nuxt to="/profile"></v-btn> 태그가 있는데요. nuxt 가 없더라도 잘 실행이 되는데 왜 nuxt 가 들어간 것 인가용? 여기서 nuxt 의 기능이 무엇인가요??
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 기본 강의
HOC 관련 Auth 컴포넌트에서 Action 함수가 반복적으로 실행되는 오류 발생
Action 함수 Reducer 함수 Router.js HOC/auth.js 현재 아래 터미널 창에서 보듯, auth 작업 후에 api 콜 호출이 반복적으로 이뤄지고 있습니다. 당최 그 까닭을 알수가 없네요. 어떻게 해결할 수 있을까요?
-
미해결mongoDB 기초부터 실무까지(feat. Node.js)
_id값으로 유저 한명 정보 가져오는게 최선의 방법인가요?
_id값 입력 하려면 너무 길어서 불편한데 저 방법이 최선인가요? username도 unique key로 설정 했는데 username으로는 못 가져오나요?
-
미해결맥으로 배우는 윈도우즈 포렌식
질문 드립니다.
안녕하세요. 강사님 좋은 강의 항상 감사합니다. 카빙 강의 듣고 실습 후 헷갈리는 점이 있어서 질문 드립니다. 강릐를 들으면서 NTFS 파일을 추출하는 방법은 크게 아래 2가지 인 것 같습니다. 1) 이번 강의에서 설명해주신 PE Header와 Section의 크기 정보를 통해 파일을 추출한 방식 2) 'FAT32 and NTFS - 2(실습) 편' 강의에서 NTFS FILE RECORD의 OffsetFieldSize와 LengthFieldSize를 통해 파일을 추출하는 방식 위 1), 2)는 방법이 다를 뿐 같은 결과를 가져오는 것이 맞나요?? 혹시 맞다면 carver.py을 2)가 아닌 1)의 방식으로 구현한 이유가 따로 있을까요? ps. 제가 아직 정확한게 이해한게 아니라서 질문이 앞뒤가 안맞을 수도 있습니다. 그렇다면 죄송합니다 ㅠㅜ 감사합니다.
-
미해결맥으로 배우는 윈도우즈 포렌식
2021-02-28 기준 010 Editor 64bit(v11.0.1) 참고!
강의 화면과 현재 최신 버전은 v11.0.1 버전의 010 Editor에 차이점이 있어서 개인적으로 정리한 내용 공유 드립니다. 강의 들으시는 분들 참고하세요! 2021-02-28 기준 최신 010 Editor 64bit(v11.0.1) - 아직 빅서 버전은 공식적으로 지원하지 않습니다.- 010 Editor 32bit 버전은 모하비까지만 지원합니다. 그 이후부터는 64bit 파일로 설치해야 됩니다.- 강의 내용 중 010 Editor에서 'Templates - Drive - Drive' 를 선택하면 NTFS나 FAT의 경우 자동으로 파싱해주고 템플릿으로 보여주는 기능이 있다고 하는데, 최신 버전 기준으로는 저 기능이 보이지 않습니다. 하지만, 아래와 같이 진행하면 볼 수 있습니다. 1) Templates - Template Repository 에서 Drive를 Install 해주면 강의와 같이 Templates - Drive - Drive 메뉴가 보임. 근데, 해당 메뉴를 선택해도 파싱에 대한 결과는 볼 수 없습니다.2) 이때, View - Edit As - Drive 를 선택하면 그때부터 hex 값을 자동으로 파싱한 값들이 010 Editor 하단에 보이기 시작합니다.
-
미해결파이썬 무료 강의 (기본편) - 6시간 뒤면 나도 개발자
질문 있어요
코딩 프로그램을 저장 후 컴퓨터 폴더에서 더블클릭으로 프로그램을 실행하면 화면이 잠깐 보였다가 사라지네요. 왜 이런 건가요? 오류인가요? 해결 방법이 있다면 알려주세요.
-
미해결파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)
자동채점문의드립니다
안녕하세요, 문제를 보고 혼자서 아래와 같이 코드를 작성해서 VSCODE에서 돌리니까 답은 나오는데.. 자동채점기로 돌리면 시간 초과가 뜨는거 같습니다. 혹시 이유를 알 수 있을까요? (Judge(Python-5)로 진행해도 동일하게 TIME LIMIT 발생합니다) import sys #sys.stdin = open('2. K번째 수\in5.txt', 'rt') data = sys.stdin.readlines() t = int(data[0].strip()) for i in range(t): n, s, e, k = map(int, data[i*2+1].strip().split(' ')) num_lst = list(map(int, data[i*2+2].strip().split(' '))) num_lst = num_lst[s-1:e] num_lst.sort() print(f'#{i+1} {num_lst[k-1]}')
-
미해결하울의 안드로이드 인스타그램 클론 만들기
DetailViewFramgment 구현 중 viewholder를 사용 시 item.detail이 불러와 지지 않습니다.
초보라서 정확한 상황을 설명할 순 없지만 이번 장 구현할 때 똑같이 구현했는데도 전 item.detail의 id들이 불러와지질 않습니다. import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.appcompat.view.menu.MenuView import androidx.fragment.app.Fragment import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.example.instagram.R import com.example.instagram.navigation.model.ContentDTO import com.google.firebase.firestore.FirebaseFirestore class DetailViewFragment : Fragment() { var firestore: FirebaseFirestore? = null override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { var view = LayoutInflater.from(activity).inflate(R.layout.fragment_detail, container, false) firestore = FirebaseFirestore.getInstance() return view } inner class DetailViewRecyclerViewAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() { var contentDTOs: ArrayList<ContentDTO> = arrayListOf() var contentUidList: ArrayList<String> = arrayListOf() init { firestore?.collection("images")?.orderBy("timestamp") ?.addSnapshotListener { querySnapshot, firebaseFirestoreException -> contentDTOs.clear() contentUidList.clear() for (snapshot in querySnapshot!!.documents) { var item = snapshot.toObject(ContentDTO::class.java) contentDTOs.add(item!!) contentUidList.add(snapshot.id) } notifyDataSetChanged() } } override fun onCreateViewHolder(p0: ViewGroup, p1: Int): RecyclerView.ViewHolder { var view = LayoutInflater.from(p0.context).inflate(R.layout.item_detail, p0, false) return CustomViewHolder(view) } inner class CustomViewHolder(view: View) : RecyclerView.ViewHolder(view) override fun getItemCount(): Int { return contentDTOs.size } override fun onBindViewHolder(p0: RecyclerView.ViewHolder, p1: Int) { var viewholder = (p0 as CustomViewHolder).itemView //Userid viewholder.detale Glide.with(p0.itemView.context).load(contentDTOs!![p1].imageUri).into(viewholder.deta) } } }
-
해결됨[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part1: C# 기초 프로그래밍 입문
static 함수 관련 질문
공부를 하던 도중 static함수에 대해 헷갈리는 부분이 생겼습니다. 1. static 변수들은 데이터 영역에 값이 잡히는 것으로 알고 있습니다. 일반 함수들은 코드영역에 값이 잡히구요 그렇다면 static 함수들은 데이터 영역에 있는건가요 아니면 코드 영역에 있는 건가요? 2. c++이랑 다르게 namespace 안에 class들과 static 너무 많아서 헷갈리는 부분이 있습니다. 언제 static이 붙은 함수가 생기고 언제 static을 안 쓰는건지 헷갈립니다. namespace CSharp_연습용 { class Program { enum ClassType { None, Knight, Archer, Mage, } struct Player { public int hp; public int attack; } enum MonsterType { None, Slime, Orc, Skeleton, } struct Monster { public int hp; public int attack; } static ClassType ChooseClass() { Console.WriteLine("직업을 선택하세요!"); Console.WriteLine("[1] 기사"); Console.WriteLine("[2] 궁수"); Console.WriteLine("[3] 법사"); string input = Console.ReadLine(); ClassType choice = ClassType.None; switch (input) { case "1": choice = ClassType.Knight; break; case "2": choice = ClassType.Archer; break; case "3": choice = ClassType.Mage; break; } return choice; } static void CreatePlayer(ClassType choice, out Player player) { switch (choice) { case ClassType.Knight: player.hp = 100; player.attack = 10; break; case ClassType.Archer: player.hp = 75; player.attack = 12; break; case ClassType.Mage: player.hp = 50; player.attack = 15; break; default: player.hp = 0; player.attack = 0; break; } } static void CreateRandomMonster(out Monster monster) { Random rand = new Random(); int randMonster = rand.Next(1, 4); switch (randMonster) { case (int)MonsterType.Slime: Console.WriteLine("슬라임이 스폰"); monster.hp = 20; monster.attack = 2; break; case (int)MonsterType.Orc: Console.WriteLine("오크가 스폰"); monster.hp = 40; monster.attack = 4; break; case (int)MonsterType.Skeleton: Console.WriteLine("스켈레톤이 스폰"); monster.hp = 30; monster.attack = 3; break; default: monster.hp = 0; monster.attack = 0; break; } } static void Fight(ref Player player, ref Monster monster) { while (true) { monster.hp -= player.attack; if (monster.hp <= 0) { Console.WriteLine("승리 했습니다"); Console.WriteLine($"남은 체력, {player.hp}"); break; } player.hp -= monster.attack; if (player.hp <= 0) { Console.WriteLine("패배했습니다"); break; } } } static void EnterField(ref Player player) { while (true) { Console.WriteLine("필드에 접속했습니다"); Monster monster; CreateRandomMonster(out monster); Console.WriteLine("[1] 전투 모드로 돌입"); Console.WriteLine("[2] 일정 확률로 마을로 도망"); string input = Console.ReadLine(); if (input == "1") { Fight(ref player, ref monster); } else if (input == "2") { Random rand = new Random(); int randValue = rand.Next(0, 101); if (randValue <= 33) { Console.WriteLine("도망치는데 성공했습니다"); break; } else { Fight(ref player, ref monster); } } } } static void EnterGame(ref Player player) { while (true) { Console.WriteLine("마을에 접속"); Console.WriteLine("[1] 필드로 간다"); Console.WriteLine("[2] 로비로 돌아가기"); Console.WriteLine(); string input = Console.ReadLine(); switch (input) { case "1": EnterField(ref player); break; case "2": return; default: break; } } } static void Main(string[] args) { while (true) { ClassType choice = ChooseClass(); if (choice == ClassType.None) continue; Player player; CreatePlayer(choice, out player); EnterGame(ref player); } } } } 위와 같이 TEXTRPG 코드에서 3. Main 옆에 왜 static이 붙는건가요? 4. Main을 제외하고 나머지 함수들(CreatePlayer, EnterField등)은 class Program에 소속된 함수인 것 맞나요? 5. 만약 나머지 함수들이 class Program에 소속된 거라면 왜 static을 붙이는 건가요? static 함수들은 클래스에 종속적인 것이지 특정 객체에 종속적인 것이 아닌 것이라고 말씀해주셨습니다. Main이란 함수와 나머지 함수들이 현재 Program이란 클래스에 다 같이 있는 것이니까 나머지 함수에 static이 없어도 Main 안에서 작동해야 하는 것 아닌가요? 6. 질문하면서 떠오른 코드가 static void Main(string[] args) { Program p1; while (true) { ClassType choice = ChooseClass(); if (choice == ClassType.None) continue; Player player; p1.CreatePlayer(choice, out player); EnterGame(ref player); } } CreatePlayer 함수에서 static을 제거하고 Program의 객체 p1을 찍어서 p1이 호출한 함수로써 CreatePlayer을 쓰면 되지 않을까 했는데, 할당되지 않은 p1 지역변수를 사용했다는 안내가 나옵니다. 어떤점이 문제인 것인가요?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
파이썬오류 gyp ERR! find Python
구글링해서 제가 해결해보려고했봤습니다만.... 저에게 맞지않은 npm까지 설치하고 하니까 다른 리액트프로젝트들까지 작동이 안되는 상황까지갔어서 차라리 강사님 답변을 기다리기로했습니다 파이썬 오류가떠서 저아래있는 툴설치해도 똑같습니다ㅠㅠ npm --add-python-to-path='true' --debug install --global windows-build-tools 아래 에러메세지 PS C:\Users\KHS\Desktop\React class\boilerplate-mern-stack-master> npm install > bcrypt@3.0.8 install C:\Users\KHS\Desktop\React class\boilerplate-mern-stack-master\node_modules\bcrypt > node-pre-gyp install --fallback-to-build node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v83-win32-x64-unknown.tar.gz node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@14.16.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) gyp ERR! find Python gyp ERR! find Python Python is not set from command line or npm configuration gyp ERR! find Python Python is not set from environment variable PYTHON gyp ERR! find Python checking if "python" can be used gyp ERR! find Python - "python" is not in PATH or produced an error gyp ERR! find Python checking if "python2" can be used gyp ERR! find Python - "python2" is not in PATH or produced an error gyp ERR! find Python checking if "python3" can be used gyp ERR! find Python - "python3" is not in PATH or produced an error gyp ERR! find Python checking if the py launcher can be used to find Python 2 gyp ERR! find Python - "py.exe" is not in PATH or produced an error gyp ERR! find Python checking if Python is C:\Python27\python.exe gyp ERR! find Python - "C:\Python27\python.exe" could not be run gyp ERR! find Python checking if Python is C:\Python37\python.exe gyp ERR! find Python - "C:\Python37\python.exe" could not be run gyp ERR! find Python gyp ERR! find Python ********************************************************** gyp ERR! find Python You need to install the latest version of Python. gyp ERR! find Python Node-gyp should be able to find and use Python. If not, gyp ERR! find Python you can try one of the following options: gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe" gyp ERR! find Python (accepted by both node-gyp and npm) gyp ERR! find Python - Set the environment variable PYTHON gyp ERR! find Python - Set the npm configuration variable python: gyp ERR! find Python npm config set python "C:\Path\To\python.exe" gyp ERR! find Python For more information consult the documentation at: gyp ERR! find Python https://github.com/nodejs/node-gyp#installation gyp ERR! find Python ********************************************************** gyp ERR! find Python gyp ERR! configure error gyp ERR! stack Error: Could not find any Python installation to use gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47) gyp ERR! stack at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21) gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16) gyp ERR! stack at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16) gyp ERR! stack at exithandler (child_process.js:315:5) gyp ERR! stack at ChildProcess.errorhandler (child_process.js:327:5) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! stack at onErrorNT (internal/child_process.js:465:16) gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:80:21) gyp ERR! System Windows_NT 10.0.19041 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\KHS\\Desktop\\React class\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\KHS\\Desktop\\React class\\boilerplate-mern-stack-master\\node_modules\\bcrypt\\lib\\binding" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83" gyp ERR! cwd C:\Users\KHS\Desktop\React class\boilerplate-mern-stack-master\node_modules\bcrypt gyp ERR! node -v v14.16.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\KHS\Desktop\React class\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\KHS\Desktop\React class\boilerplate-mern-stack-master\node_modules\bcrypt\lib\binding --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\KHS\Desktop\React class\boilerplate-mern-stack-master\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) node-pre-gyp ERR! System Windows_NT 10.0.19041 node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\KHS\\Desktop\\React class\\boilerplate-mern-stack-master\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" ack-master\node_modules\bcrypt node-pre-gyp ERR! cwd C:\Users\KHS\Desktop\React class\boilerplate-mern-stack-master\node_modules\bcrypt node-pre-gyp ERR! node -v v14.16.0 node-pre-gyp ERR! node-pre-gyp -v v0.14.0 s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\User node-pre-gyp ERR! not ok t\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\KHS\Desktop\React class\b Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejn=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)s\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallb| ^16.0.0-0 but none is installed. You must install peer dependencies yourself.ack-to-build --module=C:\Users\KHS\Desktop\React class\boilerplate-mern-st.0.0-0 but none is installed. You must install peer dependencies yourself.npm WARN react-boiler-plate@1ack-master\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\KHS\Desktop\React class\boilerplate-mern-les\fsevents):stack-master\node_modules\bcrypt\lib\binding --napi_version=7 --node_abi_nvents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})api=napi --napi_build_version=0 --node_napi_label=node-v83' (1) npm WARN react-redux@5.1.2 requires a peer of react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0 but none is installed. You must install peer dependencies yourself. npm WARN react-redux@5.1.2 requires a peer of redux@^2.0.0 || ^3.0.0 || ^4.0.0-0 but none is installed. You must install peer dependencies yourself.npm WARN react-boiler-plate@1.0.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modual logging output above.les\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32",_11_535Z-debug.log"arch":"x64"}) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bcrypt@3.0.8 install: `node-pre-gyp install --fallback-to-build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@3.0.8 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\KHS\AppData\Roaming\npm-cache\_logs\2021-02-27T21_22_11_535Z-debug.log