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
x = 5 | |
def foo(): | |
print x | |
x = 10 | |
print x | |
foo() |
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
for(i = 0; i < BUCKET_A_SIZE; ++i) { bucket_A[i] = 0; } | |
for(i = 0; i < BUCKET_B_SIZE; ++i) { bucket_B[i] = 0; } | |
/* Count the number of occurrences of the first one or two characters of each | |
type A, B and B* suffix. Moreover, store the beginning position of all | |
type B* suffixes into the array SA. */ | |
for(i = n - 1, m = n, c0 = T[n - 1]; 0 <= i;) { | |
/* type A suffix. */ | |
do { ++BUCKET_A(c1 = c0); } while((0 <= --i) && ((c0 = T[i]) >= c1)); | |
if(0 <= i) { |
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
09 19:22:30 | |
m218176vaps2036.att.target.com, WCS01 </<built-in function Comment>> <title> KitchenAid Stamped Set - Black (16 Pc) | |
href="http://Img2.targetimg2.com/wcsstore/TargetSAS/11_05_2013_06_55/css/Globalperf_2_ie_minified.css | |
http://Img3.targetimg3.com/wcsstore/TargetSAS/11_05_2013_06_55/ | |
http://imgsvc.target.com/wcsstore/TargetSAS/11_05_2013_06_55/ | |
http://Img1.targetimg1.com/wcsstore/TargetSAS/11_05_2013_06_55/images/spinner-small.gif | |
<a> Load Complete Content | |
12417854", | |
12417854 | |
4133 |
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
class Closer(object): | |
def __init__(self): | |
methods = self.fixup_methods() | |
for name, method in methods.iteritems(): | |
setattr(self, name, method) | |
def _inner__(self): | |
return locals() | |
def fixup_methods(self): |
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
type | |
TPerson = object of TObject | |
name*: string | |
age: int | |
TStudent = object of TPerson | |
student_id: int | |
var | |
student: TStudent |
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
bad_attrs = ('__class__', '__doc__', '__init__', '__new__', | |
'__getattr__', '__getattribute__', '__subclasshook__', | |
'__str__', '__repr__', '__hash__', '__setattr__') | |
good_attrs = ('append',) | |
def get_ops(o): | |
ops = [x for x in dir(o) if | |
(x.startswith('__') and x not in bad_attrs) or |
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
from __future__ import division | |
import random | |
import sys | |
import re | |
from math import floor | |
from math import ceil | |
from collections import defaultdict | |
_tokenize = re.compile(r'((?:\w{1,20}\'\w+)|(?:\w{1,20})|(?:[.,]))') |
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
"#detail-bullets td.bucket div.content li" | { | |
kind := /([ \w]+):/ | |
value := /: (.+)/ | |
} | |
description = .".content #postBodyPS p" | |
"#ASIN" { | |
asin = value |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from cStringIO import StringIO | |
from UserString import MutableString | |
data = xrange(100000) | |
def test_join_way(): | |
return ''.join([str(x) for x in data]) |
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
#!/usr/bin/env python | |
import time | |
data = range(10000000) | |
def test_method(method): | |
start_time = time.time() | |
result = method() | |
assert len(result) == 68888890, 'Method work no good: %s != 68888890' % len(result) | |
end_time = time.time() |