Skip to content

Instantly share code, notes, and snippets.

import time
from math import sqrt
def sieve(stop):
'''
That sieve of eratosthenes thing. Implemented directly from the
pseudocode found here:
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Implementation
'''
stop += 1
#!/usr/bin/env python
import time
from math import sqrt
def sieve(stop):
'''
That sieve of eratosthenes thing. Implemented directly from the
pseudocode found here:
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Implementation
'''
import random
print "bot 1"
if input is '':
print "input = ''"
else:
print input
output = random.choice(['R', 'P', 'S'])
print "bot 1"
print output
import random
from collections import defaultdict
def update(input):
counts[input] += 1
def play():
rcounts = {str(v): k for k, v in counts}
return rcounts[max([str(val) for val in counts.values())]]
#!/usr/bin/env python
import random
import re
import sys
from collections import defaultdict, namedtuple
from itertools import chain, count
from operator import add
from random import choice
from string import uppercase
#!/usr/bin/env python
import random
import re
import sys
from collections import defaultdict, namedtuple
from itertools import chain, count
from operator import add
from random import choice
from string import uppercase
#!/usr/bin/env python
import random
import re
import sys
from collections import defaultdict, namedtuple
from itertools import chain, count
from operator import add
from random import choice
from string import uppercase
# Configuration file for ipython.
c = get_config()
#------------------------------------------------------------------------------
# TerminalInteractiveShell configuration
#------------------------------------------------------------------------------
# pager settings
c.TerminalInteractiveShell.pager = 'less'
c.TerminalInteractiveShell.color_info = True
#<start test.md>
Inline *markup* **test**.
Paragraph^block and^(multiple super)^test
~~More~~ inline [tests](http://www.example.com)
Inline `fixed width text` and \*escaped format test\*
The following is a block of code:
#!/usr/bin/env bash
#
# single step iTunes external drive ejection
disk="/dev/disk2"
music_path=/Volumes/media/music
itunes_pid=$(pgrep "^itunes$")
itunes_status=$(lsof -p "$itunes_pid" | grep "$music_path")