Skip to content

Instantly share code, notes, and snippets.

View seungwonpark's full-sized avatar

Seung-won Park seungwonpark

View GitHub Profile
@seungwonpark
seungwonpark / square-wave.tex
Created June 6, 2017 16:18
Fourier Series of Square Wave
% Fourier Series of Square Wave - illustrated and computed by TeX.
% Author : Seungwon Park (swpark.me)
% convert -delay 10 -loop 0 -density 400 -alpha remove square-wave.pdf square-wave.gif
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{amsmath,amssymb}
\usepackage{centernot}
\begin{document}
\foreach \angle in {0,4,...,360}{
@seungwonpark
seungwonpark / haafor-calculator.py
Created June 24, 2017 13:47
HAAFOR Challenge calculator
import numpy as np
# grouping = [[0,3],[1,2]]
# filename = 'hfc_20170614_example.csv'
# grouping = [[x for x in range(200*y, 200*(y+1))] for y in range(10)]
with open('random.csv', 'a') as f2:
while(1):
grouping_rand = np.random.permutation(2000)
@seungwonpark
seungwonpark / joi-style.tex
Created July 6, 2017 12:19
JOI style profile picture
% !TeX program = lualatex
\RequirePackage{luatex85}
\documentclass{standalone}
\usepackage{tikz}
\usepackage{luacode}
\usepackage{graphicx}
\definecolor{joired}{RGB}{218,11,49}
\definecolor{joigreen}{RGB}{18,136,104}
\definecolor{joiyellow}{RGB}{250,210,49}
\definecolor{joiblue}{RGB}{15,105,180}
@seungwonpark
seungwonpark / cf-hint-hider.js
Created August 23, 2017 13:44
CF Hint Hider
// ==UserScript==
// @name CF Hint Hider
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hide algorithm hint at Codeforces
// @author Seungwon Park (veydpz)
// @match http://codeforces.com/problemset
// @grant none
// ==/UserScript==
@seungwonpark
seungwonpark / imyeoni.tex
Last active October 26, 2017 08:12
이면이면이면이면이면이면
% Author : Seungwon Park (swpark.me)
% convert -delay 2 -loop 0 -density 1000 -alpha remove imyeoni.pdf imyeoni.gif
% emoji: convert -delay 2 -loop 0 -density 120 -alpha remove imyeoni.pdf imyeoni.gif
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usepackage{amsmath,amssymb}
\usepackage{kotex}
\begin{document}
\foreach \ani in {0,3,...,57}{
\begin{tikzpicture}
@seungwonpark
seungwonpark / taegeukgi.tex
Created November 12, 2017 09:36
TikZ로 그린 태극기
% taegeukgi.tex
% Taeguekgi(태극기)
% Author: Seungwon Park (swpark.me)
% Date: 2017.11.12
% 국기 그리는 법은 아래의 행정안전부 지침을 따랐습니다.
% http://www.mois.go.kr/frt/sub/a06/b08/nationalIcon_2_2/screen.do
\documentclass{standalone}
\usepackage{tikz}
% CIE color space is replaced with RGB, using colorpicker.
\definecolor{taegeuk-red}{RGB}{199, 32, 50}
@seungwonpark
seungwonpark / protractor.tex
Created November 12, 2017 16:07
TikZ - protractor drawing
\documentclass{standalone}
\usepackage{tikz}
\usepackage{ifthen}
\usepackage{intcalc}
\begin{document}
\begin{tikzpicture}
\draw (6,0) arc [radius=6, start angle=0, end angle=180] -- (-6,-0.5) -- (6,-0.5) -- cycle;
\foreach \i in {0,10,...,180}{
\draw[red] (\i:5.2) -- (\i:6);
\node[red, rotate=-90+\i] at (\i:5) {\i};
@seungwonpark
seungwonpark / pss-crawler.py
Last active September 8, 2018 06:27
효자동사진관 사진 크롤러
# open.pss.go.kr image crawler
# n=150: 2017-12-28, Conversation with future scientists
import requests
import re
import os
baseurl = 'http://open.pss.go.kr'
for n in range(151):
# n = 150
req = requests.get(baseurl + '/picture/view/?no=%d' % n)
@seungwonpark
seungwonpark / toroid-v2.tex
Last active February 2, 2018 12:09
Drawing toroid with TikZ using perspective projection
\documentclass{standalone}
\usepackage{tikz}
\def\camtheta{60}
\def\camphi{70}
%\def\p{((3+cos(16*\t))*cos(\t))}
%\def\q{((3+cos(16*\t))*sin(\t))}
%\def\r{sin(16*\t)}
%\def\w{\p*sin(\camtheta)*cos(\camphi) + \q*sin(\camtheta)*sin(\camphi) + \r*cos(\camtheta)}
\def\rot{32} % # of toroid revolution.
\def\dist{20} % distance of camera and origin
@seungwonpark
seungwonpark / cube-animate.tex
Last active February 2, 2018 17:02
Drawing cube with TikZ using perspective projection
% convert -delay 2 -loop 0 -density 1000 -alpha remove cube.pdf cube.gif
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usepackage{pgffor}
\usetikzlibrary{calc}
\def\sintheta{0.8660254037844386}
\def\costheta{0.5}
\def\sinphi{0.9396926207859083}
\def\cosphi{0.3420201433256688}
\def\cube{1}