inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

친구인가?(Union&Find) 첫 case1에서 타임리밋뜨는 이유

미해결

자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비

채점 결과 태스트 케이스2~5까지는 정답으로 나옵니다. 4개 모두 200ms안에 끝납니다 반면에 가장 테스트 케이스 크기가 작을 case1에서는 타임리밋이 뜹니다 이유는 무엇이고 해결책은 무엇일까요? import java.util.*; public class Main { static String answer = "NO"; static int N,M; static int[] ch,dis; public void BFS(int t1, int t2, ArrayList<ArrayList<Integer>> arr) { Queue<Integer> Q = new LinkedList<>(); Loop:for(int i = 1;i<=N;i++) { if(ch[i] == 0) { Q.offer(i); while(!Q.isEmpty()) { int tmp = Q.poll(); ch[tmp] = 1; dis[tmp] = 1; if(dis[t1] == 1 && dis[t2]==1) { answer = "YES"; break Loop; } int len = arr.get(tmp).size(); for(int j = 0;j<len;j++) { int n = arr.get(tmp).get(j); Q.offer(n); } } Arrays.fill(dis, 0); } } } public static void main(String[] args){ Scanner in=new Scanner(System.in); N = in.nextInt(); M = in.nextInt(); ch = new int[N+1]; dis = new int[N+1]; ArrayList<ArrayList<Integer>> arr = new ArrayList<>(); for(int i = 0;i<=N;i++) { arr.add(new ArrayList<Integer>()); } for(int i = 0;i<M;i++) { int a = in.nextInt(); int b= in.nextInt(); arr.get(a).add(b); } int t1 = in.nextInt(); int t2 = in.nextInt(); Main T = new Main(); T.BFS(t1, t2, arr); System.out.print(answer); } }

  • java
  • 코테 준비 같이 해요!
김유중 댓글 1 좋아요 0 조회수 324

타임 리밋이 일어나는 이유를 모르겠습니다.

해결됨

자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비

혼자 풀어봤을 때, 다음과 같은 코드를 작성하였는데요. 타임리밋이 일어날 만한 곳이 while문밖에 없는거같아서 계속 보는데 이유를 모르겠습니다. 첫 요소가 K만큼 들어왔으면 그 다음부터는 1번씩만 put하니까 괜찮을 것이라 생각했는데 어떠한 이유로 타임리밋이 뜨는걸까요 ㅠㅠ? public static String solution(int n,int k,int[] arr) { String answer =""; HashMap<Integer,Integer> map = new HashMap<>(); // 매출의 종류 => HashMap & Sliding Window int lt=0; for(int rt = 0;rt<=(n-k);rt++) { while(lt-rt<k&&lt<n) { map.put(arr[lt], map.getOrDefault(arr[lt],0)+1); lt++; } answer += map.size()+" "; if(map.get(arr[rt])>1) { map.put(arr[rt], map.get(arr[rt])-1); }else { map.remove(arr[rt]); } } return answer; }

  • java
  • 코테 준비 같이 해요!
qkslzl101216 댓글 1 좋아요 0 조회수 511

상속관계 오류

미해결

자바 ORM 표준 JPA 프로그래밍 - 기본편

Book.java Item 상속관계에서 오류가 발생했습니다..

  • java
  • JPA
kim1234123 댓글 2 좋아요 0 조회수 617

설정 오류

미해결

자바 ORM 표준 JPA 프로그래밍 - 기본편

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 이렇게 오류가 나서 해결이 안되는데 방법이 있을까요?

  • java
  • JPA
wxogud3377 댓글 2 좋아요 2 조회수 948

출력(전반전-정수)

미해결

나도코딩의 자바 기본편 - 풀코스 (20시간)

정수 3자리마다 콤마가 찍히는 원리를 답변 받고 싶습니다 ㅠㅠ

  • oop
  • java
문수 댓글 2 좋아요 -1 조회수 414

4. 벤더프리픽스

미해결

견고한 기본기 HTML&CSS

관리 화면에서 ‘ Autoprefixer: Format On Save’ 설정에 체크합니다. 이제 파일을 저장하면 Autoprefixer가 작동하며 자동으로 벤더프리픽스를 여러분의 코드에 추가합니다. 그리고 하단의 ‘ setting.json에서 편집 ’ 버튼을 눌러 setting.json 편집화면으로 이동합니다. 이때, setting.json 편집화면이 영상에 나오는 코딩과 다른데 그냥 작성해주신 아래 코드를 넣으면 괜찮을까요? "autoprefixer.options": { "browsers": [ "last 4 versions", /* 가장 최신 버전에서 4단계 아래 버전까지 지원합니다. */ "ie >= 9", /* IE9 버전 이상만 지원합니다. */ "> 5%" /* 전 세계 브라우저 사용률 중 5% 를 초과하는 브라우저만 대응합니다. */ ] }

  • HTML/CSS
3pkwon 댓글 1 좋아요 0 조회수 491

임베티드 타입에 대해 질문있습니다.

미해결

자바 ORM 표준 JPA 프로그래밍 - 기본편

7분44초에 임베디드 타입에서 같은 객체를 사용하여 저장하고 setter를 통해서 값을 수정하게 되면 같은 객체의 인스턴스를 사용하기 때문에 값이 member1과 member2가 둘 다 바뀐다고 하셔서 제가 테스트를 해봤습니다. 같은 메서드에서 member1과 member2를 같은 address 객체를 사용해서 저장한 건 똑같은데 다른 메서드에서 아래에 코드 처럼 member1을 찾아와서 city를 수정하니 member2는 수정이 안된 것을 확인하였습니다. 이것은 다른 트랜잭션을 사용하기 때문에 같은 인스턴스를 공유하고 있지 않은 건가요? Member member = em.find(Member.class, 1L); member.getHomeAddress().setCity("city");

  • java
  • JPA
댓글 1 좋아요 0 조회수 401

Ajax 인증시 인가코드가 발급 되지 않는 원인 문의

해결됨

스프링 시큐리티 OAuth2

Spring Authorization 1.0,1 기반으로 개발을 하고 있습니다. 인가코드를 발급 할떄 FormLogin 기본 설정을 사용하면 인가코드가 발급이 되는데 Ajax 로 로그인을 하면 인가코드가 발급되지 않고 있습니다. 디버깅을 해보면 로그인인 후 OAuth2AuthorizationEndpointFilter 는 실행되는데 @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { if (!this.authorizationEndpointMatcher.matches(request)) { filterChain.doFilter(request, response); return; } try { Authentication authentication = this.authenticationConverter.convert(request); if (authentication instanceof AbstractAuthenticationToken) { ((AbstractAuthenticationToken) authentication) .setDetails(this.authenticationDetailsSource.buildDetails(request)); } Authentication authenticationResult = this.authenticationManager.authenticate(authentication); if (!authenticationResult.isAuthenticated()) { // If the Principal (Resource Owner) is not authenticated then // pass through the chain with the expectation that the authentication process // will commence via AuthenticationEntryPoint filterChain.doFilter(request, response); return; } if (authenticationResult instanceof OAuth2AuthorizationConsentAuthenticationToken) { if (this.logger.isTraceEnabled()) { this.logger.trace("Authorization consent is required"); } sendAuthorizationConsent(request, response, (OAuth2AuthorizationCodeRequestAuthenticationToken) authentication, (OAuth2AuthorizationConsentAuthenticationToken) authenticationResult); return; } this.authenticationSuccessHandler.onAuthenticationSuccess( request, response, authenticationResult); } catch (OAuth2AuthenticationException ex) { if (this.logger.isTraceEnabled()) { this.logger.trace(LogMessage.format("Authorization request failed: %s", ex.getError()), ex); } this.authenticationFailureHandler.onAuthenticationFailure(request, response, ex); } } FormLogin 적용시에는 authenticationResult의 principal 에 UsernamePasswordAuthenticationToken이 설정되어 인가 코드가 정상적으로 발급되는데 AjaxLogin 적용시에는 authenticationResult의 principal 에 AnonymousAuthenticationToken이 설정되어 인가 코드가 정상적으로 발급되지 않고 403 예외가 발생합니다. AuthenticationProvider 구현체에서는 정상적으로 토큰을 저장하고 있습니다. AuthenticationProvider 구현체 소스 @Component @RequiredArgsConstructor public class CustomAuthenticationProvider implements AuthenticationProvider { private final CustomUserDetailsService customUserDetailsService; private final PasswordEncoder passwordEncoder; @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if(authentication == null){ throw new InternalAuthenticationServiceException("Authentication is null"); } LoginRequestDto loginRequestDto = (LoginRequestDto)authentication.getPrincipal(); String password = loginRequestDto.getLoginPassword(); UserAdapter userAdapter = (UserAdapter) customUserDetailsService.loadUserByLoinRequestDto(loginRequestDto); if (!passwordEncoder.matches(password, userAdapter.getCurrentUser().getLoginPwd())) { throw new BadCredentialsException("BadCredentialsException"); } CustomAuthenticationToken result = CustomAuthenticationToken.authenticated(userAdapter.getCurrentUser(), authentication.getCredentials(), userAdapter.getAuthorities()); result.setDetails(authentication.getDetails()); return result; } @Override public boolean supports(Class<?> authentication) { return CustomAuthenticationToken.class.isAssignableFrom(authentication); } } 이외 Custom 소스 Spring Security 설정 @EnableWebSecurity @RequiredArgsConstructor @Configuration public class DefaultSecurityConfig { private final CustomAuthenticationProvider customAuthenticationProvider; // private final CustomUserDetailsService customUserDetailsService; @Bean public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception { return authenticationConfiguration.getAuthenticationManager(); } @Bean public CustomAuthenticationProcessingFilter customAuthenticationProcessingFilter() throws Exception { CustomAuthenticationProcessingFilter filter = new CustomAuthenticationProcessingFilter(); // filter.setAuthenticationManager(authenticationManager(null)); filter.setAuthenticationManager(new ProviderManager(customAuthenticationProvider)); // filter.setAuthenticationSuccessHandler(customAuthenticationSuccessHandler()); // filter.setAuthenticationFailureHandler(customAuthenticationFailureHandler()); return filter; } // @formatter:off @Bean SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests(authorizeRequests ->authorizeRequests .requestMatchers(CorsUtils::isPreFlightRequest).permitAll() .requestMatchers(new AntPathRequestMatcher("/")).permitAll() .requestMatchers(new AntPathRequestMatcher("/login/**")).permitAll() .requestMatchers("/api/login/**").permitAll() .requestMatchers("/api/registered-client/**").permitAll() .anyRequest().authenticated() ); http.addFilterBefore(customAuthenticationProcessingFilter(), UsernamePasswordAuthenticationFilter.class); http.exceptionHandling(httpSecurityExceptionHandlingConfigurer -> httpSecurityExceptionHandlingConfigurer .authenticationEntryPoint(new CustomLoginAuthenticationEntryPoint()) .accessDeniedHandler(customAccessDeniedHandler()) ); // http.userDetailsService(customUserDetailsService); // http.formLogin(); http.csrf().disable(); return http.build(); } // @formatter:on @Bean public AccessDeniedHandler customAccessDeniedHandler() { return new CustomAccessDeniedHandler(); } @Bean public AuthenticationSuccessHandler customAuthenticationSuccessHandler() { return new CustomAuthenticationSuccessHandler(); } @Bean public AuthenticationFailureHandler customAuthenticationFailureHandler() { return new CustomAuthenticationFailureHandler(); } } Ajax 로그인 처리 필터 소스 public class CustomAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter { private final ObjectMapper objectMapper = new ObjectMapper(); private static final AntPathRequestMatcher DEFAULT_ANT_PATH_REQUEST_MATCHER = new AntPathRequestMatcher("/api/login", HttpMethod.POST.name()); public CustomAuthenticationProcessingFilter() { super(DEFAULT_ANT_PATH_REQUEST_MATCHER); } public CustomAuthenticationProcessingFilter(AuthenticationManager authenticationManager) { super(DEFAULT_ANT_PATH_REQUEST_MATCHER, authenticationManager); } @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { if (!request.getMethod().equals("POST")) { throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod()); } LoginRequestDto loginRequestDto = objectMapper.readValue(request.getReader(), LoginRequestDto.class); if(StringUtils.isEmpty(loginRequestDto.getLoginId())||StringUtils.isEmpty(loginRequestDto.getLoginPassword())) { throw new IllegalStateException("Username or Password is empty"); } CustomAuthenticationToken authRequest = CustomAuthenticationToken.unauthenticated(loginRequestDto, loginRequestDto.getLoginPassword()); authRequest.setDetails(this.authenticationDetailsSource.buildDetails(request)); return getAuthenticationManager().authenticate(authRequest); } } CustomAuthenticationToken 소스 public class CustomAuthenticationToken extends AbstractAuthenticationToken { private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID; private final Object principal; private Object credentials; public CustomAuthenticationToken(Object principal, Object credentials) { super(null); this.principal = principal; this.credentials = credentials; setAuthenticated(false); } public CustomAuthenticationToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) { super(authorities); this.principal = principal; this.credentials = credentials; super.setAuthenticated(true); // must use super, as we override } public static CustomAuthenticationToken unauthenticated(Object principal, Object credentials) { return new CustomAuthenticationToken(principal, credentials); } public static CustomAuthenticationToken authenticated(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) { return new CustomAuthenticationToken(principal, credentials, authorities); } @Override public Object getCredentials() { return this.credentials; } @Override public Object getPrincipal() { return this.principal; } }

  • java
  • oauth
  • spring-boot
  • spring
신석균 댓글 2 좋아요 1 조회수 1390

JdbcTemplate 테스트에서의 중복 회원 예외 오류가 뜨는 이유를 모르겠습니다.

미해결

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (비슷한 내용은 있었지만 원하는 해답을 찾지 못했습니다) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예) [질문 내용] 여기에 질문 내용을 남겨주세요. 차근차근 강의 예제를 따라가면서 잘 오고 있었는데 테스트 하는 부분에서 갑작스런 오류로 인해 해답을 찾던 도중 어려움을 겪어서 프로젝트 링크와 오류 사진을 남기겠습니다 https://drive.google.com/file/d/1DIAzsFD6RnTCv73h-kNpeDWUE5CsF8oC/view?usp=share_link

  • spring-boot
  • mvc
  • MVC
  • spring
  • java
김동우 댓글 2 좋아요 1 조회수 738

업로드 후 홈화면에서 이미지가 보이지 않습니다

미해결

비전공자를 위한 진짜 입문 올인원 개발 부트캠프

데이터 베이스에도 기록이 잘 들어가고 사이트 홈화면에도 잘 뜨는데 화면의 이미지가 안뜹니다. uploads파일에도 이미지 다 잘 들어갑니다. 인강과 데이터베이스를 비교해봤을 때 경로문제인것같긴한데 어떻게 수정을 해야할까요? 근데 DB경로의 역슬래시를 슬래시로 바꾸어도 안뜨고 uploads에는 사진도 잘 들어가고 사진의 경로를 봤을때도 동일해서... 왜 안뜨는걸까요? 단순히 한사진의 오류라고생각했었는데 등록한 것 모두 이렇게 되어서... 어딜 어떻게 수정해야할지모르겠어서... 일단은 깃허브링크 함께올려봅니다... 홈사이트 화면 개발자 툴 상품넣고 난뒤 DB데이터 베이스 물건 등록 후 vscode에 뜨는것 깃허브 링크: https://github.com/Dalrae03/webstudy/commit/7a5981dafabdbf009b40c0c5814e7e7c6f3ea9de https://github.com/Dalrae03/webstudy/commit/c9106654b1d6badba9ae64ce744a11da46b719a5

  • html/css
  • 머신러닝 배워볼래요?
  • express
  • node.js
  • react-native
  • react-native
  • tensorflow
  • react
  • 머신러닝
  • HTML/CSS
  • nodejs
  • javascript
Yoo Seung Hwan 댓글 1 좋아요 0 조회수 602

static 메소드와 instance 메소드의 접근?

해결됨

나도코딩의 자바 기본편 - 풀코스 (20시간)

안녕하세요 ㅎㅎ 다름이 아니라 나도코딩 자바편에서 메소드를 공부하면서 궁금증이 생겨, 이렇게 또 다시 질문을 남깁니다...ㅎ 나도코딩 자바편을 보는 것과 동시에, 제 스스로 나름 예제들도 풀면서 개념을 익히고 있는데요...ㅎ 방금 전에 제가 문자열(String)배열과 charAt()을 이용하여, 전치행렬을 만드는데 성공했습니다...ㅎ 결과도 잘 출력했구요 ㅎㅎ 이 예제를 푸는 데는 String, String[], length(), charAt()에 대한 선생님의 도움과 답변이 없었으면 풀지 못했을 건데, 선생님의 자세한 답변 덕분에 문제를 빠르게 잘 풀 수 있었습니다. 감사합니다 ㅎㅎ 아래가 제가 쓴 코드고, 출력한 결과입니다: 여기서부터가 제 질문인데요...ㅎ static 메소드(public static void main(String[] args) {...})에서 일반 메소드를 접근하려면, 에러 메시지로 'non-static variable/method cannot be referenced fromstatic context.'라고 나오는데, 이럴 경우에 에러를 없애고, 결과를 잘 출력하려면: pubilc static void main 메소드 앞에 첫 번째 방법으로 void transpose 메소드를 static void tranpose라고 바꾸거나, 아니면 2번째 방법으로 static 메소드 안에서 이렇게 Question_03 making = new Question_03(); 즉, (클래스 이름) (객체 이름) = new (클래스 이름)(); 이런 식으로 객체화를 해서 메소드를 접근해야 하나요?

  • java
  • 객체지향
  • oop
  • 메소드
  • static
댓글 1 좋아요 0 조회수 751

일정시간마다 자동으로 데이터를 생성하는 코드를 짜려고 합니다.

해결됨

비전공자를 위한 풀스택 맛집지도 만들기 프로젝트!: Front, Back-end 그리고 배포까지

외부 api 에서 ajax를 통해 데이터를 받아오고, 받아온 데이터를 카피해서 mysql 에 삽입하고자 합니다. 일정시간마다 반복하는 것은 setInterval 을 활용하면 되는것까지는 구글링을 통해 알아냈는데 본 강의에서는 데이터 생성을 postman 을 사용해 수동으로 데이터를 입력하고 전송하셔서 코드 상으로는 어떻게 구현해야 할지 궁금해서 여쭤봅니다! 1줄요약! postman을 통해 했던 데이터 삽입을 코드로 하는 방법이 궁금합니다!

  • HTML/CSS
  • rest-api
  • git
  • aws
  • javascript
  • github
  • mysql
전예준 댓글 1 좋아요 0 조회수 512

image 파일에서 vscode로 드래그 앤 드롭을 처리할 수 없다고 합니다

미해결

비전공자를 위한 진짜 입문 올인원 개발 부트캠프

압축을 푼뒤 진행해도 에러가 납니다 The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding.라고 나오고요 hexeditor를 깔아도 해결이 안됩니다 찾아보니 50mb를 넘는 자료를 vs코드에서 지원을 못한다고 하는데요 참고로 집에 컴퓨터가 없어 pc방 컴퓨터로 배우는 중입니다

  • html/css
  • javascript
  • tensorflow
  • node.js
  • HTML/CSS
  • nodejs
  • react-native
  • 머신러닝
  • react
  • 머신러닝 배워볼래요?
  • express
tostarmk 댓글 1 좋아요 0 조회수 1034

31강 대출기능에서 테이블 생성에 대한 질문입니다.

해결됨

자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]

대출기능을 개발하려고 하니, 저희가 가진 두 테이블, User와 Book은 서로를 가리킬 필드가 없어서 '대출했다.'라는 정보를 표시할 수 없었습니다. 그래서 user_loan_history 테이블을 새로 만드는 내용이 강의의 주된 내용이 되는데요, 제가 궁금한건 여기서 User와 Book 테이블을 수정하여, 예를들면 User테이블에는 OneToMany로 Book의 id를 가리킬 수 있는 필드를, Book테이블에는 ManyToOne으로 User의 id를 가리킬 수 있는 필드를 추가하여 개발할 수도 있지 않나 싶어서요! 객체지향적으로 생각했을 때 User와 Book은 객체지만, '대출기록'은 객체가 아니라 객체간의 관계 같아서 테이블로 만드는 것에 거부감이 생기는 것 같습니다. 어떤 이유에서 기존의 테이블을 수정하지 않고, 새로운 테이블을 만들었는지 궁금합니다!

  • spring
  • spring-boot
  • JPA
  • java
  • aws
  • jpa
  • mysql
Dompoo 댓글 1 좋아요 2 조회수 474

선생님 익스는 사라지지 않았나요?

미해결

풀스택을 위한 탄탄한 프런트엔드 부트캠프 (HTML, CSS, 바닐라 자바스크립트 + ES6) [풀스택 Part2]

선생님 익스플로러는 사라지지 않았나요? 모던 HTML/CSS/VanillaJS+ES6 로 상용화도 가능한 반응형 모던 웹페이지 만들기6 이번 강의 들어야 되는지.. 헷갈리네요. 오직 익스 호환성을 위한거라면.. 그냥 스킵해도 되나요?

  • html/css
  • es6
  • javascript
  • HTML/CSS
소희 댓글 1 좋아요 0 조회수 460

유튜브 썸네일 따는 과정에서 오류가 생겨요 숏츠는 다른 방법이 있나요?

미해결

비전공자를 위한 풀스택 맛집지도 만들기 프로젝트!: Front, Back-end 그리고 배포까지

유튜브 숏츠의 썸네일을 사용하려고 합니다 인포윈도우 가공하기 단계에서 똑같이 하는데도 섬네일이 오류표시가 나요ㅜㅜ 숏츠는 방법이 다른건가요?

  • html/css
  • rest-api
  • mysql
  • HTML/CSS
  • github
  • aws
  • javascript
  • git
박선희 댓글 1 좋아요 0 조회수 846

SpringConfig에 JdbcMemberRepsoitory반환 오류

미해결

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

[질문 내용] SpringConfig클래스에 MemoryMemberRepsoitory 메소드에 retrun new JdbcMemberRepository();를 하고 dataSource 객체 생성 후 생성자까지 만들어주었습니다. 여기까지는 ()에 오류가 생기는데 여기에 dataSource를 넣어주면 전체오류가 생기여 옵션엔터를 눌러 해결하면 메소드 이름을 MemoryMemberRepository가 아닌 JdbcMemeberRepository로 바꿔라 합니다. 이를 변경하면 위에 MemberService도 바꿔야하며 전체코드에 이상이 생깁니다. package hello.hellospring; import hello.hellospring.repository.JdbcMemberRepository; import hello.hellospring.repository.MemoryMemberRepository; import hello.hellospring.service.MemberService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import javax.sql.DataSource; @Configuration public class SpringConfig { DataSource dataSource; public SpringConfig(DataSource dataSource) { this.dataSource = dataSource; } @Bean public MemberService memberService(){ return new MemberService(memberRepository()); } @Bean public MemoryMemberRepository memberRepository(){ //return new MemoryMemberRepository(); return new JdbcMemberRepository(dataSource); //오류발생 } } java: incompatible types: hello.hellospring.repository.JdbcMemberRepository cannot be converted to hello.hellospring.repository.MemoryMemberRepository 이러한 오류내용이 뜹니다. 수업 소스코드와 동일하게 해봤는데 이럽니다!

  • MVC
  • java
  • mvc
  • spring
  • spring-boot
  • spring-boot
nskynet5374 댓글 1 좋아요 0 조회수 667

Contact 설정 관련해서 질문이 있어요

미해결

비전공자를 위한 풀스택 맛집지도 만들기 프로젝트!: Front, Back-end 그리고 배포까지

제가 html, css 등 까지 수강하고 배포 등 다음 과정으로 넘어가려고 하는데 Contact를 활용하는 강의를 못 본거 같아서요 혹시 제가 놓친 부분이 있을까요? 감사합니다..!

  • html/css
  • HTML/CSS
  • rest-api
  • github
  • aws
  • git
  • javascript
  • mysql
박선희 댓글 1 좋아요 0 조회수 330

auto-fill, auto-fill이 적용되지 않는것 에 대해 질문드립니다.

미해결

CSS Flex와 Grid 제대로 익히기

Q1: auto-fill 에 대해 질문드립니다. <Grid #3 강의의 4:30초> 에서 셀이 2개 있고, grid-template-columns에 minmax(200px, auto)가 설정되어 있으며 auto-fill이 적용되어 있을때 grid-template-columns: repeat(auto-fill, minmax(200px, auto)) 전체 Grid Container의 넓이가 500px 일때에, 셀의 column 길이가 200px 이상이 되어지게 됩니다. 제가 알기로는 minmax(최솟값, auto) 라면 셀의 길이가 최솟값 보다 커지려면 셀이 가지는 컨텐츠의 길이가 최솟값보다 커야된다고 알고 있는데요. 그런데 왜 auto-fill이 설정되어 있을때에는 컨텐츠의 column 길이가 200px 보다 작은데 왜 Grid Container의 넓이 만큼 늘어나는 것인가요? 이것이 auto-fill을 적용하여 Grid의 기본 성질인 꽉 차게 늘어나는 성질때문에 그런가요? Q2 auto-fill 적용불가에 대해 질문드립니다. 저의 브라우저에서 테스트 해본결과, auto-fill이 적용이 되지 않는 부분은 셀이 2개가 있고, column의 길이가 minmax(200px, auto) 이며, auto-fill을 사용하고, Grid Container의 넓이가 600px 초과 된다면, 셀이 가지는 column의 길이가 원래는 Grid Container의 길이만큼 꽉차게 늘어나다가 200px이 가질 수 있는 크기를 넘어서게 되니 꽉차지 않게 되는 것 같습니다. 위의 질문과 동일한 것같습니다만, 자동으로 늘어나는 것은 400px (200px 셀 2개) 의 크기보다 Grid Container의 길이에서 뺀것의 크기가 200px 이상이라면 자동으로 늘어나는 것이 중단되고, 200px 이하라면 늘어나는 것이 되는 것인데, 왜 200px 이하라면 늘어나는 것입니까? Grid Container의 넓이를 200px으로 나눌때 나머지가 200px 보다 작다면 그냥 Grid의 성질에 의해 늘어나는 것인가요? Flex만 사용하던 사람이라 minmax의 대한 성질과 auto-fill을 공부하니 약간 했갈리네요...

  • html/css
  • flex
  • HTML/CSS
  • flex
chebread 댓글 1 좋아요 0 조회수 584

upload 페이지에 아무것도 안 뜨는 현상

미해결

비전공자를 위한 진짜 입문 올인원 개발 부트캠프

안녕하세요. 그랩님 매일 같이 열정적으로 댓글 달아주셔서 항상 감사드립니다. 모든 것이 그러하듯 강의를 운영하는 것도 엄청난 공수가 든다는 것을 깨달았네요. 현재 오류가 생겼는데, useHistory를 이용해서 upload 페이지로 이동한 후 Upload 클라이언트 쪽에서 아무 반응도 일어나지 않고 있습니다. 아무리 코드랑 구글링을 해봐도 해결이 안되는데요. upload페이지가 console창을 보면 /upload/index.js의 html 코드가 아무것도 불러와지지 않고 있는 것 같아요. 혹시 조언좀 구할 수 있을까요? 1. 현상 : 클라이언트에 아무것도 뜨지 않음 Elements 창을 클릭해도 upload.js 작성한 HTML이 없습니다. 2.App.js에 제가 작성한 코드입니다. History와 import 란에 모두 정확하게 작성하였는데요. 3. upload/index.js 파일 코드도 같이 첨부드립니다. 한번만 봐주실 수 있을까요? ㅠ useHistory가 만료가 되어서 작동을 안 하는걸까요.. https://github.com/promotionX/Grabmarket-clinet

  • html/css
  • react
  • HTML/CSS
  • node.js
  • nodejs
  • tensorflow
  • 머신러닝 배워볼래요?
  • 머신러닝
  • react-native
  • express
  • javascript
promotion 댓글 1 좋아요 0 조회수 460

인기 태그

인프런 TOP Writers

주간 인기글