묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part4: 게임 서버
static TypeConversion conversion, template argument 없는 경우
준비해주신 강의자료TypeCast.h153번줄에 있는 선언에 대한 질문입니다. static inline bool CanConvert(int32 from, int32 to){static TypeConversion conversion;return s_convert[from][to];} CanConvert 함수안에 있는 TypeConversion 타입의정적변수 선언이 문법적으로 잘 이해가 가지 않습니다 TypeConversion은 class template이기 때문에선언할 때 template argument값(=typeList)을 줘야 한다고 생각했습니다.(제가 생각했던 예시)ex) static TypeConversion<TL> conversion; 근데 예시 코드에는 생략하여도 잘 동작해서관련해서 어떤 문법인지 찾으려고 했는데 찾지 못했습니다 개인적으로 열심히 고민해봤는데 default type이 정해진 경우에 생략이 가능하고template function에는 인자 값을 통해 추론해템플릿 인자값을 생략하는 경우도 있었지만둘 다 해당하지 않는 것 같습니다 TypeConversion<TL>::CanConvert(ptr->_typeId, IndexOf<TL, remove_pointer_t<To>>::value)를 통해서 이미 template class가 인자 값을 받아서인스턴트화 했기 때문에 생략이 가능한 것으로 이해해도 괜찮을까요? -수정Injected-class-name 라는 cpp reference를 찾았습니다제가 궁굼해 하는게 이게 맞을까요?
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
JdbcMemberRepository 문제
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.이런 오류가 뜨는데 대체 어떻게 해결해야 할까요? ㅠㅠpackage hello.hello_spring.repository; import hello.hello_spring.domain.Member; import org.springframework.jdbc.datasource.DataSourceUtils; import javax.sql.DataSource; import java.sql.*; import java.util.ArrayList; import java.util.List; import java.util.Optional; public class JdbcMemberRepository implements MemberRepository{ private final DataSource dataSource; public JdbcMemberRepository(DataSource dataSource) { this.dataSource = dataSource; } @Override public Member save(Member member) { String sql = "insert into member(name) values(?)"; Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; try { conn = getConnection(); pstmt = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); pstmt.setString(1, member.getName()); pstmt.executeUpdate(); rs = pstmt.getGeneratedKeys(); if (rs.next()) { member.setId(rs.getLong(1)); } else { throw new SQLException("id 조회 실패"); } return member; } catch (Exception e) { throw new IllegalStateException(e); } finally { close(conn, pstmt, rs); } } @Override public Optional<Member> findById(Long id) { String sql = "select * from member where id = ?"; Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; try { conn = getConnection(); pstmt = conn.prepareStatement(sql); pstmt.setLong(1, id); rs = pstmt.executeQuery(); if(rs.next()) { Member member = new Member(); member.setId(rs.getLong("id")); member.setName(rs.getString("name")); return Optional.of(member); } else { return Optional.empty(); } } catch (Exception e) { throw new IllegalStateException(e); } finally { close(conn, pstmt, rs); } } @Override public List<Member> findAll() { String sql = "select * from member"; Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; try { conn = getConnection(); pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); List<Member> members = new ArrayList<>(); while(rs.next()) { Member member = new Member(); member.setId(rs.getLong("id")); member.setName(rs.getString("name")); members.add(member); } return members; } catch (Exception e) { throw new IllegalStateException(e); } finally { close(conn, pstmt, rs); } } @Override public Optional<Member> findByName(String name) { String sql = "select * from member where name = ?"; Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; try { conn = getConnection(); pstmt = conn.prepareStatement(sql); pstmt.setString(1, name); rs = pstmt.executeQuery(); if(rs.next()) { Member member = new Member(); member.setId(rs.getLong("id")); member.setName(rs.getString("name")); return Optional.of(member); } return Optional.empty(); } catch (Exception e) { throw new IllegalStateException(e); } finally { close(conn, pstmt, rs); } } private Connection getConnection() { return DataSourceUtils.getConnection(dataSource); } private void close(Connection conn, PreparedStatement pstmt, ResultSet rs) { try { if (rs != null) { rs.close(); } } catch (SQLException e) { e.printStackTrace(); } try { if (pstmt != null) { pstmt.close(); } } catch (SQLException e) { e.printStackTrace(); } try { if (conn != null) { close(conn); } } catch (SQLException e) { e.printStackTrace(); } } private void close(Connection conn) throws SQLException { DataSourceUtils.releaseConnection(conn, dataSource); } } error: JdbcMemberRepository is not abstract and does not override abstract method cleatStore() in MemberRepository public class JdbcMemberRepository implements MemberRepository{
-
미해결파이썬 무료 강의 (기본편) - 6시간 뒤면 나도 개발자
uninstall beautifulsoup4 했더니 인텔리제이를 삭제하려 하는데..
평소에 인텔리제이로 자바 공부를 하긴 했는데 이건 무슨 경운가요..
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
7-c 코드 질문입니다
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.제가 작성한 아래의 코드에서 항상 실제 답보다 1이 작게 나오는데 그 이유를 알 수 있을까요?#include <bits/stdc++.h> using namespace std; int n, m, ny, nx; int dy[] = {-1, 0, 1, 0}; int dx[] = {0, 1, 0, -1}; int mp[51][51]; int dp[51][51]; // 2차원 dp 배열로 수정 // dp[y][x]: 현재 위치에서 최대 몇 번 이동할 수 있는가? int move(int y, int x) { // 이미 계산된 값이 있으면 그 값을 반환 if (dp[y][x] != -1) return dp[y][x]; dp[y][x] = 0; // 이동 불가능한 상태로 설정 (기본값) // 4방향 탐색 for (int i = 0; i < 4; i++) { ny = y + mp[y][x] * dy[i]; nx = x + mp[y][x] * dx[i]; // 오버플로우 처리 및 구멍 처리 if (ny >= n || nx >= m || ny < 0 || nx < 0 || mp[ny][nx] == 0) continue; int ret = move(ny, nx); dp[y][x] = max(dp[y][x], ret + 1); // 현재 위치에서 한 번 이동하고 나서 계산 } return dp[y][x]; } int main() { cin >> n >> m; // 입력 받기 for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { char v; cin >> v; if (v == 'H') { mp[i][j] = 0; // 'H'는 구멍이므로 0으로 처리 } else { mp[i][j] = v - '0'; // 숫자는 변환해서 저장 } } } // DP 테이블 초기화 (-1로) memset(dp, -1, sizeof(dp)); // 배열 처리 확인 for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { cout << mp[i][j] << " "; cout << dp[i][j] << " "; } cout << "\n"; } // 첫 위치에서 최대 이동 횟수 계산 int result = move(0, 0); cout << result << "\n"; return 0; }
-
미해결Next + React Query로 SNS 서비스 만들기
rightSectionWrapper,leftSectionWrapper 중앙정렬 질문입니다!
flex 컨테이너 안에 rightSectionWrapper,leftSectionWrapper 에 각각 flex-grow:1을 주어 컨테이너의 남은 여백을 똑같이 가져가고 leftWrapper에는 flex-end, rightWrapper에는 flex-start를 주어 중앙정렬 처럼 보이게 나타내는 것까지는 이해 하였습니다.그런데 직접 코드를 작성하여 로컬에서 실행해보니 flex-grow가 적용이 되질 않습니다. . 개발자 도구를 확인해보면 분명 적용돼있는데 오른쪽 끝에 덩그러니 여백이 남아있습니다. 깃허브의 코드와 비교해보니 다른게 없어 ch2-1의 코드를 복붙해서 로컬에서 돌려봤더니 똑같이 flex-grow가 적용되지 않았습니다. 어떤 문제가 있어서 그런 것일까요 .. ? 코드는 문제가 없어 보이긴하는데 .. import { ReactNode } from "react"; import style from "@/app/(afterLogin)/layout.module.css"; import Link from "next/link"; import Image from "next/image"; import ZLogo from "../../../public/zlogo.png"; export default function AfterLoginLayout({ children, }: { children: ReactNode; }) { return ( <div className={style.container}> <header className={style.leftSectionWrapper}> <section className={style.leftSection}></section> </header> <div className={style.rightSectionWrapper}> <div className={style.rightSectionInner}> <main className={style.main}>{children}</main> <section className={style.rightSection}></section> </div> </div> </div> ); } .container { display: flex; align-items: stretch; background-color: #fff; } .leftSectionWrapper { display: flex; align-items: flex-end; flex-direction: column; flex-grow: 1; } .leftSection { background-color: orange; height: 100dvh; width: 275px; padding: 0 8px; } .rightSectionWrapper { display: flex; align-items: flex-start; height: 100dvh; flex-direction: column; flex-grow: 1; } .rightSectionInner { display: flex; flex-direction: row; background-color: aqua; width: 990px; height: 100%; } .rightSection { background-color: aquamarine; height: 100%; }
-
미해결입문자를 위한 코딩테스트 핵심(이론과 문제풀이) [Python]
[문제 5번] 중복제거
혹시 입력 받은 배열을 list(set(배열명))을 통해 중복을 제거한 후 deque 자료구조로 바꾸면 시간 복잡도상 문제가 될까요?
-
해결됨Kevin의 알기 쉬운 Spring Reactive Web Applications: Reactor 1부
Reactor 3부의 오픈 일정에 관해서 문의드립니다!
안녕하세요 최근에 Spring MVC 말고도 Spring WebFlux에 대해서도 관심을 가지게 되어 Reactor 공부를 막 시작한 주니어입니다. 해당 강의가 3부까지 기획되어 있는 것으로 강의소개를 봤었습니다. 강사님께서도 무척이나 바쁘시겠지만, 혹시 3부는 언제쯤 오픈할 예정이신지 여쭤봐도 될까요? 강의 잘 보고 있습니다! 감사합니다
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
2-e 해설보고 질문드립니다
답안으로 적어주신 코드에서 n=2 11 11 을넣었을땐 ()자체가 생성이안되는데 해설이 잘못된걸까요?
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
6-F 질문드립니다 :)
안녕하세요 선생님 🙂 한군데 이해가 가지 않는 부분이 있어서 질문드립니다. 아래의 코드는 Check함수에서 init_attack 변수를 설정하여 attack으로 초기화하도 않았을 뿐더러 아예 사용을 하지 않았습니다. 결론부터 말씀드리면 틀렸는데요, 이게 왜 틀린건지 이해가 되지 않습니다. 혹시 call by value인가요? 입력 값에서 용사의 공격력을 이미 입력받았고, 그 공격력을 포션방을 갔을 때 입력받은 용사의 공격력을 증가시키면 된다고 생각했는데요, 이게 왜 안되는걸까요?http://boj.kr/9ca6118540e54a259b26c070a1b20868
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
범위 체크 질문있습니다.
http://boj.kr/c5c442d82b24467fbbac115beed3793c와 같이저는 배열 [0][0]~[x-1][y-1]이 아니고 배열을 넉넉하게 잡아[0][0][0][0][0][0][0][0] // 사용 ______ _[0][0] _____________ _[0][0] _____________ _[0][0]_____________ _[0][0]_____________ _[0][0][0][0][0][0][0][0] 과 같은 형태로[1][1] ~ [x][y] 까지 활용을 했는데요. 문제가 메모리를 정말 타이트하게 잡지 않는 이상 선생님께서 말씀하신 범위체크하고 위 방법은 취향 차이라고 보면 될까요?
-
해결됨태블로를 향한 첫 걸음
Quick Table 값 동시에 여러 개 보기
Table Calculation 기능을 이용해서 테이블의 수치를 다양한 형태를 보고 싶은데요.예를 들어 Sales의 경우,Sales 기존 값 - 전체 구성 비율 - 누적 합계 등 이런 퀵테이블 계산결과를 각 열로 동시에 테이블 안에 보고 싶으면 어떻게 해야 할까요?
-
해결됨Airflow 마스터 클래스
data_interval_start가 배치일로 나오는 이유 문의
안녕하세요.우선 강사님, 좋은 강의 잘 듣고 있습니다. [섹션 5. Template Variable > Airflow 날짜개념] 강의 관련하여 질문 드립니다. Airflow 2.10.0 버전 사용 중이며, 강의와 같이 테스트를 진행하였는데, data_interval_start이 이전 배치일이 아닌 배치일로 나와서 문의드립니다.DAG의 start_date를 2024년 9월 1일로 설정 후 소급 처리하였습니다. 아래와 같이 dag_run이 배치일일텐데, 왜 data_interval_start가 이전 배치일(2024.08.31)이 아닌 배치일로 나올까요?'dag_run': <DagRun dags_python_show_templates @ 2024-09-01 00:30:00+00:00: scheduled__2024-09-01T00:30:00+00:00, state:running, queued_at: 2024-09-06 09:11:26.187022+00:00. externally triggered: False>,'data_interval_end': DateTime(2024, 9, 2, 0, 30, 0, tzinfo=Timezone('UTC')),'data_interval_start': DateTime(2024, 9, 1, 0, 30, 0, tzinfo=Timezone('UTC')),'ds': '2024-09-01',
-
미해결
Exploring the Benefits of Super Vidalista for Men’s Sexual Health
Super Vidalista has gained attention for its ability to tackle two of the most common sexual health issues faced by men—erectile dysfunction (ED) and premature ejaculation (PE). This dual-action medication combines two key active ingredients: Tadalafil and Dapoxetine, which together provide a comprehensive approach to improving sexual performance and overall satisfaction. Understanding the benefits of Super Vidalista can help men regain confidence and enhance their intimate relationships.How Super Vidalista WorksSuper Vidalista contains 20 mg of Tadalafil and 60 mg of Dapoxetine. These two components work in different but complementary ways.Tadalafil, a phosphodiesterase type 5 (PDE5) inhibitor, is responsible for improving blood flow to the penis. It relaxes the blood vessels, allowing more blood to enter during sexual stimulation, which results in a firmer, longer-lasting erection. Tadalafil’s effects can last up to 36 hours, earning it the nickname “the weekend pill.” This prolonged effectiveness allows men more flexibility in choosing the right time for intimacy, without the pressure of timing their medication perfectly.Dapoxetine, on the other hand, is a selective serotonin reuptake inhibitor (SSRI) that is specifically designed to treat premature ejaculation. It increases serotonin activity in the brain, which can delay ejaculation and extend the duration of sexual activity. By combining these two ingredients, Super Vidalista provides a dual-action solution for men who face both ED and PE, a common co-occurrence.Benefits of Super Vidalista for Sexual HealthImproved Erectile Function Erectile dysfunction can have a profound impact on a man’s self-esteem and relationships. By helping men achieve and maintain an erection, Super Vidalista restores confidence in sexual performance. Tadalafil works by increasing blood flow, which is essential for a strong erection. Men who struggle with the ability to maintain an erection long enough for satisfying sexual intercourse can greatly benefit from this.Prolonged Sexual Activity Premature ejaculation is another concern that can lead to frustration and anxiety in intimate relationships. Dapoxetine, the second key ingredient in Super Vidalista, helps men take control of their ejaculation timing, allowing for longer-lasting sexual experiences. This can significantly improve satisfaction for both partners.Enhanced Intimacy and Emotional Well-Being Sexual performance issues such as ED and PE can create stress and tension in relationships. Super Vidalista addresses these problems, leading to a more satisfying sexual experience for both partners. By helping men regain control over their sexual health, the medication can improve emotional intimacy, strengthen bonds, and reduce performance-related anxiety.Convenient Dual Therapy One of the standout benefits of Super Vidalista is its combination of two treatments in a single pill. Men no longer need to take separate medications for ED and PE, which simplifies the treatment process. This dual-action therapy offers convenience and efficiency, particularly for men who struggle with both conditions.Long-Lasting Effects Tadalafil’s long half-life means that the effects of Super Vidalista can last up to 36 hours. This offers men more freedom in their sexual lives, removing the need for last-minute planning or worrying about the medication wearing off too quickly. The long-lasting effects allow for more spontaneous intimacy, further reducing stress and enhancing enjoyment.Boosted Confidence and Reduced Anxiety Sexual health issues often lead to feelings of inadequacy, low self-esteem, and anxiety. By addressing both erectile dysfunction and premature ejaculation, Super Vidalista helps men regain control of their sexual function. This can lead to a significant boost in confidence, which often extends beyond the bedroom and into other areas of life.ConclusionSuper Vidalista offers a comprehensive solution for men who experience both erectile dysfunction and premature ejaculation. With its unique combination of Tadalafil and Dapoxetine, it improves erectile function, prolongs sexual activity, and enhances overall sexual satisfaction. For men who face the dual challenge of ED and PE, Super Vidalista can be a life-changing medication, helping them regain confidence, improve intimate relationships, and enjoy a more fulfilling sexual experience. Its long-lasting effects and dual-action formula make it a convenient and effective option for men looking to enhance their sexual health and well-being.
-
미해결
강의 재생 안됨
아이패드로 강의를 듣고 있습니다.사파리로 5회차까지 듣다가 6회차부터 로딩만 계속 되고 실행이 되지않아서 크롬으로 설치하여 다시 시도했는데도 같은 상태가 반복되고 있습니다.
-
해결됨[리뉴얼] 처음하는 SQL과 데이터베이스(MySQL) 부트캠프 [입문부터 활용까지]
(맥환경) workbench 이용할 때 패스워드 입력 안해도 자동으로 활성화 가능해져요..
본문제목 그대로 워크 벤치 이용할 때, 항상 패스워드를 입력한 후 활성화 되는 것으로 알고 있었는데, 현재 패스워드 입력 안하고 그냥 클릭만 해도 활성화됩니다. 보안상으로 좋지 않은 것 같은데, 혹시 이런 경우 어떻게 변경이 가능할까요? 오랜만에 mysql을 공부하는데 몇년 전에는 항상 패스워드 입력했던 것 같은데 이번에 새로 깔아보니 패스워드 입력 안해도 실행이 되어 불안합니다. 참고로 저는 맥 환경에서 사용하고 있습니다.
-
미해결자바 동시성 프로그래밍 [리액티브 프로그래밍 Part.1]
자식 프로세스를 쓰는 이유
안녕하세요 선생님, 강의 정말 잘 듣고 있습니다.2장의 내용을 복습하다가 궁금한 점이 생겼어요 여러개의 자식 프로세스를 사용하는 것과 멀티스레드를 사용하는 것의 목적이 서로 상이할까요? 아파치의 woker mpm 방식의 경우에는자식 프로세스도 여러 개 생성하고 각각의 자식 프로세스들이 멀티 스레드 방식을 사용하고 있어서요... 어떤 이점을 취할 수 있는 경우에 자식 프로세스를 혹은 멀티 스레드를 선택하는 건가요? 제가 생각하기로 멀티스레드만을 사용할 경우에는 비교적 메모리 리소스를 효율적으로 사용할 수 있지만, 가용성을 위해 여러 대의 서버 장비를 두어야 하고자식 프로세스가 많을 경우 한 서버의 자원은 많이 먹지만 하나의 장비 내 가용성이 높아지지 않을까 추측하고 있습니다...
-
미해결Nuxt.js 시작하기
nuxt 최신버전 설치 후 layouts 없어서 직접 폴더 생성 후 문제
nuxt 최신버전 설치 후 layouts 없어서 직접 폴더 생성 후 문제인데요.error.vue 는 문제없이 실행되는데default.vue 생성시 pages에 있는 내용은 하나도 안나오고default.vue에 있는 내용만 똑같이 나오는 현상이 나옵니다.default.vue 내용만 나옴 default.vue 삭제시
-
미해결이득우의 언리얼 프로그래밍 Part1 - 언리얼 C++의 이해
UObject 타입과 가비지 콜렉션 질문
UObject 를 상속한 멤버이기 때문에 가비지 콜렉터로 관리가 되는 건지, 아니면 TObjectPtr<> 로 인해 가비지 콜렉터로 관리되는 건지 궁금합니다. 멤버가 TObjectPtr<UObject>이 아닌 UObject* 타입으로 되있을 때도 가비지 콜렉터가 작동되서 UPROPERTY() 를 붙이지 않는 한 자동으로 지워지는 건가요??
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
3-A 코드확인 부탁드립니다.!
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요! 강의 듣고 변수만 바꿔서 테스트해서 예제는 통과했는데 제출하니까 에러가 발생해서 ㅜㅜ 코드 한번 확인 부탁드립니다. http://boj.kr/052be6c86bf945e5a945a7682b12f2aa
-
해결됨실전 jOOQ! Type Safe SQL with Java
from절 subquery table filed nullable 처리
안녕하세요. 강의 잘 듣고있습니다.다름이 아니라 subquery 실습 중 nullable method 처리가 안되어 질문 드립니다. asTable() method 사용하여 Table<Record> 인스턴스 subTable 생성 후 subTable.field() method 호출 시 Nullable한 method이기 때문에 NPE 발생 가능 경고가 발생합니다. 서브쿼리가 아닌 generated된 객체의 경우에는 발생하지 않아 비슷한 방식으로 해결해보기 위해 구글링해보았지만 뚜렷한 해결방법이 나오지 않아서요. 특정 객체로 mapping 혹은 NPE 발생 가능성을 compile level에서 처리 가능하게끔 해결 가능할까요?