Gravity Sim

Directions

This applet is a very simple gravity (kinda E and M?) demonstration. The red dots are particles while the wells change from black when they are strongly attractive to yellow when they are strongly repelent. To begin the simulation press the "Start" button. You can change the number of particles by selecting the number you want next to "Particle #". If you want to clear out all the gravity well, click the "Clear Wells" button. If you wish to place a new gravity well, first choose the power of the well with the number selector next to "Well Power" and then hold down the shift key and press anywhere on the applet to place the new well. If you want to have well that moves, hold down the alt key and click on the applet where you want the well to start, then click again where you want the well to end. A well will now move back an forth along the line that you have just placed. You can also choose the length of the tails drawn on the particles with the drop down menu, and you can turn on and off friction with the checkbox marked "Friciton", imagine that! You can Have fun!


1337

So I was bored one day and I decided to make a human->1337 translator. I made this this thing in about 20 minutes, so I am sure there are better ways of doing it, whatever. The first file here is the driver file while the second is the "dictionary" from number letters to 1337.

leet.py

from random import randint import sys class LeetConvert(object): def __init__(self, f = 'leet.txt'): self.dict = {} self.file = f def getFile(self): f = open(self.file) for l in f.readlines(): l = l.split(":") rep = l[1].split(",") pick = randint(0, len(rep)-2) self.dict[l[0]] = rep[pick] def convert(self, str="Yes, I am that nerdy!"): self.getFile() n = "" for x in str: try: x = x.lower() l = self.dict[x] except: l = x n+=l print n if __name__=="__main__": le = LeetConvert() le.convert(sys.argv[1])

leet.txt

a:4,/\,/-\,^,aye,
b:13,I3,|3,P>,!3,)3,]3,
c:<,(,{,
d:|o,]),[),|>,T),cl,
e:&,[-,|=-,
f:ph,},|=,(=,I=,
g:(_+,gee,(_-,cj,
h:/-/,[-],]-[,)-(,(-),:-:,|~|,|-|,]~[,}{,}-{,
i:1,!,|,eye,3y3,Á,][,:,],
j:_|,_/,],,{\},[]\,/V,[]\[],]\[,
o:0,(),oh,[],p,
p:|*,|o,|>,|",
q:(_,()_,0_,<|,
r:12,|?,/2,I2,|2,
s:5,$,z,ehs,es,
t:7,+,-|-,1,
u:M,|_|,Y3W,L|,
v:\/,\\//,
w:\/\/,vv,\^/,\V/,\X/,\|/,\_|_/,\\//\\//,\_:_/,
x:><,%,}{,ecks,*,)(,ex,
y:j,`/,`(,-/,
z:~/_,>_,7_,

Clearing Out Junk

So I got tired of having a cluttered terminal, so I wrote this quick script to print out a buch of stuff to "clear" out the screen

clear.py

from random import random

count = 0
inc = 1
for x in xrange(200):
	s = ""
	for y in xrange(count):
		s += " "
	s = s+"~"
	print s
	count += inc
	if count > 50 or count < 1:
		inc *= -1