Skip to content

Instantly share code, notes, and snippets.

View albertmeronyo's full-sized avatar

Albert Meroño-Peñuela albertmeronyo

View GitHub Profile

This is my first foobar gist

Section 1

Mwahaahaha

  • foo
  • bar
  • foobaz
  • baz
@albertmeronyo
albertmeronyo / StabilityAndVariationWorkshop
Created June 26, 2014 13:31
Notes taken during Berit Jansen's workshop "Stability and Variation, COntinuity and Change", Meertens Instituut, 26 June 2014
* Berit's Workshop: Stability and Variation, Continuity and Change
- Sophie Elpers: Generative concepts in vernacular architecture
- Common primary concepts in architecture independent of context
- Speak of 'architectural grammar': different unconscious rules
- Project COMPARE on Ducth farmhouses
- Marten van der Meulen Folgert Karsdorp: Black, Whie and Red: color
term salience in Thommpson's Motif Index
- Colors with an implication of hierarchy (i.e. more mentioned in
folk tales)
- momfer.ml
@albertmeronyo
albertmeronyo / STCN queries
Created August 14, 2014 14:39
Links to SGVizler visualizations making use of the STCN dataset from a remote SPARQL endpoint.
- Number of publications in 17th century http://bit.ly/10DH4ue
- Authors 17th century http://bit.ly/11CIbWf
- Publishers 17th century http://bit.ly/1azh7xT
- Reissuing publishers in 17th century http://bit.ly/182Fk0a
http://bit.ly/16TGGHs
- Subjects 17th century http://bit.ly/1c3hs9S
- Subjects with illustrations http://bit.ly/13XvmsQ
- List of Marteau-titles http://bit.ly/14mIpTq
- Temporal distribution of Marteau-titles http://bit.ly/19sV36v
- Reissues Marteau http://bit.ly/1071ZU6
@albertmeronyo
albertmeronyo / dyldo.sh
Last active April 23, 2017 10:19
Dyldo magic
#!/usr/bin/bash
wget -r -l2 --no-parent -A "data.nq.gz" http://swse.deri.org/dyldo/data/
for d in `ls`; do zcat $d/data.nq.gz | egrep -i "http://www.w3.org/2002/07/owl#Thing|http://www.w3.org/2000/01/rdf-schema#subClassOf|http://www.w3.org/1999/02/22-rdf-syntax-ns#type|http://www.w3.org/2000/01/rdf-schema#label" | gzip > $d/owldata.nq.gz ; done
for d in `ls`; do zcat $d/owldata.nq.gz | rev | cut -d" " -f2 | rev | sort | uniq > $d/owlNG; done
for d in `ls`; do cat $d/owlNG >> totalOWLNG; done
sort totalOWLNG | uniq -c | grep "144 <" | cut -d" " -f8 > totalUniqOWLNG
for d in `ls`; do for i in `seq 1 \`cat totalUniqNG | wc -l\``; do (zcat $d/owldata.nq.gz | grep -e `sed -n "$i{p;q}"` | gzip) > $i/$d-$i.nq.gz ; done; done
@albertmeronyo
albertmeronyo / oemlStats.sh
Last active August 29, 2015 14:15
OEML dataset stats
# totalSize
bzcat *hisco.nt.bz2 | wc -l
# nSnapshots
ls *hisco.nt.bz2 | wc -l
# nInserts (pair)
diff -u <(bzcat `ls *hisco.nt.bz2 | head -n6 | tail -n2 | head -n1` | sort) <(bzcat `ls *hisco.nt.bz2 | head -n6 | tail -n1` | sort) | grep ^+ | wc -l
# nDeletes (pair)
diff -u <(bzcat `ls *hisco.nt.bz2 | head -n6 | tail -n2 | head -n1` | sort) <(bzcat `ls *hisco.nt.bz2 | head -n6 | tail -n1` | sort) | grep ^- | wc -l
# nInserts (dataset)
for i in `seq 2 \`ls *hisco.nt.bz2 | wc -l\``; do diff -u <(bzcat `ls *hisco.nt.bz2 | head -n$i | tail -n2 | head -n1` | sort) <(bzcat `ls *hisco.nt.bz2 | head -n$i | tail -n1` | sort) | grep ^+ | wc -l; done
@albertmeronyo
albertmeronyo / nsMatrix.sh
Last active August 29, 2015 14:15
CLOD clusters
# Matching namespace index
for e in `cat nsCounts/402ecd52d22d648c48e28bfc59901b78 | cut -f1`; do grep -n -e "^$e$" totalNamespaces; done | cut -d":" -f1
# All documents namespace indexes
for d in `ls nsCounts`; do NS=$d; for e in `cat nsCounts/$d | cut -f1`; do NS=$NS,`grep -n -e "^$e$" totalNamespaces | cut -d":" -f1`; done; echo $NS >> nsPointers; done
# Standard deviation of matched observations
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX cedar: <http://bit.ly/cedar#>
PREFIX scry: <http://www.scry.com/>
PREFIX math: <http://www.scry.com/math/>
PREFIX input: <http://www.scry.com/input?>
SELECT *
WHERE {
@albertmeronyo
albertmeronyo / c-pearson.c
Last active April 12, 2016 18:23
SCRY statistical queries
/* Pearson's correlation coefficient */
#include <stdio.h>
#include <math.h>
int main() {
int x[100], y[100], xy[100], xsquare[100], ysquare[100];
int i, n, xsum, ysum, xysum, xsqr_sum, ysqr_sum;
float coeff, num, deno;
@albertmeronyo
albertmeronyo / sd.sparql
Created April 29, 2015 14:32
Standard deviation in (pure) SPARQL
SELECT ((SUM((?n - ?mean)*(?n - ?mean)))/(COUNT(?n) - 1) AS ?sdev) WHERE {
?obs qb:value ?n .
{
SELECT (AVG(?n) AS ?mean) WHERE {
?obs qb:value ?n .
}
}
@albertmeronyo
albertmeronyo / 1.sparql
Created April 30, 2015 19:30
SCRY paper queries
PREFIX scry:<http://www.scry.rocks/>
SELECT ?pau ?desc WHERE {
GRAPH scry:orb_description {
scry:orb scry:procedure ?pau .
?pau scry:description ?desc .
}
}