본문 바로가기

분류 전체보기

(177)
[Two Scoops of Django] 1. Coding Style * 해당 포스트는 'Two Scoops of Django: Best Practices for Django 1.8 Book by Audrey Roy Greenfeld and Daniel Roy Greenfeld'를 공부하며 적은 기록입니다. 오늘 읽은 부분 1. Coding Style 전 하위 목차 기억해야할 부분 1.1 The Importance of Making Your Code Readable variable name을 생략하지 말자: 모두가 해석하기 쉽게 1.2 PEP8 PEP8: official style guide for Python 팁! Flake8(command-line tool for checking coding quality) 한줄에 79-character만 쓰도록 하자 1.3 The W..
[c++] 프로그래머스: 힙(Heap) / 라면공장 문제 설명 라면 공장에서는 하루에 밀가루를 1톤씩 사용합니다. 원래 밀가루를 공급받던 공장의 고장으로 앞으로 k일 이후에야 밀가루를 공급받을 수 있기 때문에 해외 공장에서 밀가루를 수입해야 합니다. 해외 공장에서는 향후 밀가루를 공급할 수 있는 날짜와 수량을 알려주었고, 라면 공장에서는 운송비를 줄이기 위해 최소한의 횟수로 밀가루를 공급받고 싶습니다. 현재 공장에 남아있는 밀가루 수량 stock, 밀가루 공급 일정(dates)과 해당 시점에 공급 가능한 밀가루 수량(supplies), 원래 공장으로부터 공급받을 수 있는 시점 k가 주어질 때, 밀가루가 떨어지지 않고 공장을 운영하기 위해서 최소한 몇 번 해외 공장으로부터 밀가루를 공급받아야 하는지를 return 하도록 solution 함수를 완성하세요. ..
Two Scoops of Django 1.8 원서 / 2020.04.12 공부 시작 Django에 대한 얕은 공부를 끝내고, 좀더 심화된 장고 프로젝트 구축과 코딩 스타일에 대해 공부해보고자 시작! 고민은 너무 깊게 하지 않는다. 고민만 하다간 시작도 하지 못하기 때문이다. 일단 저지르기!
[c++] 프로그래머스: 힙(Heap) / 더 맵게 문제 설명 매운 것을 좋아하는 Leo는 모든 음식의 스코빌 지수를 K 이상으로 만들고 싶습니다. 모든 음식의 스코빌 지수를 K 이상으로 만들기 위해 Leo는 스코빌 지수가 가장 낮은 두 개의 음식을 아래와 같이 특별한 방법으로 섞어 새로운 음식을 만듭니다. 섞은 음식의 스코빌 지수 = 가장 맵지 않은 음식의 스코빌 지수 + (두 번째로 맵지 않은 음식의 스코빌 지수 * 2) Leo는 모든 음식의 스코빌 지수가 K 이상이 될 때까지 반복하여 섞습니다. Leo가 가진 음식의 스코빌 지수를 담은 배열 scoville과 원하는 스코빌 지수 K가 주어질 때, 모든 음식의 스코빌 지수를 K 이상으로 만들기 위해 섞어야 하는 최소 횟수를 return 하도록 solution 함수를 작성해주세요. 제한 사항 scovil..
[Django REST framework] 6. ViewSets & Routers https://www.django-rest-framework.org/tutorial/6-viewsets-and-routers/ 6 - Viewsets and routers - Django REST framework REST framework includes an abstraction for dealing with ViewSets, that allows the developer to concentrate on modeling the state and interactions of the API, and leave the URL construction to be handled automatically, based on common conventions. ViewSet c www.django-rest-frame..
[c++] priority_queue 함수 / 우선순위 큐란? https://en.cppreference.com/w/cpp/container/priority_queue std::priority_queue - cppreference.com template class priority_queue; A priority queue is a container adaptor that provides constant time lookup of the largest (by default) element, at the expense of logarithmic i en.cppreference.com 우선순위 큐(Priority queue)란? 삽입 순서에 상관없..
[Django REST framework] 5. Relationships & Hyperlinked APIs https://www.django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis/ 5 - Relationships and hyperlinked APIs - Django REST framework At the moment relationships within our API are represented by using primary keys. In this part of the tutorial we'll improve the cohesion and discoverability of our API, by instead using hyperlinking for relationships. Right now we have endpoints for..
[Django REST framework] 4. Authentication & Permissions https://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/ 4 - Authentication and permissions - Django REST framework Currently our API doesn't have any restrictions on who can edit or delete code snippets. We'd like to have some more advanced behavior in order to make sure that: Code snippets are always associated with a creator. Only authenticated users may create snipp w..