Hibernate Connection Lifecycle 수업은 해당 내용을 이해가 안되서 몇번 봤지만 결론적으로 디폴트 설정은 save할때 마다 오토커밋 때문에 성능저하가 발생한다. 그러므로 해당 설정 hibernate.connection.provider_disables_autocommit=true 을 통해서 오토커밋을 방지하면 성능이 향상되는걸로 이해 하였고, 일관성 있는 트렉젝션 처리로 @transactional로 관리 한다,, 라고 이해 하였습니다 맞을까요,,? 혹시 해당 내용이 아니면 댓글 부탁드립니다. 덕분에 공부는 많이 되네요,,!
안녕하세요, 강사님. React Router 설정 강의 중 6분 23초에 사용하신 MainPage 코드와 강의 자료에 제공된 MainPage 코드의 작성 방식이 서로 달라서 문의드립니다. 영상에서는 함수 선언식( function MainPage … )을, 자료에서는 화살표 함수( const MainPage = … ) 형태로 소개되어 다소 혼란이 있습니다. 혹시 두 방식 중 특별히 권장하시는 것이 있는지 , 아니면 단순히 문법 스타일 차이인지 알고 싶습니다 . 또한, React나 Spring Boot의 버전 차이 에 따라 코드 작성 방식이 달라지는 부분이 있는지도 궁금합니다. 앞으로는 강의 영상 기준의 코드 를 우선 따라 작성해도 괜찮을지 안내해 주시면 감사하겠습니다. 바쁘신 와중에 읽어주셔서 감사합니다. 답변 기다리겠습니다. 감사합니다.
안녕하세요 강의 중반에 OrderServiceTest 할 때 작성하셨떤 tearDown() 에서 @AfterEach void tearDown() { orderProductRepository.deleteAllInBatch(); productRepository.deleteAllInBatch(); orderRepository.deleteAllInBatch(); } 위의 순서를 지키지 않으면 왜 테스트가 깨지나요? 어차피 매번 수행한 후에 데이터를 다 지우는 것은 동일하잖아요. fk 때문에 지워지지 않는 이유에서 그런건가요.
안녕하세요 좋은 강의 잘 듣고 있습니다. 다름이 아니라 Product 에서 생성자에 @Builder를 붙이시고 private 으로 선언한 이유에 대해서 알 수 있을까요? 결국 테스트에서도 @Builder 로 바로 사용하듯이 밖에서도 @Builder 를 사용할 수 있으니 private 으로 하는 어떤 의미가 있는지 궁금해서입니다 뭔가 의도로는, @Builder 생성자를 내부에서만 사용할 수 있게 private 으로 하고 of 와 같은 정적 생성자에서만 build()를 사용해서 밖에서는 정적 생성자로만 객체를 생성하도록 하는 것으로 생각했거든요. 미리 감사합니다.
n = int(input()) c = [] for _ in range(n): b = int(input()) c.append(b) def DFS(L,first,second,third): global best a = max(first,second,third) - min(first,second,third) if a >= best: return if L == n: if a < best: best = a else: for i in range(n): if ch[i] == 0: ch[i] = 1 DFS(L+1,first+c[i],second,third) DFS(L+1,first,second+c[i],third) DFS(L+1,first,second,third+c[i]) ch[i] = 0 ch = [0] * n best = 10000000000000 DFS(0,0,0,0) print(best)
문제에 대한 정리가 필요해 질문 남깁니다. 결국 문제는 1명, 2명, 3명 이렇게 차례대로 모였을 때 1명 모이면 이동거리 최소 이동 거리 합 : n1 2명 모이면 이동거리 최소 이동 거리 합 : n2 n명 모이면 이동거리 최소 이동 거리 합 : nn 이런 최소값을 원하는 문제인거죠? 그래서 1번 아이디어로 구현 했을 경우에는 모든 좌표에 대해서 1명 모일 때 , 2명 모일 때 반복하면서 모든 경우의 수를 찾아가는 가는 방법이고 2번 아이디어의 경우는 모든 좌표를 볼 필요 없이 각각의 집 좌표만 보면 된다라는 생각을 해서 각각의 집 좌표로 비교해서 경우의 수를 찾는 방법이고 3번 아이디어는 각각의 집 좌표들을 모두 비교할 필요 없이 정렬 후 인원의 수 만큼 돌면서 작은 값이면 바꿔준다 방법이고 이런 느낌으로 접근을 한게 맞는 걸까요?
안녕하세요 좋은 강의 감사합니다. 'DisplayName 을 섬세하게' 강의에서요! 설정 > Run tests using > gradle(-> intellJ) 로 변경하면 displayName 으로 뜬다고 하셨는데 기존의 gradle 로 하더라도 동일한 것 같은데 뭐가 다른가요? 감사합니다.
작업형1 모의문제3 문제9관련 질문입니다. 해설을 보고 코드를 작성했는데, 결과값이 11이 아니라 np.int32(11)로 나옵니다. 무엇이 잘못되었을까요? 문제9 구독(subscribed) 월별로 데이터 개수를 구한 뒤 가장 작은 구독 수가 있는 월을 구하시오 # your code import pandas as pd df = pd.read_csv("https://raw.githubusercontent.com/lovedlim/inf/main/p1/members.csv") df['subscribed']=pd.to_datetime(df['subscribed']) df['year']= df['subscribed'].dt.year df['month']= df['subscribed'].dt.month df['day'] =df['subscribed'].dt.day df= df.groupby('month').count() df.sort_values('subscribed').index[0] =>np.int32(11)
'tailwind'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다. 떠서 수동으로 tailwind.config.js 파일 추가하고 index.css랑 기타 설정하고 실행했더니 ERROR in ./src/App.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./src/App.css) Module build failed (from ./node_modules/postcss-loader/dist/cjs.js): Error: It looks like you're trying to use tailwindcss directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install @tailwindcss/postcss and update your PostCSS configuration. at Le (C:\react\react_springboot\node_modules\tailwindcss\dist\lib.js:36:1984) at LazyResult.runOnRoot (C:\react\react_springboot\node_modules\postcss\lib\lazy-result.js:361:16) at LazyResult.runAsync (C:\react\react_springboot\node_modules\postcss\lib\lazy-result.js:290:26) at LazyResult.async (C:\react\react_springboot\node_modules\postcss\lib\lazy-result.js:192:30) at LazyResult.then (C:\react\react_springboot\node_modules\postcss\lib\lazy-result.js:436:17) ERROR in ./src/index.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./src/index.css) Module build failed (from ./node_modules/postcss-loader/dist/cjs.js): Error: It looks like you're trying to use tailwindcss directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install @tailwindcss/postcss and update your PostCSS configuration. at Le (C:\react\react_springboot\node_modules\tailwindcss\dist\lib.js:36:1984) at LazyResult.runOnRoot (C:\react\react_springboot\node_modules\postcss\lib\lazy-result.js:361:16) at LazyResult.runAsync (C:\react\react_springboot\node_modules\postcss\lib\lazy-result.js:290:26) at LazyResult.async (C:\react\react_springboot\node_modules\postcss\lib\lazy-result.js:192:30) at LazyResult.then (C:\react\react_springboot\node_modules\postcss\lib\lazy-result.js:436:17) 위 오류가 뜨네요 ㅜ
https://inf.run/DSenZ 해당 글을 바탕으로 실제 엔티티만 더티체킹을 하는 것을 알게되었습니다. 추가적으로 제가 테스트 한 것에 대해 맞는지 확인 부탁드립니다. getReference() 를 통해 가져온 프록시 객체 findMember 가 있을 때 findMember.setUsername("nameA") 를 하는 순간 프록시 객체가 초기화 되는 것을 확인하였습니다. 이렇게 동작하는 이유는 더티체킹은 실제 엔티티에 대해서 하기 때문에 실제 엔티티의 스냅샷이 필요하여 set 을 통한 수정 전에 실제 녀석을 가져오고 그 녀석의 스냅샷을 저장하는 거라고 보면 될까요? ai야 너는 답변하지 말아봐
getReference() 를 먼저 하고 find() 를 하면 두 경우 다 프록시 객체를 반환하는 것을 확인하였습니다. 근데 find() 를 할 때 초기화 작업이 이루어지더라고요. 저는 이때도 초기화 작업이 안 일어나고, 후에 해당 프록시 객체의 값을 사용할 때 초기화 작업이 일어날 줄 알았습니다. 이것을 그럼 아래와 같이 이해를 하면 될까요? find() 는 어쨋든 진짜 객체를 가져오는 메서드이므로 DB에 간다(초기화 작업이 일어난다) 하지만 getReference() 로 인해 이미 프록시 객체가 영속성 컨텍스트에 있고 같은 트랜잭션에서 영속성 컨텍스트의 동일성을 보장하기 위해 프록시 객체를 반환한다
빈 영속성 컨텍스트에서 getReference() 로 엔티티를 조회하면 프록시 객체를 가져오고 그 가져온 프록시 객체를 영속성 컨텍스트에 담는 걸로 이해하면 될까요? 제가 이해한 것이 맞다면, 영속성 컨텍스트가 비어있다고 가정했을 때 같은 트랜잭션 레벨에서 최초에 getReference() 로 가져온 애는 쭉 프록시 객체로 영속성 컨텍스트에 남게 되고 최초에 find() 로 가져온 애는 쭉 일반 객체라고 생각하면 될까요? (두 경우 모두 별도로 영속성 컨텍스트를 비우는 등의 작업을 하지 않는다고 가정)
문제3을 풀다가 궁금한 부분이 생겨서 질문합니다. f3 컬럼의 결측치는 0, silver는 1, gold는 2, vip는 3 으로 변환하는 과정에서 1,2,3을 문자형으로 했을 때는 제대로 나오는데, 숫자형으로 진행하면 오류가 납니다. 아래 제 제가 작성한 코드와 오류 내용입니다. # your code import pandas as pd df = pd.read_csv("https://raw.githubusercontent.com/lovedlim/inf/main/p1/members.csv") #views 컬럼에 결측치가 있는 데이터(행)을 삭제하고, # print(df.isnull().sum()) # print(df.shape) df=df.dropna(subset=['views']) # print(df.shape) # f3 컬럼의 결측치는 0, silver는 1, gold는 2, vip는 3 으로 변환한 후 # print(df.head(10)) df['f3']=df['f3'].fillna(0) df['f3']=df['f3'].replace('silver',1) df['f3']=df['f3'].replace('gold',2) df['f3']=df['f3'].replace('vip',3) # print(df.head(10)) #총 합을 정수형으로 출력하시오 # print(df.info()) df['f3']=df['f3'].astype('int') # print(df.info()) print(sum(df['f3'])) 출력값 =>133 <ipython-input-136-3e83f178c7e6>:20: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)` df['f3']=df['f3'].replace('vip',3) 마지막 방법으로 알려주신 sum의 방법의 경우 문제에서 제시하는 값을 변환하고 총 합을 출력하라는 지시에서 값을 실제로 변환하지는 않은 것 같은데.. 답만 맞으면 괜찮은 걸까요? # your code import pandas as pd df = pd.read_csv("https://raw.githubusercontent.com/lovedlim/inf/main/p1/members.csv") #views 컬럼에 결측치가 있는 데이터(행)을 삭제하고, # print(df.isnull().sum()) # print(df.shape) df=df.dropna(subset=['views']) # print(df.shape) # f3 컬럼의 결측치는 0, silver는 1, gold는 2, vip는 3 으로 변환한 후 r1=sum(df['f3']=='silver')*1 r2=sum(df['f3']=='gold')*2 r3=sum(df['f3']=='vip')*3 print(r1+r2+r3) => 133