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
>>> 'ala ma kota'.replace(' ', r'\ ') | |
'ala\\ ma\\ kota' | |
>>> list('ala ma kota'.replace(' ', r'\ ')) | |
['a', 'l', 'a', '\\', ' ', 'm', 'a', '\\', ' ', 'k', 'o', 't', 'a'] | |
>>> print('ala ma kota'.replace(' ', r'\ ')) | |
ala\ ma\ kota |
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 bRun(val, name, bf, res, bfpt, info, mlt, pr, nr = {0:1}, check = False): | |
solutions = {} | |
new, cz = runF(val, name, bf, res, check) | |
solt = oneTab(new) | |
lst = nr.keys()[-1] | |
last = glMulti(nr) | |
if solt["e"] > 0 and last < mlt: | |
m = 1 | |
solutions[lst] = {"data" : solt, 'mlt' : last} | |
tmp = newName(name, nr, True) |
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
from lxml import etree | |
DOC = """<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl"> | |
<head> | |
<title>{}</title> | |
</head> | |
<body> | |
<ul id="menu"></ul> | |
<ul xml:id="posty"></ul> | |
</body> |
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
<html> | |
<head> | |
<title>Webkit Bug</title> | |
<meta http-equiv="Content-Type" value="text/html; charset=utf-8"> | |
</head> | |
<body> | |
<p>Hello World!</p> | |
<script type="text/javascript"> | |
function run() |
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
# -*- coding: utf-8 | |
from xml.dom import minidom | |
from urllib import urlopen | |
from os import getcwd | |
import codecs | |
class HackingRssReader: | |
def __init__(self, feed_url = 'http://hacking.pl/rss.xml' ): | |
self.feed_url = feed_url# nie ma powodu tego ukrywać |
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
#! /usr/bin/env python | |
#-*- coding: utf-8 -*- | |
""" | |
Source: http://forum.python.org.pl/index.php?topic=1607.msg7913#msg7913 | |
""" | |
import socket | |
import sys | |
import os | |
import datetime |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>Bleach Exile > Online Manga Reader > Browse Series</title> | |
</head> | |
<body> | |
<script language="JavaScript" type="text/javascript"> | |
document.write('<scr'+'ipt language="JavaScript" src="http://ad.de.doubleclick.net/adj/P4444.ani.animemanga.de_de/Value;sz=728x90;tile=1;dcopt=ist;ord='+ord+'?" type="text/javascript"></scr'+'ipt>'); | |
</script> | |
</body> |
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 functools | |
import datetime | |
def with_time(func): | |
@functools.wraps(func) | |
def timed_execution(*args, **kwargs): | |
start = datetime.datetime.now() | |
try: | |
result = func(*args, **kwargs) | |
time = datetime.datetime.now() - start |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<style type="text/css"> | |
.click { | |
background: white; | |
opacity: 0.5; | |
} |
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
SELECT DISTINCT people.*, count(my_friends.guid_two) AS coincidence | |
FROM entities people | |
LEFT JOIN metadata | |
ON (metadata.entity_guid = people.guid) | |
LEFT JOIN relationships related_friends | |
ON (related_friends.guid_two = people.guid) | |
LEFT JOIN relationships my_friends | |
ON (related_friends.guid_one = my_friends.guid_two) | |
WHERE my_friends.guid_one = 'ME!' -- indirectly related to me | |
AND my_friends.relation = 'friend' |