728x90
반응형

야곰야곰 326

error C3861: 'min': identifier not found

1>c:\program files (x86)\windows kits\8.1\include\um\gdiplustypes.h(689): error C3861: 'min': identifier not found 1>c:\program files (x86)\windows kits\8.1\include\um\gdiplustypes.h(690): error C3861: 'min': identifier not found 오랜만에 봐서 살짝 당황했네. MIN, MAX가 중복 선언돼서 문제 되는 건 기억나는데.. 이건 opencv와 Gdiplus의 min, max가 충돌(?) 혹은 선점이 잘못되어서 그런 것 같다. 를 사용하지 않았는데, 이런 에러가 떠다니, opencv.hpp 보다 먼저 인클루드 해주면 된다. #inc..

(OpenCV) LNK2019: unresolved external symbol "class cv::debug_build_guard::_InputOutputArray ....

Error Linking static libraries - OpenCV Q&A Forum Error Linking static libraries edit Hi, I built opencv from source and I'm trying to make a dll that uses some of the opencv .lib. In visual studio I set the additional directory and dependencies as follows (.lib files are in that folder): [...]\lib;%(Addi answers.opencv.org 한참을 헤매다가 debug 프로젝트에서 release 라이브러리를 가져와서 발생한 에러라는 걸 알았다. 그래서 debug 라이브러..

C4430 : missing type specifier - int assumed.

오래전에 해결해 두고 또 같은 에러로 헤매고 있었다니.. 아 놀라워라.. C++에서 순환 참조(?)하게 되면 이런 에러가 뜬다. //A.h #include "B.h" class A{ B* b; .. }; //B.h #include "A.h" class B{ A* a; // error error C4430: missing type specifier - int assumed. } 이런 식으로 말이다. 결국 전방 선언을 이용해서 해결해야 한다. //B.h class A; // change the include of A.h to forward declaration class B { A* a; }; 대신 소스파일에서 해당 헤드파일을 포함해주면 된다.

git push maser "no matching host key type found. Thier offer : ssh-rsa" error

git에서 ssh 접속 시 no matching host key type found. Thier offer : ssh-rsa 에러가 발생한다. 이는 push나 pull 같은 명령어를 쓸 때 해당된다. 이것은 git의 version이 2.3 이상이 되면 ssh에서 rsa 방식을 지원하지 않아 PubkeyAcceptedAlgorithms와 HostKeyAlgorithms 옵션을 직접 지정해줘야 한다. git 폴더 아래 cofig 파일을 열어 옵션을 추가한다. [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true sshCommand = ssh ..

Program Language 2023.11.28

(python) CRM 워드파일 만들기

import mailmerge from mailmerge import MailMerge from datetime import date import pandas as pd template_1 = '고객감사메일.docx' template_2 = '고객감사메일-구매이력.docx' document_1 = MailMerge(template_1) customer_1 = { '등급': 'Gold', '전화번호': '070-XXX-XXXX', '상호': '좋은 신발', '구입총액': '500,000원', '배송한도': '50,000원', '주소': '서울시 종로구 11번지', '날짜': '{:%Y-%m-%d}'.format(date.today()), '할인': '5%', '수신자': '이순신'} document_1.m..

(python) 두 개 엑셀 파일 비교하기

import pandas as pd import xlwings as xw excel1 = '분개장_1.xlsx' excel2 = '분개장_2.xlsx' df_excel1 = pd.read_excel(excel1, 'Sheet1', na_values=['NA']) df_excel2 = pd.read_excel(excel2, 'Sheet1', na_values=['NA']) df_excel1['version'] = 'cur' df_excel2['version'] = 'new' gb_excel1 = df_excel1.groupby(['전표일자', '전표번호']) gb_excel2 = df_excel2.groupby(['전표일자', '전표번호']) df_excel1['전표번호seq'] = gb_excel1.cu..

(python) 코스피 종목 데이터 가져오기

import pandas as pd import numpy as np import FinanceDataReader as fdr import xlwings as xw import os base_dir = os.getcwd() df_code = pd.read_csv('종목코드.csv') df_code = df_code[df_code['검색'] == 1] df_code = df_code.reset_index() print(df_code) date_s = '2021-10-01' date_e = '2022-10-30' tbl_list = [] for i in range(len(df_code)) : # csv로 읽어서 그런지 숫자 첫자리의 0이 계속 삭제되어서 강제로 채웠다. # 종목코드는 6자리니까 강제로 맞췄다..

(python) pandas ix -> iloc

조금 오래된 교재를 보고 따라 하다 보니 .ix 를 사용하는 예제를 작성할 때 코드 자동 생성이 안되길래 기분이 싸~ 했는데... 계속 에러다. 그래서 검색 검색하다 보니 2020년 초에 해당 기능이 deprecated(더 이상 사용하지 않음) 되었다는 걸 알게 되었다. 그래서 .ix 대신에 .iloc을 넣으면 된다. 오래된 교재를 쓰면 역시 이런 문제가 있다. ㅎㅎ iloc은 행번호로 데이터를 가져오고, loc은 라벨 이름으로 가져 온다.

(python) bad operand type for unary +: 'str'

news_html = "" for i in range(len(df_news_final)) : news_html = news_html + "\ " + str(df_news_final.loc[i, '뉴스제목']) + "\ " + str(df_news_final.loc[i, '매체']) + " \ " + str(df_news_final.loc[i, '등록일']) + "" python 3에서 final_sentence="""Pulled """+stock+""".""" print (final_sentence) 이건 동작하지만, final_sentence="""Pulled""" +stock+""".""" print (final_sentence) 는 동작하지 않는다. 아마 operator 정의 문제인 듯하다. 아래와..

(python) 정부 입찰 공고 자료 수집

import selenium # 여기서는 약자를 붙이지 않았다. import pandas as pd from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager import time service = Service(ChromeDriverManager().install()) options = Options() options.add_argument("--start-maximized") driver = webdriver.Ch..

(python) 셀레리움 에러

어제 실습 예제대로 하니까 계속 에러가 발생했다. import selenium # 여기서는 약자를 붙이지 않았다. from selenium import webdriver driver = webdriver.Chrome('chromedriver.exe') 크롬드라이버를 내려받으러 갔지만, 크롬이 워낙 신상이라 최신 버전이 없었다. chromedrivermanger를 이용하면 된다고 해서 이렇게도 해봤다 import selenium # 여기서는 약자를 붙이지 않았다. from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager driver = webdriver.Chrome(ChromeDriverManager().i..

(python) selenium 이용하여 시청률 엑셀로 만들기

import selenium # 여기서는 약자를 붙이지 않았다. from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager import time options = webdriver.ChromeOptions() options.add_argument("--start-maximized") driver = webdriver.Chrome() # 우선 경로나 옵션을 넣으면 동작 하지 않음 (해결 안됨) driver.maximize_window() # 창을 최고 사이즈로 함 driver.get('http://wwww.daum.net') # daum으로 이동 #driver.find .find_element_by_id("q..

(python) pyautogui 기능들

import pyautogui as p # as뒤는 약자다. import time time.sleep(2) #2초간 인터벌을 인위적으로 부여한다. print(p.position()) #현재 x축과 y축의 좌표 print(p.size()) # 메인 모니터의 가로 세로 크기 print(p.onScreen(300, 300)) # 커서가 현재 가로, 세로 크기 안에 들어가는지 확인 # 마우스 이동 # 원하는 좌표로 이동 p.moveTo(300, 300, duration=1) # duration에서 이동시간을 초단위로 설정 # 현재 위치에서 원하는 거리만큼 이동 p.moveRel(500, 500, duration=1) # duration에서 이동시간을 초단위로 설정 # 마우스 drag and drop # 원하는 ..

YUV Format 개념 이해

YUV란? RGB를 이용한 색 표현은 색 그대로를 전부 표현한다. 이는 무척 자세하고 풍부한 색 표현이 가능하지만 그만큼 용량이 커진다는 단점이 있다. 만약 동영상을 RGB를 사용한 데이터로 재생한다면 영상의 용량은 매우 커질 것이고 이는 치명적인 단점으로 돌아올 것이다. 그래서 생긴 포맷이 YUV 포맷이다. 빛의 삼원색을 표현하는 RGB와 달리 빛의 밝기를 나타내는 휘도(Y)와 색상신호 2개(U, V)로 표현하는 방식이다. 일반적인 TV나 비디오카메라에서 많이 사용되는 방식이며, 흑백을 표현하기 위한 흰색, 회색, 검정색을 표현하는 데 사용되는 RGB와 YUV의 값은 다음과 같다. 흑백 TV가 없어진 현재도 YUV 신호를 사용하는 이유는 RGB에 비해 압축률을 크게 향상할 수 있기 때문이다. 흑백만을 ..

회전 행렬 유도

회전행렬(Rotation matrix)은 좌표의 회전이 필요할 때 자주 사용된다. 한 번 유도를 해보면 시계 방향 회전이나 반시계 방향 회전에 대해 이해하는 것도 어렵지 않다. 그래서 그냥 무심코 사용하는 것보다 원리를 이해는 것이 중요하다. (x', y')는 중심 c를 기준으로 r만큼 떨어진(x, y)를 θ만큼 회전시킨 좌표다. 각 좌표는 삼각함수를 이용하여 표현할 수 있다. 같은 방법으로 (x', y')를 나타내면, 가 된다. 이를 삼각함수 합 법칙을 적용하면 가 된다. 여기에 (x, y)를 대입하면 다음과 같다. 이 식을 행렬로 바꾸면 다음과 같이 표현할 수 있다. 반시계 방향으로 회전하려면 각을 빼면 된다.

728x90
반응형