Archive for December, 2013

Setting Up a Portable Library with ZotFile

Lee Hachadoorian on Dec 14th 2013

For the last two years, I have used a combination of calibre and Zotero to manage my research sources, mostly PDFs of journal articles. Zotero is great for reference management and automatic citation. I force my first-year seminar students to use it for their research papers, and even upper division students who have not used a reference manager before have their minds blown when they realize they no longer need to keep track of where the commas go in a citation. Enough people love Zotero that I hardly need to sing its praises. But I don’t like its obtuse, iTunes-like management of your library in a hierarchy of meaninglessly named subfolders, and I also wanted something that could sync my library to my Kindle DX.

I started using calibre, which is primarily intended as an e-reader manager, for that reason, and also for the fact that it allows easy conversion to e-reader file formats from HTML, DOC(X), and also from EPUB (which the Kindle can’t read) to MOBI (which it can). (It does offer PDF conversion as well, but I found the results to be not very good, so I read native PDFs on the Kindle.) Additionally, while calibre also does not give you control over the library folder hierarchy and file naming, it at least uses a human-readable hierarchy based on <author(s)>/<article name>/<article name>.<extension>. (Article name is duplicated in the folder hierarchy and the file name because multiple formats of the article, such as PDF and EPUB, may coexist in the folder.)  This meant that when I found a journal article I wanted to read, I had to import it to calibre, import the bibliographic data to Zotero, and link from the Zotero database to the file in the calibre storage hierachy. While no single step is difficult in and of itself, doing three things instead of one always inspires a certain amount of laziness, so it meant that my libraries often got out of sync. In practice this usually meant that I had the article to read on my Kindle, but not in Zotero. Additionally, time I spent updating metadata in calibre had limited payoff because I couldn’t use calibre for citation.

Since nothing sidetracks writing a paper like finding out your sources aren’t in order, I’ve decided it’s more important to prioritize the reference manager, and want to use Zotero to manage my library. Fortunately, Zotero has some ways to add these desired features, including the ZotFile plugin for library management (which has been around for awhile, but since I was managing my library in calibre, I haven’t used ZotFile until now). ZotFile lets you specify an alternate location to store your attached files, and gives you control over the folder hierarchy and file naming (similar to Mendeley, or to many music players; note, calibre also gives you this kind of control, but you have to export your library to an alternate location, duplicating all your files–it doesn’t allow you to mess with its internal library structure). The instructions for doing this on the developer’s web page were a little unclear to me, so I went looking for help in the Zotero forums, and found a thread from today started by a new user who was looking for guidance in how to do the same thing. In this post, I’ll explain how to accomplish this.

First, you have to understand that Zotero draws a distinction between saving a file internally (which it calls “stored” files), and saving a link to a file anywhere on your hard drive, though both stored and linked files are called “attachments”. Part of the reason why its internal naming is so obtuse is probably because they don’t want you messing with it and moving files around. If you want a pretty, human-readable hierarchy, you need to tell ZotFile how to construct that hierarchy. Since linked files can be anywhere on your hard drive, by default Zotero saves their location using absolute paths. If you want to share your files across computers, you need to instead tell Zotero to interpret all file paths relative to your human-readable hierarchy.

  1. Go to Zotero Preferences (using File→Preferences, or using the gear icon). Click the Advanced icon at the top, then the Files and Folders tab.
  2. Under Linked Attachment Base Directory, hit the Choose button and use the file browser to pick the folder where you want your library to be organized:ZoteroPrefsFilesAndFolders
    NOTE: You do not have to change the Data Directory Location. This is the location of your Zotero database, and also where PDFs are stored internally, but the whole point of what we are doing is to not store the files internally.
  3. Now go to ZotFile (not Zotero) Preferences, by clicking the gear icon, and go to General Settings.
  4. Under Location of Files, click Custom Location, and set it to the same folder you just set as the Linked Attachment Base Directory.

    ZotFileGeneralSettings

  5. Check “Use subfolder defined by”. The default, `/%w/%y`, will organize your files into directories by journal/publisher (uses the publisher name if there is no journal name, e.g. for books) and year. Since I want to be able to navigate this directory sensibly, and I can’t always remember the year a paper was written, I dropped year from the definition. The codes used here and in the next stop are listed in detail at the ZotFile website.
  6. Click the Renaming Rules tab. Leave “Use Zotero to rename” unchecked. The default naming rule is `{%a_}{%y_}{%t}` which would generate something like “Smith_2013_This is my title.pdf”. I don’t like underscores in my filenames, so I set my renaming rule to `{%a }{%y – }{%t}`, which would produce “Smith 2013 – This is my title.pdf”, and changed the delimiter between multiple authors to an ampersand surrounded by spaces. Others might prefer a comma. If the filesystem can handle long names, I don’t see why I shouldn’t take advantage of that, so I unchecked both “Truncate title after . or : or ?” and “Maximum length of title”. I left the maximum number of authors at 2, and the use of “et al” for more than two authors.ZotFileRenamingRules
  7. At this point you can select an item in the main Zotero window and click the Update button at the top of the dialog to see how the file will be renamed. If you are satisfied with it, hit the Close button.
  8. Now we want to actually move our attached files to this new hierarchy. I began by sorting my library on the attachments column (just click on the paper clip at the top of the column). Then Shift+Click to select all the items with attachments. Right-click on the selected files and choose Manage Attachments→Rename Attachments. ZotFile will now move the files to the Location of Files specified in the preferences. It will do this for both attachments, like the files in my calibre library, and Zotero’s own internally stored files, which will become attachments in the new location, and no longer be stored internally. But this will not move web page snapshots, which stay internal.

Do keep in mind that ZotFile does not copy the files, it moves them. Since my attached files were in my calibre library, and I’m not giving up on calibre just yet, I didn’t really want them deleted from their original location. I backed up my calibre library so that I could allow ZotFile to move the files to the new location, then restored my calibre library from the backup. But I kept the backup for the next step. Since I had a lot of sources in the Zotero database (hundreds) that were not linked to the PDFs in calibre, I could link to the PDFs in this backup, then move them with Manage Attachments→Rename Attachments without affecting my calibre library.

Storing the files this way has two advantages over storing them internally. First, since they are in a human-readable hierarchy, I can pretty quickly find a file through the file browser of another application—for example, if I am writing an email to a colleague and want to attach an article— without having to switch to Zotero first. Second, although Zotero supports WebDAV for library syncing, and Zotero’s own storage is not that expensive, using ZotFile to organize your attachments this way allows you to use any cloud service to keep your library synced across computers, such as Dropbox (mentioned by the new user who started the forum thread linked above) or SpiderOak (my preferred backup/share/sync service).

I ran into a little bit of an issue in that I use Zotero Standalone. This requires me to also have Zotero for Firefox installed so that I can import sources while web browsing. But the preferences did not propagate between them (for either Zotero or ZotFile), so I had to independently set the Linked Attachment Base Directory, Location of Files, and Renaming Rules in both Standalone and the Firefox plugin.

While I’m pretty happy with the result, this all leaves calibre and Kindle syncing out of the equation. Using external PDF reader applications, ZotFile can also manage syncing PDFs, including annotations, between your Zotero library and iPad or Android tablets. Maybe there’s a way to get this to work with calibre to keep my library synced with my Kindle? That will be the next thing to figure out…

Thanks to Zotero forum users bwiernik and adamsmith.

 

Filed in Productivity | 3 responses so far

Should We Tax Internet Retail?

Lee Hachadoorian on Dec 7th 2013

Last weekend I saw an episode of The Good Wife (it’s a few weeks old, I’m a little behind) in which the governor-elect of Illinois decides to send a message to fictional tech giant ChumHum by publicly floating the possibility of collecting taxes on the sales of out-of-state, internet-based companies. Then at the beginning of this week the Supreme Court declined to hear Amazon’s appeal of New York State’s real-life law requiring just that. (ChumHum always struck me as a Google stand-in rather than an Amazon stand-in, but, whatever.) People tend to view Amazon as the evil giant in this case, with some commenting that “It’s about time” they started paying their fair share. But I think there’s a tendency to lump this in with more general concerns about corporate tax avoidance, and I want to suggest some reasons why the new regime is undesirable.

First, Amazon isn’t necessarily going to be the one paying the tax. Sales taxes tend to get split between the seller and the consumer, with consumers absorbing more of the tax on necessities (it’s difficult to stop buying food, or, for that matter cigarettes), and sellers absorbing more of the tax on luxuries. Now, Amazon is probably mostly selling things that fall more toward the luxury end of the spectrum, but some of the tax will be absorbed by consumers. Of course, the real point of the law is that requiring Amazon to collect sales taxes levels the playing field between out-of-state and in-state businesses, but some sales Amazon would have made won’t be substituted by an in-state purchase, because the consumer will decide that the after-tax price is too high. This represents a loss to Amazon, no gain to any in-state seller, and a loss to the consumer. Some consumers will still make purchases, so the state government will still collect new revenue.

Second, and more important, sales taxes are fairly regressive. Lower-income households spend a relatively greater proportion of their income than upper-income households, so if we consider the tax as a percentage of income, lower-income households are paying a higher percentage. New York tries to make the sales tax less regressive by exempting necessities like food, but it’s tax exemptions are notoriously bizarre. For example, nuts are not taxable, unless they are honey-roasted, in which case they become taxable again. Rather than extend a regressive tax to out-of-state purchases, New York could reduce the sales tax on in-state purchases. The lost revenue could be made up by increases in the income tax or (for localities like New York City that rely on a sales tax increment) the property tax. This would be a more progressive outcome, but of course it is much harder politically to raise taxes on in-state sources than to impose a tax that seems to fall on an out-of-state source. But since the sales tax reduction would increase in-state sales, in theory the lost revenue could be offset (this would need to be modelled) by increased revenue from business income taxes and from property taxes, even without an increase in those tax rates.

Third, the whole reason this is an issue is because it was relatively easy for consumers to avoid the sales tax by ordering from out of state. One could argue that governments should try to avoid taxes which are easily avoided. Out of the big three, sales taxes are most easily avoided, income taxes less so (there is some debate over the impact of tax-related migration, but one recent study flat out calls tax flight a “myth”, Gerard Depardieu’s move to Russia notwithstanding), and property taxes are least easy to avoid. In fact, the land portion of the property tax is completely unavoidable, while the capital (structure or building) portion may cause some capital flight if the tax is much higher than in competing jurisdictions. Because sales taxes are relatively easy to avoid, and because there are a large number of taxing jurisdictions that businesses have to keep track of, there have been some noises in Congress about standardizing sales tax rules across the states. This is a bad idea for reason number two, regressivity. Consumption taxes are pretty popular among conservatives as an alternative to the income taxes, I would argue specifically because consumption taxes are so regressive (but see Robert Frank’s discussion of a progressive consumption tax). My concern is that if we back ourselves into a national sales tax, it will gradually eat away at the income tax, leading to an overall more regressive tax system.

Finally, to the extent that this tax does fall on Amazon, we can ask what kinds of businesses we want to be taxing. The Mining, Quarrying, and Oil and Gas Extraction sector pays on average 6% of corporate income in taxes [gated link]. So if we were looking for new revenue…

 

Filed in Federalism,Public Finance | Comments Off on Should We Tax Internet Retail?

Maps of NYPD Stops, 2011

Lee Hachadoorian on Dec 2nd 2013

 

The Bronx is heavily Black and Latino, and shows a high number of NYPD stops over much of the borough.

The Bronx is heavily Black and Latino, and shows a high number of NYPD stops over much of the borough.

 

There have been a lot of ups and downs in the battle over the NYPD Stop and Frisk program. Over the Summer, a federal judge ruled the program unconstitutional as practiced, and appointed a federal monitor to oversee reforms. Then, a month ago, a federal appeals panel removed Judge Scheindlin from the case, and put a stay on her orders. Bill de Blasio was  elected mayor promising to drop the City’s appeal, but lame duck Mayor Bloomberg tried to push the appeal to a full overturning of Judge Scheindlin’s ruling before leaving office. Now the full Second Circuit has put on hold any further action while the litigants negotiate—clearly taking the ball from Bloomberg and passing it to the mayor-elect.

nypd_stop_and_frisk_2011_Brooklyn_Queens

Stops are concentrated in predominantly Black and Latino neighborhoods like Bedford-Stuyvesant and East New York in Brooklyn, and East Elmhurst and Jamaica in Queens.

 

Much of the focus in the case has been on whether the Stop and Frisk program was implemented in a racially biased manner, with considerable concern over the targeting of young Blacks and Latinos. The maps I’ve created, based on the 2011 statistics, do show many more stops taking place in predominantly Black and Latino neighborhoods. The maps do not show the race of the people being stopped, an important consideration in the trial, as plaintiffs presented evidence that the “hit rate”—stops that actually led to the discovery of a crime—was much lower for Black and Latinos than for Whites, indicating that the police were using a different, and looser, standard for what they regarded as suspicious behavior by Blacks and Latinos.

The main exception to the  correlation between neighborhood demographics and volume of police stops is in Manhattan. We do see a concentration of stops in the Black and Latino neighborhoods of Harlem and Washington Heights, but we also see generally higher stops in Manhattan than in the outer boroughs. Doubtless this is due to Manhattan’s generally higher nonresidential population (commuters, shoppers, etc.), as well as the generally higher pedestrian counts in Lower Manhattan and Midtown.

Manhattan, with its high daily influx of nonresidents for employment, shopping, and commercial activities, has high numbers of NYPD stops throughout the borough.

Manhattan, with its high daily influx of nonresidents for employment, shopping, and commercial activities, has high numbers of NYPD stops throughout the borough.

 

While the differences in “hit rate” helped Judge Scheindlin conclude that this policy led to “indirect racial profiling”, the ridiculously low yield—less than 12% of stops led to a summons or arrest in 2011 (about equally split)—suggests that the police are extremely poor judges of suspicious behavior. But what do you expect of a policy that allows the police to stop someone for “inappropriate attire for season” (about 7.5% of stops in 2011)?

Staten Island's population is more White, and subject to fewer police stops.

Staten Island’s population is more White, and subject to fewer police stops.

 

Filed in GIS,Governance | One response so far

Skip to toolbar