This file contains 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
[ui] | |
username = Dominik Dabrowsk <dominik@rhodecode.com> | |
[extensions] | |
color = | |
pager = | |
fetch = | |
graphlog = | |
mercurial_keyring = | |
rebase = |
This file contains 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 timeit | |
test_str = "hello world|" | |
test_times = 1000 | |
def test_str_add(): | |
result = "" | |
for i in xrange(test_times-1): | |
result += test_str | |
return result |
This file contains 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
numbers = [[1,2,3],[4,5,6],[7,8,9]] | |
persons = [ | |
{'name':'peter', | |
'age':22, | |
'from':'USA'}, | |
{'name':'frank', | |
'age':float('-inf'), | |
'from':'japan'} | |
] | |
This file contains 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
query = """SELECT id, password_hash, salt FROM users | |
WHERE username = 'x' UNION SELECT 0 AS id, "c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2" AS password_hash, "bar" AS salt;-- LIMIT 1""".format(username) | |
x' UNION SELECT 0 AS id, "c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2" AS password_hash, "bar" AS salt;-- |
This file contains 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
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/include -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/include/linux -Isrc/native/common/include -Isrc/native/python/include -I/usr/include/python2.7 -c src/native/common/jp_javaenv.cpp -o build/temp.linux-x86_64-2.7/src/native/common/jp_javaenv.o | |
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default] | |
src/native/common/jp_javaenv.cpp: In static member function ‘static void JPJavaEnv::load(const string&)’: | |
src/native/common/jp_javaenv.cpp:61:117: error: invalid conversion from ‘jint (*)(JPJavaEnv::load(const string&)::JavaVM_**, void**, void*) {aka int (*)(JPJavaEnv::load(const string&)::JavaVM_**, void**, void*)}’ to ‘jint (*)(JavaVM**, void**, void*) {aka int (*)(_Jv_JavaVM**, void**, void*)}’ [-fpermissive] | |
src/native/common/jp_javaenv.cpp:62:126: error: invalid conversion from ‘jint (*)(JPJavaEnv::load(const string&)::Java |
This file contains 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
__name__ = '__derp__' | |
print __name__ == '__derp__' |
This file contains 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
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/include -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.08/include/linux -Isrc/native/common/include -Isrc/native/python/include -I/usr/include/python2.7 -c src/native/common/jp_proxy.cpp -o build/temp.linux-x86_64-2.7/src/native/common/jp_proxy.o | |
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default] | |
In file included from src/native/common/jp_proxy.cpp:17:0: | |
src/native/common/include/jpype.h:45:17: fatal error: jni.h: No such file or directory | |
compilation terminated. | |
error: command 'gcc' failed with exit status 1 |
This file contains 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 eenum(l): | |
return dict((k,v) for l in (enumerate(l), ((x,i) for i,x in enumerate(l))) for k,v in l) | |
eenum(['enumerate','dict', 'import' ,'pprint']) | |
{0: 'enumerate', | |
1: 'dict', | |
2: 'import', | |
3: 'pprint', |
This file contains 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 eenum(l): | |
return dict((k,v) for l in (enumerate(l), ((x,i) for i,x in enumerate(l))) for k,v in l) | |
print eenum('asd') | |
>>> {0: 'a', 1: 's', 2: 'd', 'a': 0, 'd': 2, 's': 1} |
This file contains 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 import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import |
NewerOlder