Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# http://stackoverflow.com/questions/1939902
from __future__ import division
import itertools
operands = [1, 2, 3, 5, 7]
operators = ['+', '-', '*', '/']
#!/usr/bin/env python
# http://stackoverflow.com/questions/2953421/split-based-by-a-z-character-in-an-alphanumeric-string-in-python/2953461#2953461
import re
s = "5d4h2s"
p = re.compile("([0-9])([a-z])")
def mm(s):
<xs:element name="gap">
<xs:complexType>
<xs:sequence>
<xs:element name="correct" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="inputLength" use="optional">
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minInclusive value="1"/>
</xs:restriction>
$ cd ~/projects/ialt
$ ls -1
downloads
elateXam
elateXam-support
elateXamSmall.tar.gz
$ mkdir elateXamSmall
$ cp elateXamSmall.tar.gz elateXamSmall
$ cd elateXamSmall
$ tar xvzf elateXamSmall.tar.gz
#!/usr/bin/env python
# http://stackoverflow.com/questions/3139869/heapq-nlargest-index-of-returned-result-in-original-sequence/3139918#3139918
import heapq
from timeit import Timer
seq = [100, 2, 400, 500, 400] + range(9995)
# seq = ("hello", 2, "world", 500, 400)
h1639710:~ $ locate bin/php
/opt/psa/admin/bin/php
/opt/psa/admin/sbin/php_from_sql_charsets
/opt/psa/admin/sbin/phpc
/opt/psa/bin/php-cli
...
# alten "link" entfernen ...
h1639710:~ $ sudo rm /usr/local/psa/admin/bin/php
This gist was saved via command-line ...
class A(object):
active = True
def about_me(self):
return A.active
def am_i_active(self):
if self.__class__.active:
print 'Yes, sir!'
else:
print 'Nope.'
We couldn’t find that file to show.