묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결CSS Flex와 Grid 제대로 익히기
display: flex와 display:none 함께 사용하는 법.
안녕하세요 1분코딩 너무나도 재밌게 듣고있는 수강생입니다 ^^ 선생님 제가 flex를 이용해서 메뉴바를 만드는데 (2단으로 만듭니다. float : left로 사용해왔는데) display:none을 flex와 같이 사용하면 display:none을 적용하면 플랙스 적용된 위치가 자꾸바뀌어요! 제이쿼리나 자바스크립트를 이용해서 display했던 것을 보이게 하면 또 바뀌어있고요! 이거 해결방법있으실까요?ㅠㅠ
-
미해결플러터와 장고로 1시간만에 퀴즈 앱/서버 만들기 [무작정 풀스택]
에러 문의 드립니다
에러 메세지떄문에 문의 드립니다 4분30초정도까지 따라 왔는데 이런에러때문에 에물레이션이 실행이 되질않습니다 재가 혹시 놓친 부분이 있을까요???
-
미해결파이썬 무료 강의 (활용편1) - 추억의 오락실 게임 만들기 (3시간)
공에 무기가 닿았을 때 공이 안 사라져요
import pygame, os from pygame.constants import K_LEFT, K_RIGHT pygame.init() # 초기화 (항상 적어야 하는것) pygame.mixer.init() # 화면 크기 screen_width = 640 # 가로 screen_height = 480 # 세로 screen = pygame.display.set_mode((screen_width, screen_height)) # 화면 설정 # 화면 타이틀 pygame.display.set_caption("dudcks pang") # 게임 이름 current_path = os.path.dirname(__file__) # 현재 파일의 위치 반환 image_path = os.path.join(current_path, "images") music_path = os.path.join(current_path, "music") # 배경 만들기 background = pygame.image.load(os.path.join(image_path, "background.png")) # 스테이지 만들기 stage = pygame.image.load(os.path.join(image_path, "stage.png")) stage_size = stage.get_rect().size stage_height = stage_size[1] # 스테이지의 높이 위에 캐릭터를 두기 위해 사용 # 캐릭터 만들기 character = pygame.image.load(os.path.join(image_path, "character.png")) character_size = character.get_rect().size character_width = character_size[0] character_height = character_size[1] character_x = (screen_width / 2) - (character_width / 2 ) character_y = screen_height - character_height - stage_height # 캐릭터 이동 방향 character_to_x = 0 # 캐릭터 이동 속도 character_speed = 5 # 무기 만들기 weapon = pygame.image.load(os.path.join(image_path, "weapon.png")) weapon_size = weapon.get_rect().size weapon_width = weapon_size[0] # 무기는 한 번에 여러발 발사 가능 weapons = [] # 무기 이동 속도 weapon_speed = 10 # 공 만들기 (4개 따로 처리) ball_images = [ pygame.image.load(os.path.join(image_path, "balloon1.png")), pygame.image.load(os.path.join(image_path, "balloon2.png")), pygame.image.load(os.path.join(image_path, "balloon3.png")), pygame.image.load(os.path.join(image_path, "balloon4.png"))] # 공 크기에 따른 최초 스피드 ball_speed_y = [-18, -15, -12, -9] # index 0, 1, 2, 3 에 해당되는 값 # 공들 balls = [] # 최초 발생하는 큰 공 추가 balls.append({ "pos_x" : 50, # 공의 x좌표 "pos_y" : 50, # 공의 y좌표 "img_idx" : 0, # 공의 이미지 인덱스 "to_x" : 3, # x축 이동방향 "to_y" : -6, # y축 이동방향 "init_spd_y" : ball_speed_y[0] }) # y 최초 속도 # 사라질 무기, 공 정보 저장 변수 weapon_to_remove = -1 ball_to_remove = -1 # 음악 music = pygame.mixer.music.load(os.path.join(music_path, "music.mp3")) pygame.mixer.music.set_volume(0.2) pygame.mixer.music.play() MUSIC_END_EVENT = pygame.USEREVENT + 1 pygame.mixer.music.set_endevent(MUSIC_END_EVENT) # FPS clock = pygame.time.Clock() # 이벤트 루트 running = True while running: dt = clock.tick(30) # 초당 프레임 수 for event in pygame.event.get(): # 들어오는 이벤트를 받아옴 if event.type == pygame.QUIT: # X버튼을 눌렀을때 running = False if event.type == pygame.KEYDOWN: # 키 이벤트 if event.key == pygame.K_LEFT: character_to_x -= character_speed elif event.key == pygame.K_RIGHT: character_to_x += character_speed elif event.key == pygame.K_SPACE: # 무기 발사 weapon_x = character_x + (character_width / 2) - (weapon_width / 2) weapon_y = character_y weapons.append([weapon_x, weapon_y]) if event.type == pygame.KEYUP: if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT: character_to_x = 0 if event.type == MUSIC_END_EVENT: pygame.mixer.music.play() # 캐릭터 위치 정의 character_x += character_to_x if character_x < 0: character_x = 0 elif character_x > screen_width - character_width: character_x = screen_width - character_width # 무기 위치 조정 # 100, 200 -> 180, 160, 140, ... # 500, 200 -> 180, 160, 140, ... weapons = [ [w[0], w[1] - weapon_speed] for w in weapons] # 천장에 닿은 무기 없애기 weapons = [ [w[0], w[1] - weapon_speed] for w in weapons if w[1] > 0] # 공 위치 정의 for ball_idx, ball_val in enumerate(balls): ball_pos_x = ball_val["pos_x"] ball_pos_y = ball_val["pos_y"] ball_img_idx = ball_val["img_idx"] ball_size = ball_images[ball_img_idx].get_rect().size ball_width = ball_size[0] ball_height = ball_size[1] # 가로 벽에 닿았을때 공 이동 위치 변경 (튕겨 나오는 효과) if ball_pos_x <= 0 or ball_pos_x > screen_width - ball_width: ball_val["to_x"] = ball_val["to_x"] * -1 # 세로 위치 # 스테이지에 튕겨서 올라가는 처리 if ball_pos_y > screen_height - stage_height - ball_height: ball_val["to_y"] = ball_val["init_spd_y"] else: # 그 외의 모든 경우에는 속도를 증가 ball_val["to_y"] += 0.5 ball_val["pos_x"] += ball_val["to_x"] ball_val["pos_y"] += ball_val["to_y"] character_rect = character.get_rect() character_rect.left = character_x character_rect.top = character_y for ball_idx, ball_val in enumerate(balls): ball_pos_x = ball_val["pos_x"] ball_pos_y = ball_val["pos_y"] ball_img_idx = ball_val["img_idx"] # 공 rect 정보 업데이트 ball_rect = ball_images[ball_img_idx].get_rect() ball_rect.left = ball_pos_x ball_rect.top = ball_pos_y # 공과 캐릭터 충돌 처리 if character_rect.colliderect(ball_rect): running = False break # 공과 무기들 충돌 처리 for weapon_idx, weapon_val in enumerate(weapons): weapon_x = weapon_val[0] weapon_y = weapon_val[1] # 무기 rect 정보 업데이트 weapon_rect = weapon.get_rect() weapon_rect.left = weapon_x weapon_rect.top = weapon_y # 충돌 처리 if weapon_rect.colliderect(ball_rect): weapon_to_remove = weapon_idx ball_to_remove = ball_idx # 가장 작은 크기의 공이 아니라면 다음 단계의 공으로 나눠주기 if ball_img_idx < 3: # 현재 공 크기 정보를 가지고 옴 ball_width = ball_rect.size[0] ball_height = ball_rect.size[1] # 나눠진 공 정보 small_ball_rect = ball_images[ball_img_idx + 1].get_rect() small_ball_width = small_ball_rect.size[0] small_ball_height = small_ball_rect.size[1] # 왼쪽으로 튕겨나가는 작은 공 balls.append({ "pos_x" : ball_pos_x + (ball_width / 2) - (small_ball_width / 2), # 공의 x좌표 "pos_y" : ball_pos_y + (ball_height / 2) - (small_ball_height / 2), # 공의 y좌표 "img_idx" : ball_img_idx + 1, # 공의 이미지 인덱스 "to_x" : -3, # x축 이동방향 "to_y" : -6, # y축 이동방향 "init_spd_y" : ball_speed_y[ball_img_idx + 1] }) # y 최초 속도 # 오른쪽으로 튕겨나가는 작은 공 balls.append({ "pos_x" : ball_pos_x + (ball_width / 2) - (small_ball_width / 2), # 공의 x좌표 "pos_y" : ball_pos_y + (ball_height / 2) - (small_ball_height / 2), # 공의 y좌표 "img_idx" : ball_img_idx + 1, # 공의 이미지 인덱스 "to_x" : 3, # x축 이동방향 "to_y" : -6, # y축 이동방향 "init_spd_y" : ball_speed_y[ball_img_idx + 1] }) # y 최초 속도 break # 충돌된 공 or 무기 삭제 if ball_to_remove > -1: del balls[ball_to_remove] ball_to_remove = -1 if weapon_to_remove > -1: del weapons[weapon_to_remove] weapon_to_remove = -1 # 화면 그리기 screen.blit(background, (0, 0)) for weapon_x, weapon_y in weapons: screen.blit(weapon, (weapon_x, weapon_y)) for idx, val in enumerate(balls): ball_pos_x = val["pos_x"] ball_pos_y = val["pos_y"] ball_img_idx = val["img_idx"] screen.blit(ball_images[ball_img_idx], (ball_pos_x, ball_pos_y)) screen.blit(stage, (0, screen_height - stage_height)) screen.blit(character, (character_x, character_y)) pygame.display.update() # 게임 화면 다시 그리기 (항상 적어야 하는것) # pygame 종료 pygame.quit 이렇게 해봤는데 어떨때는 잘 되고 어떨때는 작은 공들이 우수수 나와요
-
미해결[리뉴얼] React로 NodeBird SNS 만들기
사가 재로딩방법 문의
안녕하세요 강의덕분에 나름 완성도 있는 시스템을 만들수있어 감사합니다 다른게 아니라 usestate에서 디스패치를 쓰면 한번읽어온후 다시읽어오지를 않는데 api재로딩 방법이 있을까요??
-
미해결Do it! 자바 프로그래밍 입문 with 은종쌤
클래스와객체 1 (2)
8:59쯤에서 n1 과 n2과 위에 num1 num2 와 관련이 없다고하셨는데 , 어떻게 sysmte.out.printlnI(sum)했을경우 40이 나오나요? 위에꺼랑 아래 함수가 어떻게 연결이 되나요?
-
미해결일주일 완성! 3dsmax 입문 (자동차 및 캐릭터 만들기)
단축키 불러오기를 못하고 있어요 핫키에디터가 없어요!
- 사진 첨부합니다 커스텀마이즈로 들어갔는데 영상에는 두번째에 핫키에디터가있는데 저는 그게 보이지 않아서 단축키 등록을 할 수가 없어요 다른 강의도 결제를 했기때문에 초급에서 고급까지 강좌에 등록하라는 단축키를 수기로 입력을 해서 강좌를 보던 중입니다... 중간에 단축키가 먹히지 않는게 있어서 누락된 것이 있는거 같아 첨부해주신 파일 이용해서 등록하려는데 핫키에디터가 없으니 어떻게 등록을 해야할지 모르겠어요 ㅠㅠㅠㅠ무슨 문제인가요 ???
-
미해결[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
강의중 궁금점이 jwt.sign , jwt.verify 는 왜 await을 넣어주지않는거죠?
jwt.sign, jwt.verify 보면 이러이런걸 확인하고 맞으면 통과 아니면 에러 이런식인것같은데 그러면 비동기함수이고 await을 넣어줘야하는거아닌가요?
-
미해결[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part4: 게임 서버
락프리큐 관련해서 문의드립니다
락프리큐 강의의 참고자료를 다운받아 우선 실행해 보았는데 첨부한 이미지처럼 에러가 발생합니다.. 매번 발생하거나 즉시 발생하지는 않습니다. 실행 환경은 Push만 하는 스레드 4개, Pop만 하는 스레드 4개를 동시에 실행시키고 무한으로 돌리는 환경입니다.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
포인트컷 조인포인트 질문드립니다.
조인포인트와 포인트컷의 차이를 찾아봐도 정확하게 모르겟는데 무슨 차이가 있는지 궁금합니다. 이 코드에서 "execution"은 포인트컷 지정자로 이해하고 있고 조인포인트는 advice적용될 위치라는 개념으로 알고있는데요 jpabook.jpashop.service.. 이 부분이 조인포인트인가요?
-
미해결iOS 개발을 위한 swift5 완벽 가이드
해당 강의 코드 그대로 쳤는데 동작이 안돼요.
삭제된 글입니다
-
미해결
스프링부트에서 MariaDB 연동 관련 에러
안녕하세요. 스프링부트 프로젝트를 아래와 같이 생성하고, DB 정보를 application.yml에 기재하였음에도 아래와 같은 에러가 뜨는데 도저히 해결이 안되네요... 도움 부탁드립니다 ㅠ Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test'} spring: datasource: hikari: data-source-class-name: org.mariadb.jdbc.Driver # jdbc-url: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&characterEncoding=UTF-8 jdbc-url: jdbc:mariadb://localhost:3306/test?characterEncoding=UTF-8&serverTimezone=UTC username: test password: 1229 connection-test-query: SELECT 1
-
미해결따라하며 배우는 도커와 CI환경 [2023.11 업데이트]
강의자료 불일치
강의중에 쓰이는 자료와 올려주신 자료가 다릅니다. 일치하는 자료 부탁드립니다.
-
미해결자바 스프링부트 활용 웹개발 실무용
submit후 리턴되는 곳이...이상하네요
ajax로 submit을 하였고 title과 contents값이 없으면 save메소드에서 throw new BaseException~ 을 던지게 되는데~~ 그러면 ajax문장중에 success쪽이 아닌 error쪽으로 저는 들어오는데 강사님 강좌는 에러가 아닌것으로 success쪽으로 들어오는데 그 차이는 뭔가요? success:function(data){ if(data.code=='SUCCESS') { }else{ alert(data.message) } console.log(data) }, error:function(e){ console.log(e) }
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
경로 이동이 안됍니다..
강의 내용 처럼 url주소로 이동해 봤는데 안돼네요. 뭐가 잘못 됬을까요> ㅜ
-
미해결딥러닝 CNN 완벽 가이드 - TFKeras 버전
여러 샘플마다의 데이터 편차를 수학적으로 정규화할 수 있나요?
안녕하세요 https://www.inflearn.com/questions/231229 이전에 남긴 질문에서 내용을 보완해서 남겨봤습니다 이상 탐지 기술에 사용한 것은 위 논문과 같으며 https://arxiv.org/abs/2011.08785 결론적으로는 pretrained 모델을 통과한 피처맵 레이어를 3개를 뽑습니다. 그리고 3개의 레이어는 여러 개의 필터가 있으니, 여러 개가 concat한 상황에서 여기서 랜덤하게 뽑고, 뽑은 것에 대해서 마할노비스 거리를 구해서 결국엔 score map이라는 것을 구하게 됩니다 추론 단계에서 똑같이 테스트 이미지에 대해서 score map을 구하고 훈련에서 구한 score map과 비교해 편차가 있는 것에 대해서 이상탐지를 찾아내는 과정입니다 그런데 이게 클래스 하나씩 테스트하면 잘 동작을 하는데, 만일 여러 클래스를 한 번에 입력으로 넣어서 score_map을 구하게 되면 기존 결과를 보여드렸듯이 나오게 됩니다. 즉, 클래스마다 score_map 평균이 다르게 됩니다. 물론 해결방법이 없으면 score_map을 원론적으로 고쳐야 하는데, 지금은 후처리가 가능하게끔 생각해보고 싶습니다 문제점을 요약하면, 각 스코어가 대략적으로 저렇게 클래스마다 분포되어 있습니다 그런데, 이를 표준화나 정규화를 하면, 예를 들어 표준화를 하면 제가 기대했던 것은 평균이 0으로 오고, threshold를 구할 수 있을 것이라고 예상했는데, 표준화를 구하는 식에 편차가 들어가 있다보니까 서로의 클래스 범위가 편차가 다르다보니 표준화를 해도 이게 적용이 되어서 맨 마지막 사진과 같이 크게 의미가 없어져서요 혹시 클래스마다 픽셀간의 편차를 같게 해주는 방법이 있을까요? 내용이 부족하면 더 추가해보겠습니다
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
ReferenceError: React is not defined
App.js 에 React를 import 하지 않을 경우 ReferenceError: React is not defined 라는 에러가 나오면서 화면이 출력되지 않습니다. 왜 저는 다른 걸까요? 상단 배너나 헤드라인도 그렇고 강의와 차이가 많이 나는 것 같습니다.
-
미해결[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문
함수 객체 질문
함수 객체라는것이 객체를 생성하고 그걸 () 로 오버로딩 된 함수를 호출 하는것 아닌가요?? auto findit = std::find_if(v.begin(), v.end(), FinditemByItemId(itemid)) 의 finditembyitemid는 그냥 객체를 생성해주는것아닌가요? finditembyitemid(int itemid) 라는 생성자를 통해서요. 디버깅을 해보면 저 저것만으로도 bool operator() 가 실행이 되던데 그게 자동으로 되는것인가요? 그러니깐 즉 finditembyitemdid(itemid) 이것이 조건식으로 부합되는 이유가 궁금합니다. 그저 객체를 생성하는것만 하는것이 아닌.
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
배너가 나오지 않습니다.
안녕하세요. 유익한 강의를 잘 보고 있습니다. 그런데 Carousel 컴포넌트가 표시가 되지 않습니다. <ScrollView> <Carousel data={banners} sliderWidth={Dimensions.get("window").width} itemWidth={Dimensions.get("window").width} itemHeight={200} renderItem={(obj) => { return ( <TouchableOpacity onPress={() => { Alert.alert("배너 클릭"); }} > <Image style={styles.bannerImage} source={{ uri: `${API_URL}/${obj.item.imageUrl}` }} resizeMode="contain" /> </TouchableOpacity> ); }} /> <Text style={styles.headline}>판매되는 상품들</Text> 이와 같이 했는데 최상단에 판매되는 상품들부터 출력이 됩니다. 무엇이 잘못된 것일까요?
-
미해결윤재성의 만들면서 배우는 Spring MVC 5
2021년 최신 이클립스 IDE 진짜 발암이네요.. ;
삭제된 글입니다
-
해결됨모든 개발자를 위한 HTTP 웹 기본 지식
DNS 관련 질문입니다.
nslookup 같은 툴을 이용해서 google.com을 조회하면 172.217.175.78 IP를 확인할 수 있는데요. 이 주소를 443 포트와 결합하여 브라우저에서 접근하면 에러 메시지가 나타나서 80번 포트와 결합하여 접근해야 하는데 이동하는 페이지는 HTTPS로 보호가 되어있는 것으로 확인됩니다. 이 경우에는 HTTPS 연결을 하되 포트만 80번 포트를 사용하는 것인지 아니면 80번 포트로 접근하면 리다이렉트를 통해 다른 IP주소의 443 포트로 연결해주는 것인지 궁금합니다~ 그리고 리다이렉트 시나리오가 맞다면 이런식으로 리다이렉트를 시켰을 때 이점이 무엇인지도 궁금합니다~