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 | |
# | |
# Father's Day card puzzle #3: | |
# In the figure below, fill in each of the sixteen numbers from 1 to 16 such | |
# that the four rows and three columns add up to 29. | |
# | |
# ( )---( )---( ) | |
# | | | |
# ( )---( )---( )---( ) ( ) | |
# | | | |
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
-- confluence_markup.lua | |
-- A Pandoc Atlassian Confluence Markup Writer | |
-- | |
-- Invoke with: pandoc -to confluence_markup.lua | |
-- | |
-- Based on pandoc/data/sampsdfsle.lua and zhzhxtrrk's "pandoc confluence markup writer" | |
-- Fixes tables and lists of lists | |
local image_index = 0 |
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
def ways_to_break(amount, coins): | |
""" | |
:param amount: the monetary value to break into some number of coins | |
:param coins: a container of descending coin denominations | |
:return: the number of different ways to break amount into coins | |
""" | |
this_coin = coins[0] | |
# If this is the only coin, there's one way to break it. | |
if len(coins) == 1: |
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
Verifying I am +dblume on my passcard. https://onename.com/dblume |
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 platform | |
import tempfile | |
import ntpath | |
import filelock # https://github.com/dmfrey/FileLock | |
# It's interesting to see what's different between Windows and Linux. | |
# On Windows, you can't rename to an existing file, and you can't | |
# use os.fdatasync(). | |
# Also see: http://blog.gocept.com/2013/07/15/reliable-file-updates-with-python/ |
NewerOlder