전체 글
-
코드트리 사용 후기 #1Algorithm 2024. 3. 2. 23:50
알고리즘 학습 사이트들인 백준, 리트코드, 프로그래머스의 구천을 떠돌아다던 제가 마침내 코드트리에 정착하기로 결심한 경험을 공유하겠습니다. 저는 어려운 문제를 만났을 때 한 문제에 4~5시간씩 매달려서 다른 일을 못 하게 되곤 했습니다. 더 심각한 날은 그 정도의 시간을 투자했는데 결국 문제를 못 푸는 날도 있었습니다. 알고리즘 문제 푸는 날은 알고리즘만 하게 되는 날, 나아가 성과가 아무 것도 없는 최악의 날이 될 수도 있다는 인식이 생겨서 아침부터 굉장한 스트레스를 받곤 했습니다. 그래서 다른 플랫폼으로 옮기면 다시 전의가 불타오르지 않을까 싶은 마음에 애꿎은 학습 플랫폼만 옮겨다녔었습니다. 사실 글또에서 '코드트리 × 글또 블로그 챌린지'를 운영한다고 하셨을 때 플랫폼에 대한 기대는 별로 없었고 '..
-
[Resilience4j] 외부 서비스 호출 로직에 서킷 브레이커 패턴 적용하기Design Pattern 2024. 2. 18. 17:32
들어가며 외부 서비스에 장애가 발생하더라도 연속적인 서비스를 제공하려면 어떻게 해야할까요? 트래픽 폭증 등의 이유로 외부 서비스가 당장 복구되기 어려울 때, 계속해서 외부 서비스에 데이터를 요청한다면 해당 서버에 부하를 가하게 되고 사용자에게도 지속적으로 장애 상황이 전파될 것입니다. 이런 경우, '서킷 브레이커' 패턴을 사용함으로써 외부 서비스 호출 실패가 전체 시스템에 영향을 미치는 것을 방지할 수 있습니다. 그럼 도대체 서킷 브레이커가 무엇인지, 서킷 브레이커가 어떻게 서비스 안정성과 고가용성을 위한 디자인 패턴으로서 기능하는지 살펴보겠습니다. 참고로 저는 재시도(retry)와 서킷 브레이커(circuit breaker)를 조합해서 사용했습니다. 목차1. 서킷 브레이커 패턴이란?(feat. 고가..
-
[9기 글쓰기 세미나 후기] 나만의 작은 글쓰기 공장 운영하기Extracurricular Activites/글또 2024. 2. 5. 13:27
넋두리 블로그를 시작한지 어언 2년.. 글쓰기가 습관으로 자리잡지 않아서 글또를 시작한지는 벌써 1년이 되었다. 두 번째로 참여하는 글또이지만 여전히 글쓰기의 시작은 부담스럽다. 주적은 게으른 완벽주의이다. 이름부터 마음에 안 드는 이 친구가 저항감을 만들어낸다. 그래서 9기 중반이 되었는데 제출한 글이 1개이다.🙄 게으른 것도 맞는데 잘 하고 싶은 마음이 너무 크다. 잘 하고 싶은데 내가 지금 걷고 있는 불편의 다리는 꽤 길다. 정말 길어서 울고 싶다. 난 무엇이 되었든 즐거운 마음으로 하는 게 가장 중요하다고 생각한다. 무언가를 잘 하기 위해서는 많은 시행착오를 겪어야 하고, 시도 자체를 많이 하려면 재미가 있어야 하기 때문이다. 더이상 학생이 아니고 누구도 나에게 학습을 강요하지 않기 때문..
-
[I/O multiplexing] select vs kqueueNetWork 2024. 1. 7. 23:59
I/O multiplexing이 가능한 채팅 프로그램을 고도화한 경험을 공유합니다. I/O multiplexing 구현을 위한 system call을 O(n)의 시간복잡도를 가지는 'select'에서 시간복잡도 O(1)의 'kqueue'로 변경했습니다. 본 포스팅의 목차는 아래와 같습니다. 1. I/O multiplexing 개념 - multiplexing의 정의 - I/O model의 종류 - I/O multiplexing의 종류2. 코드로 확인하는 select vs kqueue3. trouble shooting: 표준입력은 READ_EVENT 이다! 1. I/O multiplexing 개념 본격적으로 select와 kqueue를 비교하기 전, 'I/O multiplexing 채팅 프로그램..
-
백준 # 15736Algorithm 2023. 12. 7. 10:55
https://www.acmicpc.net/problem/15736 15736번: 청기 백기예제 입력 1의 경우 1, 2, 3번 깃발이 존재하고, 3명의 선수가 참가한다. 첫 번째 선수는 1의 배수의 번호를 가진 깃발을 뒤집는다. 초기에 청색이였던 깃발은 첫 번째 선수에 의해 모두 백기로 된www.acmicpc.net 나의 풀이n = int(input())answer = 0flags = [0] * n# n명이 n개의 깃발을 각 순서의 배수만큼 뒤집은 결과 리스트 for i in range(1, n+1): for j in range(1, n+1): if j*i 모범 답안패턴을 발견해보자!n 이하의 가장 큰 제곱수를 구하면 된다 12345678최초 깃발 상태oooooooo1번 학생이 깃발을 뒤집은 ..
-
백준 # 14568Algorithm 2023. 12. 6. 02:06
https://www.acmicpc.net/problem/14568 14568번: 2017 연세대학교 프로그래밍 경시대회 규칙에 맞게 사탕을 분배하는 경우의 수를 출력한다. 택희, 영훈이, 남규가 받은 사탕의 수를 각각 A, B, C개라고 할 때, 서로 다른 (A, B, C) 순서쌍의 수를 세면 된다. 만일 규칙에 맞게 사탕을 분 www.acmicpc.net 시간 초과로 답을 본 후 풀이 n = int(input()) answer = 0 # 세 명에게 n개의 사탕을 나눠주는 모든 경우의 수 for i in range(1, n + 1): for j in range(1, n + 1): for k in range(1, n + 1): # 주어진 조건을 모두 만족시키기 위해 중첩조건문을 사용 if i + j + ..
-
백준 #1816Algorithm 2023. 12. 5. 19:48
https://www.acmicpc.net/problem/1816 1816번: 암호 키 현대 사회에서 통용되고 있는 많은 종류의 암호 시스템에서는, 매우 큰 소수의 곱으로 만들어진 수를 암호 키로 이용하는 경우가 많다. 현실적으로 매우 큰 수를 빠른 시간 내에 소인수분해하는 www.acmicpc.net 나의 풀이 def rtn_primes(num): """ input(비밀번호)에 대한 모든 소인수를 요소로 갖는 리스트 반환 """ primes = [] i = 2 while i == num: if num % i == 0: primes.append(i) i += 1 return primes # 주어진 횟수를 요소의 길이로 갖는 비밀번호 리스트 생성 num = int(input()) password_list ..
-
항해 플러스 후기Extracurricular Activites/항해플러스 2기 2023. 11. 28. 21:05
1) 항해 플러스를 참여하기 전 백그라운드 비전공자이며 22년 1월부터 6월까지 국비교육을 수료하고 22년 7월부터 서버 개발자로 일하고 있습니다. 주로 SNMP라는 프로토콜을 사용해 데이터를 송수신 하는 등 데이터 엔지니어링 업무를 하고 있고 사용하는 언어는 파이썬입니다. 2) 항해 플러스 2기에 합류하기로 결심한 이유 회사에서 테스트 자동화 업무를 맡게 돼서 혼자 공부를 하던 중에 항해를 알게 되었습니다. 제가 관심이 있었던 TDD 뿐만이 아니라 CI/CD나 장애대응, 통합 모니터링 시스템 구축 등 저년차로서 쉽게 접할 수 없었던 주제로 커리큘럼이 구성돼서 항해를 시작하기로 마음먹었습니다. 3) 항해 플러스가 실제로 좋았던 부분팀 프로젝트: 협업에 대해서 배울 수 있을 뿐만 아니라 다양한 의견을..