Skip to content

Instantly share code, notes, and snippets.

View Avantgarde95's full-sized avatar
😺
Working

Hunmin Park Avantgarde95

😺
Working
View GitHub Profile
@Avantgarde95
Avantgarde95 / sieve_table.html
Created August 26, 2017 03:26
Simple simulation of the sieve of Eratosthenes in JavaScript
<!DOCTYPE html>
<html>
<head>
<title>Sieve of Eratosthenes</title>
<style type="text/css">
/* Title design */
.title {
text-align: center;
@Avantgarde95
Avantgarde95 / calc.py
Created August 23, 2017 03:16
PLY example - Calculator
import ply.lex as lex
import ply.yacc as yacc
tokens = ['NUMBER']
literals = '()+-*/'
t_ignore = ' \n\t'
def t_error(t):
raise Exception('LexError: %s' % t)
@Avantgarde95
Avantgarde95 / setup.py
Created August 8, 2017 01:19
py2exe example
from distutils.core import setup
import py2exe
import sys
# This enables us to just run "python setup.py".
sys.argv.append('py2exe')
setup(
name='DailyBread',
version='1.4',
@Avantgarde95
Avantgarde95 / bj_2751.py
Last active July 30, 2017 02:09
Translation of bj_2751.c
# My solution of Baekjoon 2751
from sys import stdin, stdout
# for reducing some bytecodes...
read = stdin.readline
write = stdout.write
flush = stdout.flush
limit = 1000000
@Avantgarde95
Avantgarde95 / bj_2751.c
Last active July 30, 2017 01:53
My solution for Baekjoon 2751
/*
* My solution for Baekjoon 2751
* Problem: Sort the list of integers which contains no duplicates.
*/
#include <stdio.h>
#include <stdbool.h>
#define LIMIT 1000000
@Avantgarde95
Avantgarde95 / run_tr.py
Created March 11, 2017 16:31
Traceroute script
import subprocess
import sys
import datetime
list_urls = {
'South Korea': 'ftp.kr.debian.org',
'USA': 'ftp.us.debian.org',
'Mexico': 'ftp.mx.debian.org',
'South Africa': 'debian.mirror.ac.za',
'France': 'debian.mirror.ate.info',
@Avantgarde95
Avantgarde95 / love.c
Created December 19, 2016 11:23
Equation of love
#include <stdio.h>
#include <math.h> // for fabs
#define width_max 60
#define height_max 30
typedef int bool;
bool func(float x, float y) {
// heart equation
@Avantgarde95
Avantgarde95 / MaxHeapTest.java
Created November 26, 2016 10:01
Simple array-based max-heap in Java
public class MaxHeapTest {
private static int[] toHeap(int[] input) {
int size = input.length;
int[] heap = new int[size];
for (int i = 0; i < size; i++) {
// set the element as the last node
heap[i] = input[i];
System.out.printf("- Added %d as the last node.\n", i);
# How to install PyOpenGL :
# "$ python -m pip install PyOpenGL PyOpenGL_accelerate"
import OpenGL.GL as gl
import OpenGL.GLU as glu
import OpenGL.GLUT as glut
from random import randint, uniform, choice
from math import sqrt, sin, cos, tan, pi, ceil
from math import e as e_nat
@Avantgarde95
Avantgarde95 / linkedlist.py
Created October 10, 2016 16:43
Singly linked list
class Node(object):
def __init__(self, data):
self.data = data
self.next = None
# ----------------------------------------------------------
class MyLinkedList(object):
def __init__(self):
self.head = None