For my previous post on how many colored sources you should put in your mana bases, I adapted Frank Karsten's simulation code to the London Mulligan rules change, and to make recommendations based on how many lands you want to play. In doing so, I made two errors: first, the tables for Commander decks do not take into account the free mulligan, or the turn one draw. Second, I changed the assumed mulligan strategy to be more aggressive; the effect of this change dominated over the effect of the London Mulligan, invalidating my comment on the matter.
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
| try: | |
| import xmlrpclib | |
| except ImportError: | |
| import xmlrpc.client as xmlrpclib | |
| client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi') | |
| packages = client.list_packages() | |
| total = len(packages) | |
| dashes = len([x for x in packages if '-' in x]) |
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 | |
| class Vertex: | |
| def __init__(self, value): | |
| self.value = value | |
| self.edges = {} | |
| def degree(self): | |
| return len(self.edges) | |
| def __str__(self): | |
| return str(self.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
| /*! data attribute parser | |
| * This parser will use the data-tablesorter-value to extract the cell's value | |
| * Written by Mathieu Lemoine :https://github.com/lemoinem | |
| */ | |
| /*global jQuery: false */ | |
| ;(function($){ | |
| "use strict"; | |
| $.tablesorter.addParser({ | |
| id : 'data-attribute', |
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
| pb-kill-line () { | |
| zle kill-line | |
| echo -n $CUTBUFFER | pbcopy | |
| } | |
| pb-kill-whole-line () { | |
| zle kill-whole-line | |
| echo -n $CUTBUFFER | pbcopy | |
| } |
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
| # To run the script you must set PYTHONPATH and path to QGIS binaries | |
| # | |
| # on Linux: export PYTHONPATH=/qgispath/share/qgis/python | |
| # on Windows: set PYTHONPATH=c:\qgispath\python | |
| # on OSX: export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python | |
| # export PATH="/Applications/QGIS.app/Contents/MacOS/bin:$PATH" | |
| from qgis.core import * | |
| import sys | |
| import os |