전체 글
-
[직무탐색] Upstream, Downstream 이해 관계자<견고한 데이터 엔지니어링> 2023. 7. 20. 13:56
( 서적을 참고했습니다.) * External Engineer : 소셜 미디어 앱, IoT 장치, 전자 상거래 플랫폼과 같은 외부 애플리케이션의 사용자와 연계하며, 이러한 애플리케이션에서 발생하는 트랜잭션 및 이벤트 데이터를 수집/저장/처리하는 시스템을 설계, 구축, 관리한다. 이러한 데이터 엔지니어가 구축한 시스템에는 애플리케이션에서 데이터 파이프라인으로, 그리고 다시 애플리케이션으로 향하는 피드백 루프가 있다. [External Engineer가 가져야할 문제의식] 1. 외부 대면 쿼리 엔진은 내부 대면 시스템보다 훨씬 더 큰 동시성 부하를 처리하는 경우가 많아. 사용자가 실행할 수 있는 쿼리에 엄격한 제한을 두어 단일 사용자가 인프라에 미치는 영향을 제한해야 한다 2. 보안은 외부 쿼리에서 훨씬 더..
-
웹 크롤러 설계Project 2023. 7. 12. 18:17
웹 크롤러 - 검색 엔진에서 널리쓰는 기술로, 웹에 새로 올라오거나 갱신된 콘텐츠를 찾아내는 것이 주된 목적 - 콘텐츠는 웹 페이지일수도, 이미지나 비디오 또는 PDF 파일일 수도 있다. 1. Search Engine Indexing - 웹 페이지를 모아 검색 엔진을 위한 로컬 인덱스를 만든다 - GoogleBot : 구글 검색 엔진이 사용하는 크롤러 2. Web Archiving - 나중에 사용할 목적으로 장기보관하기 위해 웹에서 정보를 모으는 절차 - 많은 국립 도서관이 크롤러를 돌려 웹사이트를 아카이빙 3. Web Mining - 인터넷에서 유용한 지식을 도출해 낼 수 있는 것 - 유명 금융 기업들은 크롤러를 사용해 주주총회 자료나 연차 보고서를 다운받아 기업의 핵심 사업 방향을 제시 4. Web ..
-
27. 영어 끝말잇기Programmers 2023. 7. 12. 11:19
문제 설명 1부터 n까지 번호가 붙어있는 n명의 사람이 영어 끝말잇기를 하고 있습니다. 영어 끝말잇기는 다음과 같은 규칙으로 진행됩니다. 1번부터 번호 순서대로 한 사람씩 차례대로 단어를 말합니다. 마지막 사람이 단어를 말한 다음에는 다시 1번부터 시작합니다. 앞사람이 말한 단어의 마지막 문자로 시작하는 단어를 말해야 합니다. 이전에 등장했던 단어는 사용할 수 없습니다. 한 글자인 단어는 인정되지 않습니다. 다음은 3명이 끝말잇기를 하는 상황을 나타냅니다. tank → kick → know → wheel → land → dream → mother → robot → tank 위 끝말잇기는 다음과 같이 진행됩니다. 1번 사람이 자신의 첫 번째 차례에 tank를 말합니다. 2번 사람이 자신의 첫 번째 차례에 ..
-
26. 짝지어 제거하기Programmers 2023. 7. 12. 09:24
문제 설명 짝지어 제거하기는, 알파벳 소문자로 이루어진 문자열을 가지고 시작합니다. 먼저 문자열에서 같은 알파벳이 2개 붙어 있는 짝을 찾습니다. 그다음, 그 둘을 제거한 뒤, 앞뒤로 문자열을 이어 붙입니다. 이 과정을 반복해서 문자열을 모두 제거한다면 짝지어 제거하기가 종료됩니다. 문자열 S가 주어졌을 때, 짝지어 제거하기를 성공적으로 수행할 수 있는지 반환하는 함수를 완성해 주세요. 성공적으로 수행할 수 있으면 1을, 아닐 경우 0을 리턴해주면 됩니다. 예를 들어, 문자열 S = baabaa 라면 b aa baa → bb aa → aa → 의 순서로 문자열을 모두 제거할 수 있으므로 1을 반환합니다. 제한사항 문자열의 길이 : 1,000,000이하의 자연수 문자열은 모두 소문자로 이루어져 있습니다. ..
-
25. 카펫Programmers 2023. 7. 11. 16:07
문제 설명 Leo는 카펫을 사러 갔다가 아래 그림과 같이 중앙에는 노란색으로 칠해져 있고 테두리 1줄은 갈색으로 칠해져 있는 격자 모양 카펫을 봤습니다. Leo는 집으로 돌아와서 아까 본 카펫의 노란색과 갈색으로 색칠된 격자의 개수는 기억했지만, 전체 카펫의 크기는 기억하지 못했습니다. Leo가 본 카펫에서 갈색 격자의 수 brown, 노란색 격자의 수 yellow가 매개변수로 주어질 때 카펫의 가로, 세로 크기를 순서대로 배열에 담아 return 하도록 solution 함수를 작성해주세요. 제한사항 갈색 격자의 수 brown은 8 이상 5,000 이하인 자연수입니다. 노란색 격자의 수 yellow는 1 이상 2,000,000 이하인 자연수입니다. 카펫의 가로 길이는 세로 길이와 같거나, 세로 길이보다 ..
-
24. 카드 뭉치Programmers 2023. 7. 11. 14:39
문제 설명 코니는 영어 단어가 적힌 카드 뭉치 두 개를 선물로 받았습니다. 코니는 다음과 같은 규칙으로 카드에 적힌 단어들을 사용해 원하는 순서의 단어 배열을 만들 수 있는지 알고 싶습니다. 원하는 카드 뭉치에서 카드를 순서대로 한 장씩 사용합니다. 한 번 사용한 카드는 다시 사용할 수 없습니다. 카드를 사용하지 않고 다음 카드로 넘어갈 수 없습니다. 기존에 주어진 카드 뭉치의 단어 순서는 바꿀 수 없습니다. 예를 들어 첫 번째 카드 뭉치에 순서대로 ["i", "drink", "water"], 두 번째 카드 뭉치에 순서대로 ["want", "to"]가 적혀있을 때 ["i", "want", "to", "drink", "water"] 순서의 단어 배열을 만들려고 한다면 첫 번째 카드 뭉치에서 "i"를 사용한..
-
[Parsing] Scrapy를 활용하여 웹 스크래핑 하기Project 2023. 7. 9. 00:44
Pyspider를 활용하여 크롤러를 구현해보려고 했으나, 왜 예시가 없나 했더니 코드도 구식이고 지금 시점에서 구현이 어려웠다...(공식문서에 자랑(?)했던 WebUI도 이제 지원하지 않는 듯) 그래서 대체재를 찾던 도중 Scrapy가 눈에 띄어 이것을 활용하여 만들어보기로 한다. +) 6년 전에 마지막으로 깃헙에 커밋된 코드라서, 자잘한 오류만 짚고 넘어가자면 gcd(최대공약수)를 구현하는데 math가 아닌 현재 지원하지 않는 fractions 모듈을 사용한다던가, 무차별적인 six 모듈에서 함수를 가져와 일일이 코드를 고치는 데 애를 먹기도 했고, pickle error가 자주 발생하기도 했다... 또한 인용하거나 따라해볼만한 튜토리얼 같은 문서가 부족하다 Scrapy? https://keyhyuk-..
-
7월 1주차 Error + Unknown 모음.Data Engineer 2023. 7. 8. 16:34
- six 모듈 : Six는 python2 및 3 호환성 라이브러리로, 유틸리티 기능을 제공한다. 두 Python 버전 모두에서 호환되는 Python 코드 작성을 목표로 Python 버전 간의 차이점을 매끄럽게 하기 위해 만들어졌다. Python 2.7 및 3.3 이상을 지원하며, 하나의 Python 파일에만 포함되어 있으므로 프로젝트에 쉽게 복사할 수 있다. https://six.readthedocs.io pyspider를 지금 뜯어보고 있는데 six 모듈은 위 설명과 같이 이전 파이썬 버전의 함수를 사용할 수 있게 해주는 모듈인 것 같다. - Python 상위/하위 폴더에 있는 파일 import 하기 파이썬에는 패키지 import 말고 내가 만든 파일을 불러 올 수 있다. 다음과 같은 문제는 깃헙에 ..