Giter Club home page Giter Club logo

boj-offline-judge's Introduction

Education

  • 2017 보정고등학교 졸업
  • 2018 동국대학교(경주캠퍼스) 전자정보통신공학 입학
  • 2018 동국대학교(경주캠퍼스) EICE Lab. 소속 학부연구생
  • 2023 상명대학교 지능IOT융합전공 편입학
  • 2023 멋쟁이사자처럼Univ. 11기 백엔드(Django) 입부

Certification

  • 2023 "SAMSUNG ELECTRONICS 상시 SW 역량테스트" Level B 취득 (SWEA Username: Hepheir)

대외 활동

(연도) 활동명 소개 참여 기술
(2016) MMC Ticketing Service 고교 연극동아리의 티켓팅 서비스 Web FE+BE php node.js
(2017) Self Cloud Server 셀프 호스팅을 위한 웹 드라이브 Web FE+BE+Design node.js
(2019) 제17회 임베디드SW 경진대회 [지능형 휴머노이드]부문 본선진출1 Computer Vision python opencv #Threading #Serial
(2020) 문화센터 다모여, 문다 Moonda.kr 의 관리자 페이지 개발 Web FE react.js
(2021) BOJ Offline Judge 오프라인 Problem Solving 채점기 BE python
(2022) Jekyll N Hyde Jekyll 사용자를 위한 Visual Studio Code 확장 프로그램 BE typescript visual-studio-code github-pages
(2023) SMU Calender 상명대학교 학생을 위한 구독캘린더 BE python

연구 활동

참여 과제

(과제고유번호) 과제명 과제수행기관 참여기간
(1425132456) 3D 스캔 기반 유물 도면화 S/W 캐럿펀트 2019-01-01 ~ 2019-11-30
(1711116255) (지능정보-3세부) 사용자의 의도와 맥락을 이해하는 지능형 인터랙션 기술 연구개발 경북대학교산학협력단 2020-03-01 ~ 2020-12-31

참여 논문

  • 고배 유물 도면 자동 생성 모델의 투창 영역 윤곽선 검출 개선 2019, riss.kr
  • 유물 도면 생성 자동화 영상처리 S/W 개발 2019, riss.kr

Hepheir's GitHub Stats hepheir's solved.ac stats

Footnotes

  1. 팀명: 공돌이들 / 동국대학교

boj-offline-judge's People

Contributors

grapediget avatar hepheir avatar seogi98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

grapediget

boj-offline-judge's Issues

모듈 정체성 명확하게 하기

개요

그 동안 이 모듈은 boj라는 이름과는 달리, Baekjoon Online Judge 관련 기능을 중점적으로 다루지 않았습니다.

명확하지 않던 정체성을 확실하게 할 필요가 있다고 느꼈고, 이에 따라 다음과 같이 모듈 구조를 수정할 것을 제안합니다.

제안 모듈 구조

boj
├─ python
|  ├─ core
│  │  ├─ problem.py // 문제 데이터를 다루는 인터페이스 정의
│  │  └─ web.py     // 정보 수집 관련 작업
│  │
│  └─ judge.py      // 가채점기 관련 모듈
│
├─ __init__.py
└─ __main__.py

boj.python.core.web

web.py에서는 웹으로 부터 데이터를 받아오고 처리하기 위한 인터페이스를 제공합니다.

받아온 HTML 문서를 파싱하고 다룹니다.

interface Crawler

interface Crawler {
	str get(String url);
}

Methods

get()

url로 부터 HTML문서를 불러옵니다.

REST api의 'GET' 메소드를 사용하며, 받아온 HTML은 문자열의 형태로 반환됩니다.

Args:

url: HTML문서를 불러올 url 주소입니다.

Returns:

HTML문서를 반환합니다.

interface HTMLElement

interface HTMLElement {
	attribute str inner_HTML;
	str to_markdown();
}

Properties

inner_HTML

해당 HTML 요소 안의 내용입니다.

Methods

to_markdown()

해당 요소의 내용을 마크다운으로 변환하여 반환합니다.

Returns:

마크다운 문법으로 변환된 문서를 반환합니다.

boj.python.core.problem

problem.py에서는 문제에 데이터를 다루기 위한 인터페이스를 제공합니다.

interface Document

interface Document {
	str title;
	HTMLElement desc;
	HTMLElement input;
	HTMLElement output;
	HTMLElement hint;
}

Document는 문제 설명에 대해 다루기 위한 가장 기본 단위입니다.

https://www.acmicpc.net/problem/:number에 표시되는 대부분의 정보는 Document를 통해 다루어집니다.

Properties

title

문제의 제목입니다.

desc

문제의 설명입니다.

input

문제의 입력에 대한 설명입니다.

output

문제의 출력에 대한 설명입니다.

hint

문제에 대한 힌트입니다.

interface Rule

문제 풀이 규칙에 관련된 인터페이스입니다.

interface Rule {
	// Definition Group
		
	SPECIAL_JUDGE = 2;

	attribute int method;

}

interface Problem

interface Problem {
	readonly attribute int number;
	readonly attribute Document document;
	attribute Rule rule;

	None save(str path);
	None load(str path);
	None 
}

Properties

Methods

``
Args:
Returns:
Raises:

`Problem.load()`를 구현해야 합니다

개요

boj.python.core.problem 에 있는 Problem.load() 메소드를 구현해야 합니다.

구현 시 검증 방법

단위 테스트 코드는 미리 준비해 둔 것이 있으니, boj/python/core/problem_test.py를 사용하면 될 것으로 예상합니다.

메소드 설명

load() 메소드는 받는 인자에 따라서 서로 다른 두 가지 작업을 합니다.

  • path가 문자열로 주어진 경우, 주어진 경로로 부터 문제 정보를 읽어들입니다. 불러온 정보를 토대로 Problem 객체 자기자신의 각 property(number, title, document, rule)을 채웁니다. 경로가 올바르지 않거나 내부 파일이 손상, 혹은 사용불가능한 경우 FileNotFoundError 를 발생시킵니다.

  • 아무 인자도 주어지지 않은 경우, 문제의 번호를 토대로 백준 온라인 저지으로 부터 문제 정보를 읽어들입니다. 불러온 정보를 토대로 Problem 객체 자기자신의 각 property를 채웁니다. 문제의 번호가 올바르지 않거나 사용 불가능할 때, AssertionError를 발생시킵니다.

https://github.com/Hepheir/BOJ-Offline-Judge/blob/486a35f2fc58af351f12fcb281ed6c631d978f86/boj/python/core/problem.py#L9-L28

자세한 내용은 이 곳에 업데이트 될 예정입니다.

구현 시 유의할 점

  • 본 메소드는 사실상 오버로드 되는 함수입니다. 인자의 종류에 맞추어 동적으로 docstring을 제공하기 위해 typing 모듈의 @overload 데코레이터를 사용합니다. docstring을 표시하기 위해 @overload 데코레이터로 묶인 메소드들은 별도로 내부 동작 구현이 필요하지 않습니다.

  • 본 메소드는 Template method pattern을 사용합니다. 인자에 따라서 다른 보조 함수에 접근한다는 점에 유의하며, 데이터를 불러오는 방법에 따라 각각 _load_from_local()_load_from_web() 메소드를 참조합니다. 두 보조 함수 구현을 중점적으로 하면 될 것 같습니다.

https://github.com/Hepheir/BOJ-Offline-Judge/blob/d3de9cc89c8f65ccabcec470aedba4e28a8dee32/boj/python/core/problem.py#L37-L86

필수 모듈이 함께 설치되지 않습니다

대표적인 dependancy로 bs4와 requests가 있는데,
boj 모듈 설치시 이들이 함께 설치되지 않아
수동으로 설치해야하는 번거로움이 있습니다.

해결해주세요

Python.exe의 올바른 경로

각자의 스타일, 설치환경 등에 따라 어떤 사람은 python3 명령어로 콘솔에서 파이썬을 사용할 수 있는가 하면, 그렇지 않은 사람도 있다.

특히 python3는 본인이 따로 설정해놓지 않으면 해당 명령어로 파이썬 실행이 불가능한 경우가 있지만, python 명령어는 환경변수의 우선순위 정도에 따라 다른 버젼의 파이썬이 선택될 수는 있어도, 왠만해서는 파이썬 프로그램 실행이 어렵지 않다.

따라서, python3 보다는 python이 더 올바른 파이썬 프로그램의 호출 방법인 것 같다.
또한 C, C++의 컴파일러 경로를 지정해주듯 파이썬 프로그램의 경로를 지정해주는 옵션 및 파이썬 프로그램 실행이 불가능할 때 친절한 에러메세지 출력도 필요해보인다.

패키지 구조 재설계

개요

패키지 구조를 재설계할 필요성이 있습니다.

기존 구조

기존 패키지 구조 설계는 다음과 같았습니다.

boj
├─ python
|  ├─ core
│  │  ├─ problem.py // 문제 데이터를 다루는 인터페이스 정의
│  │  │  ├─ Rule        // 문제의 채점 규칙 등을 저장
│  │  │  ├─ Document    // 문제의 설명 등을 저장
│  │  │  └─ Problem     // 문제에 대한 전반적인 정보를 저장
│  │  └─ web.py     // 정보 수집 관련 작업
│  │     ├─ HTMLElement // 파싱한 HTML에서 각 요소를 다루기 위한 객체
│  │     └─ Crawler     // 웹 크롤러
│  │
│  └─ judge.py      // 가채점기 관련 모듈
│
├─ __init__.py
└─ __main__.py

image

image

README 파일 보강

배지를 달거나, 향후 지원 계획 등 README 파일을 좀 정리해주세요

로컬 환경에 문제 정보를 저장하는 방식

어떤 방식으로 저장해야 할까요

우선 각 문제마다 담고 있는 정보는 다음과 같습니다.

  • 문제 번호

  • 설명

    • 제목
    • 문제 내용 설명
    • 입력 방법 설명
    • 출력 방법 설명
  • 채점 데이터

    • *예제 입력들
    • *예제 출력들
  • 채점 규칙

    • 채점 방식
    • 시간 제한 (초)
    • 메모리 제한 (MB)

`Document.title`에서 `Problem.title`로 변경

아무래도 Document 클래스는 HTMLElement 노드로만 묶어두는 것이 좋을 것 같습니다.

단순 문자열로 이루어진 'title' 속성은 Problem으로 편입시키겠습니다.

Cannot open workspace in Docker Container

개요

도커의 컨테이너로 본 레포지토리를 열 수 없었다.

에러 코드

OR: Could not open requirements file: [Errno 2] No such file or dir
 => => # ectory: 'requirements.txt'
[+] Building 1.4s (6/6)
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/p  0.5s
 => [1/3] FROM mcr.microsoft.com/vscode/devcontainers/python:0-3@sha256:5  0.0s
 => CACHED [2/3] RUN if [ "false" = "true" ]; then su vscode -c "umask 00  0.0s
 => ERROR [3/3] RUN pip3 install -r requirements.txt                       0.8s


[+] Building 1.4s (6/6) FINISHED
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 32B                                        0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/p  0.5s
 => [1/3] FROM mcr.microsoft.com/vscode/devcontainers/python:0-3@sha256:5  0.0s
 => CACHED [2/3] RUN if [ "false" = "true" ]; then su vscode -c "umask 00  0.0s
 => ERROR [3/3] RUN pip3 install -r requirements.txt                       0.8s
------
 > [3/3] RUN pip3 install -r requirements.txt:
#5 0.559 ERROR: Could not open requirements file: [Errno 2] No such file or dire
ctory: 'requirements.txt'
------
executor failed running [/bin/sh -c pip3 install -r requirements.txt]: exit code
: 1
[3379 ms] Command failed: docker build -f workspace\.devcontainer\Dockerfile -t vsc-boj-offline-judge-1cba33b4509df1e2f200f39024ca55ff --build-arg VARIANT=3 --build-arg INSTALL_NODE=false --build-arg NODE_VERSION=lts/* workspace

분석

https://github.com/Hepheir/BOJ-Offline-Judge/blob/96e084beb2e7d26b39538caadbc3a951b3f897bd/.devcontainer/Dockerfile#L24

아마도 이 부분으로 인해 발생하는 오류 같다.

배포 전 확인 해야 할 것

README.md

  • 업데이트 로그 추가
  • 잘못된 정보가 없는지 / 변경 사항이 문서에 올바르게 적용되어 있는지 검토

boj.config

  • 버전 정보 갱신
  • 이전 버전과의 호환성 확인

Please support C

I'm C developer.
But your module doesn't support C.
I'm waiting your positive reaction.
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.