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
# http://books.google.com/books?id=0FW3DMNhl1EC&lpg=PA1&ots=tt-xF-JWXq&dq=jon%20erickson%20art%20of%20exploitation%20math%20problem&pg=PA1#v=onepage&q=math%20problem&f=false | |
# | |
# Use each of the numbers 1, 3, 4, and 6 exactly once with any of the four basic math operations | |
# (addition, subtraction, multiplication, and division) to total 24. Each number must be used | |
# once and only once, and you may define the order of operations; for example, 3 * (4 + 6) + 1 = 31 | |
# is valid, however incorrect, since it doesn't total 24. | |
from fractions import Fraction | |
import itertools |
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
# code for monkey-patching | |
import nose.tools | |
# let's fix nose.tools.assert_raises (which is really unittest.assertRaises) | |
# so that it always supports context management | |
# in order for these changes to be available to other modules, you'll need | |
# to guarantee this module is imported by your fixture before either nose or | |
# unittest are imported |
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
''' | |
A minimal example of how to use Paste and WebOb to build a custom | |
WSGI app and serve it. | |
Depends on: | |
* paste - http://pypi.python.org/pypi/Paste | |
* webob - http://pypi.python.org/pypi/WebOb/1.1.1 | |
* routes - http://pypi.python.org/pypi/Routes/1.12.3 | |
I (marmida) still think this is less appropriate than using CouchDB; you'll need |
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
Feature: matchers | |
# passes fine | |
Scenario: regex, no nested groups, matching | |
Given that I am testing behave | |
When I try to use a regex matcher for unnested groups | |
Then I should have to call step_matcher | |
# both of the following trigger AssertionError |
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 unittest2 | |
# some code under test | |
def raise_msg(x): | |
raise ValueError('hello: %s' % x) | |
class SomeError(ValueError): | |
def __init__(self, x): | |
self.x = x |
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 | 2014-05-01 00:00:00+00:00 | 2014-06-01 00:00:00+00:00 | 2014-07-01 00:00:00+00:00 | 2014-08-01 00:00:00+00:00 | 2014-09-01 00:00:00+00:00 | 2014-10-01 00:00:00+00:00 | 2014-11-01 00:00:00+00:00 | 2014-12-01 00:00:00+00:00 | 2015-01-01 00:00:00+00:00 | 2015-02-01 00:00:00+00:00 | 2015-03-01 00:00:00+00:00 | 2015-04-01 00:00:00+00:00 | 2015-04-23 00:00:00+00:00 |
---|