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 re | |
import urllib | |
import string | |
import cgi | |
import hashlib | |
word_split_re = re.compile(r'(\s+)') | |
LEADING_PUNCTUATION = ['(', '<', '<'] | |
TRAILING_PUNCTUATION = ['.', ',', ')', '>', '\n', '>'] |
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 events; | |
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.event.ContainerEvent; | |
import java.awt.event.ContainerListener; | |
/** |
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 javax.swing.*; | |
import javax.swing.event.DocumentEvent; | |
import javax.swing.event.DocumentListener; | |
import java.awt.*; | |
import java.awt.font.FontRenderContext; | |
import java.awt.font.LineBreakMeasurer; | |
import java.awt.font.TextAttribute; | |
import java.awt.font.TextLayout; | |
import java.awt.geom.AffineTransform; | |
import java.text.AttributedString; |
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 gc | |
import weakref | |
_destroyed = False | |
_superDestroyed = False | |
class MyClass(object): | |
'''A simple class that sets a global variable when it is destroyed. | |
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
# Terrain generation based on noise. | |
# The terrain is a simple line grid. | |
# Noise generation using Casey Duncan's noise library: | |
# http://pypi.python.org/pypi/noise/1.0b1 | |
# Use WASD to move through the scene | |
# Use Q and E to move up/down | |
# Use the mouse to look in the view | |
# Use the arrow keys to offset the noise grid |
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
; This example shows how to write a bitmap image using Clojure | |
; Import the necessary classes. | |
(import 'java.awt.image.BufferedImage 'javax.imageio.ImageIO 'java.awt.Color 'java.io.File) | |
; Create a new image with a 100x100 size. The image is going to have four color channels. | |
(def img (BufferedImage. 100 100 BufferedImage/TYPE_INT_ARGB)) | |
; Draw on the image by getting the graphics object and invoking methods on it. | |
(doto (.getGraphics img) |
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 sandbox; | |
public interface Command { | |
} |
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
(defn move-formatter [command] | |
(format "<MoveCommand %s,%s>" (:x command) (:y command))) | |
(defn stop-formatter [command] | |
"<StopCommand>") | |
(defn default-formatter [command] | |
(format "<Unknown command %s>" command)) |
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 'overtone.live) | |
(def rkick-id (int (rand 10000))) | |
(def rsnare-id (int (rand 10000))) | |
(println "Kick id " rkick-id) | |
(println "Snare id " rsnare-id) | |
(def rkick (sample (freesound-path rkick-id))) | |
(def rsnare (sample (freesound-path rsnare-id))) | |
(def metro (metronome 80)) | |
(defn player [beat] | |
(at (metro beat) (rkick)) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="bundle.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
OlderNewer