"El más rápido de los hombres, Aquiles, no podrá alcanzar nunca al más lento de los animales, la tortuga, si se da a ésta una ventaja inicial en una carrera."
Zenón de Elea
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
| # -*- coding: utf-8 -*- | |
| # | |
| # http://stackoverflow.com/a/904085 | |
| import csv | |
| def UnicodeDictReader(utf8_data, **kwargs): | |
| csv_reader = csv.DictReader(utf8_data, **kwargs) | |
| for row in csv_reader: |
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
| # -*- coding: utf-8 -*- | |
| from urllib3 import connection_from_url | |
| from urllib3.util import make_headers | |
| from urllib3.exceptions import HTTPError | |
| from suds.transport import Transport, TransportError, Reply | |
| class Urllib3Transport(Transport): | |
| """ |
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
| # -*- coding: utf-8 -*- | |
| from fabric.api import env | |
| from fabric.decorators import task | |
| from fabric.operations import run, local | |
| env.timeout = 120 | |
| # env.hosts = ['motoko', 'batou', 'tachikoma'] | |
| env.forward_agent = True | |
| env.use_ssh_config = True |
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 -*- | |
| try: | |
| from urllib import urlencode | |
| from urlparse import urlparse, urljoin, parse_qsl | |
| except ImportError: | |
| from urllib.parse import urlparse, urljoin, urlencode, parse_qsl | |
| from lxml.html import parse |
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 -*- | |
| """ | |
| Zipf's song | |
| =========== | |
| Your slightly pointy-bearded boss has assigned you to write software to find | |
| the best songs from different music albums. And the software should be finished | |
| in an hour. But don’t panic, you don’t have to solve the problem of writing an |
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
| # Tips: | |
| # * [ci skip] in commits messages | |
| # * https://secure.travis-ci.org/:username/:project.png | |
| # * Use travislint | |
| language: python | |
| python: | |
| - '2.6' | |
| - '2.7' |
It has been brought to the management’s attention that some individuals have been using foul language in the course of normal conversation between employees. Due to complaints from some of the easily offended workers, this conduct will no longer be tolerated.
The management does, however, realize the importance of each person being able to properly express their feelings when communicating with their fellow employees. Therefore, the management has compiled the following code phrases so that the proper exchange of ideas and information can continue.
OLD PHRASE NEW PHRASE
No fucking way ......................................... I’m not certain that’s feasible.
You’ve got to be shitting me ........................... Really.
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 -*- | |
| """ | |
| Reversed Binary Numbers | |
| ~~~~~~~~~~~~~~~~~~~~~~~ | |
| Yi has moved to Sweden and now goes to school here. The first years of | |
| schooling she got in China, and the curricula do not match completely in the | |
| two countries. Yi likes mathematics, but now... The teacher explains the | |
| algorithm for subtraction on the board, and Yi is bored. Maybe it is possible |