This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Sieve of Eratosthenes</title> | |
| <style type="text/css"> | |
| /* Title design */ | |
| .title { | |
| text-align: center; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * My solution for Baekjoon 2751 | |
| * Problem: Sort the list of integers which contains no duplicates. | |
| */ | |
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #define LIMIT 1000000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Node(object): | |
| def __init__(self, data): | |
| self.data = data | |
| self.next = None | |
| # ---------------------------------------------------------- | |
| class MyLinkedList(object): | |
| def __init__(self): | |
| self.head = None |