목록분류 전체보기 (107)
정글에서 온 개발자
첫번째 시도 최소힙, 최대힙 두개를 운용하고, size만 조절해 D연산시 size 이상으로 pop을 못하게 하면 되지 않을까? import heapq T=int(input()) for _ in range(T): k = int(input()) sQ = [] lQ = [] size=0 for _ in range(k): cmd, num = input().strip().split() num = int(num) if(cmd=="I"): heapq.heappush(sQ,num) heapq.heappush(lQ,-num) size+=1 if(size>0 and cmd=="D"): size-=1 if(num==1): heapq.heappop(lQ) elif(num==-1): heapq.heappop(sQ) if(siz..
Two Sum LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제의 핵심 합이 특정 값이 되는 두 수를 O(n)에 찾을 수 있는지? O(n^2) class Solution(object): def twoSum(self, nums, target): length = len(nums) fin=False for i in range(0,length): for j in ..
개요 JDBC(Java Database Connectivity) - 1990 중반. 자바 프로그래밍 언어의 일부 JdbcTemplate - 2000년 초. Spring Framework의 일부. Spring과 함께 등장 JPA(Java Persistence API) - 2000년대 중반. 자바 EE 표준. ORM(Object-Relational Mapping)을 위한 API 제공. Hibernate는 JPA의 구현체 Spring Data JPA - 2010년 초. Spring Data 프로젝트의 일부. JPA를 더 쉽게 사용 리포지토리 계층 쉽게 구현하는 추상화 제공 Spring Data JDBC - 2010년 후반. Spring Data JDBC. JPA의 복잡성을 줄이고자 등장. 도메인 중심 설계 촉..
디렉토리 구성 model ArticleEntity.java dto ArticleDTO.java ReponseDTO.java repository ArticleRepository.java (interface) service ArticleService.java controller ArticleController.java 코드 Entity(Model) 테이블 스키마 그 자체 @Builder @NoArgsConstructor @AllArgsConstructor @Data @Entity @Table(name = "Article") public class ArticleEntity { @Id @GeneratedValue(generator="system-uuid") @GenericGenerator(name="system..
서블릿 엔진 → @RestController 개발자는 Javax.servlet.http.HttpServlet을 상속받는 서브 클래스를 작성해야 한다. 서블릿 컨테이너는 서블릿 서브 클래스를 실행시킨다. @RestController 에는 이 서블릿 서브 클래스가 이미 구현되어있다. MVC 흐름 contoller → model (service → repository) 데이터처리 데이터 → service → controller → view M(odel) @Service - Model에서 비즈니스 로직을 담당함 @Repository - 서비스에서 호출되어 실제 데이터베이스와 연결, 데이터 조회, 저장 작업을 수행함 .findbyId 등 이용 가능extends JpaRepository 로 JPA 이용 @Query..

https://spring.io/quickstart/ Spring | Quickstart Spring Quickstart Guide What you'll build You will build a classic “Hello World!” endpoint which any browser can connect to. You can even tell it your name, and it will respond in a more friendly way. Step 1: Start a new Spring Boot project Use start.s spring.io 강의를 보기 전에 공식문서 보고도 혼자 할 수 있지 않을까 해본 spring quick start. spring 말고 spring boot부터 해야하나?..

배경 void supplemental_page_table_kill (struct supplemental_page_table *spt); Frees all the resources that were held by a supplemental page table. This function is called when a process exits (process_exit() in userprog/process.c). You need to iterate through the page entries and call destroy(page) for the pages in the table. You do not need to worry about the actual page table (pml4) and the phys..

해결하려는 문제#ifdef VM 블럭 아래에서 코딩을 해야 하는데, 해당 코드가 음영처리 된다.아래와 같이 정의되어 있는 속성을 써도 빨간줄도 뜬다.#ifdef VM 안에서 정의된 함수들은 자동 완성이 안된다.문제의 원인Makefile가 돌아갈때는 알아서 설정되는 define 값들이 자동으로 설정된다.Makefile을 돌리기 전 코딩하는 상황에서는 VM이 define되지 않았기 때문에 아래와 같은 문제가 생긴다.접근그럼 VM을 define해주면 되지 않을까?가장 먼저 생각나는 방법은 파일에 직접 #define VM을 해주는 방법이다. 실제로 잘 작동한다.하지만 이 방법은 코드 자체를 조정하는 방법으로, VM을 끄고 싶을 때 해당 코드로 가서 일일히 꺼야 하는 단점이 있다.#define VM이 정의된 파일..

기존 mmap 코드 void * do_mmap (void *addr, size_t length, int writable, int fd, off_t ofs) { //에러 처리 void *va = pg_round_down(addr); if(length == 0 || addr == 0 || va != addr || fd == 0 || fd == 1){ return NULL; } struct file *file = thread_current()->fdt[fd]; //이 부분 off_t read_bytes = file_length(file); if(read_bytes 0) { /* Do calculate how to fill this page. * We will read PAGE_READ_BYTES bytes f..

에러 Anonymous, Stack growth를 통과했는데, page-linear를 돌리면 에러가 났다. 0x00000080042095f3: intr_handler (threads/interrupt.c:352) 0x0000008004209a11: intr_entry (threads/intr-stubs.o:?) 0x000000800421ad55: hash_clear (lib/kernel/hash.c:58) 0x0000008004221cb9: supplemental_page_table_kill (vm/vm.c:332) 0x000000800421c70c: process_cleanup (userprog/process.c:378) 0x000000800421c6a8: process_exit (userprog/pr..