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
macbook $ time ./zaprzyjaznione | |
Podaj przedział: 1500 | |
284 i 220 są liczbami zaprzyjaźnonymi | |
1210 i 1184 są liczbami zaprzyjaźnonymi | |
real 0m4.903s | |
user 0m3.616s | |
sys 0m0.000s |
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
--- thumbs.py 2009-06-08 20:11:41.000000000 +0200 | |
+++ thumbs2.py 2010-01-23 14:48:25.000000000 +0100 | |
@@ -5,7 +5,7 @@ | |
""" | |
from django.db.models import ImageField | |
from django.db.models.fields.files import ImageFieldFile | |
-from PIL import Image | |
+from PIL import Image, ImageFilter | |
from django.core.files.base import ContentFile | |
import cStringIO |
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 -*- | |
# Based on http://napi.py.googlepages.com/napi.py | |
import sys | |
import os | |
import hashlib | |
import sys | |
import urllib |
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 django import forms | |
class Invite(forms.Form): | |
email = forms.EmailField(required=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
import feedparser | |
user = 'pagenoare' | |
d = feedparser.parse('http://ws.audioscrobbler.com/1.0/user/%s/recenttracks.rss' % user) | |
title = d.entries[0].title.encode('utf-8') | |
print title |
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 | |
import re | |
import mechanize | |
pattern = re.compile('<tr><th class="black tdl">W dniu <b>([^\<]+)</b> o godzinie <b>([^\<]+)</b> przyrost Twojego portfela wynosi</th><td class="money1">([^\%]+)%</td></tr>') | |
class SIGG(object): | |
def __init__(self): | |
self.browser = mechanize.Browser() |
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/python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2007 TUBITAK/UEKAE | |
# Licensed under the GNU General Public License, version 2. | |
# See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt | |
from pisi.actionsapi import autotools | |
def setup(): |
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/python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2007 TUBITAK/UEKAE | |
# Licensed under the GNU General Public License, version 2. | |
# See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt | |
from pisi.actionsapi import autotools | |
from pisi.actionsapi import pisitools | |
from pisi.actionsapi import get |
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
222 22121 | |
211 12020 | |
12 21111 | |
2010 20122 | |
1222 12211 | |
2021 20122 | |
111 10221 | |
2 10010 | |
111 22211 | |
122 10221 |
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 | |
def main(): | |
try: | |
liczba = int(raw_input('Podaj liczbe: ')) | |
except: | |
print 'podany wyraz to nie liczba!' | |
if (liczba % 2 == 0) and (liczba >= 4 and liczba <= 100000000): | |
i = [liczba / 2, liczba / 2] | |
if (not liczba_pierwsza(i[0])) and (not liczba_pierwsza(i[1])): |