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
#Imports | |
import math | |
import csv | |
x = range(1,500) | |
#Fib (Using square roots to preserve ram) | |
def fib(n): | |
fiby = ((1+math.sqrt(5))**n-(1-math.sqrt(5))**n)/(2**n*math.sqrt(5)) | |
return int(fiby)^2 |
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
def fib(n): | |
if n==0: | |
return 0 | |
elif n==1: | |
return 1 | |
else: | |
return fib(n-2)+fib(n-1) |
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
<a href="javascript:play_single_sound();"></a> | |
<audio id="audiotag1" src="<?php bloginfo('template_directory');?>/etc/nyan/Nyan.mp3" preload="auto"> | |
<script type="text/javascript"> | |
function play_single_sound() { | |
document.getElementById('audiotag1').play(); | |
} | |
function stop_single_sound() { | |
document.getElementById('audiotag1').pause(); | |
} | |
</script> |
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
#Random! Optimized! YAY! | |
import random | |
seed = "123456789" | |
count = 1000000 | |
def generate(seed2,count): | |
f = open("./random-"+str(count)+".txt", "w") | |
x = 0 | |
y = None | |
while x < count: |
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 urllib2,time | |
x=0 | |
while x<100000: | |
urllib2.urlopen("http://thisurl.com/vote/ajax?id=123") | |
time.sleep(.2) | |
x+=1 |
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
76.***.***.*** - - [12/Jul/2011:10:33:08 -0600] "GET / HTTP/1.1" 200 34300 "-" "Python-urllib/2.6" | |
76.***.***.*** - - [12/Jul/2011:10:33:09 -0600] "GET / HTTP/1.1" 200 33683 "-" "Python-urllib/2.6" | |
76.***.***.*** - - [12/Jul/2011:10:33:10 -0600] "GET / HTTP/1.1" 200 33683 "-" "Python-urllib/2.6" | |
76.***.***.*** - - [12/Jul/2011:10:33:11 -0600] "GET / HTTP/1.1" 200 33683 "-" "Python-urllib/2.6" | |
76.***.***.*** - - [12/Jul/2011:10:33:11 -0600] "GET / HTTP/1.1" 200 34677 "-" "Python-urllib/2.6" | |
76.***.***.*** - - [12/Jul/2011:10:33:12 -0600] "GET / HTTP/1.1" 200 34632 "-" "Python-urllib/2.6" | |
76.***.***.*** - - [12/Jul/2011:10:33:13 -0600] "GET / HTTP/1.1" 200 33683 "-" "Python-urllib/2.6" | |
76.***.***.*** - - [12/Jul/2011:10:33:14 -0600] "GET / HTTP/1.1" 200 34629 "-" "Python-urllib/2.6" | |
76.***.***.*** - - [12/Jul/2011:10:33:15 -0600] "GET / HTTP/1.1" 200 34684 "-" "Python-urllib/2.6" | |
76.***.***.*** - - [12/Jul/2011:10:33:16 -0600] "GET / HTTP/1.1" 200 34509 "-" "Python-urllib/2.6" |
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 hashlib, sys | |
sys.setrecursionlimit(11000) | |
def rec(inputy,x): | |
x += 1 | |
def md5y(iny): | |
return hashlib.md5(str(iny)).digest() | |
def sha512y(iny): |
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 hashlib | |
count = 1000 | |
def func(f2): | |
x = 0 | |
while x < count: | |
x += 1 | |
f1 = hashlib.md5(str(f2)).digest() | |
f2 = hashlib.sha512(str(f1)).hexdigest() | |
print f2 |
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 time, hashlib | |
end = time.time() + 1 | |
f2 = "Hello World" | |
x = 0 | |
while time.time() < end: | |
x += 1 | |
f1 = hashlib.md5(str(f2)).digest() | |
f2 = hashlib.sha512(str(f1)).hexdigest() | |
print f2,x |
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 MySQLdb | |
user = "root" | |
passwd = "" | |
db = "test" | |
host = "localhost" | |
DB = MySQLdb.connect(user=user, passwd=passwd, host=host, db=db) | |
C = DB.cursor() |