묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결김영한의 실전 자바 - 기본편
displayInfo 메소드에 배열 인스턴스 문의
Book 클래스 displayInfo 메소드에 book1 ~ book3 까지 각각 인스턴스를 넣어 정상적으로 출력이 되었습니다 void displayInfo(){ System.out.println("제목:" + title + ", 저자:" +author+ ", 페이지:" + page); } --- Main 메소드 --- book1.displayInfo(); book2.displayInfo(); book3.displayInfo(); 만약 displayInfo 메소드에 Books 인스턴스 배열을 매개 변수로 넣고 for문으로 처리하고 싶으면 어떻게 코드 수정을 해야 할까요? 뾰족한 수가 생각이 안나 스스로 해보는 중인데 ㅠㅠ 되지 않네요 혹시 가능할까요..? Book 클래스 displayInfo 메소드에 아무 매개변수를 배열 인자를 받아야 뭐 해결이 될거 같은데..ㅠ < 시도중인 코드> === Book 클래스 displayInfo 메소드=== void displayInfo(Book[] books){ for(int i=0; i <= books.length;i++){ System.out.println("제목:" + books[i].title + ", 저자:" +ooks[i]. author+", 페이지:" + ooks[i]. page); } } === 메인 메소드 === Book book1 = new Book(); Book book2 = new Book("Hello Java", "Seo"); Book book3 = new Book("JPA 프로그래밍","Kim", 700); Book[] books = {book1, book2, book3}; books.displayInfo();
-
미해결실전! Querydsl
contextLoads() 테스트 오류 질문드립니다.
@SpringBootTest class QuerydslApplicationTests { @Autowired EntityManager em; @Test void contextLoads() { Hello hello = new Hello(); em.persist(hello); JPAQueryFactory query = new JPAQueryFactory(em); QHello qHello = new QHello("h"); Hello result = query .selectFrom(qHello) .fetchOne(); assertThat(result).isEqualTo(hello); } }강사께서 진행하신 테스트를 똑같이 따라했는데 계속해서 TransactionRequiredException이 발생했습니다. 결국 @Transactional을 붙여주니 테스트가 정상적으로 수행됐는데요, 강의에서는 @Transactional이 없이도 잘 동작했는데 왜 저는 그렇지 않은 이유가 무엇일까요? 참고로 Spring Boot 3.2.5 최신 버전 사용중입니다.
-
미해결ASP.NET Core MVC +ASP.NET Core +REST API +.NET 8.0
해당 코드가 작동하지 않는 이유
강의 들으면서 도움이 많이 되고 있습니다.중간까지의 과정을 복습하고싶어 필기와 기억을 토대로 코드를 작성했는데, 첫 수업 복습부터 난항을 겪고 있습니다. program.cs에 오류가 없음에도 작동하지 않아 고민입니다. 1강 강의 기준 똑같은 내용의 코드를 이미 만들어두었던 코드에서 가져와 붙여놓았을때에는 또 정상적으로 작동하는데, 무엇이 문제인지 도통 모르겠습니다.var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); var app = builder.Build(); app.MapControllerRoute( name: default, pattern: "{controller=Home},{action=Index}/{id?}"); app.Run();이게 문제가 발생하는 코드var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(); var app = builder.Build(); app.MapControllerRoute( name: default, pattern: "{controller=Home}/{action=Index}/{id?}"); app.Run();이게 정상적으로 작동하는 코드입니다.이럴 때에는 어떻게 해야 하나요? 왜 첫 코드가 정상적으로 작동하지 않을까요? 무엇을 놓친건지를 모르겠어요...
-
미해결Next + React Query로 SNS 서비스 만들기
provider 가 안되요...
안녕하세요 provider 따라해보는중 다른데는 잘되는데 안되는곳이 있어 문의드립니다. "use client" import {createContext, ReactNode, useState} from "react"; const currentYear = new Date().getFullYear(); const currentMonth = new Date().getMonth() + 1; export const FilterContext = createContext({ year: currentYear, setYear: (value: number) => {}, month: currentMonth.toString().padStart(2, "0"), setMonth: (value: string) => {}, }); type Props = { children: ReactNode }; export default function FilterProvider({ children }: Props) { const [ year, setYear ] = useState(currentYear); const [ month, setMonth ] = useState(currentMonth.toString().padStart(2, "0")); return ( <FilterContext.Provider value={{ year, setYear, month, setMonth }}> {children} </FilterContext.Provider> ); } const { year, setYear, month, setMonth } = useContext(FilterContext); const [selectBox2, setSelectBox2] = useState(false); const [selectBox3, setSelectBox3] = useState(false); {Array.from({ length: year - 2019 }, (_, index) => year - index).map((item) => ( <li key={item} onClick={() => { setSelectBox2(false); setYear(item); console.log(item); }}>{item}</li> ))} {Array.from({ length: 12 }, (_, index) => (index + 1).toString().padStart(2, "0")).map((item) => ( <li key={item} onClick={() => { setSelectBox3(false); console.log("month",item); setMonth(item); }}>{item}</li> ))}yser, month 가 업데이트가 될질 않아서요. 콘솔에는 찍히는데 값이 변경이 안되는 이유를 모르겠습니다.
-
미해결실전! 스프링 데이터 JPA
junit5쓴다는건가요ㅠ
강의 영상에서는 위와같이 구성해서 4를 제외 시켰자나요? 그런데 왜 강의 pdf 에서는 4를 쓴다는건가요?ㅠ
-
미해결Next + React Query로 SNS 서비스 만들기
useMutation의 onError에 관하여 질문있습니다.
안녕하세요. 제로초님 항상 좋은 강의 감사드립니다. 해당 강의에서 팔로우 api에 의도적으로 에러를 일으켜 보았는데, onError에서 캐치하지 못하는 것을 확인했습니다. const follow = useMutation({ mutationFn: (userId: string) => { // console.log('follow', userId); return fetch( `${process.env.NEXT_PUBLIC_BASE_URL}/api/users/${userId}/follow`, { credentials: 'include', method: 'post', } ); }, ... onError(error, userId: string) { ... } 그래서 밑에와 같이 바꾸어보니 onError에서 캐치하여 롤백이 정상적으로 되었습니다. mutationFn: async (userId: string) => { const response = await fetch( `${process.env.NEXT_PUBLIC_BASE_URL}/api/users/${userId}/follow`, { credentials: 'include', method: 'post', } ); if (!response.ok) { throw new Error('팔로우 실패'); } return response; },혹시 본 강의 코드대로 하면 onError에서 원래 캐치해야하는데 안 되는 것인지 아니면 수강생들에게 숙제로 낸 것인지 궁금합니다.
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
프록시와 연관관계 관리-프록시 질문있습니다.
refMember.getUsername()을 하면 프록시가 초기화 된다고 하셨는데요. em.detach나 em.clear가 영속상태에서 준영속상태로 바껴야지 초기화인데 단순히 get만 호출한건데 준영속으로 바뀔수가 있나요? 즉시 로딩과 지연 로딩3분 16초 m.getTeam().getName()이부분이 프록시라고 하셨는데 이부분만 보고 프록시인지 아닌지 어떻게 알아요?
-
미해결CS 지식의 정석 | 디자인패턴 네트워크 운영체제 데이터베이스 자료구조
FIFO 부분
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. FIFO 부분 설명하실 때 Miss, Hit 이 부분에서 1,3,0 부분을 참조할 때 Page Miss가 뜬다고 하셨는데, 이게 결국 페이지 폴트인가요 ?참조하고자 하는 곳에 없기 때문에 1,3,0 순으로 페이지를 가져왔다 ? 이렇게 생각하면 되는건지 궁금합니다. 그리고 페이지 힛은 가상 메모리의 페이지가 이미 실제 물리 메모리에 로드되어 있어서 (캐시 ?) 해당 페이지에 바로 접근 가능하다고 이해하면 될지 궁금합니다.
-
미해결CS 지식의 정석 | 디자인패턴 네트워크 운영체제 데이터베이스 자료구조
LFD 예시 부분에서 질문
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요 큰돌님, 주어진 예시에서 궁금한 점이 생겨서 질문 남깁니다.오프라인 알고리즘에서 페이지 최대가 3개이고,0,1,2,3,4,2 순으로 들어올 때1. 0,1,2 -> 3,1,22. 3,1,2 -> 4,1,2이렇게 교체하면 스와핑은 단 2번만 일어나서 이게 최대의 경우 아닌가요 ?어째서 가장 먼 미래에 참조되는 페이지와 교체해야 하는지 잘 모르겠습니다.
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
itemcode.name
미세먼지 강의 중에 itemCode.name에 name을 쓰는 근거가 이해가 안됩니다.어디를 확인해 봐야 될까요 ?
-
미해결쿠버네티스 어나더 클래스-Sprint 1, 2 (#실무기초 #설치 #배포 #Jenkins #Helm #ArgoCD)
Jenkins Pipeline step 1 에러입니다.
Container Build 단계에서 아래와 같은 에러가 발생합니다.The recommended git tool is: NONE No credentials specified > git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/2211-jenkins_pipeline-step1/.git # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/k8s-1pro/kubernetes-anotherclass-sprint2.git # timeout=10 Fetching upstream changes from https://github.com/k8s-1pro/kubernetes-anotherclass-sprint2.git > git --version # timeout=10 > git --version # 'git version 2.25.1' > git fetch --tags --force --progress -- https://github.com/k8s-1pro/kubernetes-anotherclass-sprint2.git +refs/heads/*:refs/remotes/origin/* # timeout=10 > git rev-parse refs/remotes/origin/main^{commit} # timeout=10 Checking out Revision fb1fbf9171da06bea8c17ae38ff8e3f47981527c (refs/remotes/origin/main) > git config core.sparsecheckout # timeout=10 > git config core.sparsecheckout true # timeout=10 > git read-tree -mu HEAD # timeout=10 > git checkout -f fb1fbf9171da06bea8c17ae38ff8e3f47981527c # timeout=10 ERROR: Checkout failed hudson.plugins.git.GitException: Command "git checkout -f fb1fbf9171da06bea8c17ae38ff8e3f47981527c" returned status code 128: stdout: stderr: error: Entry '.gitignore' not uptodate. Cannot update sparse checkout. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2842) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:3170) Caused: hudson.plugins.git.GitException: Could not checkout fb1fbf9171da06bea8c17ae38ff8e3f47981527c at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:3198) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1355) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:136) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:101) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:88) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840) ERROR: Maximum checkout retry attempts reached, aborting 강사님의 Github Repository URL, fork 뜬 제 Github Repository URL 모두 시도해봤지만 동일한 결과입니다. (fork 뜬 Github Repo URL 시, Sync Fork 확인했습니다.)구글링을 해도 시원한 해결이 되지 않아서 질문 드립니다.감사합니다.
-
미해결리눅스 커널의 구조와 원리: 디버깅 - Basic [저자 직강 1부-2]
라즈베리 OS
수업 실습을 따라할려면 , 강사님 putty에 나온것 처럼 할려면 라즈베리 상품을 구매해야 하나요?, 아니면 따로 설치하는 방법이 있을까요?
-
미해결U-Net 구현으로 배우는 딥러닝 논문 구현 with TensorFlow 2.0 - 딥러닝 의료영상 분석
안녕하세요 train_isbi부분 문의드려요
2000/2000 [==============================] - ETA: 0s - loss: 0.2448 - accuracy: 0.9157Epoch 1: loss improved from inf to 0.24480, saving model to saved_model_isbi_2012\unet_model.h5Traceback (most recent call last):File "train_isbi_2012.py", line 180, in <module>app.run(main)File "D:\anaconda\envs\tfunet\lib\site-packages\absl\app.py", line 308, in runrunmain(main, args)File "D:\anaconda\envs\tfunet\lib\site-packages\absl\app.py", line 254, in runmainsys.exit(main(argv))File "train_isbi_2012.py", line 177, in maincallbacks=[model_checkpoint_callback, tensorboard_callback, custom_callback])File "D:\anaconda\envs\tfunet\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handlerraise e.with_traceback(filtered_tb) from NoneFile "D:\anaconda\envs\tfunet\lib\site-packages\keras\saving\legacy\save.py", line 155, in save_model"Saving the model to HDF5 format requires the model to be a "NotImplementedError: Saving the model to HDF5 format requires the model to be a Functional model or a Sequential model. It does not work for subclassed models, because such models are defined via the body of a Python method, which isn't safely serializable. Consider saving to the Tensorflow SavedModel format (by setting save_format="tf") or using save_weights.2024-05-05 07:43:59.819913: W tensorflow/core/kernels/data/generator_dataset_op.cc:108] Error occurred when finalizing GeneratorDataset iterator: FAILED_PRECONDITION: Python interpreter state is not initialized. The process may be terminated.[[{{node PyFunc}}]]이런문제가 뜨고 사진 5장도 저장안되고 save 폴더 안에도 저장되는게 없는데요 인터넷을 찾아봐도 무슨 문제인지 나오질 않아서 물어봐요 ㅜ(밑에 다른사람이 비슷한사례가 있어 바꿔보았는데 이렇게 뜨네요)2000/2000 [==============================] - ETA: 0s - loss: 0.2294 - accuracy: 0.9116Epoch 1: loss improved from inf to 0.22941, saving model to unet_model.h5Traceback (most recent call last): File "C:\Users\Administrator\Desktop\UNET-tf2-main\train_isbi_2012.py", line 180, in <module> app.run(main) File "D:\anaconda\envs\tfunet\lib\site-packages\absl\app.py", line 308, in run runmain(main, args) File "D:\anaconda\envs\tfunet\lib\site-packages\absl\app.py", line 254, in runmain sys.exit(main(argv)) File "C:\Users\Administrator\Desktop\UNET-tf2-main\train_isbi_2012.py", line 177, in main callbacks=[model_checkpoint_callback, tensorboard_callback, custom_callback]) File "D:\anaconda\envs\tfunet\lib\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler raise e.with_traceback(filtered_tb) from None File "D:\anaconda\envs\tfunet\lib\site-packages\keras\saving\legacy\save.py", line 155, in save_model "Saving the model to HDF5 format requires the model to be a "NotImplementedError: Saving the model to HDF5 format requires the model to be a Functional model or a Sequential model. It does not work for subclassed models, because such models are defined via the body of a Python method, which isn't safely serializable. Consider saving to the Tensorflow SavedModel format (by setting save_format="tf") or using save_weights.2024-05-05 14:39:03.225178: W tensorflow/core/kernels/data/generator_dataset_op.cc:108] Error occurred when finalizing GeneratorDataset iterator: FAILED_PRECONDITION: Python interpreter state is not initialized. The process may be terminated. [[{{node PyFunc}}]]Process finished with exit code 1
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
class를 직접사용
강의를 들으면서 class에 대한 혼동이 생겨 문의합니다... static 을 쓰지 않았는데..class를 인스터스화 하지 않고 class를 직접사용이 가능한가요..? 미세먼지 강의 영상중 캡쳐해서 올립니다.
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
디바이스 선택이 안됩니다
실행버튼 옆에 select device를 선택하려고 하니 not applicable for the "main.dart" configuration라고 뜨네요 ㅠㅠ
-
미해결실습으로 배우는 프로메테우스 - {{ x86-64, arm64 }}
helm으로 프로메테우스 설치 시 PVC 관련 질문
질문 답변을 제공하지만, 강의 비용에는 Q&A는 포함되어 있지 않습니다. 다만 실습이 안되거나, 잘못된 내용의 경우는 알려주시면 가능한 빠르게 조치하겠습니다![질문 전 답변]1. 강의에서 다룬 내용과 관련된 질문인가요? [예 | 아니요]2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? [예 | 아니요]3. 질문 잘하기 법을 읽어보셨나요? [예 | 아니요](https://www.inflearn.com/blogs/1719)4. 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.[질문 하기]helm으로 프로메테우스 설치 시 StorageClass 관련 내용을 정의해주지 않았는데, 어떻게 프로메테우스는 NFS StorageClass를 사용하는 PVC 를 만들어 내나요?
-
미해결자바 동시성 프로그래밍 [리액티브 프로그래밍 Part.1]
사용자모드와 커널모드 피드백
유저 모드에서 I/O 장치들과 같은 특정 리소스에 접근이 불가한 것을 배웠습니다.스레드가 커널 모드가 필요하지 않는 작업을 수행할때도 어쨌든 CPU를 할당받아서 연산을 할 수 있다는 점도 직관적으로 알 수 있도록 그림이 아래와 같이 바뀌면 어떨까요?
-
해결됨[리뉴얼] 맛집 지도앱 만들기 (React Native & NestJS)
marker.d.ts 에러 문제
import {LatLng, MapMarkerProps} from 'react-native-maps'; // marker props의 타입을 변경 declare module 'react-native-maps' { export interface MyMapMarkerProps extends MapMarkerProps { coordinate?: LatLng; } } Interface 'MyMapMarkerProps' incorrectly extends interface 'MapMarkerProps'.Type 'MyMapMarkerProps' is not assignable to type '{ anchor?: Point | undefined; calloutAnchor?: Point | undefined; calloutOffset?: Point | undefined; centerOffset?: Point | undefined; coordinate: LatLng; ... 22 more ...; zIndex?: number | undefined; }'.Types of property 'coordinate' are incompatible.Type 'LatLng | undefined' is not assignable to type 'LatLng'.Type 'undefined' is not assignable to type 'LatLng'.ts(2430)이런 에러가 발생합니다. 강의와 동일하게 했는데 그렇습니다! 아래 질문주신분 답변에 응답이 없어서 다시 질문드리는 점 양해부탁드립니다!
-
미해결카프카 완벽 가이드 - 코어편
OrderDBHandler 에서 데이터가 다 안들어가고 누락이 됩니다.
원인을 찾아보니insertOrders 메소드에서pstmt.executeUpdate();이 부분이 문제입니다.대신에pstmt.executeBatch();이렇게 하니누락된 데이터가 없이다 들어갑니다.
-
미해결사물인터넷 통신은 내 손에 (Arduino, MQTT, Nodejs, MongoDB, Android,VS Code)
몽고DB 사용 이유 문의
보통 정해진 데이터를 받는 경우 SQL을 사용하는 것 같은데 MongoDB를 사용하시는 이유가 따로 있을까요?