묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨토비의 스프링 부트 - 이해와 원리
DataSourceConfig에서 @EnableTransactionManagement를 사용하면 DataSourceTest가 안 되는것에 대한 질문이 있습니다.
안녕하세요 토비님. 강의 정말 잘 듣고있습니다! JdbcTemplate과 트랜잭션 매니저 구성 강의를 듣다가 @EnableTransactionManagement으로 트랜잭션(tx) 관리 기능을 열어주고 기존 DataSourceTest.java 예제를 실행하니 java.lang.IllegalStateException: Failed to unwrap proxied object 에러가 계속 발생합니다.DataSourceConfig.java에서 @EnableTransactionManagement 애노테이션을 제외를 하면 DataSourceTest.java 테스트가 정상적으로 잘 돌아가더라고요...음 java와 spring 버전, 라이브러리는 모두 동일하게 설정을 했습니다. 제 소스 코드는 하단에 있습니다! 버전 문제로 해당 예제가 안 돌아가는 것인지? 왜 안 되는지 궁금합니다.. 바쁘실텐데 이유나 원인을 아시면 알려주시면 감사하겠습니다. 에러코드java.lang.IllegalStateException: Failed to unwrap proxied object at org.springframework.test.util.AopTestUtils.getUltimateTargetObject(AopTestUtils.java:105) at org.springframework.boot.test.mock.mockito.SpringBootMockResolver.resolve(SpringBootMockResolver.java:35) at org.mockito.internal.util.MockUtil.resolve(MockUtil.java:118) at org.mockito.internal.util.MockUtil.isMock(MockUtil.java:108) at org.mockito.internal.util.DefaultMockingDetails.isMock(DefaultMockingDetails.java:32) at org.springframework.boot.test.mock.mockito.MockReset.get(MockReset.java:106) at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.resetMocks(ResetMocksTestExecutionListener.java:82) at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.resetMocks(ResetMocksTestExecutionListener.java:70) at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.beforeTestMethod(ResetMocksTestExecutionListener.java:57) at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:293) build.gradleplugins { id 'java' id 'org.springframework.boot' version '2.7.6' id 'io.spring.dependency-management' version '1.0.15.RELEASE' } group = 'tobyspring' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '11' } repositories { mavenCentral() maven { url 'https://repo.clojars.org' name 'Clojars' } } dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework:spring-jdbc' implementation 'hikari-cp:hikari-cp:3.0.1' runtimeOnly('com.h2database:h2:2.1.214') // spring-boot-starter-undertow // implementation 'org.springframework.boot:spring-boot-starter-jetty' testImplementation 'org.springframework.boot:spring-boot-starter-test' } tasks.named('test') { useJUnitPlatform() } DataSourceTest package tobyspring.helloboot; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; @HellobootTest public class DataSourceTest { @Autowired DataSource dataSource; @Test public void connect() throws SQLException { Connection connection = dataSource.getConnection(); connection.close(); } } HelloBootTestpackage tobyspring.helloboot; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.transaction.annotation.Transactional; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = HellobootApplication.class) @TestPropertySource("classpath:/application.properties") @Transactional public @interface HellobootTest { } DataSourceConfig.javapackage tobyspring.config.autoconfig.datasource; import com.zaxxer.hikari.HikariDataSource; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate; import org.springframework.context.annotation.Bean; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.SimpleDriverDataSource; import org.springframework.jdbc.support.JdbcTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement; import tobyspring.config.ConditionalMyOnClass; import tobyspring.config.MyAutoConfiguration; import tobyspring.config.autoconfig.EnableMyConfigurationProperties; import javax.sql.DataSource; import java.sql.Driver; @MyAutoConfiguration @ConditionalMyOnClass("org.springframework.jdbc.core.JdbcOperations") @EnableMyConfigurationProperties(MyDataSourceProperties.class) @EnableTransactionManagement public class DataSourceConfig { @Bean @ConditionalMyOnClass("com.zaxxer.hikari.HikariDataSource") @ConditionalOnMissingBean DataSource hikariDataSource(MyDataSourceProperties properties) { HikariDataSource dataSource = new HikariDataSource(); dataSource.setDriverClassName(properties.getDriverClassName()); dataSource.setJdbcUrl(properties.getUrl()); dataSource.setUsername(properties.getUsername()); dataSource.setPassword(properties.getPassword()); return dataSource; } @Bean @ConditionalOnMissingBean DataSource dataSource(MyDataSourceProperties properties) throws ClassNotFoundException { SimpleDriverDataSource dataSource = new SimpleDriverDataSource(); dataSource.setDriverClass((Class<? extends Driver>) Class.forName(properties.getDriverClassName())); dataSource.setUrl(properties.getUrl()); dataSource.setUsername(properties.getUsername()); dataSource.setPassword(properties.getPassword()); return dataSource; } @Bean @ConditionalOnSingleCandidate(DataSource.class) @ConditionalOnMissingBean JdbcTemplate jdbcTemplate(DataSource dataSource) { return new JdbcTemplate(dataSource); } @Bean @ConditionalOnSingleCandidate(DataSource.class) @ConditionalOnMissingBean JdbcTransactionManager jdbcTransactionManager(DataSource dataSource) { return new JdbcTransactionManager(dataSource); } }
-
해결됨독하게 되새기는 C 프로그래밍
접근권한과 위변조
실제 위변조 해킹을 할 때 여러방법이 있겠지만, 초기에 접근 권한을 얻어서 위변조를 하는 방식도 있었을까요? Win OS상에서 Hxd 프로그램을 실행하고Linux에서 작성한 bin파일을 가져와서 위변조라는 것을 하려고 하는데 수정이 불가능 했습니다.이에 따른 3가지 가설로linux상에서 bin file에 접근 권한을 chmod를 통해 주지 않았기 때문에 수정이 불가능프로그램을 저장할 때 file을 저장 시킨 system 단은 linux OS이고, binary file을 실행한 HxD프로그램이 win Os라서 불가능 읽기 전용 파일이라서? 2번은 file이 하드디스크에 물리적으로 저장해서 부르는 데는 문제가 없을 것이라 생각했습니다.3번은 HxD가 -rw-r--r-- 1 root root 256 Nov 12 16:34 rdata.bin에서 읽기 전용 파일이기 때문이라고 생각했는데, HxD는 에디터에서 건들 수 없는 것이 말이 되나 싶었습니다..1번이 문제인 줄 알고 sudo chmod 777 bin파일이름을 통해 권한을 부여하니 위변조가 가능했음을 알게 되었습니다.그렇다면 여기서 궁금한 점은 1번에 접근 권한을 허락만 하면 (다른 컴퓨터에 원격으로 제어를 하고 root사용자의 비밀번호를 얻어서) 해킹이 되지 않을까라는 생각이 들어서 질문을 드렸습니다. 너무 궁금해서 수업과는 약간 결이 다른 질문인 점은 죄송합니다..
-
미해결Slack 클론 코딩[백엔드 with NestJS + TypeORM]
유저 컨트롤러 코드 질문
깃허브 코드를 보면 @ApiOperation({ summary: '회원가입' }) @UseGuards(NotLoggedInGuard) @Post() async join(@Body() data: JoinRequestDto) { const user = this.usersService.findByEmail(data.email); if (!user) { throw new NotFoundException(); } const result = await this.usersService.join( data.email, data.nickname, data.password, ); if (result) { return 'ok'; } else { throw new ForbiddenException(); } } 이런데 여기서 user가 없는데 왜 NotFoundException()을 날리는 건가요? user가 없으면 그대로 join하여 사용자 등록을 해야 하는 것이 아닌가요?
-
해결됨모든 개발자를 위한 HTTP 웹 기본 지식
HTML FORM에서의 컨트롤 URI
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예)[질문 내용]HTML FORM을 사용할 때 회원 삭제의 경우, DELETE 메서드를 사용할 수 없으므로/members/{id}/delete -> POST 이렇게 컨트롤 URI를 어쩔 수 없이 사용한다고 강의에서 말씀하셨는데만약 /members/{id} -> POST로 지정된 무언가가 정해지지 않은 상황이라면,/members/{id} -> POST로 회원 삭제를 구현하는 게 가능한가요?권장되지 않는 방법인 건 알겠는데 구현이 아예 안 되는 건지, 구현은 가능한지 궁금합니다.
-
해결됨Slack 클론 코딩[백엔드 with NestJS + TypeORM]
package.json / "scripts" / schema:drop, schma:sync에 `-d ./dataSource.ts` 옵션을 넣지 않으신 이유가 있으신가요?
테이블 삭제도 시도해보고 싶어서 터미널에$ npm run schema:drop 을 입력하였더니 아래와 같은 내용이 나왔습니다.Drops all tables in the database on your default dataSource. To drop table of a concrete connection's database use -c option. 옵션: -h, --help 도움말 표시 [불리언] -d, --dataSource Path to the file where your DataSource instance is defined. [필수] -v, --version 버전 표시 [불리언] 필수 인수가 주어지지 않았습니다: dataSource dataSource가 주어지지 않았다고 해서 살펴보다package.json/scripts/schema에 다른 명령어들과는 다르게 경로가 지정되어 있지 않는것 같아아래와 같이 수정했고, { "scripts": { "seed": "ts-node ./node_modules/typeorm-extension/bin/cli.cjs seed:run -d ./dataSource.ts", "schema:drop": "ts-node ./node_modules/typeorm/cli.js schema:drop -d ./dataSource.ts", "schema:sync": "ts-node ./node_modules/typeorm/cli.js schema:sync", } } 테이블 삭제에 성공했습니다.$ npm run schema:drop > a-nest@0.0.1 schema:drop > ts-node ./node_modules/typeorm/cli.js schema:drop -d ./dataSource.ts query: SELECT VERSION() AS `version` query: SELECT * FROM `INFORMATION_SCHEMA`.`SCHEMATA` WHERE `SCHEMA_NAME` = '00_nestjs_typeorm' query: START TRANSACTION query: SELECT concat('DROP VIEW IF EXISTS `', table_schema, '`.`', table_name, '`') AS `query` FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_SCHEMA` = '00_nestjs_typeorm' query: SELECT concat('DROP TABLE IF EXISTS `', table_schema, '`.`', table_name, '`') AS `query` FROM ` `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA` = '00_nestjs_typeorm' INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA` = '00_nestjs_typeorm' query: DROP TABLE IF EXISTS `00_nestjs_typeorm`.`channelchats` query: DROP TABLE IF EXISTS `00_nestjs_typeorm`.`channelmembers` query: DROP TABLE IF EXISTS `00_nestjs_typeorm`.`channels` query: DROP TABLE IF EXISTS `00_nestjs_typeorm`.`dms` query: DROP TABLE IF EXISTS `00_nestjs_typeorm`.`mentions` query: DROP TABLE IF EXISTS `00_nestjs_typeorm`.`migrations` query: DROP TABLE IF EXISTS `00_nestjs_typeorm`.`users` query: DROP TABLE IF EXISTS `00_nestjs_typeorm`.`workspacemembers` query: DROP TABLE IF EXISTS `00_nestjs_typeorm`.`workspaces` query: SET FOREIGN_KEY_CHECKS = 1; query: COMMIT Database schema has been successfully dropped. 혹시 schema:drop, schema:sync 명령어에 경로를 지정하지 않으신 이유가 있으신지,경로를 빼놓은 상태로 유지하다가, 정말 필요할 때에만 경로 지정하고 명령어를 사용하는게 좋은지가 궁금합니다. 실수로 입력해서 데이터 손실이 발생하는 것을 막기 위해서일까요?
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
refresh 토큰이 만료됐는데 만료된 refresh 토큰으로 새로운 refresh 토큰을 발급받는 것인가요..?
access token이 만료되었을 떄 refresh 토큰을 통해 access token을 새로 발급 받는 것은 이해가 되는데.. refresh 토큰이 만료되어서 새로운 refresh 토큰을 발급받기 위한 시점에서 만료된 refresh 토큰을 사용할 수 있는 것인가요..? 조금 헷갈리내요..
-
미해결[리뉴얼] 타입스크립트 올인원 : Part2. 실전 분석편
axios 1.6.0 버전으로 보고 있는데영
axios 1.6.0에서는export function isAxiosError<T = any, D = any>(payload: any): payload is AxiosError<T, D>;제네릭 넣는공간이 생겼네용!!다른분들도 참고 하시라고 남깁니다!
-
미해결부트캠프에서 알려주지 않는 것들 (리액트 렌더링 최적화 편) 2편
쓰레드 관련
안녕하세요. 강의 잘 듣고 있습니다.node에서 user가 실행하는 일반적인 코드는 single thread라 async로 분리해서 실행하면 조금 늦게 끝나야 하는데 너무 차이가 나서 제가 잘못이해하고 있었나?하고 순간 당황했네요.Array 생성하실때 파라메터가 길이이고 fill함수의 파라메터가 값인듯 합니다.확인 부탁드립니다.감사합니다.
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
이원분산분석
이원분산분석 진행시 데이터가 정규성을 만족하지 않으면 분석이 불가능 한가요?
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
코드 질문
package basic.practice.servletV1.response; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Collection; import java.util.Enumeration; /** * response header 조회하기 */ @WebServlet(name = "responseHeaderServlet", urlPatterns = "/response-header") public class ResponseHeaderServlet extends HttpServlet { @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("ResponseHeaderServlet.service"); response.setContentType("text/plain"); System.out.println(response.getHeader("Content-Type")); } }두번째 출력값이 널이 나오는 이유가 뭔가요??
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
작업형2 질문 드립니다.
안녕하세요, 수강생입니다. 선생님 노트북 작업형2 문제 중 type2-ex의 백화점 구매 데이터를 활용한 문제와 type2-2nd의 2회 기출 문제 풀이를 보다가 궁금한 점이 생겨서 이렇게 문의글 남깁니다. 두 문제 모두 X_train, X_test, y_train 이렇게 3개의 데이터셋이 주어졌는데 전체 풀이에서는 검증데이터 분리하는 train_test_split에서만 각각의 X_train, y_train['target'] 값만 활용해서 풀이한 것으로 이해했습니다. 하지만 type2-2nd 2회 기출에서는 중간 풀이 과정에 X_train, y_train을 concat으로 합쳐서 중간에 설명을 하셨더라구요~ 물론 풀이에서는 concat으로 합친 데이터를 활용해서 작업된 것 같지는 않은데 혹시 train 데이터 합치는 과정이 반드시 필요한가요? 작업형2 기출 문제들을 학습하면서 데이터셋이 train과 test로 주어질 때와 X_train, X_test, y_train 이렇게 3개가 주어질 때 검증 데이터 분리하는 train_test_split에서만 구분해서 풀이하면 될 것 같은데요. 제가 혹시나 놓치고 있는 부분이 없는지 조언해주시면 감사하겠습니다!!!!
-
미해결내 가치를 높이는 노션 이력서 만들기
프로젝트관련 작성 질문!
안녕하세요! 노션 이력서 페이지를 만들고있는중에 궁금한 점이 있어서 질문드립니다. 데이터 관련 대외활동에서 데이콘주최 프로젝트에서 수상한적이 있는데 그때 프로젝트를 작성해도 될까요.. 고민되는 부분이 데이터를 제가 수집하것도 아니고 그냥 데이콘에서 제공받은 데이터를 가지고 팀이랑 데이터 분석하고 모델만들어서 정확도를 높이는 대회였어서 이점 궁금합니다. 그리고 수상하지 못한 데이콘에서 참여한 대회도 작성해도 되는지 궁금합니다.노션 공유버튼에 검색 엔진 인덱싱이라고 있던데 저는 우피로 만들어서 따로 구매해 설정한 도메인으로 연결해서 웹에 게시했습니다. 검색엔진인덱싱은 유료던데 설정안해도 검색엔진에 제 웹페이지가 노출 되는 걸까요.
-
해결됨한 입 크기로 잘라먹는 타입스크립트(TypeScript)
tsc 명령어를 실행하면 cannot find module undici-type 이라는 오류가 뜹니다.
tsc 명령어를 입력하면 아래와 같은 오류가 발생하는데 js 파일은 정상적으로 만들어집니다.어떤게 이상한걸까요? undici-types 라는 모듈은 설치한적도 없고 사용한적도 없는데 왜 이런 오류가 뜨는지 모르겠습니다...PS C:\typescript\typescript_section2> tsc node_modules/@types/node/globals.d.ts:325:84 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 325 type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:326:85 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 326 type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:327:85 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 327 type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:328:84 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 328 type _Headers = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Headers; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:330:22 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 330 : import("undici-types").RequestInit; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:336:35 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 336 type RequestInfo = import("undici-types").RequestInfo; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:337:35 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 337 type HeadersInit = import("undici-types").HeadersInit; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:338:32 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 338 type BodyInit = import("undici-types").BodyInit; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:339:39 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 339 type RequestRedirect = import("undici-types").RequestRedirect; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:340:42 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 340 type RequestCredentials = import("undici-types").RequestCredentials; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:341:35 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 341 type RequestMode = import("undici-types").RequestMode; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:342:38 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 342 type ReferrerPolicy = import("undici-types").ReferrerPolicy; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:343:34 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 343 type Dispatcher = import("undici-types").Dispatcher; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:344:37 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 344 type RequestDuplex = import("undici-types").RequestDuplex; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:360:21 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 360 : typeof import("undici-types").Request; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:367:21 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 367 : typeof import("undici-types").Response; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:374:21 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 374 : typeof import("undici-types").FormData; ~~~~~~~~~~~~~~ node_modules/@types/node/globals.d.ts:381:21 - error TS2792: Cannot find module 'undici-types'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option? 381 : typeof import("undici-types").Headers; ~~~~~~~~~~~~~~ Found 18 errors in the same file, starting at: node_modules/@types/node/globals.d.ts:325
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
작업형1 모의문제1 관련 질문입니다.
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요먼저 유사한 질문이 있었는지 검색해보세요 작업형1 모의문제1 강의에서 문제2번 중 '해당 컬럼에 결측치가 있는 데이터(행)를 삭제 함' 문장에 대해 질문입니다. df = df.dropna(subset=['f1'])이 답인데,왜 df[‘f1’] = df[‘f1’].dropna() 는 불가능한지 궁금합니다. ㅠㅠㅠㅠ
-
미해결쉽고 빠르게 끝내는 GO언어 프로그래밍 핵심 기초 입문 과정
package관리에 질문이 있습니다.
golang package 버전 관리 및 local package 관리 관련되서 질문이 있습니다.go mod 정확하게 사용법을 잘 모르겠 더 라구요go work를 설정하면 go path를 건들지 않고 locoal package 관리를 쉽게 할 수 있다고 하는데 관련된 내용 예제 같은 것 추천해주실 수 있을까요?
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
이진분류 target값에 문자
선생님 혹시 이진분류는 타겟값이 숫자일수도 있고 문자일수도 있는 건데 만약 문자일 경우는 학습을 시키기 전에 반드시 숫자로 인코딩이나 replace변경을 하지 않고 실행해도 되는지 궁금합니다!!
-
미해결파이썬 Streamlit 활용한 웹 자동화 업무, 데이터 검색 및 시각화
강의 자료 링크(노션) 자료
안녕하세요, 강사님보안 프로젝트들을 유용하게 잘 듣고 있는 수강생입니다.항상 좋은 자료 강의 컨텐츠 올려 주셔서 감사드립니다.다름이 아니라 강의 자료 받고 싶어서강의 자료 링크(노션) 클릭을 했는데, '페이지를 찾을 수 없음' 뜨면서 강의 다운로드를 못 받고 있습니다.어떻게 하면 다운로드 받을 수 있는지요?바쁘시겠지만 확인 부탁드립니다!감사합니다.
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - NestJS Core
[토큰 재발급 로직 코딩하기] 토큰 재발급 후 sub 정보 사라짐
signToken(user: Pick<UsersModel, 'email' | 'id'>, isRefreshToken: boolean) { const payload = { email: user.email, sub: user.id, type: isRefreshToken ? 'refresh' : 'access', }; return this.jwtService.sign(payload, { secret: JWT_SECRET, // seconds expiresIn: isRefreshToken ? 3600 : 300, }); } async rotateToken(token: string, isRefreshToken: boolean) { const decoded = this.jwtService.verify(token, { secret: JWT_SECRET, }); if(decoded.type !== 'refresh'){ throw new UnauthorizedException('토큰 재발급은 Refresh 토큰으로만 가능합니다!'); } return this.signToken({ ...decoded, }, isRefreshToken); }토큰 생성 시 payload에서 sub에 user.id를 할당하고 있는데 재발급시 decoded 객체를 그대로 할당하면 sub 정보가 사라지지 않나요?
-
미해결모두를 위한 대규모 언어 모델 LLM(Large Language Model) Part 1 - Llama 2 Fine-Tuning 해보기
문제에 봉착했습니다!!도움 부탁드립니다.
openai.FineTuningJob.create(training_file="file-G8e3McuXFWVZnm1XSNB-----", model="gpt-3.5-turbo")위의 코드에 대해서 아래와 같이 메세지가 나오면서 실행이 안됩니다 ㅠㅜ { "name": "AttributeError", "message": "module 'openai' has no attribute 'FineTuningJob'", "stack": "--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /Users/loveyourself/dev/LLM/chatBot/worKBee/worKBee.ipynb 셀 3 line 1 ----> <a href='vscode-notebook-cell:/Users/loveyourself/dev/LLM/chatBot/worKBee/worKBee.ipynb#W3sZmlsZQ%3D%3D?line=0'>1</a> openai.FineTuningJob.create(training_file=\"file-G8e3McuXFWVZnm1XSNBtMrmA\", model=\"gpt-3.5-turbo\") AttributeError: module 'openai' has no attribute 'FineTuningJob'" } FineTuningJob 이 없다고 하는데 어떻게 해야하나요..
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
setter 을 사용하지 않는다면 어떻게 해야 할까요?
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예강의에서는 setter를 사용하지 않고 하는게 바람직하다고 언급하신적이 있습니다. public static OrderItem createOrderItem(Item item,int orderPrice,int count){ OrderItem orderItem=new OrderItem(); orderItem.setItem(item); orderItem.setOrderPrice(orderPrice); orderItem.setCount(count); item.removeStock(count); return orderItem; }이것은 영한님 강의의 OrderItem이라는 중간테이블을 생성해주는 것이였습니다. 위에서 set,set,set 이 많이 나오는데 이게 아마 builer패턴? 으로 위 코드에서 setter를 지워주는것 맞져?? 그러면 Order의 연관관계 편의 메서드인 아래 코드는 또 어떻게 바꿔야 할까 public void addOrderItem(OrderItem orderItem){ orderItem.setOrder(this); this.orderItems.add(orderItem); }이거는 또 어떻게 바꿔야 할까요?? 실무에서는 이런 것까지도 set을 안쓰나요? 아니면 뭐set 대신 이름만 inItOrder로 바꿔야 하는 것인가요? 질문 2) 솔직히 set을 왜 안써야 하는지 감이 안옵니다. 다른 개발자가 무작정 set을 호출할수 있다는게 단점이라고 하신 것 같은데 그러면 뭐 cancelOrder 이런 메서드로 바꾸면 다른 개발자가 이걸 호출할수도 있지 않나요?? 질문 3) 가끔 보면 이런 코드가 있습니다. public void initPost(Post post) { if(this.post == null) this.post = post; }이것은 init 이기때문에 단순히 null 인지 체크해주는 것인가요??가끔 이렇게 매개변수들어온게 null 인지 체크하는 로직이 들어있는게 있더라고요!