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 sys, re, argparse, string, codecs | |
parser = argparse.ArgumentParser() | |
parser.add_argument("citearg", help="the file containing the citations from footnotes etc.") | |
parser.add_argument("refarg", help="the file containing reference list") | |
manuFiles = parser.parse_args() | |
def makeCorpoi(citefile, reffile): | |
citebox = open(citefile, 'r') |
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
b'Raaflaub, Kurt. 1FOREIGNAthens: Equalities, Inequalities.1FOREIGN In Demokratia: A Conversation on Democracies, Ancient and Modern, edited by Josiah Ober and Charles Hedrick, 139-74. Princeton: Princeton University Press, 1996.\n \n1FOREIGN1FOREIGN1FOREIGN. The Discovery of Freedom in Ancient Greece. Chicago: University of Chicago Press, 2004.\n\nRantanen, Jason. 1FOREIGNThe Malleability of Patent Rights.1FOREIGN forthcoming in Michigan State Law Review (2015).\n \nRawls, John. A Theory of Justice. Cambridge, MA: Harvard University Press, 1999a.\n\n1FOREIGN1FOREIGN1FOREIGN. 1FOREIGNThe Idea of Public Reason Revisited.1FOREIGN In The Law of Peoples: With, 1FOREIGNThe Idea of Public Reason Revisited1FOREIGN, by John Rawls, 129-80. Cambridge, MA: Harvard University Press, 1999b.\n\n1FOREIGN1FOREIGN1FOREIGN. Justice as Fairness: A Restatement. Cambridge, MA: Harvard University Press, 2001.\n\n1FOREIGN1FOREIGN1FOREIGN. Political Liberalism. New York: Columbia University Press, 2005.\n\nRaz, Joseph. 1FOREIGNThe R |
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
b'This truth, of course, is embedded deeply into our constitutional ideas. Thus, the Supreme Court applies rational basis review to every legislative act, even those not impinging on a fundamental right or protected class (e.g. Cleburne v. Cleburne Living Center, 473 U.S. 432 (1985)). But the idea goes deeper: positive law is purpose-driven activity (the legislature is trying to bring something about by its enactments), and purpose-driven activity is under a rational requirement to take the means necessary to achieve its ends (Kant 2002, 31-34). \n Davidson, 2001, chs. 9-10; Lewis 1974.\n The quote, along with the principles of coherence and charity, come from Davidson (2001).\n Ordinarily, these attitudes will be beliefs, however the expressive meaning of a law could comprise some other propositional attitude. Nothing in the argument turns on this. Beliefs might be about social, physical, or normative truths, or some combination of them1FOREIGNa law may require attributions of beliefs about, e.g., economi |
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
'''FTP server for Pythonista (iOS) | |
You can use this to exchange files with a Mac/PC or a file management app on the same device (e.g. Transmit). | |
If you use a Mac, you can connect from the Finder, using the "Go -> Connect to Server..." menu item. | |
''' | |
import os | |
from socket import gethostname |
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
# Very simple SSH client for Pythonista | |
import paramiko | |
import console | |
ssh = paramiko.SSHClient() | |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
host = console.input_alert('Connect to') | |
user, passwd = console.login_alert('Login') | |
ssh.connect(host, username=user, password=passwd) | |
print 'Connected to %s. Type `exit` to disconnect.' % host |
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
# with list comprehension | |
print '\n'.join(['Fizzbuzz' if x % 15 == 0 else 'Fizz' if x % 3 == 0 else 'Buzz' if x % 5 == 0 else str(x) for x in range(input('Start: '), input('End: ') + 1, input('Step: '))]) | |
# with lambdas and map (two versions) | |
print '\n'.join(map(lambda x: 'Fizzbuzz' if x % 15 == 0 else (lambda x: 'Fizz' if x % 3 == 0 else (lambda x: 'Buzz' if x % 5 == 0 else str(x))(x))(x), range(input('Start: '), input('End: ') + 1, input('Step: ')))) | |
print '\n'.join(map(lambda x: 'Fizzbuzz' if x % 15 == 0 else 'Fizz' if x % 3 == 0 else 'Buzz' if x % 5 == 0 else str(x), range(input('Start: '), input('End: ') + 1, input('Step: ')))) | |
# these versions sometimes work, and sometimes throw an error about being unable to convert string to int, even before user is asked for input. |
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
samplerow = [1, u'Message-ID: <20625717.1075857797770.JavaMail.evans@thyme>\r\nDate: Wed, 13 Dec 2000 06:03:00 -0800 (PST)\r\nFrom: thane.twiggs@enron.com\r\nTo: jeffery.ader@enron.com, mark.bernstein@enron.com, scott.healy@enron.com, \r\n\tjanelle.scheuer@enron.com, tom.dutta@enron.com, dana.davis@enron.com, \r\n\tpaul.broderick@enron.com, chris.dorland@enron.com, \r\n\tgautam.gupta@enron.com, michael.brown@enron.com, \r\n\tjohn.llodra@enron.com, george.wood@enron.com, joe.gordon@enron.com, \r\n\tstephen.plauche@enron.com, jennifer.stewart@enron.com, \r\n\tdavid.guillaume@enron.com, tom.may@enron.com, \r\n\trobert.stalford@enron.com, jeffrey.miller@enron.com, \r\n\tnarsimha.misra@enron.com, joe.quenet@enron.com, \r\n\tpaul.thomas@enron.com, ricardo.perez@enron.com, \r\n\tkevin.presto@enron.com, sarah.novosel@enron.com, \r\n\tchristi.nicolay@enron.com\r\nSubject: ISO-NE failure to mitigate ICAP market -- Release of ISO NE\r\n confidential information\r\nMime-Version: 1.0\r\nContent-Type: text/plain; charset=u |
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
# creating an example list item plus an example list: | |
samplerow = [1, u'Message-ID: <20625717.1075857797770.JavaMail.evans@thyme>\r\nDate: Wed, 13 Dec 2000 06:03:00 -0800 (PST)\r\nFrom: thane.twiggs@enron.com\r\nTo: jeffery.ader@enron.com, mark.bernstein@enron.com, scott.healy@enron.com, \r\n\tjanelle.scheuer@enron.com, tom.dutta@enron.com, dana.davis@enron.com, \r\n\tpaul.broderick@enron.com, chris.dorland@enron.com, \r\n\tgautam.gupta@enron.com, michael.brown@enron.com, \r\n\tjohn.llodra@enron.com, george.wood@enron.com, joe.gordon@enron.com, \r\n\tstephen.plauche@enron.com, jennifer.stewart@enron.com, \r\n\tdavid.guillaume@enron.com, tom.may@enron.com, \r\n\trobert.stalford@enron.com, jeffrey.miller@enron.com, \r\n\tnarsimha.misra@enron.com, joe.quenet@enron.com, \r\n\tpaul.thomas@enron.com, ricardo.perez@enron.com, \r\n\tkevin.presto@enron.com, sarah.novosel@enron.com, \r\n\tchristi.nicolay@enron.com\r\nSubject: ISO-NE failure to mitigate ICAP market -- Release of ISO NE\r\n confidential information\r\nM |
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
# takes all HTML files in a directory, dumps it to evernote notebook. | |
# usage: designed for quick transfer of apple notes to evernote | |
# using the tool provided at https://github.com/pmatiello/notes-export | |
# first to get html files dumped in a notebook. | |
# then call from command line: | |
# python n2ev.py DEVTOKEN FULLPATHTODIR NOTEBOOKNAME | |
# DEVTOKEN is a developer token for your evernote acconut, which can | |
# be acquired from evernote: https://dev.evernote.com/#apikey | |
# FULLPATHTODIR is, obviously, the path to the directory in which your notes | |
# are stored, as html files. NOTEBOOKNAME is the new evernote notebook to |
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
# USAGE: | |
# | |
# To add code to the end of every <head> tag (like a css link, a font link, etc.) to quick-format an entire website: | |
# 1. Start in the top-level-directory of the site. Put this file there. | |
# 2. Add your formtting for the <head> tag to the formatme variable. | |
# EXAMPLE: mine was '<link href="https://fonts.googleapis.com/css?family=Halant:300" rel="stylesheet" type="text/css"><link rel="stylesheet" href="http://paul-gowder.com/conlawII/prettify.css">' | |
# be sure to either escape quotes or use single quotes to demarcate the string and double-quotes in the html/vice versa | |
# 3. Run this script. | |
# 4. Bam. Every html page in in the top-level directory and all its subdirectories now has the formatting you want. |
OlderNewer