Assistant Professor
Department of Government
University of Texas at Austin
smoser@austin.utexas.edu
a .bib file, with bibkeys in
`4characterAuthor 2digitYear - firstWordOfTitle' format
Searchable,
in HTML courtesy of JabRef
a combination of
AppleScripts, python, and ruby to aid in some workflows
using a iPad and an OS X (Mountain Lion) desktop
Sync selected PDFs from
desktop (or cloud) Zotero library with tablet, annotate
PDFs on tablet or desktop; daily sync annotated PDFs
Background/ Goal:
Using ZotReader / ZotFile
to get Zotero PDFs to a tablet, automate updating the
zotero library with annotated PDFs.
Idea:
Zotero PDF storage on a
cloud drive ZOT_STORAGE.
Send PDFs to tablet from
desktop using ZotFile/ ZotReader (send to
IPAD_ZOT_PDF).
Annotate PDFs on iPad and
sync to cloud drive IPAD_ZOT_PDF (NOT `ZOT_STORAGE'! )
(eg. Goodreader).
Every evening, time an iCal
event to find the most recently modified PDFs in
IPAD_ZOT_PDF, and move them back to ZOT_STORAGE, in
appropriate sub-folder.
PDFs that are not in your
Zotero library can also be annotated and synced, but
such PDFs should be put in the sub-folder
''IPAD_ZOT_PDF/notinZotero"
Steps:
0. Requires python
0a. Download
and uncompress the archive annotPDF2zotero.zip
1. Put the file
'zotero_iPad2zotLib.py' somewhere convenient (say,
PATH_TO_PY_SCRIPT)
1a. modify the file
'zotero_iPad2zotLib.py' to reflect the location of
your 'zotero/storage' folder, called 'ZOT_STORAGE', as
well as the location of the (possibly cloud) folder
that PDFs annotated on a tablet will be saved to,
called 'IPAD_ZOT_PDF,'
2. Create an iCal event to
run the the command ''python
PATH_TO_PY_SCRIPT/zotero_iPad2zotLib.py -d'' as often
as you like (say, daily)
2a. Depending on your
Automator/iCal set up, creating a wrapper app /
workflow to run the terminal command in (2) might be
necessary. If so, create an 'Calendar Alarm' in
Automator, drag the action 'Run Shell Script' into the
workflow and add the line ''python
PATH_TO_PY_SCRIPT/zotero_iPad2zotLib.py -d''
take handwritten notes on a
tablet, automatically create a searchable Evernote note
utilizing handwriting recognition
Background and Goal:
Notability generates nice
handwritten notes but as yet only saves them as PDFs,
the disadvantage of which is that Evernote's
handwriting recognition works best (well, even) on JPG
files.
Idea:
iPad saves PDFs of handwritten notes to a could
folder WATCHED_FOLDER (eg using Dropbox, for
example). When the folder WATCHED_FOLDER gets
updated on a desktop running OS X the script ''pdflibJPG2folder.py''
automatically converts each page of the PDF into a
JPEG, appropriately numbered, and puts them in a local
folder WATCHED_FOLDER/jpgs.
Each PDF is converted to JPGs, named with the original
PDf file-name base and page-numbered. Finally, a new
note is created in Evernote for each PDF and each JPG
file (page of note) is added to said note, in order.
Steps:
0.
Download and uncompress the archive writtenPDF2EvernoteJPG.zip
1. From Noteability (iPad),
auto-save notes to some cloud service (eg.
Dropbox/from_iPad).
2. Put
''pdflibJPG2folder.py'' (a modified version of Martin
Michel's modified python script of Dinu C. Gherman for
automated PDF-> JPG conversion, see http://macscripter.net/viewtopic.php?id=25350
) in a handy place (lets call the path to your local
copy of pdflibJPG2folder.py PATH_TO_SCRIPT)
3. From OS X with synced
cloud folder, create a folder action in using
AppleScript Editor to watch the folder WATCHED_FOLDER.
Note:
Change `PATH_TO_SCRIPT'
to the path to pdflibJPG2folder.py on the local
machine.
Note:
Change `NOTEBOOK' to the particular notebook you want
the note created in Evernote (or delete for the
default notebook).
Note:
Change `TAG1' and `TAG2' (etc.) to any tags you want
your hand-written note automatically tagged with upon
creation, or delete.
The AppleScript appears
below and also in the file ``pdf2jpgFolder2Evernote
Watched.scpt'' in this archive.
on
adding folder items to this_folder after receiving
these_items
repeat
with anItem
from 1 to
number of
items in
these_items
set
this_item to item
anItem of these_items
set
the item_info
to info
for this_item
set
the item_path
to this_item
as text
tell
(info for this_item)
to set
{Nm, Ex}
to {name,
name extension}
set
BN to
text 1 thru
((get offset
of "." & Ex
in Nm)
- 1) of Nm
set
cmd to
"python" & space
& "PATH_TO_SCRIPT/pdflibJPG2folder.py" & space & "pdf2jpg" &
space & quoted
form of POSIX path of
this_item & space
& 72
set
cmd to
cmd as
"class utf8"
try
do
shell script cmd
on
error error_message number error_number
display
dialog error_message
end try
set
cmdCount to
"python" & space
& "PATH_TO_SCRIPT/pdflibJPG2folder.py" & space & "getpagecount"
& space & quoted form of
POSIX path of
this_item & space
& 72
set
cmdCount to cmdCount as "class
utf8"
try
set pageCount to
do shell script cmdCount
end try
tell
application "Evernote"
set
notei to
create note title
BN with
text (pageCount
& " number of pages" & return
& return) notebook
"NOTEBOOK" tags
{"TAG1", "TAG2"}
repeat
with pageNum
from 0 to
(pageCount - 1)
try
append
notei attachment
(POSIX file (POSIX
path of (this_folder) & "/jpgs/"
& BN & "-"
& pageNum &
".jpg"))
on
error error_message
number error_number
display
alert "Append to Evernote Failed" message
"Error: " & error_message
& " " & "Error Number: " & error_number
as warning
end
try
end repeat
end tell
end repeat
end
adding folder items to
Write slides/ papers/ notes,
etc. and don't be bothered always having to remember to
'send them' to tablet. Designate folders/ file types to
always keep most recent copy of on tablet.
Background/ Goal:
Write slides/ papers/
notes, etc. and don't be bothered always having to
remember to 'send them' to tablet. Designate folders/
file types to always keep most recent copy of on
tablet.
Note: If one were not
concerned with space, all this could be trivially
avoided by saving all materials only on cloud drives,
and sync all such materials with a tablet. However, as
space is more constrained on tablets than on desktops,
this workflow offers a way to keep current lectures,
papers, notes only of frequently update materials
easily and automatically.
Idea:
Use Ruby folder watcher to
trigger copy event upon most recent nontrivial
modification of specified file/ file type.
(AppleScript nor Automator can trigger upon
modification of existing files in folders as of this
writing)
Start RubyFolderWatcher
upon login to Desktop.
On tablet, set auto-sync to
cloud drive. Then, whenever you modify or create a
'watched' file type (folder X extension), the most
recent version will be synced in a cloud drive.
Steps:
0. Requires Ruby
1. Get 'Ruby Folder
Watcher' (by Vickash) from https://github.com/vickash/folder_watcher
and unpack it to a folder of your choosing, say
PATH_TO_FOLDER_WATCHER
1a. Follow instructions in
'README.md' file
2. Modify the file
'settings.yml' to include the folders for which you
want the most current files sent to a cloud drive. For
example, if you wanted the most recent version of all
Keynote files (files ending in '.key') in the folder
MY_LECTURES automatically sent to the Dropbox folder
MY_DROPBOX_LECTURES, the following should be inserted
in 'settings.yml' :
ANYTHING_YOU_WANT_TO_NAME_THIS_WATCHING
:
path: "MY_LECTURES"
command: "FILE=$(ls -tr -d
-1 MY_LECTURES/*.key | tail -1); cp \"$FILE\"
MY_DROPBOX_LECTURES"
>
As an other example, if you
wanted all LaTeX modifications automatically committed
to a git repository and named by the LaTeX project
name plus the date of modification, for some reason,
the following would be in order:
GIT_AUTOCOMMIT:
path: "MY_LATEX_DIRECTORY"
command: "DD=\"git commit
-a -m \"v$(date +%Y%m%d)\"\"; cd
\"MY_LATEX_DIRECTORY\"; eval $DD "
3. On a Mac, create a
wrapper app to run the terminal command
"PATH_TO_FOLDER_WATCHER/ruby folder_watcher.rb"
3a. For example, using
Platypus ( http://sveinbjorn.org/platypus
), create an app called FOLDER_WATCHER_STARTER that
runs the bash script ''PATH_TO_FOLDER_WATCHER/ruby
folder_watcher.rb"
4. [note: the following
holds for OS X 10.8.2. Minor modification might be in
order for older version of OS X]
In Mac OS X 'System
Preferences' -> 'Users & Groups', find your
account and click on the 'Login Items' tab. Add (by
clicking the '+' button) the application you created
in 3, for example the app ''FOLDER_WATCHER_STARTER''
from 3a. Now every time you log in the Folder Watcher
will start up, and every time you modify or make a,
for example, Keynote file in the directory
MY_LECTURES, it will automatically be copied to the
cloud drive MY_DROPBOX_LECTURES.
6. On tablet, set auto-sync
to cloud drive MY_DROPBOX_LECTURES. Then, whenever you
modify a 'watched' file type (folder X extension), the
most recent version will synced in a cloud drive.
7. The Ruby watcher daemon
can be stopped by running executing
"cd PATH_TO_FOLDER_WATCHER"
and then
"kill -15 $(cat
daemons.rb.pid)"
from the terminal
other people's data and tools
for data management, loosely organized and in no
particular order
General
Comparative Data -- ACE Electoral
Knowledge Network
http://aceproject.org/epic-en/
Universitaet Bern - Comparative
Political Data Sets
http://www.ipw.unibe.ch/content/team/klaus_armingeon/comparative_political_data_sets/index_ger.html
SourceOECD:
http://caliban.sourceoecd.org/vl=97433220/cl=14/nw=1/rpsv/home.htm
Data - Gapminder
http://www.gapminder.org/data/
BHPS - Institute for Social &
Economic Research (ISER) [Panel]
https://www.iser.essex.ac.uk/bhps
DIW Berlin: About SOEP [Panel]
http://www.diw.de/en/diw_02.c.299771.en/about_soep_2.html
Managing and Visualizing Data
Online and Open-Source Resources
for Data Sourcing, Visualization, and Analysis -
Professor Bear Braumoeller
https://sites.google.com/site/braumoellerosu/ug-stats-resource-page
Many Eyes
http://www-958.ibm.com/software/data/cognos/manyeyes/page/Tour.html
Data Wrangler
http://vis.stanford.edu/wrangler/
google-refine - Google Refine, a
power tool for working with messy data (formerly
Freebase Gridworks) - Google Project Hosting
http://code.google.com/p/google-refine/
Voting, Elections and Electoral
Systems
Voting America: United States
Politics, 1840 - 2008
http://dsl.richmond.edu/voting/
Election Mathematics
http://electionmathematics.org/
Lijphart Elections Archive - The
Library
http://libraries.ucsd.edu/locations/sshl/data-gov-info-gis/ssds/guides/lij/
Constituency-Level Elections
Dataset
http://www.cle.wustl.edu/index.php/datasets/build
Constituency-Level Elections
Archive (CLEA)
http://www.electiondataarchive.org/
The Comparative Study of Electoral
Systems
Replication data for: Democratic
Electoral Systems Around the World, 1946-2000 - Matt
Golder Dataverse - IQSS Dataverse Network
Binghamton University -
Institutions and Elections Project
http://www2.binghamton.edu/political-science/institutions-and-elections-project.html
Parliamentary Coalitions
Cabinets and Coalition Bargaining:
data
http://www.erdda.se/index.php/projects/cpd/data-archive
Parliament and government
composition database (ParlGov)
Coalition formation in Iceland
1945-2003 | politicaldata.org
http://www.politicaldata.org/?p=3
Steven Fish's Parliamentary Powers
Index Data,
http://polisci.berkeley.edu/people/faculty/FishM/PPIdata.xls
(codebook and scores)
Welfare and Felons
Publications - Comparative Welfare
State Data
http://www.lisproject.org/publications/welfaredata/welfareaccess.htm
The Welfare Rules Database
http://anfdata.urban.org/wrd/WRDWelcome.cfm
State Felon Voting Laws - Felon
Voting - ProCon.org
http://felonvoting.procon.org/view.resource.php?resourceID=286
Christopher Uggen's felon
disenfranchisement data
http://www.soc.umn.edu/~uggen/felon_disenfranchisement.htm
Searchable Execution Database |
Death Penalty Information Center
http://www.deathpenaltyinfo.org/executions
US States
Redisctricting - Public Mapping
Project
http://www.publicmapping.org/resources/state-resources
Open States: discover politics in
your state
Partisan Division of American State
Governments, 1834-1985
http://www.icpsr.umich.edu/icpsrweb/ICPSR/studies/00016/version/1
Klarner State Partisan Balance Data
http://www.indstate.edu/polisci/klarnerpolitics.htm
Full-text state statutes and
legislation
State and Local Public Policies in
the United States
http://www.statepolicyindex.com/
Stateline - News about state
government and politics from The Pew Center on the
States
http://www.pewstates.org/projects/stateline
National Institute on Money in
State Politics | Follow The Money
http://www.followthemoney.org/index.phtml
International Relations-ish
Peace and Conflict Datasets -
Uppsala University, Sweden
http://www.pcr.uu.se/research/ucdp/datasets/
Country Memberships in Selected
Intergovernmental Organizations and Accession to
Selected Regional and Global Treaty Regimes: Global,
Country-Year Format, 1955-2010
http://www.icpsr.umich.edu/icpsrweb/ICPSR/studies/30541
Global Terrorism Database
Congressional Campaigning and
Congress
Campaign Finance | Influence
Explorer
http://data.influenceexplorer.com/#
Charles Stewart's congressional
data page
http://web.mit.edu/17.251/www/data_page.html
E. Scott Adler
http://sobek.colorado.edu/~esadler/Congressional_District_Data.html
Supreme Court of the United States
Supreme Court Dialogs Corpus -
LLee-Research-Collaborators - Confluence
https://confluence.cornell.edu/display/llresearch/Supreme+Court+Dialogs+Corpus
The Supreme Court Database
http://scdb.wustl.edu/data.php
Other
CAP
http://www.comparativeagendas.org/
Comparative Constitutions Project
http://www.comparativeconstitutionsproject.org/data.htm
Measuring Worth - Annual RPI and
Average Earnings for Britain
http://www.measuringworth.com/ukearncpi/
Noun Project artists
Paper designed by Tom Schott
Blender designed by Simon Child
Scroll designed by Eduardo Souza
Floppy Disk designed by Mike Wirth
Person designed by Antonis Makriyannis
all from The
Noun Project
Not cited icons in the
public domain