묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨스프링 DB 2편 - 데이터 접근 활용 기술
DB강의 듣다 강이ppt의 외래키 부분을 보고 궁금증이 생겨 질문 남깁니다.
웹 개발을 할 때 DDL을 통해 생성되는 테이블들은 모두 서비스에서 사용되는 객체들을 보고 만드는것 같은데 (예를 들면 Member 클래스, Item클레스들을 생각했습니다)만약 어떤 회원 A가 아이템A를 등록하였으면 데이터 베이스의 회원과 아이템 사이에는 등록이라는 관계가 생성이 되고 회원 1명은 아이템을 여러개 등록이 가능하다면 Member 테이블의 PK를 Item 테이블의 FK로 등록되며 Item 테이블의 속성들은 (id, item_name, price, quantity, member_id)로 설정이 될것 같은데 이런 경우 Item 클레스의 멤버변수로Member member_id; 를 생성해주어야 할것 같은데 이런 외래키 값은 도메인을 설계할때 어떻게 처리해야 하나요?그리고 api로 통신할 때 클라이언트 에게 데이터를 넘겨줄 때 스프링 입문 강의에서 hello 객체자체를 return 하면 스프링의 잭슨라이브러리가 json포멧으로 변환해서 넘겨준다고 해주셨는데 여러개의 테이블이 조인된 결과를 json으로 반환 해주려면(예를 들어서 멤버 A가 등록한 아이템의 이름과 가격, 멤버의 이름을 요청한다면 반환되는 튜플이 item_name, price, member_name) 이것들은 하나의 객체가 아닌 Member클래스와 Item클래스의 일부 변수들을 사용한 새로운 값들인데 이럴때는 어떤 방법으로 return해주어야 하나요? 클라이언트측과 조율을 하여 검색되는 조건을 설정하여 조인검색의 제약을 설정하나요? 제약을 설정한다면 반환할 때 (item_name, price, member_name)이 3개의 속성들을 멤버변수로 사용하는 새로운 클래스를 생성하여 반환해 주어야 하나요?
-
미해결실리콘밸리 엔지니어가 가르치는 파이썬 기초부터 고급까지
shallow copy를 쓰긴하나요?
쓰는 곳이 있나요? 예시가 생각이 나지않네요. assingment랑 비슷하면서 다르긴 하나. assignment는 복사란 개념보단 직접 그 point한 메모리안의 값을 assign 한다는 의미로 받았고. shallow copy 는 새로운 메모리 공간 안에 값들을 복사 하고자(reference value)하는 memory의 address를 point해서 reference 값을 가져온다는 의미로 이해했습니다.shallow copy를 했을 때랑 assignment 했을 때랑 =, [:]말곤 차이를 잘 못느끼겠습니다. 다른 건 그냥 assign하는 memory address만 다르다로만 이해했습니다. hard copy는 새로운 memory안에 복사 하고자 하는 값도 똑같이 복사한다는 걸로 이해했습니다.
-
미해결
Benefits of Utilizing PerfectEssayWriter.ai's AMA Format Generator
Are you struggling to format your academic papers in the AMA style? PerfectEssayWriter.ai has got your back with its AMA Format Generator. But first, let's understand what the AMA format is, the role of citation machines in it, and how PerfectEssayWriter.ai can make your academic life easier.What is AMA Format?The AMA style also known as the American Medical Association is widely used in writing medical, health, and biological sciences. It gives direction on citing sources, formatting papers, and making references. According to the AMA format, citations are numbered consecutively following the order of appearance within the text while references are listed at the end of the paper in numerical order.Role of Citation Machine in AMA FormatThe citation tool plays a crucial role in simplifying the process of formatting references in AMA style. They help in generating accurate citations for various sources like books, journals, websites, and more, saving time and ensuring consistency in formatting.PerfectEssayWriter.ai's AMA Format Generator PerfectEssayWriter.ai is a free AI essay writer no sign up needed platform. This innovative tool utilizes advanced artificial intelligence technology to generate high-quality essays on a variety of topics. With its user-friendly interface, users can input their essay prompts and receive well-crafted essays tailored to their specifications. PerfectEssayWriter.ai prioritizes user privacy and security, offering a completely anonymous writing experience. Overall, it's a convenient and effective solution for anyone in need of quality written content without the hassle of signing up.PerfectEssayWriter.ai provides a citation machine feature that supports various citation formats. Users can easily generate citations in different styles such MLA, APA, Chicago, Harvard, and more. AMA Citation Generator The AMA Format Generator is an online tool developed by PerfectEssayWriter.ai that helps students and researchers simplify their document preparations when using the AMA format. This program automatically produces reference lists and formats citations as per AMA instructions so that students do not have to manually arrange them risking mistakes during this process.Benefits of Using PerfectEssayWriter.ai's AMA Format Generator✅ Accurate Citations: Through sophisticated algorithms the software generates citations that strictly conform to your chosen citation style’s specific directions. It ensures every comma, period, or title is placed correctly thus maintaining the integrity of your work.🧾 In-Text & Full Citations: Generate both in-text citations and comprehensive full citations. In-text citations direct readers to the full details in the reference list, while full citations provide all necessary information for locating the source.👍 Easy-to-Use Interface: Navigate the complexities of referencing with ease through the tool's intuitive and user-friendly interface. Clear prompts and straightforward steps make generating citations a breeze for users of all levels.🚫 No Ads Blockage: Enjoy an uninterrupted and distraction-free citation experience with the ad-free citation machine. Maintain focus and productivity without encountering annoying ads that could hinder your workflow.⏱ Quick Results: No more waiting around; the tool swiftly generates accurate citations within 60 seconds. Focus more on your writing as unnecessary delays in the referencing process are eliminated.How to Use PerfectEssayWriter.ai's AMA Format Generator?Navigating PerfectEssayWriter.ai's AMA Format Generator is a straightforward process accessible to all users. Using the Citation FinderEnter Your Topic: Users are prompted to articulate their paper's subject matter, enabling the tool to curate sources aligned with their topic.Specify Source Quantity: Users can indicate the number of sources required for their project, ensuring precision in the search results.Pick Source Type: Users categorize their sources by type, such as books or websites, facilitating targeted searches.Time Frame: Users specify their preference for source recency, ensuring relevance to contemporary research.Upon completion of these steps, users receive citation suggestions tailored to their paper's topic, ready to be seamlessly integrated into their work. Using the Citation GeneratorEnter URL or Title: Users provide the URL or title of the source they wish to cite, simplifying the citation process. Using the Annotation GeneratorEnter Your Topic: Users input their paper's topic to facilitate the search for relevant references and annotations.Specify Source Quantity: Users specify the number of sources required for their project, tailoring the results to their needs.Upon hitting 'Generate', users receive pertinent references for their paper, accompanied by concise annotations conforming to their chosen citation format. ConclusionPerfectEssayWriter.ai's AMA Format Generator excels at saving time. It automates citation and reference formatting so that you don’t have to manually organize all the sources yourself. This allows you to concentrate on research, data analysis, and creating a powerful argument for your paper. PerfectEssayWriter.ai also offers other citation formats such as APA, Chicago formats, and more. FAQsIs PerfectEssayWriter.ai's AMA Format Generator free to use?Yes, the AMA Format Generator is available for free to all users. There are no subscription fees or hidden charges - simply access the tool on the website and start formatting your papers instantly.Can I cite various types of sources using this generator?Its generator supports a wide range of sources, including books, journals, websites, conference proceedings, and more. Whether you're citing a scholarly article, a book chapter, or an online source, you can rely on tools to generate accurate citations for your paper.Is there a limit to the number of citations I can generate?With PerfectEssayWriter.ai’s AMA Format Generator, there is no limit as to how many citations can be generated for your work. You are encouraged to generate as many citations and references as necessary to support your arguments and ideas regardless of whether you are working on a brief essay or an extensive research paper. Other Useful ResourcesHow to use PerfectEssayWriter.ai's Harvard Reference GeneratorWhat is a Citation Generator and How Does it Work in 2024Bluebook Citation Machine, website that can write essays for you free, citation generator
-
미해결
🚨D-1🚨팀 "포춘 쿠키" 디자이너 모집 😊
팀 "포춘 쿠키" 디자이너 모집 😊🚨D-1🚨 🤗 UX/UI 디자이너를 모집합니다!! 🤗✨ 앱 UI/UX 디자인 경험을 쌓고 싶은데 어떻게 시작해야 할지 막막한 분✨ 본인의 UI/UX 디자인이 살아 움직이는 걸 보고 싶으신 분✨ 자신의 엄청난 디자인을 담아줄 그릇을 가진 개발자를 찾지 못하셨던 분🔥넘치는 열정🔥으로 도전해 볼 디자이너를 모집합니다!당장 지원하세요 🔥안녕하세요! 저희는 팀 “포춘쿠키” 입니다 :)🍀 프로젝트 내용저희 팀은 “LLM을 활용한 토론 보조 앱”이라는 주제로 ICT 한이음 공모전 예선을 합격하였고, 이를 디벨롭하여 앱 개발 및 배포까지 목표로 하고 있습니다.9월에 있을 1차 서류 심사를 위해, 8월까지 앱 개발 및 배포를 목표로 진행할 예정입니다.* ICT 멘토링 공모전 링크 : https://www.hanium.or.kr/portal/index.do🎮 팀 소개현재 저희 팀 “PortuneCookiess”는 숭실대학교 컴퓨터학부 3, 4학년 5명의 학우로 구성되어 있으며, 저희 팀은 다수의 개발 프로젝트 및 각종 공모전 수상 경력, 개발 외주 용역 경험을 가지고있는 실력 있는 개발자 5명으로 구성되어 있습니다. (프론트엔드 2명, 백엔드 2명, AI 1명)인원 모두 단순 프로젝트 경험이 아닌 절대적인 1위 수상을 바라보고 시작한 만큼 대학생 토이프로젝트 수준을 뛰어넘은 상용 애플리케이션 수준의 퀄리티를 약속드립니다.-팀원 개발 경력 中-2020 KDB 창업교육 미니 IR 대상 2020 서울시 SBA 종합 대상 2022 국방데이터 활용 경진대회 - 한국IT서비스산업협회 협회장상 2023 SW마에스트로 14기 수료📍 모집 파트디자인 파트 : UX/UI 앱 디자인, 앱 아이콘 디자인(❗ 프로젝트 경험은 없어도 되고 학생, 직장인, 취준생 상관 없이 가능합니다.)💰 지원 혜택- 피그마 강의 제공 (프로그래머스/유데미)- 상금 균등 분할- 대면 만남 시 교통비 및 회의실 제공- 유쾌한 팀원들과 함께 확실한 경험 및 경력 쌓기 가능 (쌉가능)👇🏻 지원 구글폼 (~5.17)https://forms.gle/vWMAPHpFxiqSdyPK9📌 참고 사항저희는 현재 대면회의로 진행되고 있습니다. 저희가 모두 숭실대학교 재학중이므로 서울 근교에서 회의 참여 가능하시면 좋을 것 같습니다.☎ Contact관련한 문의사항은 아래의 오픈채팅과 연락처로 편하게 연락 부탁드립니다!💬 카카오톡 오픈 채팅: https://open.kakao.com/o/sPEXIDrg
-
미해결[게임 프로그래머 입문 올인원] C++ & 자료구조/알고리즘 & STL & 게임 수학 & Windows API & 게임 서버
[문자열] 강의 부분에서 StrCpy함수 포인터로 구현 하는 부분 질문 있습니다.
글로 질문은 처음이라 두서 없을 수 있다는 부분 양해 부탁 드립니다. char* StrCpy(char dest, char src) 함수에서 char * ret = dest; 선언을 통해 기존 원본 위치값을 저장해 주는것은 알겠는데,while문이 다 돌고 나서 'dest'의 값을 확인해 보면 문자열이 없는 것을 데이터를 확인 하여 알았습니다.그 이유가 'dest++'을 통해 포인터의 시작 위치 값을 변경해 주어서 값이 없는 주소 부분을 가르키기 때문에 'dest'의 데이터가 아무것도 없는 것이 맞을까요? 그렇기 때문에 원본 데이터에는 정상적으로 들어있고,함수내에서 'dest'의 주소 시작점이 뒤로 밀려나 데이터가 없다고 판단해도 되는지 궁금합니다.
-
미해결데이터 드리븐 그로스 마케팅 - 고객 중심의 문제 해결력 업그레이드
강의 자료를 받을 수 있을까요?
안녕하세요.오늘부터 수강 시작했는데 좋은 강의 감사합니다 🙂 그런데 강의 슬라이드에 메모를 하면서 수강을 하면 효과가 더욱 있을 것 같습니다.강의 자료를 받을 수 있을까요?감사합니다.
-
해결됨외워서 끝내는 SSL과 최소한의 암호기술
은행에서 사용자를 인증하는법
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요 강사님. 우선 강사님 강의를 통해 CS지식을 많이 얻을 수 있었음에 감사드립니다.은행예시에서 사용자가 인증을 위해 X.509형식의 인증서를 은행에 전달하면 은행은 CA의 public key를 활용하여 인증서를 검증하여 사용자를 인증한다고 이해했습니다.그러면 은행은 X.509형식의 인증서에 있는 사용자에 대한 추가 정보만을 통해 인증을 하는것일까요?관련해서 검색을 많이 해봤지만 확실하게 이해할 수 없어서 질문드립니다. 감사합니다.
-
해결됨[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
react-native-date-picker darkmode 적용 관련 공유
다크모드를 어떻게 적용시킬까 고민하다가, 찾아보니 theme이라는 프로퍼티를 사용해서 아래와 같이 코드를 작성하면 다크모드가 적용이 됩니다!! import {colors} from '@/constants'; import useThemeStore from '@/store/useThemeStore'; import {ThemeMode} from '@/types/common'; import React from 'react'; import { StyleSheet, View, Modal, SafeAreaView, Pressable, Text, } from 'react-native'; import DatePicker from 'react-native-date-picker'; interface DatePickerOptionProps { isVisible: boolean; date: Date; onChangeDate: (date: Date) => void; onConfirmDate: () => void; } const DatePickerOption = ({ isVisible, date, onChangeDate, onConfirmDate, }: DatePickerOptionProps) => { const {theme} = useThemeStore(); const styles = styling(theme); return ( <Modal visible={isVisible} transparent animationType="slide"> <SafeAreaView style={styles.optionBackground}> <View style={styles.optionContainer}> <View style={styles.pickerContainer}> <DatePicker mode="date" date={date} onDateChange={onChangeDate} locale="ko" theme={theme === 'dark' ? 'dark' : 'light'} /> </View> </View> <View style={styles.optionContainer}> <Pressable style={styles.optionButton} onPress={onConfirmDate}> <Text style={styles.optionText}>확인</Text> </Pressable> </View> </SafeAreaView> </Modal> ); }; const styling = (theme: ThemeMode) => StyleSheet.create({ pickerContainer: { alignItems: 'center', }, optionBackground: { flex: 1, justifyContent: 'flex-end', backgroundColor: 'rgba(0, 0, 0 / 0.5)', }, optionContainer: { borderRadius: 15, marginHorizontal: 10, marginBottom: 10, backgroundColor: colors[theme].GRAY_100, overflow: 'hidden', }, optionButton: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', height: 50, gap: 5, }, optionText: { color: colors[theme].BLUE_500, fontSize: 17, fontWeight: '500', }, }); export default DatePickerOption;
-
해결됨스프링 핵심 원리 - 기본편
assertThat() 인자값 질문있습니다.
assertThat() 메서드에 대해서 찾아 봤는데, 매개변수 이름이 actual(실제값) 이더라구요. 그리고 isEqualTo() 메서드의 매개변수 이름은 expected(기대값)이구요.그러면 assertThat() 메서드를 호출할 때 인자값으로 테스트하고자 하는 값을, 그리고 isEqualTo() 메서드는 테스트의 결과로 기대되는 값을 넘기는게 맞지 않나요?여기 아래 코드에서 memberService.findMember(1L)로 찾아온 회원(findMember)이앞서 직접 만들어서 join으로 넘긴 member와 같아야 하는 거니까Assertions.assertThat(findMember).isEqualTo(member)가 맞는거 아닌가요?
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
localhost:8080 에러에 관하여..
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.안녕하세요 현재 프로젝트 생성 강의에 나오는대로 따라하였는데 톰캣이 뜨지 않는데 뭐가 문제인지 잘 모르겠습니다..
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
2-J 코드 질문입니다.
안녕하세요 강사님! 강의 너무 잘 듣고 있습니다!제가 짠 코드랑 강사님 코드랑 좀 다르지만 답은 맞다고 뜨는데, 이렇게 풀이해도 큰 문제 없는지 여쭤보고 싶어서 코드 올려봅니다.http://boj.kr/5a5e290d48434a57a34847c066b4de7b
-
미해결[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
강의 수강 순서 문의드려요.
유료 강의 첫 수업을 들으려는데 강의가 업데이트가 되었네요? 감사합니다. ^^강의 순서는 1부터 들으면 될까요? 과정 리스트를 보니 설치와 기본은 뒤쪽에 있어서 문의드려요.
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
답은 맞았는데, 이상한 부분이 있어서 질문드려요
http://boj.kr/a12c58c1df11493f8ba78847feffa3b9 선생님, 안녕하세요~완전탐색(재귀방식)으로 해서 어떻게 답을 맞췄습니다.처음에는 dp테이블에 동전이 n개일때 경우의 수를 저장해야겠다고 생각하고 코드를 짜보았지만, 뭔가 잘 되지않아dp[34][34] 이런식으로 남은 w가 n개, h가 m개일때 경우의 수를 저장하게 하는 방식으로 해서 통과하였습니다.그런데 이상한 점은, 한번 dp방식으로 해서 답을 맞췄으면, 그 다음 입력때도 이전에 저장된 dp테이블에 있는 값을 그대로 이용해서 답을 맞출 수 있을 줄 알았는데,이전에 저장된 dp테이블을 이용하면 다른 답이 나와서, 입력을 할 때마다 dp테이블을 초기화 해주는 방식을 사용하고 있습니다.음,, 어떤 부분때문에 이렇게 나오는 걸까요??
-
미해결김영한의 실전 자바 - 중급 2편
9강 map과 set && duque Peek()
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]9강을 들으면서 두가지의 궁금증이 생겼습니다. Hashset이 내부에서 Map을 이용한다고 하셨는데, hashSet은 콜렉션이고 map은 아닐 수 있는 지 궁금합니다. stack이랑 queue를 둘 다 deque를 사용하여 구현한다고 하셨는데 이때 peek() 함수의 결과가 똑같은 deque를 사용해도 다른 걸 확인 했습니다. 이게 어떨 때는 stack 구조인지 어떨 때는 queue 구조인지 어떻게 알고 peek()을 해주는 건가요?입력 할 때 offer와 push를 사용하는 것에 대한 차이를 인지하고 다르게 출력하는 걸까요?
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
데이터 전처리(결측치 채울때 궁금한점)
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요먼저 유사한 질문이 있었는지 검색해보세요안녕하세요! 공부하다 궁금한 점이 있어 질문드립니다.데이터 전처리할때, 수치형 변수 스케일링은x_train의 값으로 scaler.transform(test)만 하는것으로 이해를 했습니다! 그런데 결측치 처리를 할때에는 train은 train의 값으로test는 test의 값으로 채우는데.. 수치형 변수 처리할때처럼 train값으로 test 값을 처리하는 것이 아니라, 결측치는 각 데이터 셋의 값으로 채우는것이 맞을까요 ?
-
미해결Next + React Query로 SNS 서비스 만들기
msw 모바일 환경으로 local 접속 에러
localhost 환경에서 모바일로 접속 하였을때 IP 주소 확인하여 넣어줬는데도 api error가 발생하는데 이유를 잘 모르겠습니다.app.use( cors({ origin: 'http://내 IP 주소:3000', optionsSuccessStatus: 200, credentials: true }) );
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
혹시 이거 Mysql로 바꾸려면 어떻게 해야되나요?
혹시 이거 Mysql로 바꾸려면 어떻게 해야되나요?바꿀부분 다 바꿨는데 [Nest] 61395 - 05/16/2024, 6:50:32 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (6)...Error: Access denied for user ''@'localhost' (using password: YES) at Packet.asError (/Users/eunsukkim/nestjs-lv1-main/nestjs-lv1-main/node_modules/mysql2/lib/packets/packet.js:728:17) at ClientHandshake.execute (/Users/eunsukkim/nestjs-lv1-main/nestjs-lv1-main/node_modules/mysql2/lib/commands/command.js:29:26) at PoolConnection.handlePacket (/Users/eunsukkim/nestjs-lv1-main/nestjs-lv1-main/node_modules/mysql2/lib/connection.js:481:34) at PacketParser.onPacket (/Users/eunsukkim/nestjs-lv1-main/nestjs-lv1-main/node_modules/mysql2/lib/connection.js:97:12) at PacketParser.executeStart (/Users/eunsukkim/nestjs-lv1-main/nestjs-lv1-main/node_modules/mysql2/lib/packet_parser.js:75:16) at Socket.<anonymous> (/Users/eunsukkim/nestjs-lv1-main/nestjs-lv1-main/node_modules/mysql2/lib/connection.js:104:25) 이런 오류가 나네요. env // // 서버 프로토콜 -> http / https// export const ENV_PROTOCOL_KEY = 'PROTOCOL';// // 서버 호스트 -> localhost:3000// export const ENV_HOST_KEY = 'HOST';// // JWT 토큰 시크릿 -> codefactory// export const ENV_JWT_SECRET_KEY = 'JWT_SECRET';// // JWT 토큰 해시 라운드 수 -> 10// export const ENV_HASH_ROUNDS_KEY = 'HASH_ROUNDS';// // 데이터베이스 호스트 -> localhost// export const ENV_DB_HOST_KEY = 'DB_HOST';// // 데이터베이스 포트 -> 5432// export const ENV_DB_PORT_KEY = 'DB_PORT';// // 데이터베이스 사용자 이름 -> postgres// export const ENV_DB_USERNAME_KEY = 'DB_USERNAME';// // 데이터베이스 사용자 비밀번호 -> postgres// export const ENV_DB_PASSWORD_KEY = 'DB_PASSWORD';// // 데이터베이스 이름// export const ENV_DB_DATABASE_KEY = 'DB_DATABASE';//// 서버 프로토콜 -> http / httpsexport const ENV_PROTOCOL_KEY = 'PROTOCOL';// 서버 호스트 -> localhost:3000export const ENV_HOST_KEY = 'HOST';// JWT 토큰 시크릿 -> codefactoryexport const ENV_JWT_SECRET_KEY = 'JWT_SECRET';// JWT 토큰 해시 라운드 수 -> 10export const ENV_HASH_ROUNDS_KEY = 'HASH_ROUNDS';// 데이터베이스 호스트 -> localhostexport const ENV_DB_HOST_KEY = 'localhost';// 데이터베이스 포트 -> 5432export const ENV_DB_PORT_KEY = '3306';// 데이터베이스 사용자 이름 -> postgresexport const ENV_DB_USERNAME_KEY = 'root';// 데이터베이스 사용자 비밀번호 -> postgresexport const ENV_DB_PASSWORD_KEY = 'root';// 데이터베이스 이름export const ENV_DB_DATABASE_KEY = 'bigproject'; 이런식으로 다 바꿨는데요
-
미해결
canvas의 도형에 원하는 이미지들을 넣고 싶습니다.
const COLORS = [ "#394fb8", "#554fb8", "#605ac7", "#2a91a8", "#2e9ab2", "#32a5bf", "#81b144", "#85b944", "#8fc549", "#e0af27", "#eeba2a", "#fec72e", "#bf342d", "#ca3931", "#d7423a", ]; export class Polygon { constructor(x, y, radius, sides) { this.x = x; this.y = y; this.radius = radius; this.sides = sides; this.rotate = 0; } animate(ctx, moveX) { ctx.save(); const angle = PI2 / this.sides; const angle2 = PI2 / 4; ctx.translate(this.x, this.y); this.rotate += moveX * 0.008; ctx.rotate(this.rotate); for (let i = 0; i < this.sides; i++) { const x = this.radius * Math.cos(angle * i); const y = this.radius * Math.sin(angle * i); i == 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y); ctx.save(); ctx.fillStyle=COLORS[i] ctx.translate(x, y); ctx.rotate((((360 / this.sides) * i + 45) * Math.PI) / 180); ctx.beginPath(); for (let j = 0; j < 4; j++) { const x2 = 160 * Math.cos(angle2 * j); const y2 = 160 * Math.sin(angle2 * j); j == 0 ? ctx.moveTo(x2, y2) : ctx.lineTo(x2, y2); } ctx.fill(); ctx.closePath(); ctx.restore(); } ctx.restore(); } }지금은 COLORS 배열을 이용해 fillstyle의 색을 넣었는데, 색상 대신 특정 이미지들을 넣고싶습니다. ctx.fillstyle = colors[i] 를 어떤 식으로 바꿔야할까요..?
-
미해결이득우의 언리얼 프로그래밍 Part2 - 언리얼 게임 프레임웍의 이해
3강에서 시점 변경 부분이요
시점 변경 전까지 정상 적으로 작동 되었는데 변경 후부터 움직임도 먹통이고 해서 이것저것 수정하다가 ACharacterPlayer::ACharacterPlayer() { // 카메라 붐 생성 (충돌이 있으면 플레이어 쪽으로 당겨짐) CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom")); CameraBoom->SetupAttachment(RootComponent); CameraBoom->TargetArmLength = 400.0f; // 카메라가 캐릭터 뒤에서 이 거리만큼 따라갑니다 CameraBoom->bUsePawnControlRotation = true; // 컨트롤러를 기반으로 암을 회전시킵니다 // 팔로우 카메라 생성 FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera")); FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName); // 카메라를 붐 끝에 부착하고 붐이 컨트롤러 방향에 맞춰 조정되도록 합니다 FollowCamera->bUsePawnControlRotation = false; // 카메라는 암과 상대적으로 회전하지 않습니다 //Jump Input Action을 찾습니다. static ConstructorHelpers::FObjectFinder<UInputAction> InputActionJumpRef(TEXT("/Script/EnhancedInput.InputAction'/Game/KoreaSoul/Input/Actions/IA_Jump.IA_Jump'")); if (nullptr != InputActionJumpRef.Object) { JumpAction = InputActionJumpRef.Object; } static ConstructorHelpers::FObjectFinder<UInputAction> InputChangeActionControlRef(TEXT("/Script/EnhancedInput.InputAction'/Game/KoreaSoul/Input/Actions/IA_ChangeControl.IA_ChangeControl'")); if (nullptr != InputChangeActionControlRef.Object) { ChangeControlAction = InputChangeActionControlRef.Object; } // ShoulderMove Input Action static ConstructorHelpers::FObjectFinder<UInputAction> ShoulderMoveActionRef(TEXT("/Script/EnhancedInput.InputAction'/Game/KoreaSoul/Input/Actions/IA_ShoulderMove.IA_ShoulderMove'")); if (nullptr != ShoulderMoveActionRef.Object) { ShoulderMoveAction = ShoulderMoveActionRef.Object; } // ShoulderMoveLook Input Action static ConstructorHelpers::FObjectFinder<UInputAction> ShoulderMoveActionLookRef(TEXT("/Script/EnhancedInput.InputAction'/Game/KoreaSoul/Input/Actions/IA_ShoulderLook.IA_ShoulderLook'")); if (nullptr != ShoulderMoveActionLookRef.Object) { ShoulderLookAction = ShoulderMoveActionLookRef.Object; } // QuaterMove Input Action static ConstructorHelpers::FObjectFinder<UInputAction> QuaterMoveActionRef(TEXT("/Script/EnhancedInput.InputAction'/Game/KoreaSoul/Input/Actions/IA_QuaterMove.IA_QuaterMove'")); if (nullptr != QuaterMoveActionRef.Object) { QuaterMoveAction = QuaterMoveActionRef.Object; } CurrentCharacterControlType = ECharacterControlType::Quater; } void ACharacterPlayer::BeginPlay() { // 부모 클래스의 BeginPlay 함수를 호출합니다. Super::BeginPlay(); SetCharacterControl(CurrentCharacterControlType); } void ACharacterPlayer::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) { Super::SetupPlayerInputComponent(PlayerInputComponent); // PlayerInputComponent를 UEnhancedInputComponent로 캐스팅합니다. UEnhancedInputComponent* EnhancedInputComponent = CastChecked<UEnhancedInputComponent>(PlayerInputComponent); // 점프 액션을 트리거 이벤트에 바인딩합니다. // JumpAction이 발생하면 ACharacter의 Jump 함수를 호출합니다. EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Started, this, &ACharacter::Jump); EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ACharacter::StopJumping); EnhancedInputComponent->BindAction(ChangeControlAction, ETriggerEvent::Triggered, this, &ACharacterPlayer::ChangeCharacterControl); // MoveAction이 발생하면 ACharacterPlayer의 Move 함수를 호출합니다. EnhancedInputComponent->BindAction(ShoulderMoveAction, ETriggerEvent::Triggered, this, &ACharacterPlayer::ShoulderMove); EnhancedInputComponent->BindAction(ShoulderLookAction, ETriggerEvent::Triggered, this, &ACharacterPlayer::ShoulderLook); EnhancedInputComponent->BindAction(QuaterMoveAction, ETriggerEvent::Triggered, this, &ACharacterPlayer::QuaterMove); Controller = GetController(); // 컨트롤러 초기화 // 바인딩 확인용 로그 추가 UE_LOG(LogTemp, Warning, TEXT("InputComponent bound successfully")); } void ACharacterPlayer::ChangeCharacterControl() { UE_LOG(LogTemp, Warning, TEXT("ChangeCharacterControl called")); if (CurrentCharacterControlType == ECharacterControlType::Quater) { SetCharacterControl(ECharacterControlType::Shoulder); } else if (CurrentCharacterControlType == ECharacterControlType::Shoulder) { SetCharacterControl(ECharacterControlType::Quater); } // SetupPlayerInputComponent를 다시 호출하여 새로운 입력 맵핑을 적용합니다. SetupPlayerInputComponent(InputComponent); // 상태 변경 로그 추가 UE_LOG(LogTemp, Warning, TEXT("Control type changed to %s"), CurrentCharacterControlType == ECharacterControlType::Quater ? TEXT("Quater") : TEXT("Shoulder")); } void ACharacterPlayer::SetCharacterControl(ECharacterControlType NewCharacterControlType) { // CharacterControlManager 맵에서 NewCharacterControlType 키에 해당하는 값을 검색합니다. UCharacterControlData* NewCharacterControl = CharacterControlManager[NewCharacterControlType]; // 검색된 NewCharacterControl이 유효한 값인지 확인합니다. check(NewCharacterControl); // 가져온 CharacterControlData를 적용합니다. SetCharacterControlData(NewCharacterControl); APlayerController* PlayerController = CastChecked<APlayerController>(GetController()); if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer())) { Subsystem->ClearAllMappings(); UInputMappingContext* NewMappingContext = NewCharacterControl->InputMappingContext; if (NewMappingContext) { Subsystem->AddMappingContext(NewMappingContext, 0); } } // 현재 캐릭터 컨트롤 타입을 새로운 타입으로 설정합니다. CurrentCharacterControlType = NewCharacterControlType; UE_LOG(LogTemp, Warning, TEXT("Character control changed to %s"), NewCharacterControlType == ECharacterControlType::Quater ? TEXT("Quater") : TEXT("Shoulder")); } void ACharacterPlayer::SetCharacterControlData(const UCharacterControlData* CharacterControlData) { // 각 프로퍼티를 CharacterControlData 값으로 설정합니다. Super::SetCharacterControlData(CharacterControlData); CameraBoom->TargetArmLength = CharacterControlData->TargetArmLength; // 대상의 팔 길이를 설정합니다. CameraBoom->SetRelativeRotation(CharacterControlData->RelativeRotator); // 상대 각도를 설정합니다. CameraBoom->bUsePawnControlRotation = CharacterControlData->bUsePawnControlRotation; // 폰의 제어 회전을 사용하는지 설정합니다. CameraBoom->bInheritPitch = CharacterControlData->bInheritPitch; // Pitch 상속을 사용하는지 설정합니다. CameraBoom->bInheritYaw = CharacterControlData->bInheritYaw; // Yaw 상속을 사용하는지 설정합니다. CameraBoom->bInheritRoll = CharacterControlData->bInheritRoll; // Roll 상속을 사용하는지 설정합니다. CameraBoom->bDoCollisionTest = CharacterControlData->bDoCollisionTest; // 충돌 검사를 수행하는지 설정합니다. UE_LOG(LogTemp, Warning, TEXT("Character control data set")); } void ACharacterPlayer::ShoulderMove(const FInputActionValue& Value) { // 입력 값에서 2D 이동 벡터를 가져옵니다. FVector2D MovementVector = Value.Get<FVector2D>(); // 컨트롤러가 유효한지 확인합니다. if (Controller) { // 컨트롤러의 현재 회전값을 가져옵니다. const FRotator Rotation = Controller->GetControlRotation(); // Yaw(좌우 회전)만 사용하여 회전 값을 만듭니다. const FRotator YawRotation(0, Rotation.Yaw, 0); // 회전 매트릭스를 사용하여 전방 방향 벡터를 구합니다. const FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X); // 회전 매트릭스를 사용하여 오른쪽 방향 벡터를 구합니다. const FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y); // 입력 값에 따라 전방 방향으로 이동을 추가합니다. AddMovementInput(ForwardDirection, MovementVector.X); // 입력 값에 따라 오른쪽 방향으로 이동을 추가합니다. AddMovementInput(RightDirection, MovementVector.Y); } UE_LOG(LogTemp, Warning, TEXT("ShoulderMove called")); } void ACharacterPlayer::ShoulderLook(const FInputActionValue& Value) { // 입력 값에서 2D 회전 벡터를 가져옵니다. FVector2D LookVector = Value.Get<FVector2D>(); // 컨트롤러가 유효한지 확인합니다. if (Controller) { // 입력 값에 따라 컨트롤러의 회전 값을 변경합니다. AddControllerYawInput(LookVector.Y); AddControllerPitchInput(LookVector.X); } UE_LOG(LogTemp, Warning, TEXT("ShoulderLook called: Yaw=%f, Pitch=%f"), LookVector.X, LookVector.Y); } void ACharacterPlayer::QuaterMove(const FInputActionValue& Value) { // 이동 벡터를 생성합니다. 입력 값으로부터 FVector2D 타입을 가져옵니다. FVector2D MovementVector = Value.Get<FVector2D>(); // 입력 값의 제곱의 크기입니다. float InputSizeSquared = MovementVector.SquaredLength(); // 이동 벡터의 크기를 기본값 1로 설정합니다. float MovementVectorSize = 1.f; // 이동 벡터의 제곱 크기입니다. float MovementVectorSizeSquared = MovementVector.SquaredLength(); // 이동 벡터의 제곱 크기가 1을 초과하는 경우 if (MovementVectorSizeSquared > 1.0f) { // 이동 벡터를 정규화합니다. MovementVector.Normalize(); // 이동 벡터의 제곱 크기를 1로 설정합니다. MovementVectorSizeSquared = 1.f; } else { // 이동 벡터의 크기를 이동 벡터의 제곱 크기의 제곱근으로 설정합니다. MovementVectorSize = FMath::Sqrt(MovementVectorSizeSquared); } // 이동 방향을 설정합니다. 입력 벡터의 x, y를 사용하고 z를 0으로 설정합니다. FVector MoveDirection = FVector(MovementVector.X, MovementVector.Y, 0.0f); // 캐릭터 생성자의 컨트롤러에 이동 방향의 로테이터를 설정합니다. GetController()->SetControlRotation(FRotationMatrix::MakeFromX(MoveDirection).Rotator()); // 이동 입력을 추가합니다. 이동 방향과 이동 벡터의 크기를 인자로 사용합니다. AddMovementInput(MoveDirection, MovementVectorSize); UE_LOG(LogTemp, Warning, TEXT("QuaterMove called: X=%f, Y=%f"), MovementVector.X, MovementVector.Y); }일단 여기까지 고쳤는데 마우스 동작도 안되고 방향키는 전부 반대로 되어있고 v키를 눌러도 숄더로 돌아가서 다시 안돌아옵니다3시간동안 헤맸는데 도저히 모르겠어요
-
해결됨김영한의 실전 자바 - 중급 2편
섹션 8。map1
Map<String, Integer> studentMap = new HashMap<>(); . . . Collection<Integer> values = studentMap.values();studentMap.values()를 하면 Collection타입으로 반환해준다고 하셨는데 의문이 하나 들었습니다.Collection은 인터페이스, map은 Collection을 상속받지 않음으로 Collection은 studentMap.values()를 담을 수 없지어야 한다고 생각했는데... 모르겠습니다ㅠㅠ