안녕하세요 . 아직 리액트에 빠져살아서 서버컴포넌트와 클라이언트 컴포넌트 사용 구분이 잘 가지 않아 질문드립니다. 1번 질문. 예를들어 3개의 페이지가 존재한다고 했을때, 각 페이지는 navbar(하위컴포넌트)를 가지려고 하는데요 navbar의 버튼은 각 페이지 마다 다 다른 함수로 동작하게 된다고 가정하면, 3개의 페이지 컴포넌트는 'use-client'를 사용하여 클라이언트 컴포넌트가 되어야 하는게 맞나요? 그렇다면 페이지의 하위컴포넌트를 서버컴포넌트로 만들면 서버컴포넌트로 사용하면 ssr을 사용하는 이유가 충분할까요? 2번질문. after_login 폴더 안에 _lib폴더에서 'getTrends'함수로 패치를 했는데요, 결국에는 클라이언트 컴포넌트에서 usequery로 데이터를 패치해오고 있습니다. 그러면 데이터 패치도 클라이언트컴포넌트에서 진행하는것인데, 1번상황에 패치도 2번과 같이 한다면 서버사이드렌더링의 장점은 어떤것이라고 볼 수 있을까요?
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 아니요 3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예 [질문 내용] 양쪽에 LAZY로 설정되어 있는것 같은데 맴버를 조회하면 ORDER와 MEMBER가 무한으로 탑니다. ( 주문까지 진행한 상태 ) 그게 현재 진도에서 맞는 상태인지 궁금합니다. (다음 강의에 설명 나오는지 모름)
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예 [질문 내용] 안녕하세요. 메서드 호출과 값 전달 2 강의 중 질문사항이 있어 문의 드립니다. 지역 변수 선언 시 다른 영역인 점은 이해를 했습니다. 1. 강의 3:32초 부분에서 이름이 동일한 지역변수에 대해 완전히 다른 메모리 공간이 생긴다고 하셨는데, JVM 메모리에 변수 저장 시 각 지역변수마다 늘 공간이 따로 생기는 건가요? 아니면 하나의 stack,heap 공간에 같이 사용 하는 건가요? 감사합니다. 수강자 올림.
자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]
안녕하세요. 우선 좋은 강의 만들어 주셔서 감사합니다. 13강을 수강하던 중 오류가 발생하여 질문드립니다. 검색해보니 테이블 명이 user로 생성을 하면 안되는 것 같아 user_table 이라는 명칭으로 테이블을 생성했습니다. CLI로 확인해본 결과 테이블 자체는 정상적으로 생성이 되었습니다. 그런데 컨트롤러와 yml 파일 설정 후 화면에서 데이터를 저장하려고 하니 오류가 발생합니다. spring: database: url: "jdbc:mysql://localhost/library" username: "root" password: "" drive-class-name: com.mysql.cj.jdbc.Driver package com.group.libraryapp.controller.User; import com.group.libraryapp.domain.user.User; import com.group.libraryapp.dto.User.request.UserCreateRequest; import com.group.libraryapp.dto.User.response.UserResponse; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; @RestController public class UserController { private final JdbcTemplate jdbcTemplate; public UserController(JdbcTemplate jdbcTemplate){ this.jdbcTemplate = jdbcTemplate; } private final List<User> users = new ArrayList<>(); @PostMapping("/user") public void saveUser(@RequestBody UserCreateRequest request){ String sql = "INSERT INTO user_table (name, age) VALUES (?,?)"; jdbcTemplate.update(sql, request.getName(), request.getAge()); } @GetMapping("/user") public List<UserResponse> getUsers() { String sql = "SELECT * FROM user_table"; //람다로 변경 알트+엔터 return jdbcTemplate.query(sql, (rs, rowNum) -> { long id = rs.getLong("id"); String name = rs.getString("name"); int age = rs.getInt("age"); return new UserResponse(id, name, age); }); } } INSERT INTO user_table (name, age) VALUES (?,?) [42104-214]] with root cause org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "USER_TABLE" not found (this database is empty); SQL statement: INSERT INTO user_table (name, age) VALUES (?,?) [42104-214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214] at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214] at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214] at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214] at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8385) ~[h2-2.1.214.jar:2.1.214] at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8369) ~[h2-2.1.214.jar:2.1.214] at org.h2.command.Parser.readTableOrView(Parser.java:8358) ~[h2-2.1.214.jar:2.1.214] at org.h2.command.Parser.readTableOrView(Parser.java:8328) ~[h2-2.1.214.jar:2.1.214] at org.h2.command.Parser.parseInsert(Parser.java:1632) ~[h2-2.1.214.jar:2.1.214] at org.h2.command.Parser.parsePrepared(Parser.java:814) ~[h2-2.1.214.jar:2.1.214] at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214] at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214] at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214] 위와 같이 데이터베이스가 비었다고 하고 테이블을 찾지 못하는데 제가 어느 부분을 확인해야 하는지 궁금해 질문드립니다.
다른 풀이 해주신거도 읽어봤습니다만. 포문에서 if문 한 덩이 안에 첫 조건식의 갯수가 2의배수 (1012)+3의배수 (674)-중복숫자(337) 1349가 앞의 항 참인 경우이고, 뒷항의 조건식은 !가 붙어서 5의배수 (404)+6의배수 (337)-중복숫자 30의 배수(67) 해서 뒷 항의 참인경우는 674 하지만 !가 붙어서 안의 항의 연상결과가 거짓인경우가 되어야 카운팅이 되기 때문에 2024-674 = 1350 ..? 이런식으로 푸는거 아닌가요??? 어렵네요 ......
■ 질문 남기실 때 꼭! 참고해주세요. - 먼저 유사한 질문이 있었는지 검색해주세요. - 궁금한 부분이 있으시면 해당 강의의 타임라인 부분을 표시해주시면 좋습니다. - HTML, CSS, JQUERY 코드 소스를 텍스트 형태로 첨부해주시고 스크린샷도 첨부해주세요. - 다운로드가 필요한 파일은 해당 강의의 마지막 섹션에 모두 있습니다. <!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>Flex 레이아웃 이미지 어코디언 네비게이션</title> <link rel="stylesheet" href="style.css"> </head> <body> <ul class="gallery"> <li> <div class="content"> <h2>Uploads made easy</h2> <p>Use Spotify for Artists to upload your releases. With previews and simple edits, you can control exactly how your music appears to divsteners. </p> <div class="sns"> <a href="#none"><i class="fa fa-facebook"></i></a> <a href="#none"><i class="fa fa-instagram"></i></a> <a href="#none"><i class="fa fa-linkedin"></i></a> <a href="#none"><i class="fa fa-google-plus"></i></a> </div> </div> </li> <li> <div class="content"> <h2>Uploads made easy</h2> <p>Use Spotify for Artists to upload your releases. With previews and simple edits, you can control exactly how your music appears to divsteners. </p> <div class="sns"> <a href="#none"><i class="fa fa-facebook"></i></a> <a href="#none"><i class="fa fa-instagram"></i></a> <a href="#none"><i class="fa fa-linkedin"></i></a> <a href="#none"><i class="fa fa-google-plus"></i></a> </div> </div> </li> <li> <div class="content"> <h2>Uploads made easy</h2> <p>Use Spotify for Artists to upload your releases. With previews and simple edits, you can control exactly how your music appears to divsteners. </p> <div class="sns"> <a href="#none"><i class="fa fa-facebook"></i></a> <a href="#none"><i class="fa fa-instagram"></i></a> <a href="#none"><i class="fa fa-linkedin"></i></a> <a href="#none"><i class="fa fa-google-plus"></i></a> </div> </div> </li> <li> <div class="content"> <h2>Uploads made easy</h2> <p>Use Spotify for Artists to upload your releases. With previews and simple edits, you can control exactly how your music appears to divsteners. </p> <div class="sns"> <a href="#none"><i class="fa fa-facebook"></i></a> <a href="#none"><i class="fa fa-instagram"></i></a> <a href="#none"><i class="fa fa-linkedin"></i></a> <a href="#none"><i class="fa fa-google-plus"></i></a> </div> </div> </li> <li> <div class="content"> <h2>Uploads made easy</h2> <p>Use Spotify for Artists to upload your releases. With previews and simple edits, you can control exactly how your music appears to divsteners. </p> <div class="sns"> <a href="#none"><i class="fa fa-facebook"></i></a> <a href="#none"><i class="fa fa-instagram"></i></a> <a href="#none"><i class="fa fa-linkedin"></i></a> <a href="#none"><i class="fa fa-google-plus"></i></a> </div> </div> </li> </ul> </body> </html> /* Google Web Font */ @import url('https://fonts.googleapis.com/css?family=Raleway&display=swap'); /* Fontawesome 4.7 */ @import url('https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'); body { font-family: 'Raleway', sans-serif; line-height: 1.5em; margin: 0; } a { text-decoration: none; color:#fff; } .gallery{ list-style: none; margin:0; padding:0; height: 100vh; display: flex; } .gallery li{ flex:1; background:center no-repeat; border-right:3px solid #000; position:relative; overflow: hidden; transition:0.5s; } .gallery li:last-child{ border-right:none; } .gallery li:nth-of-type(1){background-image: url(images/artistic-image-01.jpg);} .gallery li:nth-of-type(2){background-image: url(images/artistic-image-02.jpg);} .gallery li:nth-of-type(3){background-image: url(images/artistic-image-03.jpg);} .gallery li:nth-of-type(4){background-image: url(images/artistic-image-04.jpg);} .gallery li:nth-of-type(5){background-image: url(images/artistic-image-05.jpg);} .gallery li .content{ position:absolute; width: 100%; background-color:#000; height: 250px; left:0; bottom:-300px; color:#fff; text-align: center; padding:20px; padding-top: 40px; box-sizing: border-box; transition:0.5s; } .gallery li .content:before{ content:''; position:absolute; width: 100%; height: 50px; top:0; left:0; background-color:#000; transform: rotate(-3deg) scale(1.3); transform-origin: left bottom; } .gallery li:hover{ flex:3; filter: grayscale(1); } .gallery li:hover .content{ bottom:0; transition-delay: 0.5s; } transition-delay:0.5s를 .gallery li .content와 .gallery li:hover .content 중 어느쪽에 주느냐에 따라 차이가 있는데 왜 그런걸까요...ㅠㅠ .gallery li .content에 주면 li에 마우스가 벗어날때 .content박스가 사라지는것까지 보여버리는데 (.gallery li:hover .content에 주면 문제없이 잘 작동됩니다.) .gallery li .content와 .gallery li:hover .content에 각각 transition-delay를 주는게 어떤 차이때문에 다르게 보이는지 알고싶습니다.
안녕하세요, 강의 잘 보고 있습니다. React Native 프로젝트를 진행할 때 Bun을 사용하여 패키지 매니징을 했을 때 굉장히 개발 경험이 쾌적했던 기억이 있습니다. 그리고 비교적 최근 ESLint와 Prettier의 단점을 상쇄해줄 Biome라는 솔루션이 나와서 도입해보려고 하던 상태였습니다. 선생님은 Bun, Biome에 대해 어떻게 생각하시는지 궁금합니다!
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요. 1. 강의 내용과 관련된 질문을 남겨주세요. 2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요. (자주 하는 질문 링크: https://bit.ly/3fX6ygx) 3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요. (질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG) 질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요. ========================================= [질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 예 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 예 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 예 [질문 내용] 여기에 질문 내용을 남겨주세요. 클래스 레벨 접근 제어자에 protected가 사용할수 없는 이유가 궁금합니다
컬렉션 프레임워크 - Set 강의 중 UML 클래스 다이어그램에 관해 궁금증이 생겼습니다. HashSet , TreeSet , LinkedHashSet 즉 Set의 주요 구현체들을 설명하셨을때, 여기서 점선으로 된것과 실선으로 된것의 차이점은 무엇일까요?? 인터페이스인 Set의구현체로 HashSet , TreeSet 등이 있다는 것은 이해가 가지만, LinkedHashSet은 왜 실선으로 표시하는 걸까요?? 이 두개의 차이점에 대해 정확히 알고싶습니다!
먼저 강의 잘 듣고 있습니다. 강의 자료 202쪽에 보면 아래 그림과 같이 ReentrantLock.lockInterruptibly() 예제 코드가 작성되어 있는데요. 이 코드를 강의 소스코드 (LockInterruptiblyExample.java) 에 적용해 보았습니다. 적용한 코드는 아래와 같습니다. public class LockInterruptiblyExample { public static void main(String[] args) { Lock lock = new ReentrantLock(); Thread thread1 = new Thread(() -> { try { lock.lockInterruptibly(); // 락을 시도하며, 인터럽트가 들어오면 중단 System.out.println("스레드 1이 락을 획득했습니다"); } catch (InterruptedException e) { System.out.println("스레드 1이 인터럽트를 받았습니다"); } finally { lock.unlock(); System.out.println("스레드 1이 락을 해제했습니다"); } }); Thread thread2 = new Thread(() -> { try { lock.lockInterruptibly(); // 락을 시도하며, 인터럽트가 들어오면 중단 try { System.out.println("스레드 2가 락을 획득했습니다"); } finally { lock.unlock(); System.out.println("스레드 2가 락을 해제했습니다"); } } catch (InterruptedException e) { System.out.println("스레드 2가 인터럽트를 받았습니다"); } }); thread1.start(); thread2.start(); thread1.interrupt(); // thread2.interrupt(); try { Thread.sleep(500); thread1.join(); thread2.join(); } catch (InterruptedException e) { e.printStackTrace(); } } } 이 코드를 실행했을 때, 아래 이미지와 같이 IllegalMonitorStateException 이 발생했는데요. 아마 try ~ catch ~ finally 블록에 의한 문제가 아닐까 싶습니다. 이 부분이 어떻게 동작하여 오류가 발생한 건지 궁금한데, 답변 해주시면 감사하겠습니다.
public class Number4 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int count = scanner.nextInt(); List<String> array = new ArrayList<>(); for (int i = 0; i <= count; i++) { array.add(scanner.nextLine()); } for (String str : array) { Deque<Character> stack = new ArrayDeque<>(); for ( char c : str.toCharArray()){ stack.push(c); } while (!stack.isEmpty()){ System.out.print(stack.pop()); } System.out.println(); } } } 위 풀이방법처럼 풀었는데 이게 컴파일 에러가 나는데 혹시 이 풀이방법이 문제점을 가지고 있을까요?
안녕하세요. Set<Map.Entry<String, Integer>> 이게 좀 궁금해서 살펴보니 Set<E> 제네릭으로 받게끔 되어 있고 그럼 여기서 Map.Entry<String, Integer> 이게 하나의 타입처럼 사용이 된다는 건데 Map 클래스에서 Entry는 interface로 되어 있어서요. Map.Entry라고 썼다는거는 Entry도 인터페이스(클래스)니까 중첩 static class 처럼 쓰였다는건데 static도 안 붙어 있고 관련된 구현체도 Map 클래스 내부에는 없는 거 같아서요. 추가 설명 부탁드립니다.