묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결AWS Certified Solutions Architect - Associate 자격증 준비하기
수강 기간 연장 부탁드립니다
개인 사정으로 학습을 하지 못했습니다 연장해주시면 정말 감사드립니다..!
-
해결됨[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part4: 게임 서버
Session의 수명 관리를 위한 Ref 카운트 관리 부분
안녕하세요. 수업 잘 듣고 있습니다. 감사합니다. Session 수업 부분에서Register함수들에서 owner = shared_from_this(); 를 Process함수들에서 owner = nullptr 를 해주는 방식을.한 군데에서 관리하는게 좋지않을까 하는 생각이 들었습니다.Session이 생성될 때 Init함수 같은 것을 하나 둬서멤버 변수로 들고 있는 각Event들의 owner에 shared_from_this()를 넣어주고(계속 들고 있는 상태로 유지)나중에 문제가 생겨서 Disconnect()를 호출해야 할 때,ProcessDisconnect함수와 소멸자 같은 부분에서nullptr로 밀어주는 식으로 한다면 비동기 함수에 걸어놓는 동안 session의 생명은 계속 유지가 될 것 같고, 매번 참조횟수를 늘렸다 줄였다 하지 않아도 되니 괜찮을 것 같다 생각했는데요.혹시 제가 잘못 생각하고 있거나미처 생각을 못한 부분이 있을까요?
-
미해결스프링 핵심 원리 - 기본편
싱글톤 패턴 문제점
싱글톤 패턴의 문제점중 하나로 클라이언트가 구체 클래스에 의존해서 DIP와 OCP원칙을 위반할 수 있다고설명이 되어 있는데 궁금한 부분이 여기서 말하는 클라이언트가 아래와 같이 강의 중에 설명한 코드 중private static final SingletonService instance = new SingletonService()를 의미하는건지혹은 두 번째 코드에서 SingletonService singletonService1 = SingletonService.getInstance()과 같이 SingletonService 객체에서 객체를 가져오는 것을 의미하는 건가요? 그리고 강사님께서 싱글톤 패턴을 테스트에 위치하여 작성하였고 해당 SingletonService 클래스의 싱글톤을 구현한 코드를 해당 클래스 안에 작성하셨는데 스프링을 사용하지 않는다는 가정하에 싱글톤으로 컨테이너 객체를 관리할 때 SingletonService는 인터페이스고 해당 인터페이스를 구현하는 구현 클래스에 싱글톤 구현부들 작성하는게 맞을까요?
-
미해결
영상재생안됩니다. 폰에서
영상 재생이 안됩니다. 이것이 진짜 크롤링이다 실전편 입니다.
-
미해결실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
h2 데이터베이스 설정 오류
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예)[질문 내용]java.lang.NullPointerException: Cannot invoke "org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(java.sql.SQLException, String)" because the return value of "org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.sqlExceptionHelper()" is null at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:116) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.getJdbcEnvironmentUsingJdbcMetadata(JdbcEnvironmentInitiator.java:290) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:123) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:77) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:130) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:238) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:215) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.boot.model.relational.Database.<init>(Database.java:45) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:221) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:189) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:171) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1431) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1502) ~[hibernate-core-6.5.2.Final.jar:6.5.2.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75) ~[spring-orm-6.1.8.jar:6.1.8] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:390) ~[spring-orm-6.1.8.jar:6.1.8] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.1.8.jar:6.1.8] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.1.8.jar:6.1.8] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:366) ~[spring-orm-6.1.8.jar:6.1.8] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1835) ~[spring-beans-6.1.8.jar:6.1.8] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784) ~[spring-beans-6.1.8.jar:6.1.8] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.8.jar:6.1.8] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.8.jar:6.1.8] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) ~[spring-beans-6.1.8.jar:6.1.8] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.8.jar:6.1.8] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) ~[spring-beans-6.1.8.jar:6.1.8] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205) ~[spring-beans-6.1.8.jar:6.1.8] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:952) ~[spring-context-6.1.8.jar:6.1.8] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624) ~[spring-context-6.1.8.jar:6.1.8] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.3.0.jar:3.3.0] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.3.0.jar:3.3.0] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.3.0.jar:3.3.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[spring-boot-3.3.0.jar:3.3.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363) ~[spring-boot-3.3.0.jar:3.3.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352) ~[spring-boot-3.3.0.jar:3.3.0] at jpabook.jpashop.JpashopApplication.main(JpashopApplication.java:16) ~[classes/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50) ~[spring-boot-devtools-3.3.0.jar:3.3.0]2024-06-12T10:54:03.045+09:00 ERROR 26788 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'jakarta.persistence.jdbc.url' for common cases or 'hibernate.dialect' when a custom Dialect implementation must be provided)2024-06-12T10:54:03.047+09:00 WARN 26788 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set 'jakarta.persistence.jdbc.url' for common cases or 'hibernate.dialect' when a custom Dialect implementation must be provided)2024-06-12T10:54:03.061+09:00 INFO 26788 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]2024-06-12T10:54:03.086+09:00 INFO 26788 --- [ restartedMain] .s.b.a.l.ConditionEvaluationReportLogger : Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.2024-06-12T10:54:03.135+09:00 ERROR 26788 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed제가 컴퓨터 재부팅하고 JpashopApplicaton을 실행했을 때 다음과 같이 에러가 떠서 h2 데이터베이스 설정이 안됐나 싶어서 설정하려 했는데 h2에서 다음과 같은 에러가 발생했다고 하네요... 이거 Chat GPT한테 물어보면 application.yml을 다시 설정하라 하는데 뭔가 건드리면 안될 것 같아서 그런데 어떻게 해결하면 좋을지 질문 드리고자 합니다.
-
해결됨
인텔리제이 run 창 위로 뜨는것 어떻게 내리나요 ㅜㅜ
이렇게 떠버렸는데.. 아래로 어떻게 내릴수 있을까요..
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
df 조건관련
df = df[ df['year']== 2023 ] cond1 = (df['year'] > 2023)이 어떤게 다른걸까요? df = df[ df['year']== 2023 ] 는 조건을 df에 다시 넣고cond1 = (df['year'] > 2023)는 조건을 df에 넣지 않고 cond1로 넣은건데요 구분이 되지 않습니다 ㅠㅠ 예를들어 cond1 = (df['year'] > 2023)가 아닌 cond1 = df[df['year'] > 2023]로 했을때도 가능한건지 궁금합니다.
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
[캐글 작업형1, 12번 문제] 이해가 되지 않는게 있습니다.
[문제]주어진 데이터에서 상위 10개 국가의 접종률 평균과 하위 10개 국가의 접종률 평균을 구하고, 그 차이를 구해보세요 . (단, 100%가 넘는 접종률 제거, 소수 첫째자리까지 출력) import pandas as pddf = pd.read_csv('../input/covid-vaccination-vs-death/covid-vaccination-vs-death_ratio.csv') #시간에 따라 접종률이 점점 올라감df2 = df.groupby('country').max()df2 = df2.sort_values(by='ratio', ascending = False) #100%가 넘는 접종률 제거cond = df2['ratio'] <= 100df2 = df2[cond] top = df2['ratio'].head(10).mean()bottom = df2['ratio'].tail(10).mean()print(round(top - bottom,1)) 문제와 정답코드는 위와 같이 적어주셨는데, 여기서 #시간에 따라 접종률이 점점 올라감df2 = df.groupby('country').max() 이 말의 뜻과, 코드가 이해가 되지 않습니다.
-
미해결Airflow 마스터 클래스
도커를 사용하지 않는 방법
안녕하세요 HPC를 사용하고 있는데 도커가 사용 불가능한 HPC라 우선은 구글링하여 airflow를 설치하고 강의를 듣고 있습니다. 아직 1강인데, 혹시 차후에 도커가 없어서 강의를 못따라가는 상황이 생길까요? 수강신청전에 미리 확인해봤어야 했는데 죄송합니다 ㅜㅜ!
-
미해결스프링 핵심 원리 - 고급편
스프링 문의드립니다.
해결함 !
-
미해결파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트 (장고 4.2 기준)
엑셀 파일 생성 중에 cannot be used in worksheets 에러 발생
안녕하세요.강의와는 무관한 질문이지만 본 강의 수강 완료 후 혼자서 프로젝트를 하고 있습니다.현재 구글 리뷰 크롤링 & 스크랩중인데요. 해당 에러가 발생하는 이유를 도무지 찾을 수 가 없어서 질문 드립니다...여러 사이트를 크롤링 해보고 엑셀을 생성 해 보았지만 왜 이런 에러가 발생하는지 로그를 봐도 제대로 표시가 안되니깐 찾기가 힘드네요.구글 리뷰 사이트만 20여개 스크랩 했었고 엑셀도 제대로 생성 되었으니 스크랩 코드 자체에는 문제가 없는거 같습니다. 다만 이 부분에서만 문제가 생깁니다.### 에러 발생 로그[2024-06-12 09:42:59,954] [ERROR utils.py:179] >>Traceback (most recent call last): File "scraper\scrap_crawlers.py", line 1365, in get_review_details File "scraper\utils.py", line 202, in create_xlsx_file File "scraper\utils.py", line 181, in create_xlsx_file File "pandas\util\_decorators.py", line 333, in wrapper File "pandas\core\generic.py", line 2417, in to_excel File "pandas\io\formats\excel.py", line 952, in write File "pandas\io\excel\_openpyxl.py", line 490, in writecells File "openpyxl\cell\cell.py", line 218, in value File "openpyxl\cell\cell.py", line 197, in bindvalue File "openpyxl\cell\cell.py", line 165, in check_stringopenpyxl.utils.exceptions.IllegalCharacterError: 동생한테추천받았는데이렇게편한어플이있다니너무좋아요.현금비율은좋지않지만 신경많이안써도되서괜찮네요~ cannot be used in worksheets.During handling of the above exception, another exception occurred:###cannot be used in worksheets. 이놈이 말썽이네요...아래와 같이 테스트 케이스 만들어서 적용했을 때는 제대로 작동했었습니다.import asyncio from scraper.utils import create_xlsx_file, save_to_xlsx DEFAULT_NAME = "test" async def main(): data = { "message": "동생한테추천받았는데이렇게편한어플이있다니너무좋아요.현금비율은좋지않지만 신경많이안써도되서괜찮네요~" } xlsx_file = await create_xlsx_file( data, file_name=DEFAULT_NAME, sheet_name=DEFAULT_NAME ) await save_to_xlsx(xlsx_file, DEFAULT_NAME) asyncio.run(main()) # utils.py # 엑셀 가로 폭 조정하는 함수 async def calculate_dimension(worksheet: Worksheet) -> None: try: for column_cells in worksheet.iter_cols(): length = max(len(str(cell.value)) for cell in column_cells) adjusted_width = (length + 2) * 1.2 # 조정된 폭 계산 column_letter = get_column_letter(column_cells[0].column) worksheet.column_dimensions[column_letter].width = adjusted_width except Exception as e: message = f"엑셀 폭 조정 중에 예외 발생: '\n{e}" logger = await get_logger() logger.error(message) print(message) raise e # 엑셀에 서식 스타일 지정하는 함수 async def cell_pattern_fill( df: pd.DataFrame, worksheet: Worksheet, head_fill_color: str = "4472C4", head_font_color: str = "FFFFFF", body_fill_color: str = "D9E1F2", body_font_color: str = "000000", head_border_color: str = "2E5C99", body_border_color: str = "B4C6E7", fill_type: fills = "solid", ) -> None: try: # Define border styles thin_border_head = Border( left=Side(border_style="thin", color=head_border_color), right=Side(border_style="thin", color=head_border_color), top=Side(border_style="thin", color=head_border_color), bottom=Side(border_style="thin", color=head_border_color), ) thin_border_body = Border( left=Side(border_style="thin", color=body_border_color), right=Side(border_style="thin", color=body_border_color), top=Side(border_style="thin", color=body_border_color), bottom=Side(border_style="thin", color=body_border_color), ) # Set header row style for row in worksheet.iter_rows( min_row=1, max_row=1, min_col=1, max_col=df.shape[1] ): for cell in row: cell.fill = PatternFill( start_color=head_fill_color, end_color=head_fill_color, fill_type=fill_type, ) cell.font = Font(color=head_font_color, bold=True) cell.border = thin_border_head # Set body row style for i, row in enumerate( worksheet.iter_rows( min_row=2, max_row=worksheet.max_row, min_col=1, max_col=df.shape[1] ) ): for cell in row: if i % 2 == 0: cell.fill = PatternFill( start_color=body_fill_color, end_color=body_fill_color, fill_type=fill_type, ) cell.font = Font(color=body_font_color) cell.border = thin_border_body except Exception as e: message = f"엑셀 서식 지정 중에 예외 발생: '\n{e}" logger = await get_logger() logger.error(message) print(message) raise e # 본 강의 drf 엑셀 생성 파트를 참고해서 만든 엑셀 생성 함수 async def create_xlsx_file( data: Union[Dict, List], file_name: str = DEFAULT_DIR_NAME, sheet_name: str = DEFAULT_DIR_NAME, ) -> BytesIO: df = pd.json_normalize(data) io = BytesIO() io.name = file_name try: writer = pd.ExcelWriter(io, engine="openpyxl") # noqa df.to_excel( writer, index=False, engine="openpyxl", sheet_name=sheet_name, ) workbook = writer.book worksheet = workbook.active tasks = [ calculate_dimension(worksheet), cell_pattern_fill(df, worksheet), ] await tqdm.gather(*tasks, desc=f" 엑셀 파일 생성중") writer._save() # noqa except Exception as e: message = f"엑셀 생성 중에 예외 발생: '\n{e}" logger = await get_logger() logger.error(message) print(message) raise e io.seek(0) return io # 엑셀 저장 함수 async def save_to_xlsx( xlsx_file: BytesIO, dirname: str = DEFAULT_DIR_NAME, ): output_path = BASE_DIR / "스크랩_결과" / "엑셀" / dirname output_path.mkdir(parents=True, exist_ok=True) now = datetime.datetime.now() timestamp = now.strftime("%Y-%m-%d_%H_%M") filename = f"{xlsx_file.name}_{timestamp}" extension = ".xlsx" file_path = output_path / (filename + extension) try: async with aiofiles.open(file_path, "wb") as f: await f.write(xlsx_file.getvalue()) except Exception as e: message = f"엑셀 파일 저장 중에 예외 발생: '{filename}'\n{e}" logger = await get_logger() logger.error(message) print(message) raise e전체적인 함수는 위와 같으며 엑셀 생성 중에 에러가 발생하였으니 create_xlsx_file 함수 부분에서 해결을 해보아야 할것 같습니다.아니면 혹시 엑셀의 행을 생성 중에 에러가 발생하였을 때 해당 행은 스킵하고 이어서 진행하게 하는 방법이 있을까요?? "raise e"을 발생 시키지 않아도 엑셀 생성 작업 스킵이 되지않고 작업 자체에 문제가 생기네요
-
미해결실무자가 알려주는 CANoe (For CAN 통신)
Canoe 차량에 직접 연결 사용법
안녕하세요 강사님강사님 덕분엔 정말 막막하던 Can 장비 사용법 관련해서 물꼬가 트였고 어쩌면 제가 현실적으로 들을 수 있는 강의중에 최고라고 생각합니다. 자동차 업계에 입사한지 1년이 조금넘은 신입 매니저입니다. 제가 현업에 있으면서 차량(트럭, 버스)에 직접 네트워크 인터페이스 장비를 꽂아서(OBD단자 or CM) CAN BUS를 관측해야하는 경우가 있는데요. 이럴 경우에는 강의중에 말씀하신 DBC파일이 있어야할텐데 해당파일은 차량을 개발한 연구소에 문의를 해서 공유 받아다가 봐야할까요? 그리고 추가 질문으로 CM에 커넥터를 물리고 싶으면 OBD 케이블 외에 별도의 커넥터 케이블이 있나요?
-
미해결데이터 분석 SQL Fundamentals
다양한 window절의 이해 -01, 02
윈도우 절 코드 실습 중입니다.select product_id, product_name, category_id , unit_price, sum(unit_price) over (partition by category_id order by unit_price rows between 1 preceding and 1 following) as unit_price_sum from products;위 코드는 제공해주신 base 코드입니다. 해당 unit_price_sum을 소수점 둘째자리 까지만 표시하고자 round 함수를 썼는데,round(sum(unit_price) over (partition by category_id order by unit_price rows between 1 preceding and 1 following), 2) as unit_price_sum from products; "SQL Error [42883]: 오류: round(real, integer) 이름의 함수가 없음 Hint: 지정된 이름 및 인자 자료형과 일치하는 함수가 없습니다. 명시적 형변환자를 추가해야 할 수도 있습니다."이와 같은 에러가 납니다. 그래서 with절로 해당 unit_price_sum을 temp_01이라는 임시 쿼리에 담아서 아래와 같이 했지만 이래도 위 오류와 동일하게 나오면서 되지 않네요with temp_01 as(select avg(unit_price) over (partition by category_id order by unit_price rows between 1 preceding and 1 following) as unit_price_avg from products) select round(temp_01.*, 2) from temp_01;select product_id, product_name, category_id, unit_price,avg(unit_price) over (partition by category_id order by unit_price rows between 1 preceding and 1 following) as unit_price_avg from products; 하는 방법이 있을까요? chat gpt도 서브쿼리로 답을 제공했는데 동일한 문제가 발생했습니다.
-
미해결자바 ORM 표준 JPA 프로그래밍 - 기본편
jpql과 1차 캐시
Persist를 실행할 때는 영속성 컨텍스트 1차 캐시에 데이터를 넣지 않는 건가요? 아니면 persist도 1차 캐시에 데이터와 스냅샷 모두 저장하나요?Find를 실행해서 db에서 가져올 때만 가져올 때의 엔티키 상태를 스냅샷을 찍고 엔티티와 함께 1차 캐시에 저장하나요?jpql 실행시에는 1차 캐시를 조회하지 않는 건가요?이 질문의 이유:Find는 1차 캐시에 있는 엔티티를 먼저 조회하는 것으로 알고 있습니다.jpql을 실행할 때 Member 데이터가 없으면 안된다고 설명하고 있습니다그래서 jpql 실행은 1차 캐시를 먼저 찾지 않고 바로 쿼리를 전송하는 것인가? 라는 생각이 들었습니다.jpql이 1차 캐시를 조회하지 않으면 persist 호출 시 1차 캐시에 엔티티를 저장해도 db에서 찾으니까 결국 flush가 발생한다는 생각이 맞아 떨어지는 것 같습니다.
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
플러터 ui guide 안보이는 현상
섹션5에서는 코드팩토리님도 ui guide가 안보였는데(위젯 계층간의 연결선) 섹션7부터는 보이네요. 저는 ui guide가 안보이는데 어떻게 해결해야할까요?
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
작업형 2 - 데이터 전처리에서 공식같은 게 있을까요??
작업형 2 - 데이터 전처리에서 공식같은 게 있을까요?? 이 의미는 데이터 타입이 object, int/float 섞여있을 때 수치형만 모아서 분석을 한다거나수치형+범주형 같이 모아서 분석을 한다거나 위 두 개의 경우 점수 배점 차이가 없을지 궁금합니다.
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
2회 기출유형(작업형2) 데이터
케글에서 다운받았는데 X_train.csv y_train.csv X_test.csv는 없고 Train.csv 파일 하나 있네요. 어떻게 된걸까요?
-
미해결PM을 위한 데이터 리터러시(프로덕트 데이터 분석)
4-8 지표 정의하기 연습문제
안녕하세요, 카일님. 지표 연습문제 한번 작성해봤습니다.도움 많이 받고 있습니다. 감사합니다 (__) 1. 각 메뉴별 CTR (click / imp) 확인 2. 페이지 전환율 확인 (serach_result -> 상품 상세), 페이지 이탈률 확인 3. 검색 필터 버튼 CTR 확인, 검색 필터 지우기 버튼 CTR 확인 4. 배달 서비스에서 가장 중요한 지표? 주문건수!배달 포장 치킨, 한식, 분식 등... 치킨, 한식, 분식 등...늘릴 수 있는 방법? CVR (구매 전환율) 이 가장 높은 segment (배달, 치킨) 을 가장 전면에 배치한다가장 높은 segment의 쿠폰을 제공한다가장 높은 segment 관련 activity를 제공한다 5. 추천 알고리즘의 성능 지표? 구매 전환율왜? 이커머스 알고리즘이기 때문에... 한번 추천 시킨 다음 구매까지 연결되는 것이 최종 목표기존 알고리즘과 신규 알고리즘의 전후비교를 통해서 구매 전환율을 볼 것 같다. 6. 유튜브 duration -> 앱을 오래쓰는 것은 뭔가 이유가 있다신규 구독 건수 -> 콘텐츠 추천에 대한 최상의 만족도를 표시하는 지표라고 생각playrate (playtime / videolength) -> 특정 콘텐츠에 대한 만족도를 전반적으로 볼 수 있다고 생각 7. 가입 전환율이 20%보다 상승했는지 확인, ABT를 통해서 비교
-
해결됨[퇴근후딴짓] 빅데이터 분석기사 실기 (작업형1,2,3)
작업형 2 고민끝에 정리하여 질문드립니다.
안녕하세요 선생님 저는 작업형 2를 아래와 같은 매커니즘으로 푸려고 합니다.train.info()를 통해서 object 컬럼 확인→ 만약 범주형 데이터가 있다면?→ 라벨인코딩(여기서 cols = train.select_dtypes(include='object').columns 로 해서 푸려고 합니다.)→target = train.pop('타겟컬럼')train = train.drop('ID',axis=1)test_ID = test.pop('ID')→train_test_split을 통해 검증데이터 분리train_test_split(train, target, test_size=0, random_state=0)<여기서 train과 target으로만 쓰기 위해서 위에서 pop과 drop을 진행했습니다.>→모델 예측 및 검증무조건 랜덤포레스트로 진행하고 그 후에 하이퍼파라메터 튜닝으로 성능 비교해볼 생각입니다.→평가지표에 따른 성능 비교→하이퍼파라메터 튜닝 적용해보기→DataFrame 만들기→csv만들기매커니즘에 따른 코드는 다음과 같습니다. train.info() from sklearn.preprocessing import LabelEncodercols = train.select_dtypes(include='object').columnsfor col in cols:le = LabelEncoder()train[col] = le.fit_transform(train[col])test[col] = le.transform(test[col]) target = train.pop('타겟컬럼')train = train.drop('ID',axis=1)test_ID = test.pop('ID') from sklearn.model_selection import train_test_splitX_tr, X_val, y_tr, y_val = train_test_split(train, target, test_size=0, random_state=0) from sklearn.ensemble import RandomForestClassifierrf = RandomForestClassifier(random_state=0, max_depth = 5, n_estimators = 500)rf.fit(X_tr,y_tr)pred = rf.predict(X_val) from sklearn.metrics import f1_scoreprint(f1_score(y_val, pred, average='macro')) pred = rf.predict(test) submit = pd.DataFrame({'ID' : test_ID,'타겟컬럼' : pred}) submit.to_csv('0000.csv', index=False)여기서 질문은1. pop과 drop을 저 단계에서 해줘도 무방한가요?cols를 라벨 인코딩에서 먼저 정의해주게 되는데 그 이후에 pop과 drop써도 무방한지 여쭤봅니다.2. 물론 어떤 데이터를 주냐에 따라 다르겠지만 위와 같은 과정으로 진행해도 점수획득에 큰 무리 없겠죠?(교차검증등등은 진행하고 싶지 않아서요)3. 범주형 데이터가 하나도 없다면? 그럴일이 없을거 같긴한대 그러면 인코딩단계만 빼고 그대로 진행하면되나용?
-
미해결스프링 시큐리티 OAuth2
OAuth2 로그인 구현 - Oauth 2.0 User 모델 소개 issuer-uri에러
섹션 7OAuth2 로그인 구현 - Oauth 2.0 User 모델 소개(2)진행시 설정시 에러가 납니다uli 클릭하면realm: "oauth2",public_key: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqFd5+xNaJoQzccdweHH4hxMOOirdHcbGx7tAkl7YWFAD0kBpVmpFN3sWaz3T3CLa0zSULmEWuepEkf/T376JKs+opBRb8pfnDSvvq1va4UXhw5j1mMgN8a6kME2TfM4cd2XnnT9huTIJ2+4nTYPTwKhYd+KvgB1ruzUe4ApMw0injfbsyufS17bhGtHYn4Ysq7THWsOAPVQ+FMYd8e1T4tfY1jkQg68UYB43dHST34y0JWkStPowP80qLMbsPvJ4JrOCzSGk08sBvmd6Fo1KD9RAqZyGvQFXEyo1Y5jVcKGCgwin0ijQBCKhRpHmWGlmyamrW6fsgAnAJH+clUdAwQIDAQAB",token-service: "http://localhost:8080/realms/oauth2/protocol/openid-connect",account-service: "http://localhost:8080/realms/oauth2/account",tokens-not-before: 0}이렇게 잘나옵니다. implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test'spring: application: name: inf_oauth2 security: oauth2: client: registration: keycloak: authorization-grant-type: authorization_code client-id: oauth2-client-app client-name: oauth2-client-app client-secret: 90GVrQtfYCp1u9cc0VAJNFiY8ZzCyjHD redirect-uri: http://localhost:8081/login/oauth2/code/keycloak client-authentication-method: client_secret_basic scope: openid, profile, email provider: keycloak: issuer-uri: http://localhost:8080/realms/oauth2 authorization-uri: http://localhost:8080/realms/oauth2/protocol/openid-connect/auth jwk-set-uri: http://localhost:8080/realms/oauth2/protocol/openid-connect/certs token-uri: http://localhost:8080/realms/oauth2/protocol/openid-connect/token user-info-uri: http://localhost:8080/realms/oauth2/protocol/openid-connect/userinfo user-name-attribute: preferred_username org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexContoller': Unsatisfied dependency expressed through field 'clientRegistrationRepository': Error creating bean with name 'clientRegistrationRepository' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2ClientRegistrationRepositoryConfiguration.class]: Failed to instantiate [org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository]: Factory method 'clientRegistrationRepository' threw exception with message: Unable to resolve Configuration with the provided Issuer of "http://localhost:8080/realms/oauth2" at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessorAutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:787) ~[spring-beans-6.1.6.jar:6.1.6] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessorAutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:767) ~[spring-beans-6.1.6.jar:6.1.6] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientRegistrationRepository' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/servlet/OAuth2ClientRegistrationRepositoryConfiguration.class]: Failed to instantiate [org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository]: Factory method 'clientRegistrationRepository' threw exception with message: Unable to resolve Configuration with the provided Issuer of "http://localhost:8080/realms/oauth2" at java.base/java.util.HashMap.forEach(HashMap.java:1421) ~[na:na] at org.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientPropertiesMapper.asClientRegistrations(OAuth2ClientPropertiesMapper.java:64) ~[spring-boot-autoconfigure-3.2.5.jar:3.2.5] at org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientRegistrationRepositoryConfiguration.clientRegistrationRepository(OAuth2ClientRegistrationRepositoryConfiguration.java:49) ~[spring-boot-autoconfigure-3.2.5.jar:3.2.5] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140) ~[spring-beans-6.1.6.jar:6.1.6] ... 34 common frames omitted