// Axios.test.ts import axios from 'axios'; import ManagerService from "./ManagerService"; jest.mock('axios'); const mockedAxios = axios as jest.Mocked<typeof axios>; describe("Axios Test", () => { let managerService = new ManagerService(); it("should mock axios get call", async () => { mockedAxios.get.mockResolvedValue({ data: [ { corporation: "inflearn" } ], }); const test = await managerService.axiosTest("inflearn"); expect(test).toEqual([ { corporation: "inflearn" } ]); expect(mockedAxios.get).toHaveBeenCalledWith(`${process.env.SERVER_URL}/corporation/info`, { params: { corporation: "inflearn" }, }); }); }); 위와 똑같은 코드로 테스트를 진행했고, 본 코드에서는 약간의 차이만 있었습니다. 하지만 아직 왜 그렇게 되는지 알지 못하여서 강사님께 여쭤보려고 합니다. 1번 코드 ( 테스트가 잘 동작하는 코드 ) axiosTest = async (corporation: string) => { const response = await axios.get(`${process.env.SERVER_URL}/corporation/info`, { params: { corporation: corporation, }, }); if (!response) { throw new Error("값이 없음"); } return response.data; }; 2번 코드 ( 값이 없음으로 에러가 발생하는 코드 ) axiosTest = async (corporation : string) => { const site = await axios({ method: 'get', url: `${process.env.SERVER_URL}/corporation/info`, params: { corporation : corporation }, }) if(!site) { throw new Error("값이 없음"); } return site.data } 둘의 차이점에 대해서 알 수 있을까요?
// Axios.test.ts import axios from 'axios'; import ManagerService from "./ManagerService"; jest.mock('axios'); const mockedAxios = axios as jest.Mocked<typeof axios>; describe("Axios Test", () => { let managerService = new ManagerService(); it("should mock axios get call", async () => { mockedAxios.get.mockResolvedValue({ data: [ { corporation: "inflearn" } ], }); const test = await managerService.axiosTest("inflearn"); expect(test).toEqual([ { corporation: "inflearn" } ]); expect(mockedAxios.get).toHaveBeenCalledWith(`${process.env.SERVER_URL}/corporation/info`, { params: { corporation: "inflearn" }, }); }); }); 위와 똑같은 코드로 테스트를 진행했고, 본 코드에서는 약간의 차이만 있었습니다. 하지만 아직 왜 그렇게 되는지 알지 못하여서 강사님께 여쭤보려고 합니다. 1번 코드 ( 테스트가 잘 동작하는 코드 ) axiosTest = async (corporation: string) => { const response = await axios.get(`${process.env.SERVER_URL}/corporation/info`, { params: { corporation: corporation, }, }); if (!response) { throw new Error("값이 없음"); } return response.data; }; 2번 코드 ( 값이 없음으로 에러가 발생하는 코드 ) axiosTest = async (corporation : string) => { const site = await axios({ method: 'get', url: `${process.env.SERVER_URL}/corporation/info`, params: { corporation : corporation }, }) if(!site) { throw new Error("값이 없음"); } return site.data } 둘의 차이점에 대해서 알 수 있을까요?
part1의 실습 - 선형회귀모델 - 당뇨병진행률 예측 에서 질문 있습니다! diabetes_X를 정의할 때 reshape해주는 게 매트릭스를 만들기 위해서라고 해주셨는데요! 혹시 그럼 Test 셋을 정의할 때에는 그럴 필요가 없는 건가요? (??,)인 걸 (??,1)로 만들어주는 RESHAPE를 diabetes_X할 때는 했는데, diabetes.target 은 그냥 (??,) 형태인데도 따로 그 과정을 안 거치는 지 궁금합니다!
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 코드 내에서 값이 같은 경우 append를 하고 indexA += 1, indexB += 1을 해주셨는데 그럼 테이블B에 id가 중복된 경우 해당 행을 조인하지 못하고 건너뛰는 상황이 발생하지 않나요? 예를 들어 A의 id가 1, 2, 3, 4, 5이고 B의 id가 3, 3, 6, 7 이라고 하면 조인의 결과가 2행이 나와야 하는데 indexA = 2 indexB = 0 에서 매칭 후 바로 둘다 indexA = 3, indexB = 1이 되면 조인의 결과가 1행만 나올 것 같아요
import org.springframework.security.config.annotation.web.invoke 시큐리티 5.3부터 Kotlin 환경에서 스프링 시큐리티를 사용하실 때 DSL을 지원받을 수 있습니다. 공식문서에 나와있습니다.( https://docs.spring.io/spring-security/reference/servlet/configuration/kotlin.html) 이 DSL을 사용한 예제 프로젝트도 제공됩니다. ( https://github.com/spring-projects/spring-security-samples/tree/main/servlet/spring-boot/kotlin/hello-security) DSL 문 삽입은 IDE의 지원을 받을 수 없어서 위 import 문을 직접 작성해야합니다. @Configuration class SecurityConfig { @Bean fun securityFilterChain(http: HttpSecurity): SecurityFilterChain { http { authorizeHttpRequests { authorize("/", permitAll) authorize(anyRequest, authenticated) } formLogin {} rememberMe { } sessionManagement { sessionCreationPolicy = SessionCreationPolicy.STATELESS } } return http.build() } } 예를 들면 위와 같이 DSL의 지원을 받아 설정을 구성할 수 있습니다. 람다 표현식을 작성하지 않고 설정할 수 있습니다. IDE를 통해 DSL 설정 클래스를 쭉 따라가보면 어떤 파라미터를 전달하면 될지 확인할 수 있는데 이를 참고하면 좀 더 편리하게 설정을 사용할 수 있습니다. 다만 일부 설정은 제공되지 않는 것도 있어서 해당하는 부분은 Spring에서 제공되는 API 그대로 사용하셔야합니다.
좋은 강의 감사드립니다. 한 가지 질문이 있어 문의드립니다. 한/글 파일에 사용인감 이미지를 첨부하고 싶은데요 현재까지는 표를 만들어서 특정 셀에 이미지를 입력하는 방법까지 구현해봤습니다. 그런데 한글 서식에서는 보통 "(서명)" 글자와 겹쳐서 이미지를 삽입하는데요 이와 같이 이미지를 글자와 겹쳐서 삽입하는 것도 가능할까요? 간단한 Tip이나 예제가 있으면 부탁드립니다. 감사합니다.
결국 traceID가 서로 다른 쓰레드에서 같은 값을 가지게 되니 쓰레드로컬을 이용해서 따로 traceId를 관리 하는거잖아요? 그런데 그냥 애초에 Trace클래스 자체의 빈스코프를 프로토타입으로 해버리면 각각의 쓰레드가 Trace클래스를 DI받을때마다 쓰레드마다 다른 Trace클래스가 생성되니 따로 관리를 할 필요가 없지 않나요? 이렇게되면 어떠한 오버헤드가 발생하나요?
ThreadLocalLogTrace는 싱글톤이잖아요? 그러므로 A와 B에서 참고하는 ThreadLocalLogTrace 참조값은 같은 값을 가리킬꺼같은데, 여기서 ThreadLocal<TraceId> 필드는 각 A쓰레드 B쓰레드 각각의 공유하지 않는 고유의 데이터영역에 저장되는것인가요? (JVM에서 STACK과 PC Register처럼) 아니면 일종의 해시함수처럼 작용하여 A쓰레드에서의 요청이면 알아서 A의 데이터 B쓰레드에서의 요청이면 알아서 B의 데이터 를 주는것인가요? 만약 전자라면 이게 어떻게 가능한것인지?
Uncaught TypeError: Cannot read properties of undefined (reading 'scrollHeight') at scrollLoop (main.js:367:65) at main.js:388:9 이런 오류 떠서 제 자바 스크립트 코드도 여기 올려볼께요....
"Printer showing in error state" is a common issue encountered by HP printer users. This problem can arise due to various reasons such as paper jams, connectivity issues, outdated printer drivers, or hardware problems. Here are some steps you can take to troubleshoot and fix this ' HP printer in error state windows 10 ' issue: Check for Paper Jams : Open the printer cover and check for any paper jams. Remove any stuck paper carefully. Restart Printer : Turn off the printer, wait for a few seconds, and then turn it back on. Sometimes, a simple restart can resolve the error state issue. Check Printer Connections : Ensure that the printer is properly connected to your computer or network. If it's a wireless printer, check the Wi-Fi connection and make sure it's stable. Update Printer Drivers : Outdated or corrupted printer drivers can cause various issues. Visit the HP website, download the latest drivers for your printer model, and install them on your computer. Reset Printer : Sometimes, resetting the printer to its factory settings can resolve persistent issues. Refer to your printer's manual for instructions on how to reset it. Clear Print Queue : There might be pending print jobs in the print queue causing the error state. Clear the print queue by canceling all print jobs. Check for Firmware Updates : Check if there are any firmware updates available for your printer model on the HP website. Updating the firmware can fix bugs and improve printer performance. Run HP Print and Scan Doctor : HP provides a diagnostic tool called HP Print and Scan Doctor which can automatically diagnose and resolve various printer issues. Download and run this tool to troubleshoot the error state problem. Inspect Hardware : If none of the above steps resolve the issue, there might be a hardware problem with the printer. Inspect the printer for any visible damage or malfunctioning parts. If necessary, contact HP support or a qualified technician for further assistance. By following these steps, you should be able to troubleshoot and resolve the "printer showing in error state" issue for your HP printer. While Having Wifi Connectivity Issue Check This Here Encountering issues with your HP printer not connecting to WiFi can be frustrating, disrupting your workflow and productivity. However, fret not! This comprehensive guide is crafted to assist you in troubleshooting the problem effectively, ensuring seamless connectivity with your HP printer. Check Network Connection: Begin by verifying if your WiFi network is working properly. Ensure other devices can connect without any issues. Restart your WiFi router and modem. Sometimes, a simple reboot can resolve connectivity issues. Printer Placement: Ensure your HP printer is placed within the WiFi range. Walls, electronic devices, and other obstructions can weaken the signal strength. Avoid placing the printer in close proximity to microwave ovens, cordless phones, or other electronic devices that might interfere with the WiFi signal. Verify Printer Settings: Access the printer's control panel and navigate to the wireless settings. Ensure that WiFi is enabled on your printer and that it is connected to the correct network. Double-check the WiFi network name (SSID) and password entered on the printer to avoid any typos. Restart Printer: Turn off your HP printer, wait for a few seconds, and then turn it back on. Sometimes, a simple restart can help reset the printer's connectivity settings and establish a fresh connection to the WiFi network. Update Printer Firmware: Check if there are any pending firmware updates available for your HP printer. Visit the official HP website, navigate to the support section, and download/install the latest firmware updates for your printer model. Reconfigure WiFi Settings: If the printer still fails to connect, you may need to reconfigure its WiFi settings. Reset the printer's network settings to default and then set up the WiFi connection again using the printer's control panel or HP Smart app. Firewall/Antivirus Settings: Check your firewall or antivirus settings to ensure they are not blocking the printer's connection to the WiFi network. Temporarily disable firewall or antivirus software and attempt to reconnect the printer to WiFi. By following the steps outlined in this guide, you can troubleshoot and resolve HP Printer won't connect to wifi issue efficiently.
파워앱스에서 가닥을 잡고 쉐어포인트에서 LIST 를 만든 후, 파워오토메이트에서 들어와서 만들기-> 인스턴트 클라우드 흐름 으로 들어가서 PowerApps(V2) 트리거 선택 후, 동작->쉐어포인트로 들어가서 항목만들기로 사이트와 목록을 불러오는데 까진 성공했으나 '사용할 수 있는 동적 콘텐츠가 없음' 이라고 계속 떠서 전진을 못합니다. MS가 워낙 업데이트를 자주해서 UI가 바뀌어서, 강의랑 인터페이스가 바뀌어서 당황스러워요.. 어떻게 하면 될까요?
[질문 템플릿] 1. 강의 내용과 관련된 질문인가요? (예/아니오) 2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) [질문 내용] 여기에 질문 내용을 남겨주세요. 이 부분에서 charArr은 참조변수니까 인덱스를 따로 지정하지 않고 charArr을 통째로 출력하면 참조값이 나와야 하는거 아닌가요? 강의에서는 hello가 출력되더라고요 아무리 생각해도 이상해서 제가 놓친 개념이 있는 거 같아서 궁금해서 질문드립니다. 추가로 System.out.println(charArr)을 하면 hello가 나오던데 사진처럼 "charArr = " + charArr로 하니까 이렇게 참조값이 나오더라고요 무슨 차이인지도 궁금합니다.
Timesharing is allowing many users to interact concurrently with the single computer Multitasking is when multiple tasks are preformed during the same period of time in a single processor. 책이나 다른 자료들에서는 time sharing 이 여러 유저들에게 일정한 시간을 단위로 cpu 를 점유할 수 있게 한다고 하는데, 이 강의에서 다루는 내용은 프로세서들을 메모리에 다 저장해놓고, 시간을 나눠서 사용하는 것이 time sharing 이라고 했어요, 유저들 간의 사용성이 언급되지 않았어요. 혹시 강의 내용이 잘못된것인가 저의 이해가 부족한 것인가 싶어서 질문 드립니다. 감사합니다.