Skip to content

Instantly share code, notes, and snippets.

View erickpeirson's full-sized avatar
🟢

Erick erickpeirson

🟢
View GitHub Profile
@erickpeirson
erickpeirson / licenseCounts.json
Created August 23, 2018 13:05
arXiv License Selection (2015-01-01 through 2018-07-30)
{
"http://arxiv.org/licenses/nonexclusive-distrib/1.0/": 406647,
"http://creativecommons.org/licenses/by-nc-sa/3.0/": 485,
"http://creativecommons.org/licenses/by-nc-sa/4.0/": 3187,
"http://creativecommons.org/licenses/by-sa/4.0/": 857,
"http://creativecommons.org/licenses/by/3.0/": 766,
"http://creativecommons.org/licenses/by/4.0/": 6982,
"http://creativecommons.org/licenses/publicdomain/": 192,
"http://creativecommons.org/publicdomain/zero/1.0/": 1451
}
IGNORE = [
'/Users/brp53/projects/arxiv-bin/notify_reflink.pl',
'/Users/brp53/projects/arxiv-bin/notify_search.pl',
'/Users/brp53/projects/arxiv-submit/lib/arXiv/Controller/DocMeta.pm',
# Not our code.
'/Users/brp53/projects/arxiv-bin/aws/java/com/amazon/s3/AWSAuthConnection.java',
'/Users/brp53/projects/arxiv-bin/aws/java/com/amazon/s3/Bucket.java',
'/Users/brp53/projects/arxiv-bin/aws/java/com/amazon/s3/CallingFormat.java',
'/Users/brp53/projects/arxiv-bin/aws/java/com/amazon/s3/CommonPrefixEntry.java',
@erickpeirson
erickpeirson / arXiv-CLA-v1.0.md
Last active April 18, 2018 14:45
arXiv Contributor License Agreement v1.0

Thank you for your interest in arXiv. In order to clarify the intellectual property license granted with Contributions from any person or entity, arXiv must have a Contributor License Agreement ("CLA") on file that has been agreed to by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of arXiv and its users; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to arXiv. In return, arXiv shall not use Your Contributions in a way that is contrary to the public benefit or inconsistent with its operating principles in effect at the time of the Contribution. Except for the license granted herein to arXiv and recipients of software distributed by arXiv, You reserve all right, title, and interest in and to Your Contributions.

Contributor License Agreement

The following terms

upstream submit {
server 127.0.0.1:8001;
}
upstream auth {
server 127.0.0.1:8002;
}
server {
listen 8000;
@erickpeirson
erickpeirson / arxiv-reflink.conf
Last active July 14, 2017 17:22
mod_wsgi with Flask
from django.contrib.contenttypes.models import ContentType
from collections import Counter
import networkx as nx
def generate_collection_coauthor_graph(collection,
author_predicate_uri="http://purl.org/net/biblio#authors"):
"""
Create a graph describing co-occurrences of :class:`.ConceptEntity` instances
linked to individual :class:`.Resource` instances via an authorship
:class:`.Relation` instance.
<OAI-PMH xmlns:bib="http://purl.org/net/biblio#" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:prsmstndrd="http://prismstandard.org/namespaces/1.2/basic#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns"
xmlns:ztr="http://www.zotero.org/namespaces/export#" xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<responseDate>2016-09-09T19:41:07Z</responseDate>
<request verb="ListRecords" set="1" metadataPrefix="oai_dc">/oaipmh/</request>
<ListRecords>
<record>
<header>
@erickpeirson
erickpeirson / chains.png
Last active August 12, 2016 21:41
Change point model
chains.png
# I found this package called "reshape", and it looks useful:
# http://svitsrv25.epfl.ch/R-doc/library/reshape/html/00Index.html
library("reshape")
# Here are some jagged data with a shared column.
d1<-data.frame(primary=c(1, 2, 3, 4), foo='bar')
d2<-data.frame(primary=c(1,3,5), secret=42)
d3<-data.frame(primary=c(5, 3, 1, 20, 4), scout="scout")
d4<-data.frame(primary=c(6, 7, 20, 4), bat='baz')
d5<-data.frame(primary=c(1, 2, 3, 4, 5, 6, 7), pi=3.141592764)
import nltk
class AuthoritativeText(object):
original = ""
T = [] # Tokens.
P = [] # Paragraph start indices (in T).
S = [] # Sentence start indices (in T).
I = [] # Token start,end character position indices.
def __init__(self, text):