묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨스프링 DB 1편 - 데이터 접근 핵심 원리
close()에 관해 궁금한점이 있습니다.
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용]Connection 객체의 경우에는 해당 커넥션이 만들어지고 close하지않으면 네트워크 리소스 소모때문에 close를 해야하는것으로 이해했습니다.그렇다면 preparedStatement와 ResultSet객체의 경우에는 해당 데이터베이스로 SQL문을 전송및 전달받는 객체인걸로 보이는데 왜 close로 명시적으로 닫아야하는건가요?
-
미해결
HTML 에서 a 태그의 href 만 뽑아오기
파이썬으로 왓차피디아 사이트를 크롤링 하려고 하는데요.requests 랑 Beautifulsoup 모듈을 사용하고 있습니다.{영화 제목: ~~~,제작연도 : ~~~,링크: ~~~}이렇게 만들고 싶습니다. 근데 링크를 뽑아오는 데서 문제를 겪고 있습니다. 보시다시피 아래에서 두 번째 줄에서 리스트 컴프리헨션을 활용했는데요.soup_links 에 데이터가 비어서 나옵니다.웹에서 개발자 도구로 확인했는데도 저렇게 나오는데 혹시 고수님들 어떻게 해야 링크를 크롤링 할 수 있을까요?url_watcha = "https://pedia.watcha.com/ko-KR" req_watcha = requests.get(url_watcha) html = req_watcha.text soup = BeautifulSoup(html, "lxml") soup_titles = soup.select("div.css-1ntmtyn-ContentTitle-makeTypeFunction-handleHorizontalUlRender") soup_year_countries = soup.select("div.css-zb5qbk-StyledContentYearAndNation-createMediaQuery-makePediaTypeFunction") soup_links = soup.select("li.css-1ofozqs.ei3ci1h10 > a") titles = [t.get_text(strip=True) for t in soup_titles[:10]] year_countries = [y.get_text(strip=True) for y in soup_year_countries[:10]] links = [l["href"] for l in soup_links] time.sleep(1)
-
해결됨실전! Querydsl
stringTemplate("...") 은 어떻게 찾으신건가요?
공식 문서 5.0.0 버전을 봐도 stringTemplate이나 function에 대한 소개가 없더라구요 이렇게 공식문서에서 찾을 수 없는 내용을 강사님께서는 어떻게 찾으시는지 궁금합니다.
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
%s에 정수를 넣어봤는데도 작동해요
print('%s %s' % ('one', 'two'))에 one, two 대신 1, 2를 넣어도 출력이 가능하던데 그럼에도 format을 출력하는 이유가 있을까요? #format 사용 (d: 정수, s:문자열, f:실수) print('%s %s' % ('one', 'two')) #정석적 print('{} {}'.format('one', 'two')) #format 함수가 내부적으로 처리해줌
-
미해결Next + React Query로 SNS 서비스 만들기
next aws s3 가능 여부 문의
혹시 aws s3로는 배포가 불가능 할까요??
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
7-L 안녕 질문이 있습니다.
http://boj.kr/2451435928954fd4ade7f532de725ef2재귀를 돌면서 hp가 0이하가 되면 0을 반환하고 사람의 명수 만큼 재귀를 돌며 hp가 남아있으면 hppy(행복)을 반환해줘서 최대값을 반환하는 dp를 작성했는데 문제에 나와있는 테스트 케이스와 질문게시판에 있는 테케를 전부 돌려봤는데도 무엇이 잘못되었는지 모르겠습니다.
-
미해결
Unleashing the Power of MyEssayWriter.ai: Transforming Writing Effortlessly 2023-2024
Essay writing tools have revolutionized how individuals approach academic or professional writing tasks. These essay writing tools encompass a wide range of functionalities, from aiding in organization and structure to generating content and ensuring authenticity. With features like AI-driven essay generation, paraphrasing, outlining, and plagiarism detection, these tools streamline the writing process, enhancing essential writing and quality while encouraging individual writing styles and skill sets.Among the plethora of essay writing tools available, MyEssayWriter.ai stands out as the best tool of 2023, full of innovation and efficiency. Its amalgamation of AI-powered features like the Essay Writer, Outliner, Custom Writer, Paraphrasing Tool, and Plagiarism Detection Tool sets it apart.MyEssayWriter.ai MyEssayWriter.ai utilizes an essay writer tool to redefine the realm of academic writing. Specifically designed to meet the demands of professionals, scholars, and learners, it offers an array of features that are carefully crafted to facilitate the writing process.MyEssayWriter.ai is fundamentally a headstone to the cooperation of human creativity and artificial intelligence (AI) capabilities, democratizing access to excellent writing help and assisting users in achieving unmatched academic success.MyEssayWriter.ai offers a user-friendly interface that makes the essay generation process easy. It’s popular for generating full-fledged essays with one click in under 90 seconds. amolife.com Benefits of MyEssayWriter.aiEffortless Efficiency: Saves invaluable time by swiftly generating well-structured essays, liberating users from the tedium of extensive research and formulation of ideas.Enhanced Originality: Ensures authenticity through innovative plagiarism detection tools, safeguarding against unintentional duplication and bolstering academic integrity.Tailored Precision: Offers personalized essay creation, aligning content precisely with individual requirements and preferences, fostering a unique writing approach.Refined Writing Skills: Facilitates skill enhancement through the AI-based paraphrasing tool, refining writing style while preserving the essence of the original content.Comprehensive Organization: It aids in streamlining thoughts and concepts with the AI essay outliner, enabling a structured framework for cohesive and impactful essays. Tools Featured by MyEssayWriter.aiAI Essay Writer: Utilizes advanced algorithms to generate comprehensive essays swiftly and efficiently, analyzing provided prompts or topics to create well-structured content tailored to specific requirements with a focus on accuracy and depth.AI Essay Outliner: Facilitates the organization of thoughts and concepts by creating a structured framework for essays, enhancing coherence, and aiding in the seamless development of content, ensuring a logical flow from ideas to the final composition.Custom Essay Writer: Tailor's essays precisely to individual specifications, offering personalized content creation that aligns with unique preferences, ensuring authenticity, and catering to diverse academic or professional needs.Paraphrasing Tool: This paraphrasing tool enhances writing style by adeptly rephrasing content while preserving original meaning, promoting creativity, refining language proficiency, and fostering an improved and polished writing approach.Plagiarism Detection Tool: Safeguards academic integrity by checking content against extensive databases, ensuring authenticity and originality, thereby preventing unintentional duplication and reinforcing the credibility of the written work. Reviews for MyEssayWriter.aiUsers hailed MyEssayWriter.ai for its user-friendly interface and ability to significantly reduce the time and effort spent on essay writing. Its AI-driven capabilities have been lauded for producing well-researched, coherent, and original content, catering to various academic and professional needs. The platform's versatility and efficiency have garnered praise for enhancing writing skills and fostering academic success. FAQs about MyEssayWriter.aiQ: Is MyEssayWriter.ai suitable for all academic levels?Yes, the platform caters to students from high school to postgraduate levels, adapting to diverse writing needs.Q: How does the plagiarism detection tool work?The tool cross-references the submitted content with extensive databases to identify similarities and potential instances of plagiarism.Q: Can I use MyEssayWriter.ai for non-academic writing purposes?The platform's versatile tools can aid in various writing tasks, including professional, creative, or personal projects.Q: Is the content generated by MyEssayWriter.ai reliable and accurate?Yes, the AI algorithms ensure coherence, accuracy, and reliability in the generated content, which can serve as a strong foundation for further refinement and enhancement. Useful ResourcesTop AI Writing Tools: Navigating the Landscape in 2023-24MyEssayWriter.ai: Revolutionizing Writing Excellence - A Comprehensive ReviewEssay Writing in 2023-2024: How MyEssayWriter.ai Keeps You Ahead
-
해결됨[임베디드 입문용] 임베디드 개발은 실제로 이렇게 해요.
보드의 D1 LED는 어떻게 제어해야 하나요?
D1 LED가 처음부터 계속 켜져 있어서 배운데로 제어해보려고 하는데, 회로도상에서 D1 LED에 연결된 pin이 안보이네요. 어떻게 해야할까요?
-
미해결실전 프로젝트로 배우는 데이터 앱 만들기 with Python & Streamlit
오류 메세지
안녕하세요~~ 루비네 코딩 입니다 ^^최근 앱을 런칭할 때 다음과 같은 오류가 발생하고 있습니다.ModuleNotFoundError: No module named 'altair.vegalite.v4'이런경우, 다음과 같이 altair 패키지의 버전을 바꾸어 설치해 주세요 ^^감사합니다~pip uninstall altairpip install altair==4.2.2
-
미해결[실전]텍스톰 TEXTOM 실전 강의: 빅데이터 논문 작성을 위한 텍스트 분석/텍스트마이닝
선생님 질문있어요!
선생님 덕분에 많이 배우고 있습니다.선생님이 쓰신 이진규, & 이창배. (2022). 자연어 처리 (NLP) 기반 텍스트마이닝을 활용한 소나무에 대한 국내외 연구동향 (2001∼ 2020) 분석. 농업생명과학연구, 56(2), 35-47. 논문을 보니 국외 논문도 연구동향을 진행하셨는데요.Web of science 사이트에서 RISS처럼 크롤링 하는 방법을 간단히 소개해 주실 수 있으신가요?그리고 선생님이 하신 강의를 보다보면 대부분의 데이터 처리가 한글 기반으로 되어 있습니다. 혹시 TEXTOM을 사용할때 언어가 영어인 경우에는 잘 구동이 안 되나요? (선생님께서는 파이썬 라이브러리를 사용하셨더라구요) 혹시 영어의 경우에는 TEXTOM이 잘 안 되어서 다른 프로그램을 사용하셨나 해서요.항상 강의 잘 듣고 있습니다.감사합니다.
-
미해결[켠김에 출시까지] 유니티 방치형 키우기 게임 (M1 + C1)
멘토링 한자리 남겨주실수 있을까요?
혹시 가능하다면 멘토링 한자리 남겨주심 안될까요?회사에서 지원하는 금액이 넘어가서 멘토링은 담달초에 등록할려고 합니다. 2인 개발을 목표로 하고 있는데 한명은 그래픽이고 제가 기획이랑 프로그래밍을 할 예정이라 꼭 듣고 싶습니다
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
구글맵 지도 자체는 뜨는데 위치가 안뜨시는분들
API 및 서비스 여기서 Maps SDK for Android랑 iOS 여기서 DISABLE로 되어있어야 활성화 된겁니다! 처음에 ENABLE로 되어야 활성화인줄알고 했다가 계속 안떴었네요! 강사님 이거 자막에 달아주시면 좋을거같습니다 ㅜㅜ
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
test중 NullPointerException에러발생
jpa와 db설정, 동작확인 강의를 듣고 클론코딩 중test중 NullPointerException에러발생mainjpabook.jpashop.Memberpackage jpabook.jpashop; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import lombok.Getter; import lombok.Setter; @Entity @Getter @Setter public class Member { @Id @GeneratedValue private Long id; private String username; }jpabook.jpashop.MemberRepositorypackage jpabook.jpashop; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import org.springframework.stereotype.Repository; @Repository public class MemberRepository { @PersistenceContext EntityManager em; public Long save(Member member) { em.persist(member); return member.getId(); } public Member find(Long id) { return em.find(Member.class, id); } } testjpabook.jpashop.MemberRepositoryTestpackage jpabook.jpashop; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.Rollback; import org.springframework.transaction.annotation.Transactional; import static org.assertj.core.api.Assertions.assertThat; public class MemberRepositoryTest { @Autowired MemberRepository memberRepository; @Test @Transactional @Rollback(false) public void testMember() { Member member = new Member(); member.setUsername("memberA"); Long saveId = memberRepository.save(member); Member findMember = memberRepository.find(saveId); assertThat(findMember.getId()).isEqualTo(member.getId()); assertThat(findMember.getUsername()).isEqualTo(member.getUsername()); } } application.ymlspring: datasource: url: jdbc:h2:tcp://localhost/~/jpashop username: sa password: driver-class-name: org.h2.Driver jpa: hibernate: ddl-auto: create properties: hibernate: # show_sql: true format_sql: true logging.level: org.hibernate.SQL: debug org.hibernate.type: trace build.gradleplugins { id 'java' id 'org.springframework.boot' version '3.2.1' id 'io.spring.dependency-management' version '1.1.4' } group = 'jpabook' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '17' } 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-validation' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-devtools' compileOnly 'org.projectlombok:lombok' runtimeOnly 'com.h2database:h2' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' } tasks.named('test') { useJUnitPlatform() }build, run 모두 intellj IDE로 하는중입니다.
-
미해결실전! Querydsl
BooleanBuilder 사용 방법에 대해서
private BooleanBuilder searchName(String name) { if (name == null || name.isBlank()) { return new BooleanBuilder(); } return new BooleanBuilder(QMember.member.username.eq(name)); } private BooleanBuilder searchAge(Integer age) { if (age == null) { return new BooleanBuilder(); } return new BooleanBuilder(QMember.member.age.eq(age)); } private BooleanBuilder allCond(String username, Integer age) { return searchName(username).or(searchAge(age)); } @DisplayName("BooleanBuilder 연속 사용") @Test void pr2(){ //given em.persist(new Member("둘리",15)); em.persist(new Member("또치",20)); em.flush(); em.clear(); QMember member = QMember.member; List<Member> findMember = queryFactory .select(member) .from(member) .where(searchName("name").and(searchAge(null)).and(searchAge(15))) .fetch(); System.out.println("findMember = " + findMember); }null 여부에 따라 Expression을 추가하거나 new BooleanBuilder를 반환하면and나 or일 경우 내부에서 합치거나 치환하는 방식을 통해 최종 BooleanBuilder를 사용할 수 잇더라구요public BooleanBuilder or(@Nullable Predicate right) { if (right != null) { if (predicate == null) { predicate = right; } else { predicate = ExpressionUtils.or(predicate, right); } } return this; }이렇게 사용하는 방법은 BooleanExpression을 사용하면 null 체크를 해야하는데따로 기존에 있는 메소드에서 null을 체크해야주기 때문에 좋을 거같은데단점은 매번 쿼리를 실행할 때마다 저 많은 조건문이 실행되니까 비효율적일까요 ?
-
미해결
Navigating Academic Waters: MyPerfectWords.com Essay Bot and Your Mental Well-being
Welcome, fellow students, to the exciting world of academia! As we embark on our educational journeys, we often encounter challenging academic tasks that can sometimes make us feel like we're drowning in a sea of essays, papers, and deadlines. But fear not, because there's a helpful tool called MyPerfectWords.com Essay Bot that promises to be your academic lifeboat. In this article, we'll explore how this nifty tool can assist you on your academic voyage while also keeping a keen eye on your mental well-being. Understanding Student StressorsBefore we dive into the wonders of Essay Bot, let's take a moment to understand the challenges that many students face. You're not alone if you feel the weight of academic pressure on your shoulders.Juggling assignments, exams, and the desire to maintain a social life can sometimes feel overwhelming. It's crucial to recognize that these stressors can have an impact on your mental health. MyPerfectWords.com Essay Bot: A Tool for Academic SupportNow, let's talk about Essay Bot – your secret weapon in the battle against looming deadlines. This tool is designed to assist you with writing tasks, making the process smoother and more efficient. It's like having a personal writing assistant at your fingertips.Moreover, the recent launch of the Essay Bot as a completely free AI essay writing tool by MyPerfectWords.com has sparked excitement in the academic community. This not only provides a cost-effective solution but also aligns with the commitment to supporting students on their academic journeys. Features of Essay Bot:Topic Assistance: Struggling to find a topic for your essay? Essay Bot can suggest ideas to kickstart your creativity.Outline Creation: Need help organizing your thoughts? The Essay Bot can generate an outline to guide you through the writing process.Content Generation: Stuck on a sentence or paragraph? Let the Essay Bot generate content suggestions for you to build upon.Time Management: By streamlining the writing process, Essay Bot helps you manage your time more effectively, reducing the last-minute panic.Stress Reduction: With the tool handling some of the heavy lifting, you can approach your assignments with a calmer mindset. Assessing the Impact on Mental HealthNow, let's explore how using tools like Essay Bot can positively influence your mental well-being. Imagine having more time for self-care, hobbies, and a good night's sleep – all while knowing your essays are in good hands.Real-world Examples:Fewer All-nighters: Say goodbye to those stressful all-nighters as Essay Bot helps you break down tasks into manageable chunks, making late-night cram sessions a thing of the past.Improved Confidence: Successfully using Essay Bot to enhance your writing skills can boost your confidence, reducing anxiety associated with academic performance.If you're interested in learning more about how students are maximizing their productivity with Essay Bot, check out this article on Medium. It delves into how Essay Bot has become an integral part of students' essay-writing journeys. Responsible Integration and Ethical ConsiderationsWhile Essay Bot is a fantastic tool, we must use it responsibly and ethically. Let's explore some tips to ensure you're making the most of this tool without compromising your integrity.Use as a Guide: Think of Essay Bot as a guide rather than a shortcut. Use its suggestions to enhance your understanding and creativity.Combine with Personal Input: Inject your unique voice and ideas into the content generated by Essay Bot. This ensures that your work remains authentically yours.Cite Properly: If Essay Bot provides information or ideas, make sure to cite them correctly. This demonstrates honesty and gives credit where it's due.Avoid Plagiarism: Plagiarism is a big no-no. Ensure that the content you create with Essay Bot is original and reflects your thoughts and insights. Promoting Positive Mental Well-beingBeyond using Essay Bot responsibly, there are additional strategies to promote positive mental well-being throughout your academic journey.Take Breaks: Don't forget to take breaks. Step away from your screen, stretch, and refresh your mind.Set Realistic Goals: Break down your tasks into achievable goals. Celebrate small victories along the way.Balance Work and Play: A healthy balance between academic tasks and leisure activities is crucial for your well-being. Make time for hobbies and socializing.Seek Support: If you're feeling overwhelmed, don't hesitate to seek support from friends, family, or professionals. You're not alone on this journey. Diverse Perspectives and ExperiencesLet's hear from fellow students who have ventured into the world of Essay Bot. Their experiences shed light on the diverse ways this tool can impact their academic and mental well-being.Success Stories: Students share how Essay Bot helped them overcome challenges and improve their writing skills.Learning Curves: Some students discuss the learning curves and adjustments they made to use Essay Bot effectively.As technology evolves, so does Essay Bot. Let's explore how continuous improvements and collaboration with mental health professionals can make this tool even more beneficial for students.Furthermore, a LinkedIn post provides a thought-provoking perspective on the role of AI in essay writing tools, highlighting the significance of technology in transforming the student experience. The collaborative nature of these tools, as discussed in the article, reflects the synergy between technology and education. Enhancements for a Better User Experience:User Feedback Integration: Essay Bot evolves based on user feedback. Your input matters!User-friendly Updates: Ongoing improvements make the tool more user-friendly and tailored to your needs.Integration of Support Features: Imagine Essay Bot not only helps with writing but also offers mental health resources when you need them most.Adapting to Emerging Challenges: The tool stays relevant by adapting to the ever-changing landscape of student needs and challenges.In conclusion, MyPerfectWords.com Essay Bot is not just an essay writing service; it's a dynamic tool that evolves with the input of its users. As we've seen, students are not only benefiting from its writing assistance but are also actively contributing to its improvement. The collaborative efforts between students and the tool itself create a symbiotic relationship that enhances the overall academic experience.Remember, your mental well-being is as important as your academic success, and tools like Essay Bot are here to support you every step of the way. Happy writing and take care! Read more:Unveiling MyPerfectWords.com's AI Magic: A Journey into Effortless Essay CreationFrom Ideas to A+ Essays: Demystifying MyPerfectWords's AI Essay WriterMyPerfectWords.com vs. the Academic Grind: How AI Streamlines Student LifeCrafting Uniqueness: Personalized Essays Powered by MyPerfectWords.com Essay BotTracing Student Writing Evolution with MyPerfectWords.com Essay BotThe Impact of MyPerfectWords.com Essay Bot on Time Management in Academia
-
미해결자바스크립트 알고리즘 문제풀이 입문(코딩테스트 대비)
다음과 같이 풀었는데 괜찮은가요
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키<html> <head> <meta charset="UTF-8"> <title>출력결과</title> </head> <body> <script> function solution(arr){ let answer=0 ; let max =0; for(let i=0; i<arr.length; i++){ if(arr[i]>max){ max=arr[i] answer++ } } return answer; } let arr=[130, 135, 148, 140, 145, 150, 150, 153]; console.log(solution(arr)); </script> </body> </html>며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
-
해결됨홍정모의 따라하며 배우는 C언어
11.2강 19:43 질문이 있습니다.
공부한 내용을 테스트해보려고 다음 코드를 작성했습니다.#include <stdio.h> #include <stdlib.h> int var_global_initialized = 1; int var_global_uninitialized; void func_test(); int main(void) { // 값이 저장되는 메모리 영역과 그 주소 // Code 영역 printf("%llu [Code]\n", (unsigned long long)"I am a String."); // Data 영역 printf("%llu [Data]\n", (unsigned long long)&var_global_initialized); // BSS 영역 printf("%llu [BSS]\n", (unsigned long long)&var_global_uninitialized); // Heap 영역 char* var_dynamic = (char*)malloc(sizeof(char) * 100); printf("%llu [Heap]\n", (unsigned long long)var_dynamic); // Stack 영역 func_test(); return 0; } void func_test() { int var_local = 0; printf("%llu [Stack]\n", (unsigned long long)&var_local); }; 메모리 영역 별 간격이 너무 작게 출력되는데 올바르게 작성한게 맞을까요..?? 참조온라인 컴파일러 링크문자열 리터럴이 저장되는 메모리 영역 링크메모리 영역별 예제 코드 링크
-
미해결프로그래밍 시작하기 : 파이썬 입문 (Inflearn Original)
강의 자료 부탁드립니다!
안녕하세요! 잘 듣고 있습니다:)강의 자료 부탁드릴게요maria9513@naver.com
-
미해결Next + React Query로 SNS 서비스 만들기
/login 라우팅시 발생하는 컴포넌트 업데이트 오류
Warning: Cannot update a component (`Router`) while rendering a different component (`RedirectLoginPage`). To locate the bad setState() call inside `RedirectLoginPage`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render at RedirectLoginPage (webpack-internal:///(app-pages-browser)/./src/app/(beforeLogin)/login/page.tsx:15:78) at StaticGenerationSearchParamsBailoutProvider (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/static-generation-searchparams-bailout-provider.js:15:11) at InnerLayoutRouter (webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/components/layout-router.js:240:11)로그인 버튼 클릭시 '/login' 이동하면 이런 Warning 이 발생하는데 빌드시에도 Error occurred prerendering page "/login". Read more: https://nextjs.org/docs/messages/prerender-error ReferenceError: location is not defined위 같은 에러가 발생합니다. location을 사용하는 부분도 없고, useRouter도 'next/navigation' 에 있는 것을 사용중입니다. 해결법으로는 useEffect로 감싸주는 법이 있어 useEffect((router.replace(path)) => []) 이런방식으로 해봤는데 오류는 해결되네요.하지만 오류 내용대로 해석해보면 렌더링 도중 set을 통한 상태변화를 하지 않는데 오류가 나는 이유는 뭔가요? return 으로 Main 컴포넌트를 그려주어야하는데 replace시 LoginModal의 컴포넌트를 그려주어야해서 렌더링해야할 컴포넌트가 겹쳐서 발생하는 문제인가요?
-
해결됨[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part3: 유니티 엔진
UI_Button 클론이 무한생성
UI_Button 클론이 무한생성됩니다. public class Test : MonoBehaviour { GameObject er; void Update() { if (Input.GetMouseButtonDown(0)) { Managers.UI.ShowPopupUI<UI_Button>(); } } }아래 코드로 문제가 있어서 화면을 클릭했을 때만 팝업이 뜨도록 위의 코드로 Test 스크립트를 일부 바꿔 봤습니다.그러고나서 보니까public static UIManager UI{get{return instance._ui;}} 이 지점에서 계속 다시 Test 파일의if (Input.GetMouseButtonDown(0)) { Managers.UI.ShowPopupUI<UI_Button>(); }이 부분으로 가는 것 같습니다. 늘어나는 갯수로 처음엔 한번 클릭했을 때는 한번으로 잘 늘어나는데 그 다음엔 2개가 생기고 그 다음엔 5개..? 규칙을 알 수 없게 늘어납니다저 요즘 질문 너무 많이하죠..ㅜㅜ 그치만 미워하지 말아주세요 다 기본 3시간은 고민고민하며 노려보다가 보내는거긴해유..하핳..using System.Collections; using System.Collections.Generic; using UnityEngine; public class Test : MonoBehaviour { GameObject er ; void Start() { Managers.UI.ShowPopupUI<UI_Button>(); } void Update() { } } using System.Collections; using System.Collections.Generic; using UnityEngine; public class ResourceManager { public T Load<T>(string path) where T:Object { return Resources.Load<T>(path); } public GameObject Instantiate(string path, Transform parent = null) { GameObject prefab = Load<GameObject>($"Prefabs/{path}"); if (prefab == null) { Debug.Log($"Failed to load prefab : {path}"); return null; } return Object.Instantiate(prefab, parent);//Object붙이는 이유는 리소스메니저에 있는 Instantiate를 또 호출하려고 할까봐. } public void Destroy(GameObject go) { if(go == null) return; Object.Destroy(go); } } using System.Collections; using System.Collections.Generic; using UnityEngine; public class Managers : MonoBehaviour { static Managers s_Instance; //유일성이 보장된다 static Managers instance { get { Init(); return s_Instance; } } // 유일한 매니저를 갖고온다 ResourceManager _resource = new ResourceManager(); UIManager _ui = new UIManager(); public static UIManager UI{get{return instance._ui;}} public static ResourceManager Resource{get{return instance._resource;}} // Start is called before the first frame update void Start() { Init(); } // Update is called once per frame void Update() { } static void Init() { if (s_Instance == null) { GameObject go = GameObject.Find("@Managers"); if (go == null) { go = new GameObject { name = "@Managers" }; go.AddComponent<Managers>(); } DontDestroyOnLoad(go); s_Instance = go.GetComponent<Managers>(); } } }using System.Collections; using System.Collections.Generic; using UnityEngine; public class UIManager { int _order = 0; //팝업 목록을 들고있어야함. 스택 구조으로 관리하기 가장 마지막에 띄운 팝업이 가장 먼저 삭제돼야하니까. Stack<UI_Popup> _popupStack = new Stack<UI_Popup>(); public T ShowPopupUI<T>(string name = null) where T : UI_Popup//T에는 UI버튼이라는 스크립트를 건네고 name에는 팝업프리펩을 건네줄거임. { if(string.IsNullOrEmpty(name))//이름이 비어있으면 T타입의 이름과 똑같은걸로 넣겠다. name = typeof(T).Name; GameObject go = Managers.Resource.Instantiate($"UI/Popup/{name}"); T popup = Util.GetOrAddComponent<T>(go); _popupStack.Push(popup); return popup; } public void ClosePopupUI() { if (_popupStack.Count == 0) //stack을 건드릴 떈 항상 카운트를 체크하는걸 습관화하기 return; UI_Popup popup = _popupStack.Pop(); Managers.Resource.Destroy(popup.gameObject); popup = null; _order--; } } using System.Collections; using System.Collections.Generic; using UnityEngine; public class Util { public static T GetOrAddComponent<T>(GameObject go) where T : UnityEngine.Component { T component = go.GetComponent<T>(); if (component == null) component = go.AddComponent<T>(); return component; } public static GameObject FindChild(GameObject go, string name = null, bool recursive = false) { Transform transform = FindChild<Transform>(go, name, recursive);//<Transform>을 사용하면 FindChild 메서드가 호출될 때 해당 메서드는 Transform 타입의 자식을 찾도록 약속됩니다. 이는 제네릭을 사용하여 메서드를 특정 타입에 제한하는 방법 중 하나입니다. if (transform == null) return null; return transform.gameObject; } public static T FindChild<T>(GameObject go, string name = null, bool recursive = false) where T : UnityEngine.Object { if (go == null) return null; if (recursive == false) { for (int i = 0; i < go.transform.childCount; i++) { Transform childTransform = go.transform.GetChild(i); if (string.IsNullOrEmpty(name) || childTransform.name == name) { T component = childTransform.GetComponent<T>(); if (component != null) return component; } } } else { foreach (T component in go.GetComponentsInChildren<T>(true)) { if (string.IsNullOrEmpty(name) || component.name == name) return component; } } return null; } }