Home
Deercode
Cancel

[python] Learn Basic Template Codes for DFS/BFS in Python

Graph Traversal When it comes to graph traversal, there are commonly used techniques: Depth-First Search (DFS) and Breadth-First Search (BFS). DFS is generally more widely used than BFS, and it’s a...

Effective Python 파이썬 코딩의 기술 요약 정리 (Chapter 3. 함수)

19. 함수가 여러 값을 반환하는 경우에는 절대로 네 값 이상을 언패킹하지 말라 이건 그냥 함수 리턴 값을 아래와 같이 많이 쓰지 말라는 얘기. min, max, avg, med, count = get_stats(lengths) 개발자가 헷갈릴 가능성이 크다. 이건 너무 당연한거라 패쓰. 20. None을 반환하기 보다는 예외를 발생시켜라 ...

Effective Python 파이썬 코딩의 기술 요약 정리 (Chapter 2. 리스트와 딕셔너리)

11. 시퀀스를 슬라이싱하는 방법을 익혀라 슬라이싱이란 시퀀스를 여러 조각으로 나누는 방법이다. 슬라이싱은 최소한의 노력으로 시퀀스에 들어있는 아이템의 부분집합에 접근할 수 있게 해준다. 슬라이싱의 기본 형태는 리스트[시작:끝]이다. 시작인덱스는 포함되지만, 끝 인덱스는 포함되지 않는다. a = [1, 2, 3, 4, 5] print(a[3:5]...

Effective Python 파이썬 코딩의 기술 요약 정리 (Chapter 1. 파이썬 답게 생각하기)

Ch1. 파이썬 답게 생각하기 가장 파이썬다운(pythonic) 프로그래밍 방법이란 무엇일까? 1. 사용중인 파이썬의 버전을 알자 현재 사용중인 파이썬 버전을 정확히 알고 싶으면 –version 플래그를 통해 알 수 있다. 참고로 파이썬 2 버전대는 더이상 지원하지 않으니, 더이상 사용하지 말라. python --version Python 2....

Resolution of 'Unable to reach server' issue in GraphQL Studio due to local server connection

Problem Situation I encountered an issue while setting up a GraphQL environment where GraphQL Studio kept redirecting to an external server. It consistently redirected to https://studio.apollogr...

Linux Memory Performance Monitoring (Using free, ps)

Linux Memory Performance Monitoring While I’ve been using Linux frequently, understanding the performance of Linux itself has always been challenging and confusing. When operating a server on Linu...

Linux Disk Performance Monitoring (Using df, du, iostat, pidstat)

Linux Disk Performance Monitoring While I’ve used Linux frequently, understanding the performance of Linux itself has always been challenging and confusing. When operating servers on Linux, I ofte...

[Leet Code풀이] 201. Bitwise AND of Numbers Range

문제 설명 https://leetcode.com/problems/bitwise-and-of-numbers-range 만약 주어진 입력이 아래와 같은 경우 5 7 5부터 7까지 bitwise AND 연산을 해서 나온 결과를 리턴하는 문제다. 즉 5 (0101)와 6(0110)을 Bitwise AND 연산을 하면 0100이 나온다. 0100에 7...

[Elasticsearch] Precautions when executing enrich policy

Purpose of Using Enrich In SQL, you can use Join to combine different tables and retrieve information from two tables at once. However, Elasticsearch does not support Join between multiple indexes...

[Leet Code풀이] 5. Longest Palindromic Substring

문제 설명 https://leetcode.com/problems/longest-palindromic-substring palindrom 이란 abc, aabaa, 우영우(?) 처럼 앞에서 읽으나 뒤에서 부터 읽으나 똑같은 문자열을 말한다. panlindrom을 찾으려니 세가지 케이스가 나왔다. Palindrom 찾기 Case 1. 중심 문자...