war stories: programming in the field of medieval history

Post on 14-Apr-2017

465 Views

Category:

Engineering

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

War Stories

Programming in the field of Medieval History

Tara L Andrews (@tla) Assistant Professor of Digital Humanities, University of Bern

How do we write history?

Matthew of Edessa

He went through the wars. And then his text did, too.

Interlude: A fragile history

package Text::Tradition::Collation::Data; use Moose; use Graph; use Text::Tradition::Datatypes;

has 'sequence' => ( is => 'ro', isa => 'Graph', default => sub { Graph->new() }, handles => { paths => 'edges', }, ); has 'relations' => ( is => 'ro', isa => 'Text::Tradition::Collation::RelationshipStore', handles => { relationships => 'relationships', related_readings => 'related_readings', get_relationship => 'get_relationship', del_relationship => 'del_relationship', equivalence => 'equivalence', equivalence_graph => 'equivalence_graph', relationship_types => 'types' }, writer => '_set_relations', );

package Text::Tradition::Directory;

use strict; use warnings; use Moose; use DBI; use Encode qw/ encode decode_utf8 /; use KiokuDB::GC::Naive; use KiokuDB::TypeMap; use KiokuDB::TypeMap::Entry::Naive; use Safe::Isa; use Text::Tradition::Error;

## users use KiokuX::User::Util qw(crypt_password); use Text::Tradition::Store; use Text::Tradition::User; use Text::Tradition::TypeMap::Entry;

extends 'KiokuX::Model';

use vars qw/ $VERSION /; $VERSION = "1.2";

=head1 NAME

Text::Tradition::Directory - a KiokuDB interface for storing and retrieving traditions and their owners

=head1 SYNOPSIS

[warn] leaked objects: .--------------------------------------------------------------+----------. | Class | Count | +--------------------------------------------------------------+----------+ | Text::Tradition::Collation::Data | 1 | '--------------------------------------------------------------+----------' [warn] leaked objects: .--------------------------------------------------------------+----------. | Class | Count | +--------------------------------------------------------------+----------+ | Text::Tradition::Collation::Data | 1 | '--------------------------------------------------------------+----------' [warn] leaked objects: .--------------------------------------------------------------+----------. | Class | Count | +--------------------------------------------------------------+----------+ | Text::Tradition::Collation::Data | 6 | '--------------------------------------------------------------+----------' [warn] leaked objects: .--------------------------------------------------------------+----------. | Class | Count | +--------------------------------------------------------------+----------+ | Text::Tradition::Collation::Data | 1 | '--------------------------------------------------------------+----------' [warn] leaked objects: .--------------------------------------------------------------+----------. | Class | Count | +--------------------------------------------------------------+----------+ | Text::Tradition::Collation::Data | 6 | '--------------------------------------------------------------+----------' [error] Caught exception in stemmaweb::Controller::Relation->main "Cannot allocate memory during fork at /usr/local/share/perl/5.18.2/Text/Tradition/Collation.pm line 976."

Testing. A cute idea.Mac-c8e0eb150215:base tla$ prove -l t/*.t t/00dependencies.t .............................. ok t/01app.t ....................................... ok t/02pod.t ....................................... ok t/03podcoverage.t ............................... skipped: set TEST_POD to enable this test t/text_tradition.t .............................. ok t/text_tradition_collation.t .................... ok t/text_tradition_collation_relationshipstore.t .. ok t/text_tradition_parser_collatex.t .............. ok t/text_tradition_parser_json.t .................. ok t/text_tradition_parser_self.t .................. ok t/text_tradition_parser_tabular.t ............... ok t/text_tradition_parser_tei.t ................... ok t/text_tradition_witness.t ...................... ok All tests successful. Files=13, Tests=556, 43 wallclock secs ( 0.10 usr 0.03 sys + 40.60 cusr 1.12 csys = 41.85 CPU) Result: PASS

Digital Humanities tenure submission

Textual criticismA war of methodology

Interlude #2: We really have problems.

use strict; use warnings; use feature ‘say’; use WWW::Google::Places; my $api_key = 's33kr1t'; my $place = WWW::Google::Places->new({ api_key => $api_key }); # Google search place my @results = $place->textsearch({ query => $ARGV[0] }); foreach (reverse @results) { say "Id : ", $_->place_id; say "Name : ", $_->name; say "Types : ", join(", ", @{$_->types}); say "Geometry: ", $_->geometry; say "Icon : ", $_->icon; say "Vicinity: ", $_->vicinity; say "Scope : ", $_->scope; say "----------------------------------------"; }

---------------------------------------- Id : ChIJsX7lyvNMSIgRVXRTNgaDlb0 Name : Gihon Elementary School Types : school, point_of_interest, establishment Geometry: Location: Latitude: 39.234044, Longitude: -81.552035 Icon : https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png Vicinity: N/A Scope : GOOGLE ---------------------------------------- Id : ChIJRUzmdd7J5YgR0aKaqFXMhLI Name : Shorstein, Lasnetski, & Gihon Types : lawyer, point_of_interest, establishment Geometry: Location: Latitude: 30.254356, Longitude: -81.627089 Icon : https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png Vicinity: N/A Scope : GOOGLE ---------------------------------------- Id : ChIJYbwjTt06K4gRuKL-IX6oTy0 Name : Gihon Spring Park Types : park, point_of_interest, establishment Geometry: Location: Latitude: 43.754475, Longitude: -79.594406 Icon : https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png Vicinity: N/A Scope : GOOGLE ----------------------------------------

Art or engineering?Skirmishes on the place of

creativity

Thank you! ¡Grácias!

top related