묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨[임베디드 입문용] 임베디드 개발은 실제로 이렇게 해요.
보드의 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; } }
-
해결됨클론코딩에서 알려주지 않는 것들 (보안, DDD, 마이크로서비스) 2편
다음 강의는 언제 나오나요?
학습 내용과는 관련없는 질문이지만...이제 12월이 거의 다 지나가는데 다음 강의는 언제쯤 나오나요?
-
해결됨실전! GitHub Actions으로 CI/CD 시작하기
PR merge 시 test job 미실행 관련 문의
안녕하세요 이상원님 수강생입니다. 다른 분들은 이해하셨겠지만, Job 미실행 관련 의문이 생겨 문의드립니다.'시나리오1 워크플로우 구성하기 1,2'의 흐름과 코드를 보면 test,image-build,deploy job이 있습니다.이해한 내용으로는 test job은 말그대로 테스트를 위한 job(코드에 문제가 없는지 판단하는 job), image-build는 그 코드를 말아서 ECR로 올리는 과정 deploy는 실제 환경에 올리는 배포 과정으로 이해했습니다. 이때, test job과 image build job을 같은 job에 두고 같이 실행하면 안되는 지에 대해서 의문이 생겨 문의드립니다. 감사합니다.
-
미해결Flutter 테스트 기초
GeneratedMocks로 생성한 코드의 위치를 변경하고싶어요
GeneratedMocks로 생성한 코드들이 많아지면 복잡할 것 같아서 생성되는 파일의 위치를 자동으로 변경해주고 싶은데요,예를들면 현재 코드가 있는 디렉토리에 generated라는 디렉토리 안에다가 생성된 파일을 저장해주고싶어요.어떠한 설정을 해야할까요?
-
미해결김영한의 실전 자바 - 기본편
3. 객체 지향 프로그래밍 질문
package oop1.ex; public class Ex1Rectangle { int height; int width; int area; int perimeter; void calculateArea() { area = width * height; System.out.println("넓이: " + area); } void calculatePerimeter() { perimeter = 2 * (width + height); System.out.println("둘레: " + perimeter); } void isSquare() { boolean isSquare = width == height; System.out.println("정사각형 여부: "+ isSquare); } }package oop1.ex; public class Ex1RectangleObjectMain { public static void main(String[] args) { Ex1Rectangle rectangle = new Ex1Rectangle(); rectangle.height = 8; rectangle.width = 5; rectangle.calculateArea(); rectangle.calculatePerimeter(); rectangle.isSquare(); } }[질문 내용]3. 객체지향 프로그래밍 문제 1번의 제공된 정답에서는System.out.println으로 출력하는 부분을 main메서드 안에 남겨두었고,제가 문제를 푸는 과정에서는객체 클래스에 int area와 int perimeter를 선언한 후, 각 메서드를 int와 boolean값을 반환하지 않는 void메서드로 변경하고, 계산된 값을 출력하는 부분을 각 메서드 안에 넣어놓고,main메서드에서는 int width와 int height의 값을 지정하고 객체 클래스의 메서드들을 호출만 했고 같은 결과가 나오는데,둘 중 어느 것이 효율적이고 여러 방면에서 좋은 코드인가요??
-
미해결실전 JSP (renew ver.) - 신입 프로그래머를 위한 강좌
일반적으로 로그인 상태 판정을 쿠키로 하나요?
안녕하세요, 강의 잘 듣고 있습니다.본 영상에서는 memberId가 쿠키에 존재하면 로그인이 된 상태라고 간주하는데요실무에서도 이와 같은 방식으로 로그인 여부를 판정하는지 궁금합니다. 만약 쿠키를 사용하여 로그인 여부를 판정하게 된다면사용자 측에서 쿠키를 조작할 수 있기 때문에로그인이 되어 있지 않더라도 loginOk 페이지에 접근할 수 있을 것으로 보입니다. 간단하게 로그인을 성공했는지 여부만 따질때는본 예제처럼 쿠키 값을 이용하여 판별하는 경우도 많은지 궁금합니다.
-
미해결김영한의 실전 자바 - 기본편
코드 구현력
안녕하세요 영한님. 강의를 보면서 한층 더 발전한 것 같습니다.실제 문제2를 풀면서 변하는 부분은 결제 종류가 추가되는 부분이고 나머지는 수정되지 않는 것을 보면서이게 클린코드인가..? 이런 생각을 했습니다. 이런 식의 코드 구현력을 공부하려면 디자인 패턴을 공부해야 할까요 ? 한마디로 클린코드를 짜기 위해서 디자인 패턴에 대한 내용을 공부하면 어느정도 코드가 보이는 걸까요 ?
-
미해결스프링 시큐리티 OAuth2
Resouce Server에서 JWT 토큰 검증 후 로직추가
Resource Server 에서 JWT 토큰 검증 후 access token 에서 claim 을 추출하여 인증된 사용자의 추가 정보를 DB에 조회 후 SecurityContextHolder 에 저장하는 로직을 추가 하려고 합니다. Resource Server 에서 커스터 마이징이 가능한게 AuthenticationManager와 JwtAuthenticationConverter 등등인데 JwtAuthenticationConverter 은 적합하지 않을거 같아 AuthenticationManager에 JwtAuthenticationProvider 커스터 구현체를 등록해서 진행해야 할거 같은데 더 좋은 방벙이 있을까요?