CShapes: Historical Country Boundaries →

Thanks to my colleague (and co-host) Elijah Meeks for pointing me to a project by Nils Weidmann, who has put together CShapes – an R package and GIS shapefile of country boundaries and capitals between 1946 and 2008.

Syllabus for Digital History

This fall I am teaching an undergraduate/graduate colloquium called “Digital History,” joining the lineup of the History Department’s stellar Visualizing Evidence, Spatial History, and The Digital Historian’s Toolkit. My aim is to get students familiar with various approaches to digital history – data mining, spatial history, visualization, and so on – and how to apply these approaches to historical questions.

The main outcome for the course will be a beta project that serves as an equivalent to a capstone paper. To get there, the undergraduates in the course are spending our time focusing on the history of Silicon Valley and exploring questions and issues relevant to this region’s history. That means I’ll have students working in the university archives, digitizing material, creating historical data, and building visualizations. I have some additional ideas for the graduate students in the course, which I will share soon. I cannot wait to see what we all come up with over the course of the quarter.

Here is the syllabus for the course.

First Draft Podcast: Liberation Technology →

This week: We talk about the accessibility of computational tools, systems, networks, data-driven decision making, neotopology, and pushback from specialists.

First Draft Podcast: Humanities Savior Narrative →

Friend of the show Glen Worthey joins us to talk about DH14, the popularity of digital humanities projects, the humanities savior narrative, and ‪#‎dhsheep‬.

Environmental History at the 2014 Western History Association Conference

I’m stealing an idea from my friend and fellow Husker Brenden Rensink. Brenden just wrote a post summarizing borderlands and transnational history panels – his area of study – at the Western History Association Conference this year. I thought I’d do similar with environmental history.

To reiterate from Brenden’s post, the Western History Association is meeting in Newport Beach, California, between October 15 to October 18 with the theme “The West & the World.” Like Brenden, I’m listing any panel that includes some theme on environmental history even if that only includes a single paper. If I’ve missed a panel or paper, let me know on Twitter.

Thursday, October 16 8:30am-10:00am

Conquering the Meat Frontier: North American Ranching in the Nineteenth Century

  • Chair: Jeff Roche, College of Wooster
  • Nicholas Foreman, University of Florida - The Irish Face of American Expansion: Philip Nolan and the Stealing of New Spain
  • Michael M. Miller, University of North Texas - The XIT Ranch of Montana: Experiments in Imperial Ranching, 1889-1909
  • Matt Todd, University of Saskatchewan - World Diseases and New World Curses: The (Misleading) Creation of a Ranching Eden in the Canadian West
  • Comment: Jon Coleman, University of Notre Dame

The Legal and Physical Infrastructure of Southern California Water

  • Chair & Comment: Donald J. Pisani, University of Oklahoma
  • Tanis C. Thorne, University of California-Irvine - Settling with Indians: Phil Swing and the Scattering Policy at El Capitan
  • Jason A. Robison, University of Wyoming College of Law - Another Frontier of the Evolving Law of the River: The Quantification Settlement Agreement and its Discontents
  • Peter L. Reich, Whittier Law School - The All-American Canal and Civil-Common Law Divide

Thursday, October 16 10:15am-11:45am

The West and the World: Pacific Connections, Pacific Possibilities

  • Chair: Jennifer Thigpen, Washington State University
  • Adria Imada, University of California, San Diego - Visual Cultures of Leprosy: Pacific Tropicality, Disease, and Embodiment
  • Josh Reid, University of Massachusetts, Boston - Comekala, Indigenous Explorer of the North Pacific
  • Matt Basso, University of Utah - Land or Labor: The Fracture of Pacific Settler Masculinity in the United States and New Zealand
  • Comment: David Igler, University of California, Irvine

Western History in the Imagination and on the Landscape

  • Chair: Sherry Smith, Southern Methodist University
  • Cody H. Smith, Oklahoma State University - Reiten mit dem Teufel (Riding with the Devil): German Heavy Metal Music and Representations of the Dalton Gang
  • Cathleen D. Cahill, University of New Mexico – “The West of the Indian…and white, of jazz and airplanes”: The Albuquerque First American Pageant, 1929-1931
  • Alexandra Ritter, University of Arizona - Making Waves: Southern California Surfers’ Developing Relationship with Nature from the 1950s to the 1980s
  • Comment: Susan Sessions Rugh, Brigham Young University

Friday, October 17 8:30am-10:00am

Teaching “America’s Best Idea”: Lessons from a Century (and More) of National Parks: A Roundtable Discussion with Images and Documents

  • Chair: Char Miller, Pomona College
  • Participants:
    • Jonathan Foster, Great Basin College
    • Jeffrey Shepherd, University of Texas at El Paso
    • Eric Nystrom, Rochester Institute of Technology
    • Michael Childers, University of Northern Iowa
    • Michael Welsh, University of Northern Colorado
    • Comment: Kenneth Orona, Longmont, Colorado

Borderlandscapes of the Rio Grande

  • Chair: Sterling Evans, University of Oklahoma
  • Timothy Paul Bowman, West Texas A&M University - “Goodbye, Great River”: A Transnational History of the Rio Grande’s Destruction
  • Peter A. Kopp, New Mexico State University - Fabian Garcia: Borderland Horticulturalist
  • Jerry D. Wallace, University of New Mexico - “All Over New Mexico”: Dale Bellamah and the Reshaping of the Southwest’s Built Environment in the Early Cold War Era
  • Comment: Benjamin Johnson, Loyola University Chicago

How Labor Shapes the West

  • Chair: Leisl Carr Childers, University of Northern Iowa
  • Joel Zapata, Southern Methodist University - Women’s Transnational Response to the North American Free Trade Agreement
  • Tom Fujii, California State University, Fullerton - Planting Our Roots: Nikkei Labor and Business in Orange County, California
  • Bernadette Jeanne Pérez, University of Minnesota, Twin Cities - Sugar Beet Fields, Agribusiness, and the Negotiation of Political Difference in the Upper Arkansas River Valley, 1900-1924
  • Comment: Erik Loomis, University of Rhode Island

Friday, October 17 10:30-Noon

Nature, Science, the West, and the World

  • Chair: Sterling Evans, University of Oklahoma
  • Adrian Howkins, Colorado State University - A Northward Course of Empire? Alaska, the Arctic, and the Globalization of Western History
  • Jeremy Vetter, University of Arizona - The American West as a Region in World Science: Colony, Frontier, or Emerging Center?
  • Karen Lloyd D’Onofrio, University of Colorado Boulder - Bringing the World to Denver: An Investigation of the Pacific Rim Natural History Explorations and Displays at the Denver Museum of Nature and Science
  • Comment: Kathleen Brosnan, University of Oklahoma

Friday, October 17 2:30pm-4:00pm

Rethinking the “Colossus of Roads”: Transportation Infrastructure and the Development of British Columbia

  • Chair: Frank Leonard, University of Victoria
  • Frank Leonard, University of Victoria - Unromancing the Road: The Cariboo Wagon Road as British Columbia’s First Mega-Project
  • Ben Bradley, University of Toronto - British Columbia’s Premier Drive Through the Past: Cultivating a Canadian Frontier Heritage Along the Cariboo Highway, 1925-1960
  • Philip Van Huizen, University of Alberta - Resource Roads, Wilderness Recreation, and the Paradox of Multiple Use Planning in British Columbia and Washington
  • Comment: Ted Binnema, University of Northern British Columbia

Saturday, October 18 10:30am-12:00pm

The Mining West and the World

  • Chair: Liping Zhu, Eastern Washington University
  • Emmanuelle Perez Tisserant, Ecole des Hautes Etudes en Sciences Sociales, Paris - Too Lazy to Find El Dorado? A Spatial and Political History of Finding Gold in California
  • Jeremy Mouat, University of Alberta - The St. Eugene Arbitration of 1907, Western Mines, and the World of Ideas
  • Brian Leech, Augustana College - Gentle Destruction: Mining Subsidence, Sinking Houses, and Property Protests in Butte, Montana, and around the World
  • Steven Danver, Walden University - Uranium Mining and Native Communities in Southwestern United States, Canada, and Niger
  • Comment: Eric Nystrom, Rochester Institute of Technology

Saturday, October 18 2:30pm-4:00pm

Rethinking Nature with Boom: A Journal of California

  • Chair: Jon Christensen, UCLA, Editor, Boom: A Journal of California
  • Participants:
    • Peter Alagona, University of California, Santa Barbara
    • Glen MacDonald, University of California, Los Angeles
    • Rue Mapp, Outdoor Afro
    • Amy B. Scott, Chief Curator and Marilyn B. and Calvin B. Gross Curator of Visual Arts, Autry National Center of the American West, Los Angeles.

Remembering Norris Hundley – Pioneer Scholar, Mentor, Teacher, and Editor of the Pacific Historical Review

  • Participants:
    • Albert Camarillo, Stanford University
    • Carl Abbott, Portland State University
    • Ernesto Chávez, University of Texas, El Paso
    • Miroslava Chávez-Garciá, University of California, Santa Barbara
    • David Johnson, Portland State University

And of course, I would be remiss if I didn’t point out digital history sessions. The Technology Committee, of which I am a part, is sponsoring another Six Shooters lightning session this year on Thursday 2:30pm-5pm. There’s rumors of a cupcake reception afterwards. Presenters are limited to six minutes and six slides. We have some great speakers lined up already and we will be announcing them soon.

Finally, I am also chairing the panel “Western Encounters, Alliances, and Experiences: Mormons, Indians, and U.S. Federal Law” on Saturday, 8:30am-10:00am. The full program is here.

If you’re going to be at the Western, get in touch and let’s go grab coffee. Or the beach.

First Draft Podcast: The Pragmatic Tyranny of Building Digital Artifacts →

This week: we discuss my experiences working on the Geography of the Post, D3.js, and the challenges of designing, and critically engaging with, interactive scholarly works.

Simple Parsing CSV to JSON

I took a moment yesterday morning to start work on a Ruby script to convert CSV files to JSON. My main motivation for writing the script was to get data into a format that more easily works with D3.js.

D3 has two main ways to load data: JSON or CSV. Although CSV has its benefits, the data is untyped. Because of that, D3 loads all the data as strings rather than differentiating between strings and integers. I could do the conversion on the fly with D3 pretty easily using built-in functions or coerce the data with JavaScript. But sometimes I like prepping data before I begin working with it.

The script builds JSON using the first line of the CSV file to determine the appropriate elements and the corresponding data, as well as checking that integers and strings are converted to their appropriate (typed) formats. And the script seems fairly robust; I noticed hardly a pause when throwing a 14,000-line CSV file at it. There are no built-in specifics to the data mapping; you’ll need to handle that either by modifying the script or handling it in D3.

The script:

#!/usr/bin/env ruby

# Parse CSV files and convert them to JSON.
# Mostly used for preparing data for D3.js. I don't like using untyped
# CSV files, so this script begins to clean things up for me.

# Usage: ./parse.rb /path/to/input.csv /path/to/output.json

# Jason A. Heppler | jason@jasonheppler.org | jasonheppler.org
# MIT License <http://heppler.mit-license.org/>
# Created: 2014-07-10

require 'rubygems'
require 'json'
require 'csv'

def is_int(str)
  # Check if a string should be an integer
  return !!(str =~ /^[-+]?[1-9]([0-9]*)?$/)

lines = CSV.open(ARGV[0]).readlines
keys = lines.delete lines.first

File.open(ARGV[1], "w") do |f|
  data = lines.map do |values|
    is_int(values) ? values.to_i : values.to_s
  f.puts JSON.pretty_generate(data)

Say I give it an input like this (postwar population of Bay Area cities):

date,San Jose,Palo Alto,Sunnyvale,Mountain View,Santa Clara

And in return I get this:

    "date": "1940",
    "San Jose": "68457",
    "Palo Alto": "16774",
    "Sunnyvale": "4373",
    "Mountain View": "3946",
    "Santa Clara": "6650"
    "date": "1950",
    "San Jose": "95280",
    "Palo Alto": "25475",
    "Sunnyvale": "9829",
    "Mountain View": "6563",
    "Santa Clara": "11702"
    "date": "1960",
    "San Jose": "204196",
    "Palo Alto": "52287",
    "Sunnyvale": "52898",
    "Mountain View": "30889",
    "Santa Clara": "58880"
    "date": "1970",
    "San Jose": "445779",
    "Palo Alto": "55966",
    "Sunnyvale": "95408",
    "Mountain View": "51092",
    "Santa Clara": "87717"
    "date": "1980",
    "San Jose": "629442",
    "Palo Alto": "55225",
    "Sunnyvale": "106618",
    "Mountain View": "58655",
    "Santa Clara": "87746"
    "date": "1990",
    "San Jose": "782225",
    "Palo Alto": "55900",
    "Sunnyvale": "117229",
    "Mountain View": "67460",
    "Santa Clara": "93613"
    "date": "2000",
    "San Jose": "894943",
    "Palo Alto": "58598",
    "Sunnyvale": "131760",
    "Mountain View": "70708",
    "Santa Clara": "102361"
    "date": "2010",
    "San Jose": "945942",
    "Palo Alto": "64403",
    "Sunnyvale": "140081",
    "Mountain View": "72510",
    "Santa Clara": "112466"

Note that the data transformation for this particular example probably isn’t the best. A more useful JSON construction would group the data together with child nodes, for example:

    "name": "San Jose",
    "values": [
        "date": 1940,
        "population": 945942
        "date": 1950,
        "population": 95280

But if you need a simple CSV to JSON transformation, the script starts getting you there.