본문 바로가기

전체 글211

오라클 Comment 자동 생성을 위한 Custom Annotation 만들기 SpringBoot 환경에서 오라클을 사용하는데, table은 자동으로 만들어 줘서 좋은데 Comment는 자동으로 안 넣어줘 이래 저래 찾다 보니 딱히 방법이 없었다. Mysql 같은 경우, table을 만들면서 comment를 추가할 수 있어 @Column Annotation에 'columndefinition'을 넣어 만들 수 있는데 Oracle은 그 방법을 쓸 수 없고 'comment on' query를 써야 한다. 그러던 중 좋은 게시물을 찾았다. https://developpaper.com/a-solution-to-the-problem-that-configuration-annotation-in-springboot-jpa-oracle-entity-class-cannot-generate-annota.. 2021. 10. 16.
코드 수행 시간 측정하기 코드 수행 시간 측청은 간단하면서도 외우기는 귀찮다. 어디에 써놓고 필요할 때 보는 것이 편하다. 그런 의미에서 여기에 끄적인다. gettimeofday() 함수는 아래와 같이 시간을 얻어올 수 있는데, microseconds를 얻을 수 있다. GETTIMEOFDAY(2) Linux Programmer's Manual GETTIMEOFDAY(2) NAME gettimeofday, settimeofday - get / set time SYNOPSIS #include int gettimeofday(struct timeval *tv, struct timezone *tz); int settimeofday(const struct timeval *tv, const struct timezone *tz); Featur.. 2021. 10. 15.
time 명령어로 프로그램 수행 시간 측정하기 어떠한 문제를 해결하는 프로그램을 작성하는데 누구의 수행 시간이 빠른지 체크하는 것이 한때 유행이었다. 굳이 이런 것이 아니더라도 수행 시간에 민감한 작업을 할 때 주로 사용하던 명령어였다. time 명령어를 사용하면 이와 같은 것을 쉽게 할 수 있었는데 사용법은 간단하다. $ time COMMAND [ ARGS ] time sleep 10 이라고 실행하면 sleep 1을 수행하는데 걸린 시간이 출력된다. dev@dev:~$ time sleep 10 real0m10.004s user0m0.003s sys0m0.000s dev@dev:~$ time uname -a Linux dev 5.8.0-50-generic #56~20.04.1-Ubuntu SMP Mon Apr 12 21:46:35 UTC 2021 x.. 2021. 10. 15.
포스트맨(Postman)이 만들어준 코드로 예제 만들기 (C 언어, curl library) 위와 같이 작성 후, 포스트맨으로 아래와 같은 코드를 만들었다. CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "http://192.168.0.6:3000/"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers.. 2021. 10. 11.