- Plain Strings (207):
foo - Anchors (208):
k$ - Ranges (202):
^[a-f]*$ - Backrefs (201):
(...).*\1 - Abba (169):
^(.(?!(ll|ss|mm|rr|tt|ff|cc|bb)))*$|^n|ef - A man, a plan (177):
^(.)[^p].*\1$ - Prime (286):
^(?!(..+)\1+$) - Four (199):
(.)(.\1){3} - Order (198):
^[^o].....?$ - Triples (507):
(^39|^44)|(^([0369]|([147][0369]*[258])|(([258]|[147][0369]*[147])([0369]*|[258][0369]*[147])([147]|[258][0369]*[258])))*$)
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 Node : | |
| def __init__( self, data ) : | |
| self.data = data | |
| self.next = None | |
| self.prev = None | |
| class LinkedList : | |
| def __init__( self ) : | |
| self.head = None |
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 | |
| import pygame | |
| import random | |
| # [email protected] | |
| TAMANHO = (640, 480) | |
| T = 640 / 32 | |
| TX = 640 / T | |
| TY = 480 / T |
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
| import shutil, tempfile | |
| from os import path | |
| import unittest | |
| class TestExample(unittest.TestCase): | |
| def setUp(self): | |
| # Create a temporary directory | |
| self.test_dir = tempfile.mkdtemp() | |
| def tearDown(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
| # coding: utf-8 | |
| import pygame | |
| import random | |
| rr = random.randrange | |
| SIZE = 800, 600 | |
| cellsize = 20 | |
| try: |
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 python2.7 | |
| import random | |
| import subprocess | |
| class Node(object): | |
| def __init__(self, key, value): | |
| self.key = key | |
| self.value = 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
| from subprocess import Popen, PIPE | |
| def shell_out(command): | |
| return Popen(command.split(' '), stdout=PIPE,stderr=PIPE).communicate()[0].strip('\n').split('\n') | |
| def main(): | |
| return shell_out('echo one\ntwo\nthree\n') |
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
| autoload -Uz vcs_info | |
| zstyle ':vcs_info:*' stagedstr '%F{green}●' | |
| zstyle ':vcs_info:*' unstagedstr '%F{yellow}●' | |
| zstyle ':vcs_info:*' check-for-changes true | |
| zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r' | |
| zstyle ':vcs_info:*' enable git svn | |
| theme_precmd () { | |
| if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] { | |
| zstyle ':vcs_info:*' formats '%c%u%B%F{green} ' |
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 urllib2 import urlopen | |
| from re import findall, search | |
| base_url = "http://link.springer.com" | |
| links = [] | |
| for i in xrange(1, 13): | |
| index = base_url + '/search/page/%d?facet-series="136"&facet-content-type="Book"&showAll=false' % i | |
| links.extend(findall('<a class="title" href="(.*?)"', urlopen(index).read())) |
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
| # Retorna dados sobre o pregão | |
| http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDados.asp?CodDado=IBOV,ticker&CA=undefined | |
| # Retorna ações e seus últimos valores negociados | |
| http://www.bmfbovespa.com.br/Pregao-OnLine/ExecutaAcaoCarregarDados.asp?CodDado=Ticker | |
| # Retorna o histórico do dia de um papel | |
| http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDadosPapeis.asp?CodDado=petr4 | |
| # Retorna dados de um papel |