Skip to content

Instantly share code, notes, and snippets.

View mdlincoln's full-sized avatar

Matthew Lincoln mdlincoln

View GitHub Profile
.............. . . . . . .... . .. . ..... . .... . .. . ..... . .... . ..
......... .... . . . . .. . . . . . . . . . .. . .. . .
.............................. . .. . ........ .................................
.............. . .. . . .. . . . .. . . . ...+I?=......... .. . .... . ...
................................. ........... ....II?==,........................
..................................................7I?==~.......... . .. . ......
.................................................=7I+=~~........................
................ ........... . . .. . .. . ..77?+==~...... . ........... ...
................................ ... .. . ......~$I+=~=:...... ..... ...... ...
SELECT DISTINCT ?id ?pref_name ?birth_year ?death_year ?birth_place ?death_place ?nationality ?bio_description ?scope_note ?pref_role
WHERE {
?artist skos:inScheme ulan: ;
dc:identifier ?id ;
rdf:type gvp:PersonConcept ;
dc:identifier ?id ;
xl:prefLabel [xl:literalForm ?pref_name] .
?artist foaf:focus [gvp:biographyPreferred ?bio] .
?bio schema:gender aat:300189557 .

Keybase proof

I hereby claim:

  • I am mdlincoln on github.
  • I am mdlincoln (https://keybase.io/mdlincoln) on keybase.
  • I have a public key whose fingerprint is 5271 D84C 193A 4B9B 945C D4AA D3AB 2911 2CAD 6E14

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am mdlincoln on github.
  • I am mdlincoln (https://keybase.io/mdlincoln) on keybase.
  • I have a public key whose fingerprint is 5271 D84C 193A 4B9B 945C D4AA D3AB 2911 2CAD 6E14

To claim this, I am signing this object:

@mdlincoln
mdlincoln / project.R
Last active August 10, 2016 01:28
Maintain other attributes when making a bipartite projection
library(igraph)
library(dplyr)
# Assume you have a dataframe "objects" with columns "object_id", "artist_id", "date"
# Create an identical table that just gives a new variable name to "artist_id"
flipped_objects <- objects %>% rename(artist_id = artist2_id)
# Join the tables together (essentially joining objects to itself, creating every combination
# of artist that share an object_id and date
edges <- objects %>%
@mdlincoln
mdlincoln / excel_utf8.sh
Created September 21, 2015 20:22
How to convert text files from OS X excel into UTF-8
iconv -t UTF8 -f MACROMAN < file.csv > file-utf8.csv
@mdlincoln
mdlincoln / coordinates.csv
Last active April 9, 2016 02:45
Euro population data
city coordinates
'S HERTOGENBOSCH 51.69917,5.30417
AACHEN 50.77664,6.08342
AALST 50.93604,4.0355
ABBEVILLE 50.1,1.83333
ABERDEEN 57.14369,-2.09814
ACIREALE 37.60666,15.16279
AGEN 44.2,0.63333
AIX EN PROVENCE 43.5283,5.44973
ALBI 43.9298,2.148
@mdlincoln
mdlincoln / doc_data.R
Last active March 7, 2016 19:39
Create a skeleton documentation string for an R data.frame
doc_data <- function(d) {
# Get column names and types
vartype <- vapply(d, typeof, FUN.VALUE = character(1))
# Write individual item description templates
items <- paste0("#\' \\item{\\code{", names(vartype), "}}{", vartype, ". ###}", collapse = "\n")
# Return the full documentation template
paste0("#\' DATASET TITLE
#\'
@mdlincoln
mdlincoln / iconclass_atomic
Last active December 21, 2015 01:48
This is an attempt to define a regular expression that will capture the various particles of an Iconclass notation in its match groups. The Iconclass schema is described here: http://www.iconclass.nl/contents-of-iconclass
(\d{1,2})([A-Z]{1,2})?(\d{1,5})?(\(\w*\))?(\d{1,2})?(\(\+\d\))?
@mdlincoln
mdlincoln / range_simulation.R
Last active December 18, 2015 16:33
Animated GIF of simulation replications
library(ggplot2)
library(dplyr)
library(animation)
load(url("http://matthewlincoln.net/assets/docs/sim_data.rda"))
saveGIF({
# We want one frame per replication
for(i in 1:max(bm_raw_sims$r)) {