728x90

C:\Users\<사용자명>\AppData\Local\Android\Sdk/emulator/emulator @<AVD 명>

728x90
728x90
sio = SocketIO(app, cors_allowed_origins="*")
728x90
728x90

https://jqueryui.com/tooltip/

728x90
728x90
출처 : https://meyerweb.com/eric/tools/css/reset/

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
728x90
728x90
-webkit-app-region: drag;

 

728x90
728x90
pd.set_option('display.max_columns', None) 
728x90
728x90

np.fft.fft( ) 함수로 푸리에 변환

728x90
728x90

대한민국 좌표 데이터 topojson


순서

  1. 대한민국의 좌표 데이터 확보
  2. geojson 내보내기
  3. Topojson 포맷으로 변경

 

1. 좌표 데이터 확보

2. geojson 변환

  • 프로그램 실행 후 json 파일 로드

  • 로드 된 데이터 오른쪽 마우스 클릭 → Export → 객체를 다른이름으로 저장

  • 포맷 : geojson 선택
  • 파일이름 또는 경로 입력

3. topojson 변환

  • 변환된 geojson 파일 import

  • 해당 데이터 → topojson export

728x90

'이것저것 코드' 카테고리의 다른 글

[Jquery UI] Tooltips  (0) 2022.12.14
[css] reset css  (0) 2022.10.13
[electron] move css  (0) 2022.10.13
728x90

Decorator Example Code

Overview

  • 백엔드 서버에서 특정 URL 에 접속을 할 때 잘못된 경로 접속 또는 로그인 유무, Not Found Page 등 중간에서 처리를 해야할 경우가 있다. 이때 파이썬에서 제공하는 Deacorator를 사용하여 구현할 수 있으며, 간단한 코드로 정리를 했다.

참고 사이트 : Flask Dacorator

Login Require Decorator

def login_required(f):
    @wraps(f)
    def decorated_function(*args, **kwargs):
        if session.get('유저 아이디', None) is None:
            return redirect(url_for('리다이렉트 URL 또는 라우팅 함수 이름'))
        return f(*args, **kwargs)
    return decorated_function
  1. 데코레이터로 쓰일 함수를 정의한다. login_required 라는 함수를 정의하고 매개변수로는 데코레이터가 쓰이는 함수를 받아 준다.
  2. login_required 함수는 매개변수로 받은 함수f를 실행하기 전에 처리하는 함수 decorated_function을 정의하고 이 함수는 , 함수 freturn 한다.
  3. 마지막으로 login_requireddecorated_functionreturn 한다.

- 파이썬에서 쓰이는 데이코레터 형식은 흔히들 함수 실행 시간을 측정하거나, Numba와 같이 병렬처리 패키지를 사용하는 곳에도 많이 쓰인다. 예제와 같이 Function 또는 Class로 정의해서 사용할 수 있다.

728x90

+ Recent posts