묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결프론트엔드 개발자를 위한 웹팩
스크립트 위치가 다릅니다
npm run dev 로 빌드 실행 후 localhost:9000 확인을 하였는데... script 영역이 강의 영상에서는 body 에 적용되었는데 저는 head 영역에 적용이 되었습니다. 적용하는 영역도 웹팩 업그레이드 되면서 달라진걸까요??
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
동시에 cancel 요청이 두번 들어오게 된다면 어떻게 되나요?
안녕하세요! 가능성은 거의 없겠지만 고객센터에서 A , B 상담원이 같은 주문을 취소하게 될 경우 재고가 두번 쌓일 가능성은 없나요?
-
미해결C# ADO.NET 데이터베이스 프로그래밍
소스 및 자료 요청
강의 자료 및 C# 소스 자료 부탁드립니다.
-
미해결웹 게임을 만들며 배우는 React
TicTacToe에서 onClickTable에 역할을 알고싶습니다.
import React, {useEffect, useReducer, useCallback} from 'react'; import Table from './Table'; const initialState = { winner: '', turn: 'O', tableData: [['','',''],['','',''],['','','']], recentCell: [-1, -1], }; export const SET_WINNER = 'SET_WINNER'; export const CLICK_CELL = 'CLICK_CELL'; export const CHANGE_TURN = 'CHANGE_TURN'; export const RESET_GAME = 'RESET_GAME'; const reducer = (state, action) =>{ switch(action.type){ case SET_WINNER: return { ...state, winner: action.winner, }; case CLICK_CELL:{ const tableData2 = [...state.tableData]; tableData2[action.row] = [...tableData2[action.row]]; tableData2[action.row][action.cell] = state.turn; return{ ...state, tableData: tableData2, recentCell: [action.row, action.cell], } } case CHANGE_TURN:{ return{ ...state, turn: state.turn === 'O' ? 'X' : 'O', } } case RESET_GAME:{ return{ ...state, turn: 'O', tableData: [['','',''],['','',''],['','','']], recentCell: [-1, -1], } } default: return state; } }; const TicTacToe=()=>{ const [state, dispatch] = useReducer(reducer, initialState); const {tableData, turn, winner, recentCell} = state; const onClickTable = useCallback(()=>{ console.log("onClickTable") dispatch({type: SET_WINNER, winner: 'O'}); }, []) useEffect(()=>{ const [row, cell] = recentCell; if(row < 0){ return; } let win = false; if(tableData[row][0] === turn && tableData[row][1] === turn && tableData[row][2] === turn){ win = true; } if(tableData[0][cell] === turn && tableData[1][cell] === turn && tableData[2][cell] === turn){ win = true; } if(tableData[0][0] === turn && tableData[1][1] === turn && tableData[2][2] === turn){ win = true; } if(tableData[0][2] === turn && tableData[1][1] === turn && tableData[2][0] === turn){ win = true; } if(win){ dispatch({type: SET_WINNER, winner: turn}); dispatch({type: RESET_GAME}); } else{ let all = true; tableData.forEach((row)=>{ row.forEach((cell)=>{ if(!cell){ all = false; } }) }) if(all){ dispatch({type: RESET_GAME}); }else{ dispatch({type: CHANGE_TURN}); } } }, [recentCell]) return( <> <Table onClick = {onClickTable} tableData={tableData} dispatch={dispatch}/> {winner && <div>{winner}님의 승리</div>} </> ); } export default TicTacToe; 위에 코드에서 onClickTable이 어떤역할을 하는지 정확히 알고싶습니다. 함수 안에 console.log을 넣어봐도 실행중에 console창에 찍히지 않고, Table component에 props로 전달되어도 해당 component에서 쓰이는거 같지도 않고, Table에 자식component에 전달도 안되는것을 보니 어떤 역할을 하는것인지 아무리 생각해봐도 모르겠습니다. 긴 질문 읽어주셔서 감사합니다.
-
해결됨[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문
포인터로사용하던걸 참조로 넘겨줄 때 널체크 하는법?
pointer = nullptr; void PrintInfoByRef(*pointer); // 이 경우에 cout출력줄에서 에러가 생기는데 void PrintInfoByRef(StatInfo& info) { // 그럴경우를 대비해서 여기서 이렇게 레퍼런스의 널체크를 추가해주면 되나요? // 널체크는 잘 되는데 보통 이렇게 레퍼런스도 체크하는지 확실하지 않아 여쭤봅니다 if (&info == nullptr) return; cout << info.hp << endl; }
-
[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문
list#2에서 질문
삭제된 글입니다
-
미해결홍정모의 따라하며 배우는 C언어
autos 창 띄우기
안녕하세요 9.16 본강의 40초 부근을 보면, 디버깅시 밑에 Autos 창이 뜨는 걸 볼 수 있었는데요, 제가 이걸 껐는지 보이질 않습니다. 어디서 다시 켜줘야 하나요? *추가 1분 19초의 debug > windows > memory도 찾을 수가 없어요,, 인스톨러로 가서 뭘 더 다운 받아야 하나요?
-
미해결초보를 위한 쿠버네티스 안내서
minikube ingress -> ingress-nginx-controller가 crashLoopBackOff이 되네요
안녕하세요. ingress 테스트를 해보려고 하는데 시작부터 crashLoopBackOff 오류가 발생하네요. 환경은 네이버 클라우드 입니다. minikube addons enable ingress (정상완료) -> curl -I 192.168.49.2/healthz 하면 "curl: (7) Failed connect to 192.168.49.2:80; connection refused" 가 뜨네요. minikube의 아이피는 192.168.49.2 입니다. 감사합니다.
-
해결됨오라클 성능 분석과 인스턴스 튜닝 핵심 가이드
oewizard.bat 수행 중 멈춤
강의 잘 듣고 있습니다.SwingBench 수강 중에 oewizard.bat을 수행하던 도중 78%에서 멈추었습니다.Wizard Log에는 아래까지 나와있습니다.Completed processing table ORDER_ITEMS_3574474 in 0:59:30 06:16:32Completed processing table ORDER_ITEMS_10723422 in 0:59:29 06:16:32Completed processing table ORDER_ITEMS_0 in 0:59:30 06:16:32cancle 하고 다시 수행하려면 먼저 조치를 취하고 다시 수행해야 할 것 같은데요.답변 부탁드리겠습니다.
-
it 취업을 위한 알고리즘 문제풀이 입문 (with C/C++) : 코딩테스트 대비
정답소스파일
삭제된 글입니다
-
미해결파이썬 무료 강의 (기본편) - 6시간 뒤면 나도 개발자
파괴 되었다는 메세지 미출력 등
안녕하세요 일단 좋은 강의 감사드립니다. 몇가지 질문이 있어서 질문 남깁니다.! 1.randint 의 변수를 50,100 까지 늘려서 출력해보니 파괴되었다는 메세지는 출력되지않습니다. 본 코드에 어떤이상이 있어서 그런걸까요.. 2. 출력메세지를 보면 마린1,2,3 으로 구분이 안되어 어떤 마린의 피가 몇 달았는지까지 구분감을 주고싶은데 각 유닛의 이름에 구분감을 줄 수 있는 방법이 있을까요? from random import * #일반 유닛 class unit: def __init__(self, name, hp, speed): self.name = name self.hp = hp self.speed = speed print(f"{name} 유닛이 생성됬습니다") def move(self, location): print("[지상유닛 이동]") print(f"{self.name}은 {location} 방향으로 이동합니다.{self.speed} 속도로 이동") def damaged(self, damage): print(f"{self.name} : {damage} 데미지를 입음.") self.hp -= damage print(f"{self.name}의 현재 체력은 {self.hp} 입니다.") if self.damage <= 0: print(f"{self.name} 파괴되었습니다.") # 공격유닛 class attackunit(unit): def __init__(self, name, hp, speed, damage): unit.__init__(self, name, hp, speed) self.damage = damage def attack(self, location): print(f"{self.name} {location}방향으로 {self.damage} 만큼의 데미지" ) #마린 class marine(attackunit): def __init__(self): attackunit.__init__(self,"마린", 40, 1, 5) #스팀팩 def stimpack(self): if self.hp > 10: self.hp -= 10 print(f"{self.name} : 스팀팩을 사용합니다. (hp 10 감소)") else: print(f"{self.name} : 체력이 부족하여 스팀팩을 사용하지 않음") #탱크 class tank(attackunit): #시즈모드 seize_developed = False def __init__(self): attackunit.__init__(self, "탱크", 150, 1, 35) self.seize_mode = False def set_seize_mode(self): if tank.seize_developed == False: return #현재 시즈모드가 아닐때 > 시즈모드 if self.seize_mode == False: print(f"{self.name} : 시즈모드로 전환합니다.") self.damage *= 2 self.seize_mode = True #현재 시즈모드일 떄 > 시즈모드 해제 else: print(f"{self.name} : 시즈모드를 해제합니다.") self.damage /= 2 self.seize_mode = False # 날 수 있는 기능을 가진 클래스 class flyable: def __init__(self,fly_speed): self.fly_speed = fly_speed def fly (self, name, location): print(f"{name} {location} 방향으로 {self.fly_speed} 로 날아감") #공중 공격 유닛 클래스 class flyableattackunit(attackunit, flyable): def __init__(self, name, hp, damage, fly_speed): attackunit.__init__(self, name, hp, 0, damage) #지상스피드 0 flyable.__init__(self, fly_speed) def move (self, location): print("[공중유닛 이동]") self.fly(self.name, location) #레이스 class wraith(flyableattackunit): def __init__(self): flyableattackunit.__init__(self,"레이스", 80, 20, 5) self.clocked = False #클로킹 모드 (해제상태) def clocking(self): if self.clocked == True: print(f"{self.name} : 클로킹 모드 해제합니다. ") self.clocked = False else: print(f"{self.name} : 클로킹 모드 설정합니다") self.clocked == True def game_start(): print("[알림] 새로운 게임을 시작합니다.") def game_over(): print("player : gg") print("[player] 님이 게임에서 퇴장하셨습니다.") #실제 게임 진행 game_start() m1 = marine() m2 = marine() m3 = marine() t1 = tank() t2 = tank() w1 = wraith() attack_units = [] attack_units.append(m1) attack_units.append(m2) attack_units.append(m3) attack_units.append(t1) attack_units.append(t2) attack_units.append(w1) #전군이동 for units in attack_units: units.move("1시") #탱크 시즈모드 개발 tank.seize_developed = True print("[알림] 탱크 시즈모드 개발이 완료되었습니다.") #공격 모드 준비 (마린 : 스팀팩, 탱크 : 시즈모드, 레이즈 : 클로킹) for units in attack_units: if isinstance(units, marine): units.stimpack() elif isinstance(units, tank): units.set_seize_mode() elif isinstance(units, wraith): units.clocking() #전군 공격 for units in attack_units: units.attack("1시") #전군 피해 for units in attack_units: units.damaged(randint(30,40)) #공격은 랜덤 (5~21) #끝 game_over()
-
미해결홍정모의 따라하며 배우는 C++
연습문제 출력관련
출력했을때 뒤에 이상한 문자가 나오는데 왜그런건가요??
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
서비스 클래스의 join 안에서 중복회원검증 후?
서비스 클래스의 join 안에서 중복회원검증 함수에서 illegalstate exception을 던지게 되면 memberRepository.save()를 수행하지 않게끔 해야하는거 아닌가요? 저 상태면 중복된 회원이 있건없건 save를 하게되는게 아닌지 여쭙고자합니다!
-
실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
jacksonfilter, 그리고 @valid 질문드립니다.
삭제된 글입니다
-
해결됨[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part3: 유니티 엔진
혼자서 점프 하는 애니메이션을 넣어 봤습니다ㅜㅜ
삭제된 글입니다
-
미해결[리뉴얼] 처음하는 파이썬 백엔드와 웹기술 입문 (파이썬 중급, flask[플라스크] 로 이해하는 백엔드 및 웹기술 기본) [풀스택 Part1-1]
강의 자료가 없어요
강의 자료가 없는데 오류인가요?
-
미해결스프링 핵심 원리 - 기본편
안녕하세요! 질문 있습니다.
안녕하세요 좋은 강의 잘 듣고 있습니다. node.js , Golang 등 다양한 백엔드 언어가 많은데 이것들도 객체지향적으로 프로그래밍이 가능한 것이 있는걸로 알고있습니다. 혹시 다른 언어가 아닌 스프링을 사용하는 이유가 있을까요?
-
미해결실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
querydsl 이 안됩니다.ㅜㅜ
안녕하세요? 강사님!! 항상 강의 잘듣고 있습니다. 다름이 아니라, 제가 build.gradle 에서 querydsl 을 설정 하고 코끼리 모양 버튼 눌렀는데 계속 에러가 떠서 이렇게 질문 드립니다. 항상 좋은 강의 와 답변 감사드립니다 ^^ //querydsl 추가buildscript { dependencies { classpath("gradle.plugin.com.ewerk.gradle.plugins:querydslplugin:1.0.10") }}plugins { id 'org.springframework.boot' version '2.4.1' id 'io.spring.dependency-management' version '1.0.10.RELEASE' id 'java'}group = 'jpabook'version = '0.0.1-SNAPSHOT'sourceCompatibility = '11'//apply plugin: 'io.spring.dependency-management'apply plugin: "com.ewerk.gradle.plugins.querydsl"configurations { compileOnly { extendsFrom annotationProcessor }}repositories { mavenCentral()}dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-devtools' implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-hibernate5' implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.6' compileOnly 'org.projectlombok:lombok' runtimeOnly 'com.h2database:h2' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation("org.junit.vintage:junit-vintage-engine") { exclude group: "org.hamcrest", module: "hamcrest-core" } //querydsl 추가 implementation 'com.querydsl:querydsl-jpa' //querydsl 추가 implementation 'com.querydsl:querydsl-apt'}test { useJUnitPlatform()}//querydsl 추가//def querydslDir = 'src/main/generated'def querydslDir = "$buildDir/generated/querydsl"querydsl { library = "com.querydsl:querydsl-apt" jpa = true querydslSourcesDir = querydslDir}sourceSets { main { java { srcDirs = ['src/main/java', querydslDir] } }}compileQuerydsl{ options.annotationProcessorPath = configurations.querydsl}configurations { querydsl.extendsFrom compileClasspath}//여기 밑에가 에러 내용입니다.....A problem occurred configuring root project 'jpashop'. > Could not resolve all artifacts for configuration ':classpath'. > Could not find gradle.plugin.com.ewerk.gradle.plugins:querydslplugin:1.0.10. Searched in the following locations: - https://plugins.gradle.org/m2/gradle/plugin/com/ewerk/gradle/plugins/querydslplugin/1.0.10/querydslplugin-1.0.10.pom If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration. Required by: project : Possible solution: - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
-
미해결공공데이터로 파이썬 데이터 분석 시작하기
전화번호와 자동차등록번호 마스킹 차이점
선생님 전화번호마스킹할 때에는 re.sub('(\d{3})-(\d{2})(\d{2})-(\d{2})(\d{2})', r'\1-\2**-**\5', '010-1234-5678')이런식으로() 괄호 안에 \d 를 그냥 써주셨는데.. 자동차등록번호 마스킹할 때에는 re.sub("([0-9])([가-힣])([\d])([\d]{2})([\d])", r"*\2\3**\5", car_num) 이런식으로()괄호안에 \d를 쓸 때 [] 안에 넣는 이유는 무엇인가요? 별차이가 없는건지.. 왜 []를 써주었는지 궁금합니다..
-
미해결공공데이터로 파이썬 데이터 분석 시작하기
문자열에 뒤쪽에 * 넣으려고 하는데..
선생님~ 이번에는.. car_num = "32가나1234"에서 "32가*1234" 이렇게 만들려고 하는데.. 강의에서처럼 숫자에서는 마지막 한자리만 바뀌는게 되던데.. 문자에서는 적용이 왜 안되나요..?ㅠ 어떻게 해야 할까요?