This file contains 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
# -*- coding: utf-8 -*- | |
import re | |
o = re.compile(r'<TD><A HREF="page[0-9]+\.html"\s*?style="text-decoration:none"\s?>([0-9]+?)</a></TD>\W*?<TD><A HREF="page[0-9]+?\.html"\s*?style="text-decoration:none">(.*?)\s</a></TD>\W*?<TD><A HREF="page[0-9]+?\.html"\s?style="text-decoration:none">([\W\w]*?)</TD>', re.I) | |
dat = u''' | |
<TR> | |
<TD><A HREF="page1.html" style="text-decoration:none">001</a></TD> | |
<TD><A HREF="page1.html" style="text-decoration:none">秋の田の かりほの庵の 苫をあらみ わが衣手は 露にぬれつつ |
This file contains 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 math import * | |
import struct | |
import pyaudio | |
from multiprocessing import Process, Pipe | |
import threading | |
import sys, pygame | |
start = 0 |
This file contains 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
''' | |
Pass | |
Reborn | |
Self-kill | |
''' | |
from math import ceil | |
def expand(n): | |
a = n/1000 |
This file contains 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
(use srfi-1) | |
(use srfi-42) | |
(use math.mt-random) | |
(define *screen-width* 500) | |
(define *screen-height* 500) | |
(define *field-width* 100) | |
(define *field-height* 100) | |
(define field |
This file contains 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
(use srfi-13) | |
(define (token type data) | |
(cons type data)) | |
(define (normalize source) | |
(let loop ([acc ()] | |
[dat (string-split source #\newline)]) | |
(cond [(null? dat) | |
(string-join (reverse acc) #\newline)] |
This file contains 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
;;; Syntax Rules (in BNF) | |
;;; | |
;;; <program> ::= <main> | <definition> <program> | |
;;; <main> ::= <statement> <eof> | <statement> <main> | |
;;; <statement> ::= 's' | 'r' | 'l' | <call> | <parameter> | |
;;; | |
;;; <call> ::= <procname> | <procname> '(' <arguments> ')' | |
;;; <arguments> ::= <argument> | <argument> ',' <arguments> | |
;;; <argument> ::= <expression> | <body> | |
;;; <body> ::= <statement> <body> | '' |
This file contains 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
package sprite; | |
import java.util.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
public class Event { | |
private static Queue<AWTEvent> queue = new LinkedList<AWTEvent>(); | |
public static AWTEvent peek() { | |
return queue.peek(); |
This file contains 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 java.awt.GraphicsEnvironment; | |
import java.awt.GraphicsDevice; | |
import java.awt.DisplayMode; | |
import java.awt.GraphicsConfiguration; | |
import java.awt.GradientPaint; | |
import java.awt.Graphics; | |
import java.awt.Graphics2D; | |
import java.awt.Color; | |
import java.awt.Image; | |
import java.awt.Font; |
This file contains 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
(use 'clojure.contrib.combinatorics) | |
(def seeds [7 7 7 9 11 11]) | |
(def result 218/100) | |
(def inject-pos | |
(memoize |
This file contains 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
(use 'clojure.contrib.combinatorics) | |
(def seeds [7 7 7 9 11 11]) | |
(def answer 218/100) | |
(defn drop-nth [n coll] | |
(concat (take n coll) | |
(drop (inc n) coll))) |
OlderNewer