Skip to content

Instantly share code, notes, and snippets.

@tomzeppenfeldt
tomzeppenfeldt / gist:40364ac2a52f57aa520a
Last active August 29, 2015 14:01
Network versioning using transition nodes
= Network versioning using relationnodes
Recently there was a nice blog on versioning networks by Ian Robinson (http://iansrobinson.com/2014/05/13/time-based-versioned-graphs/[read it here]) on using identity nodes and separating structure from state. In this gist I'd like to put in my 2 cents by introducing another approach using _relationnodes_. This is more about structure of a network than about states of nodes, but it treats versioning differently. As Ian states in his blog, there's always a trade-off to be made, since versioning causes an extra load on storage and processing.
== Relationnodes?
=== What are relationnodes?
Relation nodes are intermediary nodes between two network nodes that represents the relation between the nodes.
So, if A and B are two network nodes, instead of connecting them with a relationship of `[:RELTYPE]`,
@philcryer
philcryer / oicr
Created October 6, 2010 02:30
downloads a djvu file, splits it into pages (djvmcvt), parses out ocr'd text (djvused) and also creates an XML of the ocr'd text (djvutoxml)
#!/bin/bash
[[ -n "${1}" ]] || { echo "Usage: oicr.sh IA_BOOK_TITLE"; exit 0 ; }
# sample record ids: catalogueoflepid02briti electronicnaviga00unit halfhoursinfarno00newy nachrichtsblattd3234190012deut
BOOK=${1}
#BASEURL=http://cluster.biodiversitylibrary.org
BASEURL=http://www.archive.org/download
@philcryer
philcryer / bhldata_box.sh
Created October 13, 2010 20:15
Get latest bhl.zip, rename it with the date, generate an md5 of it, move those files into a Dropbox directory, get the public Dropbox URL for that file, create a HTML file containing a link to that, and put that URL and put that HTML in on a webserver.
#!/bin/bash
DATE=`date +%Y%m%d`
TARGET_PATH=/home/phil/Dropbox/Public
WWW_USER=www-data
WWW_GROUP=www-data
WWW_PATH=/var/www/data
if [ ! -d ${WWW_PATH} ]; then
mkdir -p ${WWW_PATH}
chown -R ${WWW_USER}:${WWW_GROUP} ${WWW_PATH}
@hubgit
hubgit / mendeley-fetch.php
Created September 22, 2011 10:57
Minimal PHP class for fetching data from the Mendeley API
<?php
// register at http://dev.mendeley.com/applications/
define('MENDELEY_CONSUMER_KEY', ''); // edit this
class Mendeley {
static function fetch($path, $params = array()) {
$default = array('consumer_key' => MENDELEY_CONSUMER_KEY);
$url = 'http://api.mendeley.com/oapi/' . $path . '?' . http_build_query($params + $default);
return json_decode(file_get_contents($url), true);
Title: eLife Lens - A novel way of seeing content

Abstract

Introduction

Working with digital documents used to be hard because for the most part, they come in presentation-centric formats, optimized for print and having the same display across multiple devices. Ultimately, the display of these documents had been preserved to ultimately allow the user to print the exact same document across any device. Content today, however, is no longer being printed out readily; instead, it is read on a variety of platforms spanning computers and mobile devices. The limitations presented by different screen sizes, the lack of tactile feedback that comes from flipping between pages and inability to purely focus on the author’s arguments are problems present in all disciplines.

@edsu
edsu / gist:c95c9ae9f60ecdf80077
Last active January 21, 2016 15:46
Look up WikiData ID based using a Freebase ID. Possibly useful if you have lots of Freebase ids and want to turn them into WikiData ids when Freebase goes the way of the Dodo in June.
% curl --silent 'https://wdq.wmflabs.org/api?q=string\[646:/m/04hcw\]' | python -mjson.tool
{
"items": [
9391
],
"status": {
"error": "OK",
"items": 1,
"parsed_query": "STRING[646:'/m/04hcw']",
"querytime": "113ms"
@nickynicolson
nickynicolson / name-reconciliation-python.ipynb
Last active February 12, 2016 16:25
Name reconciliation in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jprante
jprante / jsonld.sh
Created December 7, 2012 10:03
JSON-LD in Elasticsearch
curl -XDELETE 'localhost:9200/jsonld'
curl -XPOST 'localhost:9200/jsonld'
curl -XPUT 'localhost:9200/jsonld/doc/1' -d '
{
"@context":
{
"dc": "http://purl.org/dc/elements/1.1/",
@rdmpage
rdmpage / primers.txt
Last active May 17, 2018 10:10
COI DNA barcode primer locations
Reference COI is NC_003128 Buteo buteo COI
TZBRD035-15.COI-5P [648bp] ctgatctttggtgnatgagcaggcatagccggcacagcacttagcctactaatccgcgcagaactaggacagccaggaacactattgggagacgaccaaatctacaatgtaatcgtaacagcccacgctttcgtcataatcttcttcatagtcatacctattatgatcggaggcttcggaaactgactggttccactcataattggcgccccagacatagcattcccccgcataaataatatgagcttctgactcctcccaccttcttttctcctcctactagcctcctctacagtagaagccggggctggcactggatgaactgtttatccacccctagccggtaatcttgcccacgcgggcgcatcagtagacctggctattttttcccttcacttggcaggcgtgtcgtccatcttaggagctattaactttatcaccacaattattaacataaagccccctgcactatcacaatatcaaacacccctcttcgtatgatccgtcctcattactgctatcctcttactactatccctgccagtcctagccgccgggattacaatactcctcaccgatcgcaacctcaacactacattctttgaccctgcaggaggaggagacccaatcctgtatcaacacctattc
TZBRD019-15.COI-5P tcttcggcgcctgagctggtatagtcggcaccgccctcagcttactcatccgtgcagaactcggccaacccggcacactcctaggtgacgaccaaatttataacgtaatcgttaccgcacatgccttcgtaataatcttcttcatagttataccaatcatgatcggaggattcggaaactgacttgttccactcataattggcgctc
910
1984
 DZRJ
-
()
(UB 19881)
(UB 19882)
(UFG 13985)
(UFG 13986)
*